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::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate 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]: longrunning::model::Operation::result
69 /// [google.rpc.Status.code]: 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 pub fn new() -> Self {
80 std::default::Default::default()
81 }
82
83 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
84 ///
85 /// # Example
86 /// ```ignore,no_run
87 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
88 /// use wkt::Timestamp;
89 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
90 /// ```
91 pub fn set_create_time<T>(mut self, v: T) -> Self
92 where
93 T: std::convert::Into<wkt::Timestamp>,
94 {
95 self.create_time = std::option::Option::Some(v.into());
96 self
97 }
98
99 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
100 ///
101 /// # Example
102 /// ```ignore,no_run
103 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
104 /// use wkt::Timestamp;
105 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
106 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
107 /// ```
108 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
109 where
110 T: std::convert::Into<wkt::Timestamp>,
111 {
112 self.create_time = v.map(|x| x.into());
113 self
114 }
115
116 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
117 ///
118 /// # Example
119 /// ```ignore,no_run
120 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
121 /// use wkt::Timestamp;
122 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
123 /// ```
124 pub fn set_end_time<T>(mut self, v: T) -> Self
125 where
126 T: std::convert::Into<wkt::Timestamp>,
127 {
128 self.end_time = std::option::Option::Some(v.into());
129 self
130 }
131
132 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
133 ///
134 /// # Example
135 /// ```ignore,no_run
136 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
137 /// use wkt::Timestamp;
138 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
139 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
140 /// ```
141 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
142 where
143 T: std::convert::Into<wkt::Timestamp>,
144 {
145 self.end_time = v.map(|x| x.into());
146 self
147 }
148
149 /// Sets the value of [target][crate::model::OperationMetadata::target].
150 ///
151 /// # Example
152 /// ```ignore,no_run
153 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
154 /// let x = OperationMetadata::new().set_target("example");
155 /// ```
156 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
157 self.target = v.into();
158 self
159 }
160
161 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
162 ///
163 /// # Example
164 /// ```ignore,no_run
165 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
166 /// let x = OperationMetadata::new().set_verb("example");
167 /// ```
168 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
169 self.verb = v.into();
170 self
171 }
172
173 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
174 ///
175 /// # Example
176 /// ```ignore,no_run
177 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
178 /// let x = OperationMetadata::new().set_status_message("example");
179 /// ```
180 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
181 self.status_message = v.into();
182 self
183 }
184
185 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
186 ///
187 /// # Example
188 /// ```ignore,no_run
189 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
190 /// let x = OperationMetadata::new().set_requested_cancellation(true);
191 /// ```
192 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
193 self.requested_cancellation = v.into();
194 self
195 }
196
197 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
198 ///
199 /// # Example
200 /// ```ignore,no_run
201 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
202 /// let x = OperationMetadata::new().set_api_version("example");
203 /// ```
204 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
205 self.api_version = v.into();
206 self
207 }
208}
209
210impl wkt::message::Message for OperationMetadata {
211 fn typename() -> &'static str {
212 "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata"
213 }
214}
215
216/// The ServiceConnectionMap resource.
217#[derive(Clone, Default, PartialEq)]
218#[non_exhaustive]
219pub struct ServiceConnectionMap {
220 /// Immutable. The name of a ServiceConnectionMap.
221 /// Format:
222 /// projects/{project}/locations/{location}/serviceConnectionMaps/{service_connection_map}
223 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
224 pub name: std::string::String,
225
226 /// Output only. Time when the ServiceConnectionMap was created.
227 pub create_time: std::option::Option<wkt::Timestamp>,
228
229 /// Output only. Time when the ServiceConnectionMap was updated.
230 pub update_time: std::option::Option<wkt::Timestamp>,
231
232 /// User-defined labels.
233 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
234
235 /// A description of this resource.
236 pub description: std::string::String,
237
238 /// The service class identifier this ServiceConnectionMap is for.
239 /// The user of ServiceConnectionMap create API needs to have
240 /// networkconnecitivty.serviceclasses.use iam permission for the service
241 /// class.
242 pub service_class: std::string::String,
243
244 /// Output only. The service class uri this ServiceConnectionMap is for.
245 pub service_class_uri: std::string::String,
246
247 /// Output only. The infrastructure used for connections between
248 /// consumers/producers.
249 pub infrastructure: crate::model::Infrastructure,
250
251 /// The PSC configurations on producer side.
252 pub producer_psc_configs:
253 std::vec::Vec<crate::model::service_connection_map::ProducerPscConfig>,
254
255 /// The PSC configurations on consumer side.
256 pub consumer_psc_configs:
257 std::vec::Vec<crate::model::service_connection_map::ConsumerPscConfig>,
258
259 /// Output only. PSC connection details on consumer side.
260 pub consumer_psc_connections:
261 std::vec::Vec<crate::model::service_connection_map::ConsumerPscConnection>,
262
263 /// The token provided by the consumer. This token authenticates that the
264 /// consumer can create a connection within the specified project and network.
265 pub token: std::string::String,
266
267 /// Optional. The etag is computed by the server, and may be sent on update and
268 /// delete requests to ensure the client has an up-to-date value before
269 /// proceeding.
270 pub etag: std::option::Option<std::string::String>,
271
272 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
273}
274
275impl ServiceConnectionMap {
276 pub fn new() -> Self {
277 std::default::Default::default()
278 }
279
280 /// Sets the value of [name][crate::model::ServiceConnectionMap::name].
281 ///
282 /// # Example
283 /// ```ignore,no_run
284 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
285 /// let x = ServiceConnectionMap::new().set_name("example");
286 /// ```
287 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
288 self.name = v.into();
289 self
290 }
291
292 /// Sets the value of [create_time][crate::model::ServiceConnectionMap::create_time].
293 ///
294 /// # Example
295 /// ```ignore,no_run
296 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
297 /// use wkt::Timestamp;
298 /// let x = ServiceConnectionMap::new().set_create_time(Timestamp::default()/* use setters */);
299 /// ```
300 pub fn set_create_time<T>(mut self, v: T) -> Self
301 where
302 T: std::convert::Into<wkt::Timestamp>,
303 {
304 self.create_time = std::option::Option::Some(v.into());
305 self
306 }
307
308 /// Sets or clears the value of [create_time][crate::model::ServiceConnectionMap::create_time].
309 ///
310 /// # Example
311 /// ```ignore,no_run
312 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
313 /// use wkt::Timestamp;
314 /// let x = ServiceConnectionMap::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
315 /// let x = ServiceConnectionMap::new().set_or_clear_create_time(None::<Timestamp>);
316 /// ```
317 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
318 where
319 T: std::convert::Into<wkt::Timestamp>,
320 {
321 self.create_time = v.map(|x| x.into());
322 self
323 }
324
325 /// Sets the value of [update_time][crate::model::ServiceConnectionMap::update_time].
326 ///
327 /// # Example
328 /// ```ignore,no_run
329 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
330 /// use wkt::Timestamp;
331 /// let x = ServiceConnectionMap::new().set_update_time(Timestamp::default()/* use setters */);
332 /// ```
333 pub fn set_update_time<T>(mut self, v: T) -> Self
334 where
335 T: std::convert::Into<wkt::Timestamp>,
336 {
337 self.update_time = std::option::Option::Some(v.into());
338 self
339 }
340
341 /// Sets or clears the value of [update_time][crate::model::ServiceConnectionMap::update_time].
342 ///
343 /// # Example
344 /// ```ignore,no_run
345 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
346 /// use wkt::Timestamp;
347 /// let x = ServiceConnectionMap::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
348 /// let x = ServiceConnectionMap::new().set_or_clear_update_time(None::<Timestamp>);
349 /// ```
350 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
351 where
352 T: std::convert::Into<wkt::Timestamp>,
353 {
354 self.update_time = v.map(|x| x.into());
355 self
356 }
357
358 /// Sets the value of [labels][crate::model::ServiceConnectionMap::labels].
359 ///
360 /// # Example
361 /// ```ignore,no_run
362 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
363 /// let x = ServiceConnectionMap::new().set_labels([
364 /// ("key0", "abc"),
365 /// ("key1", "xyz"),
366 /// ]);
367 /// ```
368 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
369 where
370 T: std::iter::IntoIterator<Item = (K, V)>,
371 K: std::convert::Into<std::string::String>,
372 V: std::convert::Into<std::string::String>,
373 {
374 use std::iter::Iterator;
375 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
376 self
377 }
378
379 /// Sets the value of [description][crate::model::ServiceConnectionMap::description].
380 ///
381 /// # Example
382 /// ```ignore,no_run
383 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
384 /// let x = ServiceConnectionMap::new().set_description("example");
385 /// ```
386 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
387 self.description = v.into();
388 self
389 }
390
391 /// Sets the value of [service_class][crate::model::ServiceConnectionMap::service_class].
392 ///
393 /// # Example
394 /// ```ignore,no_run
395 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
396 /// let x = ServiceConnectionMap::new().set_service_class("example");
397 /// ```
398 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
399 self.service_class = v.into();
400 self
401 }
402
403 /// Sets the value of [service_class_uri][crate::model::ServiceConnectionMap::service_class_uri].
404 ///
405 /// # Example
406 /// ```ignore,no_run
407 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
408 /// let x = ServiceConnectionMap::new().set_service_class_uri("example");
409 /// ```
410 pub fn set_service_class_uri<T: std::convert::Into<std::string::String>>(
411 mut self,
412 v: T,
413 ) -> Self {
414 self.service_class_uri = v.into();
415 self
416 }
417
418 /// Sets the value of [infrastructure][crate::model::ServiceConnectionMap::infrastructure].
419 ///
420 /// # Example
421 /// ```ignore,no_run
422 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
423 /// use google_cloud_networkconnectivity_v1::model::Infrastructure;
424 /// let x0 = ServiceConnectionMap::new().set_infrastructure(Infrastructure::Psc);
425 /// ```
426 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
427 mut self,
428 v: T,
429 ) -> Self {
430 self.infrastructure = v.into();
431 self
432 }
433
434 /// Sets the value of [producer_psc_configs][crate::model::ServiceConnectionMap::producer_psc_configs].
435 ///
436 /// # Example
437 /// ```ignore,no_run
438 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
439 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ProducerPscConfig;
440 /// let x = ServiceConnectionMap::new()
441 /// .set_producer_psc_configs([
442 /// ProducerPscConfig::default()/* use setters */,
443 /// ProducerPscConfig::default()/* use (different) setters */,
444 /// ]);
445 /// ```
446 pub fn set_producer_psc_configs<T, V>(mut self, v: T) -> Self
447 where
448 T: std::iter::IntoIterator<Item = V>,
449 V: std::convert::Into<crate::model::service_connection_map::ProducerPscConfig>,
450 {
451 use std::iter::Iterator;
452 self.producer_psc_configs = v.into_iter().map(|i| i.into()).collect();
453 self
454 }
455
456 /// Sets the value of [consumer_psc_configs][crate::model::ServiceConnectionMap::consumer_psc_configs].
457 ///
458 /// # Example
459 /// ```ignore,no_run
460 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
461 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
462 /// let x = ServiceConnectionMap::new()
463 /// .set_consumer_psc_configs([
464 /// ConsumerPscConfig::default()/* use setters */,
465 /// ConsumerPscConfig::default()/* use (different) setters */,
466 /// ]);
467 /// ```
468 pub fn set_consumer_psc_configs<T, V>(mut self, v: T) -> Self
469 where
470 T: std::iter::IntoIterator<Item = V>,
471 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConfig>,
472 {
473 use std::iter::Iterator;
474 self.consumer_psc_configs = v.into_iter().map(|i| i.into()).collect();
475 self
476 }
477
478 /// Sets the value of [consumer_psc_connections][crate::model::ServiceConnectionMap::consumer_psc_connections].
479 ///
480 /// # Example
481 /// ```ignore,no_run
482 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
483 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
484 /// let x = ServiceConnectionMap::new()
485 /// .set_consumer_psc_connections([
486 /// ConsumerPscConnection::default()/* use setters */,
487 /// ConsumerPscConnection::default()/* use (different) setters */,
488 /// ]);
489 /// ```
490 pub fn set_consumer_psc_connections<T, V>(mut self, v: T) -> Self
491 where
492 T: std::iter::IntoIterator<Item = V>,
493 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConnection>,
494 {
495 use std::iter::Iterator;
496 self.consumer_psc_connections = v.into_iter().map(|i| i.into()).collect();
497 self
498 }
499
500 /// Sets the value of [token][crate::model::ServiceConnectionMap::token].
501 ///
502 /// # Example
503 /// ```ignore,no_run
504 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
505 /// let x = ServiceConnectionMap::new().set_token("example");
506 /// ```
507 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
508 self.token = v.into();
509 self
510 }
511
512 /// Sets the value of [etag][crate::model::ServiceConnectionMap::etag].
513 ///
514 /// # Example
515 /// ```ignore,no_run
516 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
517 /// let x = ServiceConnectionMap::new().set_etag("example");
518 /// ```
519 pub fn set_etag<T>(mut self, v: T) -> Self
520 where
521 T: std::convert::Into<std::string::String>,
522 {
523 self.etag = std::option::Option::Some(v.into());
524 self
525 }
526
527 /// Sets or clears the value of [etag][crate::model::ServiceConnectionMap::etag].
528 ///
529 /// # Example
530 /// ```ignore,no_run
531 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
532 /// let x = ServiceConnectionMap::new().set_or_clear_etag(Some("example"));
533 /// let x = ServiceConnectionMap::new().set_or_clear_etag(None::<String>);
534 /// ```
535 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
536 where
537 T: std::convert::Into<std::string::String>,
538 {
539 self.etag = v.map(|x| x.into());
540 self
541 }
542}
543
544impl wkt::message::Message for ServiceConnectionMap {
545 fn typename() -> &'static str {
546 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap"
547 }
548}
549
550/// Defines additional types related to [ServiceConnectionMap].
551pub mod service_connection_map {
552 #[allow(unused_imports)]
553 use super::*;
554
555 /// The PSC configurations on producer side.
556 #[derive(Clone, Default, PartialEq)]
557 #[non_exhaustive]
558 pub struct ProducerPscConfig {
559 /// The resource path of a service attachment.
560 /// Example:
561 /// projects/{projectNumOrId}/regions/{region}/serviceAttachments/{resourceId}.
562 pub service_attachment_uri: std::string::String,
563
564 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
565 }
566
567 impl ProducerPscConfig {
568 pub fn new() -> Self {
569 std::default::Default::default()
570 }
571
572 /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ProducerPscConfig::service_attachment_uri].
573 ///
574 /// # Example
575 /// ```ignore,no_run
576 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ProducerPscConfig;
577 /// let x = ProducerPscConfig::new().set_service_attachment_uri("example");
578 /// ```
579 pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
580 mut self,
581 v: T,
582 ) -> Self {
583 self.service_attachment_uri = v.into();
584 self
585 }
586 }
587
588 impl wkt::message::Message for ProducerPscConfig {
589 fn typename() -> &'static str {
590 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ProducerPscConfig"
591 }
592 }
593
594 /// Allow the producer to specify which consumers can connect to it.
595 #[derive(Clone, Default, PartialEq)]
596 #[non_exhaustive]
597 pub struct ConsumerPscConfig {
598 /// The consumer project where PSC connections are allowed to be created in.
599 pub project: std::string::String,
600
601 /// The resource path of the consumer network where PSC connections are
602 /// allowed to be created in. Note, this network does not need be in the
603 /// ConsumerPscConfig.project in the case of SharedVPC.
604 /// Example:
605 /// projects/{projectNumOrId}/global/networks/{networkId}.
606 pub network: std::string::String,
607
608 /// This is used in PSC consumer ForwardingRule to control whether the PSC
609 /// endpoint can be accessed from another region.
610 pub disable_global_access: bool,
611
612 /// Output only. Overall state of PSC Connections management for this
613 /// consumer psc config.
614 pub state: crate::model::service_connection_map::consumer_psc_config::State,
615
616 /// Immutable. Deprecated. Use producer_instance_metadata instead.
617 /// An immutable identifier for the producer instance.
618 #[deprecated]
619 pub producer_instance_id: std::string::String,
620
621 /// Output only. A map to store mapping between customer vip and target
622 /// service attachment. Only service attachment with producer specified ip
623 /// addresses are stored here.
624 pub service_attachment_ip_address_map:
625 std::collections::HashMap<std::string::String, std::string::String>,
626
627 /// Required. The project ID or project number of the consumer project. This
628 /// project is the one that the consumer uses to interact with the producer
629 /// instance. From the perspective of a consumer who's created a producer
630 /// instance, this is the project of the producer instance. Format:
631 /// 'projects/<project_id_or_number>' Eg. 'projects/consumer-project' or
632 /// 'projects/1234'
633 pub consumer_instance_project: std::string::String,
634
635 /// Immutable. An immutable map for the producer instance metadata.
636 pub producer_instance_metadata:
637 std::collections::HashMap<std::string::String, std::string::String>,
638
639 /// The requested IP version for the PSC connection.
640 pub ip_version: std::option::Option<crate::model::IPVersion>,
641
642 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
643 }
644
645 impl ConsumerPscConfig {
646 pub fn new() -> Self {
647 std::default::Default::default()
648 }
649
650 /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConfig::project].
651 ///
652 /// # Example
653 /// ```ignore,no_run
654 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
655 /// let x = ConsumerPscConfig::new().set_project("example");
656 /// ```
657 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
658 self.project = v.into();
659 self
660 }
661
662 /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConfig::network].
663 ///
664 /// # Example
665 /// ```ignore,no_run
666 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
667 /// let x = ConsumerPscConfig::new().set_network("example");
668 /// ```
669 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
670 self.network = v.into();
671 self
672 }
673
674 /// Sets the value of [disable_global_access][crate::model::service_connection_map::ConsumerPscConfig::disable_global_access].
675 ///
676 /// # Example
677 /// ```ignore,no_run
678 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
679 /// let x = ConsumerPscConfig::new().set_disable_global_access(true);
680 /// ```
681 pub fn set_disable_global_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
682 self.disable_global_access = v.into();
683 self
684 }
685
686 /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConfig::state].
687 ///
688 /// # Example
689 /// ```ignore,no_run
690 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
691 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::consumer_psc_config::State;
692 /// let x0 = ConsumerPscConfig::new().set_state(State::Valid);
693 /// let x1 = ConsumerPscConfig::new().set_state(State::ConnectionPolicyMissing);
694 /// let x2 = ConsumerPscConfig::new().set_state(State::PolicyLimitReached);
695 /// ```
696 pub fn set_state<
697 T: std::convert::Into<crate::model::service_connection_map::consumer_psc_config::State>,
698 >(
699 mut self,
700 v: T,
701 ) -> Self {
702 self.state = v.into();
703 self
704 }
705
706 /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_id].
707 ///
708 /// # Example
709 /// ```ignore,no_run
710 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
711 /// let x = ConsumerPscConfig::new().set_producer_instance_id("example");
712 /// ```
713 #[deprecated]
714 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
715 mut self,
716 v: T,
717 ) -> Self {
718 self.producer_instance_id = v.into();
719 self
720 }
721
722 /// Sets the value of [service_attachment_ip_address_map][crate::model::service_connection_map::ConsumerPscConfig::service_attachment_ip_address_map].
723 ///
724 /// # Example
725 /// ```ignore,no_run
726 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
727 /// let x = ConsumerPscConfig::new().set_service_attachment_ip_address_map([
728 /// ("key0", "abc"),
729 /// ("key1", "xyz"),
730 /// ]);
731 /// ```
732 pub fn set_service_attachment_ip_address_map<T, K, V>(mut self, v: T) -> Self
733 where
734 T: std::iter::IntoIterator<Item = (K, V)>,
735 K: std::convert::Into<std::string::String>,
736 V: std::convert::Into<std::string::String>,
737 {
738 use std::iter::Iterator;
739 self.service_attachment_ip_address_map =
740 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
741 self
742 }
743
744 /// Sets the value of [consumer_instance_project][crate::model::service_connection_map::ConsumerPscConfig::consumer_instance_project].
745 ///
746 /// # Example
747 /// ```ignore,no_run
748 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
749 /// let x = ConsumerPscConfig::new().set_consumer_instance_project("example");
750 /// ```
751 pub fn set_consumer_instance_project<T: std::convert::Into<std::string::String>>(
752 mut self,
753 v: T,
754 ) -> Self {
755 self.consumer_instance_project = v.into();
756 self
757 }
758
759 /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_metadata].
760 ///
761 /// # Example
762 /// ```ignore,no_run
763 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
764 /// let x = ConsumerPscConfig::new().set_producer_instance_metadata([
765 /// ("key0", "abc"),
766 /// ("key1", "xyz"),
767 /// ]);
768 /// ```
769 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
770 where
771 T: std::iter::IntoIterator<Item = (K, V)>,
772 K: std::convert::Into<std::string::String>,
773 V: std::convert::Into<std::string::String>,
774 {
775 use std::iter::Iterator;
776 self.producer_instance_metadata =
777 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
778 self
779 }
780
781 /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
782 ///
783 /// # Example
784 /// ```ignore,no_run
785 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
786 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
787 /// let x0 = ConsumerPscConfig::new().set_ip_version(IPVersion::Ipv4);
788 /// let x1 = ConsumerPscConfig::new().set_ip_version(IPVersion::Ipv6);
789 /// ```
790 pub fn set_ip_version<T>(mut self, v: T) -> Self
791 where
792 T: std::convert::Into<crate::model::IPVersion>,
793 {
794 self.ip_version = std::option::Option::Some(v.into());
795 self
796 }
797
798 /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
799 ///
800 /// # Example
801 /// ```ignore,no_run
802 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
803 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
804 /// let x0 = ConsumerPscConfig::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
805 /// let x1 = ConsumerPscConfig::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
806 /// let x_none = ConsumerPscConfig::new().set_or_clear_ip_version(None::<IPVersion>);
807 /// ```
808 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
809 where
810 T: std::convert::Into<crate::model::IPVersion>,
811 {
812 self.ip_version = v.map(|x| x.into());
813 self
814 }
815 }
816
817 impl wkt::message::Message for ConsumerPscConfig {
818 fn typename() -> &'static str {
819 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig"
820 }
821 }
822
823 /// Defines additional types related to [ConsumerPscConfig].
824 pub mod consumer_psc_config {
825 #[allow(unused_imports)]
826 use super::*;
827
828 /// PSC Consumer Config State.
829 ///
830 /// # Working with unknown values
831 ///
832 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
833 /// additional enum variants at any time. Adding new variants is not considered
834 /// a breaking change. Applications should write their code in anticipation of:
835 ///
836 /// - New values appearing in future releases of the client library, **and**
837 /// - New values received dynamically, without application changes.
838 ///
839 /// Please consult the [Working with enums] section in the user guide for some
840 /// guidelines.
841 ///
842 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
843 #[derive(Clone, Debug, PartialEq)]
844 #[non_exhaustive]
845 pub enum State {
846 /// Default state, when Connection Map is created initially.
847 Unspecified,
848 /// Set when policy and map configuration is valid,
849 /// and their matching can lead to allowing creation of PSC Connections
850 /// subject to other constraints like connections limit.
851 Valid,
852 /// No Service Connection Policy found for this network and Service
853 /// Class
854 ConnectionPolicyMissing,
855 /// Service Connection Policy limit reached for this network and Service
856 /// Class
857 PolicyLimitReached,
858 /// The consumer instance project is not in
859 /// AllowedGoogleProducersResourceHierarchyLevels of the matching
860 /// ServiceConnectionPolicy.
861 ConsumerInstanceProjectNotAllowlisted,
862 /// If set, the enum was initialized with an unknown value.
863 ///
864 /// Applications can examine the value using [State::value] or
865 /// [State::name].
866 UnknownValue(state::UnknownValue),
867 }
868
869 #[doc(hidden)]
870 pub mod state {
871 #[allow(unused_imports)]
872 use super::*;
873 #[derive(Clone, Debug, PartialEq)]
874 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
875 }
876
877 impl State {
878 /// Gets the enum value.
879 ///
880 /// Returns `None` if the enum contains an unknown value deserialized from
881 /// the string representation of enums.
882 pub fn value(&self) -> std::option::Option<i32> {
883 match self {
884 Self::Unspecified => std::option::Option::Some(0),
885 Self::Valid => std::option::Option::Some(1),
886 Self::ConnectionPolicyMissing => std::option::Option::Some(2),
887 Self::PolicyLimitReached => std::option::Option::Some(3),
888 Self::ConsumerInstanceProjectNotAllowlisted => std::option::Option::Some(4),
889 Self::UnknownValue(u) => u.0.value(),
890 }
891 }
892
893 /// Gets the enum value as a string.
894 ///
895 /// Returns `None` if the enum contains an unknown value deserialized from
896 /// the integer representation of enums.
897 pub fn name(&self) -> std::option::Option<&str> {
898 match self {
899 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
900 Self::Valid => std::option::Option::Some("VALID"),
901 Self::ConnectionPolicyMissing => {
902 std::option::Option::Some("CONNECTION_POLICY_MISSING")
903 }
904 Self::PolicyLimitReached => std::option::Option::Some("POLICY_LIMIT_REACHED"),
905 Self::ConsumerInstanceProjectNotAllowlisted => {
906 std::option::Option::Some("CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED")
907 }
908 Self::UnknownValue(u) => u.0.name(),
909 }
910 }
911 }
912
913 impl std::default::Default for State {
914 fn default() -> Self {
915 use std::convert::From;
916 Self::from(0)
917 }
918 }
919
920 impl std::fmt::Display for State {
921 fn fmt(
922 &self,
923 f: &mut std::fmt::Formatter<'_>,
924 ) -> std::result::Result<(), std::fmt::Error> {
925 wkt::internal::display_enum(f, self.name(), self.value())
926 }
927 }
928
929 impl std::convert::From<i32> for State {
930 fn from(value: i32) -> Self {
931 match value {
932 0 => Self::Unspecified,
933 1 => Self::Valid,
934 2 => Self::ConnectionPolicyMissing,
935 3 => Self::PolicyLimitReached,
936 4 => Self::ConsumerInstanceProjectNotAllowlisted,
937 _ => Self::UnknownValue(state::UnknownValue(
938 wkt::internal::UnknownEnumValue::Integer(value),
939 )),
940 }
941 }
942 }
943
944 impl std::convert::From<&str> for State {
945 fn from(value: &str) -> Self {
946 use std::string::ToString;
947 match value {
948 "STATE_UNSPECIFIED" => Self::Unspecified,
949 "VALID" => Self::Valid,
950 "CONNECTION_POLICY_MISSING" => Self::ConnectionPolicyMissing,
951 "POLICY_LIMIT_REACHED" => Self::PolicyLimitReached,
952 "CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" => {
953 Self::ConsumerInstanceProjectNotAllowlisted
954 }
955 _ => Self::UnknownValue(state::UnknownValue(
956 wkt::internal::UnknownEnumValue::String(value.to_string()),
957 )),
958 }
959 }
960 }
961
962 impl serde::ser::Serialize for State {
963 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
964 where
965 S: serde::Serializer,
966 {
967 match self {
968 Self::Unspecified => serializer.serialize_i32(0),
969 Self::Valid => serializer.serialize_i32(1),
970 Self::ConnectionPolicyMissing => serializer.serialize_i32(2),
971 Self::PolicyLimitReached => serializer.serialize_i32(3),
972 Self::ConsumerInstanceProjectNotAllowlisted => serializer.serialize_i32(4),
973 Self::UnknownValue(u) => u.0.serialize(serializer),
974 }
975 }
976 }
977
978 impl<'de> serde::de::Deserialize<'de> for State {
979 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
980 where
981 D: serde::Deserializer<'de>,
982 {
983 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
984 ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig.State"))
985 }
986 }
987 }
988
989 /// PSC connection details on consumer side.
990 #[derive(Clone, Default, PartialEq)]
991 #[non_exhaustive]
992 pub struct ConsumerPscConnection {
993 /// The URI of a service attachment which is the target of the PSC
994 /// connection.
995 pub service_attachment_uri: std::string::String,
996
997 /// The state of the PSC connection.
998 pub state: crate::model::service_connection_map::consumer_psc_connection::State,
999
1000 /// The consumer project whose PSC forwarding rule is connected to the
1001 /// service attachments in this service connection map.
1002 pub project: std::string::String,
1003
1004 /// The consumer network whose PSC forwarding rule is connected to the
1005 /// service attachments in this service connection map.
1006 /// Note that the network could be on a different project (shared VPC).
1007 pub network: std::string::String,
1008
1009 /// The PSC connection id of the PSC forwarding rule connected
1010 /// to the service attachments in this service connection map.
1011 pub psc_connection_id: std::string::String,
1012
1013 /// The IP literal allocated on the consumer network for the PSC forwarding
1014 /// rule that is created to connect to the producer service attachment in
1015 /// this service connection map.
1016 pub ip: std::string::String,
1017
1018 /// The error type indicates whether the error is consumer facing, producer
1019 /// facing or system internal.
1020 #[deprecated]
1021 pub error_type: crate::model::ConnectionErrorType,
1022
1023 /// The most recent error during operating this connection.
1024 #[deprecated]
1025 pub error: std::option::Option<rpc::model::Status>,
1026
1027 /// The last Compute Engine operation to setup PSC connection.
1028 pub gce_operation: std::string::String,
1029
1030 /// The URI of the consumer forwarding rule created.
1031 /// Example:
1032 /// projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.
1033 pub forwarding_rule: std::string::String,
1034
1035 /// Output only. The error info for the latest error during operating this
1036 /// connection.
1037 pub error_info: std::option::Option<rpc::model::ErrorInfo>,
1038
1039 /// Output only. The URI of the selected subnetwork selected to allocate IP
1040 /// address for this connection.
1041 pub selected_subnetwork: std::string::String,
1042
1043 /// Immutable. Deprecated. Use producer_instance_metadata instead.
1044 /// An immutable identifier for the producer instance.
1045 #[deprecated]
1046 pub producer_instance_id: std::string::String,
1047
1048 /// Immutable. An immutable map for the producer instance metadata.
1049 pub producer_instance_metadata:
1050 std::collections::HashMap<std::string::String, std::string::String>,
1051
1052 /// The requested IP version for the PSC connection.
1053 pub ip_version: std::option::Option<crate::model::IPVersion>,
1054
1055 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1056 }
1057
1058 impl ConsumerPscConnection {
1059 pub fn new() -> Self {
1060 std::default::Default::default()
1061 }
1062
1063 /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ConsumerPscConnection::service_attachment_uri].
1064 ///
1065 /// # Example
1066 /// ```ignore,no_run
1067 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1068 /// let x = ConsumerPscConnection::new().set_service_attachment_uri("example");
1069 /// ```
1070 pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
1071 mut self,
1072 v: T,
1073 ) -> Self {
1074 self.service_attachment_uri = v.into();
1075 self
1076 }
1077
1078 /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConnection::state].
1079 ///
1080 /// # Example
1081 /// ```ignore,no_run
1082 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1083 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::consumer_psc_connection::State;
1084 /// let x0 = ConsumerPscConnection::new().set_state(State::Active);
1085 /// let x1 = ConsumerPscConnection::new().set_state(State::Failed);
1086 /// let x2 = ConsumerPscConnection::new().set_state(State::Creating);
1087 /// ```
1088 pub fn set_state<
1089 T: std::convert::Into<
1090 crate::model::service_connection_map::consumer_psc_connection::State,
1091 >,
1092 >(
1093 mut self,
1094 v: T,
1095 ) -> Self {
1096 self.state = v.into();
1097 self
1098 }
1099
1100 /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConnection::project].
1101 ///
1102 /// # Example
1103 /// ```ignore,no_run
1104 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1105 /// let x = ConsumerPscConnection::new().set_project("example");
1106 /// ```
1107 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1108 self.project = v.into();
1109 self
1110 }
1111
1112 /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConnection::network].
1113 ///
1114 /// # Example
1115 /// ```ignore,no_run
1116 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1117 /// let x = ConsumerPscConnection::new().set_network("example");
1118 /// ```
1119 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1120 self.network = v.into();
1121 self
1122 }
1123
1124 /// Sets the value of [psc_connection_id][crate::model::service_connection_map::ConsumerPscConnection::psc_connection_id].
1125 ///
1126 /// # Example
1127 /// ```ignore,no_run
1128 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1129 /// let x = ConsumerPscConnection::new().set_psc_connection_id("example");
1130 /// ```
1131 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
1132 mut self,
1133 v: T,
1134 ) -> Self {
1135 self.psc_connection_id = v.into();
1136 self
1137 }
1138
1139 /// Sets the value of [ip][crate::model::service_connection_map::ConsumerPscConnection::ip].
1140 ///
1141 /// # Example
1142 /// ```ignore,no_run
1143 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1144 /// let x = ConsumerPscConnection::new().set_ip("example");
1145 /// ```
1146 pub fn set_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1147 self.ip = v.into();
1148 self
1149 }
1150
1151 /// Sets the value of [error_type][crate::model::service_connection_map::ConsumerPscConnection::error_type].
1152 ///
1153 /// # Example
1154 /// ```ignore,no_run
1155 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1156 /// use google_cloud_networkconnectivity_v1::model::ConnectionErrorType;
1157 /// let x0 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorInternal);
1158 /// let x1 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorConsumerSide);
1159 /// let x2 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorProducerSide);
1160 /// ```
1161 #[deprecated]
1162 pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
1163 mut self,
1164 v: T,
1165 ) -> Self {
1166 self.error_type = v.into();
1167 self
1168 }
1169
1170 /// Sets the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
1171 ///
1172 /// # Example
1173 /// ```ignore,no_run
1174 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1175 /// use rpc::model::Status;
1176 /// let x = ConsumerPscConnection::new().set_error(Status::default()/* use setters */);
1177 /// ```
1178 #[deprecated]
1179 pub fn set_error<T>(mut self, v: T) -> Self
1180 where
1181 T: std::convert::Into<rpc::model::Status>,
1182 {
1183 self.error = std::option::Option::Some(v.into());
1184 self
1185 }
1186
1187 /// Sets or clears the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
1188 ///
1189 /// # Example
1190 /// ```ignore,no_run
1191 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1192 /// use rpc::model::Status;
1193 /// let x = ConsumerPscConnection::new().set_or_clear_error(Some(Status::default()/* use setters */));
1194 /// let x = ConsumerPscConnection::new().set_or_clear_error(None::<Status>);
1195 /// ```
1196 #[deprecated]
1197 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1198 where
1199 T: std::convert::Into<rpc::model::Status>,
1200 {
1201 self.error = v.map(|x| x.into());
1202 self
1203 }
1204
1205 /// Sets the value of [gce_operation][crate::model::service_connection_map::ConsumerPscConnection::gce_operation].
1206 ///
1207 /// # Example
1208 /// ```ignore,no_run
1209 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1210 /// let x = ConsumerPscConnection::new().set_gce_operation("example");
1211 /// ```
1212 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
1213 mut self,
1214 v: T,
1215 ) -> Self {
1216 self.gce_operation = v.into();
1217 self
1218 }
1219
1220 /// Sets the value of [forwarding_rule][crate::model::service_connection_map::ConsumerPscConnection::forwarding_rule].
1221 ///
1222 /// # Example
1223 /// ```ignore,no_run
1224 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1225 /// let x = ConsumerPscConnection::new().set_forwarding_rule("example");
1226 /// ```
1227 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(
1228 mut self,
1229 v: T,
1230 ) -> Self {
1231 self.forwarding_rule = v.into();
1232 self
1233 }
1234
1235 /// Sets the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
1236 ///
1237 /// # Example
1238 /// ```ignore,no_run
1239 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1240 /// use rpc::model::ErrorInfo;
1241 /// let x = ConsumerPscConnection::new().set_error_info(ErrorInfo::default()/* use setters */);
1242 /// ```
1243 pub fn set_error_info<T>(mut self, v: T) -> Self
1244 where
1245 T: std::convert::Into<rpc::model::ErrorInfo>,
1246 {
1247 self.error_info = std::option::Option::Some(v.into());
1248 self
1249 }
1250
1251 /// Sets or clears the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
1252 ///
1253 /// # Example
1254 /// ```ignore,no_run
1255 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1256 /// use rpc::model::ErrorInfo;
1257 /// let x = ConsumerPscConnection::new().set_or_clear_error_info(Some(ErrorInfo::default()/* use setters */));
1258 /// let x = ConsumerPscConnection::new().set_or_clear_error_info(None::<ErrorInfo>);
1259 /// ```
1260 pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
1261 where
1262 T: std::convert::Into<rpc::model::ErrorInfo>,
1263 {
1264 self.error_info = v.map(|x| x.into());
1265 self
1266 }
1267
1268 /// Sets the value of [selected_subnetwork][crate::model::service_connection_map::ConsumerPscConnection::selected_subnetwork].
1269 ///
1270 /// # Example
1271 /// ```ignore,no_run
1272 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1273 /// let x = ConsumerPscConnection::new().set_selected_subnetwork("example");
1274 /// ```
1275 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
1276 mut self,
1277 v: T,
1278 ) -> Self {
1279 self.selected_subnetwork = v.into();
1280 self
1281 }
1282
1283 /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_id].
1284 ///
1285 /// # Example
1286 /// ```ignore,no_run
1287 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1288 /// let x = ConsumerPscConnection::new().set_producer_instance_id("example");
1289 /// ```
1290 #[deprecated]
1291 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
1292 mut self,
1293 v: T,
1294 ) -> Self {
1295 self.producer_instance_id = v.into();
1296 self
1297 }
1298
1299 /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_metadata].
1300 ///
1301 /// # Example
1302 /// ```ignore,no_run
1303 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1304 /// let x = ConsumerPscConnection::new().set_producer_instance_metadata([
1305 /// ("key0", "abc"),
1306 /// ("key1", "xyz"),
1307 /// ]);
1308 /// ```
1309 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
1310 where
1311 T: std::iter::IntoIterator<Item = (K, V)>,
1312 K: std::convert::Into<std::string::String>,
1313 V: std::convert::Into<std::string::String>,
1314 {
1315 use std::iter::Iterator;
1316 self.producer_instance_metadata =
1317 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1318 self
1319 }
1320
1321 /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
1322 ///
1323 /// # Example
1324 /// ```ignore,no_run
1325 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1326 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
1327 /// let x0 = ConsumerPscConnection::new().set_ip_version(IPVersion::Ipv4);
1328 /// let x1 = ConsumerPscConnection::new().set_ip_version(IPVersion::Ipv6);
1329 /// ```
1330 pub fn set_ip_version<T>(mut self, v: T) -> Self
1331 where
1332 T: std::convert::Into<crate::model::IPVersion>,
1333 {
1334 self.ip_version = std::option::Option::Some(v.into());
1335 self
1336 }
1337
1338 /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
1339 ///
1340 /// # Example
1341 /// ```ignore,no_run
1342 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1343 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
1344 /// let x0 = ConsumerPscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
1345 /// let x1 = ConsumerPscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
1346 /// let x_none = ConsumerPscConnection::new().set_or_clear_ip_version(None::<IPVersion>);
1347 /// ```
1348 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
1349 where
1350 T: std::convert::Into<crate::model::IPVersion>,
1351 {
1352 self.ip_version = v.map(|x| x.into());
1353 self
1354 }
1355 }
1356
1357 impl wkt::message::Message for ConsumerPscConnection {
1358 fn typename() -> &'static str {
1359 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection"
1360 }
1361 }
1362
1363 /// Defines additional types related to [ConsumerPscConnection].
1364 pub mod consumer_psc_connection {
1365 #[allow(unused_imports)]
1366 use super::*;
1367
1368 /// The state of the PSC connection.
1369 /// We reserve the right to add more states without notice in the future.
1370 /// Users should not use exhaustive switch statements on this enum.
1371 /// See <https://google.aip.dev/216>.
1372 ///
1373 /// # Working with unknown values
1374 ///
1375 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1376 /// additional enum variants at any time. Adding new variants is not considered
1377 /// a breaking change. Applications should write their code in anticipation of:
1378 ///
1379 /// - New values appearing in future releases of the client library, **and**
1380 /// - New values received dynamically, without application changes.
1381 ///
1382 /// Please consult the [Working with enums] section in the user guide for some
1383 /// guidelines.
1384 ///
1385 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1386 #[derive(Clone, Debug, PartialEq)]
1387 #[non_exhaustive]
1388 pub enum State {
1389 /// An invalid state as the default case.
1390 Unspecified,
1391 /// The connection has been created successfully. However, for the
1392 /// up-to-date connection status, please use the service attachment's
1393 /// "ConnectedEndpoint.status" as the source of truth.
1394 Active,
1395 /// The connection is not functional since some resources on the connection
1396 /// fail to be created.
1397 Failed,
1398 /// The connection is being created.
1399 Creating,
1400 /// The connection is being deleted.
1401 Deleting,
1402 /// The connection is being repaired to complete creation.
1403 CreateRepairing,
1404 /// The connection is being repaired to complete deletion.
1405 DeleteRepairing,
1406 /// If set, the enum was initialized with an unknown value.
1407 ///
1408 /// Applications can examine the value using [State::value] or
1409 /// [State::name].
1410 UnknownValue(state::UnknownValue),
1411 }
1412
1413 #[doc(hidden)]
1414 pub mod state {
1415 #[allow(unused_imports)]
1416 use super::*;
1417 #[derive(Clone, Debug, PartialEq)]
1418 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1419 }
1420
1421 impl State {
1422 /// Gets the enum value.
1423 ///
1424 /// Returns `None` if the enum contains an unknown value deserialized from
1425 /// the string representation of enums.
1426 pub fn value(&self) -> std::option::Option<i32> {
1427 match self {
1428 Self::Unspecified => std::option::Option::Some(0),
1429 Self::Active => std::option::Option::Some(1),
1430 Self::Failed => std::option::Option::Some(2),
1431 Self::Creating => std::option::Option::Some(3),
1432 Self::Deleting => std::option::Option::Some(4),
1433 Self::CreateRepairing => std::option::Option::Some(5),
1434 Self::DeleteRepairing => std::option::Option::Some(6),
1435 Self::UnknownValue(u) => u.0.value(),
1436 }
1437 }
1438
1439 /// Gets the enum value as a string.
1440 ///
1441 /// Returns `None` if the enum contains an unknown value deserialized from
1442 /// the integer representation of enums.
1443 pub fn name(&self) -> std::option::Option<&str> {
1444 match self {
1445 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1446 Self::Active => std::option::Option::Some("ACTIVE"),
1447 Self::Failed => std::option::Option::Some("FAILED"),
1448 Self::Creating => std::option::Option::Some("CREATING"),
1449 Self::Deleting => std::option::Option::Some("DELETING"),
1450 Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
1451 Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
1452 Self::UnknownValue(u) => u.0.name(),
1453 }
1454 }
1455 }
1456
1457 impl std::default::Default for State {
1458 fn default() -> Self {
1459 use std::convert::From;
1460 Self::from(0)
1461 }
1462 }
1463
1464 impl std::fmt::Display for State {
1465 fn fmt(
1466 &self,
1467 f: &mut std::fmt::Formatter<'_>,
1468 ) -> std::result::Result<(), std::fmt::Error> {
1469 wkt::internal::display_enum(f, self.name(), self.value())
1470 }
1471 }
1472
1473 impl std::convert::From<i32> for State {
1474 fn from(value: i32) -> Self {
1475 match value {
1476 0 => Self::Unspecified,
1477 1 => Self::Active,
1478 2 => Self::Failed,
1479 3 => Self::Creating,
1480 4 => Self::Deleting,
1481 5 => Self::CreateRepairing,
1482 6 => Self::DeleteRepairing,
1483 _ => Self::UnknownValue(state::UnknownValue(
1484 wkt::internal::UnknownEnumValue::Integer(value),
1485 )),
1486 }
1487 }
1488 }
1489
1490 impl std::convert::From<&str> for State {
1491 fn from(value: &str) -> Self {
1492 use std::string::ToString;
1493 match value {
1494 "STATE_UNSPECIFIED" => Self::Unspecified,
1495 "ACTIVE" => Self::Active,
1496 "FAILED" => Self::Failed,
1497 "CREATING" => Self::Creating,
1498 "DELETING" => Self::Deleting,
1499 "CREATE_REPAIRING" => Self::CreateRepairing,
1500 "DELETE_REPAIRING" => Self::DeleteRepairing,
1501 _ => Self::UnknownValue(state::UnknownValue(
1502 wkt::internal::UnknownEnumValue::String(value.to_string()),
1503 )),
1504 }
1505 }
1506 }
1507
1508 impl serde::ser::Serialize for State {
1509 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1510 where
1511 S: serde::Serializer,
1512 {
1513 match self {
1514 Self::Unspecified => serializer.serialize_i32(0),
1515 Self::Active => serializer.serialize_i32(1),
1516 Self::Failed => serializer.serialize_i32(2),
1517 Self::Creating => serializer.serialize_i32(3),
1518 Self::Deleting => serializer.serialize_i32(4),
1519 Self::CreateRepairing => serializer.serialize_i32(5),
1520 Self::DeleteRepairing => serializer.serialize_i32(6),
1521 Self::UnknownValue(u) => u.0.serialize(serializer),
1522 }
1523 }
1524 }
1525
1526 impl<'de> serde::de::Deserialize<'de> for State {
1527 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1528 where
1529 D: serde::Deserializer<'de>,
1530 {
1531 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1532 ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection.State"))
1533 }
1534 }
1535 }
1536}
1537
1538/// Request for ListServiceConnectionMaps.
1539#[derive(Clone, Default, PartialEq)]
1540#[non_exhaustive]
1541pub struct ListServiceConnectionMapsRequest {
1542 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
1543 pub parent: std::string::String,
1544
1545 /// The maximum number of results per page that should be returned.
1546 pub page_size: i32,
1547
1548 /// The page token.
1549 pub page_token: std::string::String,
1550
1551 /// A filter expression that filters the results listed in the response.
1552 pub filter: std::string::String,
1553
1554 /// Sort the results by a certain order.
1555 pub order_by: std::string::String,
1556
1557 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1558}
1559
1560impl ListServiceConnectionMapsRequest {
1561 pub fn new() -> Self {
1562 std::default::Default::default()
1563 }
1564
1565 /// Sets the value of [parent][crate::model::ListServiceConnectionMapsRequest::parent].
1566 ///
1567 /// # Example
1568 /// ```ignore,no_run
1569 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1570 /// let x = ListServiceConnectionMapsRequest::new().set_parent("example");
1571 /// ```
1572 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1573 self.parent = v.into();
1574 self
1575 }
1576
1577 /// Sets the value of [page_size][crate::model::ListServiceConnectionMapsRequest::page_size].
1578 ///
1579 /// # Example
1580 /// ```ignore,no_run
1581 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1582 /// let x = ListServiceConnectionMapsRequest::new().set_page_size(42);
1583 /// ```
1584 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1585 self.page_size = v.into();
1586 self
1587 }
1588
1589 /// Sets the value of [page_token][crate::model::ListServiceConnectionMapsRequest::page_token].
1590 ///
1591 /// # Example
1592 /// ```ignore,no_run
1593 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1594 /// let x = ListServiceConnectionMapsRequest::new().set_page_token("example");
1595 /// ```
1596 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1597 self.page_token = v.into();
1598 self
1599 }
1600
1601 /// Sets the value of [filter][crate::model::ListServiceConnectionMapsRequest::filter].
1602 ///
1603 /// # Example
1604 /// ```ignore,no_run
1605 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1606 /// let x = ListServiceConnectionMapsRequest::new().set_filter("example");
1607 /// ```
1608 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1609 self.filter = v.into();
1610 self
1611 }
1612
1613 /// Sets the value of [order_by][crate::model::ListServiceConnectionMapsRequest::order_by].
1614 ///
1615 /// # Example
1616 /// ```ignore,no_run
1617 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1618 /// let x = ListServiceConnectionMapsRequest::new().set_order_by("example");
1619 /// ```
1620 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1621 self.order_by = v.into();
1622 self
1623 }
1624}
1625
1626impl wkt::message::Message for ListServiceConnectionMapsRequest {
1627 fn typename() -> &'static str {
1628 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsRequest"
1629 }
1630}
1631
1632/// Response for ListServiceConnectionMaps.
1633#[derive(Clone, Default, PartialEq)]
1634#[non_exhaustive]
1635pub struct ListServiceConnectionMapsResponse {
1636 /// ServiceConnectionMaps to be returned.
1637 pub service_connection_maps: std::vec::Vec<crate::model::ServiceConnectionMap>,
1638
1639 /// The next pagination token in the List response. It should be used as
1640 /// page_token for the following request. An empty value means no more result.
1641 pub next_page_token: std::string::String,
1642
1643 /// Locations that could not be reached.
1644 pub unreachable: std::vec::Vec<std::string::String>,
1645
1646 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1647}
1648
1649impl ListServiceConnectionMapsResponse {
1650 pub fn new() -> Self {
1651 std::default::Default::default()
1652 }
1653
1654 /// Sets the value of [service_connection_maps][crate::model::ListServiceConnectionMapsResponse::service_connection_maps].
1655 ///
1656 /// # Example
1657 /// ```ignore,no_run
1658 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1659 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1660 /// let x = ListServiceConnectionMapsResponse::new()
1661 /// .set_service_connection_maps([
1662 /// ServiceConnectionMap::default()/* use setters */,
1663 /// ServiceConnectionMap::default()/* use (different) setters */,
1664 /// ]);
1665 /// ```
1666 pub fn set_service_connection_maps<T, V>(mut self, v: T) -> Self
1667 where
1668 T: std::iter::IntoIterator<Item = V>,
1669 V: std::convert::Into<crate::model::ServiceConnectionMap>,
1670 {
1671 use std::iter::Iterator;
1672 self.service_connection_maps = v.into_iter().map(|i| i.into()).collect();
1673 self
1674 }
1675
1676 /// Sets the value of [next_page_token][crate::model::ListServiceConnectionMapsResponse::next_page_token].
1677 ///
1678 /// # Example
1679 /// ```ignore,no_run
1680 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1681 /// let x = ListServiceConnectionMapsResponse::new().set_next_page_token("example");
1682 /// ```
1683 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1684 self.next_page_token = v.into();
1685 self
1686 }
1687
1688 /// Sets the value of [unreachable][crate::model::ListServiceConnectionMapsResponse::unreachable].
1689 ///
1690 /// # Example
1691 /// ```ignore,no_run
1692 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1693 /// let x = ListServiceConnectionMapsResponse::new().set_unreachable(["a", "b", "c"]);
1694 /// ```
1695 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1696 where
1697 T: std::iter::IntoIterator<Item = V>,
1698 V: std::convert::Into<std::string::String>,
1699 {
1700 use std::iter::Iterator;
1701 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1702 self
1703 }
1704}
1705
1706impl wkt::message::Message for ListServiceConnectionMapsResponse {
1707 fn typename() -> &'static str {
1708 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsResponse"
1709 }
1710}
1711
1712#[doc(hidden)]
1713impl gax::paginator::internal::PageableResponse for ListServiceConnectionMapsResponse {
1714 type PageItem = crate::model::ServiceConnectionMap;
1715
1716 fn items(self) -> std::vec::Vec<Self::PageItem> {
1717 self.service_connection_maps
1718 }
1719
1720 fn next_page_token(&self) -> std::string::String {
1721 use std::clone::Clone;
1722 self.next_page_token.clone()
1723 }
1724}
1725
1726/// Request for GetServiceConnectionMap.
1727#[derive(Clone, Default, PartialEq)]
1728#[non_exhaustive]
1729pub struct GetServiceConnectionMapRequest {
1730 /// Required. Name of the ServiceConnectionMap to get.
1731 pub name: std::string::String,
1732
1733 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1734}
1735
1736impl GetServiceConnectionMapRequest {
1737 pub fn new() -> Self {
1738 std::default::Default::default()
1739 }
1740
1741 /// Sets the value of [name][crate::model::GetServiceConnectionMapRequest::name].
1742 ///
1743 /// # Example
1744 /// ```ignore,no_run
1745 /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionMapRequest;
1746 /// let x = GetServiceConnectionMapRequest::new().set_name("example");
1747 /// ```
1748 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1749 self.name = v.into();
1750 self
1751 }
1752}
1753
1754impl wkt::message::Message for GetServiceConnectionMapRequest {
1755 fn typename() -> &'static str {
1756 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionMapRequest"
1757 }
1758}
1759
1760/// Request for CreateServiceConnectionMap.
1761#[derive(Clone, Default, PartialEq)]
1762#[non_exhaustive]
1763pub struct CreateServiceConnectionMapRequest {
1764 /// Required. The parent resource's name of the ServiceConnectionMap. ex.
1765 /// projects/123/locations/us-east1
1766 pub parent: std::string::String,
1767
1768 /// Optional. Resource ID
1769 /// (i.e. 'foo' in '[...]/projects/p/locations/l/serviceConnectionMaps/foo')
1770 /// See <https://google.aip.dev/122#resource-id-segments>
1771 /// Unique per location.
1772 /// If one is not provided, one will be generated.
1773 pub service_connection_map_id: std::string::String,
1774
1775 /// Required. Initial values for a new ServiceConnectionMaps
1776 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1777
1778 /// Optional. An optional request ID to identify requests. Specify a unique
1779 /// request ID so that if you must retry your request, the server will know to
1780 /// ignore the request if it has already been completed. The server will
1781 /// guarantee that for at least 60 minutes since the first request.
1782 ///
1783 /// For example, consider a situation where you make an initial request and
1784 /// the request times out. If you make the request again with the same request
1785 /// ID, the server can check if original operation with the same request ID
1786 /// was received, and if so, will ignore the second request. This prevents
1787 /// clients from accidentally creating duplicate commitments.
1788 ///
1789 /// The request ID must be a valid UUID with the exception that zero UUID is
1790 /// not supported (00000000-0000-0000-0000-000000000000).
1791 pub request_id: std::string::String,
1792
1793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1794}
1795
1796impl CreateServiceConnectionMapRequest {
1797 pub fn new() -> Self {
1798 std::default::Default::default()
1799 }
1800
1801 /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
1802 ///
1803 /// # Example
1804 /// ```ignore,no_run
1805 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1806 /// let x = CreateServiceConnectionMapRequest::new().set_parent("example");
1807 /// ```
1808 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1809 self.parent = v.into();
1810 self
1811 }
1812
1813 /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
1814 ///
1815 /// # Example
1816 /// ```ignore,no_run
1817 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1818 /// let x = CreateServiceConnectionMapRequest::new().set_service_connection_map_id("example");
1819 /// ```
1820 pub fn set_service_connection_map_id<T: std::convert::Into<std::string::String>>(
1821 mut self,
1822 v: T,
1823 ) -> Self {
1824 self.service_connection_map_id = v.into();
1825 self
1826 }
1827
1828 /// Sets the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
1829 ///
1830 /// # Example
1831 /// ```ignore,no_run
1832 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1833 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1834 /// let x = CreateServiceConnectionMapRequest::new().set_service_connection_map(ServiceConnectionMap::default()/* use setters */);
1835 /// ```
1836 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1837 where
1838 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1839 {
1840 self.service_connection_map = std::option::Option::Some(v.into());
1841 self
1842 }
1843
1844 /// Sets or clears the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
1845 ///
1846 /// # Example
1847 /// ```ignore,no_run
1848 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1849 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1850 /// let x = CreateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(Some(ServiceConnectionMap::default()/* use setters */));
1851 /// let x = CreateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(None::<ServiceConnectionMap>);
1852 /// ```
1853 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1854 where
1855 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1856 {
1857 self.service_connection_map = v.map(|x| x.into());
1858 self
1859 }
1860
1861 /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
1862 ///
1863 /// # Example
1864 /// ```ignore,no_run
1865 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1866 /// let x = CreateServiceConnectionMapRequest::new().set_request_id("example");
1867 /// ```
1868 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1869 self.request_id = v.into();
1870 self
1871 }
1872}
1873
1874impl wkt::message::Message for CreateServiceConnectionMapRequest {
1875 fn typename() -> &'static str {
1876 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionMapRequest"
1877 }
1878}
1879
1880/// Request for UpdateServiceConnectionMap.
1881#[derive(Clone, Default, PartialEq)]
1882#[non_exhaustive]
1883pub struct UpdateServiceConnectionMapRequest {
1884 /// Optional. Field mask is used to specify the fields to be overwritten in the
1885 /// ServiceConnectionMap resource by the update.
1886 /// The fields specified in the update_mask are relative to the resource, not
1887 /// the full request. A field will be overwritten if it is in the mask. If the
1888 /// user does not provide a mask then all fields will be overwritten.
1889 pub update_mask: std::option::Option<wkt::FieldMask>,
1890
1891 /// Required. New values to be patched into the resource.
1892 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1893
1894 /// Optional. An optional request ID to identify requests. Specify a unique
1895 /// request ID so that if you must retry your request, the server will know to
1896 /// ignore the request if it has already been completed. The server will
1897 /// guarantee that for at least 60 minutes since the first request.
1898 ///
1899 /// For example, consider a situation where you make an initial request and
1900 /// the request times out. If you make the request again with the same request
1901 /// ID, the server can check if original operation with the same request ID
1902 /// was received, and if so, will ignore the second request. This prevents
1903 /// clients from accidentally creating duplicate commitments.
1904 ///
1905 /// The request ID must be a valid UUID with the exception that zero UUID is
1906 /// not supported (00000000-0000-0000-0000-000000000000).
1907 pub request_id: std::string::String,
1908
1909 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1910}
1911
1912impl UpdateServiceConnectionMapRequest {
1913 pub fn new() -> Self {
1914 std::default::Default::default()
1915 }
1916
1917 /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1918 ///
1919 /// # Example
1920 /// ```ignore,no_run
1921 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1922 /// use wkt::FieldMask;
1923 /// let x = UpdateServiceConnectionMapRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1924 /// ```
1925 pub fn set_update_mask<T>(mut self, v: T) -> Self
1926 where
1927 T: std::convert::Into<wkt::FieldMask>,
1928 {
1929 self.update_mask = std::option::Option::Some(v.into());
1930 self
1931 }
1932
1933 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1934 ///
1935 /// # Example
1936 /// ```ignore,no_run
1937 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1938 /// use wkt::FieldMask;
1939 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1940 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1941 /// ```
1942 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1943 where
1944 T: std::convert::Into<wkt::FieldMask>,
1945 {
1946 self.update_mask = v.map(|x| x.into());
1947 self
1948 }
1949
1950 /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1951 ///
1952 /// # Example
1953 /// ```ignore,no_run
1954 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1955 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1956 /// let x = UpdateServiceConnectionMapRequest::new().set_service_connection_map(ServiceConnectionMap::default()/* use setters */);
1957 /// ```
1958 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1959 where
1960 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1961 {
1962 self.service_connection_map = std::option::Option::Some(v.into());
1963 self
1964 }
1965
1966 /// Sets or clears the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1967 ///
1968 /// # Example
1969 /// ```ignore,no_run
1970 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1971 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1972 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(Some(ServiceConnectionMap::default()/* use setters */));
1973 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(None::<ServiceConnectionMap>);
1974 /// ```
1975 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1976 where
1977 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1978 {
1979 self.service_connection_map = v.map(|x| x.into());
1980 self
1981 }
1982
1983 /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
1984 ///
1985 /// # Example
1986 /// ```ignore,no_run
1987 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1988 /// let x = UpdateServiceConnectionMapRequest::new().set_request_id("example");
1989 /// ```
1990 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1991 self.request_id = v.into();
1992 self
1993 }
1994}
1995
1996impl wkt::message::Message for UpdateServiceConnectionMapRequest {
1997 fn typename() -> &'static str {
1998 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionMapRequest"
1999 }
2000}
2001
2002/// Request for DeleteServiceConnectionMap.
2003#[derive(Clone, Default, PartialEq)]
2004#[non_exhaustive]
2005pub struct DeleteServiceConnectionMapRequest {
2006 /// Required. The name of the ServiceConnectionMap to delete.
2007 pub name: std::string::String,
2008
2009 /// Optional. An optional request ID to identify requests. Specify a unique
2010 /// request ID so that if you must retry your request, the server will know to
2011 /// ignore the request if it has already been completed. The server will
2012 /// guarantee that for at least 60 minutes after the first request.
2013 ///
2014 /// For example, consider a situation where you make an initial request and
2015 /// the request times out. If you make the request again with the same request
2016 /// ID, the server can check if original operation with the same request ID
2017 /// was received, and if so, will ignore the second request. This prevents
2018 /// clients from accidentally creating duplicate commitments.
2019 ///
2020 /// The request ID must be a valid UUID with the exception that zero UUID is
2021 /// not supported (00000000-0000-0000-0000-000000000000).
2022 pub request_id: std::string::String,
2023
2024 /// Optional. The etag is computed by the server, and may be sent on update and
2025 /// delete requests to ensure the client has an up-to-date value before
2026 /// proceeding.
2027 pub etag: std::option::Option<std::string::String>,
2028
2029 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2030}
2031
2032impl DeleteServiceConnectionMapRequest {
2033 pub fn new() -> Self {
2034 std::default::Default::default()
2035 }
2036
2037 /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
2038 ///
2039 /// # Example
2040 /// ```ignore,no_run
2041 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2042 /// let x = DeleteServiceConnectionMapRequest::new().set_name("example");
2043 /// ```
2044 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2045 self.name = v.into();
2046 self
2047 }
2048
2049 /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
2050 ///
2051 /// # Example
2052 /// ```ignore,no_run
2053 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2054 /// let x = DeleteServiceConnectionMapRequest::new().set_request_id("example");
2055 /// ```
2056 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2057 self.request_id = v.into();
2058 self
2059 }
2060
2061 /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
2062 ///
2063 /// # Example
2064 /// ```ignore,no_run
2065 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2066 /// let x = DeleteServiceConnectionMapRequest::new().set_etag("example");
2067 /// ```
2068 pub fn set_etag<T>(mut self, v: T) -> Self
2069 where
2070 T: std::convert::Into<std::string::String>,
2071 {
2072 self.etag = std::option::Option::Some(v.into());
2073 self
2074 }
2075
2076 /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
2077 ///
2078 /// # Example
2079 /// ```ignore,no_run
2080 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2081 /// let x = DeleteServiceConnectionMapRequest::new().set_or_clear_etag(Some("example"));
2082 /// let x = DeleteServiceConnectionMapRequest::new().set_or_clear_etag(None::<String>);
2083 /// ```
2084 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2085 where
2086 T: std::convert::Into<std::string::String>,
2087 {
2088 self.etag = v.map(|x| x.into());
2089 self
2090 }
2091}
2092
2093impl wkt::message::Message for DeleteServiceConnectionMapRequest {
2094 fn typename() -> &'static str {
2095 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionMapRequest"
2096 }
2097}
2098
2099/// The ServiceConnectionPolicy resource.
2100#[derive(Clone, Default, PartialEq)]
2101#[non_exhaustive]
2102pub struct ServiceConnectionPolicy {
2103 /// Immutable. The name of a ServiceConnectionPolicy.
2104 /// Format:
2105 /// projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy}
2106 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
2107 pub name: std::string::String,
2108
2109 /// Output only. Time when the ServiceConnectionPolicy was created.
2110 pub create_time: std::option::Option<wkt::Timestamp>,
2111
2112 /// Output only. Time when the ServiceConnectionPolicy was updated.
2113 pub update_time: std::option::Option<wkt::Timestamp>,
2114
2115 /// User-defined labels.
2116 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2117
2118 /// A description of this resource.
2119 pub description: std::string::String,
2120
2121 /// The resource path of the consumer network.
2122 /// Example:
2123 ///
2124 /// - projects/{projectNumOrId}/global/networks/{resourceId}.
2125 pub network: std::string::String,
2126
2127 /// The service class identifier for which this ServiceConnectionPolicy is for.
2128 /// The service class identifier is a unique, symbolic representation of a
2129 /// ServiceClass. It is provided by the Service Producer. Google services have
2130 /// a prefix of gcp or google-cloud. For example, gcp-memorystore-redis or
2131 /// google-cloud-sql. 3rd party services do not. For example,
2132 /// test-service-a3dfcx.
2133 pub service_class: std::string::String,
2134
2135 /// Output only. The type of underlying resources used to create the
2136 /// connection.
2137 pub infrastructure: crate::model::Infrastructure,
2138
2139 /// Configuration used for Private Service Connect connections. Used when
2140 /// Infrastructure is PSC.
2141 pub psc_config: std::option::Option<crate::model::service_connection_policy::PscConfig>,
2142
2143 /// Output only. [Output only] Information about each Private Service Connect
2144 /// connection.
2145 pub psc_connections: std::vec::Vec<crate::model::service_connection_policy::PscConnection>,
2146
2147 /// Optional. The etag is computed by the server, and may be sent on update and
2148 /// delete requests to ensure the client has an up-to-date value before
2149 /// proceeding.
2150 pub etag: std::option::Option<std::string::String>,
2151
2152 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2153}
2154
2155impl ServiceConnectionPolicy {
2156 pub fn new() -> Self {
2157 std::default::Default::default()
2158 }
2159
2160 /// Sets the value of [name][crate::model::ServiceConnectionPolicy::name].
2161 ///
2162 /// # Example
2163 /// ```ignore,no_run
2164 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2165 /// let x = ServiceConnectionPolicy::new().set_name("example");
2166 /// ```
2167 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2168 self.name = v.into();
2169 self
2170 }
2171
2172 /// Sets the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
2173 ///
2174 /// # Example
2175 /// ```ignore,no_run
2176 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2177 /// use wkt::Timestamp;
2178 /// let x = ServiceConnectionPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2179 /// ```
2180 pub fn set_create_time<T>(mut self, v: T) -> Self
2181 where
2182 T: std::convert::Into<wkt::Timestamp>,
2183 {
2184 self.create_time = std::option::Option::Some(v.into());
2185 self
2186 }
2187
2188 /// Sets or clears the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
2189 ///
2190 /// # Example
2191 /// ```ignore,no_run
2192 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2193 /// use wkt::Timestamp;
2194 /// let x = ServiceConnectionPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2195 /// let x = ServiceConnectionPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2196 /// ```
2197 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2198 where
2199 T: std::convert::Into<wkt::Timestamp>,
2200 {
2201 self.create_time = v.map(|x| x.into());
2202 self
2203 }
2204
2205 /// Sets the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
2206 ///
2207 /// # Example
2208 /// ```ignore,no_run
2209 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2210 /// use wkt::Timestamp;
2211 /// let x = ServiceConnectionPolicy::new().set_update_time(Timestamp::default()/* use setters */);
2212 /// ```
2213 pub fn set_update_time<T>(mut self, v: T) -> Self
2214 where
2215 T: std::convert::Into<wkt::Timestamp>,
2216 {
2217 self.update_time = std::option::Option::Some(v.into());
2218 self
2219 }
2220
2221 /// Sets or clears the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
2222 ///
2223 /// # Example
2224 /// ```ignore,no_run
2225 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2226 /// use wkt::Timestamp;
2227 /// let x = ServiceConnectionPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2228 /// let x = ServiceConnectionPolicy::new().set_or_clear_update_time(None::<Timestamp>);
2229 /// ```
2230 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2231 where
2232 T: std::convert::Into<wkt::Timestamp>,
2233 {
2234 self.update_time = v.map(|x| x.into());
2235 self
2236 }
2237
2238 /// Sets the value of [labels][crate::model::ServiceConnectionPolicy::labels].
2239 ///
2240 /// # Example
2241 /// ```ignore,no_run
2242 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2243 /// let x = ServiceConnectionPolicy::new().set_labels([
2244 /// ("key0", "abc"),
2245 /// ("key1", "xyz"),
2246 /// ]);
2247 /// ```
2248 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2249 where
2250 T: std::iter::IntoIterator<Item = (K, V)>,
2251 K: std::convert::Into<std::string::String>,
2252 V: std::convert::Into<std::string::String>,
2253 {
2254 use std::iter::Iterator;
2255 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2256 self
2257 }
2258
2259 /// Sets the value of [description][crate::model::ServiceConnectionPolicy::description].
2260 ///
2261 /// # Example
2262 /// ```ignore,no_run
2263 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2264 /// let x = ServiceConnectionPolicy::new().set_description("example");
2265 /// ```
2266 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2267 self.description = v.into();
2268 self
2269 }
2270
2271 /// Sets the value of [network][crate::model::ServiceConnectionPolicy::network].
2272 ///
2273 /// # Example
2274 /// ```ignore,no_run
2275 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2276 /// let x = ServiceConnectionPolicy::new().set_network("example");
2277 /// ```
2278 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2279 self.network = v.into();
2280 self
2281 }
2282
2283 /// Sets the value of [service_class][crate::model::ServiceConnectionPolicy::service_class].
2284 ///
2285 /// # Example
2286 /// ```ignore,no_run
2287 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2288 /// let x = ServiceConnectionPolicy::new().set_service_class("example");
2289 /// ```
2290 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2291 self.service_class = v.into();
2292 self
2293 }
2294
2295 /// Sets the value of [infrastructure][crate::model::ServiceConnectionPolicy::infrastructure].
2296 ///
2297 /// # Example
2298 /// ```ignore,no_run
2299 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2300 /// use google_cloud_networkconnectivity_v1::model::Infrastructure;
2301 /// let x0 = ServiceConnectionPolicy::new().set_infrastructure(Infrastructure::Psc);
2302 /// ```
2303 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
2304 mut self,
2305 v: T,
2306 ) -> Self {
2307 self.infrastructure = v.into();
2308 self
2309 }
2310
2311 /// Sets the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
2312 ///
2313 /// # Example
2314 /// ```ignore,no_run
2315 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2316 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2317 /// let x = ServiceConnectionPolicy::new().set_psc_config(PscConfig::default()/* use setters */);
2318 /// ```
2319 pub fn set_psc_config<T>(mut self, v: T) -> Self
2320 where
2321 T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
2322 {
2323 self.psc_config = std::option::Option::Some(v.into());
2324 self
2325 }
2326
2327 /// Sets or clears the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
2328 ///
2329 /// # Example
2330 /// ```ignore,no_run
2331 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2332 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2333 /// let x = ServiceConnectionPolicy::new().set_or_clear_psc_config(Some(PscConfig::default()/* use setters */));
2334 /// let x = ServiceConnectionPolicy::new().set_or_clear_psc_config(None::<PscConfig>);
2335 /// ```
2336 pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
2337 where
2338 T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
2339 {
2340 self.psc_config = v.map(|x| x.into());
2341 self
2342 }
2343
2344 /// Sets the value of [psc_connections][crate::model::ServiceConnectionPolicy::psc_connections].
2345 ///
2346 /// # Example
2347 /// ```ignore,no_run
2348 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2349 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2350 /// let x = ServiceConnectionPolicy::new()
2351 /// .set_psc_connections([
2352 /// PscConnection::default()/* use setters */,
2353 /// PscConnection::default()/* use (different) setters */,
2354 /// ]);
2355 /// ```
2356 pub fn set_psc_connections<T, V>(mut self, v: T) -> Self
2357 where
2358 T: std::iter::IntoIterator<Item = V>,
2359 V: std::convert::Into<crate::model::service_connection_policy::PscConnection>,
2360 {
2361 use std::iter::Iterator;
2362 self.psc_connections = v.into_iter().map(|i| i.into()).collect();
2363 self
2364 }
2365
2366 /// Sets the value of [etag][crate::model::ServiceConnectionPolicy::etag].
2367 ///
2368 /// # Example
2369 /// ```ignore,no_run
2370 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2371 /// let x = ServiceConnectionPolicy::new().set_etag("example");
2372 /// ```
2373 pub fn set_etag<T>(mut self, v: T) -> Self
2374 where
2375 T: std::convert::Into<std::string::String>,
2376 {
2377 self.etag = std::option::Option::Some(v.into());
2378 self
2379 }
2380
2381 /// Sets or clears the value of [etag][crate::model::ServiceConnectionPolicy::etag].
2382 ///
2383 /// # Example
2384 /// ```ignore,no_run
2385 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2386 /// let x = ServiceConnectionPolicy::new().set_or_clear_etag(Some("example"));
2387 /// let x = ServiceConnectionPolicy::new().set_or_clear_etag(None::<String>);
2388 /// ```
2389 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2390 where
2391 T: std::convert::Into<std::string::String>,
2392 {
2393 self.etag = v.map(|x| x.into());
2394 self
2395 }
2396}
2397
2398impl wkt::message::Message for ServiceConnectionPolicy {
2399 fn typename() -> &'static str {
2400 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy"
2401 }
2402}
2403
2404/// Defines additional types related to [ServiceConnectionPolicy].
2405pub mod service_connection_policy {
2406 #[allow(unused_imports)]
2407 use super::*;
2408
2409 /// Configuration used for Private Service Connect connections. Used when
2410 /// Infrastructure is PSC.
2411 #[derive(Clone, Default, PartialEq)]
2412 #[non_exhaustive]
2413 pub struct PscConfig {
2414 /// The resource paths of subnetworks to use for IP address management.
2415 /// Example:
2416 /// projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}.
2417 pub subnetworks: std::vec::Vec<std::string::String>,
2418
2419 /// Optional. Max number of PSC connections for this policy.
2420 pub limit: std::option::Option<i64>,
2421
2422 /// Required. ProducerInstanceLocation is used to specify which authorization
2423 /// mechanism to use to determine which projects the Producer instance can be
2424 /// within.
2425 pub producer_instance_location:
2426 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
2427
2428 /// Optional. List of Projects, Folders, or Organizations from where the
2429 /// Producer instance can be within. For example, a network administrator can
2430 /// provide both 'organizations/foo' and 'projects/bar' as
2431 /// allowed_google_producers_resource_hierarchy_levels. This allowlists this
2432 /// network to connect with any Producer instance within the 'foo'
2433 /// organization or the 'bar' project. By default,
2434 /// allowed_google_producers_resource_hierarchy_level is empty. The format
2435 /// for each allowed_google_producers_resource_hierarchy_level is \<resource
2436 /// type\>/\<id\> where <resource type\> is one of 'projects', 'folders', or
2437 /// 'organizations' and \<id\> is either the ID or the number of the resource
2438 /// type. Format for each allowed_google_producers_resource_hierarchy_level
2439 /// value: 'projects/<project_id_or_number>' or 'folders/<folder_id>' or
2440 /// 'organizations/<organization_id>'
2441 /// Eg. [projects/my-project-id, projects/567, folders/891,
2442 /// organizations/123]
2443 pub allowed_google_producers_resource_hierarchy_level: std::vec::Vec<std::string::String>,
2444
2445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2446 }
2447
2448 impl PscConfig {
2449 pub fn new() -> Self {
2450 std::default::Default::default()
2451 }
2452
2453 /// Sets the value of [subnetworks][crate::model::service_connection_policy::PscConfig::subnetworks].
2454 ///
2455 /// # Example
2456 /// ```ignore,no_run
2457 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2458 /// let x = PscConfig::new().set_subnetworks(["a", "b", "c"]);
2459 /// ```
2460 pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
2461 where
2462 T: std::iter::IntoIterator<Item = V>,
2463 V: std::convert::Into<std::string::String>,
2464 {
2465 use std::iter::Iterator;
2466 self.subnetworks = v.into_iter().map(|i| i.into()).collect();
2467 self
2468 }
2469
2470 /// Sets the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
2471 ///
2472 /// # Example
2473 /// ```ignore,no_run
2474 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2475 /// let x = PscConfig::new().set_limit(42);
2476 /// ```
2477 pub fn set_limit<T>(mut self, v: T) -> Self
2478 where
2479 T: std::convert::Into<i64>,
2480 {
2481 self.limit = std::option::Option::Some(v.into());
2482 self
2483 }
2484
2485 /// Sets or clears the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
2486 ///
2487 /// # Example
2488 /// ```ignore,no_run
2489 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2490 /// let x = PscConfig::new().set_or_clear_limit(Some(42));
2491 /// let x = PscConfig::new().set_or_clear_limit(None::<i32>);
2492 /// ```
2493 pub fn set_or_clear_limit<T>(mut self, v: std::option::Option<T>) -> Self
2494 where
2495 T: std::convert::Into<i64>,
2496 {
2497 self.limit = v.map(|x| x.into());
2498 self
2499 }
2500
2501 /// Sets the value of [producer_instance_location][crate::model::service_connection_policy::PscConfig::producer_instance_location].
2502 ///
2503 /// # Example
2504 /// ```ignore,no_run
2505 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2506 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::psc_config::ProducerInstanceLocation;
2507 /// let x0 = PscConfig::new().set_producer_instance_location(ProducerInstanceLocation::CustomResourceHierarchyLevels);
2508 /// ```
2509 pub fn set_producer_instance_location<
2510 T: std::convert::Into<
2511 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
2512 >,
2513 >(
2514 mut self,
2515 v: T,
2516 ) -> Self {
2517 self.producer_instance_location = v.into();
2518 self
2519 }
2520
2521 /// Sets the value of [allowed_google_producers_resource_hierarchy_level][crate::model::service_connection_policy::PscConfig::allowed_google_producers_resource_hierarchy_level].
2522 ///
2523 /// # Example
2524 /// ```ignore,no_run
2525 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2526 /// let x = PscConfig::new().set_allowed_google_producers_resource_hierarchy_level(["a", "b", "c"]);
2527 /// ```
2528 pub fn set_allowed_google_producers_resource_hierarchy_level<T, V>(mut self, v: T) -> Self
2529 where
2530 T: std::iter::IntoIterator<Item = V>,
2531 V: std::convert::Into<std::string::String>,
2532 {
2533 use std::iter::Iterator;
2534 self.allowed_google_producers_resource_hierarchy_level =
2535 v.into_iter().map(|i| i.into()).collect();
2536 self
2537 }
2538 }
2539
2540 impl wkt::message::Message for PscConfig {
2541 fn typename() -> &'static str {
2542 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig"
2543 }
2544 }
2545
2546 /// Defines additional types related to [PscConfig].
2547 pub mod psc_config {
2548 #[allow(unused_imports)]
2549 use super::*;
2550
2551 /// ProducerInstanceLocation is used to specify which authorization mechanism
2552 /// to use to determine which projects the Producer instance can be within.
2553 ///
2554 /// # Working with unknown values
2555 ///
2556 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2557 /// additional enum variants at any time. Adding new variants is not considered
2558 /// a breaking change. Applications should write their code in anticipation of:
2559 ///
2560 /// - New values appearing in future releases of the client library, **and**
2561 /// - New values received dynamically, without application changes.
2562 ///
2563 /// Please consult the [Working with enums] section in the user guide for some
2564 /// guidelines.
2565 ///
2566 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2567 #[derive(Clone, Debug, PartialEq)]
2568 #[non_exhaustive]
2569 pub enum ProducerInstanceLocation {
2570 /// Producer instance location is not specified. When this option is
2571 /// chosen, then the PSC connections created by this
2572 /// ServiceConnectionPolicy must be within the same project as the Producer
2573 /// instance. This is the default ProducerInstanceLocation value.
2574 /// To allow for PSC connections from this network to other networks, use
2575 /// the CUSTOM_RESOURCE_HIERARCHY_LEVELS option.
2576 Unspecified,
2577 /// Producer instance must be within one of the values provided in
2578 /// allowed_google_producers_resource_hierarchy_level.
2579 CustomResourceHierarchyLevels,
2580 /// If set, the enum was initialized with an unknown value.
2581 ///
2582 /// Applications can examine the value using [ProducerInstanceLocation::value] or
2583 /// [ProducerInstanceLocation::name].
2584 UnknownValue(producer_instance_location::UnknownValue),
2585 }
2586
2587 #[doc(hidden)]
2588 pub mod producer_instance_location {
2589 #[allow(unused_imports)]
2590 use super::*;
2591 #[derive(Clone, Debug, PartialEq)]
2592 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2593 }
2594
2595 impl ProducerInstanceLocation {
2596 /// Gets the enum value.
2597 ///
2598 /// Returns `None` if the enum contains an unknown value deserialized from
2599 /// the string representation of enums.
2600 pub fn value(&self) -> std::option::Option<i32> {
2601 match self {
2602 Self::Unspecified => std::option::Option::Some(0),
2603 Self::CustomResourceHierarchyLevels => std::option::Option::Some(1),
2604 Self::UnknownValue(u) => u.0.value(),
2605 }
2606 }
2607
2608 /// Gets the enum value as a string.
2609 ///
2610 /// Returns `None` if the enum contains an unknown value deserialized from
2611 /// the integer representation of enums.
2612 pub fn name(&self) -> std::option::Option<&str> {
2613 match self {
2614 Self::Unspecified => {
2615 std::option::Option::Some("PRODUCER_INSTANCE_LOCATION_UNSPECIFIED")
2616 }
2617 Self::CustomResourceHierarchyLevels => {
2618 std::option::Option::Some("CUSTOM_RESOURCE_HIERARCHY_LEVELS")
2619 }
2620 Self::UnknownValue(u) => u.0.name(),
2621 }
2622 }
2623 }
2624
2625 impl std::default::Default for ProducerInstanceLocation {
2626 fn default() -> Self {
2627 use std::convert::From;
2628 Self::from(0)
2629 }
2630 }
2631
2632 impl std::fmt::Display for ProducerInstanceLocation {
2633 fn fmt(
2634 &self,
2635 f: &mut std::fmt::Formatter<'_>,
2636 ) -> std::result::Result<(), std::fmt::Error> {
2637 wkt::internal::display_enum(f, self.name(), self.value())
2638 }
2639 }
2640
2641 impl std::convert::From<i32> for ProducerInstanceLocation {
2642 fn from(value: i32) -> Self {
2643 match value {
2644 0 => Self::Unspecified,
2645 1 => Self::CustomResourceHierarchyLevels,
2646 _ => Self::UnknownValue(producer_instance_location::UnknownValue(
2647 wkt::internal::UnknownEnumValue::Integer(value),
2648 )),
2649 }
2650 }
2651 }
2652
2653 impl std::convert::From<&str> for ProducerInstanceLocation {
2654 fn from(value: &str) -> Self {
2655 use std::string::ToString;
2656 match value {
2657 "PRODUCER_INSTANCE_LOCATION_UNSPECIFIED" => Self::Unspecified,
2658 "CUSTOM_RESOURCE_HIERARCHY_LEVELS" => Self::CustomResourceHierarchyLevels,
2659 _ => Self::UnknownValue(producer_instance_location::UnknownValue(
2660 wkt::internal::UnknownEnumValue::String(value.to_string()),
2661 )),
2662 }
2663 }
2664 }
2665
2666 impl serde::ser::Serialize for ProducerInstanceLocation {
2667 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2668 where
2669 S: serde::Serializer,
2670 {
2671 match self {
2672 Self::Unspecified => serializer.serialize_i32(0),
2673 Self::CustomResourceHierarchyLevels => serializer.serialize_i32(1),
2674 Self::UnknownValue(u) => u.0.serialize(serializer),
2675 }
2676 }
2677 }
2678
2679 impl<'de> serde::de::Deserialize<'de> for ProducerInstanceLocation {
2680 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2681 where
2682 D: serde::Deserializer<'de>,
2683 {
2684 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProducerInstanceLocation>::new(
2685 ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig.ProducerInstanceLocation"))
2686 }
2687 }
2688 }
2689
2690 /// Information about a specific Private Service Connect connection.
2691 #[derive(Clone, Default, PartialEq)]
2692 #[non_exhaustive]
2693 pub struct PscConnection {
2694 /// State of the PSC Connection
2695 pub state: crate::model::service_connection_policy::State,
2696
2697 /// The resource reference of the PSC Forwarding Rule within the consumer
2698 /// VPC.
2699 pub consumer_forwarding_rule: std::string::String,
2700
2701 /// The resource reference of the consumer address.
2702 pub consumer_address: std::string::String,
2703
2704 /// The error type indicates whether the error is consumer facing, producer
2705 /// facing or system internal.
2706 #[deprecated]
2707 pub error_type: crate::model::ConnectionErrorType,
2708
2709 /// The most recent error during operating this connection.
2710 /// Deprecated, please use error_info instead.
2711 #[deprecated]
2712 pub error: std::option::Option<rpc::model::Status>,
2713
2714 /// The last Compute Engine operation to setup PSC connection.
2715 pub gce_operation: std::string::String,
2716
2717 /// The project where the PSC connection is created.
2718 pub consumer_target_project: std::string::String,
2719
2720 /// The PSC connection id of the PSC forwarding rule.
2721 pub psc_connection_id: std::string::String,
2722
2723 /// Output only. The error info for the latest error during operating this
2724 /// connection.
2725 pub error_info: std::option::Option<rpc::model::ErrorInfo>,
2726
2727 /// Output only. The URI of the subnetwork selected to allocate IP address
2728 /// for this connection.
2729 pub selected_subnetwork: std::string::String,
2730
2731 /// Immutable. Deprecated. Use producer_instance_metadata instead.
2732 /// An immutable identifier for the producer instance.
2733 #[deprecated]
2734 pub producer_instance_id: std::string::String,
2735
2736 /// Immutable. An immutable map for the producer instance metadata.
2737 pub producer_instance_metadata:
2738 std::collections::HashMap<std::string::String, std::string::String>,
2739
2740 /// Output only. [Output only] The service class associated with this PSC
2741 /// Connection. The value is derived from the SCPolicy and matches the
2742 /// service class name provided by the customer.
2743 pub service_class: std::string::String,
2744
2745 /// The requested IP version for the PSC connection.
2746 pub ip_version: std::option::Option<crate::model::IPVersion>,
2747
2748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2749 }
2750
2751 impl PscConnection {
2752 pub fn new() -> Self {
2753 std::default::Default::default()
2754 }
2755
2756 /// Sets the value of [state][crate::model::service_connection_policy::PscConnection::state].
2757 ///
2758 /// # Example
2759 /// ```ignore,no_run
2760 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2761 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::State;
2762 /// let x0 = PscConnection::new().set_state(State::Active);
2763 /// let x1 = PscConnection::new().set_state(State::Failed);
2764 /// let x2 = PscConnection::new().set_state(State::Creating);
2765 /// ```
2766 pub fn set_state<T: std::convert::Into<crate::model::service_connection_policy::State>>(
2767 mut self,
2768 v: T,
2769 ) -> Self {
2770 self.state = v.into();
2771 self
2772 }
2773
2774 /// Sets the value of [consumer_forwarding_rule][crate::model::service_connection_policy::PscConnection::consumer_forwarding_rule].
2775 ///
2776 /// # Example
2777 /// ```ignore,no_run
2778 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2779 /// let x = PscConnection::new().set_consumer_forwarding_rule("example");
2780 /// ```
2781 pub fn set_consumer_forwarding_rule<T: std::convert::Into<std::string::String>>(
2782 mut self,
2783 v: T,
2784 ) -> Self {
2785 self.consumer_forwarding_rule = v.into();
2786 self
2787 }
2788
2789 /// Sets the value of [consumer_address][crate::model::service_connection_policy::PscConnection::consumer_address].
2790 ///
2791 /// # Example
2792 /// ```ignore,no_run
2793 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2794 /// let x = PscConnection::new().set_consumer_address("example");
2795 /// ```
2796 pub fn set_consumer_address<T: std::convert::Into<std::string::String>>(
2797 mut self,
2798 v: T,
2799 ) -> Self {
2800 self.consumer_address = v.into();
2801 self
2802 }
2803
2804 /// Sets the value of [error_type][crate::model::service_connection_policy::PscConnection::error_type].
2805 ///
2806 /// # Example
2807 /// ```ignore,no_run
2808 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2809 /// use google_cloud_networkconnectivity_v1::model::ConnectionErrorType;
2810 /// let x0 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorInternal);
2811 /// let x1 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorConsumerSide);
2812 /// let x2 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorProducerSide);
2813 /// ```
2814 #[deprecated]
2815 pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
2816 mut self,
2817 v: T,
2818 ) -> Self {
2819 self.error_type = v.into();
2820 self
2821 }
2822
2823 /// Sets the value of [error][crate::model::service_connection_policy::PscConnection::error].
2824 ///
2825 /// # Example
2826 /// ```ignore,no_run
2827 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2828 /// use rpc::model::Status;
2829 /// let x = PscConnection::new().set_error(Status::default()/* use setters */);
2830 /// ```
2831 #[deprecated]
2832 pub fn set_error<T>(mut self, v: T) -> Self
2833 where
2834 T: std::convert::Into<rpc::model::Status>,
2835 {
2836 self.error = std::option::Option::Some(v.into());
2837 self
2838 }
2839
2840 /// Sets or clears the value of [error][crate::model::service_connection_policy::PscConnection::error].
2841 ///
2842 /// # Example
2843 /// ```ignore,no_run
2844 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2845 /// use rpc::model::Status;
2846 /// let x = PscConnection::new().set_or_clear_error(Some(Status::default()/* use setters */));
2847 /// let x = PscConnection::new().set_or_clear_error(None::<Status>);
2848 /// ```
2849 #[deprecated]
2850 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
2851 where
2852 T: std::convert::Into<rpc::model::Status>,
2853 {
2854 self.error = v.map(|x| x.into());
2855 self
2856 }
2857
2858 /// Sets the value of [gce_operation][crate::model::service_connection_policy::PscConnection::gce_operation].
2859 ///
2860 /// # Example
2861 /// ```ignore,no_run
2862 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2863 /// let x = PscConnection::new().set_gce_operation("example");
2864 /// ```
2865 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
2866 mut self,
2867 v: T,
2868 ) -> Self {
2869 self.gce_operation = v.into();
2870 self
2871 }
2872
2873 /// Sets the value of [consumer_target_project][crate::model::service_connection_policy::PscConnection::consumer_target_project].
2874 ///
2875 /// # Example
2876 /// ```ignore,no_run
2877 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2878 /// let x = PscConnection::new().set_consumer_target_project("example");
2879 /// ```
2880 pub fn set_consumer_target_project<T: std::convert::Into<std::string::String>>(
2881 mut self,
2882 v: T,
2883 ) -> Self {
2884 self.consumer_target_project = v.into();
2885 self
2886 }
2887
2888 /// Sets the value of [psc_connection_id][crate::model::service_connection_policy::PscConnection::psc_connection_id].
2889 ///
2890 /// # Example
2891 /// ```ignore,no_run
2892 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2893 /// let x = PscConnection::new().set_psc_connection_id("example");
2894 /// ```
2895 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
2896 mut self,
2897 v: T,
2898 ) -> Self {
2899 self.psc_connection_id = v.into();
2900 self
2901 }
2902
2903 /// Sets the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
2904 ///
2905 /// # Example
2906 /// ```ignore,no_run
2907 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2908 /// use rpc::model::ErrorInfo;
2909 /// let x = PscConnection::new().set_error_info(ErrorInfo::default()/* use setters */);
2910 /// ```
2911 pub fn set_error_info<T>(mut self, v: T) -> Self
2912 where
2913 T: std::convert::Into<rpc::model::ErrorInfo>,
2914 {
2915 self.error_info = std::option::Option::Some(v.into());
2916 self
2917 }
2918
2919 /// Sets or clears the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
2920 ///
2921 /// # Example
2922 /// ```ignore,no_run
2923 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2924 /// use rpc::model::ErrorInfo;
2925 /// let x = PscConnection::new().set_or_clear_error_info(Some(ErrorInfo::default()/* use setters */));
2926 /// let x = PscConnection::new().set_or_clear_error_info(None::<ErrorInfo>);
2927 /// ```
2928 pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
2929 where
2930 T: std::convert::Into<rpc::model::ErrorInfo>,
2931 {
2932 self.error_info = v.map(|x| x.into());
2933 self
2934 }
2935
2936 /// Sets the value of [selected_subnetwork][crate::model::service_connection_policy::PscConnection::selected_subnetwork].
2937 ///
2938 /// # Example
2939 /// ```ignore,no_run
2940 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2941 /// let x = PscConnection::new().set_selected_subnetwork("example");
2942 /// ```
2943 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
2944 mut self,
2945 v: T,
2946 ) -> Self {
2947 self.selected_subnetwork = v.into();
2948 self
2949 }
2950
2951 /// Sets the value of [producer_instance_id][crate::model::service_connection_policy::PscConnection::producer_instance_id].
2952 ///
2953 /// # Example
2954 /// ```ignore,no_run
2955 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2956 /// let x = PscConnection::new().set_producer_instance_id("example");
2957 /// ```
2958 #[deprecated]
2959 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
2960 mut self,
2961 v: T,
2962 ) -> Self {
2963 self.producer_instance_id = v.into();
2964 self
2965 }
2966
2967 /// Sets the value of [producer_instance_metadata][crate::model::service_connection_policy::PscConnection::producer_instance_metadata].
2968 ///
2969 /// # Example
2970 /// ```ignore,no_run
2971 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2972 /// let x = PscConnection::new().set_producer_instance_metadata([
2973 /// ("key0", "abc"),
2974 /// ("key1", "xyz"),
2975 /// ]);
2976 /// ```
2977 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
2978 where
2979 T: std::iter::IntoIterator<Item = (K, V)>,
2980 K: std::convert::Into<std::string::String>,
2981 V: std::convert::Into<std::string::String>,
2982 {
2983 use std::iter::Iterator;
2984 self.producer_instance_metadata =
2985 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2986 self
2987 }
2988
2989 /// Sets the value of [service_class][crate::model::service_connection_policy::PscConnection::service_class].
2990 ///
2991 /// # Example
2992 /// ```ignore,no_run
2993 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2994 /// let x = PscConnection::new().set_service_class("example");
2995 /// ```
2996 pub fn set_service_class<T: std::convert::Into<std::string::String>>(
2997 mut self,
2998 v: T,
2999 ) -> Self {
3000 self.service_class = v.into();
3001 self
3002 }
3003
3004 /// Sets the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
3005 ///
3006 /// # Example
3007 /// ```ignore,no_run
3008 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3009 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
3010 /// let x0 = PscConnection::new().set_ip_version(IPVersion::Ipv4);
3011 /// let x1 = PscConnection::new().set_ip_version(IPVersion::Ipv6);
3012 /// ```
3013 pub fn set_ip_version<T>(mut self, v: T) -> Self
3014 where
3015 T: std::convert::Into<crate::model::IPVersion>,
3016 {
3017 self.ip_version = std::option::Option::Some(v.into());
3018 self
3019 }
3020
3021 /// Sets or clears the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
3022 ///
3023 /// # Example
3024 /// ```ignore,no_run
3025 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3026 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
3027 /// let x0 = PscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
3028 /// let x1 = PscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
3029 /// let x_none = PscConnection::new().set_or_clear_ip_version(None::<IPVersion>);
3030 /// ```
3031 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
3032 where
3033 T: std::convert::Into<crate::model::IPVersion>,
3034 {
3035 self.ip_version = v.map(|x| x.into());
3036 self
3037 }
3038 }
3039
3040 impl wkt::message::Message for PscConnection {
3041 fn typename() -> &'static str {
3042 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection"
3043 }
3044 }
3045
3046 /// The state of the PSC connection.
3047 /// We reserve the right to add more states without notice in the future.
3048 /// Users should not use exhaustive switch statements on this enum.
3049 /// See <https://google.aip.dev/216>.
3050 ///
3051 /// # Working with unknown values
3052 ///
3053 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3054 /// additional enum variants at any time. Adding new variants is not considered
3055 /// a breaking change. Applications should write their code in anticipation of:
3056 ///
3057 /// - New values appearing in future releases of the client library, **and**
3058 /// - New values received dynamically, without application changes.
3059 ///
3060 /// Please consult the [Working with enums] section in the user guide for some
3061 /// guidelines.
3062 ///
3063 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3064 #[derive(Clone, Debug, PartialEq)]
3065 #[non_exhaustive]
3066 pub enum State {
3067 /// An invalid state as the default case.
3068 Unspecified,
3069 /// The connection has been created successfully. However, for the
3070 /// up-to-date connection status, please use the created forwarding rule's
3071 /// "PscConnectionStatus" as the source of truth.
3072 Active,
3073 /// The connection is not functional since some resources on the connection
3074 /// fail to be created.
3075 Failed,
3076 /// The connection is being created.
3077 Creating,
3078 /// The connection is being deleted.
3079 Deleting,
3080 /// The connection is being repaired to complete creation.
3081 CreateRepairing,
3082 /// The connection is being repaired to complete deletion.
3083 DeleteRepairing,
3084 /// If set, the enum was initialized with an unknown value.
3085 ///
3086 /// Applications can examine the value using [State::value] or
3087 /// [State::name].
3088 UnknownValue(state::UnknownValue),
3089 }
3090
3091 #[doc(hidden)]
3092 pub mod state {
3093 #[allow(unused_imports)]
3094 use super::*;
3095 #[derive(Clone, Debug, PartialEq)]
3096 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3097 }
3098
3099 impl State {
3100 /// Gets the enum value.
3101 ///
3102 /// Returns `None` if the enum contains an unknown value deserialized from
3103 /// the string representation of enums.
3104 pub fn value(&self) -> std::option::Option<i32> {
3105 match self {
3106 Self::Unspecified => std::option::Option::Some(0),
3107 Self::Active => std::option::Option::Some(1),
3108 Self::Failed => std::option::Option::Some(2),
3109 Self::Creating => std::option::Option::Some(3),
3110 Self::Deleting => std::option::Option::Some(4),
3111 Self::CreateRepairing => std::option::Option::Some(5),
3112 Self::DeleteRepairing => std::option::Option::Some(6),
3113 Self::UnknownValue(u) => u.0.value(),
3114 }
3115 }
3116
3117 /// Gets the enum value as a string.
3118 ///
3119 /// Returns `None` if the enum contains an unknown value deserialized from
3120 /// the integer representation of enums.
3121 pub fn name(&self) -> std::option::Option<&str> {
3122 match self {
3123 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3124 Self::Active => std::option::Option::Some("ACTIVE"),
3125 Self::Failed => std::option::Option::Some("FAILED"),
3126 Self::Creating => std::option::Option::Some("CREATING"),
3127 Self::Deleting => std::option::Option::Some("DELETING"),
3128 Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
3129 Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
3130 Self::UnknownValue(u) => u.0.name(),
3131 }
3132 }
3133 }
3134
3135 impl std::default::Default for State {
3136 fn default() -> Self {
3137 use std::convert::From;
3138 Self::from(0)
3139 }
3140 }
3141
3142 impl std::fmt::Display for State {
3143 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3144 wkt::internal::display_enum(f, self.name(), self.value())
3145 }
3146 }
3147
3148 impl std::convert::From<i32> for State {
3149 fn from(value: i32) -> Self {
3150 match value {
3151 0 => Self::Unspecified,
3152 1 => Self::Active,
3153 2 => Self::Failed,
3154 3 => Self::Creating,
3155 4 => Self::Deleting,
3156 5 => Self::CreateRepairing,
3157 6 => Self::DeleteRepairing,
3158 _ => Self::UnknownValue(state::UnknownValue(
3159 wkt::internal::UnknownEnumValue::Integer(value),
3160 )),
3161 }
3162 }
3163 }
3164
3165 impl std::convert::From<&str> for State {
3166 fn from(value: &str) -> Self {
3167 use std::string::ToString;
3168 match value {
3169 "STATE_UNSPECIFIED" => Self::Unspecified,
3170 "ACTIVE" => Self::Active,
3171 "FAILED" => Self::Failed,
3172 "CREATING" => Self::Creating,
3173 "DELETING" => Self::Deleting,
3174 "CREATE_REPAIRING" => Self::CreateRepairing,
3175 "DELETE_REPAIRING" => Self::DeleteRepairing,
3176 _ => Self::UnknownValue(state::UnknownValue(
3177 wkt::internal::UnknownEnumValue::String(value.to_string()),
3178 )),
3179 }
3180 }
3181 }
3182
3183 impl serde::ser::Serialize for State {
3184 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3185 where
3186 S: serde::Serializer,
3187 {
3188 match self {
3189 Self::Unspecified => serializer.serialize_i32(0),
3190 Self::Active => serializer.serialize_i32(1),
3191 Self::Failed => serializer.serialize_i32(2),
3192 Self::Creating => serializer.serialize_i32(3),
3193 Self::Deleting => serializer.serialize_i32(4),
3194 Self::CreateRepairing => serializer.serialize_i32(5),
3195 Self::DeleteRepairing => serializer.serialize_i32(6),
3196 Self::UnknownValue(u) => u.0.serialize(serializer),
3197 }
3198 }
3199 }
3200
3201 impl<'de> serde::de::Deserialize<'de> for State {
3202 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3203 where
3204 D: serde::Deserializer<'de>,
3205 {
3206 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3207 ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.State",
3208 ))
3209 }
3210 }
3211}
3212
3213/// Request for ListServiceConnectionPolicies.
3214#[derive(Clone, Default, PartialEq)]
3215#[non_exhaustive]
3216pub struct ListServiceConnectionPoliciesRequest {
3217 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
3218 pub parent: std::string::String,
3219
3220 /// The maximum number of results per page that should be returned.
3221 pub page_size: i32,
3222
3223 /// The page token.
3224 pub page_token: std::string::String,
3225
3226 /// A filter expression that filters the results listed in the response.
3227 pub filter: std::string::String,
3228
3229 /// Sort the results by a certain order.
3230 pub order_by: std::string::String,
3231
3232 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3233}
3234
3235impl ListServiceConnectionPoliciesRequest {
3236 pub fn new() -> Self {
3237 std::default::Default::default()
3238 }
3239
3240 /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
3241 ///
3242 /// # Example
3243 /// ```ignore,no_run
3244 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3245 /// let x = ListServiceConnectionPoliciesRequest::new().set_parent("example");
3246 /// ```
3247 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3248 self.parent = v.into();
3249 self
3250 }
3251
3252 /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
3253 ///
3254 /// # Example
3255 /// ```ignore,no_run
3256 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3257 /// let x = ListServiceConnectionPoliciesRequest::new().set_page_size(42);
3258 /// ```
3259 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3260 self.page_size = v.into();
3261 self
3262 }
3263
3264 /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
3265 ///
3266 /// # Example
3267 /// ```ignore,no_run
3268 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3269 /// let x = ListServiceConnectionPoliciesRequest::new().set_page_token("example");
3270 /// ```
3271 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3272 self.page_token = v.into();
3273 self
3274 }
3275
3276 /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
3277 ///
3278 /// # Example
3279 /// ```ignore,no_run
3280 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3281 /// let x = ListServiceConnectionPoliciesRequest::new().set_filter("example");
3282 /// ```
3283 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3284 self.filter = v.into();
3285 self
3286 }
3287
3288 /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
3289 ///
3290 /// # Example
3291 /// ```ignore,no_run
3292 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3293 /// let x = ListServiceConnectionPoliciesRequest::new().set_order_by("example");
3294 /// ```
3295 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3296 self.order_by = v.into();
3297 self
3298 }
3299}
3300
3301impl wkt::message::Message for ListServiceConnectionPoliciesRequest {
3302 fn typename() -> &'static str {
3303 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesRequest"
3304 }
3305}
3306
3307/// Response for ListServiceConnectionPolicies.
3308#[derive(Clone, Default, PartialEq)]
3309#[non_exhaustive]
3310pub struct ListServiceConnectionPoliciesResponse {
3311 /// ServiceConnectionPolicies to be returned.
3312 pub service_connection_policies: std::vec::Vec<crate::model::ServiceConnectionPolicy>,
3313
3314 /// The next pagination token in the List response. It should be used as
3315 /// page_token for the following request. An empty value means no more result.
3316 pub next_page_token: std::string::String,
3317
3318 /// Locations that could not be reached.
3319 pub unreachable: std::vec::Vec<std::string::String>,
3320
3321 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3322}
3323
3324impl ListServiceConnectionPoliciesResponse {
3325 pub fn new() -> Self {
3326 std::default::Default::default()
3327 }
3328
3329 /// Sets the value of [service_connection_policies][crate::model::ListServiceConnectionPoliciesResponse::service_connection_policies].
3330 ///
3331 /// # Example
3332 /// ```ignore,no_run
3333 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3334 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3335 /// let x = ListServiceConnectionPoliciesResponse::new()
3336 /// .set_service_connection_policies([
3337 /// ServiceConnectionPolicy::default()/* use setters */,
3338 /// ServiceConnectionPolicy::default()/* use (different) setters */,
3339 /// ]);
3340 /// ```
3341 pub fn set_service_connection_policies<T, V>(mut self, v: T) -> Self
3342 where
3343 T: std::iter::IntoIterator<Item = V>,
3344 V: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3345 {
3346 use std::iter::Iterator;
3347 self.service_connection_policies = v.into_iter().map(|i| i.into()).collect();
3348 self
3349 }
3350
3351 /// Sets the value of [next_page_token][crate::model::ListServiceConnectionPoliciesResponse::next_page_token].
3352 ///
3353 /// # Example
3354 /// ```ignore,no_run
3355 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3356 /// let x = ListServiceConnectionPoliciesResponse::new().set_next_page_token("example");
3357 /// ```
3358 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3359 self.next_page_token = v.into();
3360 self
3361 }
3362
3363 /// Sets the value of [unreachable][crate::model::ListServiceConnectionPoliciesResponse::unreachable].
3364 ///
3365 /// # Example
3366 /// ```ignore,no_run
3367 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3368 /// let x = ListServiceConnectionPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
3369 /// ```
3370 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3371 where
3372 T: std::iter::IntoIterator<Item = V>,
3373 V: std::convert::Into<std::string::String>,
3374 {
3375 use std::iter::Iterator;
3376 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3377 self
3378 }
3379}
3380
3381impl wkt::message::Message for ListServiceConnectionPoliciesResponse {
3382 fn typename() -> &'static str {
3383 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesResponse"
3384 }
3385}
3386
3387#[doc(hidden)]
3388impl gax::paginator::internal::PageableResponse for ListServiceConnectionPoliciesResponse {
3389 type PageItem = crate::model::ServiceConnectionPolicy;
3390
3391 fn items(self) -> std::vec::Vec<Self::PageItem> {
3392 self.service_connection_policies
3393 }
3394
3395 fn next_page_token(&self) -> std::string::String {
3396 use std::clone::Clone;
3397 self.next_page_token.clone()
3398 }
3399}
3400
3401/// Request for GetServiceConnectionPolicy.
3402#[derive(Clone, Default, PartialEq)]
3403#[non_exhaustive]
3404pub struct GetServiceConnectionPolicyRequest {
3405 /// Required. Name of the ServiceConnectionPolicy to get.
3406 pub name: std::string::String,
3407
3408 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3409}
3410
3411impl GetServiceConnectionPolicyRequest {
3412 pub fn new() -> Self {
3413 std::default::Default::default()
3414 }
3415
3416 /// Sets the value of [name][crate::model::GetServiceConnectionPolicyRequest::name].
3417 ///
3418 /// # Example
3419 /// ```ignore,no_run
3420 /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionPolicyRequest;
3421 /// let x = GetServiceConnectionPolicyRequest::new().set_name("example");
3422 /// ```
3423 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3424 self.name = v.into();
3425 self
3426 }
3427}
3428
3429impl wkt::message::Message for GetServiceConnectionPolicyRequest {
3430 fn typename() -> &'static str {
3431 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionPolicyRequest"
3432 }
3433}
3434
3435/// Request for CreateServiceConnectionPolicy.
3436#[derive(Clone, Default, PartialEq)]
3437#[non_exhaustive]
3438pub struct CreateServiceConnectionPolicyRequest {
3439 /// Required. The parent resource's name of the ServiceConnectionPolicy. ex.
3440 /// projects/123/locations/us-east1
3441 pub parent: std::string::String,
3442
3443 /// Optional. Resource ID
3444 /// (i.e. 'foo' in
3445 /// '[...]/projects/p/locations/l/serviceConnectionPolicies/foo') See
3446 /// <https://google.aip.dev/122#resource-id-segments> Unique per location.
3447 pub service_connection_policy_id: std::string::String,
3448
3449 /// Required. Initial values for a new ServiceConnectionPolicies
3450 pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
3451
3452 /// Optional. An optional request ID to identify requests. Specify a unique
3453 /// request ID so that if you must retry your request, the server will know to
3454 /// ignore the request if it has already been completed. The server will
3455 /// guarantee that for at least 60 minutes since the first request.
3456 ///
3457 /// For example, consider a situation where you make an initial request and
3458 /// the request times out. If you make the request again with the same request
3459 /// ID, the server can check if original operation with the same request ID
3460 /// was received, and if so, will ignore the second request. This prevents
3461 /// clients from accidentally creating duplicate commitments.
3462 ///
3463 /// The request ID must be a valid UUID with the exception that zero UUID is
3464 /// not supported (00000000-0000-0000-0000-000000000000).
3465 pub request_id: std::string::String,
3466
3467 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3468}
3469
3470impl CreateServiceConnectionPolicyRequest {
3471 pub fn new() -> Self {
3472 std::default::Default::default()
3473 }
3474
3475 /// Sets the value of [parent][crate::model::CreateServiceConnectionPolicyRequest::parent].
3476 ///
3477 /// # Example
3478 /// ```ignore,no_run
3479 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3480 /// let x = CreateServiceConnectionPolicyRequest::new().set_parent("example");
3481 /// ```
3482 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3483 self.parent = v.into();
3484 self
3485 }
3486
3487 /// Sets the value of [service_connection_policy_id][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy_id].
3488 ///
3489 /// # Example
3490 /// ```ignore,no_run
3491 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3492 /// let x = CreateServiceConnectionPolicyRequest::new().set_service_connection_policy_id("example");
3493 /// ```
3494 pub fn set_service_connection_policy_id<T: std::convert::Into<std::string::String>>(
3495 mut self,
3496 v: T,
3497 ) -> Self {
3498 self.service_connection_policy_id = v.into();
3499 self
3500 }
3501
3502 /// Sets the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
3503 ///
3504 /// # Example
3505 /// ```ignore,no_run
3506 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3507 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3508 /// let x = CreateServiceConnectionPolicyRequest::new().set_service_connection_policy(ServiceConnectionPolicy::default()/* use setters */);
3509 /// ```
3510 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
3511 where
3512 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3513 {
3514 self.service_connection_policy = std::option::Option::Some(v.into());
3515 self
3516 }
3517
3518 /// Sets or clears the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
3519 ///
3520 /// # Example
3521 /// ```ignore,no_run
3522 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3523 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3524 /// let x = CreateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(Some(ServiceConnectionPolicy::default()/* use setters */));
3525 /// let x = CreateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(None::<ServiceConnectionPolicy>);
3526 /// ```
3527 pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
3528 where
3529 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3530 {
3531 self.service_connection_policy = v.map(|x| x.into());
3532 self
3533 }
3534
3535 /// Sets the value of [request_id][crate::model::CreateServiceConnectionPolicyRequest::request_id].
3536 ///
3537 /// # Example
3538 /// ```ignore,no_run
3539 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3540 /// let x = CreateServiceConnectionPolicyRequest::new().set_request_id("example");
3541 /// ```
3542 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3543 self.request_id = v.into();
3544 self
3545 }
3546}
3547
3548impl wkt::message::Message for CreateServiceConnectionPolicyRequest {
3549 fn typename() -> &'static str {
3550 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionPolicyRequest"
3551 }
3552}
3553
3554/// Request for UpdateServiceConnectionPolicy.
3555#[derive(Clone, Default, PartialEq)]
3556#[non_exhaustive]
3557pub struct UpdateServiceConnectionPolicyRequest {
3558 /// Optional. Field mask is used to specify the fields to be overwritten in the
3559 /// ServiceConnectionPolicy resource by the update.
3560 /// The fields specified in the update_mask are relative to the resource, not
3561 /// the full request. A field will be overwritten if it is in the mask. If the
3562 /// user does not provide a mask then all fields will be overwritten.
3563 pub update_mask: std::option::Option<wkt::FieldMask>,
3564
3565 /// Required. New values to be patched into the resource.
3566 pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
3567
3568 /// Optional. An optional request ID to identify requests. Specify a unique
3569 /// request ID so that if you must retry your request, the server will know to
3570 /// ignore the request if it has already been completed. The server will
3571 /// guarantee that for at least 60 minutes since the first request.
3572 ///
3573 /// For example, consider a situation where you make an initial request and
3574 /// the request times out. If you make the request again with the same request
3575 /// ID, the server can check if original operation with the same request ID
3576 /// was received, and if so, will ignore the second request. This prevents
3577 /// clients from accidentally creating duplicate commitments.
3578 ///
3579 /// The request ID must be a valid UUID with the exception that zero UUID is
3580 /// not supported (00000000-0000-0000-0000-000000000000).
3581 pub request_id: std::string::String,
3582
3583 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3584}
3585
3586impl UpdateServiceConnectionPolicyRequest {
3587 pub fn new() -> Self {
3588 std::default::Default::default()
3589 }
3590
3591 /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
3592 ///
3593 /// # Example
3594 /// ```ignore,no_run
3595 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3596 /// use wkt::FieldMask;
3597 /// let x = UpdateServiceConnectionPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3598 /// ```
3599 pub fn set_update_mask<T>(mut self, v: T) -> Self
3600 where
3601 T: std::convert::Into<wkt::FieldMask>,
3602 {
3603 self.update_mask = std::option::Option::Some(v.into());
3604 self
3605 }
3606
3607 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
3608 ///
3609 /// # Example
3610 /// ```ignore,no_run
3611 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3612 /// use wkt::FieldMask;
3613 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3614 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3615 /// ```
3616 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3617 where
3618 T: std::convert::Into<wkt::FieldMask>,
3619 {
3620 self.update_mask = v.map(|x| x.into());
3621 self
3622 }
3623
3624 /// Sets the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
3625 ///
3626 /// # Example
3627 /// ```ignore,no_run
3628 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3629 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3630 /// let x = UpdateServiceConnectionPolicyRequest::new().set_service_connection_policy(ServiceConnectionPolicy::default()/* use setters */);
3631 /// ```
3632 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
3633 where
3634 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3635 {
3636 self.service_connection_policy = std::option::Option::Some(v.into());
3637 self
3638 }
3639
3640 /// Sets or clears the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
3641 ///
3642 /// # Example
3643 /// ```ignore,no_run
3644 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3645 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3646 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(Some(ServiceConnectionPolicy::default()/* use setters */));
3647 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(None::<ServiceConnectionPolicy>);
3648 /// ```
3649 pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
3650 where
3651 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3652 {
3653 self.service_connection_policy = v.map(|x| x.into());
3654 self
3655 }
3656
3657 /// Sets the value of [request_id][crate::model::UpdateServiceConnectionPolicyRequest::request_id].
3658 ///
3659 /// # Example
3660 /// ```ignore,no_run
3661 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3662 /// let x = UpdateServiceConnectionPolicyRequest::new().set_request_id("example");
3663 /// ```
3664 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3665 self.request_id = v.into();
3666 self
3667 }
3668}
3669
3670impl wkt::message::Message for UpdateServiceConnectionPolicyRequest {
3671 fn typename() -> &'static str {
3672 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionPolicyRequest"
3673 }
3674}
3675
3676/// Request for DeleteServiceConnectionPolicy.
3677#[derive(Clone, Default, PartialEq)]
3678#[non_exhaustive]
3679pub struct DeleteServiceConnectionPolicyRequest {
3680 /// Required. The name of the ServiceConnectionPolicy to delete.
3681 pub name: std::string::String,
3682
3683 /// Optional. An optional request ID to identify requests. Specify a unique
3684 /// request ID so that if you must retry your request, the server will know to
3685 /// ignore the request if it has already been completed. The server will
3686 /// guarantee that for at least 60 minutes after the first request.
3687 ///
3688 /// For example, consider a situation where you make an initial request and
3689 /// the request times out. If you make the request again with the same request
3690 /// ID, the server can check if original operation with the same request ID
3691 /// was received, and if so, will ignore the second request. This prevents
3692 /// clients from accidentally creating duplicate commitments.
3693 ///
3694 /// The request ID must be a valid UUID with the exception that zero UUID is
3695 /// not supported (00000000-0000-0000-0000-000000000000).
3696 pub request_id: std::string::String,
3697
3698 /// Optional. The etag is computed by the server, and may be sent on update and
3699 /// delete requests to ensure the client has an up-to-date value before
3700 /// proceeding.
3701 pub etag: std::option::Option<std::string::String>,
3702
3703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3704}
3705
3706impl DeleteServiceConnectionPolicyRequest {
3707 pub fn new() -> Self {
3708 std::default::Default::default()
3709 }
3710
3711 /// Sets the value of [name][crate::model::DeleteServiceConnectionPolicyRequest::name].
3712 ///
3713 /// # Example
3714 /// ```ignore,no_run
3715 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3716 /// let x = DeleteServiceConnectionPolicyRequest::new().set_name("example");
3717 /// ```
3718 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3719 self.name = v.into();
3720 self
3721 }
3722
3723 /// Sets the value of [request_id][crate::model::DeleteServiceConnectionPolicyRequest::request_id].
3724 ///
3725 /// # Example
3726 /// ```ignore,no_run
3727 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3728 /// let x = DeleteServiceConnectionPolicyRequest::new().set_request_id("example");
3729 /// ```
3730 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3731 self.request_id = v.into();
3732 self
3733 }
3734
3735 /// Sets the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
3736 ///
3737 /// # Example
3738 /// ```ignore,no_run
3739 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3740 /// let x = DeleteServiceConnectionPolicyRequest::new().set_etag("example");
3741 /// ```
3742 pub fn set_etag<T>(mut self, v: T) -> Self
3743 where
3744 T: std::convert::Into<std::string::String>,
3745 {
3746 self.etag = std::option::Option::Some(v.into());
3747 self
3748 }
3749
3750 /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
3751 ///
3752 /// # Example
3753 /// ```ignore,no_run
3754 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3755 /// let x = DeleteServiceConnectionPolicyRequest::new().set_or_clear_etag(Some("example"));
3756 /// let x = DeleteServiceConnectionPolicyRequest::new().set_or_clear_etag(None::<String>);
3757 /// ```
3758 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
3759 where
3760 T: std::convert::Into<std::string::String>,
3761 {
3762 self.etag = v.map(|x| x.into());
3763 self
3764 }
3765}
3766
3767impl wkt::message::Message for DeleteServiceConnectionPolicyRequest {
3768 fn typename() -> &'static str {
3769 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionPolicyRequest"
3770 }
3771}
3772
3773/// The ServiceClass resource.
3774#[derive(Clone, Default, PartialEq)]
3775#[non_exhaustive]
3776pub struct ServiceClass {
3777 /// Immutable. The name of a ServiceClass resource.
3778 /// Format:
3779 /// projects/{project}/locations/{location}/serviceClasses/{service_class}
3780 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
3781 pub name: std::string::String,
3782
3783 /// Output only. The generated service class name. Use this name to refer to
3784 /// the Service class in Service Connection Maps and Service Connection
3785 /// Policies.
3786 pub service_class: std::string::String,
3787
3788 /// Output only. Time when the ServiceClass was created.
3789 pub create_time: std::option::Option<wkt::Timestamp>,
3790
3791 /// Output only. Time when the ServiceClass was updated.
3792 pub update_time: std::option::Option<wkt::Timestamp>,
3793
3794 /// User-defined labels.
3795 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3796
3797 /// A description of this resource.
3798 pub description: std::string::String,
3799
3800 /// Optional. The etag is computed by the server, and may be sent on update and
3801 /// delete requests to ensure the client has an up-to-date value before
3802 /// proceeding.
3803 pub etag: std::option::Option<std::string::String>,
3804
3805 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3806}
3807
3808impl ServiceClass {
3809 pub fn new() -> Self {
3810 std::default::Default::default()
3811 }
3812
3813 /// Sets the value of [name][crate::model::ServiceClass::name].
3814 ///
3815 /// # Example
3816 /// ```ignore,no_run
3817 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3818 /// let x = ServiceClass::new().set_name("example");
3819 /// ```
3820 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3821 self.name = v.into();
3822 self
3823 }
3824
3825 /// Sets the value of [service_class][crate::model::ServiceClass::service_class].
3826 ///
3827 /// # Example
3828 /// ```ignore,no_run
3829 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3830 /// let x = ServiceClass::new().set_service_class("example");
3831 /// ```
3832 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3833 self.service_class = v.into();
3834 self
3835 }
3836
3837 /// Sets the value of [create_time][crate::model::ServiceClass::create_time].
3838 ///
3839 /// # Example
3840 /// ```ignore,no_run
3841 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3842 /// use wkt::Timestamp;
3843 /// let x = ServiceClass::new().set_create_time(Timestamp::default()/* use setters */);
3844 /// ```
3845 pub fn set_create_time<T>(mut self, v: T) -> Self
3846 where
3847 T: std::convert::Into<wkt::Timestamp>,
3848 {
3849 self.create_time = std::option::Option::Some(v.into());
3850 self
3851 }
3852
3853 /// Sets or clears the value of [create_time][crate::model::ServiceClass::create_time].
3854 ///
3855 /// # Example
3856 /// ```ignore,no_run
3857 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3858 /// use wkt::Timestamp;
3859 /// let x = ServiceClass::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3860 /// let x = ServiceClass::new().set_or_clear_create_time(None::<Timestamp>);
3861 /// ```
3862 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3863 where
3864 T: std::convert::Into<wkt::Timestamp>,
3865 {
3866 self.create_time = v.map(|x| x.into());
3867 self
3868 }
3869
3870 /// Sets the value of [update_time][crate::model::ServiceClass::update_time].
3871 ///
3872 /// # Example
3873 /// ```ignore,no_run
3874 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3875 /// use wkt::Timestamp;
3876 /// let x = ServiceClass::new().set_update_time(Timestamp::default()/* use setters */);
3877 /// ```
3878 pub fn set_update_time<T>(mut self, v: T) -> Self
3879 where
3880 T: std::convert::Into<wkt::Timestamp>,
3881 {
3882 self.update_time = std::option::Option::Some(v.into());
3883 self
3884 }
3885
3886 /// Sets or clears the value of [update_time][crate::model::ServiceClass::update_time].
3887 ///
3888 /// # Example
3889 /// ```ignore,no_run
3890 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3891 /// use wkt::Timestamp;
3892 /// let x = ServiceClass::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3893 /// let x = ServiceClass::new().set_or_clear_update_time(None::<Timestamp>);
3894 /// ```
3895 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3896 where
3897 T: std::convert::Into<wkt::Timestamp>,
3898 {
3899 self.update_time = v.map(|x| x.into());
3900 self
3901 }
3902
3903 /// Sets the value of [labels][crate::model::ServiceClass::labels].
3904 ///
3905 /// # Example
3906 /// ```ignore,no_run
3907 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3908 /// let x = ServiceClass::new().set_labels([
3909 /// ("key0", "abc"),
3910 /// ("key1", "xyz"),
3911 /// ]);
3912 /// ```
3913 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3914 where
3915 T: std::iter::IntoIterator<Item = (K, V)>,
3916 K: std::convert::Into<std::string::String>,
3917 V: std::convert::Into<std::string::String>,
3918 {
3919 use std::iter::Iterator;
3920 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3921 self
3922 }
3923
3924 /// Sets the value of [description][crate::model::ServiceClass::description].
3925 ///
3926 /// # Example
3927 /// ```ignore,no_run
3928 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3929 /// let x = ServiceClass::new().set_description("example");
3930 /// ```
3931 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3932 self.description = v.into();
3933 self
3934 }
3935
3936 /// Sets the value of [etag][crate::model::ServiceClass::etag].
3937 ///
3938 /// # Example
3939 /// ```ignore,no_run
3940 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3941 /// let x = ServiceClass::new().set_etag("example");
3942 /// ```
3943 pub fn set_etag<T>(mut self, v: T) -> Self
3944 where
3945 T: std::convert::Into<std::string::String>,
3946 {
3947 self.etag = std::option::Option::Some(v.into());
3948 self
3949 }
3950
3951 /// Sets or clears the value of [etag][crate::model::ServiceClass::etag].
3952 ///
3953 /// # Example
3954 /// ```ignore,no_run
3955 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3956 /// let x = ServiceClass::new().set_or_clear_etag(Some("example"));
3957 /// let x = ServiceClass::new().set_or_clear_etag(None::<String>);
3958 /// ```
3959 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
3960 where
3961 T: std::convert::Into<std::string::String>,
3962 {
3963 self.etag = v.map(|x| x.into());
3964 self
3965 }
3966}
3967
3968impl wkt::message::Message for ServiceClass {
3969 fn typename() -> &'static str {
3970 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceClass"
3971 }
3972}
3973
3974/// Request for ListServiceClasses.
3975#[derive(Clone, Default, PartialEq)]
3976#[non_exhaustive]
3977pub struct ListServiceClassesRequest {
3978 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
3979 pub parent: std::string::String,
3980
3981 /// The maximum number of results per page that should be returned.
3982 pub page_size: i32,
3983
3984 /// The page token.
3985 pub page_token: std::string::String,
3986
3987 /// A filter expression that filters the results listed in the response.
3988 pub filter: std::string::String,
3989
3990 /// Sort the results by a certain order.
3991 pub order_by: std::string::String,
3992
3993 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3994}
3995
3996impl ListServiceClassesRequest {
3997 pub fn new() -> Self {
3998 std::default::Default::default()
3999 }
4000
4001 /// Sets the value of [parent][crate::model::ListServiceClassesRequest::parent].
4002 ///
4003 /// # Example
4004 /// ```ignore,no_run
4005 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4006 /// let x = ListServiceClassesRequest::new().set_parent("example");
4007 /// ```
4008 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4009 self.parent = v.into();
4010 self
4011 }
4012
4013 /// Sets the value of [page_size][crate::model::ListServiceClassesRequest::page_size].
4014 ///
4015 /// # Example
4016 /// ```ignore,no_run
4017 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4018 /// let x = ListServiceClassesRequest::new().set_page_size(42);
4019 /// ```
4020 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4021 self.page_size = v.into();
4022 self
4023 }
4024
4025 /// Sets the value of [page_token][crate::model::ListServiceClassesRequest::page_token].
4026 ///
4027 /// # Example
4028 /// ```ignore,no_run
4029 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4030 /// let x = ListServiceClassesRequest::new().set_page_token("example");
4031 /// ```
4032 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4033 self.page_token = v.into();
4034 self
4035 }
4036
4037 /// Sets the value of [filter][crate::model::ListServiceClassesRequest::filter].
4038 ///
4039 /// # Example
4040 /// ```ignore,no_run
4041 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4042 /// let x = ListServiceClassesRequest::new().set_filter("example");
4043 /// ```
4044 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4045 self.filter = v.into();
4046 self
4047 }
4048
4049 /// Sets the value of [order_by][crate::model::ListServiceClassesRequest::order_by].
4050 ///
4051 /// # Example
4052 /// ```ignore,no_run
4053 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4054 /// let x = ListServiceClassesRequest::new().set_order_by("example");
4055 /// ```
4056 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4057 self.order_by = v.into();
4058 self
4059 }
4060}
4061
4062impl wkt::message::Message for ListServiceClassesRequest {
4063 fn typename() -> &'static str {
4064 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesRequest"
4065 }
4066}
4067
4068/// Response for ListServiceClasses.
4069#[derive(Clone, Default, PartialEq)]
4070#[non_exhaustive]
4071pub struct ListServiceClassesResponse {
4072 /// ServiceClasses to be returned.
4073 pub service_classes: std::vec::Vec<crate::model::ServiceClass>,
4074
4075 /// The next pagination token in the List response. It should be used as
4076 /// page_token for the following request. An empty value means no more result.
4077 pub next_page_token: std::string::String,
4078
4079 /// Locations that could not be reached.
4080 pub unreachable: std::vec::Vec<std::string::String>,
4081
4082 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4083}
4084
4085impl ListServiceClassesResponse {
4086 pub fn new() -> Self {
4087 std::default::Default::default()
4088 }
4089
4090 /// Sets the value of [service_classes][crate::model::ListServiceClassesResponse::service_classes].
4091 ///
4092 /// # Example
4093 /// ```ignore,no_run
4094 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesResponse;
4095 /// use google_cloud_networkconnectivity_v1::model::ServiceClass;
4096 /// let x = ListServiceClassesResponse::new()
4097 /// .set_service_classes([
4098 /// ServiceClass::default()/* use setters */,
4099 /// ServiceClass::default()/* use (different) setters */,
4100 /// ]);
4101 /// ```
4102 pub fn set_service_classes<T, V>(mut self, v: T) -> Self
4103 where
4104 T: std::iter::IntoIterator<Item = V>,
4105 V: std::convert::Into<crate::model::ServiceClass>,
4106 {
4107 use std::iter::Iterator;
4108 self.service_classes = v.into_iter().map(|i| i.into()).collect();
4109 self
4110 }
4111
4112 /// Sets the value of [next_page_token][crate::model::ListServiceClassesResponse::next_page_token].
4113 ///
4114 /// # Example
4115 /// ```ignore,no_run
4116 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesResponse;
4117 /// let x = ListServiceClassesResponse::new().set_next_page_token("example");
4118 /// ```
4119 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4120 self.next_page_token = v.into();
4121 self
4122 }
4123
4124 /// Sets the value of [unreachable][crate::model::ListServiceClassesResponse::unreachable].
4125 ///
4126 /// # Example
4127 /// ```ignore,no_run
4128 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesResponse;
4129 /// let x = ListServiceClassesResponse::new().set_unreachable(["a", "b", "c"]);
4130 /// ```
4131 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4132 where
4133 T: std::iter::IntoIterator<Item = V>,
4134 V: std::convert::Into<std::string::String>,
4135 {
4136 use std::iter::Iterator;
4137 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4138 self
4139 }
4140}
4141
4142impl wkt::message::Message for ListServiceClassesResponse {
4143 fn typename() -> &'static str {
4144 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesResponse"
4145 }
4146}
4147
4148#[doc(hidden)]
4149impl gax::paginator::internal::PageableResponse for ListServiceClassesResponse {
4150 type PageItem = crate::model::ServiceClass;
4151
4152 fn items(self) -> std::vec::Vec<Self::PageItem> {
4153 self.service_classes
4154 }
4155
4156 fn next_page_token(&self) -> std::string::String {
4157 use std::clone::Clone;
4158 self.next_page_token.clone()
4159 }
4160}
4161
4162/// Request for GetServiceClass.
4163#[derive(Clone, Default, PartialEq)]
4164#[non_exhaustive]
4165pub struct GetServiceClassRequest {
4166 /// Required. Name of the ServiceClass to get.
4167 pub name: std::string::String,
4168
4169 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4170}
4171
4172impl GetServiceClassRequest {
4173 pub fn new() -> Self {
4174 std::default::Default::default()
4175 }
4176
4177 /// Sets the value of [name][crate::model::GetServiceClassRequest::name].
4178 ///
4179 /// # Example
4180 /// ```ignore,no_run
4181 /// # use google_cloud_networkconnectivity_v1::model::GetServiceClassRequest;
4182 /// let x = GetServiceClassRequest::new().set_name("example");
4183 /// ```
4184 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4185 self.name = v.into();
4186 self
4187 }
4188}
4189
4190impl wkt::message::Message for GetServiceClassRequest {
4191 fn typename() -> &'static str {
4192 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceClassRequest"
4193 }
4194}
4195
4196/// Request for UpdateServiceClass.
4197#[derive(Clone, Default, PartialEq)]
4198#[non_exhaustive]
4199pub struct UpdateServiceClassRequest {
4200 /// Optional. Field mask is used to specify the fields to be overwritten in the
4201 /// ServiceClass resource by the update.
4202 /// The fields specified in the update_mask are relative to the resource, not
4203 /// the full request. A field will be overwritten if it is in the mask. If the
4204 /// user does not provide a mask then all fields will be overwritten.
4205 pub update_mask: std::option::Option<wkt::FieldMask>,
4206
4207 /// Required. New values to be patched into the resource.
4208 pub service_class: std::option::Option<crate::model::ServiceClass>,
4209
4210 /// Optional. An optional request ID to identify requests. Specify a unique
4211 /// request ID so that if you must retry your request, the server will know to
4212 /// ignore the request if it has already been completed. The server will
4213 /// guarantee that for at least 60 minutes since the first request.
4214 ///
4215 /// For example, consider a situation where you make an initial request and
4216 /// the request times out. If you make the request again with the same request
4217 /// ID, the server can check if original operation with the same request ID
4218 /// was received, and if so, will ignore the second request. This prevents
4219 /// clients from accidentally creating duplicate commitments.
4220 ///
4221 /// The request ID must be a valid UUID with the exception that zero UUID is
4222 /// not supported (00000000-0000-0000-0000-000000000000).
4223 pub request_id: std::string::String,
4224
4225 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4226}
4227
4228impl UpdateServiceClassRequest {
4229 pub fn new() -> Self {
4230 std::default::Default::default()
4231 }
4232
4233 /// Sets the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
4234 ///
4235 /// # Example
4236 /// ```ignore,no_run
4237 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4238 /// use wkt::FieldMask;
4239 /// let x = UpdateServiceClassRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4240 /// ```
4241 pub fn set_update_mask<T>(mut self, v: T) -> Self
4242 where
4243 T: std::convert::Into<wkt::FieldMask>,
4244 {
4245 self.update_mask = std::option::Option::Some(v.into());
4246 self
4247 }
4248
4249 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
4250 ///
4251 /// # Example
4252 /// ```ignore,no_run
4253 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4254 /// use wkt::FieldMask;
4255 /// let x = UpdateServiceClassRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4256 /// let x = UpdateServiceClassRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4257 /// ```
4258 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4259 where
4260 T: std::convert::Into<wkt::FieldMask>,
4261 {
4262 self.update_mask = v.map(|x| x.into());
4263 self
4264 }
4265
4266 /// Sets the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
4267 ///
4268 /// # Example
4269 /// ```ignore,no_run
4270 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4271 /// use google_cloud_networkconnectivity_v1::model::ServiceClass;
4272 /// let x = UpdateServiceClassRequest::new().set_service_class(ServiceClass::default()/* use setters */);
4273 /// ```
4274 pub fn set_service_class<T>(mut self, v: T) -> Self
4275 where
4276 T: std::convert::Into<crate::model::ServiceClass>,
4277 {
4278 self.service_class = std::option::Option::Some(v.into());
4279 self
4280 }
4281
4282 /// Sets or clears the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
4283 ///
4284 /// # Example
4285 /// ```ignore,no_run
4286 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4287 /// use google_cloud_networkconnectivity_v1::model::ServiceClass;
4288 /// let x = UpdateServiceClassRequest::new().set_or_clear_service_class(Some(ServiceClass::default()/* use setters */));
4289 /// let x = UpdateServiceClassRequest::new().set_or_clear_service_class(None::<ServiceClass>);
4290 /// ```
4291 pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
4292 where
4293 T: std::convert::Into<crate::model::ServiceClass>,
4294 {
4295 self.service_class = v.map(|x| x.into());
4296 self
4297 }
4298
4299 /// Sets the value of [request_id][crate::model::UpdateServiceClassRequest::request_id].
4300 ///
4301 /// # Example
4302 /// ```ignore,no_run
4303 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4304 /// let x = UpdateServiceClassRequest::new().set_request_id("example");
4305 /// ```
4306 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4307 self.request_id = v.into();
4308 self
4309 }
4310}
4311
4312impl wkt::message::Message for UpdateServiceClassRequest {
4313 fn typename() -> &'static str {
4314 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceClassRequest"
4315 }
4316}
4317
4318/// Request for DeleteServiceClass.
4319#[derive(Clone, Default, PartialEq)]
4320#[non_exhaustive]
4321pub struct DeleteServiceClassRequest {
4322 /// Required. The name of the ServiceClass to delete.
4323 pub name: std::string::String,
4324
4325 /// Optional. An optional request ID to identify requests. Specify a unique
4326 /// request ID so that if you must retry your request, the server will know to
4327 /// ignore the request if it has already been completed. The server will
4328 /// guarantee that for at least 60 minutes after the first request.
4329 ///
4330 /// For example, consider a situation where you make an initial request and
4331 /// the request times out. If you make the request again with the same request
4332 /// ID, the server can check if original operation with the same request ID
4333 /// was received, and if so, will ignore the second request. This prevents
4334 /// clients from accidentally creating duplicate commitments.
4335 ///
4336 /// The request ID must be a valid UUID with the exception that zero UUID is
4337 /// not supported (00000000-0000-0000-0000-000000000000).
4338 pub request_id: std::string::String,
4339
4340 /// Optional. The etag is computed by the server, and may be sent on update and
4341 /// delete requests to ensure the client has an up-to-date value before
4342 /// proceeding.
4343 pub etag: std::option::Option<std::string::String>,
4344
4345 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4346}
4347
4348impl DeleteServiceClassRequest {
4349 pub fn new() -> Self {
4350 std::default::Default::default()
4351 }
4352
4353 /// Sets the value of [name][crate::model::DeleteServiceClassRequest::name].
4354 ///
4355 /// # Example
4356 /// ```ignore,no_run
4357 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4358 /// let x = DeleteServiceClassRequest::new().set_name("example");
4359 /// ```
4360 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4361 self.name = v.into();
4362 self
4363 }
4364
4365 /// Sets the value of [request_id][crate::model::DeleteServiceClassRequest::request_id].
4366 ///
4367 /// # Example
4368 /// ```ignore,no_run
4369 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4370 /// let x = DeleteServiceClassRequest::new().set_request_id("example");
4371 /// ```
4372 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4373 self.request_id = v.into();
4374 self
4375 }
4376
4377 /// Sets the value of [etag][crate::model::DeleteServiceClassRequest::etag].
4378 ///
4379 /// # Example
4380 /// ```ignore,no_run
4381 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4382 /// let x = DeleteServiceClassRequest::new().set_etag("example");
4383 /// ```
4384 pub fn set_etag<T>(mut self, v: T) -> Self
4385 where
4386 T: std::convert::Into<std::string::String>,
4387 {
4388 self.etag = std::option::Option::Some(v.into());
4389 self
4390 }
4391
4392 /// Sets or clears the value of [etag][crate::model::DeleteServiceClassRequest::etag].
4393 ///
4394 /// # Example
4395 /// ```ignore,no_run
4396 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4397 /// let x = DeleteServiceClassRequest::new().set_or_clear_etag(Some("example"));
4398 /// let x = DeleteServiceClassRequest::new().set_or_clear_etag(None::<String>);
4399 /// ```
4400 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
4401 where
4402 T: std::convert::Into<std::string::String>,
4403 {
4404 self.etag = v.map(|x| x.into());
4405 self
4406 }
4407}
4408
4409impl wkt::message::Message for DeleteServiceClassRequest {
4410 fn typename() -> &'static str {
4411 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceClassRequest"
4412 }
4413}
4414
4415/// The ServiceConnectionToken resource.
4416#[derive(Clone, Default, PartialEq)]
4417#[non_exhaustive]
4418pub struct ServiceConnectionToken {
4419 /// Immutable. The name of a ServiceConnectionToken.
4420 /// Format:
4421 /// projects/{project}/locations/{location}/ServiceConnectionTokens/{service_connection_token}
4422 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
4423 pub name: std::string::String,
4424
4425 /// Output only. Time when the ServiceConnectionToken was created.
4426 pub create_time: std::option::Option<wkt::Timestamp>,
4427
4428 /// Output only. Time when the ServiceConnectionToken was updated.
4429 pub update_time: std::option::Option<wkt::Timestamp>,
4430
4431 /// User-defined labels.
4432 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4433
4434 /// A description of this resource.
4435 pub description: std::string::String,
4436
4437 /// The resource path of the network associated with this token.
4438 /// Example:
4439 /// projects/{projectNumOrId}/global/networks/{resourceId}.
4440 pub network: std::string::String,
4441
4442 /// Output only. The token generated by Automation.
4443 pub token: std::string::String,
4444
4445 /// Output only. The time to which this token is valid.
4446 pub expire_time: std::option::Option<wkt::Timestamp>,
4447
4448 /// Optional. The etag is computed by the server, and may be sent on update and
4449 /// delete requests to ensure the client has an up-to-date value before
4450 /// proceeding.
4451 pub etag: std::option::Option<std::string::String>,
4452
4453 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4454}
4455
4456impl ServiceConnectionToken {
4457 pub fn new() -> Self {
4458 std::default::Default::default()
4459 }
4460
4461 /// Sets the value of [name][crate::model::ServiceConnectionToken::name].
4462 ///
4463 /// # Example
4464 /// ```ignore,no_run
4465 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4466 /// let x = ServiceConnectionToken::new().set_name("example");
4467 /// ```
4468 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4469 self.name = v.into();
4470 self
4471 }
4472
4473 /// Sets the value of [create_time][crate::model::ServiceConnectionToken::create_time].
4474 ///
4475 /// # Example
4476 /// ```ignore,no_run
4477 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4478 /// use wkt::Timestamp;
4479 /// let x = ServiceConnectionToken::new().set_create_time(Timestamp::default()/* use setters */);
4480 /// ```
4481 pub fn set_create_time<T>(mut self, v: T) -> Self
4482 where
4483 T: std::convert::Into<wkt::Timestamp>,
4484 {
4485 self.create_time = std::option::Option::Some(v.into());
4486 self
4487 }
4488
4489 /// Sets or clears the value of [create_time][crate::model::ServiceConnectionToken::create_time].
4490 ///
4491 /// # Example
4492 /// ```ignore,no_run
4493 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4494 /// use wkt::Timestamp;
4495 /// let x = ServiceConnectionToken::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4496 /// let x = ServiceConnectionToken::new().set_or_clear_create_time(None::<Timestamp>);
4497 /// ```
4498 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4499 where
4500 T: std::convert::Into<wkt::Timestamp>,
4501 {
4502 self.create_time = v.map(|x| x.into());
4503 self
4504 }
4505
4506 /// Sets the value of [update_time][crate::model::ServiceConnectionToken::update_time].
4507 ///
4508 /// # Example
4509 /// ```ignore,no_run
4510 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4511 /// use wkt::Timestamp;
4512 /// let x = ServiceConnectionToken::new().set_update_time(Timestamp::default()/* use setters */);
4513 /// ```
4514 pub fn set_update_time<T>(mut self, v: T) -> Self
4515 where
4516 T: std::convert::Into<wkt::Timestamp>,
4517 {
4518 self.update_time = std::option::Option::Some(v.into());
4519 self
4520 }
4521
4522 /// Sets or clears the value of [update_time][crate::model::ServiceConnectionToken::update_time].
4523 ///
4524 /// # Example
4525 /// ```ignore,no_run
4526 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4527 /// use wkt::Timestamp;
4528 /// let x = ServiceConnectionToken::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4529 /// let x = ServiceConnectionToken::new().set_or_clear_update_time(None::<Timestamp>);
4530 /// ```
4531 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4532 where
4533 T: std::convert::Into<wkt::Timestamp>,
4534 {
4535 self.update_time = v.map(|x| x.into());
4536 self
4537 }
4538
4539 /// Sets the value of [labels][crate::model::ServiceConnectionToken::labels].
4540 ///
4541 /// # Example
4542 /// ```ignore,no_run
4543 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4544 /// let x = ServiceConnectionToken::new().set_labels([
4545 /// ("key0", "abc"),
4546 /// ("key1", "xyz"),
4547 /// ]);
4548 /// ```
4549 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4550 where
4551 T: std::iter::IntoIterator<Item = (K, V)>,
4552 K: std::convert::Into<std::string::String>,
4553 V: std::convert::Into<std::string::String>,
4554 {
4555 use std::iter::Iterator;
4556 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4557 self
4558 }
4559
4560 /// Sets the value of [description][crate::model::ServiceConnectionToken::description].
4561 ///
4562 /// # Example
4563 /// ```ignore,no_run
4564 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4565 /// let x = ServiceConnectionToken::new().set_description("example");
4566 /// ```
4567 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4568 self.description = v.into();
4569 self
4570 }
4571
4572 /// Sets the value of [network][crate::model::ServiceConnectionToken::network].
4573 ///
4574 /// # Example
4575 /// ```ignore,no_run
4576 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4577 /// let x = ServiceConnectionToken::new().set_network("example");
4578 /// ```
4579 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4580 self.network = v.into();
4581 self
4582 }
4583
4584 /// Sets the value of [token][crate::model::ServiceConnectionToken::token].
4585 ///
4586 /// # Example
4587 /// ```ignore,no_run
4588 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4589 /// let x = ServiceConnectionToken::new().set_token("example");
4590 /// ```
4591 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4592 self.token = v.into();
4593 self
4594 }
4595
4596 /// Sets the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
4597 ///
4598 /// # Example
4599 /// ```ignore,no_run
4600 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4601 /// use wkt::Timestamp;
4602 /// let x = ServiceConnectionToken::new().set_expire_time(Timestamp::default()/* use setters */);
4603 /// ```
4604 pub fn set_expire_time<T>(mut self, v: T) -> Self
4605 where
4606 T: std::convert::Into<wkt::Timestamp>,
4607 {
4608 self.expire_time = std::option::Option::Some(v.into());
4609 self
4610 }
4611
4612 /// Sets or clears the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
4613 ///
4614 /// # Example
4615 /// ```ignore,no_run
4616 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4617 /// use wkt::Timestamp;
4618 /// let x = ServiceConnectionToken::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
4619 /// let x = ServiceConnectionToken::new().set_or_clear_expire_time(None::<Timestamp>);
4620 /// ```
4621 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
4622 where
4623 T: std::convert::Into<wkt::Timestamp>,
4624 {
4625 self.expire_time = v.map(|x| x.into());
4626 self
4627 }
4628
4629 /// Sets the value of [etag][crate::model::ServiceConnectionToken::etag].
4630 ///
4631 /// # Example
4632 /// ```ignore,no_run
4633 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4634 /// let x = ServiceConnectionToken::new().set_etag("example");
4635 /// ```
4636 pub fn set_etag<T>(mut self, v: T) -> Self
4637 where
4638 T: std::convert::Into<std::string::String>,
4639 {
4640 self.etag = std::option::Option::Some(v.into());
4641 self
4642 }
4643
4644 /// Sets or clears the value of [etag][crate::model::ServiceConnectionToken::etag].
4645 ///
4646 /// # Example
4647 /// ```ignore,no_run
4648 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4649 /// let x = ServiceConnectionToken::new().set_or_clear_etag(Some("example"));
4650 /// let x = ServiceConnectionToken::new().set_or_clear_etag(None::<String>);
4651 /// ```
4652 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
4653 where
4654 T: std::convert::Into<std::string::String>,
4655 {
4656 self.etag = v.map(|x| x.into());
4657 self
4658 }
4659}
4660
4661impl wkt::message::Message for ServiceConnectionToken {
4662 fn typename() -> &'static str {
4663 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionToken"
4664 }
4665}
4666
4667/// Request for ListServiceConnectionTokens.
4668#[derive(Clone, Default, PartialEq)]
4669#[non_exhaustive]
4670pub struct ListServiceConnectionTokensRequest {
4671 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
4672 pub parent: std::string::String,
4673
4674 /// The maximum number of results per page that should be returned.
4675 pub page_size: i32,
4676
4677 /// The page token.
4678 pub page_token: std::string::String,
4679
4680 /// A filter expression that filters the results listed in the response.
4681 pub filter: std::string::String,
4682
4683 /// Sort the results by a certain order.
4684 pub order_by: std::string::String,
4685
4686 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4687}
4688
4689impl ListServiceConnectionTokensRequest {
4690 pub fn new() -> Self {
4691 std::default::Default::default()
4692 }
4693
4694 /// Sets the value of [parent][crate::model::ListServiceConnectionTokensRequest::parent].
4695 ///
4696 /// # Example
4697 /// ```ignore,no_run
4698 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4699 /// let x = ListServiceConnectionTokensRequest::new().set_parent("example");
4700 /// ```
4701 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4702 self.parent = v.into();
4703 self
4704 }
4705
4706 /// Sets the value of [page_size][crate::model::ListServiceConnectionTokensRequest::page_size].
4707 ///
4708 /// # Example
4709 /// ```ignore,no_run
4710 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4711 /// let x = ListServiceConnectionTokensRequest::new().set_page_size(42);
4712 /// ```
4713 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4714 self.page_size = v.into();
4715 self
4716 }
4717
4718 /// Sets the value of [page_token][crate::model::ListServiceConnectionTokensRequest::page_token].
4719 ///
4720 /// # Example
4721 /// ```ignore,no_run
4722 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4723 /// let x = ListServiceConnectionTokensRequest::new().set_page_token("example");
4724 /// ```
4725 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4726 self.page_token = v.into();
4727 self
4728 }
4729
4730 /// Sets the value of [filter][crate::model::ListServiceConnectionTokensRequest::filter].
4731 ///
4732 /// # Example
4733 /// ```ignore,no_run
4734 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4735 /// let x = ListServiceConnectionTokensRequest::new().set_filter("example");
4736 /// ```
4737 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4738 self.filter = v.into();
4739 self
4740 }
4741
4742 /// Sets the value of [order_by][crate::model::ListServiceConnectionTokensRequest::order_by].
4743 ///
4744 /// # Example
4745 /// ```ignore,no_run
4746 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4747 /// let x = ListServiceConnectionTokensRequest::new().set_order_by("example");
4748 /// ```
4749 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4750 self.order_by = v.into();
4751 self
4752 }
4753}
4754
4755impl wkt::message::Message for ListServiceConnectionTokensRequest {
4756 fn typename() -> &'static str {
4757 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensRequest"
4758 }
4759}
4760
4761/// Response for ListServiceConnectionTokens.
4762#[derive(Clone, Default, PartialEq)]
4763#[non_exhaustive]
4764pub struct ListServiceConnectionTokensResponse {
4765 /// ServiceConnectionTokens to be returned.
4766 pub service_connection_tokens: std::vec::Vec<crate::model::ServiceConnectionToken>,
4767
4768 /// The next pagination token in the List response. It should be used as
4769 /// page_token for the following request. An empty value means no more result.
4770 pub next_page_token: std::string::String,
4771
4772 /// Locations that could not be reached.
4773 pub unreachable: std::vec::Vec<std::string::String>,
4774
4775 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4776}
4777
4778impl ListServiceConnectionTokensResponse {
4779 pub fn new() -> Self {
4780 std::default::Default::default()
4781 }
4782
4783 /// Sets the value of [service_connection_tokens][crate::model::ListServiceConnectionTokensResponse::service_connection_tokens].
4784 ///
4785 /// # Example
4786 /// ```ignore,no_run
4787 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensResponse;
4788 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4789 /// let x = ListServiceConnectionTokensResponse::new()
4790 /// .set_service_connection_tokens([
4791 /// ServiceConnectionToken::default()/* use setters */,
4792 /// ServiceConnectionToken::default()/* use (different) setters */,
4793 /// ]);
4794 /// ```
4795 pub fn set_service_connection_tokens<T, V>(mut self, v: T) -> Self
4796 where
4797 T: std::iter::IntoIterator<Item = V>,
4798 V: std::convert::Into<crate::model::ServiceConnectionToken>,
4799 {
4800 use std::iter::Iterator;
4801 self.service_connection_tokens = v.into_iter().map(|i| i.into()).collect();
4802 self
4803 }
4804
4805 /// Sets the value of [next_page_token][crate::model::ListServiceConnectionTokensResponse::next_page_token].
4806 ///
4807 /// # Example
4808 /// ```ignore,no_run
4809 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensResponse;
4810 /// let x = ListServiceConnectionTokensResponse::new().set_next_page_token("example");
4811 /// ```
4812 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4813 self.next_page_token = v.into();
4814 self
4815 }
4816
4817 /// Sets the value of [unreachable][crate::model::ListServiceConnectionTokensResponse::unreachable].
4818 ///
4819 /// # Example
4820 /// ```ignore,no_run
4821 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensResponse;
4822 /// let x = ListServiceConnectionTokensResponse::new().set_unreachable(["a", "b", "c"]);
4823 /// ```
4824 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4825 where
4826 T: std::iter::IntoIterator<Item = V>,
4827 V: std::convert::Into<std::string::String>,
4828 {
4829 use std::iter::Iterator;
4830 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4831 self
4832 }
4833}
4834
4835impl wkt::message::Message for ListServiceConnectionTokensResponse {
4836 fn typename() -> &'static str {
4837 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensResponse"
4838 }
4839}
4840
4841#[doc(hidden)]
4842impl gax::paginator::internal::PageableResponse for ListServiceConnectionTokensResponse {
4843 type PageItem = crate::model::ServiceConnectionToken;
4844
4845 fn items(self) -> std::vec::Vec<Self::PageItem> {
4846 self.service_connection_tokens
4847 }
4848
4849 fn next_page_token(&self) -> std::string::String {
4850 use std::clone::Clone;
4851 self.next_page_token.clone()
4852 }
4853}
4854
4855/// Request for GetServiceConnectionToken.
4856#[derive(Clone, Default, PartialEq)]
4857#[non_exhaustive]
4858pub struct GetServiceConnectionTokenRequest {
4859 /// Required. Name of the ServiceConnectionToken to get.
4860 pub name: std::string::String,
4861
4862 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4863}
4864
4865impl GetServiceConnectionTokenRequest {
4866 pub fn new() -> Self {
4867 std::default::Default::default()
4868 }
4869
4870 /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
4871 ///
4872 /// # Example
4873 /// ```ignore,no_run
4874 /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionTokenRequest;
4875 /// let x = GetServiceConnectionTokenRequest::new().set_name("example");
4876 /// ```
4877 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4878 self.name = v.into();
4879 self
4880 }
4881}
4882
4883impl wkt::message::Message for GetServiceConnectionTokenRequest {
4884 fn typename() -> &'static str {
4885 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionTokenRequest"
4886 }
4887}
4888
4889/// Request for CreateServiceConnectionToken.
4890#[derive(Clone, Default, PartialEq)]
4891#[non_exhaustive]
4892pub struct CreateServiceConnectionTokenRequest {
4893 /// Required. The parent resource's name of the ServiceConnectionToken. ex.
4894 /// projects/123/locations/us-east1
4895 pub parent: std::string::String,
4896
4897 /// Optional. Resource ID
4898 /// (i.e. 'foo' in '[...]/projects/p/locations/l/ServiceConnectionTokens/foo')
4899 /// See <https://google.aip.dev/122#resource-id-segments>
4900 /// Unique per location.
4901 /// If one is not provided, one will be generated.
4902 pub service_connection_token_id: std::string::String,
4903
4904 /// Required. Initial values for a new ServiceConnectionTokens
4905 pub service_connection_token: std::option::Option<crate::model::ServiceConnectionToken>,
4906
4907 /// Optional. An optional request ID to identify requests. Specify a unique
4908 /// request ID so that if you must retry your request, the server will know to
4909 /// ignore the request if it has already been completed. The server will
4910 /// guarantee that for at least 60 minutes since the first request.
4911 ///
4912 /// For example, consider a situation where you make an initial request and
4913 /// the request times out. If you make the request again with the same request
4914 /// ID, the server can check if original operation with the same request ID
4915 /// was received, and if so, will ignore the second request. This prevents
4916 /// clients from accidentally creating duplicate commitments.
4917 ///
4918 /// The request ID must be a valid UUID with the exception that zero UUID is
4919 /// not supported (00000000-0000-0000-0000-000000000000).
4920 pub request_id: std::string::String,
4921
4922 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4923}
4924
4925impl CreateServiceConnectionTokenRequest {
4926 pub fn new() -> Self {
4927 std::default::Default::default()
4928 }
4929
4930 /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
4931 ///
4932 /// # Example
4933 /// ```ignore,no_run
4934 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4935 /// let x = CreateServiceConnectionTokenRequest::new().set_parent("example");
4936 /// ```
4937 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4938 self.parent = v.into();
4939 self
4940 }
4941
4942 /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
4943 ///
4944 /// # Example
4945 /// ```ignore,no_run
4946 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4947 /// let x = CreateServiceConnectionTokenRequest::new().set_service_connection_token_id("example");
4948 /// ```
4949 pub fn set_service_connection_token_id<T: std::convert::Into<std::string::String>>(
4950 mut self,
4951 v: T,
4952 ) -> Self {
4953 self.service_connection_token_id = v.into();
4954 self
4955 }
4956
4957 /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
4958 ///
4959 /// # Example
4960 /// ```ignore,no_run
4961 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4962 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4963 /// let x = CreateServiceConnectionTokenRequest::new().set_service_connection_token(ServiceConnectionToken::default()/* use setters */);
4964 /// ```
4965 pub fn set_service_connection_token<T>(mut self, v: T) -> Self
4966 where
4967 T: std::convert::Into<crate::model::ServiceConnectionToken>,
4968 {
4969 self.service_connection_token = std::option::Option::Some(v.into());
4970 self
4971 }
4972
4973 /// Sets or clears the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
4974 ///
4975 /// # Example
4976 /// ```ignore,no_run
4977 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4978 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4979 /// let x = CreateServiceConnectionTokenRequest::new().set_or_clear_service_connection_token(Some(ServiceConnectionToken::default()/* use setters */));
4980 /// let x = CreateServiceConnectionTokenRequest::new().set_or_clear_service_connection_token(None::<ServiceConnectionToken>);
4981 /// ```
4982 pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
4983 where
4984 T: std::convert::Into<crate::model::ServiceConnectionToken>,
4985 {
4986 self.service_connection_token = v.map(|x| x.into());
4987 self
4988 }
4989
4990 /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
4991 ///
4992 /// # Example
4993 /// ```ignore,no_run
4994 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4995 /// let x = CreateServiceConnectionTokenRequest::new().set_request_id("example");
4996 /// ```
4997 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4998 self.request_id = v.into();
4999 self
5000 }
5001}
5002
5003impl wkt::message::Message for CreateServiceConnectionTokenRequest {
5004 fn typename() -> &'static str {
5005 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionTokenRequest"
5006 }
5007}
5008
5009/// Request for DeleteServiceConnectionToken.
5010#[derive(Clone, Default, PartialEq)]
5011#[non_exhaustive]
5012pub struct DeleteServiceConnectionTokenRequest {
5013 /// Required. The name of the ServiceConnectionToken to delete.
5014 pub name: std::string::String,
5015
5016 /// Optional. An optional request ID to identify requests. Specify a unique
5017 /// request ID so that if you must retry your request, the server will know to
5018 /// ignore the request if it has already been completed. The server will
5019 /// guarantee that for at least 60 minutes after the first request.
5020 ///
5021 /// For example, consider a situation where you make an initial request and
5022 /// the request times out. If you make the request again with the same request
5023 /// ID, the server can check if original operation with the same request ID
5024 /// was received, and if so, will ignore the second request. This prevents
5025 /// clients from accidentally creating duplicate commitments.
5026 ///
5027 /// The request ID must be a valid UUID with the exception that zero UUID is
5028 /// not supported (00000000-0000-0000-0000-000000000000).
5029 pub request_id: std::string::String,
5030
5031 /// Optional. The etag is computed by the server, and may be sent on update and
5032 /// delete requests to ensure the client has an up-to-date value before
5033 /// proceeding.
5034 pub etag: std::option::Option<std::string::String>,
5035
5036 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5037}
5038
5039impl DeleteServiceConnectionTokenRequest {
5040 pub fn new() -> Self {
5041 std::default::Default::default()
5042 }
5043
5044 /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
5045 ///
5046 /// # Example
5047 /// ```ignore,no_run
5048 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5049 /// let x = DeleteServiceConnectionTokenRequest::new().set_name("example");
5050 /// ```
5051 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5052 self.name = v.into();
5053 self
5054 }
5055
5056 /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
5057 ///
5058 /// # Example
5059 /// ```ignore,no_run
5060 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5061 /// let x = DeleteServiceConnectionTokenRequest::new().set_request_id("example");
5062 /// ```
5063 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5064 self.request_id = v.into();
5065 self
5066 }
5067
5068 /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
5069 ///
5070 /// # Example
5071 /// ```ignore,no_run
5072 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5073 /// let x = DeleteServiceConnectionTokenRequest::new().set_etag("example");
5074 /// ```
5075 pub fn set_etag<T>(mut self, v: T) -> Self
5076 where
5077 T: std::convert::Into<std::string::String>,
5078 {
5079 self.etag = std::option::Option::Some(v.into());
5080 self
5081 }
5082
5083 /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
5084 ///
5085 /// # Example
5086 /// ```ignore,no_run
5087 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5088 /// let x = DeleteServiceConnectionTokenRequest::new().set_or_clear_etag(Some("example"));
5089 /// let x = DeleteServiceConnectionTokenRequest::new().set_or_clear_etag(None::<String>);
5090 /// ```
5091 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
5092 where
5093 T: std::convert::Into<std::string::String>,
5094 {
5095 self.etag = v.map(|x| x.into());
5096 self
5097 }
5098}
5099
5100impl wkt::message::Message for DeleteServiceConnectionTokenRequest {
5101 fn typename() -> &'static str {
5102 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionTokenRequest"
5103 }
5104}
5105
5106/// The `MulticloudDataTransferConfig` resource. It lists the services that you
5107/// configure for Data Transfer Essentials billing and metering.
5108#[derive(Clone, Default, PartialEq)]
5109#[non_exhaustive]
5110pub struct MulticloudDataTransferConfig {
5111 /// Identifier. The name of the `MulticloudDataTransferConfig` resource.
5112 /// Format:
5113 /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}`.
5114 pub name: std::string::String,
5115
5116 /// Output only. Time when the `MulticloudDataTransferConfig` resource was
5117 /// created.
5118 pub create_time: std::option::Option<wkt::Timestamp>,
5119
5120 /// Output only. Time when the `MulticloudDataTransferConfig` resource was
5121 /// updated.
5122 pub update_time: std::option::Option<wkt::Timestamp>,
5123
5124 /// Optional. User-defined labels.
5125 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5126
5127 /// The etag is computed by the server, and might be sent with update and
5128 /// delete requests so that the client has an up-to-date value before
5129 /// proceeding.
5130 pub etag: std::string::String,
5131
5132 /// Optional. A description of this resource.
5133 pub description: std::string::String,
5134
5135 /// Output only. The number of `Destination` resources configured for the
5136 /// `MulticloudDataTransferConfig` resource.
5137 pub destinations_count: i32,
5138
5139 /// Output only. The number of `Destination` resources in use with the
5140 /// `MulticloudDataTransferConfig` resource.
5141 pub destinations_active_count: i32,
5142
5143 /// Optional. Maps services to their current or planned states. Service names
5144 /// are keys, and the associated values describe the state of the service. If a
5145 /// state change is expected, the value is either `ADDING` or `DELETING`,
5146 /// depending on the actions taken.
5147 ///
5148 /// Sample output:
5149 /// "services": {
5150 /// "big-query": {
5151 /// "states": [
5152 /// {
5153 /// "effectiveTime": "2024-12-12T08:00:00Z"
5154 /// "state": "ADDING",
5155 /// },
5156 /// ]
5157 /// },
5158 /// "cloud-storage": {
5159 /// "states": [
5160 /// {
5161 /// "state": "ACTIVE",
5162 /// }
5163 /// ]
5164 /// }
5165 /// }
5166 pub services: std::collections::HashMap<std::string::String, crate::model::StateTimeline>,
5167
5168 /// Output only. The Google-generated unique ID for the
5169 /// `MulticloudDataTransferConfig` resource. This value is unique across all
5170 /// `MulticloudDataTransferConfig` resources. If a resource is deleted and
5171 /// another with the same name is created, the new resource is assigned a
5172 /// different and unique ID.
5173 pub uid: std::string::String,
5174
5175 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5176}
5177
5178impl MulticloudDataTransferConfig {
5179 pub fn new() -> Self {
5180 std::default::Default::default()
5181 }
5182
5183 /// Sets the value of [name][crate::model::MulticloudDataTransferConfig::name].
5184 ///
5185 /// # Example
5186 /// ```ignore,no_run
5187 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5188 /// let x = MulticloudDataTransferConfig::new().set_name("example");
5189 /// ```
5190 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5191 self.name = v.into();
5192 self
5193 }
5194
5195 /// Sets the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
5196 ///
5197 /// # Example
5198 /// ```ignore,no_run
5199 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5200 /// use wkt::Timestamp;
5201 /// let x = MulticloudDataTransferConfig::new().set_create_time(Timestamp::default()/* use setters */);
5202 /// ```
5203 pub fn set_create_time<T>(mut self, v: T) -> Self
5204 where
5205 T: std::convert::Into<wkt::Timestamp>,
5206 {
5207 self.create_time = std::option::Option::Some(v.into());
5208 self
5209 }
5210
5211 /// Sets or clears the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
5212 ///
5213 /// # Example
5214 /// ```ignore,no_run
5215 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5216 /// use wkt::Timestamp;
5217 /// let x = MulticloudDataTransferConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5218 /// let x = MulticloudDataTransferConfig::new().set_or_clear_create_time(None::<Timestamp>);
5219 /// ```
5220 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5221 where
5222 T: std::convert::Into<wkt::Timestamp>,
5223 {
5224 self.create_time = v.map(|x| x.into());
5225 self
5226 }
5227
5228 /// Sets the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
5229 ///
5230 /// # Example
5231 /// ```ignore,no_run
5232 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5233 /// use wkt::Timestamp;
5234 /// let x = MulticloudDataTransferConfig::new().set_update_time(Timestamp::default()/* use setters */);
5235 /// ```
5236 pub fn set_update_time<T>(mut self, v: T) -> Self
5237 where
5238 T: std::convert::Into<wkt::Timestamp>,
5239 {
5240 self.update_time = std::option::Option::Some(v.into());
5241 self
5242 }
5243
5244 /// Sets or clears the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
5245 ///
5246 /// # Example
5247 /// ```ignore,no_run
5248 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5249 /// use wkt::Timestamp;
5250 /// let x = MulticloudDataTransferConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5251 /// let x = MulticloudDataTransferConfig::new().set_or_clear_update_time(None::<Timestamp>);
5252 /// ```
5253 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5254 where
5255 T: std::convert::Into<wkt::Timestamp>,
5256 {
5257 self.update_time = v.map(|x| x.into());
5258 self
5259 }
5260
5261 /// Sets the value of [labels][crate::model::MulticloudDataTransferConfig::labels].
5262 ///
5263 /// # Example
5264 /// ```ignore,no_run
5265 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5266 /// let x = MulticloudDataTransferConfig::new().set_labels([
5267 /// ("key0", "abc"),
5268 /// ("key1", "xyz"),
5269 /// ]);
5270 /// ```
5271 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5272 where
5273 T: std::iter::IntoIterator<Item = (K, V)>,
5274 K: std::convert::Into<std::string::String>,
5275 V: std::convert::Into<std::string::String>,
5276 {
5277 use std::iter::Iterator;
5278 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5279 self
5280 }
5281
5282 /// Sets the value of [etag][crate::model::MulticloudDataTransferConfig::etag].
5283 ///
5284 /// # Example
5285 /// ```ignore,no_run
5286 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5287 /// let x = MulticloudDataTransferConfig::new().set_etag("example");
5288 /// ```
5289 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5290 self.etag = v.into();
5291 self
5292 }
5293
5294 /// Sets the value of [description][crate::model::MulticloudDataTransferConfig::description].
5295 ///
5296 /// # Example
5297 /// ```ignore,no_run
5298 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5299 /// let x = MulticloudDataTransferConfig::new().set_description("example");
5300 /// ```
5301 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5302 self.description = v.into();
5303 self
5304 }
5305
5306 /// Sets the value of [destinations_count][crate::model::MulticloudDataTransferConfig::destinations_count].
5307 ///
5308 /// # Example
5309 /// ```ignore,no_run
5310 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5311 /// let x = MulticloudDataTransferConfig::new().set_destinations_count(42);
5312 /// ```
5313 pub fn set_destinations_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5314 self.destinations_count = v.into();
5315 self
5316 }
5317
5318 /// Sets the value of [destinations_active_count][crate::model::MulticloudDataTransferConfig::destinations_active_count].
5319 ///
5320 /// # Example
5321 /// ```ignore,no_run
5322 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5323 /// let x = MulticloudDataTransferConfig::new().set_destinations_active_count(42);
5324 /// ```
5325 pub fn set_destinations_active_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5326 self.destinations_active_count = v.into();
5327 self
5328 }
5329
5330 /// Sets the value of [services][crate::model::MulticloudDataTransferConfig::services].
5331 ///
5332 /// # Example
5333 /// ```ignore,no_run
5334 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5335 /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
5336 /// let x = MulticloudDataTransferConfig::new().set_services([
5337 /// ("key0", StateTimeline::default()/* use setters */),
5338 /// ("key1", StateTimeline::default()/* use (different) setters */),
5339 /// ]);
5340 /// ```
5341 pub fn set_services<T, K, V>(mut self, v: T) -> Self
5342 where
5343 T: std::iter::IntoIterator<Item = (K, V)>,
5344 K: std::convert::Into<std::string::String>,
5345 V: std::convert::Into<crate::model::StateTimeline>,
5346 {
5347 use std::iter::Iterator;
5348 self.services = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5349 self
5350 }
5351
5352 /// Sets the value of [uid][crate::model::MulticloudDataTransferConfig::uid].
5353 ///
5354 /// # Example
5355 /// ```ignore,no_run
5356 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5357 /// let x = MulticloudDataTransferConfig::new().set_uid("example");
5358 /// ```
5359 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5360 self.uid = v.into();
5361 self
5362 }
5363}
5364
5365impl wkt::message::Message for MulticloudDataTransferConfig {
5366 fn typename() -> &'static str {
5367 "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferConfig"
5368 }
5369}
5370
5371/// Request message to list `MulticloudDataTransferConfig` resources.
5372#[derive(Clone, Default, PartialEq)]
5373#[non_exhaustive]
5374pub struct ListMulticloudDataTransferConfigsRequest {
5375 /// Required. The name of the parent resource.
5376 pub parent: std::string::String,
5377
5378 /// Optional. The maximum number of results listed per page.
5379 pub page_size: i32,
5380
5381 /// Optional. The page token.
5382 pub page_token: std::string::String,
5383
5384 /// Optional. An expression that filters the results listed in the response.
5385 pub filter: std::string::String,
5386
5387 /// Optional. The sort order of the results.
5388 pub order_by: std::string::String,
5389
5390 /// Optional. If `true`, allows partial responses for multi-regional aggregated
5391 /// list requests.
5392 pub return_partial_success: bool,
5393
5394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5395}
5396
5397impl ListMulticloudDataTransferConfigsRequest {
5398 pub fn new() -> Self {
5399 std::default::Default::default()
5400 }
5401
5402 /// Sets the value of [parent][crate::model::ListMulticloudDataTransferConfigsRequest::parent].
5403 ///
5404 /// # Example
5405 /// ```ignore,no_run
5406 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5407 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_parent("example");
5408 /// ```
5409 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5410 self.parent = v.into();
5411 self
5412 }
5413
5414 /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferConfigsRequest::page_size].
5415 ///
5416 /// # Example
5417 /// ```ignore,no_run
5418 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5419 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_page_size(42);
5420 /// ```
5421 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5422 self.page_size = v.into();
5423 self
5424 }
5425
5426 /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferConfigsRequest::page_token].
5427 ///
5428 /// # Example
5429 /// ```ignore,no_run
5430 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5431 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_page_token("example");
5432 /// ```
5433 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5434 self.page_token = v.into();
5435 self
5436 }
5437
5438 /// Sets the value of [filter][crate::model::ListMulticloudDataTransferConfigsRequest::filter].
5439 ///
5440 /// # Example
5441 /// ```ignore,no_run
5442 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5443 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_filter("example");
5444 /// ```
5445 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5446 self.filter = v.into();
5447 self
5448 }
5449
5450 /// Sets the value of [order_by][crate::model::ListMulticloudDataTransferConfigsRequest::order_by].
5451 ///
5452 /// # Example
5453 /// ```ignore,no_run
5454 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5455 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_order_by("example");
5456 /// ```
5457 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5458 self.order_by = v.into();
5459 self
5460 }
5461
5462 /// Sets the value of [return_partial_success][crate::model::ListMulticloudDataTransferConfigsRequest::return_partial_success].
5463 ///
5464 /// # Example
5465 /// ```ignore,no_run
5466 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5467 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_return_partial_success(true);
5468 /// ```
5469 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5470 self.return_partial_success = v.into();
5471 self
5472 }
5473}
5474
5475impl wkt::message::Message for ListMulticloudDataTransferConfigsRequest {
5476 fn typename() -> &'static str {
5477 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsRequest"
5478 }
5479}
5480
5481/// Response message to list `MulticloudDataTransferConfig` resources.
5482#[derive(Clone, Default, PartialEq)]
5483#[non_exhaustive]
5484pub struct ListMulticloudDataTransferConfigsResponse {
5485 /// The list of `MulticloudDataTransferConfig` resources to be listed.
5486 pub multicloud_data_transfer_configs: std::vec::Vec<crate::model::MulticloudDataTransferConfig>,
5487
5488 /// The next page token.
5489 pub next_page_token: std::string::String,
5490
5491 /// Locations that could not be reached.
5492 pub unreachable: std::vec::Vec<std::string::String>,
5493
5494 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5495}
5496
5497impl ListMulticloudDataTransferConfigsResponse {
5498 pub fn new() -> Self {
5499 std::default::Default::default()
5500 }
5501
5502 /// Sets the value of [multicloud_data_transfer_configs][crate::model::ListMulticloudDataTransferConfigsResponse::multicloud_data_transfer_configs].
5503 ///
5504 /// # Example
5505 /// ```ignore,no_run
5506 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5507 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5508 /// let x = ListMulticloudDataTransferConfigsResponse::new()
5509 /// .set_multicloud_data_transfer_configs([
5510 /// MulticloudDataTransferConfig::default()/* use setters */,
5511 /// MulticloudDataTransferConfig::default()/* use (different) setters */,
5512 /// ]);
5513 /// ```
5514 pub fn set_multicloud_data_transfer_configs<T, V>(mut self, v: T) -> Self
5515 where
5516 T: std::iter::IntoIterator<Item = V>,
5517 V: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5518 {
5519 use std::iter::Iterator;
5520 self.multicloud_data_transfer_configs = v.into_iter().map(|i| i.into()).collect();
5521 self
5522 }
5523
5524 /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferConfigsResponse::next_page_token].
5525 ///
5526 /// # Example
5527 /// ```ignore,no_run
5528 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5529 /// let x = ListMulticloudDataTransferConfigsResponse::new().set_next_page_token("example");
5530 /// ```
5531 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5532 self.next_page_token = v.into();
5533 self
5534 }
5535
5536 /// Sets the value of [unreachable][crate::model::ListMulticloudDataTransferConfigsResponse::unreachable].
5537 ///
5538 /// # Example
5539 /// ```ignore,no_run
5540 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5541 /// let x = ListMulticloudDataTransferConfigsResponse::new().set_unreachable(["a", "b", "c"]);
5542 /// ```
5543 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5544 where
5545 T: std::iter::IntoIterator<Item = V>,
5546 V: std::convert::Into<std::string::String>,
5547 {
5548 use std::iter::Iterator;
5549 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5550 self
5551 }
5552}
5553
5554impl wkt::message::Message for ListMulticloudDataTransferConfigsResponse {
5555 fn typename() -> &'static str {
5556 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsResponse"
5557 }
5558}
5559
5560#[doc(hidden)]
5561impl gax::paginator::internal::PageableResponse for ListMulticloudDataTransferConfigsResponse {
5562 type PageItem = crate::model::MulticloudDataTransferConfig;
5563
5564 fn items(self) -> std::vec::Vec<Self::PageItem> {
5565 self.multicloud_data_transfer_configs
5566 }
5567
5568 fn next_page_token(&self) -> std::string::String {
5569 use std::clone::Clone;
5570 self.next_page_token.clone()
5571 }
5572}
5573
5574/// Request message to get the details of a `MulticloudDataTransferConfig`
5575/// resource.
5576#[derive(Clone, Default, PartialEq)]
5577#[non_exhaustive]
5578pub struct GetMulticloudDataTransferConfigRequest {
5579 /// Required. The name of the `MulticloudDataTransferConfig` resource to get.
5580 pub name: std::string::String,
5581
5582 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5583}
5584
5585impl GetMulticloudDataTransferConfigRequest {
5586 pub fn new() -> Self {
5587 std::default::Default::default()
5588 }
5589
5590 /// Sets the value of [name][crate::model::GetMulticloudDataTransferConfigRequest::name].
5591 ///
5592 /// # Example
5593 /// ```ignore,no_run
5594 /// # use google_cloud_networkconnectivity_v1::model::GetMulticloudDataTransferConfigRequest;
5595 /// let x = GetMulticloudDataTransferConfigRequest::new().set_name("example");
5596 /// ```
5597 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5598 self.name = v.into();
5599 self
5600 }
5601}
5602
5603impl wkt::message::Message for GetMulticloudDataTransferConfigRequest {
5604 fn typename() -> &'static str {
5605 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferConfigRequest"
5606 }
5607}
5608
5609/// Request message to create a `MulticloudDataTransferConfig` resource.
5610#[derive(Clone, Default, PartialEq)]
5611#[non_exhaustive]
5612pub struct CreateMulticloudDataTransferConfigRequest {
5613 /// Required. The name of the parent resource.
5614 pub parent: std::string::String,
5615
5616 /// Required. The ID to use for the `MulticloudDataTransferConfig` resource,
5617 /// which becomes the final component of the `MulticloudDataTransferConfig`
5618 /// resource name.
5619 pub multicloud_data_transfer_config_id: std::string::String,
5620
5621 /// Required. The `MulticloudDataTransferConfig` resource to create.
5622 pub multicloud_data_transfer_config:
5623 std::option::Option<crate::model::MulticloudDataTransferConfig>,
5624
5625 /// Optional. A request ID to identify requests. Specify a unique request ID
5626 /// so that if you must retry your request, the server can ignore
5627 /// the request if it has already been completed. The server waits
5628 /// for at least 60 minutes since the first request.
5629 ///
5630 /// For example, consider a situation where you make an initial request and
5631 /// the request times out. If you make the request again with the same request
5632 /// ID, the server can check if original operation with the same request ID
5633 /// was received, and if so, can ignore the second request. This prevents
5634 /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5635 /// resources.
5636 ///
5637 /// The request ID must be a valid UUID with the exception that zero UUID
5638 /// (00000000-0000-0000-0000-000000000000) isn't supported.
5639 pub request_id: std::string::String,
5640
5641 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5642}
5643
5644impl CreateMulticloudDataTransferConfigRequest {
5645 pub fn new() -> Self {
5646 std::default::Default::default()
5647 }
5648
5649 /// Sets the value of [parent][crate::model::CreateMulticloudDataTransferConfigRequest::parent].
5650 ///
5651 /// # Example
5652 /// ```ignore,no_run
5653 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5654 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_parent("example");
5655 /// ```
5656 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5657 self.parent = v.into();
5658 self
5659 }
5660
5661 /// Sets the value of [multicloud_data_transfer_config_id][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config_id].
5662 ///
5663 /// # Example
5664 /// ```ignore,no_run
5665 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5666 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config_id("example");
5667 /// ```
5668 pub fn set_multicloud_data_transfer_config_id<T: std::convert::Into<std::string::String>>(
5669 mut self,
5670 v: T,
5671 ) -> Self {
5672 self.multicloud_data_transfer_config_id = v.into();
5673 self
5674 }
5675
5676 /// Sets the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5677 ///
5678 /// # Example
5679 /// ```ignore,no_run
5680 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5681 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5682 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config(MulticloudDataTransferConfig::default()/* use setters */);
5683 /// ```
5684 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
5685 where
5686 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5687 {
5688 self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
5689 self
5690 }
5691
5692 /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5693 ///
5694 /// # Example
5695 /// ```ignore,no_run
5696 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5697 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5698 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(Some(MulticloudDataTransferConfig::default()/* use setters */));
5699 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(None::<MulticloudDataTransferConfig>);
5700 /// ```
5701 pub fn set_or_clear_multicloud_data_transfer_config<T>(
5702 mut self,
5703 v: std::option::Option<T>,
5704 ) -> Self
5705 where
5706 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5707 {
5708 self.multicloud_data_transfer_config = v.map(|x| x.into());
5709 self
5710 }
5711
5712 /// Sets the value of [request_id][crate::model::CreateMulticloudDataTransferConfigRequest::request_id].
5713 ///
5714 /// # Example
5715 /// ```ignore,no_run
5716 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5717 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_request_id("example");
5718 /// ```
5719 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5720 self.request_id = v.into();
5721 self
5722 }
5723}
5724
5725impl wkt::message::Message for CreateMulticloudDataTransferConfigRequest {
5726 fn typename() -> &'static str {
5727 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateMulticloudDataTransferConfigRequest"
5728 }
5729}
5730
5731/// Request message to update a `MulticloudDataTransferConfig` resource.
5732#[derive(Clone, Default, PartialEq)]
5733#[non_exhaustive]
5734pub struct UpdateMulticloudDataTransferConfigRequest {
5735 /// Optional. `FieldMask` is used to specify the fields in the
5736 /// `MulticloudDataTransferConfig` resource to be overwritten by the update.
5737 /// The fields specified in `update_mask` are relative to the resource, not
5738 /// the full request. A field is overwritten if it is in the mask. If you
5739 /// don't specify a mask, all fields are overwritten.
5740 pub update_mask: std::option::Option<wkt::FieldMask>,
5741
5742 /// Required. The `MulticloudDataTransferConfig` resource to update.
5743 pub multicloud_data_transfer_config:
5744 std::option::Option<crate::model::MulticloudDataTransferConfig>,
5745
5746 /// Optional. A request ID to identify requests. Specify a unique request ID
5747 /// so that if you must retry your request, the server can ignore
5748 /// the request if it has already been completed. The server waits
5749 /// for at least 60 minutes since the first request.
5750 ///
5751 /// For example, consider a situation where you make an initial request and
5752 /// the request times out. If you make the request again with the same request
5753 /// ID, the server can check if original operation with the same request ID
5754 /// was received, and if so, can ignore the second request. This prevents
5755 /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5756 /// resources.
5757 ///
5758 /// The request ID must be a valid UUID with the exception that zero UUID
5759 /// (00000000-0000-0000-0000-000000000000) isn't supported.
5760 pub request_id: std::string::String,
5761
5762 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5763}
5764
5765impl UpdateMulticloudDataTransferConfigRequest {
5766 pub fn new() -> Self {
5767 std::default::Default::default()
5768 }
5769
5770 /// Sets the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
5771 ///
5772 /// # Example
5773 /// ```ignore,no_run
5774 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5775 /// use wkt::FieldMask;
5776 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5777 /// ```
5778 pub fn set_update_mask<T>(mut self, v: T) -> Self
5779 where
5780 T: std::convert::Into<wkt::FieldMask>,
5781 {
5782 self.update_mask = std::option::Option::Some(v.into());
5783 self
5784 }
5785
5786 /// Sets or clears the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
5787 ///
5788 /// # Example
5789 /// ```ignore,no_run
5790 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5791 /// use wkt::FieldMask;
5792 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5793 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5794 /// ```
5795 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5796 where
5797 T: std::convert::Into<wkt::FieldMask>,
5798 {
5799 self.update_mask = v.map(|x| x.into());
5800 self
5801 }
5802
5803 /// Sets the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5804 ///
5805 /// # Example
5806 /// ```ignore,no_run
5807 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5808 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5809 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config(MulticloudDataTransferConfig::default()/* use setters */);
5810 /// ```
5811 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
5812 where
5813 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5814 {
5815 self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
5816 self
5817 }
5818
5819 /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5820 ///
5821 /// # Example
5822 /// ```ignore,no_run
5823 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5824 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5825 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(Some(MulticloudDataTransferConfig::default()/* use setters */));
5826 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(None::<MulticloudDataTransferConfig>);
5827 /// ```
5828 pub fn set_or_clear_multicloud_data_transfer_config<T>(
5829 mut self,
5830 v: std::option::Option<T>,
5831 ) -> Self
5832 where
5833 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5834 {
5835 self.multicloud_data_transfer_config = v.map(|x| x.into());
5836 self
5837 }
5838
5839 /// Sets the value of [request_id][crate::model::UpdateMulticloudDataTransferConfigRequest::request_id].
5840 ///
5841 /// # Example
5842 /// ```ignore,no_run
5843 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5844 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_request_id("example");
5845 /// ```
5846 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5847 self.request_id = v.into();
5848 self
5849 }
5850}
5851
5852impl wkt::message::Message for UpdateMulticloudDataTransferConfigRequest {
5853 fn typename() -> &'static str {
5854 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateMulticloudDataTransferConfigRequest"
5855 }
5856}
5857
5858/// Request message to delete a `MulticloudDataTransferConfig` resource.
5859#[derive(Clone, Default, PartialEq)]
5860#[non_exhaustive]
5861pub struct DeleteMulticloudDataTransferConfigRequest {
5862 /// Required. The name of the `MulticloudDataTransferConfig` resource to
5863 /// delete.
5864 pub name: std::string::String,
5865
5866 /// Optional. A request ID to identify requests. Specify a unique request ID
5867 /// so that if you must retry your request, the server can ignore
5868 /// the request if it has already been completed. The server waits
5869 /// for at least 60 minutes since the first request.
5870 ///
5871 /// For example, consider a situation where you make an initial request and
5872 /// the request times out. If you make the request again with the same request
5873 /// ID, the server can check if original operation with the same request ID
5874 /// was received, and if so, can ignore the second request. This prevents
5875 /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5876 /// resources.
5877 ///
5878 /// The request ID must be a valid UUID with the exception that zero UUID
5879 /// (00000000-0000-0000-0000-000000000000) isn't supported.
5880 pub request_id: std::string::String,
5881
5882 /// Optional. The etag is computed by the server, and might be sent with update
5883 /// and delete requests so that the client has an up-to-date value before
5884 /// proceeding.
5885 pub etag: std::string::String,
5886
5887 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5888}
5889
5890impl DeleteMulticloudDataTransferConfigRequest {
5891 pub fn new() -> Self {
5892 std::default::Default::default()
5893 }
5894
5895 /// Sets the value of [name][crate::model::DeleteMulticloudDataTransferConfigRequest::name].
5896 ///
5897 /// # Example
5898 /// ```ignore,no_run
5899 /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
5900 /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_name("example");
5901 /// ```
5902 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5903 self.name = v.into();
5904 self
5905 }
5906
5907 /// Sets the value of [request_id][crate::model::DeleteMulticloudDataTransferConfigRequest::request_id].
5908 ///
5909 /// # Example
5910 /// ```ignore,no_run
5911 /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
5912 /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_request_id("example");
5913 /// ```
5914 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5915 self.request_id = v.into();
5916 self
5917 }
5918
5919 /// Sets the value of [etag][crate::model::DeleteMulticloudDataTransferConfigRequest::etag].
5920 ///
5921 /// # Example
5922 /// ```ignore,no_run
5923 /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
5924 /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_etag("example");
5925 /// ```
5926 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5927 self.etag = v.into();
5928 self
5929 }
5930}
5931
5932impl wkt::message::Message for DeleteMulticloudDataTransferConfigRequest {
5933 fn typename() -> &'static str {
5934 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteMulticloudDataTransferConfigRequest"
5935 }
5936}
5937
5938/// The `Destination` resource. It specifies the IP prefix and the associated
5939/// autonomous system numbers (ASN) that you want to include in a
5940/// `MulticloudDataTransferConfig` resource.
5941#[derive(Clone, Default, PartialEq)]
5942#[non_exhaustive]
5943pub struct Destination {
5944 /// Identifier. The name of the `Destination` resource.
5945 /// Format:
5946 /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}/destinations/{destination}`.
5947 pub name: std::string::String,
5948
5949 /// Output only. Time when the `Destination` resource was created.
5950 pub create_time: std::option::Option<wkt::Timestamp>,
5951
5952 /// Output only. Time when the `Destination` resource was updated.
5953 pub update_time: std::option::Option<wkt::Timestamp>,
5954
5955 /// Optional. User-defined labels.
5956 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5957
5958 /// The etag is computed by the server, and might be sent with update and
5959 /// delete requests so that the client has an up-to-date value before
5960 /// proceeding.
5961 pub etag: std::string::String,
5962
5963 /// Optional. A description of this resource.
5964 pub description: std::string::String,
5965
5966 /// Required. Immutable. The IP prefix that represents your workload on another
5967 /// CSP.
5968 pub ip_prefix: std::string::String,
5969
5970 /// Required. Unordered list. The list of `DestinationEndpoint` resources
5971 /// configured for the IP prefix.
5972 pub endpoints: std::vec::Vec<crate::model::destination::DestinationEndpoint>,
5973
5974 /// Output only. The timeline of the expected `Destination` states or the
5975 /// current rest state. If a state change is expected, the value is `ADDING`,
5976 /// `DELETING` or `SUSPENDING`, depending on the action specified.
5977 ///
5978 /// Example:
5979 /// "state_timeline": {
5980 /// "states": [
5981 /// {
5982 /// // The time when the `Destination` resource will be activated.
5983 /// "effectiveTime": "2024-12-01T08:00:00Z",
5984 /// "state": "ADDING"
5985 /// },
5986 /// {
5987 /// // The time when the `Destination` resource will be suspended.
5988 /// "effectiveTime": "2024-12-01T20:00:00Z",
5989 /// "state": "SUSPENDING"
5990 /// }
5991 /// ]
5992 /// }
5993 pub state_timeline: std::option::Option<crate::model::StateTimeline>,
5994
5995 /// Output only. The Google-generated unique ID for the `Destination` resource.
5996 /// This value is unique across all `Destination` resources.
5997 /// If a resource is deleted and another with the same name is
5998 /// created, the new resource is assigned a different and unique ID.
5999 pub uid: std::string::String,
6000
6001 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6002}
6003
6004impl Destination {
6005 pub fn new() -> Self {
6006 std::default::Default::default()
6007 }
6008
6009 /// Sets the value of [name][crate::model::Destination::name].
6010 ///
6011 /// # Example
6012 /// ```ignore,no_run
6013 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6014 /// let x = Destination::new().set_name("example");
6015 /// ```
6016 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6017 self.name = v.into();
6018 self
6019 }
6020
6021 /// Sets the value of [create_time][crate::model::Destination::create_time].
6022 ///
6023 /// # Example
6024 /// ```ignore,no_run
6025 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6026 /// use wkt::Timestamp;
6027 /// let x = Destination::new().set_create_time(Timestamp::default()/* use setters */);
6028 /// ```
6029 pub fn set_create_time<T>(mut self, v: T) -> Self
6030 where
6031 T: std::convert::Into<wkt::Timestamp>,
6032 {
6033 self.create_time = std::option::Option::Some(v.into());
6034 self
6035 }
6036
6037 /// Sets or clears the value of [create_time][crate::model::Destination::create_time].
6038 ///
6039 /// # Example
6040 /// ```ignore,no_run
6041 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6042 /// use wkt::Timestamp;
6043 /// let x = Destination::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6044 /// let x = Destination::new().set_or_clear_create_time(None::<Timestamp>);
6045 /// ```
6046 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6047 where
6048 T: std::convert::Into<wkt::Timestamp>,
6049 {
6050 self.create_time = v.map(|x| x.into());
6051 self
6052 }
6053
6054 /// Sets the value of [update_time][crate::model::Destination::update_time].
6055 ///
6056 /// # Example
6057 /// ```ignore,no_run
6058 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6059 /// use wkt::Timestamp;
6060 /// let x = Destination::new().set_update_time(Timestamp::default()/* use setters */);
6061 /// ```
6062 pub fn set_update_time<T>(mut self, v: T) -> Self
6063 where
6064 T: std::convert::Into<wkt::Timestamp>,
6065 {
6066 self.update_time = std::option::Option::Some(v.into());
6067 self
6068 }
6069
6070 /// Sets or clears the value of [update_time][crate::model::Destination::update_time].
6071 ///
6072 /// # Example
6073 /// ```ignore,no_run
6074 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6075 /// use wkt::Timestamp;
6076 /// let x = Destination::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6077 /// let x = Destination::new().set_or_clear_update_time(None::<Timestamp>);
6078 /// ```
6079 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6080 where
6081 T: std::convert::Into<wkt::Timestamp>,
6082 {
6083 self.update_time = v.map(|x| x.into());
6084 self
6085 }
6086
6087 /// Sets the value of [labels][crate::model::Destination::labels].
6088 ///
6089 /// # Example
6090 /// ```ignore,no_run
6091 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6092 /// let x = Destination::new().set_labels([
6093 /// ("key0", "abc"),
6094 /// ("key1", "xyz"),
6095 /// ]);
6096 /// ```
6097 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6098 where
6099 T: std::iter::IntoIterator<Item = (K, V)>,
6100 K: std::convert::Into<std::string::String>,
6101 V: std::convert::Into<std::string::String>,
6102 {
6103 use std::iter::Iterator;
6104 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6105 self
6106 }
6107
6108 /// Sets the value of [etag][crate::model::Destination::etag].
6109 ///
6110 /// # Example
6111 /// ```ignore,no_run
6112 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6113 /// let x = Destination::new().set_etag("example");
6114 /// ```
6115 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6116 self.etag = v.into();
6117 self
6118 }
6119
6120 /// Sets the value of [description][crate::model::Destination::description].
6121 ///
6122 /// # Example
6123 /// ```ignore,no_run
6124 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6125 /// let x = Destination::new().set_description("example");
6126 /// ```
6127 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6128 self.description = v.into();
6129 self
6130 }
6131
6132 /// Sets the value of [ip_prefix][crate::model::Destination::ip_prefix].
6133 ///
6134 /// # Example
6135 /// ```ignore,no_run
6136 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6137 /// let x = Destination::new().set_ip_prefix("example");
6138 /// ```
6139 pub fn set_ip_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6140 self.ip_prefix = v.into();
6141 self
6142 }
6143
6144 /// Sets the value of [endpoints][crate::model::Destination::endpoints].
6145 ///
6146 /// # Example
6147 /// ```ignore,no_run
6148 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6149 /// use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6150 /// let x = Destination::new()
6151 /// .set_endpoints([
6152 /// DestinationEndpoint::default()/* use setters */,
6153 /// DestinationEndpoint::default()/* use (different) setters */,
6154 /// ]);
6155 /// ```
6156 pub fn set_endpoints<T, V>(mut self, v: T) -> Self
6157 where
6158 T: std::iter::IntoIterator<Item = V>,
6159 V: std::convert::Into<crate::model::destination::DestinationEndpoint>,
6160 {
6161 use std::iter::Iterator;
6162 self.endpoints = v.into_iter().map(|i| i.into()).collect();
6163 self
6164 }
6165
6166 /// Sets the value of [state_timeline][crate::model::Destination::state_timeline].
6167 ///
6168 /// # Example
6169 /// ```ignore,no_run
6170 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6171 /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
6172 /// let x = Destination::new().set_state_timeline(StateTimeline::default()/* use setters */);
6173 /// ```
6174 pub fn set_state_timeline<T>(mut self, v: T) -> Self
6175 where
6176 T: std::convert::Into<crate::model::StateTimeline>,
6177 {
6178 self.state_timeline = std::option::Option::Some(v.into());
6179 self
6180 }
6181
6182 /// Sets or clears the value of [state_timeline][crate::model::Destination::state_timeline].
6183 ///
6184 /// # Example
6185 /// ```ignore,no_run
6186 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6187 /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
6188 /// let x = Destination::new().set_or_clear_state_timeline(Some(StateTimeline::default()/* use setters */));
6189 /// let x = Destination::new().set_or_clear_state_timeline(None::<StateTimeline>);
6190 /// ```
6191 pub fn set_or_clear_state_timeline<T>(mut self, v: std::option::Option<T>) -> Self
6192 where
6193 T: std::convert::Into<crate::model::StateTimeline>,
6194 {
6195 self.state_timeline = v.map(|x| x.into());
6196 self
6197 }
6198
6199 /// Sets the value of [uid][crate::model::Destination::uid].
6200 ///
6201 /// # Example
6202 /// ```ignore,no_run
6203 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6204 /// let x = Destination::new().set_uid("example");
6205 /// ```
6206 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6207 self.uid = v.into();
6208 self
6209 }
6210}
6211
6212impl wkt::message::Message for Destination {
6213 fn typename() -> &'static str {
6214 "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination"
6215 }
6216}
6217
6218/// Defines additional types related to [Destination].
6219pub mod destination {
6220 #[allow(unused_imports)]
6221 use super::*;
6222
6223 /// The metadata for a `DestinationEndpoint` resource.
6224 #[derive(Clone, Default, PartialEq)]
6225 #[non_exhaustive]
6226 pub struct DestinationEndpoint {
6227 /// Required. The ASN of the remote IP prefix.
6228 pub asn: i64,
6229
6230 /// Required. The CSP of the remote IP prefix.
6231 pub csp: std::string::String,
6232
6233 /// Output only. The state of the `DestinationEndpoint` resource.
6234 pub state: crate::model::destination::destination_endpoint::State,
6235
6236 /// Output only. Time when the `DestinationEndpoint` resource was updated.
6237 pub update_time: std::option::Option<wkt::Timestamp>,
6238
6239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6240 }
6241
6242 impl DestinationEndpoint {
6243 pub fn new() -> Self {
6244 std::default::Default::default()
6245 }
6246
6247 /// Sets the value of [asn][crate::model::destination::DestinationEndpoint::asn].
6248 ///
6249 /// # Example
6250 /// ```ignore,no_run
6251 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6252 /// let x = DestinationEndpoint::new().set_asn(42);
6253 /// ```
6254 pub fn set_asn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6255 self.asn = v.into();
6256 self
6257 }
6258
6259 /// Sets the value of [csp][crate::model::destination::DestinationEndpoint::csp].
6260 ///
6261 /// # Example
6262 /// ```ignore,no_run
6263 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6264 /// let x = DestinationEndpoint::new().set_csp("example");
6265 /// ```
6266 pub fn set_csp<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6267 self.csp = v.into();
6268 self
6269 }
6270
6271 /// Sets the value of [state][crate::model::destination::DestinationEndpoint::state].
6272 ///
6273 /// # Example
6274 /// ```ignore,no_run
6275 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6276 /// use google_cloud_networkconnectivity_v1::model::destination::destination_endpoint::State;
6277 /// let x0 = DestinationEndpoint::new().set_state(State::Valid);
6278 /// let x1 = DestinationEndpoint::new().set_state(State::Invalid);
6279 /// ```
6280 pub fn set_state<
6281 T: std::convert::Into<crate::model::destination::destination_endpoint::State>,
6282 >(
6283 mut self,
6284 v: T,
6285 ) -> Self {
6286 self.state = v.into();
6287 self
6288 }
6289
6290 /// Sets the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
6291 ///
6292 /// # Example
6293 /// ```ignore,no_run
6294 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6295 /// use wkt::Timestamp;
6296 /// let x = DestinationEndpoint::new().set_update_time(Timestamp::default()/* use setters */);
6297 /// ```
6298 pub fn set_update_time<T>(mut self, v: T) -> Self
6299 where
6300 T: std::convert::Into<wkt::Timestamp>,
6301 {
6302 self.update_time = std::option::Option::Some(v.into());
6303 self
6304 }
6305
6306 /// Sets or clears the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
6307 ///
6308 /// # Example
6309 /// ```ignore,no_run
6310 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6311 /// use wkt::Timestamp;
6312 /// let x = DestinationEndpoint::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6313 /// let x = DestinationEndpoint::new().set_or_clear_update_time(None::<Timestamp>);
6314 /// ```
6315 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6316 where
6317 T: std::convert::Into<wkt::Timestamp>,
6318 {
6319 self.update_time = v.map(|x| x.into());
6320 self
6321 }
6322 }
6323
6324 impl wkt::message::Message for DestinationEndpoint {
6325 fn typename() -> &'static str {
6326 "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint"
6327 }
6328 }
6329
6330 /// Defines additional types related to [DestinationEndpoint].
6331 pub mod destination_endpoint {
6332 #[allow(unused_imports)]
6333 use super::*;
6334
6335 /// The state of the `DestinationEndpoint` resource.
6336 ///
6337 /// # Working with unknown values
6338 ///
6339 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6340 /// additional enum variants at any time. Adding new variants is not considered
6341 /// a breaking change. Applications should write their code in anticipation of:
6342 ///
6343 /// - New values appearing in future releases of the client library, **and**
6344 /// - New values received dynamically, without application changes.
6345 ///
6346 /// Please consult the [Working with enums] section in the user guide for some
6347 /// guidelines.
6348 ///
6349 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6350 #[derive(Clone, Debug, PartialEq)]
6351 #[non_exhaustive]
6352 pub enum State {
6353 /// An invalid state, which is the default case.
6354 Unspecified,
6355 /// The `DestinationEndpoint` resource is valid.
6356 Valid,
6357 /// The `DestinationEndpoint` resource is invalid.
6358 Invalid,
6359 /// If set, the enum was initialized with an unknown value.
6360 ///
6361 /// Applications can examine the value using [State::value] or
6362 /// [State::name].
6363 UnknownValue(state::UnknownValue),
6364 }
6365
6366 #[doc(hidden)]
6367 pub mod state {
6368 #[allow(unused_imports)]
6369 use super::*;
6370 #[derive(Clone, Debug, PartialEq)]
6371 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6372 }
6373
6374 impl State {
6375 /// Gets the enum value.
6376 ///
6377 /// Returns `None` if the enum contains an unknown value deserialized from
6378 /// the string representation of enums.
6379 pub fn value(&self) -> std::option::Option<i32> {
6380 match self {
6381 Self::Unspecified => std::option::Option::Some(0),
6382 Self::Valid => std::option::Option::Some(1),
6383 Self::Invalid => std::option::Option::Some(2),
6384 Self::UnknownValue(u) => u.0.value(),
6385 }
6386 }
6387
6388 /// Gets the enum value as a string.
6389 ///
6390 /// Returns `None` if the enum contains an unknown value deserialized from
6391 /// the integer representation of enums.
6392 pub fn name(&self) -> std::option::Option<&str> {
6393 match self {
6394 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6395 Self::Valid => std::option::Option::Some("VALID"),
6396 Self::Invalid => std::option::Option::Some("INVALID"),
6397 Self::UnknownValue(u) => u.0.name(),
6398 }
6399 }
6400 }
6401
6402 impl std::default::Default for State {
6403 fn default() -> Self {
6404 use std::convert::From;
6405 Self::from(0)
6406 }
6407 }
6408
6409 impl std::fmt::Display for State {
6410 fn fmt(
6411 &self,
6412 f: &mut std::fmt::Formatter<'_>,
6413 ) -> std::result::Result<(), std::fmt::Error> {
6414 wkt::internal::display_enum(f, self.name(), self.value())
6415 }
6416 }
6417
6418 impl std::convert::From<i32> for State {
6419 fn from(value: i32) -> Self {
6420 match value {
6421 0 => Self::Unspecified,
6422 1 => Self::Valid,
6423 2 => Self::Invalid,
6424 _ => Self::UnknownValue(state::UnknownValue(
6425 wkt::internal::UnknownEnumValue::Integer(value),
6426 )),
6427 }
6428 }
6429 }
6430
6431 impl std::convert::From<&str> for State {
6432 fn from(value: &str) -> Self {
6433 use std::string::ToString;
6434 match value {
6435 "STATE_UNSPECIFIED" => Self::Unspecified,
6436 "VALID" => Self::Valid,
6437 "INVALID" => Self::Invalid,
6438 _ => Self::UnknownValue(state::UnknownValue(
6439 wkt::internal::UnknownEnumValue::String(value.to_string()),
6440 )),
6441 }
6442 }
6443 }
6444
6445 impl serde::ser::Serialize for State {
6446 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6447 where
6448 S: serde::Serializer,
6449 {
6450 match self {
6451 Self::Unspecified => serializer.serialize_i32(0),
6452 Self::Valid => serializer.serialize_i32(1),
6453 Self::Invalid => serializer.serialize_i32(2),
6454 Self::UnknownValue(u) => u.0.serialize(serializer),
6455 }
6456 }
6457 }
6458
6459 impl<'de> serde::de::Deserialize<'de> for State {
6460 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6461 where
6462 D: serde::Deserializer<'de>,
6463 {
6464 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6465 ".google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint.State",
6466 ))
6467 }
6468 }
6469 }
6470}
6471
6472/// Request message to list `Destination` resources.
6473#[derive(Clone, Default, PartialEq)]
6474#[non_exhaustive]
6475pub struct ListDestinationsRequest {
6476 /// Required. The name of the parent resource.
6477 pub parent: std::string::String,
6478
6479 /// Optional. The maximum number of results listed per page.
6480 pub page_size: i32,
6481
6482 /// Optional. The page token.
6483 pub page_token: std::string::String,
6484
6485 /// Optional. An expression that filters the results listed in the response.
6486 pub filter: std::string::String,
6487
6488 /// Optional. The sort order of the results.
6489 pub order_by: std::string::String,
6490
6491 /// Optional. If `true`, allow partial responses for multi-regional aggregated
6492 /// list requests.
6493 pub return_partial_success: bool,
6494
6495 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6496}
6497
6498impl ListDestinationsRequest {
6499 pub fn new() -> Self {
6500 std::default::Default::default()
6501 }
6502
6503 /// Sets the value of [parent][crate::model::ListDestinationsRequest::parent].
6504 ///
6505 /// # Example
6506 /// ```ignore,no_run
6507 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6508 /// let x = ListDestinationsRequest::new().set_parent("example");
6509 /// ```
6510 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6511 self.parent = v.into();
6512 self
6513 }
6514
6515 /// Sets the value of [page_size][crate::model::ListDestinationsRequest::page_size].
6516 ///
6517 /// # Example
6518 /// ```ignore,no_run
6519 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6520 /// let x = ListDestinationsRequest::new().set_page_size(42);
6521 /// ```
6522 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6523 self.page_size = v.into();
6524 self
6525 }
6526
6527 /// Sets the value of [page_token][crate::model::ListDestinationsRequest::page_token].
6528 ///
6529 /// # Example
6530 /// ```ignore,no_run
6531 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6532 /// let x = ListDestinationsRequest::new().set_page_token("example");
6533 /// ```
6534 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6535 self.page_token = v.into();
6536 self
6537 }
6538
6539 /// Sets the value of [filter][crate::model::ListDestinationsRequest::filter].
6540 ///
6541 /// # Example
6542 /// ```ignore,no_run
6543 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6544 /// let x = ListDestinationsRequest::new().set_filter("example");
6545 /// ```
6546 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6547 self.filter = v.into();
6548 self
6549 }
6550
6551 /// Sets the value of [order_by][crate::model::ListDestinationsRequest::order_by].
6552 ///
6553 /// # Example
6554 /// ```ignore,no_run
6555 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6556 /// let x = ListDestinationsRequest::new().set_order_by("example");
6557 /// ```
6558 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6559 self.order_by = v.into();
6560 self
6561 }
6562
6563 /// Sets the value of [return_partial_success][crate::model::ListDestinationsRequest::return_partial_success].
6564 ///
6565 /// # Example
6566 /// ```ignore,no_run
6567 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6568 /// let x = ListDestinationsRequest::new().set_return_partial_success(true);
6569 /// ```
6570 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6571 self.return_partial_success = v.into();
6572 self
6573 }
6574}
6575
6576impl wkt::message::Message for ListDestinationsRequest {
6577 fn typename() -> &'static str {
6578 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsRequest"
6579 }
6580}
6581
6582/// Response message to list `Destination` resources.
6583#[derive(Clone, Default, PartialEq)]
6584#[non_exhaustive]
6585pub struct ListDestinationsResponse {
6586 /// The list of `Destination` resources to be listed.
6587 pub destinations: std::vec::Vec<crate::model::Destination>,
6588
6589 /// The next page token.
6590 pub next_page_token: std::string::String,
6591
6592 /// Locations that could not be reached.
6593 pub unreachable: std::vec::Vec<std::string::String>,
6594
6595 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6596}
6597
6598impl ListDestinationsResponse {
6599 pub fn new() -> Self {
6600 std::default::Default::default()
6601 }
6602
6603 /// Sets the value of [destinations][crate::model::ListDestinationsResponse::destinations].
6604 ///
6605 /// # Example
6606 /// ```ignore,no_run
6607 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6608 /// use google_cloud_networkconnectivity_v1::model::Destination;
6609 /// let x = ListDestinationsResponse::new()
6610 /// .set_destinations([
6611 /// Destination::default()/* use setters */,
6612 /// Destination::default()/* use (different) setters */,
6613 /// ]);
6614 /// ```
6615 pub fn set_destinations<T, V>(mut self, v: T) -> Self
6616 where
6617 T: std::iter::IntoIterator<Item = V>,
6618 V: std::convert::Into<crate::model::Destination>,
6619 {
6620 use std::iter::Iterator;
6621 self.destinations = v.into_iter().map(|i| i.into()).collect();
6622 self
6623 }
6624
6625 /// Sets the value of [next_page_token][crate::model::ListDestinationsResponse::next_page_token].
6626 ///
6627 /// # Example
6628 /// ```ignore,no_run
6629 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6630 /// let x = ListDestinationsResponse::new().set_next_page_token("example");
6631 /// ```
6632 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6633 self.next_page_token = v.into();
6634 self
6635 }
6636
6637 /// Sets the value of [unreachable][crate::model::ListDestinationsResponse::unreachable].
6638 ///
6639 /// # Example
6640 /// ```ignore,no_run
6641 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6642 /// let x = ListDestinationsResponse::new().set_unreachable(["a", "b", "c"]);
6643 /// ```
6644 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6645 where
6646 T: std::iter::IntoIterator<Item = V>,
6647 V: std::convert::Into<std::string::String>,
6648 {
6649 use std::iter::Iterator;
6650 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6651 self
6652 }
6653}
6654
6655impl wkt::message::Message for ListDestinationsResponse {
6656 fn typename() -> &'static str {
6657 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsResponse"
6658 }
6659}
6660
6661#[doc(hidden)]
6662impl gax::paginator::internal::PageableResponse for ListDestinationsResponse {
6663 type PageItem = crate::model::Destination;
6664
6665 fn items(self) -> std::vec::Vec<Self::PageItem> {
6666 self.destinations
6667 }
6668
6669 fn next_page_token(&self) -> std::string::String {
6670 use std::clone::Clone;
6671 self.next_page_token.clone()
6672 }
6673}
6674
6675/// Request message to get the details of a `Destination` resource.
6676#[derive(Clone, Default, PartialEq)]
6677#[non_exhaustive]
6678pub struct GetDestinationRequest {
6679 /// Required. The name of the `Destination` resource to get.
6680 pub name: std::string::String,
6681
6682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6683}
6684
6685impl GetDestinationRequest {
6686 pub fn new() -> Self {
6687 std::default::Default::default()
6688 }
6689
6690 /// Sets the value of [name][crate::model::GetDestinationRequest::name].
6691 ///
6692 /// # Example
6693 /// ```ignore,no_run
6694 /// # use google_cloud_networkconnectivity_v1::model::GetDestinationRequest;
6695 /// let x = GetDestinationRequest::new().set_name("example");
6696 /// ```
6697 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6698 self.name = v.into();
6699 self
6700 }
6701}
6702
6703impl wkt::message::Message for GetDestinationRequest {
6704 fn typename() -> &'static str {
6705 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetDestinationRequest"
6706 }
6707}
6708
6709/// Request message to create a `Destination` resource.
6710#[derive(Clone, Default, PartialEq)]
6711#[non_exhaustive]
6712pub struct CreateDestinationRequest {
6713 /// Required. The name of the parent resource.
6714 pub parent: std::string::String,
6715
6716 /// Required. The ID to use for the `Destination` resource, which becomes the
6717 /// final component of the `Destination` resource name.
6718 pub destination_id: std::string::String,
6719
6720 /// Required. The `Destination` resource to create.
6721 pub destination: std::option::Option<crate::model::Destination>,
6722
6723 /// Optional. A request ID to identify requests. Specify a unique request ID
6724 /// so that if you must retry your request, the server can ignore
6725 /// the request if it has already been completed. The server waits
6726 /// for at least 60 minutes since the first request.
6727 ///
6728 /// For example, consider a situation where you make an initial request and
6729 /// the request times out. If you make the request again with the same request
6730 /// ID, the server can check if original operation with the same request ID
6731 /// was received, and if so, can ignore the second request. This prevents
6732 /// clients from accidentally creating duplicate `Destination`
6733 /// resources.
6734 ///
6735 /// The request ID must be a valid UUID with the exception that zero UUID
6736 /// (00000000-0000-0000-0000-000000000000) isn't supported.
6737 pub request_id: std::string::String,
6738
6739 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6740}
6741
6742impl CreateDestinationRequest {
6743 pub fn new() -> Self {
6744 std::default::Default::default()
6745 }
6746
6747 /// Sets the value of [parent][crate::model::CreateDestinationRequest::parent].
6748 ///
6749 /// # Example
6750 /// ```ignore,no_run
6751 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6752 /// let x = CreateDestinationRequest::new().set_parent("example");
6753 /// ```
6754 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6755 self.parent = v.into();
6756 self
6757 }
6758
6759 /// Sets the value of [destination_id][crate::model::CreateDestinationRequest::destination_id].
6760 ///
6761 /// # Example
6762 /// ```ignore,no_run
6763 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6764 /// let x = CreateDestinationRequest::new().set_destination_id("example");
6765 /// ```
6766 pub fn set_destination_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6767 self.destination_id = v.into();
6768 self
6769 }
6770
6771 /// Sets the value of [destination][crate::model::CreateDestinationRequest::destination].
6772 ///
6773 /// # Example
6774 /// ```ignore,no_run
6775 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6776 /// use google_cloud_networkconnectivity_v1::model::Destination;
6777 /// let x = CreateDestinationRequest::new().set_destination(Destination::default()/* use setters */);
6778 /// ```
6779 pub fn set_destination<T>(mut self, v: T) -> Self
6780 where
6781 T: std::convert::Into<crate::model::Destination>,
6782 {
6783 self.destination = std::option::Option::Some(v.into());
6784 self
6785 }
6786
6787 /// Sets or clears the value of [destination][crate::model::CreateDestinationRequest::destination].
6788 ///
6789 /// # Example
6790 /// ```ignore,no_run
6791 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6792 /// use google_cloud_networkconnectivity_v1::model::Destination;
6793 /// let x = CreateDestinationRequest::new().set_or_clear_destination(Some(Destination::default()/* use setters */));
6794 /// let x = CreateDestinationRequest::new().set_or_clear_destination(None::<Destination>);
6795 /// ```
6796 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
6797 where
6798 T: std::convert::Into<crate::model::Destination>,
6799 {
6800 self.destination = v.map(|x| x.into());
6801 self
6802 }
6803
6804 /// Sets the value of [request_id][crate::model::CreateDestinationRequest::request_id].
6805 ///
6806 /// # Example
6807 /// ```ignore,no_run
6808 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6809 /// let x = CreateDestinationRequest::new().set_request_id("example");
6810 /// ```
6811 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6812 self.request_id = v.into();
6813 self
6814 }
6815}
6816
6817impl wkt::message::Message for CreateDestinationRequest {
6818 fn typename() -> &'static str {
6819 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateDestinationRequest"
6820 }
6821}
6822
6823/// Request message to update a `Destination` resource.
6824#[derive(Clone, Default, PartialEq)]
6825#[non_exhaustive]
6826pub struct UpdateDestinationRequest {
6827 /// Optional. `FieldMask is used to specify the fields to be overwritten in the
6828 /// `Destination` resource by the update.
6829 /// The fields specified in `update_mask` are relative to the resource, not
6830 /// the full request. A field is overwritten if it is in the mask. If you
6831 /// don't specify a mask, all fields are overwritten.
6832 pub update_mask: std::option::Option<wkt::FieldMask>,
6833
6834 /// Required. The `Destination` resource to update.
6835 pub destination: std::option::Option<crate::model::Destination>,
6836
6837 /// Optional. A request ID to identify requests. Specify a unique request ID
6838 /// so that if you must retry your request, the server can ignore
6839 /// the request if it has already been completed. The server waits
6840 /// for at least 60 minutes since the first request.
6841 ///
6842 /// For example, consider a situation where you make an initial request and
6843 /// the request times out. If you make the request again with the same request
6844 /// ID, the server can check if original operation with the same request ID
6845 /// was received, and if so, can ignore the second request.
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 UpdateDestinationRequest {
6855 pub fn new() -> Self {
6856 std::default::Default::default()
6857 }
6858
6859 /// Sets the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
6860 ///
6861 /// # Example
6862 /// ```ignore,no_run
6863 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6864 /// use wkt::FieldMask;
6865 /// let x = UpdateDestinationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6866 /// ```
6867 pub fn set_update_mask<T>(mut self, v: T) -> Self
6868 where
6869 T: std::convert::Into<wkt::FieldMask>,
6870 {
6871 self.update_mask = std::option::Option::Some(v.into());
6872 self
6873 }
6874
6875 /// Sets or clears the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
6876 ///
6877 /// # Example
6878 /// ```ignore,no_run
6879 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6880 /// use wkt::FieldMask;
6881 /// let x = UpdateDestinationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6882 /// let x = UpdateDestinationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6883 /// ```
6884 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6885 where
6886 T: std::convert::Into<wkt::FieldMask>,
6887 {
6888 self.update_mask = v.map(|x| x.into());
6889 self
6890 }
6891
6892 /// Sets the value of [destination][crate::model::UpdateDestinationRequest::destination].
6893 ///
6894 /// # Example
6895 /// ```ignore,no_run
6896 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6897 /// use google_cloud_networkconnectivity_v1::model::Destination;
6898 /// let x = UpdateDestinationRequest::new().set_destination(Destination::default()/* use setters */);
6899 /// ```
6900 pub fn set_destination<T>(mut self, v: T) -> Self
6901 where
6902 T: std::convert::Into<crate::model::Destination>,
6903 {
6904 self.destination = std::option::Option::Some(v.into());
6905 self
6906 }
6907
6908 /// Sets or clears the value of [destination][crate::model::UpdateDestinationRequest::destination].
6909 ///
6910 /// # Example
6911 /// ```ignore,no_run
6912 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6913 /// use google_cloud_networkconnectivity_v1::model::Destination;
6914 /// let x = UpdateDestinationRequest::new().set_or_clear_destination(Some(Destination::default()/* use setters */));
6915 /// let x = UpdateDestinationRequest::new().set_or_clear_destination(None::<Destination>);
6916 /// ```
6917 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
6918 where
6919 T: std::convert::Into<crate::model::Destination>,
6920 {
6921 self.destination = v.map(|x| x.into());
6922 self
6923 }
6924
6925 /// Sets the value of [request_id][crate::model::UpdateDestinationRequest::request_id].
6926 ///
6927 /// # Example
6928 /// ```ignore,no_run
6929 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6930 /// let x = UpdateDestinationRequest::new().set_request_id("example");
6931 /// ```
6932 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6933 self.request_id = v.into();
6934 self
6935 }
6936}
6937
6938impl wkt::message::Message for UpdateDestinationRequest {
6939 fn typename() -> &'static str {
6940 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateDestinationRequest"
6941 }
6942}
6943
6944/// Request message to delete a `Destination` resource.
6945#[derive(Clone, Default, PartialEq)]
6946#[non_exhaustive]
6947pub struct DeleteDestinationRequest {
6948 /// Required. The name of the `Destination` resource to delete.
6949 pub name: std::string::String,
6950
6951 /// Optional. A request ID to identify requests. Specify a unique request ID
6952 /// so that if you must retry your request, the server can ignore
6953 /// the request if it has already been completed. The server waits
6954 /// for at least 60 minutes since the first request.
6955 ///
6956 /// For example, consider a situation where you make an initial request and
6957 /// the request times out. If you make the request again with the same request
6958 /// ID, the server can check if original operation with the same request ID
6959 /// was received, and if so, can ignore the second request.
6960 ///
6961 /// The request ID must be a valid UUID with the exception that zero UUID
6962 /// (00000000-0000-0000-0000-000000000000) isn't supported.
6963 pub request_id: std::string::String,
6964
6965 /// Optional. The etag is computed by the server, and might be sent with update
6966 /// and delete requests so that the client has an up-to-date value before
6967 /// proceeding.
6968 pub etag: std::string::String,
6969
6970 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6971}
6972
6973impl DeleteDestinationRequest {
6974 pub fn new() -> Self {
6975 std::default::Default::default()
6976 }
6977
6978 /// Sets the value of [name][crate::model::DeleteDestinationRequest::name].
6979 ///
6980 /// # Example
6981 /// ```ignore,no_run
6982 /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
6983 /// let x = DeleteDestinationRequest::new().set_name("example");
6984 /// ```
6985 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6986 self.name = v.into();
6987 self
6988 }
6989
6990 /// Sets the value of [request_id][crate::model::DeleteDestinationRequest::request_id].
6991 ///
6992 /// # Example
6993 /// ```ignore,no_run
6994 /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
6995 /// let x = DeleteDestinationRequest::new().set_request_id("example");
6996 /// ```
6997 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6998 self.request_id = v.into();
6999 self
7000 }
7001
7002 /// Sets the value of [etag][crate::model::DeleteDestinationRequest::etag].
7003 ///
7004 /// # Example
7005 /// ```ignore,no_run
7006 /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
7007 /// let x = DeleteDestinationRequest::new().set_etag("example");
7008 /// ```
7009 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7010 self.etag = v.into();
7011 self
7012 }
7013}
7014
7015impl wkt::message::Message for DeleteDestinationRequest {
7016 fn typename() -> &'static str {
7017 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteDestinationRequest"
7018 }
7019}
7020
7021/// The timeline of the pending states for a resource.
7022#[derive(Clone, Default, PartialEq)]
7023#[non_exhaustive]
7024pub struct StateTimeline {
7025 /// Output only. The state and activation time details of the resource state.
7026 pub states: std::vec::Vec<crate::model::state_timeline::StateMetadata>,
7027
7028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7029}
7030
7031impl StateTimeline {
7032 pub fn new() -> Self {
7033 std::default::Default::default()
7034 }
7035
7036 /// Sets the value of [states][crate::model::StateTimeline::states].
7037 ///
7038 /// # Example
7039 /// ```ignore,no_run
7040 /// # use google_cloud_networkconnectivity_v1::model::StateTimeline;
7041 /// use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7042 /// let x = StateTimeline::new()
7043 /// .set_states([
7044 /// StateMetadata::default()/* use setters */,
7045 /// StateMetadata::default()/* use (different) setters */,
7046 /// ]);
7047 /// ```
7048 pub fn set_states<T, V>(mut self, v: T) -> Self
7049 where
7050 T: std::iter::IntoIterator<Item = V>,
7051 V: std::convert::Into<crate::model::state_timeline::StateMetadata>,
7052 {
7053 use std::iter::Iterator;
7054 self.states = v.into_iter().map(|i| i.into()).collect();
7055 self
7056 }
7057}
7058
7059impl wkt::message::Message for StateTimeline {
7060 fn typename() -> &'static str {
7061 "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline"
7062 }
7063}
7064
7065/// Defines additional types related to [StateTimeline].
7066pub mod state_timeline {
7067 #[allow(unused_imports)]
7068 use super::*;
7069
7070 /// The state and activation time details of the resource state.
7071 #[derive(Clone, Default, PartialEq)]
7072 #[non_exhaustive]
7073 pub struct StateMetadata {
7074 /// Output only. The state of the resource.
7075 pub state: crate::model::state_timeline::state_metadata::State,
7076
7077 /// Output only. Accompanies only the transient states, which include
7078 /// `ADDING`, `DELETING`, and `SUSPENDING`, to denote the time until which
7079 /// the transient state of the resource will be effective. For instance, if
7080 /// the state is `ADDING`, this field shows the time when the resource state
7081 /// transitions to `ACTIVE`.
7082 pub effective_time: std::option::Option<wkt::Timestamp>,
7083
7084 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7085 }
7086
7087 impl StateMetadata {
7088 pub fn new() -> Self {
7089 std::default::Default::default()
7090 }
7091
7092 /// Sets the value of [state][crate::model::state_timeline::StateMetadata::state].
7093 ///
7094 /// # Example
7095 /// ```ignore,no_run
7096 /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7097 /// use google_cloud_networkconnectivity_v1::model::state_timeline::state_metadata::State;
7098 /// let x0 = StateMetadata::new().set_state(State::Adding);
7099 /// let x1 = StateMetadata::new().set_state(State::Active);
7100 /// let x2 = StateMetadata::new().set_state(State::Deleting);
7101 /// ```
7102 pub fn set_state<
7103 T: std::convert::Into<crate::model::state_timeline::state_metadata::State>,
7104 >(
7105 mut self,
7106 v: T,
7107 ) -> Self {
7108 self.state = v.into();
7109 self
7110 }
7111
7112 /// Sets the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
7113 ///
7114 /// # Example
7115 /// ```ignore,no_run
7116 /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7117 /// use wkt::Timestamp;
7118 /// let x = StateMetadata::new().set_effective_time(Timestamp::default()/* use setters */);
7119 /// ```
7120 pub fn set_effective_time<T>(mut self, v: T) -> Self
7121 where
7122 T: std::convert::Into<wkt::Timestamp>,
7123 {
7124 self.effective_time = std::option::Option::Some(v.into());
7125 self
7126 }
7127
7128 /// Sets or clears the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
7129 ///
7130 /// # Example
7131 /// ```ignore,no_run
7132 /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7133 /// use wkt::Timestamp;
7134 /// let x = StateMetadata::new().set_or_clear_effective_time(Some(Timestamp::default()/* use setters */));
7135 /// let x = StateMetadata::new().set_or_clear_effective_time(None::<Timestamp>);
7136 /// ```
7137 pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
7138 where
7139 T: std::convert::Into<wkt::Timestamp>,
7140 {
7141 self.effective_time = v.map(|x| x.into());
7142 self
7143 }
7144 }
7145
7146 impl wkt::message::Message for StateMetadata {
7147 fn typename() -> &'static str {
7148 "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata"
7149 }
7150 }
7151
7152 /// Defines additional types related to [StateMetadata].
7153 pub mod state_metadata {
7154 #[allow(unused_imports)]
7155 use super::*;
7156
7157 /// The state of the resource.
7158 ///
7159 /// # Working with unknown values
7160 ///
7161 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7162 /// additional enum variants at any time. Adding new variants is not considered
7163 /// a breaking change. Applications should write their code in anticipation of:
7164 ///
7165 /// - New values appearing in future releases of the client library, **and**
7166 /// - New values received dynamically, without application changes.
7167 ///
7168 /// Please consult the [Working with enums] section in the user guide for some
7169 /// guidelines.
7170 ///
7171 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7172 #[derive(Clone, Debug, PartialEq)]
7173 #[non_exhaustive]
7174 pub enum State {
7175 /// An invalid state, which is the default case.
7176 Unspecified,
7177 /// The resource is being added.
7178 Adding,
7179 /// The resource is in use.
7180 Active,
7181 /// The resource is being deleted.
7182 Deleting,
7183 /// The resource is being suspended.
7184 Suspending,
7185 /// The resource is suspended and not in use.
7186 Suspended,
7187 /// If set, the enum was initialized with an unknown value.
7188 ///
7189 /// Applications can examine the value using [State::value] or
7190 /// [State::name].
7191 UnknownValue(state::UnknownValue),
7192 }
7193
7194 #[doc(hidden)]
7195 pub mod state {
7196 #[allow(unused_imports)]
7197 use super::*;
7198 #[derive(Clone, Debug, PartialEq)]
7199 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7200 }
7201
7202 impl State {
7203 /// Gets the enum value.
7204 ///
7205 /// Returns `None` if the enum contains an unknown value deserialized from
7206 /// the string representation of enums.
7207 pub fn value(&self) -> std::option::Option<i32> {
7208 match self {
7209 Self::Unspecified => std::option::Option::Some(0),
7210 Self::Adding => std::option::Option::Some(1),
7211 Self::Active => std::option::Option::Some(2),
7212 Self::Deleting => std::option::Option::Some(3),
7213 Self::Suspending => std::option::Option::Some(4),
7214 Self::Suspended => std::option::Option::Some(5),
7215 Self::UnknownValue(u) => u.0.value(),
7216 }
7217 }
7218
7219 /// Gets the enum value as a string.
7220 ///
7221 /// Returns `None` if the enum contains an unknown value deserialized from
7222 /// the integer representation of enums.
7223 pub fn name(&self) -> std::option::Option<&str> {
7224 match self {
7225 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7226 Self::Adding => std::option::Option::Some("ADDING"),
7227 Self::Active => std::option::Option::Some("ACTIVE"),
7228 Self::Deleting => std::option::Option::Some("DELETING"),
7229 Self::Suspending => std::option::Option::Some("SUSPENDING"),
7230 Self::Suspended => std::option::Option::Some("SUSPENDED"),
7231 Self::UnknownValue(u) => u.0.name(),
7232 }
7233 }
7234 }
7235
7236 impl std::default::Default for State {
7237 fn default() -> Self {
7238 use std::convert::From;
7239 Self::from(0)
7240 }
7241 }
7242
7243 impl std::fmt::Display for State {
7244 fn fmt(
7245 &self,
7246 f: &mut std::fmt::Formatter<'_>,
7247 ) -> std::result::Result<(), std::fmt::Error> {
7248 wkt::internal::display_enum(f, self.name(), self.value())
7249 }
7250 }
7251
7252 impl std::convert::From<i32> for State {
7253 fn from(value: i32) -> Self {
7254 match value {
7255 0 => Self::Unspecified,
7256 1 => Self::Adding,
7257 2 => Self::Active,
7258 3 => Self::Deleting,
7259 4 => Self::Suspending,
7260 5 => Self::Suspended,
7261 _ => Self::UnknownValue(state::UnknownValue(
7262 wkt::internal::UnknownEnumValue::Integer(value),
7263 )),
7264 }
7265 }
7266 }
7267
7268 impl std::convert::From<&str> for State {
7269 fn from(value: &str) -> Self {
7270 use std::string::ToString;
7271 match value {
7272 "STATE_UNSPECIFIED" => Self::Unspecified,
7273 "ADDING" => Self::Adding,
7274 "ACTIVE" => Self::Active,
7275 "DELETING" => Self::Deleting,
7276 "SUSPENDING" => Self::Suspending,
7277 "SUSPENDED" => Self::Suspended,
7278 _ => Self::UnknownValue(state::UnknownValue(
7279 wkt::internal::UnknownEnumValue::String(value.to_string()),
7280 )),
7281 }
7282 }
7283 }
7284
7285 impl serde::ser::Serialize for State {
7286 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7287 where
7288 S: serde::Serializer,
7289 {
7290 match self {
7291 Self::Unspecified => serializer.serialize_i32(0),
7292 Self::Adding => serializer.serialize_i32(1),
7293 Self::Active => serializer.serialize_i32(2),
7294 Self::Deleting => serializer.serialize_i32(3),
7295 Self::Suspending => serializer.serialize_i32(4),
7296 Self::Suspended => serializer.serialize_i32(5),
7297 Self::UnknownValue(u) => u.0.serialize(serializer),
7298 }
7299 }
7300 }
7301
7302 impl<'de> serde::de::Deserialize<'de> for State {
7303 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7304 where
7305 D: serde::Deserializer<'de>,
7306 {
7307 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7308 ".google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata.State",
7309 ))
7310 }
7311 }
7312 }
7313}
7314
7315/// A service in your project in a region that is eligible for Data Transfer
7316/// Essentials configuration.
7317#[derive(Clone, Default, PartialEq)]
7318#[non_exhaustive]
7319pub struct MulticloudDataTransferSupportedService {
7320 /// Identifier. The name of the service.
7321 pub name: std::string::String,
7322
7323 /// Output only. The network service tier or regional endpoint supported for
7324 /// the service.
7325 pub service_configs: std::vec::Vec<crate::model::ServiceConfig>,
7326
7327 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7328}
7329
7330impl MulticloudDataTransferSupportedService {
7331 pub fn new() -> Self {
7332 std::default::Default::default()
7333 }
7334
7335 /// Sets the value of [name][crate::model::MulticloudDataTransferSupportedService::name].
7336 ///
7337 /// # Example
7338 /// ```ignore,no_run
7339 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7340 /// let x = MulticloudDataTransferSupportedService::new().set_name("example");
7341 /// ```
7342 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7343 self.name = v.into();
7344 self
7345 }
7346
7347 /// Sets the value of [service_configs][crate::model::MulticloudDataTransferSupportedService::service_configs].
7348 ///
7349 /// # Example
7350 /// ```ignore,no_run
7351 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7352 /// use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7353 /// let x = MulticloudDataTransferSupportedService::new()
7354 /// .set_service_configs([
7355 /// ServiceConfig::default()/* use setters */,
7356 /// ServiceConfig::default()/* use (different) setters */,
7357 /// ]);
7358 /// ```
7359 pub fn set_service_configs<T, V>(mut self, v: T) -> Self
7360 where
7361 T: std::iter::IntoIterator<Item = V>,
7362 V: std::convert::Into<crate::model::ServiceConfig>,
7363 {
7364 use std::iter::Iterator;
7365 self.service_configs = v.into_iter().map(|i| i.into()).collect();
7366 self
7367 }
7368}
7369
7370impl wkt::message::Message for MulticloudDataTransferSupportedService {
7371 fn typename() -> &'static str {
7372 "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferSupportedService"
7373 }
7374}
7375
7376/// Specifies eligibility information for the service.
7377#[derive(Clone, Default, PartialEq)]
7378#[non_exhaustive]
7379pub struct ServiceConfig {
7380 /// Output only. The eligibility criteria for the service.
7381 pub eligibility_criteria: crate::model::service_config::EligibilityCriteria,
7382
7383 /// Output only. The end time for eligibility criteria support. If not
7384 /// specified, no planned end time is set.
7385 pub support_end_time: std::option::Option<wkt::Timestamp>,
7386
7387 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7388}
7389
7390impl ServiceConfig {
7391 pub fn new() -> Self {
7392 std::default::Default::default()
7393 }
7394
7395 /// Sets the value of [eligibility_criteria][crate::model::ServiceConfig::eligibility_criteria].
7396 ///
7397 /// # Example
7398 /// ```ignore,no_run
7399 /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7400 /// use google_cloud_networkconnectivity_v1::model::service_config::EligibilityCriteria;
7401 /// let x0 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::NetworkServiceTierPremiumOnly);
7402 /// let x1 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::NetworkServiceTierStandardOnly);
7403 /// let x2 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::RequestEndpointRegionalEndpointOnly);
7404 /// ```
7405 pub fn set_eligibility_criteria<
7406 T: std::convert::Into<crate::model::service_config::EligibilityCriteria>,
7407 >(
7408 mut self,
7409 v: T,
7410 ) -> Self {
7411 self.eligibility_criteria = v.into();
7412 self
7413 }
7414
7415 /// Sets the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
7416 ///
7417 /// # Example
7418 /// ```ignore,no_run
7419 /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7420 /// use wkt::Timestamp;
7421 /// let x = ServiceConfig::new().set_support_end_time(Timestamp::default()/* use setters */);
7422 /// ```
7423 pub fn set_support_end_time<T>(mut self, v: T) -> Self
7424 where
7425 T: std::convert::Into<wkt::Timestamp>,
7426 {
7427 self.support_end_time = std::option::Option::Some(v.into());
7428 self
7429 }
7430
7431 /// Sets or clears the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
7432 ///
7433 /// # Example
7434 /// ```ignore,no_run
7435 /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7436 /// use wkt::Timestamp;
7437 /// let x = ServiceConfig::new().set_or_clear_support_end_time(Some(Timestamp::default()/* use setters */));
7438 /// let x = ServiceConfig::new().set_or_clear_support_end_time(None::<Timestamp>);
7439 /// ```
7440 pub fn set_or_clear_support_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7441 where
7442 T: std::convert::Into<wkt::Timestamp>,
7443 {
7444 self.support_end_time = v.map(|x| x.into());
7445 self
7446 }
7447}
7448
7449impl wkt::message::Message for ServiceConfig {
7450 fn typename() -> &'static str {
7451 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConfig"
7452 }
7453}
7454
7455/// Defines additional types related to [ServiceConfig].
7456pub mod service_config {
7457 #[allow(unused_imports)]
7458 use super::*;
7459
7460 /// The eligibility information for the service.
7461 ///
7462 /// # Working with unknown values
7463 ///
7464 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7465 /// additional enum variants at any time. Adding new variants is not considered
7466 /// a breaking change. Applications should write their code in anticipation of:
7467 ///
7468 /// - New values appearing in future releases of the client library, **and**
7469 /// - New values received dynamically, without application changes.
7470 ///
7471 /// Please consult the [Working with enums] section in the user guide for some
7472 /// guidelines.
7473 ///
7474 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7475 #[derive(Clone, Debug, PartialEq)]
7476 #[non_exhaustive]
7477 pub enum EligibilityCriteria {
7478 /// The service is not eligible for Data Transfer Essentials configuration.
7479 /// This is the default case.
7480 Unspecified,
7481 /// The service is eligible for Data Transfer Essentials configuration only
7482 /// for Premium Tier.
7483 NetworkServiceTierPremiumOnly,
7484 /// The service is eligible for Data Transfer Essentials configuration only
7485 /// for Standard Tier.
7486 NetworkServiceTierStandardOnly,
7487 /// The service is eligible for Data Transfer Essentials configuration only
7488 /// for the regional endpoint.
7489 RequestEndpointRegionalEndpointOnly,
7490 /// If set, the enum was initialized with an unknown value.
7491 ///
7492 /// Applications can examine the value using [EligibilityCriteria::value] or
7493 /// [EligibilityCriteria::name].
7494 UnknownValue(eligibility_criteria::UnknownValue),
7495 }
7496
7497 #[doc(hidden)]
7498 pub mod eligibility_criteria {
7499 #[allow(unused_imports)]
7500 use super::*;
7501 #[derive(Clone, Debug, PartialEq)]
7502 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7503 }
7504
7505 impl EligibilityCriteria {
7506 /// Gets the enum value.
7507 ///
7508 /// Returns `None` if the enum contains an unknown value deserialized from
7509 /// the string representation of enums.
7510 pub fn value(&self) -> std::option::Option<i32> {
7511 match self {
7512 Self::Unspecified => std::option::Option::Some(0),
7513 Self::NetworkServiceTierPremiumOnly => std::option::Option::Some(1),
7514 Self::NetworkServiceTierStandardOnly => std::option::Option::Some(2),
7515 Self::RequestEndpointRegionalEndpointOnly => std::option::Option::Some(3),
7516 Self::UnknownValue(u) => u.0.value(),
7517 }
7518 }
7519
7520 /// Gets the enum value as a string.
7521 ///
7522 /// Returns `None` if the enum contains an unknown value deserialized from
7523 /// the integer representation of enums.
7524 pub fn name(&self) -> std::option::Option<&str> {
7525 match self {
7526 Self::Unspecified => std::option::Option::Some("ELIGIBILITY_CRITERIA_UNSPECIFIED"),
7527 Self::NetworkServiceTierPremiumOnly => {
7528 std::option::Option::Some("NETWORK_SERVICE_TIER_PREMIUM_ONLY")
7529 }
7530 Self::NetworkServiceTierStandardOnly => {
7531 std::option::Option::Some("NETWORK_SERVICE_TIER_STANDARD_ONLY")
7532 }
7533 Self::RequestEndpointRegionalEndpointOnly => {
7534 std::option::Option::Some("REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY")
7535 }
7536 Self::UnknownValue(u) => u.0.name(),
7537 }
7538 }
7539 }
7540
7541 impl std::default::Default for EligibilityCriteria {
7542 fn default() -> Self {
7543 use std::convert::From;
7544 Self::from(0)
7545 }
7546 }
7547
7548 impl std::fmt::Display for EligibilityCriteria {
7549 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7550 wkt::internal::display_enum(f, self.name(), self.value())
7551 }
7552 }
7553
7554 impl std::convert::From<i32> for EligibilityCriteria {
7555 fn from(value: i32) -> Self {
7556 match value {
7557 0 => Self::Unspecified,
7558 1 => Self::NetworkServiceTierPremiumOnly,
7559 2 => Self::NetworkServiceTierStandardOnly,
7560 3 => Self::RequestEndpointRegionalEndpointOnly,
7561 _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
7562 wkt::internal::UnknownEnumValue::Integer(value),
7563 )),
7564 }
7565 }
7566 }
7567
7568 impl std::convert::From<&str> for EligibilityCriteria {
7569 fn from(value: &str) -> Self {
7570 use std::string::ToString;
7571 match value {
7572 "ELIGIBILITY_CRITERIA_UNSPECIFIED" => Self::Unspecified,
7573 "NETWORK_SERVICE_TIER_PREMIUM_ONLY" => Self::NetworkServiceTierPremiumOnly,
7574 "NETWORK_SERVICE_TIER_STANDARD_ONLY" => Self::NetworkServiceTierStandardOnly,
7575 "REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY" => {
7576 Self::RequestEndpointRegionalEndpointOnly
7577 }
7578 _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
7579 wkt::internal::UnknownEnumValue::String(value.to_string()),
7580 )),
7581 }
7582 }
7583 }
7584
7585 impl serde::ser::Serialize for EligibilityCriteria {
7586 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7587 where
7588 S: serde::Serializer,
7589 {
7590 match self {
7591 Self::Unspecified => serializer.serialize_i32(0),
7592 Self::NetworkServiceTierPremiumOnly => serializer.serialize_i32(1),
7593 Self::NetworkServiceTierStandardOnly => serializer.serialize_i32(2),
7594 Self::RequestEndpointRegionalEndpointOnly => serializer.serialize_i32(3),
7595 Self::UnknownValue(u) => u.0.serialize(serializer),
7596 }
7597 }
7598 }
7599
7600 impl<'de> serde::de::Deserialize<'de> for EligibilityCriteria {
7601 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7602 where
7603 D: serde::Deserializer<'de>,
7604 {
7605 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EligibilityCriteria>::new(
7606 ".google.cloud.networkconnectivity.v1.ServiceConfig.EligibilityCriteria",
7607 ))
7608 }
7609 }
7610}
7611
7612/// Request message to check if a service in your project in a region is
7613/// eligible for Data Transfer Essentials configuration.
7614#[derive(Clone, Default, PartialEq)]
7615#[non_exhaustive]
7616pub struct GetMulticloudDataTransferSupportedServiceRequest {
7617 /// Required. The name of the service.
7618 pub name: std::string::String,
7619
7620 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7621}
7622
7623impl GetMulticloudDataTransferSupportedServiceRequest {
7624 pub fn new() -> Self {
7625 std::default::Default::default()
7626 }
7627
7628 /// Sets the value of [name][crate::model::GetMulticloudDataTransferSupportedServiceRequest::name].
7629 ///
7630 /// # Example
7631 /// ```ignore,no_run
7632 /// # use google_cloud_networkconnectivity_v1::model::GetMulticloudDataTransferSupportedServiceRequest;
7633 /// let x = GetMulticloudDataTransferSupportedServiceRequest::new().set_name("example");
7634 /// ```
7635 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7636 self.name = v.into();
7637 self
7638 }
7639}
7640
7641impl wkt::message::Message for GetMulticloudDataTransferSupportedServiceRequest {
7642 fn typename() -> &'static str {
7643 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferSupportedServiceRequest"
7644 }
7645}
7646
7647/// Request message to list the services in your project that are eligible for
7648/// Data Transfer Essentials configuration.
7649#[derive(Clone, Default, PartialEq)]
7650#[non_exhaustive]
7651pub struct ListMulticloudDataTransferSupportedServicesRequest {
7652 /// Required. The name of the parent resource.
7653 pub parent: std::string::String,
7654
7655 /// Optional. The maximum number of results listed per page.
7656 pub page_size: i32,
7657
7658 /// Optional. The page token.
7659 pub page_token: std::string::String,
7660
7661 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7662}
7663
7664impl ListMulticloudDataTransferSupportedServicesRequest {
7665 pub fn new() -> Self {
7666 std::default::Default::default()
7667 }
7668
7669 /// Sets the value of [parent][crate::model::ListMulticloudDataTransferSupportedServicesRequest::parent].
7670 ///
7671 /// # Example
7672 /// ```ignore,no_run
7673 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7674 /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_parent("example");
7675 /// ```
7676 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7677 self.parent = v.into();
7678 self
7679 }
7680
7681 /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_size].
7682 ///
7683 /// # Example
7684 /// ```ignore,no_run
7685 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7686 /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_page_size(42);
7687 /// ```
7688 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7689 self.page_size = v.into();
7690 self
7691 }
7692
7693 /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_token].
7694 ///
7695 /// # Example
7696 /// ```ignore,no_run
7697 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7698 /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_page_token("example");
7699 /// ```
7700 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7701 self.page_token = v.into();
7702 self
7703 }
7704}
7705
7706impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesRequest {
7707 fn typename() -> &'static str {
7708 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesRequest"
7709 }
7710}
7711
7712/// Response message to list the services in your project in regions that are
7713/// eligible for Data Transfer Essentials configuration.
7714#[derive(Clone, Default, PartialEq)]
7715#[non_exhaustive]
7716pub struct ListMulticloudDataTransferSupportedServicesResponse {
7717 /// The list of supported services.
7718 pub multicloud_data_transfer_supported_services:
7719 std::vec::Vec<crate::model::MulticloudDataTransferSupportedService>,
7720
7721 /// The next page token.
7722 pub next_page_token: std::string::String,
7723
7724 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7725}
7726
7727impl ListMulticloudDataTransferSupportedServicesResponse {
7728 pub fn new() -> Self {
7729 std::default::Default::default()
7730 }
7731
7732 /// Sets the value of [multicloud_data_transfer_supported_services][crate::model::ListMulticloudDataTransferSupportedServicesResponse::multicloud_data_transfer_supported_services].
7733 ///
7734 /// # Example
7735 /// ```ignore,no_run
7736 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesResponse;
7737 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7738 /// let x = ListMulticloudDataTransferSupportedServicesResponse::new()
7739 /// .set_multicloud_data_transfer_supported_services([
7740 /// MulticloudDataTransferSupportedService::default()/* use setters */,
7741 /// MulticloudDataTransferSupportedService::default()/* use (different) setters */,
7742 /// ]);
7743 /// ```
7744 pub fn set_multicloud_data_transfer_supported_services<T, V>(mut self, v: T) -> Self
7745 where
7746 T: std::iter::IntoIterator<Item = V>,
7747 V: std::convert::Into<crate::model::MulticloudDataTransferSupportedService>,
7748 {
7749 use std::iter::Iterator;
7750 self.multicloud_data_transfer_supported_services =
7751 v.into_iter().map(|i| i.into()).collect();
7752 self
7753 }
7754
7755 /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferSupportedServicesResponse::next_page_token].
7756 ///
7757 /// # Example
7758 /// ```ignore,no_run
7759 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesResponse;
7760 /// let x = ListMulticloudDataTransferSupportedServicesResponse::new().set_next_page_token("example");
7761 /// ```
7762 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7763 self.next_page_token = v.into();
7764 self
7765 }
7766}
7767
7768impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesResponse {
7769 fn typename() -> &'static str {
7770 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesResponse"
7771 }
7772}
7773
7774#[doc(hidden)]
7775impl gax::paginator::internal::PageableResponse
7776 for ListMulticloudDataTransferSupportedServicesResponse
7777{
7778 type PageItem = crate::model::MulticloudDataTransferSupportedService;
7779
7780 fn items(self) -> std::vec::Vec<Self::PageItem> {
7781 self.multicloud_data_transfer_supported_services
7782 }
7783
7784 fn next_page_token(&self) -> std::string::String {
7785 use std::clone::Clone;
7786 self.next_page_token.clone()
7787 }
7788}
7789
7790/// A Network Connectivity Center hub is a global management resource to which
7791/// you attach spokes. A single hub can contain spokes from multiple regions.
7792/// However, if any of a hub's spokes use the site-to-site data transfer feature,
7793/// the resources associated with those spokes must all be in the same VPC
7794/// network. Spokes that do not use site-to-site data transfer can be associated
7795/// with any VPC network in your project.
7796#[derive(Clone, Default, PartialEq)]
7797#[non_exhaustive]
7798pub struct Hub {
7799 /// Immutable. The name of the hub. Hub names must be unique. They use the
7800 /// following form:
7801 /// `projects/{project_number}/locations/global/hubs/{hub_id}`
7802 pub name: std::string::String,
7803
7804 /// Output only. The time the hub was created.
7805 pub create_time: std::option::Option<wkt::Timestamp>,
7806
7807 /// Output only. The time the hub was last updated.
7808 pub update_time: std::option::Option<wkt::Timestamp>,
7809
7810 /// Optional labels in key-value pair format. For more information about
7811 /// labels, see [Requirements for
7812 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
7813 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7814
7815 /// Optional. An optional description of the hub.
7816 pub description: std::string::String,
7817
7818 /// Output only. The Google-generated UUID for the hub. This value is unique
7819 /// across all hub resources. If a hub is deleted and another with the same
7820 /// name is created, the new hub is assigned a different unique_id.
7821 pub unique_id: std::string::String,
7822
7823 /// Output only. The current lifecycle state of this hub.
7824 pub state: crate::model::State,
7825
7826 /// The VPC networks associated with this hub's spokes.
7827 ///
7828 /// This field is read-only. Network Connectivity Center automatically
7829 /// populates it based on the set of spokes attached to the hub.
7830 pub routing_vpcs: std::vec::Vec<crate::model::RoutingVPC>,
7831
7832 /// Output only. The route tables that belong to this hub. They use the
7833 /// following form:
7834 /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
7835 ///
7836 /// This field is read-only. Network Connectivity Center automatically
7837 /// populates it based on the route tables nested under the hub.
7838 pub route_tables: std::vec::Vec<std::string::String>,
7839
7840 /// Output only. A summary of the spokes associated with a hub. The
7841 /// summary includes a count of spokes according to type
7842 /// and according to state. If any spokes are inactive,
7843 /// the summary also lists the reasons they are inactive,
7844 /// including a count for each reason.
7845 pub spoke_summary: std::option::Option<crate::model::SpokeSummary>,
7846
7847 /// Optional. The policy mode of this hub. This field can be either
7848 /// PRESET or CUSTOM. If unspecified, the
7849 /// policy_mode defaults to PRESET.
7850 pub policy_mode: crate::model::PolicyMode,
7851
7852 /// Optional. The topology implemented in this hub. Currently, this field is
7853 /// only used when policy_mode = PRESET. The available preset topologies are
7854 /// MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET,
7855 /// the preset_topology defaults to MESH. When policy_mode = CUSTOM,
7856 /// the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED.
7857 pub preset_topology: crate::model::PresetTopology,
7858
7859 /// Optional. Whether Private Service Connect connection propagation is enabled
7860 /// for the hub. If true, Private Service Connect endpoints in VPC spokes
7861 /// attached to the hub are made accessible to other VPC spokes attached to the
7862 /// hub. The default value is false.
7863 pub export_psc: std::option::Option<bool>,
7864
7865 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7866}
7867
7868impl Hub {
7869 pub fn new() -> Self {
7870 std::default::Default::default()
7871 }
7872
7873 /// Sets the value of [name][crate::model::Hub::name].
7874 ///
7875 /// # Example
7876 /// ```ignore,no_run
7877 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7878 /// let x = Hub::new().set_name("example");
7879 /// ```
7880 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7881 self.name = v.into();
7882 self
7883 }
7884
7885 /// Sets the value of [create_time][crate::model::Hub::create_time].
7886 ///
7887 /// # Example
7888 /// ```ignore,no_run
7889 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7890 /// use wkt::Timestamp;
7891 /// let x = Hub::new().set_create_time(Timestamp::default()/* use setters */);
7892 /// ```
7893 pub fn set_create_time<T>(mut self, v: T) -> Self
7894 where
7895 T: std::convert::Into<wkt::Timestamp>,
7896 {
7897 self.create_time = std::option::Option::Some(v.into());
7898 self
7899 }
7900
7901 /// Sets or clears the value of [create_time][crate::model::Hub::create_time].
7902 ///
7903 /// # Example
7904 /// ```ignore,no_run
7905 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7906 /// use wkt::Timestamp;
7907 /// let x = Hub::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7908 /// let x = Hub::new().set_or_clear_create_time(None::<Timestamp>);
7909 /// ```
7910 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7911 where
7912 T: std::convert::Into<wkt::Timestamp>,
7913 {
7914 self.create_time = v.map(|x| x.into());
7915 self
7916 }
7917
7918 /// Sets the value of [update_time][crate::model::Hub::update_time].
7919 ///
7920 /// # Example
7921 /// ```ignore,no_run
7922 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7923 /// use wkt::Timestamp;
7924 /// let x = Hub::new().set_update_time(Timestamp::default()/* use setters */);
7925 /// ```
7926 pub fn set_update_time<T>(mut self, v: T) -> Self
7927 where
7928 T: std::convert::Into<wkt::Timestamp>,
7929 {
7930 self.update_time = std::option::Option::Some(v.into());
7931 self
7932 }
7933
7934 /// Sets or clears the value of [update_time][crate::model::Hub::update_time].
7935 ///
7936 /// # Example
7937 /// ```ignore,no_run
7938 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7939 /// use wkt::Timestamp;
7940 /// let x = Hub::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7941 /// let x = Hub::new().set_or_clear_update_time(None::<Timestamp>);
7942 /// ```
7943 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7944 where
7945 T: std::convert::Into<wkt::Timestamp>,
7946 {
7947 self.update_time = v.map(|x| x.into());
7948 self
7949 }
7950
7951 /// Sets the value of [labels][crate::model::Hub::labels].
7952 ///
7953 /// # Example
7954 /// ```ignore,no_run
7955 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7956 /// let x = Hub::new().set_labels([
7957 /// ("key0", "abc"),
7958 /// ("key1", "xyz"),
7959 /// ]);
7960 /// ```
7961 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7962 where
7963 T: std::iter::IntoIterator<Item = (K, V)>,
7964 K: std::convert::Into<std::string::String>,
7965 V: std::convert::Into<std::string::String>,
7966 {
7967 use std::iter::Iterator;
7968 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7969 self
7970 }
7971
7972 /// Sets the value of [description][crate::model::Hub::description].
7973 ///
7974 /// # Example
7975 /// ```ignore,no_run
7976 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7977 /// let x = Hub::new().set_description("example");
7978 /// ```
7979 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7980 self.description = v.into();
7981 self
7982 }
7983
7984 /// Sets the value of [unique_id][crate::model::Hub::unique_id].
7985 ///
7986 /// # Example
7987 /// ```ignore,no_run
7988 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7989 /// let x = Hub::new().set_unique_id("example");
7990 /// ```
7991 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7992 self.unique_id = v.into();
7993 self
7994 }
7995
7996 /// Sets the value of [state][crate::model::Hub::state].
7997 ///
7998 /// # Example
7999 /// ```ignore,no_run
8000 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8001 /// use google_cloud_networkconnectivity_v1::model::State;
8002 /// let x0 = Hub::new().set_state(State::Creating);
8003 /// let x1 = Hub::new().set_state(State::Active);
8004 /// let x2 = Hub::new().set_state(State::Deleting);
8005 /// ```
8006 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
8007 self.state = v.into();
8008 self
8009 }
8010
8011 /// Sets the value of [routing_vpcs][crate::model::Hub::routing_vpcs].
8012 ///
8013 /// # Example
8014 /// ```ignore,no_run
8015 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8016 /// use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8017 /// let x = Hub::new()
8018 /// .set_routing_vpcs([
8019 /// RoutingVPC::default()/* use setters */,
8020 /// RoutingVPC::default()/* use (different) setters */,
8021 /// ]);
8022 /// ```
8023 pub fn set_routing_vpcs<T, V>(mut self, v: T) -> Self
8024 where
8025 T: std::iter::IntoIterator<Item = V>,
8026 V: std::convert::Into<crate::model::RoutingVPC>,
8027 {
8028 use std::iter::Iterator;
8029 self.routing_vpcs = v.into_iter().map(|i| i.into()).collect();
8030 self
8031 }
8032
8033 /// Sets the value of [route_tables][crate::model::Hub::route_tables].
8034 ///
8035 /// # Example
8036 /// ```ignore,no_run
8037 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8038 /// let x = Hub::new().set_route_tables(["a", "b", "c"]);
8039 /// ```
8040 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
8041 where
8042 T: std::iter::IntoIterator<Item = V>,
8043 V: std::convert::Into<std::string::String>,
8044 {
8045 use std::iter::Iterator;
8046 self.route_tables = v.into_iter().map(|i| i.into()).collect();
8047 self
8048 }
8049
8050 /// Sets the value of [spoke_summary][crate::model::Hub::spoke_summary].
8051 ///
8052 /// # Example
8053 /// ```ignore,no_run
8054 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8055 /// use google_cloud_networkconnectivity_v1::model::SpokeSummary;
8056 /// let x = Hub::new().set_spoke_summary(SpokeSummary::default()/* use setters */);
8057 /// ```
8058 pub fn set_spoke_summary<T>(mut self, v: T) -> Self
8059 where
8060 T: std::convert::Into<crate::model::SpokeSummary>,
8061 {
8062 self.spoke_summary = std::option::Option::Some(v.into());
8063 self
8064 }
8065
8066 /// Sets or clears the value of [spoke_summary][crate::model::Hub::spoke_summary].
8067 ///
8068 /// # Example
8069 /// ```ignore,no_run
8070 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8071 /// use google_cloud_networkconnectivity_v1::model::SpokeSummary;
8072 /// let x = Hub::new().set_or_clear_spoke_summary(Some(SpokeSummary::default()/* use setters */));
8073 /// let x = Hub::new().set_or_clear_spoke_summary(None::<SpokeSummary>);
8074 /// ```
8075 pub fn set_or_clear_spoke_summary<T>(mut self, v: std::option::Option<T>) -> Self
8076 where
8077 T: std::convert::Into<crate::model::SpokeSummary>,
8078 {
8079 self.spoke_summary = v.map(|x| x.into());
8080 self
8081 }
8082
8083 /// Sets the value of [policy_mode][crate::model::Hub::policy_mode].
8084 ///
8085 /// # Example
8086 /// ```ignore,no_run
8087 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8088 /// use google_cloud_networkconnectivity_v1::model::PolicyMode;
8089 /// let x0 = Hub::new().set_policy_mode(PolicyMode::Preset);
8090 /// ```
8091 pub fn set_policy_mode<T: std::convert::Into<crate::model::PolicyMode>>(
8092 mut self,
8093 v: T,
8094 ) -> Self {
8095 self.policy_mode = v.into();
8096 self
8097 }
8098
8099 /// Sets the value of [preset_topology][crate::model::Hub::preset_topology].
8100 ///
8101 /// # Example
8102 /// ```ignore,no_run
8103 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8104 /// use google_cloud_networkconnectivity_v1::model::PresetTopology;
8105 /// let x0 = Hub::new().set_preset_topology(PresetTopology::Mesh);
8106 /// let x1 = Hub::new().set_preset_topology(PresetTopology::Star);
8107 /// ```
8108 pub fn set_preset_topology<T: std::convert::Into<crate::model::PresetTopology>>(
8109 mut self,
8110 v: T,
8111 ) -> Self {
8112 self.preset_topology = v.into();
8113 self
8114 }
8115
8116 /// Sets the value of [export_psc][crate::model::Hub::export_psc].
8117 ///
8118 /// # Example
8119 /// ```ignore,no_run
8120 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8121 /// let x = Hub::new().set_export_psc(true);
8122 /// ```
8123 pub fn set_export_psc<T>(mut self, v: T) -> Self
8124 where
8125 T: std::convert::Into<bool>,
8126 {
8127 self.export_psc = std::option::Option::Some(v.into());
8128 self
8129 }
8130
8131 /// Sets or clears the value of [export_psc][crate::model::Hub::export_psc].
8132 ///
8133 /// # Example
8134 /// ```ignore,no_run
8135 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8136 /// let x = Hub::new().set_or_clear_export_psc(Some(false));
8137 /// let x = Hub::new().set_or_clear_export_psc(None::<bool>);
8138 /// ```
8139 pub fn set_or_clear_export_psc<T>(mut self, v: std::option::Option<T>) -> Self
8140 where
8141 T: std::convert::Into<bool>,
8142 {
8143 self.export_psc = v.map(|x| x.into());
8144 self
8145 }
8146}
8147
8148impl wkt::message::Message for Hub {
8149 fn typename() -> &'static str {
8150 "type.googleapis.com/google.cloud.networkconnectivity.v1.Hub"
8151 }
8152}
8153
8154/// RoutingVPC contains information about the VPC networks associated
8155/// with the spokes of a Network Connectivity Center hub.
8156#[derive(Clone, Default, PartialEq)]
8157#[non_exhaustive]
8158pub struct RoutingVPC {
8159 /// The URI of the VPC network.
8160 pub uri: std::string::String,
8161
8162 /// Output only. If true, indicates that this VPC network is currently
8163 /// associated with spokes that use the data transfer feature (spokes where the
8164 /// site_to_site_data_transfer field is set to true). If you create new spokes
8165 /// that use data transfer, they must be associated with this VPC network. At
8166 /// most, one VPC network will have this field set to true.
8167 pub required_for_new_site_to_site_data_transfer_spokes: bool,
8168
8169 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8170}
8171
8172impl RoutingVPC {
8173 pub fn new() -> Self {
8174 std::default::Default::default()
8175 }
8176
8177 /// Sets the value of [uri][crate::model::RoutingVPC::uri].
8178 ///
8179 /// # Example
8180 /// ```ignore,no_run
8181 /// # use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8182 /// let x = RoutingVPC::new().set_uri("example");
8183 /// ```
8184 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8185 self.uri = v.into();
8186 self
8187 }
8188
8189 /// 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].
8190 ///
8191 /// # Example
8192 /// ```ignore,no_run
8193 /// # use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8194 /// let x = RoutingVPC::new().set_required_for_new_site_to_site_data_transfer_spokes(true);
8195 /// ```
8196 pub fn set_required_for_new_site_to_site_data_transfer_spokes<T: std::convert::Into<bool>>(
8197 mut self,
8198 v: T,
8199 ) -> Self {
8200 self.required_for_new_site_to_site_data_transfer_spokes = v.into();
8201 self
8202 }
8203}
8204
8205impl wkt::message::Message for RoutingVPC {
8206 fn typename() -> &'static str {
8207 "type.googleapis.com/google.cloud.networkconnectivity.v1.RoutingVPC"
8208 }
8209}
8210
8211/// A Network Connectivity Center spoke represents one or more network
8212/// connectivity resources.
8213///
8214/// When you create a spoke, you associate it with a hub. You must also
8215/// identify a value for exactly one of the following fields:
8216///
8217/// * linked_vpn_tunnels
8218/// * linked_interconnect_attachments
8219/// * linked_router_appliance_instances
8220/// * linked_vpc_network
8221#[derive(Clone, Default, PartialEq)]
8222#[non_exhaustive]
8223pub struct Spoke {
8224 /// Immutable. The name of the spoke. Spoke names must be unique. They use the
8225 /// following form:
8226 /// `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
8227 pub name: std::string::String,
8228
8229 /// Output only. The time the spoke was created.
8230 pub create_time: std::option::Option<wkt::Timestamp>,
8231
8232 /// Output only. The time the spoke was last updated.
8233 pub update_time: std::option::Option<wkt::Timestamp>,
8234
8235 /// Optional labels in key-value pair format. For more information about
8236 /// labels, see [Requirements for
8237 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
8238 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8239
8240 /// Optional. An optional description of the spoke.
8241 pub description: std::string::String,
8242
8243 /// Immutable. The name of the hub that this spoke is attached to.
8244 pub hub: std::string::String,
8245
8246 /// Optional. The name of the group that this spoke is associated with.
8247 pub group: std::string::String,
8248
8249 /// Optional. VPN tunnels that are associated with the spoke.
8250 pub linked_vpn_tunnels: std::option::Option<crate::model::LinkedVpnTunnels>,
8251
8252 /// Optional. VLAN attachments that are associated with the spoke.
8253 pub linked_interconnect_attachments:
8254 std::option::Option<crate::model::LinkedInterconnectAttachments>,
8255
8256 /// Optional. Router appliance instances that are associated with the spoke.
8257 pub linked_router_appliance_instances:
8258 std::option::Option<crate::model::LinkedRouterApplianceInstances>,
8259
8260 /// Optional. VPC network that is associated with the spoke.
8261 pub linked_vpc_network: std::option::Option<crate::model::LinkedVpcNetwork>,
8262
8263 /// Optional. The linked producer VPC that is associated with the spoke.
8264 pub linked_producer_vpc_network: std::option::Option<crate::model::LinkedProducerVpcNetwork>,
8265
8266 /// Output only. The Google-generated UUID for the spoke. This value is unique
8267 /// across all spoke resources. If a spoke is deleted and another with the same
8268 /// name is created, the new spoke is assigned a different `unique_id`.
8269 pub unique_id: std::string::String,
8270
8271 /// Output only. The current lifecycle state of this spoke.
8272 pub state: crate::model::State,
8273
8274 /// Output only. The reasons for current state of the spoke.
8275 pub reasons: std::vec::Vec<crate::model::spoke::StateReason>,
8276
8277 /// Output only. The type of resource associated with the spoke.
8278 pub spoke_type: crate::model::SpokeType,
8279
8280 /// Optional. This checksum is computed by the server based on the value of
8281 /// other fields, and may be sent on update and delete requests to ensure the
8282 /// client has an up-to-date value before proceeding.
8283 pub etag: std::string::String,
8284
8285 /// Optional. The list of fields waiting for hub administration's approval.
8286 pub field_paths_pending_update: std::vec::Vec<std::string::String>,
8287
8288 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8289}
8290
8291impl Spoke {
8292 pub fn new() -> Self {
8293 std::default::Default::default()
8294 }
8295
8296 /// Sets the value of [name][crate::model::Spoke::name].
8297 ///
8298 /// # Example
8299 /// ```ignore,no_run
8300 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8301 /// let x = Spoke::new().set_name("example");
8302 /// ```
8303 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8304 self.name = v.into();
8305 self
8306 }
8307
8308 /// Sets the value of [create_time][crate::model::Spoke::create_time].
8309 ///
8310 /// # Example
8311 /// ```ignore,no_run
8312 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8313 /// use wkt::Timestamp;
8314 /// let x = Spoke::new().set_create_time(Timestamp::default()/* use setters */);
8315 /// ```
8316 pub fn set_create_time<T>(mut self, v: T) -> Self
8317 where
8318 T: std::convert::Into<wkt::Timestamp>,
8319 {
8320 self.create_time = std::option::Option::Some(v.into());
8321 self
8322 }
8323
8324 /// Sets or clears the value of [create_time][crate::model::Spoke::create_time].
8325 ///
8326 /// # Example
8327 /// ```ignore,no_run
8328 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8329 /// use wkt::Timestamp;
8330 /// let x = Spoke::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8331 /// let x = Spoke::new().set_or_clear_create_time(None::<Timestamp>);
8332 /// ```
8333 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8334 where
8335 T: std::convert::Into<wkt::Timestamp>,
8336 {
8337 self.create_time = v.map(|x| x.into());
8338 self
8339 }
8340
8341 /// Sets the value of [update_time][crate::model::Spoke::update_time].
8342 ///
8343 /// # Example
8344 /// ```ignore,no_run
8345 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8346 /// use wkt::Timestamp;
8347 /// let x = Spoke::new().set_update_time(Timestamp::default()/* use setters */);
8348 /// ```
8349 pub fn set_update_time<T>(mut self, v: T) -> Self
8350 where
8351 T: std::convert::Into<wkt::Timestamp>,
8352 {
8353 self.update_time = std::option::Option::Some(v.into());
8354 self
8355 }
8356
8357 /// Sets or clears the value of [update_time][crate::model::Spoke::update_time].
8358 ///
8359 /// # Example
8360 /// ```ignore,no_run
8361 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8362 /// use wkt::Timestamp;
8363 /// let x = Spoke::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8364 /// let x = Spoke::new().set_or_clear_update_time(None::<Timestamp>);
8365 /// ```
8366 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8367 where
8368 T: std::convert::Into<wkt::Timestamp>,
8369 {
8370 self.update_time = v.map(|x| x.into());
8371 self
8372 }
8373
8374 /// Sets the value of [labels][crate::model::Spoke::labels].
8375 ///
8376 /// # Example
8377 /// ```ignore,no_run
8378 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8379 /// let x = Spoke::new().set_labels([
8380 /// ("key0", "abc"),
8381 /// ("key1", "xyz"),
8382 /// ]);
8383 /// ```
8384 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8385 where
8386 T: std::iter::IntoIterator<Item = (K, V)>,
8387 K: std::convert::Into<std::string::String>,
8388 V: std::convert::Into<std::string::String>,
8389 {
8390 use std::iter::Iterator;
8391 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8392 self
8393 }
8394
8395 /// Sets the value of [description][crate::model::Spoke::description].
8396 ///
8397 /// # Example
8398 /// ```ignore,no_run
8399 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8400 /// let x = Spoke::new().set_description("example");
8401 /// ```
8402 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8403 self.description = v.into();
8404 self
8405 }
8406
8407 /// Sets the value of [hub][crate::model::Spoke::hub].
8408 ///
8409 /// # Example
8410 /// ```ignore,no_run
8411 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8412 /// let x = Spoke::new().set_hub("example");
8413 /// ```
8414 pub fn set_hub<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8415 self.hub = v.into();
8416 self
8417 }
8418
8419 /// Sets the value of [group][crate::model::Spoke::group].
8420 ///
8421 /// # Example
8422 /// ```ignore,no_run
8423 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8424 /// let x = Spoke::new().set_group("example");
8425 /// ```
8426 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8427 self.group = v.into();
8428 self
8429 }
8430
8431 /// Sets the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
8432 ///
8433 /// # Example
8434 /// ```ignore,no_run
8435 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8436 /// use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
8437 /// let x = Spoke::new().set_linked_vpn_tunnels(LinkedVpnTunnels::default()/* use setters */);
8438 /// ```
8439 pub fn set_linked_vpn_tunnels<T>(mut self, v: T) -> Self
8440 where
8441 T: std::convert::Into<crate::model::LinkedVpnTunnels>,
8442 {
8443 self.linked_vpn_tunnels = std::option::Option::Some(v.into());
8444 self
8445 }
8446
8447 /// Sets or clears the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
8448 ///
8449 /// # Example
8450 /// ```ignore,no_run
8451 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8452 /// use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
8453 /// let x = Spoke::new().set_or_clear_linked_vpn_tunnels(Some(LinkedVpnTunnels::default()/* use setters */));
8454 /// let x = Spoke::new().set_or_clear_linked_vpn_tunnels(None::<LinkedVpnTunnels>);
8455 /// ```
8456 pub fn set_or_clear_linked_vpn_tunnels<T>(mut self, v: std::option::Option<T>) -> Self
8457 where
8458 T: std::convert::Into<crate::model::LinkedVpnTunnels>,
8459 {
8460 self.linked_vpn_tunnels = v.map(|x| x.into());
8461 self
8462 }
8463
8464 /// Sets the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
8465 ///
8466 /// # Example
8467 /// ```ignore,no_run
8468 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8469 /// use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
8470 /// let x = Spoke::new().set_linked_interconnect_attachments(LinkedInterconnectAttachments::default()/* use setters */);
8471 /// ```
8472 pub fn set_linked_interconnect_attachments<T>(mut self, v: T) -> Self
8473 where
8474 T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
8475 {
8476 self.linked_interconnect_attachments = std::option::Option::Some(v.into());
8477 self
8478 }
8479
8480 /// Sets or clears the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
8481 ///
8482 /// # Example
8483 /// ```ignore,no_run
8484 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8485 /// use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
8486 /// let x = Spoke::new().set_or_clear_linked_interconnect_attachments(Some(LinkedInterconnectAttachments::default()/* use setters */));
8487 /// let x = Spoke::new().set_or_clear_linked_interconnect_attachments(None::<LinkedInterconnectAttachments>);
8488 /// ```
8489 pub fn set_or_clear_linked_interconnect_attachments<T>(
8490 mut self,
8491 v: std::option::Option<T>,
8492 ) -> Self
8493 where
8494 T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
8495 {
8496 self.linked_interconnect_attachments = v.map(|x| x.into());
8497 self
8498 }
8499
8500 /// Sets the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
8501 ///
8502 /// # Example
8503 /// ```ignore,no_run
8504 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8505 /// use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
8506 /// let x = Spoke::new().set_linked_router_appliance_instances(LinkedRouterApplianceInstances::default()/* use setters */);
8507 /// ```
8508 pub fn set_linked_router_appliance_instances<T>(mut self, v: T) -> Self
8509 where
8510 T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
8511 {
8512 self.linked_router_appliance_instances = std::option::Option::Some(v.into());
8513 self
8514 }
8515
8516 /// Sets or clears the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
8517 ///
8518 /// # Example
8519 /// ```ignore,no_run
8520 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8521 /// use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
8522 /// let x = Spoke::new().set_or_clear_linked_router_appliance_instances(Some(LinkedRouterApplianceInstances::default()/* use setters */));
8523 /// let x = Spoke::new().set_or_clear_linked_router_appliance_instances(None::<LinkedRouterApplianceInstances>);
8524 /// ```
8525 pub fn set_or_clear_linked_router_appliance_instances<T>(
8526 mut self,
8527 v: std::option::Option<T>,
8528 ) -> Self
8529 where
8530 T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
8531 {
8532 self.linked_router_appliance_instances = v.map(|x| x.into());
8533 self
8534 }
8535
8536 /// Sets the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
8537 ///
8538 /// # Example
8539 /// ```ignore,no_run
8540 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8541 /// use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
8542 /// let x = Spoke::new().set_linked_vpc_network(LinkedVpcNetwork::default()/* use setters */);
8543 /// ```
8544 pub fn set_linked_vpc_network<T>(mut self, v: T) -> Self
8545 where
8546 T: std::convert::Into<crate::model::LinkedVpcNetwork>,
8547 {
8548 self.linked_vpc_network = std::option::Option::Some(v.into());
8549 self
8550 }
8551
8552 /// Sets or clears the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
8553 ///
8554 /// # Example
8555 /// ```ignore,no_run
8556 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8557 /// use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
8558 /// let x = Spoke::new().set_or_clear_linked_vpc_network(Some(LinkedVpcNetwork::default()/* use setters */));
8559 /// let x = Spoke::new().set_or_clear_linked_vpc_network(None::<LinkedVpcNetwork>);
8560 /// ```
8561 pub fn set_or_clear_linked_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
8562 where
8563 T: std::convert::Into<crate::model::LinkedVpcNetwork>,
8564 {
8565 self.linked_vpc_network = v.map(|x| x.into());
8566 self
8567 }
8568
8569 /// Sets the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
8570 ///
8571 /// # Example
8572 /// ```ignore,no_run
8573 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8574 /// use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
8575 /// let x = Spoke::new().set_linked_producer_vpc_network(LinkedProducerVpcNetwork::default()/* use setters */);
8576 /// ```
8577 pub fn set_linked_producer_vpc_network<T>(mut self, v: T) -> Self
8578 where
8579 T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
8580 {
8581 self.linked_producer_vpc_network = std::option::Option::Some(v.into());
8582 self
8583 }
8584
8585 /// Sets or clears the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
8586 ///
8587 /// # Example
8588 /// ```ignore,no_run
8589 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8590 /// use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
8591 /// let x = Spoke::new().set_or_clear_linked_producer_vpc_network(Some(LinkedProducerVpcNetwork::default()/* use setters */));
8592 /// let x = Spoke::new().set_or_clear_linked_producer_vpc_network(None::<LinkedProducerVpcNetwork>);
8593 /// ```
8594 pub fn set_or_clear_linked_producer_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
8595 where
8596 T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
8597 {
8598 self.linked_producer_vpc_network = v.map(|x| x.into());
8599 self
8600 }
8601
8602 /// Sets the value of [unique_id][crate::model::Spoke::unique_id].
8603 ///
8604 /// # Example
8605 /// ```ignore,no_run
8606 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8607 /// let x = Spoke::new().set_unique_id("example");
8608 /// ```
8609 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8610 self.unique_id = v.into();
8611 self
8612 }
8613
8614 /// Sets the value of [state][crate::model::Spoke::state].
8615 ///
8616 /// # Example
8617 /// ```ignore,no_run
8618 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8619 /// use google_cloud_networkconnectivity_v1::model::State;
8620 /// let x0 = Spoke::new().set_state(State::Creating);
8621 /// let x1 = Spoke::new().set_state(State::Active);
8622 /// let x2 = Spoke::new().set_state(State::Deleting);
8623 /// ```
8624 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
8625 self.state = v.into();
8626 self
8627 }
8628
8629 /// Sets the value of [reasons][crate::model::Spoke::reasons].
8630 ///
8631 /// # Example
8632 /// ```ignore,no_run
8633 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8634 /// use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8635 /// let x = Spoke::new()
8636 /// .set_reasons([
8637 /// StateReason::default()/* use setters */,
8638 /// StateReason::default()/* use (different) setters */,
8639 /// ]);
8640 /// ```
8641 pub fn set_reasons<T, V>(mut self, v: T) -> Self
8642 where
8643 T: std::iter::IntoIterator<Item = V>,
8644 V: std::convert::Into<crate::model::spoke::StateReason>,
8645 {
8646 use std::iter::Iterator;
8647 self.reasons = v.into_iter().map(|i| i.into()).collect();
8648 self
8649 }
8650
8651 /// Sets the value of [spoke_type][crate::model::Spoke::spoke_type].
8652 ///
8653 /// # Example
8654 /// ```ignore,no_run
8655 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8656 /// use google_cloud_networkconnectivity_v1::model::SpokeType;
8657 /// let x0 = Spoke::new().set_spoke_type(SpokeType::VpnTunnel);
8658 /// let x1 = Spoke::new().set_spoke_type(SpokeType::InterconnectAttachment);
8659 /// let x2 = Spoke::new().set_spoke_type(SpokeType::RouterAppliance);
8660 /// ```
8661 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(mut self, v: T) -> Self {
8662 self.spoke_type = v.into();
8663 self
8664 }
8665
8666 /// Sets the value of [etag][crate::model::Spoke::etag].
8667 ///
8668 /// # Example
8669 /// ```ignore,no_run
8670 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8671 /// let x = Spoke::new().set_etag("example");
8672 /// ```
8673 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8674 self.etag = v.into();
8675 self
8676 }
8677
8678 /// Sets the value of [field_paths_pending_update][crate::model::Spoke::field_paths_pending_update].
8679 ///
8680 /// # Example
8681 /// ```ignore,no_run
8682 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8683 /// let x = Spoke::new().set_field_paths_pending_update(["a", "b", "c"]);
8684 /// ```
8685 pub fn set_field_paths_pending_update<T, V>(mut self, v: T) -> Self
8686 where
8687 T: std::iter::IntoIterator<Item = V>,
8688 V: std::convert::Into<std::string::String>,
8689 {
8690 use std::iter::Iterator;
8691 self.field_paths_pending_update = v.into_iter().map(|i| i.into()).collect();
8692 self
8693 }
8694}
8695
8696impl wkt::message::Message for Spoke {
8697 fn typename() -> &'static str {
8698 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke"
8699 }
8700}
8701
8702/// Defines additional types related to [Spoke].
8703pub mod spoke {
8704 #[allow(unused_imports)]
8705 use super::*;
8706
8707 /// The reason a spoke is inactive.
8708 #[derive(Clone, Default, PartialEq)]
8709 #[non_exhaustive]
8710 pub struct StateReason {
8711 /// The code associated with this reason.
8712 pub code: crate::model::spoke::state_reason::Code,
8713
8714 /// Human-readable details about this reason.
8715 pub message: std::string::String,
8716
8717 /// Additional information provided by the user in the RejectSpoke call.
8718 pub user_details: std::string::String,
8719
8720 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8721 }
8722
8723 impl StateReason {
8724 pub fn new() -> Self {
8725 std::default::Default::default()
8726 }
8727
8728 /// Sets the value of [code][crate::model::spoke::StateReason::code].
8729 ///
8730 /// # Example
8731 /// ```ignore,no_run
8732 /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8733 /// use google_cloud_networkconnectivity_v1::model::spoke::state_reason::Code;
8734 /// let x0 = StateReason::new().set_code(Code::PendingReview);
8735 /// let x1 = StateReason::new().set_code(Code::Rejected);
8736 /// let x2 = StateReason::new().set_code(Code::Paused);
8737 /// ```
8738 pub fn set_code<T: std::convert::Into<crate::model::spoke::state_reason::Code>>(
8739 mut self,
8740 v: T,
8741 ) -> Self {
8742 self.code = v.into();
8743 self
8744 }
8745
8746 /// Sets the value of [message][crate::model::spoke::StateReason::message].
8747 ///
8748 /// # Example
8749 /// ```ignore,no_run
8750 /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8751 /// let x = StateReason::new().set_message("example");
8752 /// ```
8753 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8754 self.message = v.into();
8755 self
8756 }
8757
8758 /// Sets the value of [user_details][crate::model::spoke::StateReason::user_details].
8759 ///
8760 /// # Example
8761 /// ```ignore,no_run
8762 /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8763 /// let x = StateReason::new().set_user_details("example");
8764 /// ```
8765 pub fn set_user_details<T: std::convert::Into<std::string::String>>(
8766 mut self,
8767 v: T,
8768 ) -> Self {
8769 self.user_details = v.into();
8770 self
8771 }
8772 }
8773
8774 impl wkt::message::Message for StateReason {
8775 fn typename() -> &'static str {
8776 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke.StateReason"
8777 }
8778 }
8779
8780 /// Defines additional types related to [StateReason].
8781 pub mod state_reason {
8782 #[allow(unused_imports)]
8783 use super::*;
8784
8785 /// The Code enum represents the various reasons a state can be `INACTIVE`.
8786 ///
8787 /// # Working with unknown values
8788 ///
8789 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8790 /// additional enum variants at any time. Adding new variants is not considered
8791 /// a breaking change. Applications should write their code in anticipation of:
8792 ///
8793 /// - New values appearing in future releases of the client library, **and**
8794 /// - New values received dynamically, without application changes.
8795 ///
8796 /// Please consult the [Working with enums] section in the user guide for some
8797 /// guidelines.
8798 ///
8799 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8800 #[derive(Clone, Debug, PartialEq)]
8801 #[non_exhaustive]
8802 pub enum Code {
8803 /// No information available.
8804 Unspecified,
8805 /// The proposed spoke is pending review.
8806 PendingReview,
8807 /// The proposed spoke has been rejected by the hub administrator.
8808 Rejected,
8809 /// The spoke has been deactivated internally.
8810 Paused,
8811 /// Network Connectivity Center encountered errors while accepting
8812 /// the spoke.
8813 Failed,
8814 /// The proposed spoke update is pending review.
8815 UpdatePendingReview,
8816 /// The proposed spoke update has been rejected by the hub administrator.
8817 UpdateRejected,
8818 /// Network Connectivity Center encountered errors while accepting
8819 /// the spoke update.
8820 UpdateFailed,
8821 /// If set, the enum was initialized with an unknown value.
8822 ///
8823 /// Applications can examine the value using [Code::value] or
8824 /// [Code::name].
8825 UnknownValue(code::UnknownValue),
8826 }
8827
8828 #[doc(hidden)]
8829 pub mod code {
8830 #[allow(unused_imports)]
8831 use super::*;
8832 #[derive(Clone, Debug, PartialEq)]
8833 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8834 }
8835
8836 impl Code {
8837 /// Gets the enum value.
8838 ///
8839 /// Returns `None` if the enum contains an unknown value deserialized from
8840 /// the string representation of enums.
8841 pub fn value(&self) -> std::option::Option<i32> {
8842 match self {
8843 Self::Unspecified => std::option::Option::Some(0),
8844 Self::PendingReview => std::option::Option::Some(1),
8845 Self::Rejected => std::option::Option::Some(2),
8846 Self::Paused => std::option::Option::Some(3),
8847 Self::Failed => std::option::Option::Some(4),
8848 Self::UpdatePendingReview => std::option::Option::Some(5),
8849 Self::UpdateRejected => std::option::Option::Some(6),
8850 Self::UpdateFailed => std::option::Option::Some(7),
8851 Self::UnknownValue(u) => u.0.value(),
8852 }
8853 }
8854
8855 /// Gets the enum value as a string.
8856 ///
8857 /// Returns `None` if the enum contains an unknown value deserialized from
8858 /// the integer representation of enums.
8859 pub fn name(&self) -> std::option::Option<&str> {
8860 match self {
8861 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
8862 Self::PendingReview => std::option::Option::Some("PENDING_REVIEW"),
8863 Self::Rejected => std::option::Option::Some("REJECTED"),
8864 Self::Paused => std::option::Option::Some("PAUSED"),
8865 Self::Failed => std::option::Option::Some("FAILED"),
8866 Self::UpdatePendingReview => std::option::Option::Some("UPDATE_PENDING_REVIEW"),
8867 Self::UpdateRejected => std::option::Option::Some("UPDATE_REJECTED"),
8868 Self::UpdateFailed => std::option::Option::Some("UPDATE_FAILED"),
8869 Self::UnknownValue(u) => u.0.name(),
8870 }
8871 }
8872 }
8873
8874 impl std::default::Default for Code {
8875 fn default() -> Self {
8876 use std::convert::From;
8877 Self::from(0)
8878 }
8879 }
8880
8881 impl std::fmt::Display for Code {
8882 fn fmt(
8883 &self,
8884 f: &mut std::fmt::Formatter<'_>,
8885 ) -> std::result::Result<(), std::fmt::Error> {
8886 wkt::internal::display_enum(f, self.name(), self.value())
8887 }
8888 }
8889
8890 impl std::convert::From<i32> for Code {
8891 fn from(value: i32) -> Self {
8892 match value {
8893 0 => Self::Unspecified,
8894 1 => Self::PendingReview,
8895 2 => Self::Rejected,
8896 3 => Self::Paused,
8897 4 => Self::Failed,
8898 5 => Self::UpdatePendingReview,
8899 6 => Self::UpdateRejected,
8900 7 => Self::UpdateFailed,
8901 _ => Self::UnknownValue(code::UnknownValue(
8902 wkt::internal::UnknownEnumValue::Integer(value),
8903 )),
8904 }
8905 }
8906 }
8907
8908 impl std::convert::From<&str> for Code {
8909 fn from(value: &str) -> Self {
8910 use std::string::ToString;
8911 match value {
8912 "CODE_UNSPECIFIED" => Self::Unspecified,
8913 "PENDING_REVIEW" => Self::PendingReview,
8914 "REJECTED" => Self::Rejected,
8915 "PAUSED" => Self::Paused,
8916 "FAILED" => Self::Failed,
8917 "UPDATE_PENDING_REVIEW" => Self::UpdatePendingReview,
8918 "UPDATE_REJECTED" => Self::UpdateRejected,
8919 "UPDATE_FAILED" => Self::UpdateFailed,
8920 _ => Self::UnknownValue(code::UnknownValue(
8921 wkt::internal::UnknownEnumValue::String(value.to_string()),
8922 )),
8923 }
8924 }
8925 }
8926
8927 impl serde::ser::Serialize for Code {
8928 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8929 where
8930 S: serde::Serializer,
8931 {
8932 match self {
8933 Self::Unspecified => serializer.serialize_i32(0),
8934 Self::PendingReview => serializer.serialize_i32(1),
8935 Self::Rejected => serializer.serialize_i32(2),
8936 Self::Paused => serializer.serialize_i32(3),
8937 Self::Failed => serializer.serialize_i32(4),
8938 Self::UpdatePendingReview => serializer.serialize_i32(5),
8939 Self::UpdateRejected => serializer.serialize_i32(6),
8940 Self::UpdateFailed => serializer.serialize_i32(7),
8941 Self::UnknownValue(u) => u.0.serialize(serializer),
8942 }
8943 }
8944 }
8945
8946 impl<'de> serde::de::Deserialize<'de> for Code {
8947 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8948 where
8949 D: serde::Deserializer<'de>,
8950 {
8951 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
8952 ".google.cloud.networkconnectivity.v1.Spoke.StateReason.Code",
8953 ))
8954 }
8955 }
8956 }
8957}
8958
8959#[derive(Clone, Default, PartialEq)]
8960#[non_exhaustive]
8961pub struct RouteTable {
8962 /// Immutable. The name of the route table. Route table names must be unique.
8963 /// They use the following form:
8964 /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}`
8965 pub name: std::string::String,
8966
8967 /// Output only. The time the route table was created.
8968 pub create_time: std::option::Option<wkt::Timestamp>,
8969
8970 /// Output only. The time the route table was last updated.
8971 pub update_time: std::option::Option<wkt::Timestamp>,
8972
8973 /// Optional labels in key-value pair format. For more information about
8974 /// labels, see [Requirements for
8975 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
8976 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8977
8978 /// An optional description of the route table.
8979 pub description: std::string::String,
8980
8981 /// Output only. The Google-generated UUID for the route table. This value is
8982 /// unique across all route table resources. If a route table is deleted and
8983 /// another with the same name is created, the new route table is assigned
8984 /// a different `uid`.
8985 pub uid: std::string::String,
8986
8987 /// Output only. The current lifecycle state of this route table.
8988 pub state: crate::model::State,
8989
8990 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8991}
8992
8993impl RouteTable {
8994 pub fn new() -> Self {
8995 std::default::Default::default()
8996 }
8997
8998 /// Sets the value of [name][crate::model::RouteTable::name].
8999 ///
9000 /// # Example
9001 /// ```ignore,no_run
9002 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9003 /// let x = RouteTable::new().set_name("example");
9004 /// ```
9005 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9006 self.name = v.into();
9007 self
9008 }
9009
9010 /// Sets the value of [create_time][crate::model::RouteTable::create_time].
9011 ///
9012 /// # Example
9013 /// ```ignore,no_run
9014 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9015 /// use wkt::Timestamp;
9016 /// let x = RouteTable::new().set_create_time(Timestamp::default()/* use setters */);
9017 /// ```
9018 pub fn set_create_time<T>(mut self, v: T) -> Self
9019 where
9020 T: std::convert::Into<wkt::Timestamp>,
9021 {
9022 self.create_time = std::option::Option::Some(v.into());
9023 self
9024 }
9025
9026 /// Sets or clears the value of [create_time][crate::model::RouteTable::create_time].
9027 ///
9028 /// # Example
9029 /// ```ignore,no_run
9030 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9031 /// use wkt::Timestamp;
9032 /// let x = RouteTable::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9033 /// let x = RouteTable::new().set_or_clear_create_time(None::<Timestamp>);
9034 /// ```
9035 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9036 where
9037 T: std::convert::Into<wkt::Timestamp>,
9038 {
9039 self.create_time = v.map(|x| x.into());
9040 self
9041 }
9042
9043 /// Sets the value of [update_time][crate::model::RouteTable::update_time].
9044 ///
9045 /// # Example
9046 /// ```ignore,no_run
9047 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9048 /// use wkt::Timestamp;
9049 /// let x = RouteTable::new().set_update_time(Timestamp::default()/* use setters */);
9050 /// ```
9051 pub fn set_update_time<T>(mut self, v: T) -> Self
9052 where
9053 T: std::convert::Into<wkt::Timestamp>,
9054 {
9055 self.update_time = std::option::Option::Some(v.into());
9056 self
9057 }
9058
9059 /// Sets or clears the value of [update_time][crate::model::RouteTable::update_time].
9060 ///
9061 /// # Example
9062 /// ```ignore,no_run
9063 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9064 /// use wkt::Timestamp;
9065 /// let x = RouteTable::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9066 /// let x = RouteTable::new().set_or_clear_update_time(None::<Timestamp>);
9067 /// ```
9068 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9069 where
9070 T: std::convert::Into<wkt::Timestamp>,
9071 {
9072 self.update_time = v.map(|x| x.into());
9073 self
9074 }
9075
9076 /// Sets the value of [labels][crate::model::RouteTable::labels].
9077 ///
9078 /// # Example
9079 /// ```ignore,no_run
9080 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9081 /// let x = RouteTable::new().set_labels([
9082 /// ("key0", "abc"),
9083 /// ("key1", "xyz"),
9084 /// ]);
9085 /// ```
9086 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9087 where
9088 T: std::iter::IntoIterator<Item = (K, V)>,
9089 K: std::convert::Into<std::string::String>,
9090 V: std::convert::Into<std::string::String>,
9091 {
9092 use std::iter::Iterator;
9093 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9094 self
9095 }
9096
9097 /// Sets the value of [description][crate::model::RouteTable::description].
9098 ///
9099 /// # Example
9100 /// ```ignore,no_run
9101 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9102 /// let x = RouteTable::new().set_description("example");
9103 /// ```
9104 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9105 self.description = v.into();
9106 self
9107 }
9108
9109 /// Sets the value of [uid][crate::model::RouteTable::uid].
9110 ///
9111 /// # Example
9112 /// ```ignore,no_run
9113 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9114 /// let x = RouteTable::new().set_uid("example");
9115 /// ```
9116 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9117 self.uid = v.into();
9118 self
9119 }
9120
9121 /// Sets the value of [state][crate::model::RouteTable::state].
9122 ///
9123 /// # Example
9124 /// ```ignore,no_run
9125 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9126 /// use google_cloud_networkconnectivity_v1::model::State;
9127 /// let x0 = RouteTable::new().set_state(State::Creating);
9128 /// let x1 = RouteTable::new().set_state(State::Active);
9129 /// let x2 = RouteTable::new().set_state(State::Deleting);
9130 /// ```
9131 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9132 self.state = v.into();
9133 self
9134 }
9135}
9136
9137impl wkt::message::Message for RouteTable {
9138 fn typename() -> &'static str {
9139 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouteTable"
9140 }
9141}
9142
9143/// A route defines a path from VM instances within a spoke to a specific
9144/// destination resource. Only VPC spokes have routes.
9145#[derive(Clone, Default, PartialEq)]
9146#[non_exhaustive]
9147pub struct Route {
9148 /// Immutable. The name of the route. Route names must be unique. Route names
9149 /// use the following form:
9150 /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}/routes/{route_id}`
9151 pub name: std::string::String,
9152
9153 /// Output only. The time the route was created.
9154 pub create_time: std::option::Option<wkt::Timestamp>,
9155
9156 /// Output only. The time the route was last updated.
9157 pub update_time: std::option::Option<wkt::Timestamp>,
9158
9159 /// The destination IP address range.
9160 pub ip_cidr_range: std::string::String,
9161
9162 /// Output only. The route's type. Its type is determined by the properties of
9163 /// its IP address range.
9164 pub r#type: crate::model::RouteType,
9165
9166 /// Immutable. The destination VPC network for packets on this route.
9167 pub next_hop_vpc_network: std::option::Option<crate::model::NextHopVpcNetwork>,
9168
9169 /// Optional labels in key-value pair format. For more information about
9170 /// labels, see [Requirements for
9171 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
9172 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9173
9174 /// An optional description of the route.
9175 pub description: std::string::String,
9176
9177 /// Output only. The Google-generated UUID for the route. This value is unique
9178 /// across all Network Connectivity Center route resources. If a
9179 /// route is deleted and another with the same name is created,
9180 /// the new route is assigned a different `uid`.
9181 pub uid: std::string::String,
9182
9183 /// Output only. The current lifecycle state of the route.
9184 pub state: crate::model::State,
9185
9186 /// Immutable. The spoke that this route leads to.
9187 /// Example: projects/12345/locations/global/spokes/SPOKE
9188 pub spoke: std::string::String,
9189
9190 /// Output only. The origin location of the route.
9191 /// Uses the following form: "projects/{project}/locations/{location}"
9192 /// Example: projects/1234/locations/us-central1
9193 pub location: std::string::String,
9194
9195 /// Output only. The priority of this route. Priority is used to break ties in
9196 /// cases where a destination matches more than one route. In these cases the
9197 /// route with the lowest-numbered priority value wins.
9198 pub priority: i64,
9199
9200 /// Immutable. The next-hop VPN tunnel for packets on this route.
9201 pub next_hop_vpn_tunnel: std::option::Option<crate::model::NextHopVPNTunnel>,
9202
9203 /// Immutable. The next-hop Router appliance instance for packets on this
9204 /// route.
9205 pub next_hop_router_appliance_instance:
9206 std::option::Option<crate::model::NextHopRouterApplianceInstance>,
9207
9208 /// Immutable. The next-hop VLAN attachment for packets on this route.
9209 pub next_hop_interconnect_attachment:
9210 std::option::Option<crate::model::NextHopInterconnectAttachment>,
9211
9212 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9213}
9214
9215impl Route {
9216 pub fn new() -> Self {
9217 std::default::Default::default()
9218 }
9219
9220 /// Sets the value of [name][crate::model::Route::name].
9221 ///
9222 /// # Example
9223 /// ```ignore,no_run
9224 /// # use google_cloud_networkconnectivity_v1::model::Route;
9225 /// let x = Route::new().set_name("example");
9226 /// ```
9227 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9228 self.name = v.into();
9229 self
9230 }
9231
9232 /// Sets the value of [create_time][crate::model::Route::create_time].
9233 ///
9234 /// # Example
9235 /// ```ignore,no_run
9236 /// # use google_cloud_networkconnectivity_v1::model::Route;
9237 /// use wkt::Timestamp;
9238 /// let x = Route::new().set_create_time(Timestamp::default()/* use setters */);
9239 /// ```
9240 pub fn set_create_time<T>(mut self, v: T) -> Self
9241 where
9242 T: std::convert::Into<wkt::Timestamp>,
9243 {
9244 self.create_time = std::option::Option::Some(v.into());
9245 self
9246 }
9247
9248 /// Sets or clears the value of [create_time][crate::model::Route::create_time].
9249 ///
9250 /// # Example
9251 /// ```ignore,no_run
9252 /// # use google_cloud_networkconnectivity_v1::model::Route;
9253 /// use wkt::Timestamp;
9254 /// let x = Route::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9255 /// let x = Route::new().set_or_clear_create_time(None::<Timestamp>);
9256 /// ```
9257 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9258 where
9259 T: std::convert::Into<wkt::Timestamp>,
9260 {
9261 self.create_time = v.map(|x| x.into());
9262 self
9263 }
9264
9265 /// Sets the value of [update_time][crate::model::Route::update_time].
9266 ///
9267 /// # Example
9268 /// ```ignore,no_run
9269 /// # use google_cloud_networkconnectivity_v1::model::Route;
9270 /// use wkt::Timestamp;
9271 /// let x = Route::new().set_update_time(Timestamp::default()/* use setters */);
9272 /// ```
9273 pub fn set_update_time<T>(mut self, v: T) -> Self
9274 where
9275 T: std::convert::Into<wkt::Timestamp>,
9276 {
9277 self.update_time = std::option::Option::Some(v.into());
9278 self
9279 }
9280
9281 /// Sets or clears the value of [update_time][crate::model::Route::update_time].
9282 ///
9283 /// # Example
9284 /// ```ignore,no_run
9285 /// # use google_cloud_networkconnectivity_v1::model::Route;
9286 /// use wkt::Timestamp;
9287 /// let x = Route::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9288 /// let x = Route::new().set_or_clear_update_time(None::<Timestamp>);
9289 /// ```
9290 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9291 where
9292 T: std::convert::Into<wkt::Timestamp>,
9293 {
9294 self.update_time = v.map(|x| x.into());
9295 self
9296 }
9297
9298 /// Sets the value of [ip_cidr_range][crate::model::Route::ip_cidr_range].
9299 ///
9300 /// # Example
9301 /// ```ignore,no_run
9302 /// # use google_cloud_networkconnectivity_v1::model::Route;
9303 /// let x = Route::new().set_ip_cidr_range("example");
9304 /// ```
9305 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9306 self.ip_cidr_range = v.into();
9307 self
9308 }
9309
9310 /// Sets the value of [r#type][crate::model::Route::type].
9311 ///
9312 /// # Example
9313 /// ```ignore,no_run
9314 /// # use google_cloud_networkconnectivity_v1::model::Route;
9315 /// use google_cloud_networkconnectivity_v1::model::RouteType;
9316 /// let x0 = Route::new().set_type(RouteType::VpcPrimarySubnet);
9317 /// let x1 = Route::new().set_type(RouteType::VpcSecondarySubnet);
9318 /// let x2 = Route::new().set_type(RouteType::DynamicRoute);
9319 /// ```
9320 pub fn set_type<T: std::convert::Into<crate::model::RouteType>>(mut self, v: T) -> Self {
9321 self.r#type = v.into();
9322 self
9323 }
9324
9325 /// Sets the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
9326 ///
9327 /// # Example
9328 /// ```ignore,no_run
9329 /// # use google_cloud_networkconnectivity_v1::model::Route;
9330 /// use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
9331 /// let x = Route::new().set_next_hop_vpc_network(NextHopVpcNetwork::default()/* use setters */);
9332 /// ```
9333 pub fn set_next_hop_vpc_network<T>(mut self, v: T) -> Self
9334 where
9335 T: std::convert::Into<crate::model::NextHopVpcNetwork>,
9336 {
9337 self.next_hop_vpc_network = std::option::Option::Some(v.into());
9338 self
9339 }
9340
9341 /// Sets or clears the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
9342 ///
9343 /// # Example
9344 /// ```ignore,no_run
9345 /// # use google_cloud_networkconnectivity_v1::model::Route;
9346 /// use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
9347 /// let x = Route::new().set_or_clear_next_hop_vpc_network(Some(NextHopVpcNetwork::default()/* use setters */));
9348 /// let x = Route::new().set_or_clear_next_hop_vpc_network(None::<NextHopVpcNetwork>);
9349 /// ```
9350 pub fn set_or_clear_next_hop_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
9351 where
9352 T: std::convert::Into<crate::model::NextHopVpcNetwork>,
9353 {
9354 self.next_hop_vpc_network = v.map(|x| x.into());
9355 self
9356 }
9357
9358 /// Sets the value of [labels][crate::model::Route::labels].
9359 ///
9360 /// # Example
9361 /// ```ignore,no_run
9362 /// # use google_cloud_networkconnectivity_v1::model::Route;
9363 /// let x = Route::new().set_labels([
9364 /// ("key0", "abc"),
9365 /// ("key1", "xyz"),
9366 /// ]);
9367 /// ```
9368 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9369 where
9370 T: std::iter::IntoIterator<Item = (K, V)>,
9371 K: std::convert::Into<std::string::String>,
9372 V: std::convert::Into<std::string::String>,
9373 {
9374 use std::iter::Iterator;
9375 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9376 self
9377 }
9378
9379 /// Sets the value of [description][crate::model::Route::description].
9380 ///
9381 /// # Example
9382 /// ```ignore,no_run
9383 /// # use google_cloud_networkconnectivity_v1::model::Route;
9384 /// let x = Route::new().set_description("example");
9385 /// ```
9386 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9387 self.description = v.into();
9388 self
9389 }
9390
9391 /// Sets the value of [uid][crate::model::Route::uid].
9392 ///
9393 /// # Example
9394 /// ```ignore,no_run
9395 /// # use google_cloud_networkconnectivity_v1::model::Route;
9396 /// let x = Route::new().set_uid("example");
9397 /// ```
9398 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9399 self.uid = v.into();
9400 self
9401 }
9402
9403 /// Sets the value of [state][crate::model::Route::state].
9404 ///
9405 /// # Example
9406 /// ```ignore,no_run
9407 /// # use google_cloud_networkconnectivity_v1::model::Route;
9408 /// use google_cloud_networkconnectivity_v1::model::State;
9409 /// let x0 = Route::new().set_state(State::Creating);
9410 /// let x1 = Route::new().set_state(State::Active);
9411 /// let x2 = Route::new().set_state(State::Deleting);
9412 /// ```
9413 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9414 self.state = v.into();
9415 self
9416 }
9417
9418 /// Sets the value of [spoke][crate::model::Route::spoke].
9419 ///
9420 /// # Example
9421 /// ```ignore,no_run
9422 /// # use google_cloud_networkconnectivity_v1::model::Route;
9423 /// let x = Route::new().set_spoke("example");
9424 /// ```
9425 pub fn set_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9426 self.spoke = v.into();
9427 self
9428 }
9429
9430 /// Sets the value of [location][crate::model::Route::location].
9431 ///
9432 /// # Example
9433 /// ```ignore,no_run
9434 /// # use google_cloud_networkconnectivity_v1::model::Route;
9435 /// let x = Route::new().set_location("example");
9436 /// ```
9437 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9438 self.location = v.into();
9439 self
9440 }
9441
9442 /// Sets the value of [priority][crate::model::Route::priority].
9443 ///
9444 /// # Example
9445 /// ```ignore,no_run
9446 /// # use google_cloud_networkconnectivity_v1::model::Route;
9447 /// let x = Route::new().set_priority(42);
9448 /// ```
9449 pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9450 self.priority = v.into();
9451 self
9452 }
9453
9454 /// Sets the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
9455 ///
9456 /// # Example
9457 /// ```ignore,no_run
9458 /// # use google_cloud_networkconnectivity_v1::model::Route;
9459 /// use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
9460 /// let x = Route::new().set_next_hop_vpn_tunnel(NextHopVPNTunnel::default()/* use setters */);
9461 /// ```
9462 pub fn set_next_hop_vpn_tunnel<T>(mut self, v: T) -> Self
9463 where
9464 T: std::convert::Into<crate::model::NextHopVPNTunnel>,
9465 {
9466 self.next_hop_vpn_tunnel = std::option::Option::Some(v.into());
9467 self
9468 }
9469
9470 /// Sets or clears the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
9471 ///
9472 /// # Example
9473 /// ```ignore,no_run
9474 /// # use google_cloud_networkconnectivity_v1::model::Route;
9475 /// use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
9476 /// let x = Route::new().set_or_clear_next_hop_vpn_tunnel(Some(NextHopVPNTunnel::default()/* use setters */));
9477 /// let x = Route::new().set_or_clear_next_hop_vpn_tunnel(None::<NextHopVPNTunnel>);
9478 /// ```
9479 pub fn set_or_clear_next_hop_vpn_tunnel<T>(mut self, v: std::option::Option<T>) -> Self
9480 where
9481 T: std::convert::Into<crate::model::NextHopVPNTunnel>,
9482 {
9483 self.next_hop_vpn_tunnel = v.map(|x| x.into());
9484 self
9485 }
9486
9487 /// Sets the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
9488 ///
9489 /// # Example
9490 /// ```ignore,no_run
9491 /// # use google_cloud_networkconnectivity_v1::model::Route;
9492 /// use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
9493 /// let x = Route::new().set_next_hop_router_appliance_instance(NextHopRouterApplianceInstance::default()/* use setters */);
9494 /// ```
9495 pub fn set_next_hop_router_appliance_instance<T>(mut self, v: T) -> Self
9496 where
9497 T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
9498 {
9499 self.next_hop_router_appliance_instance = std::option::Option::Some(v.into());
9500 self
9501 }
9502
9503 /// Sets or clears the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
9504 ///
9505 /// # Example
9506 /// ```ignore,no_run
9507 /// # use google_cloud_networkconnectivity_v1::model::Route;
9508 /// use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
9509 /// let x = Route::new().set_or_clear_next_hop_router_appliance_instance(Some(NextHopRouterApplianceInstance::default()/* use setters */));
9510 /// let x = Route::new().set_or_clear_next_hop_router_appliance_instance(None::<NextHopRouterApplianceInstance>);
9511 /// ```
9512 pub fn set_or_clear_next_hop_router_appliance_instance<T>(
9513 mut self,
9514 v: std::option::Option<T>,
9515 ) -> Self
9516 where
9517 T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
9518 {
9519 self.next_hop_router_appliance_instance = v.map(|x| x.into());
9520 self
9521 }
9522
9523 /// Sets the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
9524 ///
9525 /// # Example
9526 /// ```ignore,no_run
9527 /// # use google_cloud_networkconnectivity_v1::model::Route;
9528 /// use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
9529 /// let x = Route::new().set_next_hop_interconnect_attachment(NextHopInterconnectAttachment::default()/* use setters */);
9530 /// ```
9531 pub fn set_next_hop_interconnect_attachment<T>(mut self, v: T) -> Self
9532 where
9533 T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
9534 {
9535 self.next_hop_interconnect_attachment = std::option::Option::Some(v.into());
9536 self
9537 }
9538
9539 /// Sets or clears the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
9540 ///
9541 /// # Example
9542 /// ```ignore,no_run
9543 /// # use google_cloud_networkconnectivity_v1::model::Route;
9544 /// use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
9545 /// let x = Route::new().set_or_clear_next_hop_interconnect_attachment(Some(NextHopInterconnectAttachment::default()/* use setters */));
9546 /// let x = Route::new().set_or_clear_next_hop_interconnect_attachment(None::<NextHopInterconnectAttachment>);
9547 /// ```
9548 pub fn set_or_clear_next_hop_interconnect_attachment<T>(
9549 mut self,
9550 v: std::option::Option<T>,
9551 ) -> Self
9552 where
9553 T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
9554 {
9555 self.next_hop_interconnect_attachment = v.map(|x| x.into());
9556 self
9557 }
9558}
9559
9560impl wkt::message::Message for Route {
9561 fn typename() -> &'static str {
9562 "type.googleapis.com/google.cloud.networkconnectivity.v1.Route"
9563 }
9564}
9565
9566/// A group represents a subset of spokes attached to a hub.
9567#[derive(Clone, Default, PartialEq)]
9568#[non_exhaustive]
9569pub struct Group {
9570 /// Immutable. The name of the group. Group names must be unique. They
9571 /// use the following form:
9572 /// `projects/{project_number}/locations/global/hubs/{hub}/groups/{group_id}`
9573 pub name: std::string::String,
9574
9575 /// Output only. The time the group was created.
9576 pub create_time: std::option::Option<wkt::Timestamp>,
9577
9578 /// Output only. The time the group was last updated.
9579 pub update_time: std::option::Option<wkt::Timestamp>,
9580
9581 /// Optional. Labels in key-value pair format. For more information about
9582 /// labels, see [Requirements for
9583 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
9584 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9585
9586 /// Optional. The description of the group.
9587 pub description: std::string::String,
9588
9589 /// Output only. The Google-generated UUID for the group. This value is unique
9590 /// across all group resources. If a group is deleted and
9591 /// another with the same name is created, the new route table is assigned
9592 /// a different unique_id.
9593 pub uid: std::string::String,
9594
9595 /// Output only. The current lifecycle state of this group.
9596 pub state: crate::model::State,
9597
9598 /// Optional. The auto-accept setting for this group.
9599 pub auto_accept: std::option::Option<crate::model::AutoAccept>,
9600
9601 /// Output only. The name of the route table that corresponds to this group.
9602 /// They use the following form:
9603 /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
9604 pub route_table: std::string::String,
9605
9606 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9607}
9608
9609impl Group {
9610 pub fn new() -> Self {
9611 std::default::Default::default()
9612 }
9613
9614 /// Sets the value of [name][crate::model::Group::name].
9615 ///
9616 /// # Example
9617 /// ```ignore,no_run
9618 /// # use google_cloud_networkconnectivity_v1::model::Group;
9619 /// let x = Group::new().set_name("example");
9620 /// ```
9621 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9622 self.name = v.into();
9623 self
9624 }
9625
9626 /// Sets the value of [create_time][crate::model::Group::create_time].
9627 ///
9628 /// # Example
9629 /// ```ignore,no_run
9630 /// # use google_cloud_networkconnectivity_v1::model::Group;
9631 /// use wkt::Timestamp;
9632 /// let x = Group::new().set_create_time(Timestamp::default()/* use setters */);
9633 /// ```
9634 pub fn set_create_time<T>(mut self, v: T) -> Self
9635 where
9636 T: std::convert::Into<wkt::Timestamp>,
9637 {
9638 self.create_time = std::option::Option::Some(v.into());
9639 self
9640 }
9641
9642 /// Sets or clears the value of [create_time][crate::model::Group::create_time].
9643 ///
9644 /// # Example
9645 /// ```ignore,no_run
9646 /// # use google_cloud_networkconnectivity_v1::model::Group;
9647 /// use wkt::Timestamp;
9648 /// let x = Group::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9649 /// let x = Group::new().set_or_clear_create_time(None::<Timestamp>);
9650 /// ```
9651 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9652 where
9653 T: std::convert::Into<wkt::Timestamp>,
9654 {
9655 self.create_time = v.map(|x| x.into());
9656 self
9657 }
9658
9659 /// Sets the value of [update_time][crate::model::Group::update_time].
9660 ///
9661 /// # Example
9662 /// ```ignore,no_run
9663 /// # use google_cloud_networkconnectivity_v1::model::Group;
9664 /// use wkt::Timestamp;
9665 /// let x = Group::new().set_update_time(Timestamp::default()/* use setters */);
9666 /// ```
9667 pub fn set_update_time<T>(mut self, v: T) -> Self
9668 where
9669 T: std::convert::Into<wkt::Timestamp>,
9670 {
9671 self.update_time = std::option::Option::Some(v.into());
9672 self
9673 }
9674
9675 /// Sets or clears the value of [update_time][crate::model::Group::update_time].
9676 ///
9677 /// # Example
9678 /// ```ignore,no_run
9679 /// # use google_cloud_networkconnectivity_v1::model::Group;
9680 /// use wkt::Timestamp;
9681 /// let x = Group::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9682 /// let x = Group::new().set_or_clear_update_time(None::<Timestamp>);
9683 /// ```
9684 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9685 where
9686 T: std::convert::Into<wkt::Timestamp>,
9687 {
9688 self.update_time = v.map(|x| x.into());
9689 self
9690 }
9691
9692 /// Sets the value of [labels][crate::model::Group::labels].
9693 ///
9694 /// # Example
9695 /// ```ignore,no_run
9696 /// # use google_cloud_networkconnectivity_v1::model::Group;
9697 /// let x = Group::new().set_labels([
9698 /// ("key0", "abc"),
9699 /// ("key1", "xyz"),
9700 /// ]);
9701 /// ```
9702 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9703 where
9704 T: std::iter::IntoIterator<Item = (K, V)>,
9705 K: std::convert::Into<std::string::String>,
9706 V: std::convert::Into<std::string::String>,
9707 {
9708 use std::iter::Iterator;
9709 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9710 self
9711 }
9712
9713 /// Sets the value of [description][crate::model::Group::description].
9714 ///
9715 /// # Example
9716 /// ```ignore,no_run
9717 /// # use google_cloud_networkconnectivity_v1::model::Group;
9718 /// let x = Group::new().set_description("example");
9719 /// ```
9720 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9721 self.description = v.into();
9722 self
9723 }
9724
9725 /// Sets the value of [uid][crate::model::Group::uid].
9726 ///
9727 /// # Example
9728 /// ```ignore,no_run
9729 /// # use google_cloud_networkconnectivity_v1::model::Group;
9730 /// let x = Group::new().set_uid("example");
9731 /// ```
9732 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9733 self.uid = v.into();
9734 self
9735 }
9736
9737 /// Sets the value of [state][crate::model::Group::state].
9738 ///
9739 /// # Example
9740 /// ```ignore,no_run
9741 /// # use google_cloud_networkconnectivity_v1::model::Group;
9742 /// use google_cloud_networkconnectivity_v1::model::State;
9743 /// let x0 = Group::new().set_state(State::Creating);
9744 /// let x1 = Group::new().set_state(State::Active);
9745 /// let x2 = Group::new().set_state(State::Deleting);
9746 /// ```
9747 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9748 self.state = v.into();
9749 self
9750 }
9751
9752 /// Sets the value of [auto_accept][crate::model::Group::auto_accept].
9753 ///
9754 /// # Example
9755 /// ```ignore,no_run
9756 /// # use google_cloud_networkconnectivity_v1::model::Group;
9757 /// use google_cloud_networkconnectivity_v1::model::AutoAccept;
9758 /// let x = Group::new().set_auto_accept(AutoAccept::default()/* use setters */);
9759 /// ```
9760 pub fn set_auto_accept<T>(mut self, v: T) -> Self
9761 where
9762 T: std::convert::Into<crate::model::AutoAccept>,
9763 {
9764 self.auto_accept = std::option::Option::Some(v.into());
9765 self
9766 }
9767
9768 /// Sets or clears the value of [auto_accept][crate::model::Group::auto_accept].
9769 ///
9770 /// # Example
9771 /// ```ignore,no_run
9772 /// # use google_cloud_networkconnectivity_v1::model::Group;
9773 /// use google_cloud_networkconnectivity_v1::model::AutoAccept;
9774 /// let x = Group::new().set_or_clear_auto_accept(Some(AutoAccept::default()/* use setters */));
9775 /// let x = Group::new().set_or_clear_auto_accept(None::<AutoAccept>);
9776 /// ```
9777 pub fn set_or_clear_auto_accept<T>(mut self, v: std::option::Option<T>) -> Self
9778 where
9779 T: std::convert::Into<crate::model::AutoAccept>,
9780 {
9781 self.auto_accept = v.map(|x| x.into());
9782 self
9783 }
9784
9785 /// Sets the value of [route_table][crate::model::Group::route_table].
9786 ///
9787 /// # Example
9788 /// ```ignore,no_run
9789 /// # use google_cloud_networkconnectivity_v1::model::Group;
9790 /// let x = Group::new().set_route_table("example");
9791 /// ```
9792 pub fn set_route_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9793 self.route_table = v.into();
9794 self
9795 }
9796}
9797
9798impl wkt::message::Message for Group {
9799 fn typename() -> &'static str {
9800 "type.googleapis.com/google.cloud.networkconnectivity.v1.Group"
9801 }
9802}
9803
9804/// The auto-accept setting for a group controls whether
9805/// proposed spokes are automatically attached to the hub. If auto-accept is
9806/// enabled, the spoke immediately is attached to the hub and becomes part of the
9807/// group. In this case, the new spoke is in the ACTIVE state.
9808/// If auto-accept is disabled, the spoke goes to the INACTIVE
9809/// state, and it must be reviewed and accepted by a hub
9810/// administrator.
9811#[derive(Clone, Default, PartialEq)]
9812#[non_exhaustive]
9813pub struct AutoAccept {
9814 /// Optional. A list of project ids or project numbers for which you want
9815 /// to enable auto-accept. The auto-accept setting is applied to
9816 /// spokes being created or updated in these projects.
9817 pub auto_accept_projects: std::vec::Vec<std::string::String>,
9818
9819 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9820}
9821
9822impl AutoAccept {
9823 pub fn new() -> Self {
9824 std::default::Default::default()
9825 }
9826
9827 /// Sets the value of [auto_accept_projects][crate::model::AutoAccept::auto_accept_projects].
9828 ///
9829 /// # Example
9830 /// ```ignore,no_run
9831 /// # use google_cloud_networkconnectivity_v1::model::AutoAccept;
9832 /// let x = AutoAccept::new().set_auto_accept_projects(["a", "b", "c"]);
9833 /// ```
9834 pub fn set_auto_accept_projects<T, V>(mut self, v: T) -> Self
9835 where
9836 T: std::iter::IntoIterator<Item = V>,
9837 V: std::convert::Into<std::string::String>,
9838 {
9839 use std::iter::Iterator;
9840 self.auto_accept_projects = v.into_iter().map(|i| i.into()).collect();
9841 self
9842 }
9843}
9844
9845impl wkt::message::Message for AutoAccept {
9846 fn typename() -> &'static str {
9847 "type.googleapis.com/google.cloud.networkconnectivity.v1.AutoAccept"
9848 }
9849}
9850
9851/// Request for
9852/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
9853/// method.
9854///
9855/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
9856#[derive(Clone, Default, PartialEq)]
9857#[non_exhaustive]
9858pub struct ListHubsRequest {
9859 /// Required. The parent resource's name.
9860 pub parent: std::string::String,
9861
9862 /// The maximum number of results per page to return.
9863 pub page_size: i32,
9864
9865 /// The page token.
9866 pub page_token: std::string::String,
9867
9868 /// An expression that filters the list of results.
9869 pub filter: std::string::String,
9870
9871 /// Sort the results by a certain order.
9872 pub order_by: std::string::String,
9873
9874 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9875}
9876
9877impl ListHubsRequest {
9878 pub fn new() -> Self {
9879 std::default::Default::default()
9880 }
9881
9882 /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
9883 ///
9884 /// # Example
9885 /// ```ignore,no_run
9886 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9887 /// let x = ListHubsRequest::new().set_parent("example");
9888 /// ```
9889 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9890 self.parent = v.into();
9891 self
9892 }
9893
9894 /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
9895 ///
9896 /// # Example
9897 /// ```ignore,no_run
9898 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9899 /// let x = ListHubsRequest::new().set_page_size(42);
9900 /// ```
9901 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9902 self.page_size = v.into();
9903 self
9904 }
9905
9906 /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
9907 ///
9908 /// # Example
9909 /// ```ignore,no_run
9910 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9911 /// let x = ListHubsRequest::new().set_page_token("example");
9912 /// ```
9913 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9914 self.page_token = v.into();
9915 self
9916 }
9917
9918 /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
9919 ///
9920 /// # Example
9921 /// ```ignore,no_run
9922 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9923 /// let x = ListHubsRequest::new().set_filter("example");
9924 /// ```
9925 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9926 self.filter = v.into();
9927 self
9928 }
9929
9930 /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
9931 ///
9932 /// # Example
9933 /// ```ignore,no_run
9934 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9935 /// let x = ListHubsRequest::new().set_order_by("example");
9936 /// ```
9937 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9938 self.order_by = v.into();
9939 self
9940 }
9941}
9942
9943impl wkt::message::Message for ListHubsRequest {
9944 fn typename() -> &'static str {
9945 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsRequest"
9946 }
9947}
9948
9949/// Response for
9950/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
9951/// method.
9952///
9953/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
9954#[derive(Clone, Default, PartialEq)]
9955#[non_exhaustive]
9956pub struct ListHubsResponse {
9957 /// The requested hubs.
9958 pub hubs: std::vec::Vec<crate::model::Hub>,
9959
9960 /// The token for the next page of the response. To see more results,
9961 /// use this value as the page_token for your next request. If this value
9962 /// is empty, there are no more results.
9963 pub next_page_token: std::string::String,
9964
9965 /// Locations that could not be reached.
9966 pub unreachable: std::vec::Vec<std::string::String>,
9967
9968 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9969}
9970
9971impl ListHubsResponse {
9972 pub fn new() -> Self {
9973 std::default::Default::default()
9974 }
9975
9976 /// Sets the value of [hubs][crate::model::ListHubsResponse::hubs].
9977 ///
9978 /// # Example
9979 /// ```ignore,no_run
9980 /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
9981 /// use google_cloud_networkconnectivity_v1::model::Hub;
9982 /// let x = ListHubsResponse::new()
9983 /// .set_hubs([
9984 /// Hub::default()/* use setters */,
9985 /// Hub::default()/* use (different) setters */,
9986 /// ]);
9987 /// ```
9988 pub fn set_hubs<T, V>(mut self, v: T) -> Self
9989 where
9990 T: std::iter::IntoIterator<Item = V>,
9991 V: std::convert::Into<crate::model::Hub>,
9992 {
9993 use std::iter::Iterator;
9994 self.hubs = v.into_iter().map(|i| i.into()).collect();
9995 self
9996 }
9997
9998 /// Sets the value of [next_page_token][crate::model::ListHubsResponse::next_page_token].
9999 ///
10000 /// # Example
10001 /// ```ignore,no_run
10002 /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
10003 /// let x = ListHubsResponse::new().set_next_page_token("example");
10004 /// ```
10005 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10006 self.next_page_token = v.into();
10007 self
10008 }
10009
10010 /// Sets the value of [unreachable][crate::model::ListHubsResponse::unreachable].
10011 ///
10012 /// # Example
10013 /// ```ignore,no_run
10014 /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
10015 /// let x = ListHubsResponse::new().set_unreachable(["a", "b", "c"]);
10016 /// ```
10017 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10018 where
10019 T: std::iter::IntoIterator<Item = V>,
10020 V: std::convert::Into<std::string::String>,
10021 {
10022 use std::iter::Iterator;
10023 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10024 self
10025 }
10026}
10027
10028impl wkt::message::Message for ListHubsResponse {
10029 fn typename() -> &'static str {
10030 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsResponse"
10031 }
10032}
10033
10034#[doc(hidden)]
10035impl gax::paginator::internal::PageableResponse for ListHubsResponse {
10036 type PageItem = crate::model::Hub;
10037
10038 fn items(self) -> std::vec::Vec<Self::PageItem> {
10039 self.hubs
10040 }
10041
10042 fn next_page_token(&self) -> std::string::String {
10043 use std::clone::Clone;
10044 self.next_page_token.clone()
10045 }
10046}
10047
10048/// Request for
10049/// [HubService.GetHub][google.cloud.networkconnectivity.v1.HubService.GetHub]
10050/// method.
10051///
10052/// [google.cloud.networkconnectivity.v1.HubService.GetHub]: crate::client::HubService::get_hub
10053#[derive(Clone, Default, PartialEq)]
10054#[non_exhaustive]
10055pub struct GetHubRequest {
10056 /// Required. The name of the hub resource to get.
10057 pub name: std::string::String,
10058
10059 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10060}
10061
10062impl GetHubRequest {
10063 pub fn new() -> Self {
10064 std::default::Default::default()
10065 }
10066
10067 /// Sets the value of [name][crate::model::GetHubRequest::name].
10068 ///
10069 /// # Example
10070 /// ```ignore,no_run
10071 /// # use google_cloud_networkconnectivity_v1::model::GetHubRequest;
10072 /// let x = GetHubRequest::new().set_name("example");
10073 /// ```
10074 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10075 self.name = v.into();
10076 self
10077 }
10078}
10079
10080impl wkt::message::Message for GetHubRequest {
10081 fn typename() -> &'static str {
10082 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetHubRequest"
10083 }
10084}
10085
10086/// Request for
10087/// [HubService.CreateHub][google.cloud.networkconnectivity.v1.HubService.CreateHub]
10088/// method.
10089///
10090/// [google.cloud.networkconnectivity.v1.HubService.CreateHub]: crate::client::HubService::create_hub
10091#[derive(Clone, Default, PartialEq)]
10092#[non_exhaustive]
10093pub struct CreateHubRequest {
10094 /// Required. The parent resource.
10095 pub parent: std::string::String,
10096
10097 /// Required. A unique identifier for the hub.
10098 pub hub_id: std::string::String,
10099
10100 /// Required. The initial values for a new hub.
10101 pub hub: std::option::Option<crate::model::Hub>,
10102
10103 /// Optional. A request ID to identify requests. Specify a unique request ID so
10104 /// that if you must retry your request, the server knows to ignore the request
10105 /// if it has already been completed. The server guarantees that a request
10106 /// doesn't result in creation of duplicate commitments for at least 60
10107 /// minutes.
10108 ///
10109 /// For example, consider a situation where you make an initial request and
10110 /// the request times out. If you make the request again with the same request
10111 /// ID, the server can check to see whether the original operation
10112 /// was received. If it was, the server ignores the second request. This
10113 /// behavior prevents clients from mistakenly creating duplicate commitments.
10114 ///
10115 /// The request ID must be a valid UUID, with the exception that zero UUID is
10116 /// not supported (00000000-0000-0000-0000-000000000000).
10117 pub request_id: std::string::String,
10118
10119 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10120}
10121
10122impl CreateHubRequest {
10123 pub fn new() -> Self {
10124 std::default::Default::default()
10125 }
10126
10127 /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
10128 ///
10129 /// # Example
10130 /// ```ignore,no_run
10131 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10132 /// let x = CreateHubRequest::new().set_parent("example");
10133 /// ```
10134 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10135 self.parent = v.into();
10136 self
10137 }
10138
10139 /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
10140 ///
10141 /// # Example
10142 /// ```ignore,no_run
10143 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10144 /// let x = CreateHubRequest::new().set_hub_id("example");
10145 /// ```
10146 pub fn set_hub_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10147 self.hub_id = v.into();
10148 self
10149 }
10150
10151 /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
10152 ///
10153 /// # Example
10154 /// ```ignore,no_run
10155 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10156 /// use google_cloud_networkconnectivity_v1::model::Hub;
10157 /// let x = CreateHubRequest::new().set_hub(Hub::default()/* use setters */);
10158 /// ```
10159 pub fn set_hub<T>(mut self, v: T) -> Self
10160 where
10161 T: std::convert::Into<crate::model::Hub>,
10162 {
10163 self.hub = std::option::Option::Some(v.into());
10164 self
10165 }
10166
10167 /// Sets or clears the value of [hub][crate::model::CreateHubRequest::hub].
10168 ///
10169 /// # Example
10170 /// ```ignore,no_run
10171 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10172 /// use google_cloud_networkconnectivity_v1::model::Hub;
10173 /// let x = CreateHubRequest::new().set_or_clear_hub(Some(Hub::default()/* use setters */));
10174 /// let x = CreateHubRequest::new().set_or_clear_hub(None::<Hub>);
10175 /// ```
10176 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
10177 where
10178 T: std::convert::Into<crate::model::Hub>,
10179 {
10180 self.hub = v.map(|x| x.into());
10181 self
10182 }
10183
10184 /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
10185 ///
10186 /// # Example
10187 /// ```ignore,no_run
10188 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10189 /// let x = CreateHubRequest::new().set_request_id("example");
10190 /// ```
10191 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10192 self.request_id = v.into();
10193 self
10194 }
10195}
10196
10197impl wkt::message::Message for CreateHubRequest {
10198 fn typename() -> &'static str {
10199 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateHubRequest"
10200 }
10201}
10202
10203/// Request for
10204/// [HubService.UpdateHub][google.cloud.networkconnectivity.v1.HubService.UpdateHub]
10205/// method.
10206///
10207/// [google.cloud.networkconnectivity.v1.HubService.UpdateHub]: crate::client::HubService::update_hub
10208#[derive(Clone, Default, PartialEq)]
10209#[non_exhaustive]
10210pub struct UpdateHubRequest {
10211 /// Optional. In the case of an update to an existing hub, field mask is used
10212 /// to specify the fields to be overwritten. The fields specified in the
10213 /// update_mask are relative to the resource, not the full request. A field is
10214 /// overwritten if it is in the mask. If the user does not provide a mask, then
10215 /// all fields are overwritten.
10216 pub update_mask: std::option::Option<wkt::FieldMask>,
10217
10218 /// Required. The state that the hub should be in after the update.
10219 pub hub: std::option::Option<crate::model::Hub>,
10220
10221 /// Optional. A request ID to identify requests. Specify a unique request ID so
10222 /// that if you must retry your request, the server knows to ignore the request
10223 /// if it has already been completed. The server guarantees that a request
10224 /// doesn't result in creation of duplicate commitments for at least 60
10225 /// minutes.
10226 ///
10227 /// For example, consider a situation where you make an initial request and
10228 /// the request times out. If you make the request again with the same request
10229 /// ID, the server can check to see whether the original operation
10230 /// was received. If it was, the server ignores the second request. This
10231 /// behavior prevents clients from mistakenly creating duplicate commitments.
10232 ///
10233 /// The request ID must be a valid UUID, with the exception that zero UUID is
10234 /// not supported (00000000-0000-0000-0000-000000000000).
10235 pub request_id: std::string::String,
10236
10237 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10238}
10239
10240impl UpdateHubRequest {
10241 pub fn new() -> Self {
10242 std::default::Default::default()
10243 }
10244
10245 /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
10246 ///
10247 /// # Example
10248 /// ```ignore,no_run
10249 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10250 /// use wkt::FieldMask;
10251 /// let x = UpdateHubRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10252 /// ```
10253 pub fn set_update_mask<T>(mut self, v: T) -> Self
10254 where
10255 T: std::convert::Into<wkt::FieldMask>,
10256 {
10257 self.update_mask = std::option::Option::Some(v.into());
10258 self
10259 }
10260
10261 /// Sets or clears the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
10262 ///
10263 /// # Example
10264 /// ```ignore,no_run
10265 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10266 /// use wkt::FieldMask;
10267 /// let x = UpdateHubRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10268 /// let x = UpdateHubRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10269 /// ```
10270 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10271 where
10272 T: std::convert::Into<wkt::FieldMask>,
10273 {
10274 self.update_mask = v.map(|x| x.into());
10275 self
10276 }
10277
10278 /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
10279 ///
10280 /// # Example
10281 /// ```ignore,no_run
10282 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10283 /// use google_cloud_networkconnectivity_v1::model::Hub;
10284 /// let x = UpdateHubRequest::new().set_hub(Hub::default()/* use setters */);
10285 /// ```
10286 pub fn set_hub<T>(mut self, v: T) -> Self
10287 where
10288 T: std::convert::Into<crate::model::Hub>,
10289 {
10290 self.hub = std::option::Option::Some(v.into());
10291 self
10292 }
10293
10294 /// Sets or clears the value of [hub][crate::model::UpdateHubRequest::hub].
10295 ///
10296 /// # Example
10297 /// ```ignore,no_run
10298 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10299 /// use google_cloud_networkconnectivity_v1::model::Hub;
10300 /// let x = UpdateHubRequest::new().set_or_clear_hub(Some(Hub::default()/* use setters */));
10301 /// let x = UpdateHubRequest::new().set_or_clear_hub(None::<Hub>);
10302 /// ```
10303 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
10304 where
10305 T: std::convert::Into<crate::model::Hub>,
10306 {
10307 self.hub = v.map(|x| x.into());
10308 self
10309 }
10310
10311 /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
10312 ///
10313 /// # Example
10314 /// ```ignore,no_run
10315 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10316 /// let x = UpdateHubRequest::new().set_request_id("example");
10317 /// ```
10318 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10319 self.request_id = v.into();
10320 self
10321 }
10322}
10323
10324impl wkt::message::Message for UpdateHubRequest {
10325 fn typename() -> &'static str {
10326 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateHubRequest"
10327 }
10328}
10329
10330/// The request for
10331/// [HubService.DeleteHub][google.cloud.networkconnectivity.v1.HubService.DeleteHub].
10332///
10333/// [google.cloud.networkconnectivity.v1.HubService.DeleteHub]: crate::client::HubService::delete_hub
10334#[derive(Clone, Default, PartialEq)]
10335#[non_exhaustive]
10336pub struct DeleteHubRequest {
10337 /// Required. The name of the hub to delete.
10338 pub name: std::string::String,
10339
10340 /// Optional. A request ID to identify requests. Specify a unique request ID so
10341 /// that if you must retry your request, the server knows to ignore the request
10342 /// if it has already been completed. The server guarantees that a request
10343 /// doesn't result in creation of duplicate commitments for at least 60
10344 /// minutes.
10345 ///
10346 /// For example, consider a situation where you make an initial request and
10347 /// the request times out. If you make the request again with the same request
10348 /// ID, the server can check to see whether the original operation
10349 /// was received. If it was, the server ignores the second request. This
10350 /// behavior prevents clients from mistakenly creating duplicate commitments.
10351 ///
10352 /// The request ID must be a valid UUID, with the exception that zero UUID is
10353 /// not supported (00000000-0000-0000-0000-000000000000).
10354 pub request_id: std::string::String,
10355
10356 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10357}
10358
10359impl DeleteHubRequest {
10360 pub fn new() -> Self {
10361 std::default::Default::default()
10362 }
10363
10364 /// Sets the value of [name][crate::model::DeleteHubRequest::name].
10365 ///
10366 /// # Example
10367 /// ```ignore,no_run
10368 /// # use google_cloud_networkconnectivity_v1::model::DeleteHubRequest;
10369 /// let x = DeleteHubRequest::new().set_name("example");
10370 /// ```
10371 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10372 self.name = v.into();
10373 self
10374 }
10375
10376 /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
10377 ///
10378 /// # Example
10379 /// ```ignore,no_run
10380 /// # use google_cloud_networkconnectivity_v1::model::DeleteHubRequest;
10381 /// let x = DeleteHubRequest::new().set_request_id("example");
10382 /// ```
10383 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10384 self.request_id = v.into();
10385 self
10386 }
10387}
10388
10389impl wkt::message::Message for DeleteHubRequest {
10390 fn typename() -> &'static str {
10391 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteHubRequest"
10392 }
10393}
10394
10395/// The request for
10396/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
10397///
10398/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
10399#[derive(Clone, Default, PartialEq)]
10400#[non_exhaustive]
10401pub struct ListHubSpokesRequest {
10402 /// Required. The name of the hub.
10403 pub name: std::string::String,
10404
10405 /// A list of locations.
10406 /// Specify one of the following: `[global]`, a single region (for
10407 /// example, `[us-central1]`), or a combination of
10408 /// values (for example, `[global, us-central1, us-west1]`).
10409 /// If the spoke_locations field is populated, the list of results
10410 /// includes only spokes in the specified location.
10411 /// If the spoke_locations field is not populated, the list of results
10412 /// includes spokes in all locations.
10413 pub spoke_locations: std::vec::Vec<std::string::String>,
10414
10415 /// The maximum number of results to return per page.
10416 pub page_size: i32,
10417
10418 /// The page token.
10419 pub page_token: std::string::String,
10420
10421 /// An expression that filters the list of results.
10422 pub filter: std::string::String,
10423
10424 /// Sort the results by name or create_time.
10425 pub order_by: std::string::String,
10426
10427 /// The view of the spoke to return.
10428 /// The view that you use determines which spoke fields are included in the
10429 /// response.
10430 pub view: crate::model::list_hub_spokes_request::SpokeView,
10431
10432 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10433}
10434
10435impl ListHubSpokesRequest {
10436 pub fn new() -> Self {
10437 std::default::Default::default()
10438 }
10439
10440 /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
10441 ///
10442 /// # Example
10443 /// ```ignore,no_run
10444 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10445 /// let x = ListHubSpokesRequest::new().set_name("example");
10446 /// ```
10447 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10448 self.name = v.into();
10449 self
10450 }
10451
10452 /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
10453 ///
10454 /// # Example
10455 /// ```ignore,no_run
10456 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10457 /// let x = ListHubSpokesRequest::new().set_spoke_locations(["a", "b", "c"]);
10458 /// ```
10459 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
10460 where
10461 T: std::iter::IntoIterator<Item = V>,
10462 V: std::convert::Into<std::string::String>,
10463 {
10464 use std::iter::Iterator;
10465 self.spoke_locations = v.into_iter().map(|i| i.into()).collect();
10466 self
10467 }
10468
10469 /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
10470 ///
10471 /// # Example
10472 /// ```ignore,no_run
10473 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10474 /// let x = ListHubSpokesRequest::new().set_page_size(42);
10475 /// ```
10476 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10477 self.page_size = v.into();
10478 self
10479 }
10480
10481 /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
10482 ///
10483 /// # Example
10484 /// ```ignore,no_run
10485 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10486 /// let x = ListHubSpokesRequest::new().set_page_token("example");
10487 /// ```
10488 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10489 self.page_token = v.into();
10490 self
10491 }
10492
10493 /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
10494 ///
10495 /// # Example
10496 /// ```ignore,no_run
10497 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10498 /// let x = ListHubSpokesRequest::new().set_filter("example");
10499 /// ```
10500 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10501 self.filter = v.into();
10502 self
10503 }
10504
10505 /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
10506 ///
10507 /// # Example
10508 /// ```ignore,no_run
10509 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10510 /// let x = ListHubSpokesRequest::new().set_order_by("example");
10511 /// ```
10512 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10513 self.order_by = v.into();
10514 self
10515 }
10516
10517 /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
10518 ///
10519 /// # Example
10520 /// ```ignore,no_run
10521 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10522 /// use google_cloud_networkconnectivity_v1::model::list_hub_spokes_request::SpokeView;
10523 /// let x0 = ListHubSpokesRequest::new().set_view(SpokeView::Basic);
10524 /// let x1 = ListHubSpokesRequest::new().set_view(SpokeView::Detailed);
10525 /// ```
10526 pub fn set_view<T: std::convert::Into<crate::model::list_hub_spokes_request::SpokeView>>(
10527 mut self,
10528 v: T,
10529 ) -> Self {
10530 self.view = v.into();
10531 self
10532 }
10533}
10534
10535impl wkt::message::Message for ListHubSpokesRequest {
10536 fn typename() -> &'static str {
10537 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"
10538 }
10539}
10540
10541/// Defines additional types related to [ListHubSpokesRequest].
10542pub mod list_hub_spokes_request {
10543 #[allow(unused_imports)]
10544 use super::*;
10545
10546 /// Enum that controls which spoke fields are included in the response.
10547 ///
10548 /// # Working with unknown values
10549 ///
10550 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10551 /// additional enum variants at any time. Adding new variants is not considered
10552 /// a breaking change. Applications should write their code in anticipation of:
10553 ///
10554 /// - New values appearing in future releases of the client library, **and**
10555 /// - New values received dynamically, without application changes.
10556 ///
10557 /// Please consult the [Working with enums] section in the user guide for some
10558 /// guidelines.
10559 ///
10560 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10561 #[derive(Clone, Debug, PartialEq)]
10562 #[non_exhaustive]
10563 pub enum SpokeView {
10564 /// The spoke view is unspecified. When the spoke view is unspecified, the
10565 /// API returns the same fields as the `BASIC` view.
10566 Unspecified,
10567 /// Includes `name`, `create_time`, `hub`, `unique_id`, `state`, `reasons`,
10568 /// and `spoke_type`. This is the default value.
10569 Basic,
10570 /// Includes all spoke fields except `labels`.
10571 /// You can use the `DETAILED` view only when you set the `spoke_locations`
10572 /// field to `[global]`.
10573 Detailed,
10574 /// If set, the enum was initialized with an unknown value.
10575 ///
10576 /// Applications can examine the value using [SpokeView::value] or
10577 /// [SpokeView::name].
10578 UnknownValue(spoke_view::UnknownValue),
10579 }
10580
10581 #[doc(hidden)]
10582 pub mod spoke_view {
10583 #[allow(unused_imports)]
10584 use super::*;
10585 #[derive(Clone, Debug, PartialEq)]
10586 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10587 }
10588
10589 impl SpokeView {
10590 /// Gets the enum value.
10591 ///
10592 /// Returns `None` if the enum contains an unknown value deserialized from
10593 /// the string representation of enums.
10594 pub fn value(&self) -> std::option::Option<i32> {
10595 match self {
10596 Self::Unspecified => std::option::Option::Some(0),
10597 Self::Basic => std::option::Option::Some(1),
10598 Self::Detailed => std::option::Option::Some(2),
10599 Self::UnknownValue(u) => u.0.value(),
10600 }
10601 }
10602
10603 /// Gets the enum value as a string.
10604 ///
10605 /// Returns `None` if the enum contains an unknown value deserialized from
10606 /// the integer representation of enums.
10607 pub fn name(&self) -> std::option::Option<&str> {
10608 match self {
10609 Self::Unspecified => std::option::Option::Some("SPOKE_VIEW_UNSPECIFIED"),
10610 Self::Basic => std::option::Option::Some("BASIC"),
10611 Self::Detailed => std::option::Option::Some("DETAILED"),
10612 Self::UnknownValue(u) => u.0.name(),
10613 }
10614 }
10615 }
10616
10617 impl std::default::Default for SpokeView {
10618 fn default() -> Self {
10619 use std::convert::From;
10620 Self::from(0)
10621 }
10622 }
10623
10624 impl std::fmt::Display for SpokeView {
10625 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10626 wkt::internal::display_enum(f, self.name(), self.value())
10627 }
10628 }
10629
10630 impl std::convert::From<i32> for SpokeView {
10631 fn from(value: i32) -> Self {
10632 match value {
10633 0 => Self::Unspecified,
10634 1 => Self::Basic,
10635 2 => Self::Detailed,
10636 _ => Self::UnknownValue(spoke_view::UnknownValue(
10637 wkt::internal::UnknownEnumValue::Integer(value),
10638 )),
10639 }
10640 }
10641 }
10642
10643 impl std::convert::From<&str> for SpokeView {
10644 fn from(value: &str) -> Self {
10645 use std::string::ToString;
10646 match value {
10647 "SPOKE_VIEW_UNSPECIFIED" => Self::Unspecified,
10648 "BASIC" => Self::Basic,
10649 "DETAILED" => Self::Detailed,
10650 _ => Self::UnknownValue(spoke_view::UnknownValue(
10651 wkt::internal::UnknownEnumValue::String(value.to_string()),
10652 )),
10653 }
10654 }
10655 }
10656
10657 impl serde::ser::Serialize for SpokeView {
10658 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10659 where
10660 S: serde::Serializer,
10661 {
10662 match self {
10663 Self::Unspecified => serializer.serialize_i32(0),
10664 Self::Basic => serializer.serialize_i32(1),
10665 Self::Detailed => serializer.serialize_i32(2),
10666 Self::UnknownValue(u) => u.0.serialize(serializer),
10667 }
10668 }
10669 }
10670
10671 impl<'de> serde::de::Deserialize<'de> for SpokeView {
10672 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10673 where
10674 D: serde::Deserializer<'de>,
10675 {
10676 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeView>::new(
10677 ".google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView",
10678 ))
10679 }
10680 }
10681}
10682
10683/// The response for
10684/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
10685///
10686/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
10687#[derive(Clone, Default, PartialEq)]
10688#[non_exhaustive]
10689pub struct ListHubSpokesResponse {
10690 /// The requested spokes.
10691 /// The spoke fields can be partially populated based on the `view` field in
10692 /// the request message.
10693 pub spokes: std::vec::Vec<crate::model::Spoke>,
10694
10695 /// The token for the next page of the response. To see more results,
10696 /// use this value as the page_token for your next request. If this value
10697 /// is empty, there are no more results.
10698 pub next_page_token: std::string::String,
10699
10700 /// Locations that could not be reached.
10701 pub unreachable: std::vec::Vec<std::string::String>,
10702
10703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10704}
10705
10706impl ListHubSpokesResponse {
10707 pub fn new() -> Self {
10708 std::default::Default::default()
10709 }
10710
10711 /// Sets the value of [spokes][crate::model::ListHubSpokesResponse::spokes].
10712 ///
10713 /// # Example
10714 /// ```ignore,no_run
10715 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10716 /// use google_cloud_networkconnectivity_v1::model::Spoke;
10717 /// let x = ListHubSpokesResponse::new()
10718 /// .set_spokes([
10719 /// Spoke::default()/* use setters */,
10720 /// Spoke::default()/* use (different) setters */,
10721 /// ]);
10722 /// ```
10723 pub fn set_spokes<T, V>(mut self, v: T) -> Self
10724 where
10725 T: std::iter::IntoIterator<Item = V>,
10726 V: std::convert::Into<crate::model::Spoke>,
10727 {
10728 use std::iter::Iterator;
10729 self.spokes = v.into_iter().map(|i| i.into()).collect();
10730 self
10731 }
10732
10733 /// Sets the value of [next_page_token][crate::model::ListHubSpokesResponse::next_page_token].
10734 ///
10735 /// # Example
10736 /// ```ignore,no_run
10737 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10738 /// let x = ListHubSpokesResponse::new().set_next_page_token("example");
10739 /// ```
10740 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10741 self.next_page_token = v.into();
10742 self
10743 }
10744
10745 /// Sets the value of [unreachable][crate::model::ListHubSpokesResponse::unreachable].
10746 ///
10747 /// # Example
10748 /// ```ignore,no_run
10749 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10750 /// let x = ListHubSpokesResponse::new().set_unreachable(["a", "b", "c"]);
10751 /// ```
10752 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10753 where
10754 T: std::iter::IntoIterator<Item = V>,
10755 V: std::convert::Into<std::string::String>,
10756 {
10757 use std::iter::Iterator;
10758 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10759 self
10760 }
10761}
10762
10763impl wkt::message::Message for ListHubSpokesResponse {
10764 fn typename() -> &'static str {
10765 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"
10766 }
10767}
10768
10769#[doc(hidden)]
10770impl gax::paginator::internal::PageableResponse for ListHubSpokesResponse {
10771 type PageItem = crate::model::Spoke;
10772
10773 fn items(self) -> std::vec::Vec<Self::PageItem> {
10774 self.spokes
10775 }
10776
10777 fn next_page_token(&self) -> std::string::String {
10778 use std::clone::Clone;
10779 self.next_page_token.clone()
10780 }
10781}
10782
10783/// The request for
10784/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
10785///
10786/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
10787#[derive(Clone, Default, PartialEq)]
10788#[non_exhaustive]
10789pub struct QueryHubStatusRequest {
10790 /// Required. The name of the hub.
10791 pub name: std::string::String,
10792
10793 /// Optional. The maximum number of results to return per page.
10794 pub page_size: i32,
10795
10796 /// Optional. The page token.
10797 pub page_token: std::string::String,
10798
10799 /// Optional. An expression that filters the list of results.
10800 /// The filter can be used to filter the results by the following fields:
10801 ///
10802 /// * `psc_propagation_status.source_spoke`
10803 /// * `psc_propagation_status.source_group`
10804 /// * `psc_propagation_status.source_forwarding_rule`
10805 /// * `psc_propagation_status.target_spoke`
10806 /// * `psc_propagation_status.target_group`
10807 /// * `psc_propagation_status.code`
10808 /// * `psc_propagation_status.message`
10809 pub filter: std::string::String,
10810
10811 /// Optional. Sort the results in ascending order by the specified fields.
10812 /// A comma-separated list of any of these fields:
10813 ///
10814 /// * `psc_propagation_status.source_spoke`
10815 /// * `psc_propagation_status.source_group`
10816 /// * `psc_propagation_status.source_forwarding_rule`
10817 /// * `psc_propagation_status.target_spoke`
10818 /// * `psc_propagation_status.target_group`
10819 /// * `psc_propagation_status.code`
10820 /// If `group_by` is set, the value of the `order_by` field must be the
10821 /// same as or a subset of the `group_by` field.
10822 pub order_by: std::string::String,
10823
10824 /// Optional. Aggregate the results by the specified fields.
10825 /// A comma-separated list of any of these fields:
10826 ///
10827 /// * `psc_propagation_status.source_spoke`
10828 /// * `psc_propagation_status.source_group`
10829 /// * `psc_propagation_status.source_forwarding_rule`
10830 /// * `psc_propagation_status.target_spoke`
10831 /// * `psc_propagation_status.target_group`
10832 /// * `psc_propagation_status.code`
10833 pub group_by: std::string::String,
10834
10835 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10836}
10837
10838impl QueryHubStatusRequest {
10839 pub fn new() -> Self {
10840 std::default::Default::default()
10841 }
10842
10843 /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
10844 ///
10845 /// # Example
10846 /// ```ignore,no_run
10847 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10848 /// let x = QueryHubStatusRequest::new().set_name("example");
10849 /// ```
10850 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10851 self.name = v.into();
10852 self
10853 }
10854
10855 /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
10856 ///
10857 /// # Example
10858 /// ```ignore,no_run
10859 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10860 /// let x = QueryHubStatusRequest::new().set_page_size(42);
10861 /// ```
10862 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10863 self.page_size = v.into();
10864 self
10865 }
10866
10867 /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
10868 ///
10869 /// # Example
10870 /// ```ignore,no_run
10871 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10872 /// let x = QueryHubStatusRequest::new().set_page_token("example");
10873 /// ```
10874 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10875 self.page_token = v.into();
10876 self
10877 }
10878
10879 /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
10880 ///
10881 /// # Example
10882 /// ```ignore,no_run
10883 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10884 /// let x = QueryHubStatusRequest::new().set_filter("example");
10885 /// ```
10886 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10887 self.filter = v.into();
10888 self
10889 }
10890
10891 /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
10892 ///
10893 /// # Example
10894 /// ```ignore,no_run
10895 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10896 /// let x = QueryHubStatusRequest::new().set_order_by("example");
10897 /// ```
10898 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10899 self.order_by = v.into();
10900 self
10901 }
10902
10903 /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
10904 ///
10905 /// # Example
10906 /// ```ignore,no_run
10907 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10908 /// let x = QueryHubStatusRequest::new().set_group_by("example");
10909 /// ```
10910 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10911 self.group_by = v.into();
10912 self
10913 }
10914}
10915
10916impl wkt::message::Message for QueryHubStatusRequest {
10917 fn typename() -> &'static str {
10918 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusRequest"
10919 }
10920}
10921
10922/// The response for
10923/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
10924///
10925/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
10926#[derive(Clone, Default, PartialEq)]
10927#[non_exhaustive]
10928pub struct QueryHubStatusResponse {
10929 /// The list of hub status.
10930 pub hub_status_entries: std::vec::Vec<crate::model::HubStatusEntry>,
10931
10932 /// The token for the next page of the response. To see more results,
10933 /// use this value as the page_token for your next request. If this value
10934 /// is empty, there are no more results.
10935 pub next_page_token: std::string::String,
10936
10937 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10938}
10939
10940impl QueryHubStatusResponse {
10941 pub fn new() -> Self {
10942 std::default::Default::default()
10943 }
10944
10945 /// Sets the value of [hub_status_entries][crate::model::QueryHubStatusResponse::hub_status_entries].
10946 ///
10947 /// # Example
10948 /// ```ignore,no_run
10949 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusResponse;
10950 /// use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
10951 /// let x = QueryHubStatusResponse::new()
10952 /// .set_hub_status_entries([
10953 /// HubStatusEntry::default()/* use setters */,
10954 /// HubStatusEntry::default()/* use (different) setters */,
10955 /// ]);
10956 /// ```
10957 pub fn set_hub_status_entries<T, V>(mut self, v: T) -> Self
10958 where
10959 T: std::iter::IntoIterator<Item = V>,
10960 V: std::convert::Into<crate::model::HubStatusEntry>,
10961 {
10962 use std::iter::Iterator;
10963 self.hub_status_entries = v.into_iter().map(|i| i.into()).collect();
10964 self
10965 }
10966
10967 /// Sets the value of [next_page_token][crate::model::QueryHubStatusResponse::next_page_token].
10968 ///
10969 /// # Example
10970 /// ```ignore,no_run
10971 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusResponse;
10972 /// let x = QueryHubStatusResponse::new().set_next_page_token("example");
10973 /// ```
10974 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10975 self.next_page_token = v.into();
10976 self
10977 }
10978}
10979
10980impl wkt::message::Message for QueryHubStatusResponse {
10981 fn typename() -> &'static str {
10982 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusResponse"
10983 }
10984}
10985
10986#[doc(hidden)]
10987impl gax::paginator::internal::PageableResponse for QueryHubStatusResponse {
10988 type PageItem = crate::model::HubStatusEntry;
10989
10990 fn items(self) -> std::vec::Vec<Self::PageItem> {
10991 self.hub_status_entries
10992 }
10993
10994 fn next_page_token(&self) -> std::string::String {
10995 use std::clone::Clone;
10996 self.next_page_token.clone()
10997 }
10998}
10999
11000/// A hub status entry represents the status of a set of propagated Private
11001/// Service Connect connections grouped by certain fields.
11002#[derive(Clone, Default, PartialEq)]
11003#[non_exhaustive]
11004pub struct HubStatusEntry {
11005 /// The number of propagated Private Service Connect connections with this
11006 /// status. If the `group_by` field was not set in the request message, the
11007 /// value of this field is 1.
11008 pub count: i32,
11009
11010 /// The fields that this entry is grouped by. This has the same value as the
11011 /// `group_by` field in the request message.
11012 pub group_by: std::string::String,
11013
11014 /// The Private Service Connect propagation status.
11015 pub psc_propagation_status: std::option::Option<crate::model::PscPropagationStatus>,
11016
11017 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11018}
11019
11020impl HubStatusEntry {
11021 pub fn new() -> Self {
11022 std::default::Default::default()
11023 }
11024
11025 /// Sets the value of [count][crate::model::HubStatusEntry::count].
11026 ///
11027 /// # Example
11028 /// ```ignore,no_run
11029 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11030 /// let x = HubStatusEntry::new().set_count(42);
11031 /// ```
11032 pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11033 self.count = v.into();
11034 self
11035 }
11036
11037 /// Sets the value of [group_by][crate::model::HubStatusEntry::group_by].
11038 ///
11039 /// # Example
11040 /// ```ignore,no_run
11041 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11042 /// let x = HubStatusEntry::new().set_group_by("example");
11043 /// ```
11044 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11045 self.group_by = v.into();
11046 self
11047 }
11048
11049 /// Sets the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
11050 ///
11051 /// # Example
11052 /// ```ignore,no_run
11053 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11054 /// use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11055 /// let x = HubStatusEntry::new().set_psc_propagation_status(PscPropagationStatus::default()/* use setters */);
11056 /// ```
11057 pub fn set_psc_propagation_status<T>(mut self, v: T) -> Self
11058 where
11059 T: std::convert::Into<crate::model::PscPropagationStatus>,
11060 {
11061 self.psc_propagation_status = std::option::Option::Some(v.into());
11062 self
11063 }
11064
11065 /// Sets or clears the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
11066 ///
11067 /// # Example
11068 /// ```ignore,no_run
11069 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11070 /// use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11071 /// let x = HubStatusEntry::new().set_or_clear_psc_propagation_status(Some(PscPropagationStatus::default()/* use setters */));
11072 /// let x = HubStatusEntry::new().set_or_clear_psc_propagation_status(None::<PscPropagationStatus>);
11073 /// ```
11074 pub fn set_or_clear_psc_propagation_status<T>(mut self, v: std::option::Option<T>) -> Self
11075 where
11076 T: std::convert::Into<crate::model::PscPropagationStatus>,
11077 {
11078 self.psc_propagation_status = v.map(|x| x.into());
11079 self
11080 }
11081}
11082
11083impl wkt::message::Message for HubStatusEntry {
11084 fn typename() -> &'static str {
11085 "type.googleapis.com/google.cloud.networkconnectivity.v1.HubStatusEntry"
11086 }
11087}
11088
11089/// The status of one or more propagated Private Service Connect connections in a
11090/// hub.
11091#[derive(Clone, Default, PartialEq)]
11092#[non_exhaustive]
11093pub struct PscPropagationStatus {
11094 /// The name of the spoke that the source forwarding rule belongs to.
11095 pub source_spoke: std::string::String,
11096
11097 /// The name of the group that the source spoke belongs to.
11098 pub source_group: std::string::String,
11099
11100 /// The name of the forwarding rule exported to the hub.
11101 pub source_forwarding_rule: std::string::String,
11102
11103 /// The name of the spoke that the source forwarding rule propagates to.
11104 pub target_spoke: std::string::String,
11105
11106 /// The name of the group that the target spoke belongs to.
11107 pub target_group: std::string::String,
11108
11109 /// The propagation status.
11110 pub code: crate::model::psc_propagation_status::Code,
11111
11112 /// The human-readable summary of the Private Service Connect connection
11113 /// propagation status.
11114 pub message: std::string::String,
11115
11116 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11117}
11118
11119impl PscPropagationStatus {
11120 pub fn new() -> Self {
11121 std::default::Default::default()
11122 }
11123
11124 /// Sets the value of [source_spoke][crate::model::PscPropagationStatus::source_spoke].
11125 ///
11126 /// # Example
11127 /// ```ignore,no_run
11128 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11129 /// let x = PscPropagationStatus::new().set_source_spoke("example");
11130 /// ```
11131 pub fn set_source_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11132 self.source_spoke = v.into();
11133 self
11134 }
11135
11136 /// Sets the value of [source_group][crate::model::PscPropagationStatus::source_group].
11137 ///
11138 /// # Example
11139 /// ```ignore,no_run
11140 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11141 /// let x = PscPropagationStatus::new().set_source_group("example");
11142 /// ```
11143 pub fn set_source_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11144 self.source_group = v.into();
11145 self
11146 }
11147
11148 /// Sets the value of [source_forwarding_rule][crate::model::PscPropagationStatus::source_forwarding_rule].
11149 ///
11150 /// # Example
11151 /// ```ignore,no_run
11152 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11153 /// let x = PscPropagationStatus::new().set_source_forwarding_rule("example");
11154 /// ```
11155 pub fn set_source_forwarding_rule<T: std::convert::Into<std::string::String>>(
11156 mut self,
11157 v: T,
11158 ) -> Self {
11159 self.source_forwarding_rule = v.into();
11160 self
11161 }
11162
11163 /// Sets the value of [target_spoke][crate::model::PscPropagationStatus::target_spoke].
11164 ///
11165 /// # Example
11166 /// ```ignore,no_run
11167 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11168 /// let x = PscPropagationStatus::new().set_target_spoke("example");
11169 /// ```
11170 pub fn set_target_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11171 self.target_spoke = v.into();
11172 self
11173 }
11174
11175 /// Sets the value of [target_group][crate::model::PscPropagationStatus::target_group].
11176 ///
11177 /// # Example
11178 /// ```ignore,no_run
11179 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11180 /// let x = PscPropagationStatus::new().set_target_group("example");
11181 /// ```
11182 pub fn set_target_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11183 self.target_group = v.into();
11184 self
11185 }
11186
11187 /// Sets the value of [code][crate::model::PscPropagationStatus::code].
11188 ///
11189 /// # Example
11190 /// ```ignore,no_run
11191 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11192 /// use google_cloud_networkconnectivity_v1::model::psc_propagation_status::Code;
11193 /// let x0 = PscPropagationStatus::new().set_code(Code::Ready);
11194 /// let x1 = PscPropagationStatus::new().set_code(Code::Propagating);
11195 /// let x2 = PscPropagationStatus::new().set_code(Code::ErrorProducerPropagatedConnectionLimitExceeded);
11196 /// ```
11197 pub fn set_code<T: std::convert::Into<crate::model::psc_propagation_status::Code>>(
11198 mut self,
11199 v: T,
11200 ) -> Self {
11201 self.code = v.into();
11202 self
11203 }
11204
11205 /// Sets the value of [message][crate::model::PscPropagationStatus::message].
11206 ///
11207 /// # Example
11208 /// ```ignore,no_run
11209 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11210 /// let x = PscPropagationStatus::new().set_message("example");
11211 /// ```
11212 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11213 self.message = v.into();
11214 self
11215 }
11216}
11217
11218impl wkt::message::Message for PscPropagationStatus {
11219 fn typename() -> &'static str {
11220 "type.googleapis.com/google.cloud.networkconnectivity.v1.PscPropagationStatus"
11221 }
11222}
11223
11224/// Defines additional types related to [PscPropagationStatus].
11225pub mod psc_propagation_status {
11226 #[allow(unused_imports)]
11227 use super::*;
11228
11229 /// The Code enum represents the state of the Private Service Connect
11230 /// propagation.
11231 ///
11232 /// # Working with unknown values
11233 ///
11234 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11235 /// additional enum variants at any time. Adding new variants is not considered
11236 /// a breaking change. Applications should write their code in anticipation of:
11237 ///
11238 /// - New values appearing in future releases of the client library, **and**
11239 /// - New values received dynamically, without application changes.
11240 ///
11241 /// Please consult the [Working with enums] section in the user guide for some
11242 /// guidelines.
11243 ///
11244 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11245 #[derive(Clone, Debug, PartialEq)]
11246 #[non_exhaustive]
11247 pub enum Code {
11248 /// The code is unspecified.
11249 Unspecified,
11250 /// The propagated Private Service Connect connection is ready.
11251 Ready,
11252 /// The Private Service Connect connection is propagating. This is a
11253 /// transient state.
11254 Propagating,
11255 /// The Private Service Connect connection propagation failed because the VPC
11256 /// network or the project of the target spoke has exceeded the connection
11257 /// limit set by the producer.
11258 ErrorProducerPropagatedConnectionLimitExceeded,
11259 /// The Private Service Connect connection propagation failed because the NAT
11260 /// IP subnet space has been exhausted. It is equivalent to the `Needs
11261 /// attention` status of the Private Service Connect connection. See
11262 /// <https://cloud.google.com/vpc/docs/about-accessing-vpc-hosted-services-endpoints#connection-statuses>.
11263 ErrorProducerNatIpSpaceExhausted,
11264 /// The Private Service Connect connection propagation failed because the
11265 /// `PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK` quota in the
11266 /// producer VPC network has been exceeded.
11267 ErrorProducerQuotaExceeded,
11268 /// The Private Service Connect connection propagation failed because the
11269 /// `PSC_PROPAGATED_CONNECTIONS_PER_VPC_NETWORK` quota in the consumer
11270 /// VPC network has been exceeded.
11271 ErrorConsumerQuotaExceeded,
11272 /// If set, the enum was initialized with an unknown value.
11273 ///
11274 /// Applications can examine the value using [Code::value] or
11275 /// [Code::name].
11276 UnknownValue(code::UnknownValue),
11277 }
11278
11279 #[doc(hidden)]
11280 pub mod code {
11281 #[allow(unused_imports)]
11282 use super::*;
11283 #[derive(Clone, Debug, PartialEq)]
11284 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11285 }
11286
11287 impl Code {
11288 /// Gets the enum value.
11289 ///
11290 /// Returns `None` if the enum contains an unknown value deserialized from
11291 /// the string representation of enums.
11292 pub fn value(&self) -> std::option::Option<i32> {
11293 match self {
11294 Self::Unspecified => std::option::Option::Some(0),
11295 Self::Ready => std::option::Option::Some(1),
11296 Self::Propagating => std::option::Option::Some(2),
11297 Self::ErrorProducerPropagatedConnectionLimitExceeded => {
11298 std::option::Option::Some(3)
11299 }
11300 Self::ErrorProducerNatIpSpaceExhausted => std::option::Option::Some(4),
11301 Self::ErrorProducerQuotaExceeded => std::option::Option::Some(5),
11302 Self::ErrorConsumerQuotaExceeded => std::option::Option::Some(6),
11303 Self::UnknownValue(u) => u.0.value(),
11304 }
11305 }
11306
11307 /// Gets the enum value as a string.
11308 ///
11309 /// Returns `None` if the enum contains an unknown value deserialized from
11310 /// the integer representation of enums.
11311 pub fn name(&self) -> std::option::Option<&str> {
11312 match self {
11313 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
11314 Self::Ready => std::option::Option::Some("READY"),
11315 Self::Propagating => std::option::Option::Some("PROPAGATING"),
11316 Self::ErrorProducerPropagatedConnectionLimitExceeded => {
11317 std::option::Option::Some("ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED")
11318 }
11319 Self::ErrorProducerNatIpSpaceExhausted => {
11320 std::option::Option::Some("ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED")
11321 }
11322 Self::ErrorProducerQuotaExceeded => {
11323 std::option::Option::Some("ERROR_PRODUCER_QUOTA_EXCEEDED")
11324 }
11325 Self::ErrorConsumerQuotaExceeded => {
11326 std::option::Option::Some("ERROR_CONSUMER_QUOTA_EXCEEDED")
11327 }
11328 Self::UnknownValue(u) => u.0.name(),
11329 }
11330 }
11331 }
11332
11333 impl std::default::Default for Code {
11334 fn default() -> Self {
11335 use std::convert::From;
11336 Self::from(0)
11337 }
11338 }
11339
11340 impl std::fmt::Display for Code {
11341 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11342 wkt::internal::display_enum(f, self.name(), self.value())
11343 }
11344 }
11345
11346 impl std::convert::From<i32> for Code {
11347 fn from(value: i32) -> Self {
11348 match value {
11349 0 => Self::Unspecified,
11350 1 => Self::Ready,
11351 2 => Self::Propagating,
11352 3 => Self::ErrorProducerPropagatedConnectionLimitExceeded,
11353 4 => Self::ErrorProducerNatIpSpaceExhausted,
11354 5 => Self::ErrorProducerQuotaExceeded,
11355 6 => Self::ErrorConsumerQuotaExceeded,
11356 _ => Self::UnknownValue(code::UnknownValue(
11357 wkt::internal::UnknownEnumValue::Integer(value),
11358 )),
11359 }
11360 }
11361 }
11362
11363 impl std::convert::From<&str> for Code {
11364 fn from(value: &str) -> Self {
11365 use std::string::ToString;
11366 match value {
11367 "CODE_UNSPECIFIED" => Self::Unspecified,
11368 "READY" => Self::Ready,
11369 "PROPAGATING" => Self::Propagating,
11370 "ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED" => {
11371 Self::ErrorProducerPropagatedConnectionLimitExceeded
11372 }
11373 "ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED" => Self::ErrorProducerNatIpSpaceExhausted,
11374 "ERROR_PRODUCER_QUOTA_EXCEEDED" => Self::ErrorProducerQuotaExceeded,
11375 "ERROR_CONSUMER_QUOTA_EXCEEDED" => Self::ErrorConsumerQuotaExceeded,
11376 _ => Self::UnknownValue(code::UnknownValue(
11377 wkt::internal::UnknownEnumValue::String(value.to_string()),
11378 )),
11379 }
11380 }
11381 }
11382
11383 impl serde::ser::Serialize for Code {
11384 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11385 where
11386 S: serde::Serializer,
11387 {
11388 match self {
11389 Self::Unspecified => serializer.serialize_i32(0),
11390 Self::Ready => serializer.serialize_i32(1),
11391 Self::Propagating => serializer.serialize_i32(2),
11392 Self::ErrorProducerPropagatedConnectionLimitExceeded => serializer.serialize_i32(3),
11393 Self::ErrorProducerNatIpSpaceExhausted => serializer.serialize_i32(4),
11394 Self::ErrorProducerQuotaExceeded => serializer.serialize_i32(5),
11395 Self::ErrorConsumerQuotaExceeded => serializer.serialize_i32(6),
11396 Self::UnknownValue(u) => u.0.serialize(serializer),
11397 }
11398 }
11399 }
11400
11401 impl<'de> serde::de::Deserialize<'de> for Code {
11402 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11403 where
11404 D: serde::Deserializer<'de>,
11405 {
11406 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
11407 ".google.cloud.networkconnectivity.v1.PscPropagationStatus.Code",
11408 ))
11409 }
11410 }
11411}
11412
11413/// The request for
11414/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
11415///
11416/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
11417#[derive(Clone, Default, PartialEq)]
11418#[non_exhaustive]
11419pub struct ListSpokesRequest {
11420 /// Required. The parent resource.
11421 pub parent: std::string::String,
11422
11423 /// The maximum number of results to return per page.
11424 pub page_size: i32,
11425
11426 /// The page token.
11427 pub page_token: std::string::String,
11428
11429 /// An expression that filters the list of results.
11430 pub filter: std::string::String,
11431
11432 /// Sort the results by a certain order.
11433 pub order_by: std::string::String,
11434
11435 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11436}
11437
11438impl ListSpokesRequest {
11439 pub fn new() -> Self {
11440 std::default::Default::default()
11441 }
11442
11443 /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
11444 ///
11445 /// # Example
11446 /// ```ignore,no_run
11447 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11448 /// let x = ListSpokesRequest::new().set_parent("example");
11449 /// ```
11450 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11451 self.parent = v.into();
11452 self
11453 }
11454
11455 /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
11456 ///
11457 /// # Example
11458 /// ```ignore,no_run
11459 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11460 /// let x = ListSpokesRequest::new().set_page_size(42);
11461 /// ```
11462 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11463 self.page_size = v.into();
11464 self
11465 }
11466
11467 /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
11468 ///
11469 /// # Example
11470 /// ```ignore,no_run
11471 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11472 /// let x = ListSpokesRequest::new().set_page_token("example");
11473 /// ```
11474 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11475 self.page_token = v.into();
11476 self
11477 }
11478
11479 /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
11480 ///
11481 /// # Example
11482 /// ```ignore,no_run
11483 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11484 /// let x = ListSpokesRequest::new().set_filter("example");
11485 /// ```
11486 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11487 self.filter = v.into();
11488 self
11489 }
11490
11491 /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
11492 ///
11493 /// # Example
11494 /// ```ignore,no_run
11495 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11496 /// let x = ListSpokesRequest::new().set_order_by("example");
11497 /// ```
11498 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11499 self.order_by = v.into();
11500 self
11501 }
11502}
11503
11504impl wkt::message::Message for ListSpokesRequest {
11505 fn typename() -> &'static str {
11506 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesRequest"
11507 }
11508}
11509
11510/// The response for
11511/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
11512///
11513/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
11514#[derive(Clone, Default, PartialEq)]
11515#[non_exhaustive]
11516pub struct ListSpokesResponse {
11517 /// The requested spokes.
11518 pub spokes: std::vec::Vec<crate::model::Spoke>,
11519
11520 /// The token for the next page of the response. To see more results,
11521 /// use this value as the page_token for your next request. If this value
11522 /// is empty, there are no more results.
11523 pub next_page_token: std::string::String,
11524
11525 /// Locations that could not be reached.
11526 pub unreachable: std::vec::Vec<std::string::String>,
11527
11528 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11529}
11530
11531impl ListSpokesResponse {
11532 pub fn new() -> Self {
11533 std::default::Default::default()
11534 }
11535
11536 /// Sets the value of [spokes][crate::model::ListSpokesResponse::spokes].
11537 ///
11538 /// # Example
11539 /// ```ignore,no_run
11540 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11541 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11542 /// let x = ListSpokesResponse::new()
11543 /// .set_spokes([
11544 /// Spoke::default()/* use setters */,
11545 /// Spoke::default()/* use (different) setters */,
11546 /// ]);
11547 /// ```
11548 pub fn set_spokes<T, V>(mut self, v: T) -> Self
11549 where
11550 T: std::iter::IntoIterator<Item = V>,
11551 V: std::convert::Into<crate::model::Spoke>,
11552 {
11553 use std::iter::Iterator;
11554 self.spokes = v.into_iter().map(|i| i.into()).collect();
11555 self
11556 }
11557
11558 /// Sets the value of [next_page_token][crate::model::ListSpokesResponse::next_page_token].
11559 ///
11560 /// # Example
11561 /// ```ignore,no_run
11562 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11563 /// let x = ListSpokesResponse::new().set_next_page_token("example");
11564 /// ```
11565 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11566 self.next_page_token = v.into();
11567 self
11568 }
11569
11570 /// Sets the value of [unreachable][crate::model::ListSpokesResponse::unreachable].
11571 ///
11572 /// # Example
11573 /// ```ignore,no_run
11574 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11575 /// let x = ListSpokesResponse::new().set_unreachable(["a", "b", "c"]);
11576 /// ```
11577 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11578 where
11579 T: std::iter::IntoIterator<Item = V>,
11580 V: std::convert::Into<std::string::String>,
11581 {
11582 use std::iter::Iterator;
11583 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11584 self
11585 }
11586}
11587
11588impl wkt::message::Message for ListSpokesResponse {
11589 fn typename() -> &'static str {
11590 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesResponse"
11591 }
11592}
11593
11594#[doc(hidden)]
11595impl gax::paginator::internal::PageableResponse for ListSpokesResponse {
11596 type PageItem = crate::model::Spoke;
11597
11598 fn items(self) -> std::vec::Vec<Self::PageItem> {
11599 self.spokes
11600 }
11601
11602 fn next_page_token(&self) -> std::string::String {
11603 use std::clone::Clone;
11604 self.next_page_token.clone()
11605 }
11606}
11607
11608/// The request for
11609/// [HubService.GetSpoke][google.cloud.networkconnectivity.v1.HubService.GetSpoke].
11610///
11611/// [google.cloud.networkconnectivity.v1.HubService.GetSpoke]: crate::client::HubService::get_spoke
11612#[derive(Clone, Default, PartialEq)]
11613#[non_exhaustive]
11614pub struct GetSpokeRequest {
11615 /// Required. The name of the spoke resource.
11616 pub name: std::string::String,
11617
11618 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11619}
11620
11621impl GetSpokeRequest {
11622 pub fn new() -> Self {
11623 std::default::Default::default()
11624 }
11625
11626 /// Sets the value of [name][crate::model::GetSpokeRequest::name].
11627 ///
11628 /// # Example
11629 /// ```ignore,no_run
11630 /// # use google_cloud_networkconnectivity_v1::model::GetSpokeRequest;
11631 /// let x = GetSpokeRequest::new().set_name("example");
11632 /// ```
11633 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11634 self.name = v.into();
11635 self
11636 }
11637}
11638
11639impl wkt::message::Message for GetSpokeRequest {
11640 fn typename() -> &'static str {
11641 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetSpokeRequest"
11642 }
11643}
11644
11645/// The request for
11646/// [HubService.CreateSpoke][google.cloud.networkconnectivity.v1.HubService.CreateSpoke].
11647///
11648/// [google.cloud.networkconnectivity.v1.HubService.CreateSpoke]: crate::client::HubService::create_spoke
11649#[derive(Clone, Default, PartialEq)]
11650#[non_exhaustive]
11651pub struct CreateSpokeRequest {
11652 /// Required. The parent resource.
11653 pub parent: std::string::String,
11654
11655 /// Required. Unique id for the spoke to create.
11656 pub spoke_id: std::string::String,
11657
11658 /// Required. The initial values for a new spoke.
11659 pub spoke: std::option::Option<crate::model::Spoke>,
11660
11661 /// Optional. A request ID to identify requests. Specify a unique request ID so
11662 /// that if you must retry your request, the server knows to ignore the request
11663 /// if it has already been completed. The server guarantees that a request
11664 /// doesn't result in creation of duplicate commitments for at least 60
11665 /// minutes.
11666 ///
11667 /// For example, consider a situation where you make an initial request and
11668 /// the request times out. If you make the request again with the same request
11669 /// ID, the server can check to see whether the original operation
11670 /// was received. If it was, the server ignores the second request. This
11671 /// behavior prevents clients from mistakenly creating duplicate commitments.
11672 ///
11673 /// The request ID must be a valid UUID, with the exception that zero UUID is
11674 /// not supported (00000000-0000-0000-0000-000000000000).
11675 pub request_id: std::string::String,
11676
11677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11678}
11679
11680impl CreateSpokeRequest {
11681 pub fn new() -> Self {
11682 std::default::Default::default()
11683 }
11684
11685 /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
11686 ///
11687 /// # Example
11688 /// ```ignore,no_run
11689 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11690 /// let x = CreateSpokeRequest::new().set_parent("example");
11691 /// ```
11692 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11693 self.parent = v.into();
11694 self
11695 }
11696
11697 /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
11698 ///
11699 /// # Example
11700 /// ```ignore,no_run
11701 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11702 /// let x = CreateSpokeRequest::new().set_spoke_id("example");
11703 /// ```
11704 pub fn set_spoke_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11705 self.spoke_id = v.into();
11706 self
11707 }
11708
11709 /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
11710 ///
11711 /// # Example
11712 /// ```ignore,no_run
11713 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11714 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11715 /// let x = CreateSpokeRequest::new().set_spoke(Spoke::default()/* use setters */);
11716 /// ```
11717 pub fn set_spoke<T>(mut self, v: T) -> Self
11718 where
11719 T: std::convert::Into<crate::model::Spoke>,
11720 {
11721 self.spoke = std::option::Option::Some(v.into());
11722 self
11723 }
11724
11725 /// Sets or clears the value of [spoke][crate::model::CreateSpokeRequest::spoke].
11726 ///
11727 /// # Example
11728 /// ```ignore,no_run
11729 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11730 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11731 /// let x = CreateSpokeRequest::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
11732 /// let x = CreateSpokeRequest::new().set_or_clear_spoke(None::<Spoke>);
11733 /// ```
11734 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
11735 where
11736 T: std::convert::Into<crate::model::Spoke>,
11737 {
11738 self.spoke = v.map(|x| x.into());
11739 self
11740 }
11741
11742 /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
11743 ///
11744 /// # Example
11745 /// ```ignore,no_run
11746 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11747 /// let x = CreateSpokeRequest::new().set_request_id("example");
11748 /// ```
11749 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11750 self.request_id = v.into();
11751 self
11752 }
11753}
11754
11755impl wkt::message::Message for CreateSpokeRequest {
11756 fn typename() -> &'static str {
11757 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateSpokeRequest"
11758 }
11759}
11760
11761/// Request for
11762/// [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]
11763/// method.
11764///
11765/// [google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]: crate::client::HubService::update_spoke
11766#[derive(Clone, Default, PartialEq)]
11767#[non_exhaustive]
11768pub struct UpdateSpokeRequest {
11769 /// Optional. In the case of an update to an existing spoke, field mask is used
11770 /// to specify the fields to be overwritten. The fields specified in the
11771 /// update_mask are relative to the resource, not the full request. A field is
11772 /// overwritten if it is in the mask. If the user does not provide a mask, then
11773 /// all fields are overwritten.
11774 pub update_mask: std::option::Option<wkt::FieldMask>,
11775
11776 /// Required. The state that the spoke should be in after the update.
11777 pub spoke: std::option::Option<crate::model::Spoke>,
11778
11779 /// Optional. A request ID to identify requests. Specify a unique request ID so
11780 /// that if you must retry your request, the server knows to ignore the request
11781 /// if it has already been completed. The server guarantees that a request
11782 /// doesn't result in creation of duplicate commitments for at least 60
11783 /// minutes.
11784 ///
11785 /// For example, consider a situation where you make an initial request and
11786 /// the request times out. If you make the request again with the same request
11787 /// ID, the server can check to see whether the original operation
11788 /// was received. If it was, the server ignores the second request. This
11789 /// behavior prevents clients from mistakenly creating duplicate commitments.
11790 ///
11791 /// The request ID must be a valid UUID, with the exception that zero UUID is
11792 /// not supported (00000000-0000-0000-0000-000000000000).
11793 pub request_id: std::string::String,
11794
11795 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11796}
11797
11798impl UpdateSpokeRequest {
11799 pub fn new() -> Self {
11800 std::default::Default::default()
11801 }
11802
11803 /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
11804 ///
11805 /// # Example
11806 /// ```ignore,no_run
11807 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11808 /// use wkt::FieldMask;
11809 /// let x = UpdateSpokeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11810 /// ```
11811 pub fn set_update_mask<T>(mut self, v: T) -> Self
11812 where
11813 T: std::convert::Into<wkt::FieldMask>,
11814 {
11815 self.update_mask = std::option::Option::Some(v.into());
11816 self
11817 }
11818
11819 /// Sets or clears the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
11820 ///
11821 /// # Example
11822 /// ```ignore,no_run
11823 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11824 /// use wkt::FieldMask;
11825 /// let x = UpdateSpokeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11826 /// let x = UpdateSpokeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11827 /// ```
11828 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11829 where
11830 T: std::convert::Into<wkt::FieldMask>,
11831 {
11832 self.update_mask = v.map(|x| x.into());
11833 self
11834 }
11835
11836 /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
11837 ///
11838 /// # Example
11839 /// ```ignore,no_run
11840 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11841 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11842 /// let x = UpdateSpokeRequest::new().set_spoke(Spoke::default()/* use setters */);
11843 /// ```
11844 pub fn set_spoke<T>(mut self, v: T) -> Self
11845 where
11846 T: std::convert::Into<crate::model::Spoke>,
11847 {
11848 self.spoke = std::option::Option::Some(v.into());
11849 self
11850 }
11851
11852 /// Sets or clears the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
11853 ///
11854 /// # Example
11855 /// ```ignore,no_run
11856 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11857 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11858 /// let x = UpdateSpokeRequest::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
11859 /// let x = UpdateSpokeRequest::new().set_or_clear_spoke(None::<Spoke>);
11860 /// ```
11861 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
11862 where
11863 T: std::convert::Into<crate::model::Spoke>,
11864 {
11865 self.spoke = v.map(|x| x.into());
11866 self
11867 }
11868
11869 /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
11870 ///
11871 /// # Example
11872 /// ```ignore,no_run
11873 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11874 /// let x = UpdateSpokeRequest::new().set_request_id("example");
11875 /// ```
11876 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11877 self.request_id = v.into();
11878 self
11879 }
11880}
11881
11882impl wkt::message::Message for UpdateSpokeRequest {
11883 fn typename() -> &'static str {
11884 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"
11885 }
11886}
11887
11888/// The request for
11889/// [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1.HubService.DeleteSpoke].
11890///
11891/// [google.cloud.networkconnectivity.v1.HubService.DeleteSpoke]: crate::client::HubService::delete_spoke
11892#[derive(Clone, Default, PartialEq)]
11893#[non_exhaustive]
11894pub struct DeleteSpokeRequest {
11895 /// Required. The name of the spoke to delete.
11896 pub name: std::string::String,
11897
11898 /// Optional. A request ID to identify requests. Specify a unique request ID so
11899 /// that if you must retry your request, the server knows to ignore the request
11900 /// if it has already been completed. The server guarantees that a request
11901 /// doesn't result in creation of duplicate commitments for at least 60
11902 /// minutes.
11903 ///
11904 /// For example, consider a situation where you make an initial request and
11905 /// the request times out. If you make the request again with the same request
11906 /// ID, the server can check to see whether the original operation
11907 /// was received. If it was, the server ignores the second request. This
11908 /// behavior prevents clients from mistakenly creating duplicate commitments.
11909 ///
11910 /// The request ID must be a valid UUID, with the exception that zero UUID is
11911 /// not supported (00000000-0000-0000-0000-000000000000).
11912 pub request_id: std::string::String,
11913
11914 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11915}
11916
11917impl DeleteSpokeRequest {
11918 pub fn new() -> Self {
11919 std::default::Default::default()
11920 }
11921
11922 /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
11923 ///
11924 /// # Example
11925 /// ```ignore,no_run
11926 /// # use google_cloud_networkconnectivity_v1::model::DeleteSpokeRequest;
11927 /// let x = DeleteSpokeRequest::new().set_name("example");
11928 /// ```
11929 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11930 self.name = v.into();
11931 self
11932 }
11933
11934 /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
11935 ///
11936 /// # Example
11937 /// ```ignore,no_run
11938 /// # use google_cloud_networkconnectivity_v1::model::DeleteSpokeRequest;
11939 /// let x = DeleteSpokeRequest::new().set_request_id("example");
11940 /// ```
11941 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11942 self.request_id = v.into();
11943 self
11944 }
11945}
11946
11947impl wkt::message::Message for DeleteSpokeRequest {
11948 fn typename() -> &'static str {
11949 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"
11950 }
11951}
11952
11953/// The request for
11954/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
11955///
11956/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
11957#[derive(Clone, Default, PartialEq)]
11958#[non_exhaustive]
11959pub struct AcceptHubSpokeRequest {
11960 /// Required. The name of the hub into which to accept the spoke.
11961 pub name: std::string::String,
11962
11963 /// Required. The URI of the spoke to accept into the hub.
11964 pub spoke_uri: std::string::String,
11965
11966 /// Optional. A request ID to identify requests. Specify a unique request ID so
11967 /// that if you must retry your request, the server knows to ignore the request
11968 /// if it has already been completed. The server guarantees that a request
11969 /// doesn't result in creation of duplicate commitments for at least 60
11970 /// minutes.
11971 ///
11972 /// For example, consider a situation where you make an initial request and
11973 /// the request times out. If you make the request again with the same request
11974 /// ID, the server can check to see whether the original operation
11975 /// was received. If it was, the server ignores the second request. This
11976 /// behavior prevents clients from mistakenly creating duplicate commitments.
11977 ///
11978 /// The request ID must be a valid UUID, with the exception that zero UUID is
11979 /// not supported (00000000-0000-0000-0000-000000000000).
11980 pub request_id: std::string::String,
11981
11982 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11983}
11984
11985impl AcceptHubSpokeRequest {
11986 pub fn new() -> Self {
11987 std::default::Default::default()
11988 }
11989
11990 /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
11991 ///
11992 /// # Example
11993 /// ```ignore,no_run
11994 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
11995 /// let x = AcceptHubSpokeRequest::new().set_name("example");
11996 /// ```
11997 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11998 self.name = v.into();
11999 self
12000 }
12001
12002 /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
12003 ///
12004 /// # Example
12005 /// ```ignore,no_run
12006 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12007 /// let x = AcceptHubSpokeRequest::new().set_spoke_uri("example");
12008 /// ```
12009 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12010 self.spoke_uri = v.into();
12011 self
12012 }
12013
12014 /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
12015 ///
12016 /// # Example
12017 /// ```ignore,no_run
12018 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12019 /// let x = AcceptHubSpokeRequest::new().set_request_id("example");
12020 /// ```
12021 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12022 self.request_id = v.into();
12023 self
12024 }
12025}
12026
12027impl wkt::message::Message for AcceptHubSpokeRequest {
12028 fn typename() -> &'static str {
12029 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"
12030 }
12031}
12032
12033/// The response for
12034/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
12035///
12036/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
12037#[derive(Clone, Default, PartialEq)]
12038#[non_exhaustive]
12039pub struct AcceptHubSpokeResponse {
12040 /// The spoke that was operated on.
12041 pub spoke: std::option::Option<crate::model::Spoke>,
12042
12043 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12044}
12045
12046impl AcceptHubSpokeResponse {
12047 pub fn new() -> Self {
12048 std::default::Default::default()
12049 }
12050
12051 /// Sets the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
12052 ///
12053 /// # Example
12054 /// ```ignore,no_run
12055 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeResponse;
12056 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12057 /// let x = AcceptHubSpokeResponse::new().set_spoke(Spoke::default()/* use setters */);
12058 /// ```
12059 pub fn set_spoke<T>(mut self, v: T) -> Self
12060 where
12061 T: std::convert::Into<crate::model::Spoke>,
12062 {
12063 self.spoke = std::option::Option::Some(v.into());
12064 self
12065 }
12066
12067 /// Sets or clears the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
12068 ///
12069 /// # Example
12070 /// ```ignore,no_run
12071 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeResponse;
12072 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12073 /// let x = AcceptHubSpokeResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12074 /// let x = AcceptHubSpokeResponse::new().set_or_clear_spoke(None::<Spoke>);
12075 /// ```
12076 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12077 where
12078 T: std::convert::Into<crate::model::Spoke>,
12079 {
12080 self.spoke = v.map(|x| x.into());
12081 self
12082 }
12083}
12084
12085impl wkt::message::Message for AcceptHubSpokeResponse {
12086 fn typename() -> &'static str {
12087 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"
12088 }
12089}
12090
12091/// The request for
12092/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
12093///
12094/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
12095#[derive(Clone, Default, PartialEq)]
12096#[non_exhaustive]
12097pub struct RejectHubSpokeRequest {
12098 /// Required. The name of the hub from which to reject the spoke.
12099 pub name: std::string::String,
12100
12101 /// Required. The URI of the spoke to reject from the hub.
12102 pub spoke_uri: std::string::String,
12103
12104 /// Optional. A request ID to identify requests. Specify a unique request ID so
12105 /// that if you must retry your request, the server knows to ignore the request
12106 /// if it has already been completed. The server guarantees that a request
12107 /// doesn't result in creation of duplicate commitments for at least 60
12108 /// minutes.
12109 ///
12110 /// For example, consider a situation where you make an initial request and
12111 /// the request times out. If you make the request again with the same request
12112 /// ID, the server can check to see whether the original operation
12113 /// was received. If it was, the server ignores the second request. This
12114 /// behavior prevents clients from mistakenly creating duplicate commitments.
12115 ///
12116 /// The request ID must be a valid UUID, with the exception that zero UUID is
12117 /// not supported (00000000-0000-0000-0000-000000000000).
12118 pub request_id: std::string::String,
12119
12120 /// Optional. Additional information provided by the hub administrator.
12121 pub details: std::string::String,
12122
12123 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12124}
12125
12126impl RejectHubSpokeRequest {
12127 pub fn new() -> Self {
12128 std::default::Default::default()
12129 }
12130
12131 /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
12132 ///
12133 /// # Example
12134 /// ```ignore,no_run
12135 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12136 /// let x = RejectHubSpokeRequest::new().set_name("example");
12137 /// ```
12138 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12139 self.name = v.into();
12140 self
12141 }
12142
12143 /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
12144 ///
12145 /// # Example
12146 /// ```ignore,no_run
12147 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12148 /// let x = RejectHubSpokeRequest::new().set_spoke_uri("example");
12149 /// ```
12150 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12151 self.spoke_uri = v.into();
12152 self
12153 }
12154
12155 /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
12156 ///
12157 /// # Example
12158 /// ```ignore,no_run
12159 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12160 /// let x = RejectHubSpokeRequest::new().set_request_id("example");
12161 /// ```
12162 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12163 self.request_id = v.into();
12164 self
12165 }
12166
12167 /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
12168 ///
12169 /// # Example
12170 /// ```ignore,no_run
12171 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12172 /// let x = RejectHubSpokeRequest::new().set_details("example");
12173 /// ```
12174 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12175 self.details = v.into();
12176 self
12177 }
12178}
12179
12180impl wkt::message::Message for RejectHubSpokeRequest {
12181 fn typename() -> &'static str {
12182 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"
12183 }
12184}
12185
12186/// The response for
12187/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
12188///
12189/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
12190#[derive(Clone, Default, PartialEq)]
12191#[non_exhaustive]
12192pub struct RejectHubSpokeResponse {
12193 /// The spoke that was operated on.
12194 pub spoke: std::option::Option<crate::model::Spoke>,
12195
12196 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12197}
12198
12199impl RejectHubSpokeResponse {
12200 pub fn new() -> Self {
12201 std::default::Default::default()
12202 }
12203
12204 /// Sets the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
12205 ///
12206 /// # Example
12207 /// ```ignore,no_run
12208 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeResponse;
12209 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12210 /// let x = RejectHubSpokeResponse::new().set_spoke(Spoke::default()/* use setters */);
12211 /// ```
12212 pub fn set_spoke<T>(mut self, v: T) -> Self
12213 where
12214 T: std::convert::Into<crate::model::Spoke>,
12215 {
12216 self.spoke = std::option::Option::Some(v.into());
12217 self
12218 }
12219
12220 /// Sets or clears the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
12221 ///
12222 /// # Example
12223 /// ```ignore,no_run
12224 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeResponse;
12225 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12226 /// let x = RejectHubSpokeResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12227 /// let x = RejectHubSpokeResponse::new().set_or_clear_spoke(None::<Spoke>);
12228 /// ```
12229 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12230 where
12231 T: std::convert::Into<crate::model::Spoke>,
12232 {
12233 self.spoke = v.map(|x| x.into());
12234 self
12235 }
12236}
12237
12238impl wkt::message::Message for RejectHubSpokeResponse {
12239 fn typename() -> &'static str {
12240 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"
12241 }
12242}
12243
12244/// The request for
12245/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
12246///
12247/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
12248#[derive(Clone, Default, PartialEq)]
12249#[non_exhaustive]
12250pub struct AcceptSpokeUpdateRequest {
12251 /// Required. The name of the hub to accept spoke update.
12252 pub name: std::string::String,
12253
12254 /// Required. The URI of the spoke to accept update.
12255 pub spoke_uri: std::string::String,
12256
12257 /// Required. The etag of the spoke to accept update.
12258 pub spoke_etag: std::string::String,
12259
12260 /// Optional. A request ID to identify requests. Specify a unique request ID so
12261 /// that if you must retry your request, the server knows to ignore the request
12262 /// if it has already been completed. The server guarantees that a request
12263 /// doesn't result in creation of duplicate commitments for at least 60
12264 /// minutes.
12265 ///
12266 /// For example, consider a situation where you make an initial request and
12267 /// the request times out. If you make the request again with the same request
12268 /// ID, the server can check to see whether the original operation
12269 /// was received. If it was, the server ignores the second request. This
12270 /// behavior prevents clients from mistakenly creating duplicate commitments.
12271 ///
12272 /// The request ID must be a valid UUID, with the exception that zero UUID is
12273 /// not supported (00000000-0000-0000-0000-000000000000).
12274 pub request_id: std::string::String,
12275
12276 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12277}
12278
12279impl AcceptSpokeUpdateRequest {
12280 pub fn new() -> Self {
12281 std::default::Default::default()
12282 }
12283
12284 /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
12285 ///
12286 /// # Example
12287 /// ```ignore,no_run
12288 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12289 /// let x = AcceptSpokeUpdateRequest::new().set_name("example");
12290 /// ```
12291 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12292 self.name = v.into();
12293 self
12294 }
12295
12296 /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
12297 ///
12298 /// # Example
12299 /// ```ignore,no_run
12300 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12301 /// let x = AcceptSpokeUpdateRequest::new().set_spoke_uri("example");
12302 /// ```
12303 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12304 self.spoke_uri = v.into();
12305 self
12306 }
12307
12308 /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
12309 ///
12310 /// # Example
12311 /// ```ignore,no_run
12312 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12313 /// let x = AcceptSpokeUpdateRequest::new().set_spoke_etag("example");
12314 /// ```
12315 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12316 self.spoke_etag = v.into();
12317 self
12318 }
12319
12320 /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
12321 ///
12322 /// # Example
12323 /// ```ignore,no_run
12324 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12325 /// let x = AcceptSpokeUpdateRequest::new().set_request_id("example");
12326 /// ```
12327 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12328 self.request_id = v.into();
12329 self
12330 }
12331}
12332
12333impl wkt::message::Message for AcceptSpokeUpdateRequest {
12334 fn typename() -> &'static str {
12335 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateRequest"
12336 }
12337}
12338
12339/// The response for
12340/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
12341///
12342/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
12343#[derive(Clone, Default, PartialEq)]
12344#[non_exhaustive]
12345pub struct AcceptSpokeUpdateResponse {
12346 /// The spoke that was operated on.
12347 pub spoke: std::option::Option<crate::model::Spoke>,
12348
12349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12350}
12351
12352impl AcceptSpokeUpdateResponse {
12353 pub fn new() -> Self {
12354 std::default::Default::default()
12355 }
12356
12357 /// Sets the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
12358 ///
12359 /// # Example
12360 /// ```ignore,no_run
12361 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateResponse;
12362 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12363 /// let x = AcceptSpokeUpdateResponse::new().set_spoke(Spoke::default()/* use setters */);
12364 /// ```
12365 pub fn set_spoke<T>(mut self, v: T) -> Self
12366 where
12367 T: std::convert::Into<crate::model::Spoke>,
12368 {
12369 self.spoke = std::option::Option::Some(v.into());
12370 self
12371 }
12372
12373 /// Sets or clears the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
12374 ///
12375 /// # Example
12376 /// ```ignore,no_run
12377 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateResponse;
12378 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12379 /// let x = AcceptSpokeUpdateResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12380 /// let x = AcceptSpokeUpdateResponse::new().set_or_clear_spoke(None::<Spoke>);
12381 /// ```
12382 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12383 where
12384 T: std::convert::Into<crate::model::Spoke>,
12385 {
12386 self.spoke = v.map(|x| x.into());
12387 self
12388 }
12389}
12390
12391impl wkt::message::Message for AcceptSpokeUpdateResponse {
12392 fn typename() -> &'static str {
12393 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateResponse"
12394 }
12395}
12396
12397/// The request for
12398/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
12399///
12400/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
12401#[derive(Clone, Default, PartialEq)]
12402#[non_exhaustive]
12403pub struct RejectSpokeUpdateRequest {
12404 /// Required. The name of the hub to reject spoke update.
12405 pub name: std::string::String,
12406
12407 /// Required. The URI of the spoke to reject update.
12408 pub spoke_uri: std::string::String,
12409
12410 /// Required. The etag of the spoke to reject update.
12411 pub spoke_etag: std::string::String,
12412
12413 /// Optional. Additional information provided by the hub administrator.
12414 pub details: std::string::String,
12415
12416 /// Optional. A request ID to identify requests. Specify a unique request ID so
12417 /// that if you must retry your request, the server knows to ignore the request
12418 /// if it has already been completed. The server guarantees that a request
12419 /// doesn't result in creation of duplicate commitments for at least 60
12420 /// minutes.
12421 ///
12422 /// For example, consider a situation where you make an initial request and
12423 /// the request times out. If you make the request again with the same request
12424 /// ID, the server can check to see whether the original operation
12425 /// was received. If it was, the server ignores the second request. This
12426 /// behavior prevents clients from mistakenly creating duplicate commitments.
12427 ///
12428 /// The request ID must be a valid UUID, with the exception that zero UUID is
12429 /// not supported (00000000-0000-0000-0000-000000000000).
12430 pub request_id: std::string::String,
12431
12432 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12433}
12434
12435impl RejectSpokeUpdateRequest {
12436 pub fn new() -> Self {
12437 std::default::Default::default()
12438 }
12439
12440 /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
12441 ///
12442 /// # Example
12443 /// ```ignore,no_run
12444 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12445 /// let x = RejectSpokeUpdateRequest::new().set_name("example");
12446 /// ```
12447 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12448 self.name = v.into();
12449 self
12450 }
12451
12452 /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
12453 ///
12454 /// # Example
12455 /// ```ignore,no_run
12456 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12457 /// let x = RejectSpokeUpdateRequest::new().set_spoke_uri("example");
12458 /// ```
12459 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12460 self.spoke_uri = v.into();
12461 self
12462 }
12463
12464 /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
12465 ///
12466 /// # Example
12467 /// ```ignore,no_run
12468 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12469 /// let x = RejectSpokeUpdateRequest::new().set_spoke_etag("example");
12470 /// ```
12471 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12472 self.spoke_etag = v.into();
12473 self
12474 }
12475
12476 /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
12477 ///
12478 /// # Example
12479 /// ```ignore,no_run
12480 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12481 /// let x = RejectSpokeUpdateRequest::new().set_details("example");
12482 /// ```
12483 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12484 self.details = v.into();
12485 self
12486 }
12487
12488 /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
12489 ///
12490 /// # Example
12491 /// ```ignore,no_run
12492 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12493 /// let x = RejectSpokeUpdateRequest::new().set_request_id("example");
12494 /// ```
12495 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12496 self.request_id = v.into();
12497 self
12498 }
12499}
12500
12501impl wkt::message::Message for RejectSpokeUpdateRequest {
12502 fn typename() -> &'static str {
12503 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateRequest"
12504 }
12505}
12506
12507/// The response for
12508/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
12509///
12510/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
12511#[derive(Clone, Default, PartialEq)]
12512#[non_exhaustive]
12513pub struct RejectSpokeUpdateResponse {
12514 /// The spoke that was operated on.
12515 pub spoke: std::option::Option<crate::model::Spoke>,
12516
12517 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12518}
12519
12520impl RejectSpokeUpdateResponse {
12521 pub fn new() -> Self {
12522 std::default::Default::default()
12523 }
12524
12525 /// Sets the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
12526 ///
12527 /// # Example
12528 /// ```ignore,no_run
12529 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateResponse;
12530 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12531 /// let x = RejectSpokeUpdateResponse::new().set_spoke(Spoke::default()/* use setters */);
12532 /// ```
12533 pub fn set_spoke<T>(mut self, v: T) -> Self
12534 where
12535 T: std::convert::Into<crate::model::Spoke>,
12536 {
12537 self.spoke = std::option::Option::Some(v.into());
12538 self
12539 }
12540
12541 /// Sets or clears the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
12542 ///
12543 /// # Example
12544 /// ```ignore,no_run
12545 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateResponse;
12546 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12547 /// let x = RejectSpokeUpdateResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12548 /// let x = RejectSpokeUpdateResponse::new().set_or_clear_spoke(None::<Spoke>);
12549 /// ```
12550 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12551 where
12552 T: std::convert::Into<crate::model::Spoke>,
12553 {
12554 self.spoke = v.map(|x| x.into());
12555 self
12556 }
12557}
12558
12559impl wkt::message::Message for RejectSpokeUpdateResponse {
12560 fn typename() -> &'static str {
12561 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateResponse"
12562 }
12563}
12564
12565/// The request for
12566/// [HubService.GetRouteTable][google.cloud.networkconnectivity.v1.HubService.GetRouteTable].
12567///
12568/// [google.cloud.networkconnectivity.v1.HubService.GetRouteTable]: crate::client::HubService::get_route_table
12569#[derive(Clone, Default, PartialEq)]
12570#[non_exhaustive]
12571pub struct GetRouteTableRequest {
12572 /// Required. The name of the route table resource.
12573 pub name: std::string::String,
12574
12575 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12576}
12577
12578impl GetRouteTableRequest {
12579 pub fn new() -> Self {
12580 std::default::Default::default()
12581 }
12582
12583 /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
12584 ///
12585 /// # Example
12586 /// ```ignore,no_run
12587 /// # use google_cloud_networkconnectivity_v1::model::GetRouteTableRequest;
12588 /// let x = GetRouteTableRequest::new().set_name("example");
12589 /// ```
12590 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12591 self.name = v.into();
12592 self
12593 }
12594}
12595
12596impl wkt::message::Message for GetRouteTableRequest {
12597 fn typename() -> &'static str {
12598 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteTableRequest"
12599 }
12600}
12601
12602/// The request for
12603/// [HubService.GetRoute][google.cloud.networkconnectivity.v1.HubService.GetRoute].
12604///
12605/// [google.cloud.networkconnectivity.v1.HubService.GetRoute]: crate::client::HubService::get_route
12606#[derive(Clone, Default, PartialEq)]
12607#[non_exhaustive]
12608pub struct GetRouteRequest {
12609 /// Required. The name of the route resource.
12610 pub name: std::string::String,
12611
12612 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12613}
12614
12615impl GetRouteRequest {
12616 pub fn new() -> Self {
12617 std::default::Default::default()
12618 }
12619
12620 /// Sets the value of [name][crate::model::GetRouteRequest::name].
12621 ///
12622 /// # Example
12623 /// ```ignore,no_run
12624 /// # use google_cloud_networkconnectivity_v1::model::GetRouteRequest;
12625 /// let x = GetRouteRequest::new().set_name("example");
12626 /// ```
12627 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12628 self.name = v.into();
12629 self
12630 }
12631}
12632
12633impl wkt::message::Message for GetRouteRequest {
12634 fn typename() -> &'static str {
12635 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteRequest"
12636 }
12637}
12638
12639/// Request for
12640/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
12641/// method.
12642///
12643/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
12644#[derive(Clone, Default, PartialEq)]
12645#[non_exhaustive]
12646pub struct ListRoutesRequest {
12647 /// Required. The parent resource's name.
12648 pub parent: std::string::String,
12649
12650 /// The maximum number of results to return per page.
12651 pub page_size: i32,
12652
12653 /// The page token.
12654 pub page_token: std::string::String,
12655
12656 /// An expression that filters the list of results.
12657 pub filter: std::string::String,
12658
12659 /// Sort the results by a certain order.
12660 pub order_by: std::string::String,
12661
12662 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12663}
12664
12665impl ListRoutesRequest {
12666 pub fn new() -> Self {
12667 std::default::Default::default()
12668 }
12669
12670 /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
12671 ///
12672 /// # Example
12673 /// ```ignore,no_run
12674 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12675 /// let x = ListRoutesRequest::new().set_parent("example");
12676 /// ```
12677 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12678 self.parent = v.into();
12679 self
12680 }
12681
12682 /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
12683 ///
12684 /// # Example
12685 /// ```ignore,no_run
12686 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12687 /// let x = ListRoutesRequest::new().set_page_size(42);
12688 /// ```
12689 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12690 self.page_size = v.into();
12691 self
12692 }
12693
12694 /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
12695 ///
12696 /// # Example
12697 /// ```ignore,no_run
12698 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12699 /// let x = ListRoutesRequest::new().set_page_token("example");
12700 /// ```
12701 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12702 self.page_token = v.into();
12703 self
12704 }
12705
12706 /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
12707 ///
12708 /// # Example
12709 /// ```ignore,no_run
12710 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12711 /// let x = ListRoutesRequest::new().set_filter("example");
12712 /// ```
12713 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12714 self.filter = v.into();
12715 self
12716 }
12717
12718 /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
12719 ///
12720 /// # Example
12721 /// ```ignore,no_run
12722 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12723 /// let x = ListRoutesRequest::new().set_order_by("example");
12724 /// ```
12725 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12726 self.order_by = v.into();
12727 self
12728 }
12729}
12730
12731impl wkt::message::Message for ListRoutesRequest {
12732 fn typename() -> &'static str {
12733 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesRequest"
12734 }
12735}
12736
12737/// Response for
12738/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
12739/// method.
12740///
12741/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
12742#[derive(Clone, Default, PartialEq)]
12743#[non_exhaustive]
12744pub struct ListRoutesResponse {
12745 /// The requested routes.
12746 pub routes: std::vec::Vec<crate::model::Route>,
12747
12748 /// The token for the next page of the response. To see more results,
12749 /// use this value as the page_token for your next request. If this value
12750 /// is empty, there are no more results.
12751 pub next_page_token: std::string::String,
12752
12753 /// RouteTables that could not be reached.
12754 pub unreachable: std::vec::Vec<std::string::String>,
12755
12756 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12757}
12758
12759impl ListRoutesResponse {
12760 pub fn new() -> Self {
12761 std::default::Default::default()
12762 }
12763
12764 /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
12765 ///
12766 /// # Example
12767 /// ```ignore,no_run
12768 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
12769 /// use google_cloud_networkconnectivity_v1::model::Route;
12770 /// let x = ListRoutesResponse::new()
12771 /// .set_routes([
12772 /// Route::default()/* use setters */,
12773 /// Route::default()/* use (different) setters */,
12774 /// ]);
12775 /// ```
12776 pub fn set_routes<T, V>(mut self, v: T) -> Self
12777 where
12778 T: std::iter::IntoIterator<Item = V>,
12779 V: std::convert::Into<crate::model::Route>,
12780 {
12781 use std::iter::Iterator;
12782 self.routes = v.into_iter().map(|i| i.into()).collect();
12783 self
12784 }
12785
12786 /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
12787 ///
12788 /// # Example
12789 /// ```ignore,no_run
12790 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
12791 /// let x = ListRoutesResponse::new().set_next_page_token("example");
12792 /// ```
12793 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12794 self.next_page_token = v.into();
12795 self
12796 }
12797
12798 /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
12799 ///
12800 /// # Example
12801 /// ```ignore,no_run
12802 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
12803 /// let x = ListRoutesResponse::new().set_unreachable(["a", "b", "c"]);
12804 /// ```
12805 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12806 where
12807 T: std::iter::IntoIterator<Item = V>,
12808 V: std::convert::Into<std::string::String>,
12809 {
12810 use std::iter::Iterator;
12811 self.unreachable = v.into_iter().map(|i| i.into()).collect();
12812 self
12813 }
12814}
12815
12816impl wkt::message::Message for ListRoutesResponse {
12817 fn typename() -> &'static str {
12818 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesResponse"
12819 }
12820}
12821
12822#[doc(hidden)]
12823impl gax::paginator::internal::PageableResponse for ListRoutesResponse {
12824 type PageItem = crate::model::Route;
12825
12826 fn items(self) -> std::vec::Vec<Self::PageItem> {
12827 self.routes
12828 }
12829
12830 fn next_page_token(&self) -> std::string::String {
12831 use std::clone::Clone;
12832 self.next_page_token.clone()
12833 }
12834}
12835
12836/// Request for
12837/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
12838/// method.
12839///
12840/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
12841#[derive(Clone, Default, PartialEq)]
12842#[non_exhaustive]
12843pub struct ListRouteTablesRequest {
12844 /// Required. The parent resource's name.
12845 pub parent: std::string::String,
12846
12847 /// The maximum number of results to return per page.
12848 pub page_size: i32,
12849
12850 /// The page token.
12851 pub page_token: std::string::String,
12852
12853 /// An expression that filters the list of results.
12854 pub filter: std::string::String,
12855
12856 /// Sort the results by a certain order.
12857 pub order_by: std::string::String,
12858
12859 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12860}
12861
12862impl ListRouteTablesRequest {
12863 pub fn new() -> Self {
12864 std::default::Default::default()
12865 }
12866
12867 /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
12868 ///
12869 /// # Example
12870 /// ```ignore,no_run
12871 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12872 /// let x = ListRouteTablesRequest::new().set_parent("example");
12873 /// ```
12874 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12875 self.parent = v.into();
12876 self
12877 }
12878
12879 /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
12880 ///
12881 /// # Example
12882 /// ```ignore,no_run
12883 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12884 /// let x = ListRouteTablesRequest::new().set_page_size(42);
12885 /// ```
12886 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12887 self.page_size = v.into();
12888 self
12889 }
12890
12891 /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
12892 ///
12893 /// # Example
12894 /// ```ignore,no_run
12895 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12896 /// let x = ListRouteTablesRequest::new().set_page_token("example");
12897 /// ```
12898 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12899 self.page_token = v.into();
12900 self
12901 }
12902
12903 /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
12904 ///
12905 /// # Example
12906 /// ```ignore,no_run
12907 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12908 /// let x = ListRouteTablesRequest::new().set_filter("example");
12909 /// ```
12910 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12911 self.filter = v.into();
12912 self
12913 }
12914
12915 /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
12916 ///
12917 /// # Example
12918 /// ```ignore,no_run
12919 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12920 /// let x = ListRouteTablesRequest::new().set_order_by("example");
12921 /// ```
12922 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12923 self.order_by = v.into();
12924 self
12925 }
12926}
12927
12928impl wkt::message::Message for ListRouteTablesRequest {
12929 fn typename() -> &'static str {
12930 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"
12931 }
12932}
12933
12934/// Response for
12935/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
12936/// method.
12937///
12938/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
12939#[derive(Clone, Default, PartialEq)]
12940#[non_exhaustive]
12941pub struct ListRouteTablesResponse {
12942 /// The requested route tables.
12943 pub route_tables: std::vec::Vec<crate::model::RouteTable>,
12944
12945 /// The token for the next page of the response. To see more results,
12946 /// use this value as the page_token for your next request. If this value
12947 /// is empty, there are no more results.
12948 pub next_page_token: std::string::String,
12949
12950 /// Hubs that could not be reached.
12951 pub unreachable: std::vec::Vec<std::string::String>,
12952
12953 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12954}
12955
12956impl ListRouteTablesResponse {
12957 pub fn new() -> Self {
12958 std::default::Default::default()
12959 }
12960
12961 /// Sets the value of [route_tables][crate::model::ListRouteTablesResponse::route_tables].
12962 ///
12963 /// # Example
12964 /// ```ignore,no_run
12965 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
12966 /// use google_cloud_networkconnectivity_v1::model::RouteTable;
12967 /// let x = ListRouteTablesResponse::new()
12968 /// .set_route_tables([
12969 /// RouteTable::default()/* use setters */,
12970 /// RouteTable::default()/* use (different) setters */,
12971 /// ]);
12972 /// ```
12973 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
12974 where
12975 T: std::iter::IntoIterator<Item = V>,
12976 V: std::convert::Into<crate::model::RouteTable>,
12977 {
12978 use std::iter::Iterator;
12979 self.route_tables = v.into_iter().map(|i| i.into()).collect();
12980 self
12981 }
12982
12983 /// Sets the value of [next_page_token][crate::model::ListRouteTablesResponse::next_page_token].
12984 ///
12985 /// # Example
12986 /// ```ignore,no_run
12987 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
12988 /// let x = ListRouteTablesResponse::new().set_next_page_token("example");
12989 /// ```
12990 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12991 self.next_page_token = v.into();
12992 self
12993 }
12994
12995 /// Sets the value of [unreachable][crate::model::ListRouteTablesResponse::unreachable].
12996 ///
12997 /// # Example
12998 /// ```ignore,no_run
12999 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
13000 /// let x = ListRouteTablesResponse::new().set_unreachable(["a", "b", "c"]);
13001 /// ```
13002 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13003 where
13004 T: std::iter::IntoIterator<Item = V>,
13005 V: std::convert::Into<std::string::String>,
13006 {
13007 use std::iter::Iterator;
13008 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13009 self
13010 }
13011}
13012
13013impl wkt::message::Message for ListRouteTablesResponse {
13014 fn typename() -> &'static str {
13015 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"
13016 }
13017}
13018
13019#[doc(hidden)]
13020impl gax::paginator::internal::PageableResponse for ListRouteTablesResponse {
13021 type PageItem = crate::model::RouteTable;
13022
13023 fn items(self) -> std::vec::Vec<Self::PageItem> {
13024 self.route_tables
13025 }
13026
13027 fn next_page_token(&self) -> std::string::String {
13028 use std::clone::Clone;
13029 self.next_page_token.clone()
13030 }
13031}
13032
13033/// Request for
13034/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
13035/// method.
13036///
13037/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
13038#[derive(Clone, Default, PartialEq)]
13039#[non_exhaustive]
13040pub struct ListGroupsRequest {
13041 /// Required. The parent resource's name.
13042 pub parent: std::string::String,
13043
13044 /// The maximum number of results to return per page.
13045 pub page_size: i32,
13046
13047 /// The page token.
13048 pub page_token: std::string::String,
13049
13050 /// An expression that filters the list of results.
13051 pub filter: std::string::String,
13052
13053 /// Sort the results by a certain order.
13054 pub order_by: std::string::String,
13055
13056 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13057}
13058
13059impl ListGroupsRequest {
13060 pub fn new() -> Self {
13061 std::default::Default::default()
13062 }
13063
13064 /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
13065 ///
13066 /// # Example
13067 /// ```ignore,no_run
13068 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13069 /// let x = ListGroupsRequest::new().set_parent("example");
13070 /// ```
13071 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13072 self.parent = v.into();
13073 self
13074 }
13075
13076 /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
13077 ///
13078 /// # Example
13079 /// ```ignore,no_run
13080 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13081 /// let x = ListGroupsRequest::new().set_page_size(42);
13082 /// ```
13083 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13084 self.page_size = v.into();
13085 self
13086 }
13087
13088 /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
13089 ///
13090 /// # Example
13091 /// ```ignore,no_run
13092 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13093 /// let x = ListGroupsRequest::new().set_page_token("example");
13094 /// ```
13095 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13096 self.page_token = v.into();
13097 self
13098 }
13099
13100 /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
13101 ///
13102 /// # Example
13103 /// ```ignore,no_run
13104 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13105 /// let x = ListGroupsRequest::new().set_filter("example");
13106 /// ```
13107 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13108 self.filter = v.into();
13109 self
13110 }
13111
13112 /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
13113 ///
13114 /// # Example
13115 /// ```ignore,no_run
13116 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13117 /// let x = ListGroupsRequest::new().set_order_by("example");
13118 /// ```
13119 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13120 self.order_by = v.into();
13121 self
13122 }
13123}
13124
13125impl wkt::message::Message for ListGroupsRequest {
13126 fn typename() -> &'static str {
13127 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsRequest"
13128 }
13129}
13130
13131/// Response for
13132/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
13133/// method.
13134///
13135/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
13136#[derive(Clone, Default, PartialEq)]
13137#[non_exhaustive]
13138pub struct ListGroupsResponse {
13139 /// The requested groups.
13140 pub groups: std::vec::Vec<crate::model::Group>,
13141
13142 /// The token for the next page of the response. To see more results,
13143 /// use this value as the page_token for your next request. If this value
13144 /// is empty, there are no more results.
13145 pub next_page_token: std::string::String,
13146
13147 /// Hubs that could not be reached.
13148 pub unreachable: std::vec::Vec<std::string::String>,
13149
13150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13151}
13152
13153impl ListGroupsResponse {
13154 pub fn new() -> Self {
13155 std::default::Default::default()
13156 }
13157
13158 /// Sets the value of [groups][crate::model::ListGroupsResponse::groups].
13159 ///
13160 /// # Example
13161 /// ```ignore,no_run
13162 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13163 /// use google_cloud_networkconnectivity_v1::model::Group;
13164 /// let x = ListGroupsResponse::new()
13165 /// .set_groups([
13166 /// Group::default()/* use setters */,
13167 /// Group::default()/* use (different) setters */,
13168 /// ]);
13169 /// ```
13170 pub fn set_groups<T, V>(mut self, v: T) -> Self
13171 where
13172 T: std::iter::IntoIterator<Item = V>,
13173 V: std::convert::Into<crate::model::Group>,
13174 {
13175 use std::iter::Iterator;
13176 self.groups = v.into_iter().map(|i| i.into()).collect();
13177 self
13178 }
13179
13180 /// Sets the value of [next_page_token][crate::model::ListGroupsResponse::next_page_token].
13181 ///
13182 /// # Example
13183 /// ```ignore,no_run
13184 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13185 /// let x = ListGroupsResponse::new().set_next_page_token("example");
13186 /// ```
13187 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13188 self.next_page_token = v.into();
13189 self
13190 }
13191
13192 /// Sets the value of [unreachable][crate::model::ListGroupsResponse::unreachable].
13193 ///
13194 /// # Example
13195 /// ```ignore,no_run
13196 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13197 /// let x = ListGroupsResponse::new().set_unreachable(["a", "b", "c"]);
13198 /// ```
13199 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13200 where
13201 T: std::iter::IntoIterator<Item = V>,
13202 V: std::convert::Into<std::string::String>,
13203 {
13204 use std::iter::Iterator;
13205 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13206 self
13207 }
13208}
13209
13210impl wkt::message::Message for ListGroupsResponse {
13211 fn typename() -> &'static str {
13212 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsResponse"
13213 }
13214}
13215
13216#[doc(hidden)]
13217impl gax::paginator::internal::PageableResponse for ListGroupsResponse {
13218 type PageItem = crate::model::Group;
13219
13220 fn items(self) -> std::vec::Vec<Self::PageItem> {
13221 self.groups
13222 }
13223
13224 fn next_page_token(&self) -> std::string::String {
13225 use std::clone::Clone;
13226 self.next_page_token.clone()
13227 }
13228}
13229
13230/// A collection of Cloud VPN tunnel resources. These resources should be
13231/// redundant HA VPN tunnels that all advertise the same prefixes to Google
13232/// Cloud. Alternatively, in a passive/active configuration, all tunnels
13233/// should be capable of advertising the same prefixes.
13234#[derive(Clone, Default, PartialEq)]
13235#[non_exhaustive]
13236pub struct LinkedVpnTunnels {
13237 /// The URIs of linked VPN tunnel resources.
13238 pub uris: std::vec::Vec<std::string::String>,
13239
13240 /// A value that controls whether site-to-site data transfer is enabled for
13241 /// these resources. Data transfer is available only in [supported
13242 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13243 pub site_to_site_data_transfer: bool,
13244
13245 /// Output only. The VPC network where these VPN tunnels are located.
13246 pub vpc_network: std::string::String,
13247
13248 /// Optional. IP ranges allowed to be included during import from hub (does not
13249 /// control transit connectivity). The only allowed value for now is
13250 /// "ALL_IPV4_RANGES".
13251 pub include_import_ranges: std::vec::Vec<std::string::String>,
13252
13253 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13254}
13255
13256impl LinkedVpnTunnels {
13257 pub fn new() -> Self {
13258 std::default::Default::default()
13259 }
13260
13261 /// Sets the value of [uris][crate::model::LinkedVpnTunnels::uris].
13262 ///
13263 /// # Example
13264 /// ```ignore,no_run
13265 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13266 /// let x = LinkedVpnTunnels::new().set_uris(["a", "b", "c"]);
13267 /// ```
13268 pub fn set_uris<T, V>(mut self, v: T) -> Self
13269 where
13270 T: std::iter::IntoIterator<Item = V>,
13271 V: std::convert::Into<std::string::String>,
13272 {
13273 use std::iter::Iterator;
13274 self.uris = v.into_iter().map(|i| i.into()).collect();
13275 self
13276 }
13277
13278 /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedVpnTunnels::site_to_site_data_transfer].
13279 ///
13280 /// # Example
13281 /// ```ignore,no_run
13282 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13283 /// let x = LinkedVpnTunnels::new().set_site_to_site_data_transfer(true);
13284 /// ```
13285 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13286 self.site_to_site_data_transfer = v.into();
13287 self
13288 }
13289
13290 /// Sets the value of [vpc_network][crate::model::LinkedVpnTunnels::vpc_network].
13291 ///
13292 /// # Example
13293 /// ```ignore,no_run
13294 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13295 /// let x = LinkedVpnTunnels::new().set_vpc_network("example");
13296 /// ```
13297 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13298 self.vpc_network = v.into();
13299 self
13300 }
13301
13302 /// Sets the value of [include_import_ranges][crate::model::LinkedVpnTunnels::include_import_ranges].
13303 ///
13304 /// # Example
13305 /// ```ignore,no_run
13306 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13307 /// let x = LinkedVpnTunnels::new().set_include_import_ranges(["a", "b", "c"]);
13308 /// ```
13309 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13310 where
13311 T: std::iter::IntoIterator<Item = V>,
13312 V: std::convert::Into<std::string::String>,
13313 {
13314 use std::iter::Iterator;
13315 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13316 self
13317 }
13318}
13319
13320impl wkt::message::Message for LinkedVpnTunnels {
13321 fn typename() -> &'static str {
13322 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"
13323 }
13324}
13325
13326/// A collection of VLAN attachment resources. These resources should
13327/// be redundant attachments that all advertise the same prefixes to Google
13328/// Cloud. Alternatively, in active/passive configurations, all attachments
13329/// should be capable of advertising the same prefixes.
13330#[derive(Clone, Default, PartialEq)]
13331#[non_exhaustive]
13332pub struct LinkedInterconnectAttachments {
13333 /// The URIs of linked interconnect attachment resources
13334 pub uris: std::vec::Vec<std::string::String>,
13335
13336 /// A value that controls whether site-to-site data transfer is enabled for
13337 /// these resources. Data transfer is available only in [supported
13338 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13339 pub site_to_site_data_transfer: bool,
13340
13341 /// Output only. The VPC network where these VLAN attachments are located.
13342 pub vpc_network: std::string::String,
13343
13344 /// Optional. IP ranges allowed to be included during import from hub (does not
13345 /// control transit connectivity). The only allowed value for now is
13346 /// "ALL_IPV4_RANGES".
13347 pub include_import_ranges: std::vec::Vec<std::string::String>,
13348
13349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13350}
13351
13352impl LinkedInterconnectAttachments {
13353 pub fn new() -> Self {
13354 std::default::Default::default()
13355 }
13356
13357 /// Sets the value of [uris][crate::model::LinkedInterconnectAttachments::uris].
13358 ///
13359 /// # Example
13360 /// ```ignore,no_run
13361 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13362 /// let x = LinkedInterconnectAttachments::new().set_uris(["a", "b", "c"]);
13363 /// ```
13364 pub fn set_uris<T, V>(mut self, v: T) -> Self
13365 where
13366 T: std::iter::IntoIterator<Item = V>,
13367 V: std::convert::Into<std::string::String>,
13368 {
13369 use std::iter::Iterator;
13370 self.uris = v.into_iter().map(|i| i.into()).collect();
13371 self
13372 }
13373
13374 /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedInterconnectAttachments::site_to_site_data_transfer].
13375 ///
13376 /// # Example
13377 /// ```ignore,no_run
13378 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13379 /// let x = LinkedInterconnectAttachments::new().set_site_to_site_data_transfer(true);
13380 /// ```
13381 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13382 self.site_to_site_data_transfer = v.into();
13383 self
13384 }
13385
13386 /// Sets the value of [vpc_network][crate::model::LinkedInterconnectAttachments::vpc_network].
13387 ///
13388 /// # Example
13389 /// ```ignore,no_run
13390 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13391 /// let x = LinkedInterconnectAttachments::new().set_vpc_network("example");
13392 /// ```
13393 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13394 self.vpc_network = v.into();
13395 self
13396 }
13397
13398 /// Sets the value of [include_import_ranges][crate::model::LinkedInterconnectAttachments::include_import_ranges].
13399 ///
13400 /// # Example
13401 /// ```ignore,no_run
13402 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13403 /// let x = LinkedInterconnectAttachments::new().set_include_import_ranges(["a", "b", "c"]);
13404 /// ```
13405 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13406 where
13407 T: std::iter::IntoIterator<Item = V>,
13408 V: std::convert::Into<std::string::String>,
13409 {
13410 use std::iter::Iterator;
13411 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13412 self
13413 }
13414}
13415
13416impl wkt::message::Message for LinkedInterconnectAttachments {
13417 fn typename() -> &'static str {
13418 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"
13419 }
13420}
13421
13422/// A collection of router appliance instances. If you configure multiple router
13423/// appliance instances to receive data from the same set of sites outside of
13424/// Google Cloud, we recommend that you associate those instances with the same
13425/// spoke.
13426#[derive(Clone, Default, PartialEq)]
13427#[non_exhaustive]
13428pub struct LinkedRouterApplianceInstances {
13429 /// The list of router appliance instances.
13430 pub instances: std::vec::Vec<crate::model::RouterApplianceInstance>,
13431
13432 /// A value that controls whether site-to-site data transfer is enabled for
13433 /// these resources. Data transfer is available only in [supported
13434 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13435 pub site_to_site_data_transfer: bool,
13436
13437 /// Output only. The VPC network where these router appliance instances are
13438 /// located.
13439 pub vpc_network: std::string::String,
13440
13441 /// Optional. IP ranges allowed to be included during import from hub (does not
13442 /// control transit connectivity). The only allowed value for now is
13443 /// "ALL_IPV4_RANGES".
13444 pub include_import_ranges: std::vec::Vec<std::string::String>,
13445
13446 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13447}
13448
13449impl LinkedRouterApplianceInstances {
13450 pub fn new() -> Self {
13451 std::default::Default::default()
13452 }
13453
13454 /// Sets the value of [instances][crate::model::LinkedRouterApplianceInstances::instances].
13455 ///
13456 /// # Example
13457 /// ```ignore,no_run
13458 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13459 /// use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
13460 /// let x = LinkedRouterApplianceInstances::new()
13461 /// .set_instances([
13462 /// RouterApplianceInstance::default()/* use setters */,
13463 /// RouterApplianceInstance::default()/* use (different) setters */,
13464 /// ]);
13465 /// ```
13466 pub fn set_instances<T, V>(mut self, v: T) -> Self
13467 where
13468 T: std::iter::IntoIterator<Item = V>,
13469 V: std::convert::Into<crate::model::RouterApplianceInstance>,
13470 {
13471 use std::iter::Iterator;
13472 self.instances = v.into_iter().map(|i| i.into()).collect();
13473 self
13474 }
13475
13476 /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedRouterApplianceInstances::site_to_site_data_transfer].
13477 ///
13478 /// # Example
13479 /// ```ignore,no_run
13480 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13481 /// let x = LinkedRouterApplianceInstances::new().set_site_to_site_data_transfer(true);
13482 /// ```
13483 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13484 self.site_to_site_data_transfer = v.into();
13485 self
13486 }
13487
13488 /// Sets the value of [vpc_network][crate::model::LinkedRouterApplianceInstances::vpc_network].
13489 ///
13490 /// # Example
13491 /// ```ignore,no_run
13492 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13493 /// let x = LinkedRouterApplianceInstances::new().set_vpc_network("example");
13494 /// ```
13495 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13496 self.vpc_network = v.into();
13497 self
13498 }
13499
13500 /// Sets the value of [include_import_ranges][crate::model::LinkedRouterApplianceInstances::include_import_ranges].
13501 ///
13502 /// # Example
13503 /// ```ignore,no_run
13504 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13505 /// let x = LinkedRouterApplianceInstances::new().set_include_import_ranges(["a", "b", "c"]);
13506 /// ```
13507 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13508 where
13509 T: std::iter::IntoIterator<Item = V>,
13510 V: std::convert::Into<std::string::String>,
13511 {
13512 use std::iter::Iterator;
13513 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13514 self
13515 }
13516}
13517
13518impl wkt::message::Message for LinkedRouterApplianceInstances {
13519 fn typename() -> &'static str {
13520 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"
13521 }
13522}
13523
13524/// An existing VPC network.
13525#[derive(Clone, Default, PartialEq)]
13526#[non_exhaustive]
13527pub struct LinkedVpcNetwork {
13528 /// Required. The URI of the VPC network resource.
13529 pub uri: std::string::String,
13530
13531 /// Optional. IP ranges encompassing the subnets to be excluded from peering.
13532 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
13533
13534 /// Optional. IP ranges allowed to be included from peering.
13535 pub include_export_ranges: std::vec::Vec<std::string::String>,
13536
13537 /// Optional. The proposed include export IP ranges waiting for hub
13538 /// administration's approval.
13539 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
13540
13541 /// Output only. The proposed exclude export IP ranges waiting for hub
13542 /// administration's approval.
13543 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
13544
13545 /// Output only. The list of Producer VPC spokes that this VPC spoke is a
13546 /// service consumer VPC spoke for. These producer VPCs are connected through
13547 /// VPC peering to this spoke's backing VPC network. Because they are directly
13548 /// connected throuh VPC peering, NCC export filters do not apply between the
13549 /// service consumer VPC spoke and any of its producer VPC spokes. This VPC
13550 /// spoke cannot be deleted as long as any of these producer VPC spokes are
13551 /// connected to the NCC Hub.
13552 pub producer_vpc_spokes: std::vec::Vec<std::string::String>,
13553
13554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13555}
13556
13557impl LinkedVpcNetwork {
13558 pub fn new() -> Self {
13559 std::default::Default::default()
13560 }
13561
13562 /// Sets the value of [uri][crate::model::LinkedVpcNetwork::uri].
13563 ///
13564 /// # Example
13565 /// ```ignore,no_run
13566 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13567 /// let x = LinkedVpcNetwork::new().set_uri("example");
13568 /// ```
13569 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13570 self.uri = v.into();
13571 self
13572 }
13573
13574 /// Sets the value of [exclude_export_ranges][crate::model::LinkedVpcNetwork::exclude_export_ranges].
13575 ///
13576 /// # Example
13577 /// ```ignore,no_run
13578 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13579 /// let x = LinkedVpcNetwork::new().set_exclude_export_ranges(["a", "b", "c"]);
13580 /// ```
13581 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13582 where
13583 T: std::iter::IntoIterator<Item = V>,
13584 V: std::convert::Into<std::string::String>,
13585 {
13586 use std::iter::Iterator;
13587 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13588 self
13589 }
13590
13591 /// Sets the value of [include_export_ranges][crate::model::LinkedVpcNetwork::include_export_ranges].
13592 ///
13593 /// # Example
13594 /// ```ignore,no_run
13595 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13596 /// let x = LinkedVpcNetwork::new().set_include_export_ranges(["a", "b", "c"]);
13597 /// ```
13598 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
13599 where
13600 T: std::iter::IntoIterator<Item = V>,
13601 V: std::convert::Into<std::string::String>,
13602 {
13603 use std::iter::Iterator;
13604 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13605 self
13606 }
13607
13608 /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedVpcNetwork::proposed_include_export_ranges].
13609 ///
13610 /// # Example
13611 /// ```ignore,no_run
13612 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13613 /// let x = LinkedVpcNetwork::new().set_proposed_include_export_ranges(["a", "b", "c"]);
13614 /// ```
13615 pub fn set_proposed_include_export_ranges<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.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13622 self
13623 }
13624
13625 /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedVpcNetwork::proposed_exclude_export_ranges].
13626 ///
13627 /// # Example
13628 /// ```ignore,no_run
13629 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13630 /// let x = LinkedVpcNetwork::new().set_proposed_exclude_export_ranges(["a", "b", "c"]);
13631 /// ```
13632 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13633 where
13634 T: std::iter::IntoIterator<Item = V>,
13635 V: std::convert::Into<std::string::String>,
13636 {
13637 use std::iter::Iterator;
13638 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13639 self
13640 }
13641
13642 /// Sets the value of [producer_vpc_spokes][crate::model::LinkedVpcNetwork::producer_vpc_spokes].
13643 ///
13644 /// # Example
13645 /// ```ignore,no_run
13646 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13647 /// let x = LinkedVpcNetwork::new().set_producer_vpc_spokes(["a", "b", "c"]);
13648 /// ```
13649 pub fn set_producer_vpc_spokes<T, V>(mut self, v: T) -> Self
13650 where
13651 T: std::iter::IntoIterator<Item = V>,
13652 V: std::convert::Into<std::string::String>,
13653 {
13654 use std::iter::Iterator;
13655 self.producer_vpc_spokes = v.into_iter().map(|i| i.into()).collect();
13656 self
13657 }
13658}
13659
13660impl wkt::message::Message for LinkedVpcNetwork {
13661 fn typename() -> &'static str {
13662 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"
13663 }
13664}
13665
13666#[derive(Clone, Default, PartialEq)]
13667#[non_exhaustive]
13668pub struct LinkedProducerVpcNetwork {
13669 /// Immutable. The URI of the Service Consumer VPC that the Producer VPC is
13670 /// peered with.
13671 pub network: std::string::String,
13672
13673 /// Output only. The Service Consumer Network spoke.
13674 pub service_consumer_vpc_spoke: std::string::String,
13675
13676 /// Immutable. The name of the VPC peering between the Service Consumer VPC and
13677 /// the Producer VPC (defined in the Tenant project) which is added to the NCC
13678 /// hub. This peering must be in ACTIVE state.
13679 pub peering: std::string::String,
13680
13681 /// Output only. The URI of the Producer VPC.
13682 pub producer_network: std::string::String,
13683
13684 /// Optional. IP ranges encompassing the subnets to be excluded from peering.
13685 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
13686
13687 /// Optional. IP ranges allowed to be included from peering.
13688 pub include_export_ranges: std::vec::Vec<std::string::String>,
13689
13690 /// Optional. The proposed include export IP ranges waiting for hub
13691 /// administration's approval.
13692 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
13693
13694 /// Output only. The proposed exclude export IP ranges waiting for hub
13695 /// administration's approval.
13696 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
13697
13698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13699}
13700
13701impl LinkedProducerVpcNetwork {
13702 pub fn new() -> Self {
13703 std::default::Default::default()
13704 }
13705
13706 /// Sets the value of [network][crate::model::LinkedProducerVpcNetwork::network].
13707 ///
13708 /// # Example
13709 /// ```ignore,no_run
13710 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13711 /// let x = LinkedProducerVpcNetwork::new().set_network("example");
13712 /// ```
13713 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13714 self.network = v.into();
13715 self
13716 }
13717
13718 /// Sets the value of [service_consumer_vpc_spoke][crate::model::LinkedProducerVpcNetwork::service_consumer_vpc_spoke].
13719 ///
13720 /// # Example
13721 /// ```ignore,no_run
13722 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13723 /// let x = LinkedProducerVpcNetwork::new().set_service_consumer_vpc_spoke("example");
13724 /// ```
13725 pub fn set_service_consumer_vpc_spoke<T: std::convert::Into<std::string::String>>(
13726 mut self,
13727 v: T,
13728 ) -> Self {
13729 self.service_consumer_vpc_spoke = v.into();
13730 self
13731 }
13732
13733 /// Sets the value of [peering][crate::model::LinkedProducerVpcNetwork::peering].
13734 ///
13735 /// # Example
13736 /// ```ignore,no_run
13737 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13738 /// let x = LinkedProducerVpcNetwork::new().set_peering("example");
13739 /// ```
13740 pub fn set_peering<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13741 self.peering = v.into();
13742 self
13743 }
13744
13745 /// Sets the value of [producer_network][crate::model::LinkedProducerVpcNetwork::producer_network].
13746 ///
13747 /// # Example
13748 /// ```ignore,no_run
13749 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13750 /// let x = LinkedProducerVpcNetwork::new().set_producer_network("example");
13751 /// ```
13752 pub fn set_producer_network<T: std::convert::Into<std::string::String>>(
13753 mut self,
13754 v: T,
13755 ) -> Self {
13756 self.producer_network = v.into();
13757 self
13758 }
13759
13760 /// Sets the value of [exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::exclude_export_ranges].
13761 ///
13762 /// # Example
13763 /// ```ignore,no_run
13764 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13765 /// let x = LinkedProducerVpcNetwork::new().set_exclude_export_ranges(["a", "b", "c"]);
13766 /// ```
13767 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13768 where
13769 T: std::iter::IntoIterator<Item = V>,
13770 V: std::convert::Into<std::string::String>,
13771 {
13772 use std::iter::Iterator;
13773 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13774 self
13775 }
13776
13777 /// Sets the value of [include_export_ranges][crate::model::LinkedProducerVpcNetwork::include_export_ranges].
13778 ///
13779 /// # Example
13780 /// ```ignore,no_run
13781 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13782 /// let x = LinkedProducerVpcNetwork::new().set_include_export_ranges(["a", "b", "c"]);
13783 /// ```
13784 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
13785 where
13786 T: std::iter::IntoIterator<Item = V>,
13787 V: std::convert::Into<std::string::String>,
13788 {
13789 use std::iter::Iterator;
13790 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13791 self
13792 }
13793
13794 /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_include_export_ranges].
13795 ///
13796 /// # Example
13797 /// ```ignore,no_run
13798 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13799 /// let x = LinkedProducerVpcNetwork::new().set_proposed_include_export_ranges(["a", "b", "c"]);
13800 /// ```
13801 pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
13802 where
13803 T: std::iter::IntoIterator<Item = V>,
13804 V: std::convert::Into<std::string::String>,
13805 {
13806 use std::iter::Iterator;
13807 self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13808 self
13809 }
13810
13811 /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_exclude_export_ranges].
13812 ///
13813 /// # Example
13814 /// ```ignore,no_run
13815 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13816 /// let x = LinkedProducerVpcNetwork::new().set_proposed_exclude_export_ranges(["a", "b", "c"]);
13817 /// ```
13818 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13819 where
13820 T: std::iter::IntoIterator<Item = V>,
13821 V: std::convert::Into<std::string::String>,
13822 {
13823 use std::iter::Iterator;
13824 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13825 self
13826 }
13827}
13828
13829impl wkt::message::Message for LinkedProducerVpcNetwork {
13830 fn typename() -> &'static str {
13831 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedProducerVpcNetwork"
13832 }
13833}
13834
13835/// A router appliance instance is a Compute Engine virtual machine (VM) instance
13836/// that acts as a BGP speaker. A router appliance instance is specified by the
13837/// URI of the VM and the internal IP address of one of the VM's network
13838/// interfaces.
13839#[derive(Clone, Default, PartialEq)]
13840#[non_exhaustive]
13841pub struct RouterApplianceInstance {
13842 /// The URI of the VM.
13843 pub virtual_machine: std::string::String,
13844
13845 /// The IP address on the VM to use for peering.
13846 pub ip_address: std::string::String,
13847
13848 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13849}
13850
13851impl RouterApplianceInstance {
13852 pub fn new() -> Self {
13853 std::default::Default::default()
13854 }
13855
13856 /// Sets the value of [virtual_machine][crate::model::RouterApplianceInstance::virtual_machine].
13857 ///
13858 /// # Example
13859 /// ```ignore,no_run
13860 /// # use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
13861 /// let x = RouterApplianceInstance::new().set_virtual_machine("example");
13862 /// ```
13863 pub fn set_virtual_machine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13864 self.virtual_machine = v.into();
13865 self
13866 }
13867
13868 /// Sets the value of [ip_address][crate::model::RouterApplianceInstance::ip_address].
13869 ///
13870 /// # Example
13871 /// ```ignore,no_run
13872 /// # use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
13873 /// let x = RouterApplianceInstance::new().set_ip_address("example");
13874 /// ```
13875 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13876 self.ip_address = v.into();
13877 self
13878 }
13879}
13880
13881impl wkt::message::Message for RouterApplianceInstance {
13882 fn typename() -> &'static str {
13883 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouterApplianceInstance"
13884 }
13885}
13886
13887/// Metadata about locations
13888#[derive(Clone, Default, PartialEq)]
13889#[non_exhaustive]
13890pub struct LocationMetadata {
13891 /// List of supported features
13892 pub location_features: std::vec::Vec<crate::model::LocationFeature>,
13893
13894 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13895}
13896
13897impl LocationMetadata {
13898 pub fn new() -> Self {
13899 std::default::Default::default()
13900 }
13901
13902 /// Sets the value of [location_features][crate::model::LocationMetadata::location_features].
13903 ///
13904 /// # Example
13905 /// ```ignore,no_run
13906 /// # use google_cloud_networkconnectivity_v1::model::LocationMetadata;
13907 /// use google_cloud_networkconnectivity_v1::model::LocationFeature;
13908 /// let x = LocationMetadata::new().set_location_features([
13909 /// LocationFeature::SiteToCloudSpokes,
13910 /// LocationFeature::SiteToSiteSpokes,
13911 /// ]);
13912 /// ```
13913 pub fn set_location_features<T, V>(mut self, v: T) -> Self
13914 where
13915 T: std::iter::IntoIterator<Item = V>,
13916 V: std::convert::Into<crate::model::LocationFeature>,
13917 {
13918 use std::iter::Iterator;
13919 self.location_features = v.into_iter().map(|i| i.into()).collect();
13920 self
13921 }
13922}
13923
13924impl wkt::message::Message for LocationMetadata {
13925 fn typename() -> &'static str {
13926 "type.googleapis.com/google.cloud.networkconnectivity.v1.LocationMetadata"
13927 }
13928}
13929
13930#[derive(Clone, Default, PartialEq)]
13931#[non_exhaustive]
13932pub struct NextHopVpcNetwork {
13933 /// The URI of the VPC network resource
13934 pub uri: std::string::String,
13935
13936 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13937}
13938
13939impl NextHopVpcNetwork {
13940 pub fn new() -> Self {
13941 std::default::Default::default()
13942 }
13943
13944 /// Sets the value of [uri][crate::model::NextHopVpcNetwork::uri].
13945 ///
13946 /// # Example
13947 /// ```ignore,no_run
13948 /// # use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
13949 /// let x = NextHopVpcNetwork::new().set_uri("example");
13950 /// ```
13951 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13952 self.uri = v.into();
13953 self
13954 }
13955}
13956
13957impl wkt::message::Message for NextHopVpcNetwork {
13958 fn typename() -> &'static str {
13959 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"
13960 }
13961}
13962
13963/// A route next hop that leads to a VPN tunnel resource.
13964#[derive(Clone, Default, PartialEq)]
13965#[non_exhaustive]
13966pub struct NextHopVPNTunnel {
13967 /// The URI of the VPN tunnel resource.
13968 pub uri: std::string::String,
13969
13970 /// The VPC network where this VPN tunnel is located.
13971 pub vpc_network: std::string::String,
13972
13973 /// Indicates whether site-to-site data transfer is allowed for this VPN tunnel
13974 /// resource. Data transfer is available only in [supported
13975 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13976 pub site_to_site_data_transfer: bool,
13977
13978 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13979}
13980
13981impl NextHopVPNTunnel {
13982 pub fn new() -> Self {
13983 std::default::Default::default()
13984 }
13985
13986 /// Sets the value of [uri][crate::model::NextHopVPNTunnel::uri].
13987 ///
13988 /// # Example
13989 /// ```ignore,no_run
13990 /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
13991 /// let x = NextHopVPNTunnel::new().set_uri("example");
13992 /// ```
13993 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13994 self.uri = v.into();
13995 self
13996 }
13997
13998 /// Sets the value of [vpc_network][crate::model::NextHopVPNTunnel::vpc_network].
13999 ///
14000 /// # Example
14001 /// ```ignore,no_run
14002 /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
14003 /// let x = NextHopVPNTunnel::new().set_vpc_network("example");
14004 /// ```
14005 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14006 self.vpc_network = v.into();
14007 self
14008 }
14009
14010 /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopVPNTunnel::site_to_site_data_transfer].
14011 ///
14012 /// # Example
14013 /// ```ignore,no_run
14014 /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
14015 /// let x = NextHopVPNTunnel::new().set_site_to_site_data_transfer(true);
14016 /// ```
14017 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14018 self.site_to_site_data_transfer = v.into();
14019 self
14020 }
14021}
14022
14023impl wkt::message::Message for NextHopVPNTunnel {
14024 fn typename() -> &'static str {
14025 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVPNTunnel"
14026 }
14027}
14028
14029/// A route next hop that leads to a Router appliance instance.
14030#[derive(Clone, Default, PartialEq)]
14031#[non_exhaustive]
14032pub struct NextHopRouterApplianceInstance {
14033 /// The URI of the Router appliance instance.
14034 pub uri: std::string::String,
14035
14036 /// The VPC network where this VM is located.
14037 pub vpc_network: std::string::String,
14038
14039 /// Indicates whether site-to-site data transfer is allowed for this Router
14040 /// appliance instance resource. Data transfer is available only in [supported
14041 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
14042 pub site_to_site_data_transfer: bool,
14043
14044 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14045}
14046
14047impl NextHopRouterApplianceInstance {
14048 pub fn new() -> Self {
14049 std::default::Default::default()
14050 }
14051
14052 /// Sets the value of [uri][crate::model::NextHopRouterApplianceInstance::uri].
14053 ///
14054 /// # Example
14055 /// ```ignore,no_run
14056 /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14057 /// let x = NextHopRouterApplianceInstance::new().set_uri("example");
14058 /// ```
14059 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14060 self.uri = v.into();
14061 self
14062 }
14063
14064 /// Sets the value of [vpc_network][crate::model::NextHopRouterApplianceInstance::vpc_network].
14065 ///
14066 /// # Example
14067 /// ```ignore,no_run
14068 /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14069 /// let x = NextHopRouterApplianceInstance::new().set_vpc_network("example");
14070 /// ```
14071 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14072 self.vpc_network = v.into();
14073 self
14074 }
14075
14076 /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopRouterApplianceInstance::site_to_site_data_transfer].
14077 ///
14078 /// # Example
14079 /// ```ignore,no_run
14080 /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14081 /// let x = NextHopRouterApplianceInstance::new().set_site_to_site_data_transfer(true);
14082 /// ```
14083 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14084 self.site_to_site_data_transfer = v.into();
14085 self
14086 }
14087}
14088
14089impl wkt::message::Message for NextHopRouterApplianceInstance {
14090 fn typename() -> &'static str {
14091 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance"
14092 }
14093}
14094
14095/// A route next hop that leads to an interconnect attachment resource.
14096#[derive(Clone, Default, PartialEq)]
14097#[non_exhaustive]
14098pub struct NextHopInterconnectAttachment {
14099 /// The URI of the interconnect attachment resource.
14100 pub uri: std::string::String,
14101
14102 /// The VPC network where this interconnect attachment is located.
14103 pub vpc_network: std::string::String,
14104
14105 /// Indicates whether site-to-site data transfer is allowed for this
14106 /// interconnect attachment resource. Data transfer is available only in
14107 /// [supported
14108 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
14109 pub site_to_site_data_transfer: bool,
14110
14111 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14112}
14113
14114impl NextHopInterconnectAttachment {
14115 pub fn new() -> Self {
14116 std::default::Default::default()
14117 }
14118
14119 /// Sets the value of [uri][crate::model::NextHopInterconnectAttachment::uri].
14120 ///
14121 /// # Example
14122 /// ```ignore,no_run
14123 /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14124 /// let x = NextHopInterconnectAttachment::new().set_uri("example");
14125 /// ```
14126 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14127 self.uri = v.into();
14128 self
14129 }
14130
14131 /// Sets the value of [vpc_network][crate::model::NextHopInterconnectAttachment::vpc_network].
14132 ///
14133 /// # Example
14134 /// ```ignore,no_run
14135 /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14136 /// let x = NextHopInterconnectAttachment::new().set_vpc_network("example");
14137 /// ```
14138 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14139 self.vpc_network = v.into();
14140 self
14141 }
14142
14143 /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopInterconnectAttachment::site_to_site_data_transfer].
14144 ///
14145 /// # Example
14146 /// ```ignore,no_run
14147 /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14148 /// let x = NextHopInterconnectAttachment::new().set_site_to_site_data_transfer(true);
14149 /// ```
14150 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14151 self.site_to_site_data_transfer = v.into();
14152 self
14153 }
14154}
14155
14156impl wkt::message::Message for NextHopInterconnectAttachment {
14157 fn typename() -> &'static str {
14158 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopInterconnectAttachment"
14159 }
14160}
14161
14162/// Summarizes information about the spokes associated with a hub.
14163/// The summary includes a count of spokes according to type
14164/// and according to state. If any spokes are inactive,
14165/// the summary also lists the reasons they are inactive,
14166/// including a count for each reason.
14167#[derive(Clone, Default, PartialEq)]
14168#[non_exhaustive]
14169pub struct SpokeSummary {
14170 /// Output only. Counts the number of spokes of each type that are
14171 /// associated with a specific hub.
14172 pub spoke_type_counts: std::vec::Vec<crate::model::spoke_summary::SpokeTypeCount>,
14173
14174 /// Output only. Counts the number of spokes that are in each state
14175 /// and associated with a given hub.
14176 pub spoke_state_counts: std::vec::Vec<crate::model::spoke_summary::SpokeStateCount>,
14177
14178 /// Output only. Counts the number of spokes that are inactive for each
14179 /// possible reason and associated with a given hub.
14180 pub spoke_state_reason_counts:
14181 std::vec::Vec<crate::model::spoke_summary::SpokeStateReasonCount>,
14182
14183 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14184}
14185
14186impl SpokeSummary {
14187 pub fn new() -> Self {
14188 std::default::Default::default()
14189 }
14190
14191 /// Sets the value of [spoke_type_counts][crate::model::SpokeSummary::spoke_type_counts].
14192 ///
14193 /// # Example
14194 /// ```ignore,no_run
14195 /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14196 /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14197 /// let x = SpokeSummary::new()
14198 /// .set_spoke_type_counts([
14199 /// SpokeTypeCount::default()/* use setters */,
14200 /// SpokeTypeCount::default()/* use (different) setters */,
14201 /// ]);
14202 /// ```
14203 pub fn set_spoke_type_counts<T, V>(mut self, v: T) -> Self
14204 where
14205 T: std::iter::IntoIterator<Item = V>,
14206 V: std::convert::Into<crate::model::spoke_summary::SpokeTypeCount>,
14207 {
14208 use std::iter::Iterator;
14209 self.spoke_type_counts = v.into_iter().map(|i| i.into()).collect();
14210 self
14211 }
14212
14213 /// Sets the value of [spoke_state_counts][crate::model::SpokeSummary::spoke_state_counts].
14214 ///
14215 /// # Example
14216 /// ```ignore,no_run
14217 /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14218 /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14219 /// let x = SpokeSummary::new()
14220 /// .set_spoke_state_counts([
14221 /// SpokeStateCount::default()/* use setters */,
14222 /// SpokeStateCount::default()/* use (different) setters */,
14223 /// ]);
14224 /// ```
14225 pub fn set_spoke_state_counts<T, V>(mut self, v: T) -> Self
14226 where
14227 T: std::iter::IntoIterator<Item = V>,
14228 V: std::convert::Into<crate::model::spoke_summary::SpokeStateCount>,
14229 {
14230 use std::iter::Iterator;
14231 self.spoke_state_counts = v.into_iter().map(|i| i.into()).collect();
14232 self
14233 }
14234
14235 /// Sets the value of [spoke_state_reason_counts][crate::model::SpokeSummary::spoke_state_reason_counts].
14236 ///
14237 /// # Example
14238 /// ```ignore,no_run
14239 /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14240 /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14241 /// let x = SpokeSummary::new()
14242 /// .set_spoke_state_reason_counts([
14243 /// SpokeStateReasonCount::default()/* use setters */,
14244 /// SpokeStateReasonCount::default()/* use (different) setters */,
14245 /// ]);
14246 /// ```
14247 pub fn set_spoke_state_reason_counts<T, V>(mut self, v: T) -> Self
14248 where
14249 T: std::iter::IntoIterator<Item = V>,
14250 V: std::convert::Into<crate::model::spoke_summary::SpokeStateReasonCount>,
14251 {
14252 use std::iter::Iterator;
14253 self.spoke_state_reason_counts = v.into_iter().map(|i| i.into()).collect();
14254 self
14255 }
14256}
14257
14258impl wkt::message::Message for SpokeSummary {
14259 fn typename() -> &'static str {
14260 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary"
14261 }
14262}
14263
14264/// Defines additional types related to [SpokeSummary].
14265pub mod spoke_summary {
14266 #[allow(unused_imports)]
14267 use super::*;
14268
14269 /// The number of spokes of a given type that are associated
14270 /// with a specific hub. The type indicates what kind of
14271 /// resource is associated with the spoke.
14272 #[derive(Clone, Default, PartialEq)]
14273 #[non_exhaustive]
14274 pub struct SpokeTypeCount {
14275 /// Output only. The type of the spokes.
14276 pub spoke_type: crate::model::SpokeType,
14277
14278 /// Output only. The total number of spokes of this type that are
14279 /// associated with the hub.
14280 pub count: i64,
14281
14282 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14283 }
14284
14285 impl SpokeTypeCount {
14286 pub fn new() -> Self {
14287 std::default::Default::default()
14288 }
14289
14290 /// Sets the value of [spoke_type][crate::model::spoke_summary::SpokeTypeCount::spoke_type].
14291 ///
14292 /// # Example
14293 /// ```ignore,no_run
14294 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14295 /// use google_cloud_networkconnectivity_v1::model::SpokeType;
14296 /// let x0 = SpokeTypeCount::new().set_spoke_type(SpokeType::VpnTunnel);
14297 /// let x1 = SpokeTypeCount::new().set_spoke_type(SpokeType::InterconnectAttachment);
14298 /// let x2 = SpokeTypeCount::new().set_spoke_type(SpokeType::RouterAppliance);
14299 /// ```
14300 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(
14301 mut self,
14302 v: T,
14303 ) -> Self {
14304 self.spoke_type = v.into();
14305 self
14306 }
14307
14308 /// Sets the value of [count][crate::model::spoke_summary::SpokeTypeCount::count].
14309 ///
14310 /// # Example
14311 /// ```ignore,no_run
14312 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14313 /// let x = SpokeTypeCount::new().set_count(42);
14314 /// ```
14315 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14316 self.count = v.into();
14317 self
14318 }
14319 }
14320
14321 impl wkt::message::Message for SpokeTypeCount {
14322 fn typename() -> &'static str {
14323 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"
14324 }
14325 }
14326
14327 /// The number of spokes that are in a particular state
14328 /// and associated with a given hub.
14329 #[derive(Clone, Default, PartialEq)]
14330 #[non_exhaustive]
14331 pub struct SpokeStateCount {
14332 /// Output only. The state of the spokes.
14333 pub state: crate::model::State,
14334
14335 /// Output only. The total number of spokes that are in this state
14336 /// and associated with a given hub.
14337 pub count: i64,
14338
14339 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14340 }
14341
14342 impl SpokeStateCount {
14343 pub fn new() -> Self {
14344 std::default::Default::default()
14345 }
14346
14347 /// Sets the value of [state][crate::model::spoke_summary::SpokeStateCount::state].
14348 ///
14349 /// # Example
14350 /// ```ignore,no_run
14351 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14352 /// use google_cloud_networkconnectivity_v1::model::State;
14353 /// let x0 = SpokeStateCount::new().set_state(State::Creating);
14354 /// let x1 = SpokeStateCount::new().set_state(State::Active);
14355 /// let x2 = SpokeStateCount::new().set_state(State::Deleting);
14356 /// ```
14357 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
14358 self.state = v.into();
14359 self
14360 }
14361
14362 /// Sets the value of [count][crate::model::spoke_summary::SpokeStateCount::count].
14363 ///
14364 /// # Example
14365 /// ```ignore,no_run
14366 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14367 /// let x = SpokeStateCount::new().set_count(42);
14368 /// ```
14369 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14370 self.count = v.into();
14371 self
14372 }
14373 }
14374
14375 impl wkt::message::Message for SpokeStateCount {
14376 fn typename() -> &'static str {
14377 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"
14378 }
14379 }
14380
14381 /// The number of spokes in the hub that are inactive for this reason.
14382 #[derive(Clone, Default, PartialEq)]
14383 #[non_exhaustive]
14384 pub struct SpokeStateReasonCount {
14385 /// Output only. The reason that a spoke is inactive.
14386 pub state_reason_code: crate::model::spoke::state_reason::Code,
14387
14388 /// Output only. The total number of spokes that are inactive for a
14389 /// particular reason and associated with a given hub.
14390 pub count: i64,
14391
14392 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14393 }
14394
14395 impl SpokeStateReasonCount {
14396 pub fn new() -> Self {
14397 std::default::Default::default()
14398 }
14399
14400 /// Sets the value of [state_reason_code][crate::model::spoke_summary::SpokeStateReasonCount::state_reason_code].
14401 ///
14402 /// # Example
14403 /// ```ignore,no_run
14404 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14405 /// use google_cloud_networkconnectivity_v1::model::spoke::state_reason::Code;
14406 /// let x0 = SpokeStateReasonCount::new().set_state_reason_code(Code::PendingReview);
14407 /// let x1 = SpokeStateReasonCount::new().set_state_reason_code(Code::Rejected);
14408 /// let x2 = SpokeStateReasonCount::new().set_state_reason_code(Code::Paused);
14409 /// ```
14410 pub fn set_state_reason_code<
14411 T: std::convert::Into<crate::model::spoke::state_reason::Code>,
14412 >(
14413 mut self,
14414 v: T,
14415 ) -> Self {
14416 self.state_reason_code = v.into();
14417 self
14418 }
14419
14420 /// Sets the value of [count][crate::model::spoke_summary::SpokeStateReasonCount::count].
14421 ///
14422 /// # Example
14423 /// ```ignore,no_run
14424 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14425 /// let x = SpokeStateReasonCount::new().set_count(42);
14426 /// ```
14427 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14428 self.count = v.into();
14429 self
14430 }
14431 }
14432
14433 impl wkt::message::Message for SpokeStateReasonCount {
14434 fn typename() -> &'static str {
14435 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"
14436 }
14437 }
14438}
14439
14440/// The request for
14441/// [HubService.GetGroup][google.cloud.networkconnectivity.v1.HubService.GetGroup].
14442///
14443/// [google.cloud.networkconnectivity.v1.HubService.GetGroup]: crate::client::HubService::get_group
14444#[derive(Clone, Default, PartialEq)]
14445#[non_exhaustive]
14446pub struct GetGroupRequest {
14447 /// Required. The name of the route table resource.
14448 pub name: std::string::String,
14449
14450 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14451}
14452
14453impl GetGroupRequest {
14454 pub fn new() -> Self {
14455 std::default::Default::default()
14456 }
14457
14458 /// Sets the value of [name][crate::model::GetGroupRequest::name].
14459 ///
14460 /// # Example
14461 /// ```ignore,no_run
14462 /// # use google_cloud_networkconnectivity_v1::model::GetGroupRequest;
14463 /// let x = GetGroupRequest::new().set_name("example");
14464 /// ```
14465 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14466 self.name = v.into();
14467 self
14468 }
14469}
14470
14471impl wkt::message::Message for GetGroupRequest {
14472 fn typename() -> &'static str {
14473 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetGroupRequest"
14474 }
14475}
14476
14477/// Request for
14478/// [HubService.UpdateGroup][google.cloud.networkconnectivity.v1.HubService.UpdateGroup]
14479/// method.
14480///
14481/// [google.cloud.networkconnectivity.v1.HubService.UpdateGroup]: crate::client::HubService::update_group
14482#[derive(Clone, Default, PartialEq)]
14483#[non_exhaustive]
14484pub struct UpdateGroupRequest {
14485 /// Optional. In the case of an update to an existing group, field mask is used
14486 /// to specify the fields to be overwritten. The fields specified in the
14487 /// update_mask are relative to the resource, not the full request. A field is
14488 /// overwritten if it is in the mask. If the user does not provide a mask, then
14489 /// all fields are overwritten.
14490 pub update_mask: std::option::Option<wkt::FieldMask>,
14491
14492 /// Required. The state that the group should be in after the update.
14493 pub group: std::option::Option<crate::model::Group>,
14494
14495 /// Optional. A request ID to identify requests. Specify a unique request ID so
14496 /// that if you must retry your request, the server knows to ignore the request
14497 /// if it has already been completed. The server guarantees that a request
14498 /// doesn't result in creation of duplicate commitments for at least 60
14499 /// minutes.
14500 ///
14501 /// For example, consider a situation where you make an initial request and
14502 /// the request times out. If you make the request again with the same request
14503 /// ID, the server can check to see whether the original operation
14504 /// was received. If it was, the server ignores the second request. This
14505 /// behavior prevents clients from mistakenly creating duplicate commitments.
14506 ///
14507 /// The request ID must be a valid UUID, with the exception that zero UUID is
14508 /// not supported (00000000-0000-0000-0000-000000000000).
14509 pub request_id: std::string::String,
14510
14511 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14512}
14513
14514impl UpdateGroupRequest {
14515 pub fn new() -> Self {
14516 std::default::Default::default()
14517 }
14518
14519 /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
14520 ///
14521 /// # Example
14522 /// ```ignore,no_run
14523 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14524 /// use wkt::FieldMask;
14525 /// let x = UpdateGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
14526 /// ```
14527 pub fn set_update_mask<T>(mut self, v: T) -> Self
14528 where
14529 T: std::convert::Into<wkt::FieldMask>,
14530 {
14531 self.update_mask = std::option::Option::Some(v.into());
14532 self
14533 }
14534
14535 /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
14536 ///
14537 /// # Example
14538 /// ```ignore,no_run
14539 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14540 /// use wkt::FieldMask;
14541 /// let x = UpdateGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
14542 /// let x = UpdateGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
14543 /// ```
14544 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14545 where
14546 T: std::convert::Into<wkt::FieldMask>,
14547 {
14548 self.update_mask = v.map(|x| x.into());
14549 self
14550 }
14551
14552 /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
14553 ///
14554 /// # Example
14555 /// ```ignore,no_run
14556 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14557 /// use google_cloud_networkconnectivity_v1::model::Group;
14558 /// let x = UpdateGroupRequest::new().set_group(Group::default()/* use setters */);
14559 /// ```
14560 pub fn set_group<T>(mut self, v: T) -> Self
14561 where
14562 T: std::convert::Into<crate::model::Group>,
14563 {
14564 self.group = std::option::Option::Some(v.into());
14565 self
14566 }
14567
14568 /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
14569 ///
14570 /// # Example
14571 /// ```ignore,no_run
14572 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14573 /// use google_cloud_networkconnectivity_v1::model::Group;
14574 /// let x = UpdateGroupRequest::new().set_or_clear_group(Some(Group::default()/* use setters */));
14575 /// let x = UpdateGroupRequest::new().set_or_clear_group(None::<Group>);
14576 /// ```
14577 pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
14578 where
14579 T: std::convert::Into<crate::model::Group>,
14580 {
14581 self.group = v.map(|x| x.into());
14582 self
14583 }
14584
14585 /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
14586 ///
14587 /// # Example
14588 /// ```ignore,no_run
14589 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14590 /// let x = UpdateGroupRequest::new().set_request_id("example");
14591 /// ```
14592 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14593 self.request_id = v.into();
14594 self
14595 }
14596}
14597
14598impl wkt::message::Message for UpdateGroupRequest {
14599 fn typename() -> &'static str {
14600 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateGroupRequest"
14601 }
14602}
14603
14604/// The internal range resource for IPAM operations within a VPC network.
14605/// Used to represent a private address range along with behavioral
14606/// characteristics of that range (its usage and peering behavior).
14607/// Networking resources can link to this range if they are created
14608/// as belonging to it.
14609#[derive(Clone, Default, PartialEq)]
14610#[non_exhaustive]
14611pub struct InternalRange {
14612 /// Identifier. The name of an internal range.
14613 /// Format:
14614 /// projects/{project}/locations/{location}/internalRanges/{internal_range}
14615 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
14616 pub name: std::string::String,
14617
14618 /// Time when the internal range was created.
14619 pub create_time: std::option::Option<wkt::Timestamp>,
14620
14621 /// Time when the internal range was updated.
14622 pub update_time: std::option::Option<wkt::Timestamp>,
14623
14624 /// User-defined labels.
14625 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14626
14627 /// Optional. A description of this resource.
14628 pub description: std::string::String,
14629
14630 /// Optional. The IP range that this internal range defines.
14631 /// NOTE: IPv6 ranges are limited to usage=EXTERNAL_TO_VPC and
14632 /// peering=FOR_SELF.
14633 /// NOTE: For IPv6 Ranges this field is compulsory, i.e. the address range must
14634 /// be specified explicitly.
14635 pub ip_cidr_range: std::string::String,
14636
14637 /// Immutable. The URL or resource ID of the network in which to reserve the
14638 /// internal range. The network cannot be deleted if there are any reserved
14639 /// internal ranges referring to it. Legacy networks are not supported. For
14640 /// example:
14641 /// <https://www.googleapis.com/compute/v1/projects/{project}/locations/global/networks/{network}>
14642 /// projects/{project}/locations/global/networks/{network}
14643 /// {network}
14644 pub network: std::string::String,
14645
14646 /// Optional. The type of usage set for this InternalRange.
14647 pub usage: crate::model::internal_range::Usage,
14648
14649 /// Optional. The type of peering set for this internal range.
14650 pub peering: crate::model::internal_range::Peering,
14651
14652 /// Optional. An alternate to ip_cidr_range. Can be set when trying to create
14653 /// an IPv4 reservation that automatically finds a free range of the given
14654 /// size. If both ip_cidr_range and prefix_length are set, there is an error if
14655 /// the range sizes do not match. Can also be used during updates to change the
14656 /// range size.
14657 /// NOTE: For IPv6 this field only works if ip_cidr_range is set as well, and
14658 /// both fields must match. In other words, with IPv6 this field only works as
14659 /// a redundant parameter.
14660 pub prefix_length: i32,
14661
14662 /// Optional. Can be set to narrow down or pick a different address space while
14663 /// searching for a free range. If not set, defaults to the "10.0.0.0/8"
14664 /// address space. This can be used to search in other rfc-1918 address
14665 /// spaces like "172.16.0.0/12" and "192.168.0.0/16" or non-rfc-1918
14666 /// address spaces used in the VPC.
14667 pub target_cidr_range: std::vec::Vec<std::string::String>,
14668
14669 /// Output only. The list of resources that refer to this internal range.
14670 /// Resources that use the internal range for their range allocation
14671 /// are referred to as users of the range. Other resources mark themselves
14672 /// as users while doing so by creating a reference to this internal range.
14673 /// Having a user, based on this reference, prevents deletion of the
14674 /// internal range referred to. Can be empty.
14675 pub users: std::vec::Vec<std::string::String>,
14676
14677 /// Optional. Types of resources that are allowed to overlap with the current
14678 /// internal range.
14679 pub overlaps: std::vec::Vec<crate::model::internal_range::Overlap>,
14680
14681 /// Optional. Must be present if usage is set to FOR_MIGRATION.
14682 pub migration: std::option::Option<crate::model::internal_range::Migration>,
14683
14684 /// Optional. Immutable ranges cannot have their fields modified, except for
14685 /// labels and description.
14686 pub immutable: bool,
14687
14688 /// Optional. Range auto-allocation options, may be set only when
14689 /// auto-allocation is selected by not setting ip_cidr_range (and setting
14690 /// prefix_length).
14691 pub allocation_options: std::option::Option<crate::model::internal_range::AllocationOptions>,
14692
14693 /// Optional. ExcludeCidrRanges flag. Specifies a set of CIDR blocks that
14694 /// allows exclusion of particular CIDR ranges from the auto-allocation
14695 /// process, without having to reserve these blocks
14696 pub exclude_cidr_ranges: std::vec::Vec<std::string::String>,
14697
14698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14699}
14700
14701impl InternalRange {
14702 pub fn new() -> Self {
14703 std::default::Default::default()
14704 }
14705
14706 /// Sets the value of [name][crate::model::InternalRange::name].
14707 ///
14708 /// # Example
14709 /// ```ignore,no_run
14710 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14711 /// let x = InternalRange::new().set_name("example");
14712 /// ```
14713 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14714 self.name = v.into();
14715 self
14716 }
14717
14718 /// Sets the value of [create_time][crate::model::InternalRange::create_time].
14719 ///
14720 /// # Example
14721 /// ```ignore,no_run
14722 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14723 /// use wkt::Timestamp;
14724 /// let x = InternalRange::new().set_create_time(Timestamp::default()/* use setters */);
14725 /// ```
14726 pub fn set_create_time<T>(mut self, v: T) -> Self
14727 where
14728 T: std::convert::Into<wkt::Timestamp>,
14729 {
14730 self.create_time = std::option::Option::Some(v.into());
14731 self
14732 }
14733
14734 /// Sets or clears the value of [create_time][crate::model::InternalRange::create_time].
14735 ///
14736 /// # Example
14737 /// ```ignore,no_run
14738 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14739 /// use wkt::Timestamp;
14740 /// let x = InternalRange::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14741 /// let x = InternalRange::new().set_or_clear_create_time(None::<Timestamp>);
14742 /// ```
14743 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14744 where
14745 T: std::convert::Into<wkt::Timestamp>,
14746 {
14747 self.create_time = v.map(|x| x.into());
14748 self
14749 }
14750
14751 /// Sets the value of [update_time][crate::model::InternalRange::update_time].
14752 ///
14753 /// # Example
14754 /// ```ignore,no_run
14755 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14756 /// use wkt::Timestamp;
14757 /// let x = InternalRange::new().set_update_time(Timestamp::default()/* use setters */);
14758 /// ```
14759 pub fn set_update_time<T>(mut self, v: T) -> Self
14760 where
14761 T: std::convert::Into<wkt::Timestamp>,
14762 {
14763 self.update_time = std::option::Option::Some(v.into());
14764 self
14765 }
14766
14767 /// Sets or clears the value of [update_time][crate::model::InternalRange::update_time].
14768 ///
14769 /// # Example
14770 /// ```ignore,no_run
14771 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14772 /// use wkt::Timestamp;
14773 /// let x = InternalRange::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14774 /// let x = InternalRange::new().set_or_clear_update_time(None::<Timestamp>);
14775 /// ```
14776 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14777 where
14778 T: std::convert::Into<wkt::Timestamp>,
14779 {
14780 self.update_time = v.map(|x| x.into());
14781 self
14782 }
14783
14784 /// Sets the value of [labels][crate::model::InternalRange::labels].
14785 ///
14786 /// # Example
14787 /// ```ignore,no_run
14788 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14789 /// let x = InternalRange::new().set_labels([
14790 /// ("key0", "abc"),
14791 /// ("key1", "xyz"),
14792 /// ]);
14793 /// ```
14794 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14795 where
14796 T: std::iter::IntoIterator<Item = (K, V)>,
14797 K: std::convert::Into<std::string::String>,
14798 V: std::convert::Into<std::string::String>,
14799 {
14800 use std::iter::Iterator;
14801 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14802 self
14803 }
14804
14805 /// Sets the value of [description][crate::model::InternalRange::description].
14806 ///
14807 /// # Example
14808 /// ```ignore,no_run
14809 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14810 /// let x = InternalRange::new().set_description("example");
14811 /// ```
14812 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14813 self.description = v.into();
14814 self
14815 }
14816
14817 /// Sets the value of [ip_cidr_range][crate::model::InternalRange::ip_cidr_range].
14818 ///
14819 /// # Example
14820 /// ```ignore,no_run
14821 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14822 /// let x = InternalRange::new().set_ip_cidr_range("example");
14823 /// ```
14824 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14825 self.ip_cidr_range = v.into();
14826 self
14827 }
14828
14829 /// Sets the value of [network][crate::model::InternalRange::network].
14830 ///
14831 /// # Example
14832 /// ```ignore,no_run
14833 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14834 /// let x = InternalRange::new().set_network("example");
14835 /// ```
14836 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14837 self.network = v.into();
14838 self
14839 }
14840
14841 /// Sets the value of [usage][crate::model::InternalRange::usage].
14842 ///
14843 /// # Example
14844 /// ```ignore,no_run
14845 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14846 /// use google_cloud_networkconnectivity_v1::model::internal_range::Usage;
14847 /// let x0 = InternalRange::new().set_usage(Usage::ForVpc);
14848 /// let x1 = InternalRange::new().set_usage(Usage::ExternalToVpc);
14849 /// let x2 = InternalRange::new().set_usage(Usage::ForMigration);
14850 /// ```
14851 pub fn set_usage<T: std::convert::Into<crate::model::internal_range::Usage>>(
14852 mut self,
14853 v: T,
14854 ) -> Self {
14855 self.usage = v.into();
14856 self
14857 }
14858
14859 /// Sets the value of [peering][crate::model::InternalRange::peering].
14860 ///
14861 /// # Example
14862 /// ```ignore,no_run
14863 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14864 /// use google_cloud_networkconnectivity_v1::model::internal_range::Peering;
14865 /// let x0 = InternalRange::new().set_peering(Peering::ForSelf);
14866 /// let x1 = InternalRange::new().set_peering(Peering::ForPeer);
14867 /// let x2 = InternalRange::new().set_peering(Peering::NotShared);
14868 /// ```
14869 pub fn set_peering<T: std::convert::Into<crate::model::internal_range::Peering>>(
14870 mut self,
14871 v: T,
14872 ) -> Self {
14873 self.peering = v.into();
14874 self
14875 }
14876
14877 /// Sets the value of [prefix_length][crate::model::InternalRange::prefix_length].
14878 ///
14879 /// # Example
14880 /// ```ignore,no_run
14881 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14882 /// let x = InternalRange::new().set_prefix_length(42);
14883 /// ```
14884 pub fn set_prefix_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14885 self.prefix_length = v.into();
14886 self
14887 }
14888
14889 /// Sets the value of [target_cidr_range][crate::model::InternalRange::target_cidr_range].
14890 ///
14891 /// # Example
14892 /// ```ignore,no_run
14893 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14894 /// let x = InternalRange::new().set_target_cidr_range(["a", "b", "c"]);
14895 /// ```
14896 pub fn set_target_cidr_range<T, V>(mut self, v: T) -> Self
14897 where
14898 T: std::iter::IntoIterator<Item = V>,
14899 V: std::convert::Into<std::string::String>,
14900 {
14901 use std::iter::Iterator;
14902 self.target_cidr_range = v.into_iter().map(|i| i.into()).collect();
14903 self
14904 }
14905
14906 /// Sets the value of [users][crate::model::InternalRange::users].
14907 ///
14908 /// # Example
14909 /// ```ignore,no_run
14910 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14911 /// let x = InternalRange::new().set_users(["a", "b", "c"]);
14912 /// ```
14913 pub fn set_users<T, V>(mut self, v: T) -> Self
14914 where
14915 T: std::iter::IntoIterator<Item = V>,
14916 V: std::convert::Into<std::string::String>,
14917 {
14918 use std::iter::Iterator;
14919 self.users = v.into_iter().map(|i| i.into()).collect();
14920 self
14921 }
14922
14923 /// Sets the value of [overlaps][crate::model::InternalRange::overlaps].
14924 ///
14925 /// # Example
14926 /// ```ignore,no_run
14927 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14928 /// use google_cloud_networkconnectivity_v1::model::internal_range::Overlap;
14929 /// let x = InternalRange::new().set_overlaps([
14930 /// Overlap::RouteRange,
14931 /// Overlap::ExistingSubnetRange,
14932 /// ]);
14933 /// ```
14934 pub fn set_overlaps<T, V>(mut self, v: T) -> Self
14935 where
14936 T: std::iter::IntoIterator<Item = V>,
14937 V: std::convert::Into<crate::model::internal_range::Overlap>,
14938 {
14939 use std::iter::Iterator;
14940 self.overlaps = v.into_iter().map(|i| i.into()).collect();
14941 self
14942 }
14943
14944 /// Sets the value of [migration][crate::model::InternalRange::migration].
14945 ///
14946 /// # Example
14947 /// ```ignore,no_run
14948 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14949 /// use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
14950 /// let x = InternalRange::new().set_migration(Migration::default()/* use setters */);
14951 /// ```
14952 pub fn set_migration<T>(mut self, v: T) -> Self
14953 where
14954 T: std::convert::Into<crate::model::internal_range::Migration>,
14955 {
14956 self.migration = std::option::Option::Some(v.into());
14957 self
14958 }
14959
14960 /// Sets or clears the value of [migration][crate::model::InternalRange::migration].
14961 ///
14962 /// # Example
14963 /// ```ignore,no_run
14964 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14965 /// use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
14966 /// let x = InternalRange::new().set_or_clear_migration(Some(Migration::default()/* use setters */));
14967 /// let x = InternalRange::new().set_or_clear_migration(None::<Migration>);
14968 /// ```
14969 pub fn set_or_clear_migration<T>(mut self, v: std::option::Option<T>) -> Self
14970 where
14971 T: std::convert::Into<crate::model::internal_range::Migration>,
14972 {
14973 self.migration = v.map(|x| x.into());
14974 self
14975 }
14976
14977 /// Sets the value of [immutable][crate::model::InternalRange::immutable].
14978 ///
14979 /// # Example
14980 /// ```ignore,no_run
14981 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14982 /// let x = InternalRange::new().set_immutable(true);
14983 /// ```
14984 pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14985 self.immutable = v.into();
14986 self
14987 }
14988
14989 /// Sets the value of [allocation_options][crate::model::InternalRange::allocation_options].
14990 ///
14991 /// # Example
14992 /// ```ignore,no_run
14993 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14994 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
14995 /// let x = InternalRange::new().set_allocation_options(AllocationOptions::default()/* use setters */);
14996 /// ```
14997 pub fn set_allocation_options<T>(mut self, v: T) -> Self
14998 where
14999 T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
15000 {
15001 self.allocation_options = std::option::Option::Some(v.into());
15002 self
15003 }
15004
15005 /// Sets or clears the value of [allocation_options][crate::model::InternalRange::allocation_options].
15006 ///
15007 /// # Example
15008 /// ```ignore,no_run
15009 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15010 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15011 /// let x = InternalRange::new().set_or_clear_allocation_options(Some(AllocationOptions::default()/* use setters */));
15012 /// let x = InternalRange::new().set_or_clear_allocation_options(None::<AllocationOptions>);
15013 /// ```
15014 pub fn set_or_clear_allocation_options<T>(mut self, v: std::option::Option<T>) -> Self
15015 where
15016 T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
15017 {
15018 self.allocation_options = v.map(|x| x.into());
15019 self
15020 }
15021
15022 /// Sets the value of [exclude_cidr_ranges][crate::model::InternalRange::exclude_cidr_ranges].
15023 ///
15024 /// # Example
15025 /// ```ignore,no_run
15026 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15027 /// let x = InternalRange::new().set_exclude_cidr_ranges(["a", "b", "c"]);
15028 /// ```
15029 pub fn set_exclude_cidr_ranges<T, V>(mut self, v: T) -> Self
15030 where
15031 T: std::iter::IntoIterator<Item = V>,
15032 V: std::convert::Into<std::string::String>,
15033 {
15034 use std::iter::Iterator;
15035 self.exclude_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
15036 self
15037 }
15038}
15039
15040impl wkt::message::Message for InternalRange {
15041 fn typename() -> &'static str {
15042 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange"
15043 }
15044}
15045
15046/// Defines additional types related to [InternalRange].
15047pub mod internal_range {
15048 #[allow(unused_imports)]
15049 use super::*;
15050
15051 /// Specification for migration with source and target resource names.
15052 #[derive(Clone, Default, PartialEq)]
15053 #[non_exhaustive]
15054 pub struct Migration {
15055 /// Immutable. Resource path as an URI of the source resource, for example a
15056 /// subnet. The project for the source resource should match the project for
15057 /// the InternalRange. An example:
15058 /// /projects/{project}/regions/{region}/subnetworks/{subnet}
15059 pub source: std::string::String,
15060
15061 /// Immutable. Resource path of the target resource. The target project can
15062 /// be different, as in the cases when migrating to peer networks. For
15063 /// example:
15064 /// /projects/{project}/regions/{region}/subnetworks/{subnet}
15065 pub target: std::string::String,
15066
15067 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15068 }
15069
15070 impl Migration {
15071 pub fn new() -> Self {
15072 std::default::Default::default()
15073 }
15074
15075 /// Sets the value of [source][crate::model::internal_range::Migration::source].
15076 ///
15077 /// # Example
15078 /// ```ignore,no_run
15079 /// # use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15080 /// let x = Migration::new().set_source("example");
15081 /// ```
15082 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15083 self.source = v.into();
15084 self
15085 }
15086
15087 /// Sets the value of [target][crate::model::internal_range::Migration::target].
15088 ///
15089 /// # Example
15090 /// ```ignore,no_run
15091 /// # use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15092 /// let x = Migration::new().set_target("example");
15093 /// ```
15094 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15095 self.target = v.into();
15096 self
15097 }
15098 }
15099
15100 impl wkt::message::Message for Migration {
15101 fn typename() -> &'static str {
15102 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.Migration"
15103 }
15104 }
15105
15106 /// Range auto-allocation options, to be optionally used when CIDR block is not
15107 /// explicitly set.
15108 #[derive(Clone, Default, PartialEq)]
15109 #[non_exhaustive]
15110 pub struct AllocationOptions {
15111 /// Optional. Allocation strategy Not setting this field when the allocation
15112 /// is requested means an implementation defined strategy is used.
15113 pub allocation_strategy: crate::model::internal_range::AllocationStrategy,
15114
15115 /// Optional. This field must be set only when allocation_strategy is set to
15116 /// RANDOM_FIRST_N_AVAILABLE.
15117 /// The value should be the maximum expected parallelism of range creation
15118 /// requests issued to the same space of peered netwroks.
15119 pub first_available_ranges_lookup_size: i32,
15120
15121 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15122 }
15123
15124 impl AllocationOptions {
15125 pub fn new() -> Self {
15126 std::default::Default::default()
15127 }
15128
15129 /// Sets the value of [allocation_strategy][crate::model::internal_range::AllocationOptions::allocation_strategy].
15130 ///
15131 /// # Example
15132 /// ```ignore,no_run
15133 /// # use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15134 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationStrategy;
15135 /// let x0 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::Random);
15136 /// let x1 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::FirstAvailable);
15137 /// let x2 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::RandomFirstNAvailable);
15138 /// ```
15139 pub fn set_allocation_strategy<
15140 T: std::convert::Into<crate::model::internal_range::AllocationStrategy>,
15141 >(
15142 mut self,
15143 v: T,
15144 ) -> Self {
15145 self.allocation_strategy = v.into();
15146 self
15147 }
15148
15149 /// Sets the value of [first_available_ranges_lookup_size][crate::model::internal_range::AllocationOptions::first_available_ranges_lookup_size].
15150 ///
15151 /// # Example
15152 /// ```ignore,no_run
15153 /// # use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15154 /// let x = AllocationOptions::new().set_first_available_ranges_lookup_size(42);
15155 /// ```
15156 pub fn set_first_available_ranges_lookup_size<T: std::convert::Into<i32>>(
15157 mut self,
15158 v: T,
15159 ) -> Self {
15160 self.first_available_ranges_lookup_size = v.into();
15161 self
15162 }
15163 }
15164
15165 impl wkt::message::Message for AllocationOptions {
15166 fn typename() -> &'static str {
15167 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.AllocationOptions"
15168 }
15169 }
15170
15171 /// Possible usage of an internal range.
15172 ///
15173 /// # Working with unknown values
15174 ///
15175 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15176 /// additional enum variants at any time. Adding new variants is not considered
15177 /// a breaking change. Applications should write their code in anticipation of:
15178 ///
15179 /// - New values appearing in future releases of the client library, **and**
15180 /// - New values received dynamically, without application changes.
15181 ///
15182 /// Please consult the [Working with enums] section in the user guide for some
15183 /// guidelines.
15184 ///
15185 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15186 #[derive(Clone, Debug, PartialEq)]
15187 #[non_exhaustive]
15188 pub enum Usage {
15189 /// Unspecified usage is allowed in calls which identify the resource by
15190 /// other fields and do not need Usage set to complete. These are, i.e.:
15191 /// GetInternalRange and DeleteInternalRange.
15192 /// Usage needs to be specified explicitly in CreateInternalRange
15193 /// or UpdateInternalRange calls.
15194 Unspecified,
15195 /// A VPC resource can use the reserved CIDR block by associating it with the
15196 /// internal range resource if usage is set to FOR_VPC.
15197 ForVpc,
15198 /// Ranges created with EXTERNAL_TO_VPC cannot be associated with VPC
15199 /// resources and are meant to block out address ranges for various use
15200 /// cases, like for example, usage on-prem, with dynamic route announcements
15201 /// via interconnect.
15202 ExternalToVpc,
15203 /// Ranges created FOR_MIGRATION can be used to lock a CIDR range between a
15204 /// source and target subnet. If usage is set to FOR_MIGRATION, the peering
15205 /// value has to be set to FOR_SELF or default to FOR_SELF when unset.
15206 ForMigration,
15207 /// If set, the enum was initialized with an unknown value.
15208 ///
15209 /// Applications can examine the value using [Usage::value] or
15210 /// [Usage::name].
15211 UnknownValue(usage::UnknownValue),
15212 }
15213
15214 #[doc(hidden)]
15215 pub mod usage {
15216 #[allow(unused_imports)]
15217 use super::*;
15218 #[derive(Clone, Debug, PartialEq)]
15219 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15220 }
15221
15222 impl Usage {
15223 /// Gets the enum value.
15224 ///
15225 /// Returns `None` if the enum contains an unknown value deserialized from
15226 /// the string representation of enums.
15227 pub fn value(&self) -> std::option::Option<i32> {
15228 match self {
15229 Self::Unspecified => std::option::Option::Some(0),
15230 Self::ForVpc => std::option::Option::Some(1),
15231 Self::ExternalToVpc => std::option::Option::Some(2),
15232 Self::ForMigration => std::option::Option::Some(3),
15233 Self::UnknownValue(u) => u.0.value(),
15234 }
15235 }
15236
15237 /// Gets the enum value as a string.
15238 ///
15239 /// Returns `None` if the enum contains an unknown value deserialized from
15240 /// the integer representation of enums.
15241 pub fn name(&self) -> std::option::Option<&str> {
15242 match self {
15243 Self::Unspecified => std::option::Option::Some("USAGE_UNSPECIFIED"),
15244 Self::ForVpc => std::option::Option::Some("FOR_VPC"),
15245 Self::ExternalToVpc => std::option::Option::Some("EXTERNAL_TO_VPC"),
15246 Self::ForMigration => std::option::Option::Some("FOR_MIGRATION"),
15247 Self::UnknownValue(u) => u.0.name(),
15248 }
15249 }
15250 }
15251
15252 impl std::default::Default for Usage {
15253 fn default() -> Self {
15254 use std::convert::From;
15255 Self::from(0)
15256 }
15257 }
15258
15259 impl std::fmt::Display for Usage {
15260 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15261 wkt::internal::display_enum(f, self.name(), self.value())
15262 }
15263 }
15264
15265 impl std::convert::From<i32> for Usage {
15266 fn from(value: i32) -> Self {
15267 match value {
15268 0 => Self::Unspecified,
15269 1 => Self::ForVpc,
15270 2 => Self::ExternalToVpc,
15271 3 => Self::ForMigration,
15272 _ => Self::UnknownValue(usage::UnknownValue(
15273 wkt::internal::UnknownEnumValue::Integer(value),
15274 )),
15275 }
15276 }
15277 }
15278
15279 impl std::convert::From<&str> for Usage {
15280 fn from(value: &str) -> Self {
15281 use std::string::ToString;
15282 match value {
15283 "USAGE_UNSPECIFIED" => Self::Unspecified,
15284 "FOR_VPC" => Self::ForVpc,
15285 "EXTERNAL_TO_VPC" => Self::ExternalToVpc,
15286 "FOR_MIGRATION" => Self::ForMigration,
15287 _ => Self::UnknownValue(usage::UnknownValue(
15288 wkt::internal::UnknownEnumValue::String(value.to_string()),
15289 )),
15290 }
15291 }
15292 }
15293
15294 impl serde::ser::Serialize for Usage {
15295 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15296 where
15297 S: serde::Serializer,
15298 {
15299 match self {
15300 Self::Unspecified => serializer.serialize_i32(0),
15301 Self::ForVpc => serializer.serialize_i32(1),
15302 Self::ExternalToVpc => serializer.serialize_i32(2),
15303 Self::ForMigration => serializer.serialize_i32(3),
15304 Self::UnknownValue(u) => u.0.serialize(serializer),
15305 }
15306 }
15307 }
15308
15309 impl<'de> serde::de::Deserialize<'de> for Usage {
15310 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15311 where
15312 D: serde::Deserializer<'de>,
15313 {
15314 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Usage>::new(
15315 ".google.cloud.networkconnectivity.v1.InternalRange.Usage",
15316 ))
15317 }
15318 }
15319
15320 /// Peering type.
15321 ///
15322 /// # Working with unknown values
15323 ///
15324 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15325 /// additional enum variants at any time. Adding new variants is not considered
15326 /// a breaking change. Applications should write their code in anticipation of:
15327 ///
15328 /// - New values appearing in future releases of the client library, **and**
15329 /// - New values received dynamically, without application changes.
15330 ///
15331 /// Please consult the [Working with enums] section in the user guide for some
15332 /// guidelines.
15333 ///
15334 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15335 #[derive(Clone, Debug, PartialEq)]
15336 #[non_exhaustive]
15337 pub enum Peering {
15338 /// If Peering is left unspecified in CreateInternalRange or
15339 /// UpdateInternalRange, it will be defaulted to FOR_SELF.
15340 Unspecified,
15341 /// This is the default behavior and represents the case that this
15342 /// internal range is intended to be used in the VPC in which it is created
15343 /// and is accessible from its peers. This implies that peers or
15344 /// peers-of-peers cannot use this range.
15345 ForSelf,
15346 /// This behavior can be set when the internal range is being reserved for
15347 /// usage by peers. This means that no resource within the VPC in which
15348 /// it is being created can use this to associate with a VPC resource, but
15349 /// one of the peers can. This represents donating a range for peers to
15350 /// use.
15351 ForPeer,
15352 /// This behavior can be set when the internal range is being reserved for
15353 /// usage by the VPC in which it is created, but not shared with peers.
15354 /// In a sense, it is local to the VPC. This can be used to create internal
15355 /// ranges for various purposes like HTTP_INTERNAL_LOAD_BALANCER or for
15356 /// Interconnect routes that are not shared with peers. This also implies
15357 /// that peers cannot use this range in a way that is visible to this VPC,
15358 /// but can re-use this range as long as it is NOT_SHARED from the peer VPC,
15359 /// too.
15360 NotShared,
15361 /// If set, the enum was initialized with an unknown value.
15362 ///
15363 /// Applications can examine the value using [Peering::value] or
15364 /// [Peering::name].
15365 UnknownValue(peering::UnknownValue),
15366 }
15367
15368 #[doc(hidden)]
15369 pub mod peering {
15370 #[allow(unused_imports)]
15371 use super::*;
15372 #[derive(Clone, Debug, PartialEq)]
15373 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15374 }
15375
15376 impl Peering {
15377 /// Gets the enum value.
15378 ///
15379 /// Returns `None` if the enum contains an unknown value deserialized from
15380 /// the string representation of enums.
15381 pub fn value(&self) -> std::option::Option<i32> {
15382 match self {
15383 Self::Unspecified => std::option::Option::Some(0),
15384 Self::ForSelf => std::option::Option::Some(1),
15385 Self::ForPeer => std::option::Option::Some(2),
15386 Self::NotShared => std::option::Option::Some(3),
15387 Self::UnknownValue(u) => u.0.value(),
15388 }
15389 }
15390
15391 /// Gets the enum value as a string.
15392 ///
15393 /// Returns `None` if the enum contains an unknown value deserialized from
15394 /// the integer representation of enums.
15395 pub fn name(&self) -> std::option::Option<&str> {
15396 match self {
15397 Self::Unspecified => std::option::Option::Some("PEERING_UNSPECIFIED"),
15398 Self::ForSelf => std::option::Option::Some("FOR_SELF"),
15399 Self::ForPeer => std::option::Option::Some("FOR_PEER"),
15400 Self::NotShared => std::option::Option::Some("NOT_SHARED"),
15401 Self::UnknownValue(u) => u.0.name(),
15402 }
15403 }
15404 }
15405
15406 impl std::default::Default for Peering {
15407 fn default() -> Self {
15408 use std::convert::From;
15409 Self::from(0)
15410 }
15411 }
15412
15413 impl std::fmt::Display for Peering {
15414 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15415 wkt::internal::display_enum(f, self.name(), self.value())
15416 }
15417 }
15418
15419 impl std::convert::From<i32> for Peering {
15420 fn from(value: i32) -> Self {
15421 match value {
15422 0 => Self::Unspecified,
15423 1 => Self::ForSelf,
15424 2 => Self::ForPeer,
15425 3 => Self::NotShared,
15426 _ => Self::UnknownValue(peering::UnknownValue(
15427 wkt::internal::UnknownEnumValue::Integer(value),
15428 )),
15429 }
15430 }
15431 }
15432
15433 impl std::convert::From<&str> for Peering {
15434 fn from(value: &str) -> Self {
15435 use std::string::ToString;
15436 match value {
15437 "PEERING_UNSPECIFIED" => Self::Unspecified,
15438 "FOR_SELF" => Self::ForSelf,
15439 "FOR_PEER" => Self::ForPeer,
15440 "NOT_SHARED" => Self::NotShared,
15441 _ => Self::UnknownValue(peering::UnknownValue(
15442 wkt::internal::UnknownEnumValue::String(value.to_string()),
15443 )),
15444 }
15445 }
15446 }
15447
15448 impl serde::ser::Serialize for Peering {
15449 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15450 where
15451 S: serde::Serializer,
15452 {
15453 match self {
15454 Self::Unspecified => serializer.serialize_i32(0),
15455 Self::ForSelf => serializer.serialize_i32(1),
15456 Self::ForPeer => serializer.serialize_i32(2),
15457 Self::NotShared => serializer.serialize_i32(3),
15458 Self::UnknownValue(u) => u.0.serialize(serializer),
15459 }
15460 }
15461 }
15462
15463 impl<'de> serde::de::Deserialize<'de> for Peering {
15464 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15465 where
15466 D: serde::Deserializer<'de>,
15467 {
15468 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Peering>::new(
15469 ".google.cloud.networkconnectivity.v1.InternalRange.Peering",
15470 ))
15471 }
15472 }
15473
15474 /// Overlap specifications.
15475 ///
15476 /// # Working with unknown values
15477 ///
15478 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15479 /// additional enum variants at any time. Adding new variants is not considered
15480 /// a breaking change. Applications should write their code in anticipation of:
15481 ///
15482 /// - New values appearing in future releases of the client library, **and**
15483 /// - New values received dynamically, without application changes.
15484 ///
15485 /// Please consult the [Working with enums] section in the user guide for some
15486 /// guidelines.
15487 ///
15488 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15489 #[derive(Clone, Debug, PartialEq)]
15490 #[non_exhaustive]
15491 pub enum Overlap {
15492 /// No overlap overrides.
15493 Unspecified,
15494 /// Allow creation of static routes more specific that the current
15495 /// internal range.
15496 RouteRange,
15497 /// Allow creation of internal ranges that overlap with existing subnets.
15498 ExistingSubnetRange,
15499 /// If set, the enum was initialized with an unknown value.
15500 ///
15501 /// Applications can examine the value using [Overlap::value] or
15502 /// [Overlap::name].
15503 UnknownValue(overlap::UnknownValue),
15504 }
15505
15506 #[doc(hidden)]
15507 pub mod overlap {
15508 #[allow(unused_imports)]
15509 use super::*;
15510 #[derive(Clone, Debug, PartialEq)]
15511 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15512 }
15513
15514 impl Overlap {
15515 /// Gets the enum value.
15516 ///
15517 /// Returns `None` if the enum contains an unknown value deserialized from
15518 /// the string representation of enums.
15519 pub fn value(&self) -> std::option::Option<i32> {
15520 match self {
15521 Self::Unspecified => std::option::Option::Some(0),
15522 Self::RouteRange => std::option::Option::Some(1),
15523 Self::ExistingSubnetRange => std::option::Option::Some(2),
15524 Self::UnknownValue(u) => u.0.value(),
15525 }
15526 }
15527
15528 /// Gets the enum value as a string.
15529 ///
15530 /// Returns `None` if the enum contains an unknown value deserialized from
15531 /// the integer representation of enums.
15532 pub fn name(&self) -> std::option::Option<&str> {
15533 match self {
15534 Self::Unspecified => std::option::Option::Some("OVERLAP_UNSPECIFIED"),
15535 Self::RouteRange => std::option::Option::Some("OVERLAP_ROUTE_RANGE"),
15536 Self::ExistingSubnetRange => {
15537 std::option::Option::Some("OVERLAP_EXISTING_SUBNET_RANGE")
15538 }
15539 Self::UnknownValue(u) => u.0.name(),
15540 }
15541 }
15542 }
15543
15544 impl std::default::Default for Overlap {
15545 fn default() -> Self {
15546 use std::convert::From;
15547 Self::from(0)
15548 }
15549 }
15550
15551 impl std::fmt::Display for Overlap {
15552 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15553 wkt::internal::display_enum(f, self.name(), self.value())
15554 }
15555 }
15556
15557 impl std::convert::From<i32> for Overlap {
15558 fn from(value: i32) -> Self {
15559 match value {
15560 0 => Self::Unspecified,
15561 1 => Self::RouteRange,
15562 2 => Self::ExistingSubnetRange,
15563 _ => Self::UnknownValue(overlap::UnknownValue(
15564 wkt::internal::UnknownEnumValue::Integer(value),
15565 )),
15566 }
15567 }
15568 }
15569
15570 impl std::convert::From<&str> for Overlap {
15571 fn from(value: &str) -> Self {
15572 use std::string::ToString;
15573 match value {
15574 "OVERLAP_UNSPECIFIED" => Self::Unspecified,
15575 "OVERLAP_ROUTE_RANGE" => Self::RouteRange,
15576 "OVERLAP_EXISTING_SUBNET_RANGE" => Self::ExistingSubnetRange,
15577 _ => Self::UnknownValue(overlap::UnknownValue(
15578 wkt::internal::UnknownEnumValue::String(value.to_string()),
15579 )),
15580 }
15581 }
15582 }
15583
15584 impl serde::ser::Serialize for Overlap {
15585 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15586 where
15587 S: serde::Serializer,
15588 {
15589 match self {
15590 Self::Unspecified => serializer.serialize_i32(0),
15591 Self::RouteRange => serializer.serialize_i32(1),
15592 Self::ExistingSubnetRange => serializer.serialize_i32(2),
15593 Self::UnknownValue(u) => u.0.serialize(serializer),
15594 }
15595 }
15596 }
15597
15598 impl<'de> serde::de::Deserialize<'de> for Overlap {
15599 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15600 where
15601 D: serde::Deserializer<'de>,
15602 {
15603 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Overlap>::new(
15604 ".google.cloud.networkconnectivity.v1.InternalRange.Overlap",
15605 ))
15606 }
15607 }
15608
15609 /// Enumeration of range auto-allocation strategies
15610 ///
15611 /// # Working with unknown values
15612 ///
15613 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15614 /// additional enum variants at any time. Adding new variants is not considered
15615 /// a breaking change. Applications should write their code in anticipation of:
15616 ///
15617 /// - New values appearing in future releases of the client library, **and**
15618 /// - New values received dynamically, without application changes.
15619 ///
15620 /// Please consult the [Working with enums] section in the user guide for some
15621 /// guidelines.
15622 ///
15623 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15624 #[derive(Clone, Debug, PartialEq)]
15625 #[non_exhaustive]
15626 pub enum AllocationStrategy {
15627 /// Unspecified is the only valid option when the range is specified
15628 /// explicitly by ip_cidr_range field. Otherwise unspefified means using the
15629 /// default strategy.
15630 Unspecified,
15631 /// Random strategy, the legacy algorithm, used for backwards compatibility.
15632 /// This allocation strategy remains efficient in the case of concurrent
15633 /// allocation requests in the same peered network space and doesn't require
15634 /// providing the level of concurrency in an explicit parameter, but it is
15635 /// prone to fragmenting available address space.
15636 Random,
15637 /// Pick the first available address range. This strategy is deterministic
15638 /// and the result is easy to predict.
15639 FirstAvailable,
15640 /// Pick an arbitrary range out of the first N available ones. The N will be
15641 /// set in the first_available_ranges_lookup_size field. This strategy should
15642 /// be used when concurrent allocation requests are made in the same space of
15643 /// peered networks while the fragmentation of the addrress space is reduced.
15644 RandomFirstNAvailable,
15645 /// Pick the smallest but fitting available range. This deterministic
15646 /// strategy minimizes fragmentation of the address space.
15647 FirstSmallestFitting,
15648 /// If set, the enum was initialized with an unknown value.
15649 ///
15650 /// Applications can examine the value using [AllocationStrategy::value] or
15651 /// [AllocationStrategy::name].
15652 UnknownValue(allocation_strategy::UnknownValue),
15653 }
15654
15655 #[doc(hidden)]
15656 pub mod allocation_strategy {
15657 #[allow(unused_imports)]
15658 use super::*;
15659 #[derive(Clone, Debug, PartialEq)]
15660 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15661 }
15662
15663 impl AllocationStrategy {
15664 /// Gets the enum value.
15665 ///
15666 /// Returns `None` if the enum contains an unknown value deserialized from
15667 /// the string representation of enums.
15668 pub fn value(&self) -> std::option::Option<i32> {
15669 match self {
15670 Self::Unspecified => std::option::Option::Some(0),
15671 Self::Random => std::option::Option::Some(1),
15672 Self::FirstAvailable => std::option::Option::Some(2),
15673 Self::RandomFirstNAvailable => std::option::Option::Some(3),
15674 Self::FirstSmallestFitting => std::option::Option::Some(4),
15675 Self::UnknownValue(u) => u.0.value(),
15676 }
15677 }
15678
15679 /// Gets the enum value as a string.
15680 ///
15681 /// Returns `None` if the enum contains an unknown value deserialized from
15682 /// the integer representation of enums.
15683 pub fn name(&self) -> std::option::Option<&str> {
15684 match self {
15685 Self::Unspecified => std::option::Option::Some("ALLOCATION_STRATEGY_UNSPECIFIED"),
15686 Self::Random => std::option::Option::Some("RANDOM"),
15687 Self::FirstAvailable => std::option::Option::Some("FIRST_AVAILABLE"),
15688 Self::RandomFirstNAvailable => {
15689 std::option::Option::Some("RANDOM_FIRST_N_AVAILABLE")
15690 }
15691 Self::FirstSmallestFitting => std::option::Option::Some("FIRST_SMALLEST_FITTING"),
15692 Self::UnknownValue(u) => u.0.name(),
15693 }
15694 }
15695 }
15696
15697 impl std::default::Default for AllocationStrategy {
15698 fn default() -> Self {
15699 use std::convert::From;
15700 Self::from(0)
15701 }
15702 }
15703
15704 impl std::fmt::Display for AllocationStrategy {
15705 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15706 wkt::internal::display_enum(f, self.name(), self.value())
15707 }
15708 }
15709
15710 impl std::convert::From<i32> for AllocationStrategy {
15711 fn from(value: i32) -> Self {
15712 match value {
15713 0 => Self::Unspecified,
15714 1 => Self::Random,
15715 2 => Self::FirstAvailable,
15716 3 => Self::RandomFirstNAvailable,
15717 4 => Self::FirstSmallestFitting,
15718 _ => Self::UnknownValue(allocation_strategy::UnknownValue(
15719 wkt::internal::UnknownEnumValue::Integer(value),
15720 )),
15721 }
15722 }
15723 }
15724
15725 impl std::convert::From<&str> for AllocationStrategy {
15726 fn from(value: &str) -> Self {
15727 use std::string::ToString;
15728 match value {
15729 "ALLOCATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
15730 "RANDOM" => Self::Random,
15731 "FIRST_AVAILABLE" => Self::FirstAvailable,
15732 "RANDOM_FIRST_N_AVAILABLE" => Self::RandomFirstNAvailable,
15733 "FIRST_SMALLEST_FITTING" => Self::FirstSmallestFitting,
15734 _ => Self::UnknownValue(allocation_strategy::UnknownValue(
15735 wkt::internal::UnknownEnumValue::String(value.to_string()),
15736 )),
15737 }
15738 }
15739 }
15740
15741 impl serde::ser::Serialize for AllocationStrategy {
15742 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15743 where
15744 S: serde::Serializer,
15745 {
15746 match self {
15747 Self::Unspecified => serializer.serialize_i32(0),
15748 Self::Random => serializer.serialize_i32(1),
15749 Self::FirstAvailable => serializer.serialize_i32(2),
15750 Self::RandomFirstNAvailable => serializer.serialize_i32(3),
15751 Self::FirstSmallestFitting => serializer.serialize_i32(4),
15752 Self::UnknownValue(u) => u.0.serialize(serializer),
15753 }
15754 }
15755 }
15756
15757 impl<'de> serde::de::Deserialize<'de> for AllocationStrategy {
15758 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15759 where
15760 D: serde::Deserializer<'de>,
15761 {
15762 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AllocationStrategy>::new(
15763 ".google.cloud.networkconnectivity.v1.InternalRange.AllocationStrategy",
15764 ))
15765 }
15766 }
15767}
15768
15769/// Request for InternalRangeService.ListInternalRanges
15770#[derive(Clone, Default, PartialEq)]
15771#[non_exhaustive]
15772pub struct ListInternalRangesRequest {
15773 /// Required. The parent resource's name.
15774 pub parent: std::string::String,
15775
15776 /// The maximum number of results per page that should be returned.
15777 pub page_size: i32,
15778
15779 /// The page token.
15780 pub page_token: std::string::String,
15781
15782 /// A filter expression that filters the results listed in the response.
15783 pub filter: std::string::String,
15784
15785 /// Sort the results by a certain order.
15786 pub order_by: std::string::String,
15787
15788 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15789}
15790
15791impl ListInternalRangesRequest {
15792 pub fn new() -> Self {
15793 std::default::Default::default()
15794 }
15795
15796 /// Sets the value of [parent][crate::model::ListInternalRangesRequest::parent].
15797 ///
15798 /// # Example
15799 /// ```ignore,no_run
15800 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15801 /// let x = ListInternalRangesRequest::new().set_parent("example");
15802 /// ```
15803 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15804 self.parent = v.into();
15805 self
15806 }
15807
15808 /// Sets the value of [page_size][crate::model::ListInternalRangesRequest::page_size].
15809 ///
15810 /// # Example
15811 /// ```ignore,no_run
15812 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15813 /// let x = ListInternalRangesRequest::new().set_page_size(42);
15814 /// ```
15815 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15816 self.page_size = v.into();
15817 self
15818 }
15819
15820 /// Sets the value of [page_token][crate::model::ListInternalRangesRequest::page_token].
15821 ///
15822 /// # Example
15823 /// ```ignore,no_run
15824 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15825 /// let x = ListInternalRangesRequest::new().set_page_token("example");
15826 /// ```
15827 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15828 self.page_token = v.into();
15829 self
15830 }
15831
15832 /// Sets the value of [filter][crate::model::ListInternalRangesRequest::filter].
15833 ///
15834 /// # Example
15835 /// ```ignore,no_run
15836 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15837 /// let x = ListInternalRangesRequest::new().set_filter("example");
15838 /// ```
15839 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15840 self.filter = v.into();
15841 self
15842 }
15843
15844 /// Sets the value of [order_by][crate::model::ListInternalRangesRequest::order_by].
15845 ///
15846 /// # Example
15847 /// ```ignore,no_run
15848 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15849 /// let x = ListInternalRangesRequest::new().set_order_by("example");
15850 /// ```
15851 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15852 self.order_by = v.into();
15853 self
15854 }
15855}
15856
15857impl wkt::message::Message for ListInternalRangesRequest {
15858 fn typename() -> &'static str {
15859 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesRequest"
15860 }
15861}
15862
15863/// Response for InternalRange.ListInternalRanges
15864#[derive(Clone, Default, PartialEq)]
15865#[non_exhaustive]
15866pub struct ListInternalRangesResponse {
15867 /// Internal ranges to be returned.
15868 pub internal_ranges: std::vec::Vec<crate::model::InternalRange>,
15869
15870 /// The next pagination token in the List response. It should be used as
15871 /// page_token for the following request. An empty value means no more result.
15872 pub next_page_token: std::string::String,
15873
15874 /// Locations that could not be reached.
15875 pub unreachable: std::vec::Vec<std::string::String>,
15876
15877 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15878}
15879
15880impl ListInternalRangesResponse {
15881 pub fn new() -> Self {
15882 std::default::Default::default()
15883 }
15884
15885 /// Sets the value of [internal_ranges][crate::model::ListInternalRangesResponse::internal_ranges].
15886 ///
15887 /// # Example
15888 /// ```ignore,no_run
15889 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
15890 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
15891 /// let x = ListInternalRangesResponse::new()
15892 /// .set_internal_ranges([
15893 /// InternalRange::default()/* use setters */,
15894 /// InternalRange::default()/* use (different) setters */,
15895 /// ]);
15896 /// ```
15897 pub fn set_internal_ranges<T, V>(mut self, v: T) -> Self
15898 where
15899 T: std::iter::IntoIterator<Item = V>,
15900 V: std::convert::Into<crate::model::InternalRange>,
15901 {
15902 use std::iter::Iterator;
15903 self.internal_ranges = v.into_iter().map(|i| i.into()).collect();
15904 self
15905 }
15906
15907 /// Sets the value of [next_page_token][crate::model::ListInternalRangesResponse::next_page_token].
15908 ///
15909 /// # Example
15910 /// ```ignore,no_run
15911 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
15912 /// let x = ListInternalRangesResponse::new().set_next_page_token("example");
15913 /// ```
15914 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15915 self.next_page_token = v.into();
15916 self
15917 }
15918
15919 /// Sets the value of [unreachable][crate::model::ListInternalRangesResponse::unreachable].
15920 ///
15921 /// # Example
15922 /// ```ignore,no_run
15923 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
15924 /// let x = ListInternalRangesResponse::new().set_unreachable(["a", "b", "c"]);
15925 /// ```
15926 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
15927 where
15928 T: std::iter::IntoIterator<Item = V>,
15929 V: std::convert::Into<std::string::String>,
15930 {
15931 use std::iter::Iterator;
15932 self.unreachable = v.into_iter().map(|i| i.into()).collect();
15933 self
15934 }
15935}
15936
15937impl wkt::message::Message for ListInternalRangesResponse {
15938 fn typename() -> &'static str {
15939 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesResponse"
15940 }
15941}
15942
15943#[doc(hidden)]
15944impl gax::paginator::internal::PageableResponse for ListInternalRangesResponse {
15945 type PageItem = crate::model::InternalRange;
15946
15947 fn items(self) -> std::vec::Vec<Self::PageItem> {
15948 self.internal_ranges
15949 }
15950
15951 fn next_page_token(&self) -> std::string::String {
15952 use std::clone::Clone;
15953 self.next_page_token.clone()
15954 }
15955}
15956
15957/// Request for InternalRangeService.GetInternalRange
15958#[derive(Clone, Default, PartialEq)]
15959#[non_exhaustive]
15960pub struct GetInternalRangeRequest {
15961 /// Required. Name of the InternalRange to get.
15962 pub name: std::string::String,
15963
15964 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15965}
15966
15967impl GetInternalRangeRequest {
15968 pub fn new() -> Self {
15969 std::default::Default::default()
15970 }
15971
15972 /// Sets the value of [name][crate::model::GetInternalRangeRequest::name].
15973 ///
15974 /// # Example
15975 /// ```ignore,no_run
15976 /// # use google_cloud_networkconnectivity_v1::model::GetInternalRangeRequest;
15977 /// let x = GetInternalRangeRequest::new().set_name("example");
15978 /// ```
15979 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15980 self.name = v.into();
15981 self
15982 }
15983}
15984
15985impl wkt::message::Message for GetInternalRangeRequest {
15986 fn typename() -> &'static str {
15987 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetInternalRangeRequest"
15988 }
15989}
15990
15991/// Request for InternalRangeService.CreateInternalRange
15992#[derive(Clone, Default, PartialEq)]
15993#[non_exhaustive]
15994pub struct CreateInternalRangeRequest {
15995 /// Required. The parent resource's name of the internal range.
15996 pub parent: std::string::String,
15997
15998 /// Optional. Resource ID
15999 /// (i.e. 'foo' in '[...]/projects/p/locations/l/internalRanges/foo')
16000 /// See <https://google.aip.dev/122#resource-id-segments>
16001 /// Unique per location.
16002 pub internal_range_id: std::string::String,
16003
16004 /// Required. Initial values for a new internal range
16005 pub internal_range: std::option::Option<crate::model::InternalRange>,
16006
16007 /// Optional. An optional request ID to identify requests. Specify a unique
16008 /// request ID so that if you must retry your request, the server will know to
16009 /// ignore the request if it has already been completed. The server will
16010 /// guarantee that for at least 60 minutes since the first request.
16011 ///
16012 /// For example, consider a situation where you make an initial request and
16013 /// the request times out. If you make the request again with the same request
16014 /// ID, the server can check if original operation with the same request ID
16015 /// was received, and if so, will ignore the second request. This prevents
16016 /// clients from accidentally creating duplicate commitments.
16017 ///
16018 /// The request ID must be a valid UUID with the exception that zero UUID is
16019 /// not supported (00000000-0000-0000-0000-000000000000).
16020 pub request_id: std::string::String,
16021
16022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16023}
16024
16025impl CreateInternalRangeRequest {
16026 pub fn new() -> Self {
16027 std::default::Default::default()
16028 }
16029
16030 /// Sets the value of [parent][crate::model::CreateInternalRangeRequest::parent].
16031 ///
16032 /// # Example
16033 /// ```ignore,no_run
16034 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16035 /// let x = CreateInternalRangeRequest::new().set_parent("example");
16036 /// ```
16037 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16038 self.parent = v.into();
16039 self
16040 }
16041
16042 /// Sets the value of [internal_range_id][crate::model::CreateInternalRangeRequest::internal_range_id].
16043 ///
16044 /// # Example
16045 /// ```ignore,no_run
16046 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16047 /// let x = CreateInternalRangeRequest::new().set_internal_range_id("example");
16048 /// ```
16049 pub fn set_internal_range_id<T: std::convert::Into<std::string::String>>(
16050 mut self,
16051 v: T,
16052 ) -> Self {
16053 self.internal_range_id = v.into();
16054 self
16055 }
16056
16057 /// Sets the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
16058 ///
16059 /// # Example
16060 /// ```ignore,no_run
16061 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16062 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16063 /// let x = CreateInternalRangeRequest::new().set_internal_range(InternalRange::default()/* use setters */);
16064 /// ```
16065 pub fn set_internal_range<T>(mut self, v: T) -> Self
16066 where
16067 T: std::convert::Into<crate::model::InternalRange>,
16068 {
16069 self.internal_range = std::option::Option::Some(v.into());
16070 self
16071 }
16072
16073 /// Sets or clears the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
16074 ///
16075 /// # Example
16076 /// ```ignore,no_run
16077 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16078 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16079 /// let x = CreateInternalRangeRequest::new().set_or_clear_internal_range(Some(InternalRange::default()/* use setters */));
16080 /// let x = CreateInternalRangeRequest::new().set_or_clear_internal_range(None::<InternalRange>);
16081 /// ```
16082 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
16083 where
16084 T: std::convert::Into<crate::model::InternalRange>,
16085 {
16086 self.internal_range = v.map(|x| x.into());
16087 self
16088 }
16089
16090 /// Sets the value of [request_id][crate::model::CreateInternalRangeRequest::request_id].
16091 ///
16092 /// # Example
16093 /// ```ignore,no_run
16094 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16095 /// let x = CreateInternalRangeRequest::new().set_request_id("example");
16096 /// ```
16097 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16098 self.request_id = v.into();
16099 self
16100 }
16101}
16102
16103impl wkt::message::Message for CreateInternalRangeRequest {
16104 fn typename() -> &'static str {
16105 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateInternalRangeRequest"
16106 }
16107}
16108
16109/// Request for InternalRangeService.UpdateInternalRange
16110#[derive(Clone, Default, PartialEq)]
16111#[non_exhaustive]
16112pub struct UpdateInternalRangeRequest {
16113 /// Optional. Field mask is used to specify the fields to be overwritten in the
16114 /// InternalRange resource by the update.
16115 /// The fields specified in the update_mask are relative to the resource, not
16116 /// the full request. A field will be overwritten if it is in the mask. If the
16117 /// user does not provide a mask then all fields will be overwritten.
16118 pub update_mask: std::option::Option<wkt::FieldMask>,
16119
16120 /// Required. New values to be patched into the resource.
16121 pub internal_range: std::option::Option<crate::model::InternalRange>,
16122
16123 /// Optional. An optional request ID to identify requests. Specify a unique
16124 /// request ID so that if you must retry your request, the server will know to
16125 /// ignore the request if it has already been completed. The server will
16126 /// guarantee that for at least 60 minutes since the first request.
16127 ///
16128 /// For example, consider a situation where you make an initial request and
16129 /// the request times out. If you make the request again with the same request
16130 /// ID, the server can check if original operation with the same request ID
16131 /// was received, and if so, will ignore the second request. This prevents
16132 /// clients from accidentally creating duplicate commitments.
16133 ///
16134 /// The request ID must be a valid UUID with the exception that zero UUID is
16135 /// not supported (00000000-0000-0000-0000-000000000000).
16136 pub request_id: std::string::String,
16137
16138 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16139}
16140
16141impl UpdateInternalRangeRequest {
16142 pub fn new() -> Self {
16143 std::default::Default::default()
16144 }
16145
16146 /// Sets the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
16147 ///
16148 /// # Example
16149 /// ```ignore,no_run
16150 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16151 /// use wkt::FieldMask;
16152 /// let x = UpdateInternalRangeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16153 /// ```
16154 pub fn set_update_mask<T>(mut self, v: T) -> Self
16155 where
16156 T: std::convert::Into<wkt::FieldMask>,
16157 {
16158 self.update_mask = std::option::Option::Some(v.into());
16159 self
16160 }
16161
16162 /// Sets or clears the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
16163 ///
16164 /// # Example
16165 /// ```ignore,no_run
16166 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16167 /// use wkt::FieldMask;
16168 /// let x = UpdateInternalRangeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16169 /// let x = UpdateInternalRangeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16170 /// ```
16171 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16172 where
16173 T: std::convert::Into<wkt::FieldMask>,
16174 {
16175 self.update_mask = v.map(|x| x.into());
16176 self
16177 }
16178
16179 /// Sets the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
16180 ///
16181 /// # Example
16182 /// ```ignore,no_run
16183 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16184 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16185 /// let x = UpdateInternalRangeRequest::new().set_internal_range(InternalRange::default()/* use setters */);
16186 /// ```
16187 pub fn set_internal_range<T>(mut self, v: T) -> Self
16188 where
16189 T: std::convert::Into<crate::model::InternalRange>,
16190 {
16191 self.internal_range = std::option::Option::Some(v.into());
16192 self
16193 }
16194
16195 /// Sets or clears the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
16196 ///
16197 /// # Example
16198 /// ```ignore,no_run
16199 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16200 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16201 /// let x = UpdateInternalRangeRequest::new().set_or_clear_internal_range(Some(InternalRange::default()/* use setters */));
16202 /// let x = UpdateInternalRangeRequest::new().set_or_clear_internal_range(None::<InternalRange>);
16203 /// ```
16204 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
16205 where
16206 T: std::convert::Into<crate::model::InternalRange>,
16207 {
16208 self.internal_range = v.map(|x| x.into());
16209 self
16210 }
16211
16212 /// Sets the value of [request_id][crate::model::UpdateInternalRangeRequest::request_id].
16213 ///
16214 /// # Example
16215 /// ```ignore,no_run
16216 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16217 /// let x = UpdateInternalRangeRequest::new().set_request_id("example");
16218 /// ```
16219 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16220 self.request_id = v.into();
16221 self
16222 }
16223}
16224
16225impl wkt::message::Message for UpdateInternalRangeRequest {
16226 fn typename() -> &'static str {
16227 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateInternalRangeRequest"
16228 }
16229}
16230
16231/// Request for InternalRangeService.DeleteInternalRange
16232#[derive(Clone, Default, PartialEq)]
16233#[non_exhaustive]
16234pub struct DeleteInternalRangeRequest {
16235 /// Required. The name of the internal range to delete.
16236 pub name: std::string::String,
16237
16238 /// Optional. An optional request ID to identify requests. Specify a unique
16239 /// request ID so that if you must retry your request, the server will know to
16240 /// ignore the request if it has already been completed. The server will
16241 /// guarantee that for at least 60 minutes after the first request.
16242 ///
16243 /// For example, consider a situation where you make an initial request and
16244 /// the request times out. If you make the request again with the same request
16245 /// ID, the server can check if original operation with the same request ID
16246 /// was received, and if so, will ignore the second request. This prevents
16247 /// clients from accidentally creating duplicate commitments.
16248 ///
16249 /// The request ID must be a valid UUID with the exception that zero UUID is
16250 /// not supported (00000000-0000-0000-0000-000000000000).
16251 pub request_id: std::string::String,
16252
16253 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16254}
16255
16256impl DeleteInternalRangeRequest {
16257 pub fn new() -> Self {
16258 std::default::Default::default()
16259 }
16260
16261 /// Sets the value of [name][crate::model::DeleteInternalRangeRequest::name].
16262 ///
16263 /// # Example
16264 /// ```ignore,no_run
16265 /// # use google_cloud_networkconnectivity_v1::model::DeleteInternalRangeRequest;
16266 /// let x = DeleteInternalRangeRequest::new().set_name("example");
16267 /// ```
16268 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16269 self.name = v.into();
16270 self
16271 }
16272
16273 /// Sets the value of [request_id][crate::model::DeleteInternalRangeRequest::request_id].
16274 ///
16275 /// # Example
16276 /// ```ignore,no_run
16277 /// # use google_cloud_networkconnectivity_v1::model::DeleteInternalRangeRequest;
16278 /// let x = DeleteInternalRangeRequest::new().set_request_id("example");
16279 /// ```
16280 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16281 self.request_id = v.into();
16282 self
16283 }
16284}
16285
16286impl wkt::message::Message for DeleteInternalRangeRequest {
16287 fn typename() -> &'static str {
16288 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteInternalRangeRequest"
16289 }
16290}
16291
16292/// Policy-based routes route L4 network traffic based on not just destination IP
16293/// address, but also source IP address, protocol, and more. If a policy-based
16294/// route conflicts with other types of routes, the policy-based route always
16295/// takes precedence.
16296#[derive(Clone, Default, PartialEq)]
16297#[non_exhaustive]
16298pub struct PolicyBasedRoute {
16299 /// Immutable. A unique name of the resource in the form of
16300 /// `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
16301 pub name: std::string::String,
16302
16303 /// Output only. Time when the policy-based route was created.
16304 pub create_time: std::option::Option<wkt::Timestamp>,
16305
16306 /// Output only. Time when the policy-based route was updated.
16307 pub update_time: std::option::Option<wkt::Timestamp>,
16308
16309 /// User-defined labels.
16310 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16311
16312 /// Optional. An optional description of this resource. Provide this field when
16313 /// you create the resource.
16314 pub description: std::string::String,
16315
16316 /// Required. Fully-qualified URL of the network that this route applies to,
16317 /// for example: projects/my-project/global/networks/my-network.
16318 pub network: std::string::String,
16319
16320 /// Required. The filter to match L4 traffic.
16321 pub filter: std::option::Option<crate::model::policy_based_route::Filter>,
16322
16323 /// Optional. The priority of this policy-based route. Priority is used to
16324 /// break ties in cases where there are more than one matching policy-based
16325 /// routes found. In cases where multiple policy-based routes are matched, the
16326 /// one with the lowest-numbered priority value wins. The default value is
16327 /// 1000. The priority value must be from 1 to 65535, inclusive.
16328 pub priority: i32,
16329
16330 /// Output only. If potential misconfigurations are detected for this route,
16331 /// this field will be populated with warning messages.
16332 pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,
16333
16334 /// Output only. Server-defined fully-qualified URL for this resource.
16335 pub self_link: std::string::String,
16336
16337 /// Output only. Type of this resource. Always
16338 /// networkconnectivity#policyBasedRoute for policy-based Route resources.
16339 pub kind: std::string::String,
16340
16341 /// Target specifies network endpoints that this policy-based route applies to.
16342 /// If no target is specified, the PBR will be installed on all network
16343 /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
16344 pub target: std::option::Option<crate::model::policy_based_route::Target>,
16345
16346 pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,
16347
16348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16349}
16350
16351impl PolicyBasedRoute {
16352 pub fn new() -> Self {
16353 std::default::Default::default()
16354 }
16355
16356 /// Sets the value of [name][crate::model::PolicyBasedRoute::name].
16357 ///
16358 /// # Example
16359 /// ```ignore,no_run
16360 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16361 /// let x = PolicyBasedRoute::new().set_name("example");
16362 /// ```
16363 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16364 self.name = v.into();
16365 self
16366 }
16367
16368 /// Sets the value of [create_time][crate::model::PolicyBasedRoute::create_time].
16369 ///
16370 /// # Example
16371 /// ```ignore,no_run
16372 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16373 /// use wkt::Timestamp;
16374 /// let x = PolicyBasedRoute::new().set_create_time(Timestamp::default()/* use setters */);
16375 /// ```
16376 pub fn set_create_time<T>(mut self, v: T) -> Self
16377 where
16378 T: std::convert::Into<wkt::Timestamp>,
16379 {
16380 self.create_time = std::option::Option::Some(v.into());
16381 self
16382 }
16383
16384 /// Sets or clears the value of [create_time][crate::model::PolicyBasedRoute::create_time].
16385 ///
16386 /// # Example
16387 /// ```ignore,no_run
16388 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16389 /// use wkt::Timestamp;
16390 /// let x = PolicyBasedRoute::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16391 /// let x = PolicyBasedRoute::new().set_or_clear_create_time(None::<Timestamp>);
16392 /// ```
16393 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16394 where
16395 T: std::convert::Into<wkt::Timestamp>,
16396 {
16397 self.create_time = v.map(|x| x.into());
16398 self
16399 }
16400
16401 /// Sets the value of [update_time][crate::model::PolicyBasedRoute::update_time].
16402 ///
16403 /// # Example
16404 /// ```ignore,no_run
16405 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16406 /// use wkt::Timestamp;
16407 /// let x = PolicyBasedRoute::new().set_update_time(Timestamp::default()/* use setters */);
16408 /// ```
16409 pub fn set_update_time<T>(mut self, v: T) -> Self
16410 where
16411 T: std::convert::Into<wkt::Timestamp>,
16412 {
16413 self.update_time = std::option::Option::Some(v.into());
16414 self
16415 }
16416
16417 /// Sets or clears the value of [update_time][crate::model::PolicyBasedRoute::update_time].
16418 ///
16419 /// # Example
16420 /// ```ignore,no_run
16421 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16422 /// use wkt::Timestamp;
16423 /// let x = PolicyBasedRoute::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16424 /// let x = PolicyBasedRoute::new().set_or_clear_update_time(None::<Timestamp>);
16425 /// ```
16426 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16427 where
16428 T: std::convert::Into<wkt::Timestamp>,
16429 {
16430 self.update_time = v.map(|x| x.into());
16431 self
16432 }
16433
16434 /// Sets the value of [labels][crate::model::PolicyBasedRoute::labels].
16435 ///
16436 /// # Example
16437 /// ```ignore,no_run
16438 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16439 /// let x = PolicyBasedRoute::new().set_labels([
16440 /// ("key0", "abc"),
16441 /// ("key1", "xyz"),
16442 /// ]);
16443 /// ```
16444 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16445 where
16446 T: std::iter::IntoIterator<Item = (K, V)>,
16447 K: std::convert::Into<std::string::String>,
16448 V: std::convert::Into<std::string::String>,
16449 {
16450 use std::iter::Iterator;
16451 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16452 self
16453 }
16454
16455 /// Sets the value of [description][crate::model::PolicyBasedRoute::description].
16456 ///
16457 /// # Example
16458 /// ```ignore,no_run
16459 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16460 /// let x = PolicyBasedRoute::new().set_description("example");
16461 /// ```
16462 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16463 self.description = v.into();
16464 self
16465 }
16466
16467 /// Sets the value of [network][crate::model::PolicyBasedRoute::network].
16468 ///
16469 /// # Example
16470 /// ```ignore,no_run
16471 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16472 /// let x = PolicyBasedRoute::new().set_network("example");
16473 /// ```
16474 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16475 self.network = v.into();
16476 self
16477 }
16478
16479 /// Sets the value of [filter][crate::model::PolicyBasedRoute::filter].
16480 ///
16481 /// # Example
16482 /// ```ignore,no_run
16483 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16484 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16485 /// let x = PolicyBasedRoute::new().set_filter(Filter::default()/* use setters */);
16486 /// ```
16487 pub fn set_filter<T>(mut self, v: T) -> Self
16488 where
16489 T: std::convert::Into<crate::model::policy_based_route::Filter>,
16490 {
16491 self.filter = std::option::Option::Some(v.into());
16492 self
16493 }
16494
16495 /// Sets or clears the value of [filter][crate::model::PolicyBasedRoute::filter].
16496 ///
16497 /// # Example
16498 /// ```ignore,no_run
16499 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16500 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16501 /// let x = PolicyBasedRoute::new().set_or_clear_filter(Some(Filter::default()/* use setters */));
16502 /// let x = PolicyBasedRoute::new().set_or_clear_filter(None::<Filter>);
16503 /// ```
16504 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
16505 where
16506 T: std::convert::Into<crate::model::policy_based_route::Filter>,
16507 {
16508 self.filter = v.map(|x| x.into());
16509 self
16510 }
16511
16512 /// Sets the value of [priority][crate::model::PolicyBasedRoute::priority].
16513 ///
16514 /// # Example
16515 /// ```ignore,no_run
16516 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16517 /// let x = PolicyBasedRoute::new().set_priority(42);
16518 /// ```
16519 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16520 self.priority = v.into();
16521 self
16522 }
16523
16524 /// Sets the value of [warnings][crate::model::PolicyBasedRoute::warnings].
16525 ///
16526 /// # Example
16527 /// ```ignore,no_run
16528 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16529 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
16530 /// let x = PolicyBasedRoute::new()
16531 /// .set_warnings([
16532 /// Warnings::default()/* use setters */,
16533 /// Warnings::default()/* use (different) setters */,
16534 /// ]);
16535 /// ```
16536 pub fn set_warnings<T, V>(mut self, v: T) -> Self
16537 where
16538 T: std::iter::IntoIterator<Item = V>,
16539 V: std::convert::Into<crate::model::policy_based_route::Warnings>,
16540 {
16541 use std::iter::Iterator;
16542 self.warnings = v.into_iter().map(|i| i.into()).collect();
16543 self
16544 }
16545
16546 /// Sets the value of [self_link][crate::model::PolicyBasedRoute::self_link].
16547 ///
16548 /// # Example
16549 /// ```ignore,no_run
16550 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16551 /// let x = PolicyBasedRoute::new().set_self_link("example");
16552 /// ```
16553 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16554 self.self_link = v.into();
16555 self
16556 }
16557
16558 /// Sets the value of [kind][crate::model::PolicyBasedRoute::kind].
16559 ///
16560 /// # Example
16561 /// ```ignore,no_run
16562 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16563 /// let x = PolicyBasedRoute::new().set_kind("example");
16564 /// ```
16565 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16566 self.kind = v.into();
16567 self
16568 }
16569
16570 /// Sets the value of [target][crate::model::PolicyBasedRoute::target].
16571 ///
16572 /// Note that all the setters affecting `target` are mutually
16573 /// exclusive.
16574 ///
16575 /// # Example
16576 /// ```ignore,no_run
16577 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16578 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16579 /// let x = PolicyBasedRoute::new().set_target(Some(
16580 /// google_cloud_networkconnectivity_v1::model::policy_based_route::Target::VirtualMachine(VirtualMachine::default().into())));
16581 /// ```
16582 pub fn set_target<
16583 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
16584 >(
16585 mut self,
16586 v: T,
16587 ) -> Self {
16588 self.target = v.into();
16589 self
16590 }
16591
16592 /// The value of [target][crate::model::PolicyBasedRoute::target]
16593 /// if it holds a `VirtualMachine`, `None` if the field is not set or
16594 /// holds a different branch.
16595 pub fn virtual_machine(
16596 &self,
16597 ) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
16598 {
16599 #[allow(unreachable_patterns)]
16600 self.target.as_ref().and_then(|v| match v {
16601 crate::model::policy_based_route::Target::VirtualMachine(v) => {
16602 std::option::Option::Some(v)
16603 }
16604 _ => std::option::Option::None,
16605 })
16606 }
16607
16608 /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
16609 /// to hold a `VirtualMachine`.
16610 ///
16611 /// Note that all the setters affecting `target` are
16612 /// mutually exclusive.
16613 ///
16614 /// # Example
16615 /// ```ignore,no_run
16616 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16617 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16618 /// let x = PolicyBasedRoute::new().set_virtual_machine(VirtualMachine::default()/* use setters */);
16619 /// assert!(x.virtual_machine().is_some());
16620 /// assert!(x.interconnect_attachment().is_none());
16621 /// ```
16622 pub fn set_virtual_machine<
16623 T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
16624 >(
16625 mut self,
16626 v: T,
16627 ) -> Self {
16628 self.target = std::option::Option::Some(
16629 crate::model::policy_based_route::Target::VirtualMachine(v.into()),
16630 );
16631 self
16632 }
16633
16634 /// The value of [target][crate::model::PolicyBasedRoute::target]
16635 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
16636 /// holds a different branch.
16637 pub fn interconnect_attachment(
16638 &self,
16639 ) -> std::option::Option<
16640 &std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
16641 > {
16642 #[allow(unreachable_patterns)]
16643 self.target.as_ref().and_then(|v| match v {
16644 crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
16645 std::option::Option::Some(v)
16646 }
16647 _ => std::option::Option::None,
16648 })
16649 }
16650
16651 /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
16652 /// to hold a `InterconnectAttachment`.
16653 ///
16654 /// Note that all the setters affecting `target` are
16655 /// mutually exclusive.
16656 ///
16657 /// # Example
16658 /// ```ignore,no_run
16659 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16660 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::InterconnectAttachment;
16661 /// let x = PolicyBasedRoute::new().set_interconnect_attachment(InterconnectAttachment::default()/* use setters */);
16662 /// assert!(x.interconnect_attachment().is_some());
16663 /// assert!(x.virtual_machine().is_none());
16664 /// ```
16665 pub fn set_interconnect_attachment<
16666 T: std::convert::Into<
16667 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
16668 >,
16669 >(
16670 mut self,
16671 v: T,
16672 ) -> Self {
16673 self.target = std::option::Option::Some(
16674 crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
16675 );
16676 self
16677 }
16678
16679 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop].
16680 ///
16681 /// Note that all the setters affecting `next_hop` are mutually
16682 /// exclusive.
16683 ///
16684 /// # Example
16685 /// ```ignore,no_run
16686 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16687 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::NextHop;
16688 /// let x = PolicyBasedRoute::new().set_next_hop(Some(NextHop::NextHopIlbIp("example".to_string())));
16689 /// ```
16690 pub fn set_next_hop<
16691 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
16692 >(
16693 mut self,
16694 v: T,
16695 ) -> Self {
16696 self.next_hop = v.into();
16697 self
16698 }
16699
16700 /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16701 /// if it holds a `NextHopIlbIp`, `None` if the field is not set or
16702 /// holds a different branch.
16703 pub fn next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
16704 #[allow(unreachable_patterns)]
16705 self.next_hop.as_ref().and_then(|v| match v {
16706 crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
16707 std::option::Option::Some(v)
16708 }
16709 _ => std::option::Option::None,
16710 })
16711 }
16712
16713 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16714 /// to hold a `NextHopIlbIp`.
16715 ///
16716 /// Note that all the setters affecting `next_hop` are
16717 /// mutually exclusive.
16718 ///
16719 /// # Example
16720 /// ```ignore,no_run
16721 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16722 /// let x = PolicyBasedRoute::new().set_next_hop_ilb_ip("example");
16723 /// assert!(x.next_hop_ilb_ip().is_some());
16724 /// assert!(x.next_hop_other_routes().is_none());
16725 /// ```
16726 pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16727 self.next_hop = std::option::Option::Some(
16728 crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
16729 );
16730 self
16731 }
16732
16733 /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16734 /// if it holds a `NextHopOtherRoutes`, `None` if the field is not set or
16735 /// holds a different branch.
16736 pub fn next_hop_other_routes(
16737 &self,
16738 ) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
16739 #[allow(unreachable_patterns)]
16740 self.next_hop.as_ref().and_then(|v| match v {
16741 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
16742 std::option::Option::Some(v)
16743 }
16744 _ => std::option::Option::None,
16745 })
16746 }
16747
16748 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16749 /// to hold a `NextHopOtherRoutes`.
16750 ///
16751 /// Note that all the setters affecting `next_hop` are
16752 /// mutually exclusive.
16753 ///
16754 /// # Example
16755 /// ```ignore,no_run
16756 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16757 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::OtherRoutes;
16758 /// let x0 = PolicyBasedRoute::new().set_next_hop_other_routes(OtherRoutes::DefaultRouting);
16759 /// assert!(x0.next_hop_other_routes().is_some());
16760 /// assert!(x0.next_hop_ilb_ip().is_none());
16761 /// ```
16762 pub fn set_next_hop_other_routes<
16763 T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
16764 >(
16765 mut self,
16766 v: T,
16767 ) -> Self {
16768 self.next_hop = std::option::Option::Some(
16769 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
16770 );
16771 self
16772 }
16773}
16774
16775impl wkt::message::Message for PolicyBasedRoute {
16776 fn typename() -> &'static str {
16777 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
16778 }
16779}
16780
16781/// Defines additional types related to [PolicyBasedRoute].
16782pub mod policy_based_route {
16783 #[allow(unused_imports)]
16784 use super::*;
16785
16786 /// VM instances that this policy-based route applies to.
16787 #[derive(Clone, Default, PartialEq)]
16788 #[non_exhaustive]
16789 pub struct VirtualMachine {
16790 /// Optional. A list of VM instance tags that this policy-based route applies
16791 /// to. VM instances that have ANY of tags specified here installs this PBR.
16792 pub tags: std::vec::Vec<std::string::String>,
16793
16794 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16795 }
16796
16797 impl VirtualMachine {
16798 pub fn new() -> Self {
16799 std::default::Default::default()
16800 }
16801
16802 /// Sets the value of [tags][crate::model::policy_based_route::VirtualMachine::tags].
16803 ///
16804 /// # Example
16805 /// ```ignore,no_run
16806 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16807 /// let x = VirtualMachine::new().set_tags(["a", "b", "c"]);
16808 /// ```
16809 pub fn set_tags<T, V>(mut self, v: T) -> Self
16810 where
16811 T: std::iter::IntoIterator<Item = V>,
16812 V: std::convert::Into<std::string::String>,
16813 {
16814 use std::iter::Iterator;
16815 self.tags = v.into_iter().map(|i| i.into()).collect();
16816 self
16817 }
16818 }
16819
16820 impl wkt::message::Message for VirtualMachine {
16821 fn typename() -> &'static str {
16822 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
16823 }
16824 }
16825
16826 /// InterconnectAttachment that this route applies to.
16827 #[derive(Clone, Default, PartialEq)]
16828 #[non_exhaustive]
16829 pub struct InterconnectAttachment {
16830 /// Optional. Cloud region to install this policy-based route on interconnect
16831 /// attachment. Use `all` to install it on all interconnect attachments.
16832 pub region: std::string::String,
16833
16834 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16835 }
16836
16837 impl InterconnectAttachment {
16838 pub fn new() -> Self {
16839 std::default::Default::default()
16840 }
16841
16842 /// Sets the value of [region][crate::model::policy_based_route::InterconnectAttachment::region].
16843 ///
16844 /// # Example
16845 /// ```ignore,no_run
16846 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::InterconnectAttachment;
16847 /// let x = InterconnectAttachment::new().set_region("example");
16848 /// ```
16849 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16850 self.region = v.into();
16851 self
16852 }
16853 }
16854
16855 impl wkt::message::Message for InterconnectAttachment {
16856 fn typename() -> &'static str {
16857 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
16858 }
16859 }
16860
16861 /// Filter matches L4 traffic.
16862 #[derive(Clone, Default, PartialEq)]
16863 #[non_exhaustive]
16864 pub struct Filter {
16865 /// Optional. The IP protocol that this policy-based route applies to. Valid
16866 /// values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
16867 pub ip_protocol: std::string::String,
16868
16869 /// Optional. The source IP range of outgoing packets that this policy-based
16870 /// route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
16871 pub src_range: std::string::String,
16872
16873 /// Optional. The destination IP range of outgoing packets that this
16874 /// policy-based route applies to. Default is "0.0.0.0/0" if protocol version
16875 /// is IPv4.
16876 pub dest_range: std::string::String,
16877
16878 /// Required. Internet protocol versions this policy-based route applies to.
16879 /// For this version, only IPV4 is supported. IPV6 is supported in preview.
16880 pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,
16881
16882 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16883 }
16884
16885 impl Filter {
16886 pub fn new() -> Self {
16887 std::default::Default::default()
16888 }
16889
16890 /// Sets the value of [ip_protocol][crate::model::policy_based_route::Filter::ip_protocol].
16891 ///
16892 /// # Example
16893 /// ```ignore,no_run
16894 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16895 /// let x = Filter::new().set_ip_protocol("example");
16896 /// ```
16897 pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16898 self.ip_protocol = v.into();
16899 self
16900 }
16901
16902 /// Sets the value of [src_range][crate::model::policy_based_route::Filter::src_range].
16903 ///
16904 /// # Example
16905 /// ```ignore,no_run
16906 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16907 /// let x = Filter::new().set_src_range("example");
16908 /// ```
16909 pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16910 self.src_range = v.into();
16911 self
16912 }
16913
16914 /// Sets the value of [dest_range][crate::model::policy_based_route::Filter::dest_range].
16915 ///
16916 /// # Example
16917 /// ```ignore,no_run
16918 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16919 /// let x = Filter::new().set_dest_range("example");
16920 /// ```
16921 pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16922 self.dest_range = v.into();
16923 self
16924 }
16925
16926 /// Sets the value of [protocol_version][crate::model::policy_based_route::Filter::protocol_version].
16927 ///
16928 /// # Example
16929 /// ```ignore,no_run
16930 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16931 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::filter::ProtocolVersion;
16932 /// let x0 = Filter::new().set_protocol_version(ProtocolVersion::Ipv4);
16933 /// ```
16934 pub fn set_protocol_version<
16935 T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
16936 >(
16937 mut self,
16938 v: T,
16939 ) -> Self {
16940 self.protocol_version = v.into();
16941 self
16942 }
16943 }
16944
16945 impl wkt::message::Message for Filter {
16946 fn typename() -> &'static str {
16947 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
16948 }
16949 }
16950
16951 /// Defines additional types related to [Filter].
16952 pub mod filter {
16953 #[allow(unused_imports)]
16954 use super::*;
16955
16956 /// The internet protocol version.
16957 ///
16958 /// # Working with unknown values
16959 ///
16960 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16961 /// additional enum variants at any time. Adding new variants is not considered
16962 /// a breaking change. Applications should write their code in anticipation of:
16963 ///
16964 /// - New values appearing in future releases of the client library, **and**
16965 /// - New values received dynamically, without application changes.
16966 ///
16967 /// Please consult the [Working with enums] section in the user guide for some
16968 /// guidelines.
16969 ///
16970 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16971 #[derive(Clone, Debug, PartialEq)]
16972 #[non_exhaustive]
16973 pub enum ProtocolVersion {
16974 /// Default value.
16975 Unspecified,
16976 /// The PBR is for IPv4 internet protocol traffic.
16977 Ipv4,
16978 /// If set, the enum was initialized with an unknown value.
16979 ///
16980 /// Applications can examine the value using [ProtocolVersion::value] or
16981 /// [ProtocolVersion::name].
16982 UnknownValue(protocol_version::UnknownValue),
16983 }
16984
16985 #[doc(hidden)]
16986 pub mod protocol_version {
16987 #[allow(unused_imports)]
16988 use super::*;
16989 #[derive(Clone, Debug, PartialEq)]
16990 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16991 }
16992
16993 impl ProtocolVersion {
16994 /// Gets the enum value.
16995 ///
16996 /// Returns `None` if the enum contains an unknown value deserialized from
16997 /// the string representation of enums.
16998 pub fn value(&self) -> std::option::Option<i32> {
16999 match self {
17000 Self::Unspecified => std::option::Option::Some(0),
17001 Self::Ipv4 => std::option::Option::Some(1),
17002 Self::UnknownValue(u) => u.0.value(),
17003 }
17004 }
17005
17006 /// Gets the enum value as a string.
17007 ///
17008 /// Returns `None` if the enum contains an unknown value deserialized from
17009 /// the integer representation of enums.
17010 pub fn name(&self) -> std::option::Option<&str> {
17011 match self {
17012 Self::Unspecified => std::option::Option::Some("PROTOCOL_VERSION_UNSPECIFIED"),
17013 Self::Ipv4 => std::option::Option::Some("IPV4"),
17014 Self::UnknownValue(u) => u.0.name(),
17015 }
17016 }
17017 }
17018
17019 impl std::default::Default for ProtocolVersion {
17020 fn default() -> Self {
17021 use std::convert::From;
17022 Self::from(0)
17023 }
17024 }
17025
17026 impl std::fmt::Display for ProtocolVersion {
17027 fn fmt(
17028 &self,
17029 f: &mut std::fmt::Formatter<'_>,
17030 ) -> std::result::Result<(), std::fmt::Error> {
17031 wkt::internal::display_enum(f, self.name(), self.value())
17032 }
17033 }
17034
17035 impl std::convert::From<i32> for ProtocolVersion {
17036 fn from(value: i32) -> Self {
17037 match value {
17038 0 => Self::Unspecified,
17039 1 => Self::Ipv4,
17040 _ => Self::UnknownValue(protocol_version::UnknownValue(
17041 wkt::internal::UnknownEnumValue::Integer(value),
17042 )),
17043 }
17044 }
17045 }
17046
17047 impl std::convert::From<&str> for ProtocolVersion {
17048 fn from(value: &str) -> Self {
17049 use std::string::ToString;
17050 match value {
17051 "PROTOCOL_VERSION_UNSPECIFIED" => Self::Unspecified,
17052 "IPV4" => Self::Ipv4,
17053 _ => Self::UnknownValue(protocol_version::UnknownValue(
17054 wkt::internal::UnknownEnumValue::String(value.to_string()),
17055 )),
17056 }
17057 }
17058 }
17059
17060 impl serde::ser::Serialize for ProtocolVersion {
17061 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17062 where
17063 S: serde::Serializer,
17064 {
17065 match self {
17066 Self::Unspecified => serializer.serialize_i32(0),
17067 Self::Ipv4 => serializer.serialize_i32(1),
17068 Self::UnknownValue(u) => u.0.serialize(serializer),
17069 }
17070 }
17071 }
17072
17073 impl<'de> serde::de::Deserialize<'de> for ProtocolVersion {
17074 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17075 where
17076 D: serde::Deserializer<'de>,
17077 {
17078 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProtocolVersion>::new(
17079 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion",
17080 ))
17081 }
17082 }
17083 }
17084
17085 /// Informational warning message.
17086 #[derive(Clone, Default, PartialEq)]
17087 #[non_exhaustive]
17088 pub struct Warnings {
17089 /// Output only. A warning code, if applicable.
17090 pub code: crate::model::policy_based_route::warnings::Code,
17091
17092 /// Output only. Metadata about this warning in key: value format. The key
17093 /// should provides more detail on the warning being returned. For example,
17094 /// for warnings where there are no results in a list request for a
17095 /// particular zone, this key might be scope and the key value might be the
17096 /// zone name. Other examples might be a key indicating a deprecated resource
17097 /// and a suggested replacement.
17098 pub data: std::collections::HashMap<std::string::String, std::string::String>,
17099
17100 /// Output only. A human-readable description of the warning code.
17101 pub warning_message: std::string::String,
17102
17103 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17104 }
17105
17106 impl Warnings {
17107 pub fn new() -> Self {
17108 std::default::Default::default()
17109 }
17110
17111 /// Sets the value of [code][crate::model::policy_based_route::Warnings::code].
17112 ///
17113 /// # Example
17114 /// ```ignore,no_run
17115 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17116 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::warnings::Code;
17117 /// let x0 = Warnings::new().set_code(Code::ResourceNotActive);
17118 /// let x1 = Warnings::new().set_code(Code::ResourceBeingModified);
17119 /// ```
17120 pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
17121 mut self,
17122 v: T,
17123 ) -> Self {
17124 self.code = v.into();
17125 self
17126 }
17127
17128 /// Sets the value of [data][crate::model::policy_based_route::Warnings::data].
17129 ///
17130 /// # Example
17131 /// ```ignore,no_run
17132 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17133 /// let x = Warnings::new().set_data([
17134 /// ("key0", "abc"),
17135 /// ("key1", "xyz"),
17136 /// ]);
17137 /// ```
17138 pub fn set_data<T, K, V>(mut self, v: T) -> Self
17139 where
17140 T: std::iter::IntoIterator<Item = (K, V)>,
17141 K: std::convert::Into<std::string::String>,
17142 V: std::convert::Into<std::string::String>,
17143 {
17144 use std::iter::Iterator;
17145 self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17146 self
17147 }
17148
17149 /// Sets the value of [warning_message][crate::model::policy_based_route::Warnings::warning_message].
17150 ///
17151 /// # Example
17152 /// ```ignore,no_run
17153 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17154 /// let x = Warnings::new().set_warning_message("example");
17155 /// ```
17156 pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
17157 mut self,
17158 v: T,
17159 ) -> Self {
17160 self.warning_message = v.into();
17161 self
17162 }
17163 }
17164
17165 impl wkt::message::Message for Warnings {
17166 fn typename() -> &'static str {
17167 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
17168 }
17169 }
17170
17171 /// Defines additional types related to [Warnings].
17172 pub mod warnings {
17173 #[allow(unused_imports)]
17174 use super::*;
17175
17176 /// Warning code for policy-based routing. Expect to add values in the
17177 /// future.
17178 ///
17179 /// # Working with unknown values
17180 ///
17181 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17182 /// additional enum variants at any time. Adding new variants is not considered
17183 /// a breaking change. Applications should write their code in anticipation of:
17184 ///
17185 /// - New values appearing in future releases of the client library, **and**
17186 /// - New values received dynamically, without application changes.
17187 ///
17188 /// Please consult the [Working with enums] section in the user guide for some
17189 /// guidelines.
17190 ///
17191 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17192 #[derive(Clone, Debug, PartialEq)]
17193 #[non_exhaustive]
17194 pub enum Code {
17195 /// Default value.
17196 WarningUnspecified,
17197 /// The policy-based route is not active and functioning. Common causes are
17198 /// that the dependent network was deleted or the resource project was
17199 /// turned off.
17200 ResourceNotActive,
17201 /// The policy-based route is being modified (e.g. created/deleted) at this
17202 /// time.
17203 ResourceBeingModified,
17204 /// If set, the enum was initialized with an unknown value.
17205 ///
17206 /// Applications can examine the value using [Code::value] or
17207 /// [Code::name].
17208 UnknownValue(code::UnknownValue),
17209 }
17210
17211 #[doc(hidden)]
17212 pub mod code {
17213 #[allow(unused_imports)]
17214 use super::*;
17215 #[derive(Clone, Debug, PartialEq)]
17216 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17217 }
17218
17219 impl Code {
17220 /// Gets the enum value.
17221 ///
17222 /// Returns `None` if the enum contains an unknown value deserialized from
17223 /// the string representation of enums.
17224 pub fn value(&self) -> std::option::Option<i32> {
17225 match self {
17226 Self::WarningUnspecified => std::option::Option::Some(0),
17227 Self::ResourceNotActive => std::option::Option::Some(1),
17228 Self::ResourceBeingModified => std::option::Option::Some(2),
17229 Self::UnknownValue(u) => u.0.value(),
17230 }
17231 }
17232
17233 /// Gets the enum value as a string.
17234 ///
17235 /// Returns `None` if the enum contains an unknown value deserialized from
17236 /// the integer representation of enums.
17237 pub fn name(&self) -> std::option::Option<&str> {
17238 match self {
17239 Self::WarningUnspecified => std::option::Option::Some("WARNING_UNSPECIFIED"),
17240 Self::ResourceNotActive => std::option::Option::Some("RESOURCE_NOT_ACTIVE"),
17241 Self::ResourceBeingModified => {
17242 std::option::Option::Some("RESOURCE_BEING_MODIFIED")
17243 }
17244 Self::UnknownValue(u) => u.0.name(),
17245 }
17246 }
17247 }
17248
17249 impl std::default::Default for Code {
17250 fn default() -> Self {
17251 use std::convert::From;
17252 Self::from(0)
17253 }
17254 }
17255
17256 impl std::fmt::Display for Code {
17257 fn fmt(
17258 &self,
17259 f: &mut std::fmt::Formatter<'_>,
17260 ) -> std::result::Result<(), std::fmt::Error> {
17261 wkt::internal::display_enum(f, self.name(), self.value())
17262 }
17263 }
17264
17265 impl std::convert::From<i32> for Code {
17266 fn from(value: i32) -> Self {
17267 match value {
17268 0 => Self::WarningUnspecified,
17269 1 => Self::ResourceNotActive,
17270 2 => Self::ResourceBeingModified,
17271 _ => Self::UnknownValue(code::UnknownValue(
17272 wkt::internal::UnknownEnumValue::Integer(value),
17273 )),
17274 }
17275 }
17276 }
17277
17278 impl std::convert::From<&str> for Code {
17279 fn from(value: &str) -> Self {
17280 use std::string::ToString;
17281 match value {
17282 "WARNING_UNSPECIFIED" => Self::WarningUnspecified,
17283 "RESOURCE_NOT_ACTIVE" => Self::ResourceNotActive,
17284 "RESOURCE_BEING_MODIFIED" => Self::ResourceBeingModified,
17285 _ => Self::UnknownValue(code::UnknownValue(
17286 wkt::internal::UnknownEnumValue::String(value.to_string()),
17287 )),
17288 }
17289 }
17290 }
17291
17292 impl serde::ser::Serialize for Code {
17293 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17294 where
17295 S: serde::Serializer,
17296 {
17297 match self {
17298 Self::WarningUnspecified => serializer.serialize_i32(0),
17299 Self::ResourceNotActive => serializer.serialize_i32(1),
17300 Self::ResourceBeingModified => serializer.serialize_i32(2),
17301 Self::UnknownValue(u) => u.0.serialize(serializer),
17302 }
17303 }
17304 }
17305
17306 impl<'de> serde::de::Deserialize<'de> for Code {
17307 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17308 where
17309 D: serde::Deserializer<'de>,
17310 {
17311 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
17312 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code",
17313 ))
17314 }
17315 }
17316 }
17317
17318 /// The other routing cases.
17319 ///
17320 /// # Working with unknown values
17321 ///
17322 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17323 /// additional enum variants at any time. Adding new variants is not considered
17324 /// a breaking change. Applications should write their code in anticipation of:
17325 ///
17326 /// - New values appearing in future releases of the client library, **and**
17327 /// - New values received dynamically, without application changes.
17328 ///
17329 /// Please consult the [Working with enums] section in the user guide for some
17330 /// guidelines.
17331 ///
17332 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17333 #[derive(Clone, Debug, PartialEq)]
17334 #[non_exhaustive]
17335 pub enum OtherRoutes {
17336 /// Default value.
17337 Unspecified,
17338 /// Use the routes from the default routing tables (system-generated routes,
17339 /// custom routes, peering route) to determine the next hop. This effectively
17340 /// excludes matching packets being applied on other PBRs with a lower
17341 /// priority.
17342 DefaultRouting,
17343 /// If set, the enum was initialized with an unknown value.
17344 ///
17345 /// Applications can examine the value using [OtherRoutes::value] or
17346 /// [OtherRoutes::name].
17347 UnknownValue(other_routes::UnknownValue),
17348 }
17349
17350 #[doc(hidden)]
17351 pub mod other_routes {
17352 #[allow(unused_imports)]
17353 use super::*;
17354 #[derive(Clone, Debug, PartialEq)]
17355 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17356 }
17357
17358 impl OtherRoutes {
17359 /// Gets the enum value.
17360 ///
17361 /// Returns `None` if the enum contains an unknown value deserialized from
17362 /// the string representation of enums.
17363 pub fn value(&self) -> std::option::Option<i32> {
17364 match self {
17365 Self::Unspecified => std::option::Option::Some(0),
17366 Self::DefaultRouting => std::option::Option::Some(1),
17367 Self::UnknownValue(u) => u.0.value(),
17368 }
17369 }
17370
17371 /// Gets the enum value as a string.
17372 ///
17373 /// Returns `None` if the enum contains an unknown value deserialized from
17374 /// the integer representation of enums.
17375 pub fn name(&self) -> std::option::Option<&str> {
17376 match self {
17377 Self::Unspecified => std::option::Option::Some("OTHER_ROUTES_UNSPECIFIED"),
17378 Self::DefaultRouting => std::option::Option::Some("DEFAULT_ROUTING"),
17379 Self::UnknownValue(u) => u.0.name(),
17380 }
17381 }
17382 }
17383
17384 impl std::default::Default for OtherRoutes {
17385 fn default() -> Self {
17386 use std::convert::From;
17387 Self::from(0)
17388 }
17389 }
17390
17391 impl std::fmt::Display for OtherRoutes {
17392 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17393 wkt::internal::display_enum(f, self.name(), self.value())
17394 }
17395 }
17396
17397 impl std::convert::From<i32> for OtherRoutes {
17398 fn from(value: i32) -> Self {
17399 match value {
17400 0 => Self::Unspecified,
17401 1 => Self::DefaultRouting,
17402 _ => Self::UnknownValue(other_routes::UnknownValue(
17403 wkt::internal::UnknownEnumValue::Integer(value),
17404 )),
17405 }
17406 }
17407 }
17408
17409 impl std::convert::From<&str> for OtherRoutes {
17410 fn from(value: &str) -> Self {
17411 use std::string::ToString;
17412 match value {
17413 "OTHER_ROUTES_UNSPECIFIED" => Self::Unspecified,
17414 "DEFAULT_ROUTING" => Self::DefaultRouting,
17415 _ => Self::UnknownValue(other_routes::UnknownValue(
17416 wkt::internal::UnknownEnumValue::String(value.to_string()),
17417 )),
17418 }
17419 }
17420 }
17421
17422 impl serde::ser::Serialize for OtherRoutes {
17423 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17424 where
17425 S: serde::Serializer,
17426 {
17427 match self {
17428 Self::Unspecified => serializer.serialize_i32(0),
17429 Self::DefaultRouting => serializer.serialize_i32(1),
17430 Self::UnknownValue(u) => u.0.serialize(serializer),
17431 }
17432 }
17433 }
17434
17435 impl<'de> serde::de::Deserialize<'de> for OtherRoutes {
17436 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17437 where
17438 D: serde::Deserializer<'de>,
17439 {
17440 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OtherRoutes>::new(
17441 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes",
17442 ))
17443 }
17444 }
17445
17446 /// Target specifies network endpoints that this policy-based route applies to.
17447 /// If no target is specified, the PBR will be installed on all network
17448 /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
17449 #[derive(Clone, Debug, PartialEq)]
17450 #[non_exhaustive]
17451 pub enum Target {
17452 /// Optional. VM instances that this policy-based route applies to.
17453 VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
17454 /// Optional. The interconnect attachments that this policy-based route
17455 /// applies to.
17456 InterconnectAttachment(
17457 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
17458 ),
17459 }
17460
17461 #[derive(Clone, Debug, PartialEq)]
17462 #[non_exhaustive]
17463 pub enum NextHop {
17464 /// Optional. The IP address of a global-access-enabled L4 ILB that is the
17465 /// next hop for matching packets. For this version, only nextHopIlbIp is
17466 /// supported.
17467 NextHopIlbIp(std::string::String),
17468 /// Optional. Other routes that will be referenced to determine the next hop
17469 /// of the packet.
17470 NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
17471 }
17472}
17473
17474/// Request for
17475/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
17476/// method.
17477///
17478/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
17479#[derive(Clone, Default, PartialEq)]
17480#[non_exhaustive]
17481pub struct ListPolicyBasedRoutesRequest {
17482 /// Required. The parent resource's name.
17483 pub parent: std::string::String,
17484
17485 /// The maximum number of results per page that should be returned.
17486 pub page_size: i32,
17487
17488 /// The page token.
17489 pub page_token: std::string::String,
17490
17491 /// A filter expression that filters the results listed in the response.
17492 pub filter: std::string::String,
17493
17494 /// Sort the results by a certain order.
17495 pub order_by: std::string::String,
17496
17497 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17498}
17499
17500impl ListPolicyBasedRoutesRequest {
17501 pub fn new() -> Self {
17502 std::default::Default::default()
17503 }
17504
17505 /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
17506 ///
17507 /// # Example
17508 /// ```ignore,no_run
17509 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17510 /// let x = ListPolicyBasedRoutesRequest::new().set_parent("example");
17511 /// ```
17512 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17513 self.parent = v.into();
17514 self
17515 }
17516
17517 /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
17518 ///
17519 /// # Example
17520 /// ```ignore,no_run
17521 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17522 /// let x = ListPolicyBasedRoutesRequest::new().set_page_size(42);
17523 /// ```
17524 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17525 self.page_size = v.into();
17526 self
17527 }
17528
17529 /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
17530 ///
17531 /// # Example
17532 /// ```ignore,no_run
17533 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17534 /// let x = ListPolicyBasedRoutesRequest::new().set_page_token("example");
17535 /// ```
17536 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17537 self.page_token = v.into();
17538 self
17539 }
17540
17541 /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
17542 ///
17543 /// # Example
17544 /// ```ignore,no_run
17545 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17546 /// let x = ListPolicyBasedRoutesRequest::new().set_filter("example");
17547 /// ```
17548 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17549 self.filter = v.into();
17550 self
17551 }
17552
17553 /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
17554 ///
17555 /// # Example
17556 /// ```ignore,no_run
17557 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17558 /// let x = ListPolicyBasedRoutesRequest::new().set_order_by("example");
17559 /// ```
17560 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17561 self.order_by = v.into();
17562 self
17563 }
17564}
17565
17566impl wkt::message::Message for ListPolicyBasedRoutesRequest {
17567 fn typename() -> &'static str {
17568 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
17569 }
17570}
17571
17572/// Response for
17573/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
17574/// method.
17575///
17576/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
17577#[derive(Clone, Default, PartialEq)]
17578#[non_exhaustive]
17579pub struct ListPolicyBasedRoutesResponse {
17580 /// Policy-based routes to be returned.
17581 pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,
17582
17583 /// The next pagination token in the List response. It should be used as
17584 /// page_token for the following request. An empty value means no more result.
17585 pub next_page_token: std::string::String,
17586
17587 /// Locations that could not be reached.
17588 pub unreachable: std::vec::Vec<std::string::String>,
17589
17590 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17591}
17592
17593impl ListPolicyBasedRoutesResponse {
17594 pub fn new() -> Self {
17595 std::default::Default::default()
17596 }
17597
17598 /// Sets the value of [policy_based_routes][crate::model::ListPolicyBasedRoutesResponse::policy_based_routes].
17599 ///
17600 /// # Example
17601 /// ```ignore,no_run
17602 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17603 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17604 /// let x = ListPolicyBasedRoutesResponse::new()
17605 /// .set_policy_based_routes([
17606 /// PolicyBasedRoute::default()/* use setters */,
17607 /// PolicyBasedRoute::default()/* use (different) setters */,
17608 /// ]);
17609 /// ```
17610 pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
17611 where
17612 T: std::iter::IntoIterator<Item = V>,
17613 V: std::convert::Into<crate::model::PolicyBasedRoute>,
17614 {
17615 use std::iter::Iterator;
17616 self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
17617 self
17618 }
17619
17620 /// Sets the value of [next_page_token][crate::model::ListPolicyBasedRoutesResponse::next_page_token].
17621 ///
17622 /// # Example
17623 /// ```ignore,no_run
17624 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17625 /// let x = ListPolicyBasedRoutesResponse::new().set_next_page_token("example");
17626 /// ```
17627 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17628 self.next_page_token = v.into();
17629 self
17630 }
17631
17632 /// Sets the value of [unreachable][crate::model::ListPolicyBasedRoutesResponse::unreachable].
17633 ///
17634 /// # Example
17635 /// ```ignore,no_run
17636 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17637 /// let x = ListPolicyBasedRoutesResponse::new().set_unreachable(["a", "b", "c"]);
17638 /// ```
17639 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17640 where
17641 T: std::iter::IntoIterator<Item = V>,
17642 V: std::convert::Into<std::string::String>,
17643 {
17644 use std::iter::Iterator;
17645 self.unreachable = v.into_iter().map(|i| i.into()).collect();
17646 self
17647 }
17648}
17649
17650impl wkt::message::Message for ListPolicyBasedRoutesResponse {
17651 fn typename() -> &'static str {
17652 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
17653 }
17654}
17655
17656#[doc(hidden)]
17657impl gax::paginator::internal::PageableResponse for ListPolicyBasedRoutesResponse {
17658 type PageItem = crate::model::PolicyBasedRoute;
17659
17660 fn items(self) -> std::vec::Vec<Self::PageItem> {
17661 self.policy_based_routes
17662 }
17663
17664 fn next_page_token(&self) -> std::string::String {
17665 use std::clone::Clone;
17666 self.next_page_token.clone()
17667 }
17668}
17669
17670/// Request for
17671/// [PolicyBasedRoutingService.GetPolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]
17672/// method.
17673///
17674/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]: crate::client::PolicyBasedRoutingService::get_policy_based_route
17675#[derive(Clone, Default, PartialEq)]
17676#[non_exhaustive]
17677pub struct GetPolicyBasedRouteRequest {
17678 /// Required. Name of the PolicyBasedRoute resource to get.
17679 pub name: std::string::String,
17680
17681 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17682}
17683
17684impl GetPolicyBasedRouteRequest {
17685 pub fn new() -> Self {
17686 std::default::Default::default()
17687 }
17688
17689 /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
17690 ///
17691 /// # Example
17692 /// ```ignore,no_run
17693 /// # use google_cloud_networkconnectivity_v1::model::GetPolicyBasedRouteRequest;
17694 /// let x = GetPolicyBasedRouteRequest::new().set_name("example");
17695 /// ```
17696 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17697 self.name = v.into();
17698 self
17699 }
17700}
17701
17702impl wkt::message::Message for GetPolicyBasedRouteRequest {
17703 fn typename() -> &'static str {
17704 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
17705 }
17706}
17707
17708/// Request for
17709/// [PolicyBasedRoutingService.CreatePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]
17710/// method.
17711///
17712/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::create_policy_based_route
17713#[derive(Clone, Default, PartialEq)]
17714#[non_exhaustive]
17715pub struct CreatePolicyBasedRouteRequest {
17716 /// Required. The parent resource's name of the PolicyBasedRoute.
17717 pub parent: std::string::String,
17718
17719 /// Required. Unique id for the policy-based route to create. Provided by the
17720 /// client when the resource is created. The name must comply with
17721 /// <https://google.aip.dev/122#resource-id-segments>. Specifically, the name
17722 /// must be 1-63 characters long and match the regular expression
17723 /// [a-z]([a-z0-9-]*[a-z0-9])?. The first character must be a lowercase letter,
17724 /// and all following characters (except for the last character) must be a
17725 /// dash, lowercase letter, or digit. The last character must be a lowercase
17726 /// letter or digit.
17727 pub policy_based_route_id: std::string::String,
17728
17729 /// Required. Initial values for a new policy-based route.
17730 pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,
17731
17732 /// Optional. An optional request ID to identify requests. Specify a unique
17733 /// request ID so that if you must retry your request, the server knows to
17734 /// ignore the request if it has already been completed. The server guarantees
17735 /// that for at least 60 minutes since the first request.
17736 ///
17737 /// For example, consider a situation where you make an initial request and
17738 /// the request times out. If you make the request again with the same request
17739 /// ID, the server can check if original operation with the same request ID
17740 /// was received, and if so, ignores the second request. This prevents clients
17741 /// from accidentally creating duplicate commitments.
17742 ///
17743 /// The request ID must be a valid UUID with the exception that zero UUID is
17744 /// not supported (00000000-0000-0000-0000-000000000000).
17745 pub request_id: std::string::String,
17746
17747 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17748}
17749
17750impl CreatePolicyBasedRouteRequest {
17751 pub fn new() -> Self {
17752 std::default::Default::default()
17753 }
17754
17755 /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
17756 ///
17757 /// # Example
17758 /// ```ignore,no_run
17759 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17760 /// let x = CreatePolicyBasedRouteRequest::new().set_parent("example");
17761 /// ```
17762 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17763 self.parent = v.into();
17764 self
17765 }
17766
17767 /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
17768 ///
17769 /// # Example
17770 /// ```ignore,no_run
17771 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17772 /// let x = CreatePolicyBasedRouteRequest::new().set_policy_based_route_id("example");
17773 /// ```
17774 pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
17775 mut self,
17776 v: T,
17777 ) -> Self {
17778 self.policy_based_route_id = v.into();
17779 self
17780 }
17781
17782 /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
17783 ///
17784 /// # Example
17785 /// ```ignore,no_run
17786 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17787 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17788 /// let x = CreatePolicyBasedRouteRequest::new().set_policy_based_route(PolicyBasedRoute::default()/* use setters */);
17789 /// ```
17790 pub fn set_policy_based_route<T>(mut self, v: T) -> Self
17791 where
17792 T: std::convert::Into<crate::model::PolicyBasedRoute>,
17793 {
17794 self.policy_based_route = std::option::Option::Some(v.into());
17795 self
17796 }
17797
17798 /// Sets or clears the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
17799 ///
17800 /// # Example
17801 /// ```ignore,no_run
17802 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17803 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17804 /// let x = CreatePolicyBasedRouteRequest::new().set_or_clear_policy_based_route(Some(PolicyBasedRoute::default()/* use setters */));
17805 /// let x = CreatePolicyBasedRouteRequest::new().set_or_clear_policy_based_route(None::<PolicyBasedRoute>);
17806 /// ```
17807 pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
17808 where
17809 T: std::convert::Into<crate::model::PolicyBasedRoute>,
17810 {
17811 self.policy_based_route = v.map(|x| x.into());
17812 self
17813 }
17814
17815 /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
17816 ///
17817 /// # Example
17818 /// ```ignore,no_run
17819 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17820 /// let x = CreatePolicyBasedRouteRequest::new().set_request_id("example");
17821 /// ```
17822 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17823 self.request_id = v.into();
17824 self
17825 }
17826}
17827
17828impl wkt::message::Message for CreatePolicyBasedRouteRequest {
17829 fn typename() -> &'static str {
17830 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
17831 }
17832}
17833
17834/// Request for
17835/// [PolicyBasedRoutingService.DeletePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]
17836/// method.
17837///
17838/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::delete_policy_based_route
17839#[derive(Clone, Default, PartialEq)]
17840#[non_exhaustive]
17841pub struct DeletePolicyBasedRouteRequest {
17842 /// Required. Name of the policy-based route resource to delete.
17843 pub name: std::string::String,
17844
17845 /// Optional. An optional request ID to identify requests. Specify a unique
17846 /// request ID so that if you must retry your request, the server knows to
17847 /// ignore the request if it has already been completed. The server guarantees
17848 /// that for at least 60 minutes after the first request.
17849 ///
17850 /// For example, consider a situation where you make an initial request and
17851 /// the request times out. If you make the request again with the same request
17852 /// ID, the server can check if original operation with the same request ID
17853 /// was received, and if so, ignores the second request. This prevents clients
17854 /// from accidentally creating duplicate commitments.
17855 ///
17856 /// The request ID must be a valid UUID with the exception that zero UUID is
17857 /// not supported (00000000-0000-0000-0000-000000000000).
17858 pub request_id: std::string::String,
17859
17860 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17861}
17862
17863impl DeletePolicyBasedRouteRequest {
17864 pub fn new() -> Self {
17865 std::default::Default::default()
17866 }
17867
17868 /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
17869 ///
17870 /// # Example
17871 /// ```ignore,no_run
17872 /// # use google_cloud_networkconnectivity_v1::model::DeletePolicyBasedRouteRequest;
17873 /// let x = DeletePolicyBasedRouteRequest::new().set_name("example");
17874 /// ```
17875 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17876 self.name = v.into();
17877 self
17878 }
17879
17880 /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
17881 ///
17882 /// # Example
17883 /// ```ignore,no_run
17884 /// # use google_cloud_networkconnectivity_v1::model::DeletePolicyBasedRouteRequest;
17885 /// let x = DeletePolicyBasedRouteRequest::new().set_request_id("example");
17886 /// ```
17887 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17888 self.request_id = v.into();
17889 self
17890 }
17891}
17892
17893impl wkt::message::Message for DeletePolicyBasedRouteRequest {
17894 fn typename() -> &'static str {
17895 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
17896 }
17897}
17898
17899/// The infrastructure used for connections between consumers/producers.
17900///
17901/// # Working with unknown values
17902///
17903/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17904/// additional enum variants at any time. Adding new variants is not considered
17905/// a breaking change. Applications should write their code in anticipation of:
17906///
17907/// - New values appearing in future releases of the client library, **and**
17908/// - New values received dynamically, without application changes.
17909///
17910/// Please consult the [Working with enums] section in the user guide for some
17911/// guidelines.
17912///
17913/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17914#[derive(Clone, Debug, PartialEq)]
17915#[non_exhaustive]
17916pub enum Infrastructure {
17917 /// An invalid infrastructure as the default case.
17918 Unspecified,
17919 /// Private Service Connect is used for connections.
17920 Psc,
17921 /// If set, the enum was initialized with an unknown value.
17922 ///
17923 /// Applications can examine the value using [Infrastructure::value] or
17924 /// [Infrastructure::name].
17925 UnknownValue(infrastructure::UnknownValue),
17926}
17927
17928#[doc(hidden)]
17929pub mod infrastructure {
17930 #[allow(unused_imports)]
17931 use super::*;
17932 #[derive(Clone, Debug, PartialEq)]
17933 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17934}
17935
17936impl Infrastructure {
17937 /// Gets the enum value.
17938 ///
17939 /// Returns `None` if the enum contains an unknown value deserialized from
17940 /// the string representation of enums.
17941 pub fn value(&self) -> std::option::Option<i32> {
17942 match self {
17943 Self::Unspecified => std::option::Option::Some(0),
17944 Self::Psc => std::option::Option::Some(1),
17945 Self::UnknownValue(u) => u.0.value(),
17946 }
17947 }
17948
17949 /// Gets the enum value as a string.
17950 ///
17951 /// Returns `None` if the enum contains an unknown value deserialized from
17952 /// the integer representation of enums.
17953 pub fn name(&self) -> std::option::Option<&str> {
17954 match self {
17955 Self::Unspecified => std::option::Option::Some("INFRASTRUCTURE_UNSPECIFIED"),
17956 Self::Psc => std::option::Option::Some("PSC"),
17957 Self::UnknownValue(u) => u.0.name(),
17958 }
17959 }
17960}
17961
17962impl std::default::Default for Infrastructure {
17963 fn default() -> Self {
17964 use std::convert::From;
17965 Self::from(0)
17966 }
17967}
17968
17969impl std::fmt::Display for Infrastructure {
17970 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17971 wkt::internal::display_enum(f, self.name(), self.value())
17972 }
17973}
17974
17975impl std::convert::From<i32> for Infrastructure {
17976 fn from(value: i32) -> Self {
17977 match value {
17978 0 => Self::Unspecified,
17979 1 => Self::Psc,
17980 _ => Self::UnknownValue(infrastructure::UnknownValue(
17981 wkt::internal::UnknownEnumValue::Integer(value),
17982 )),
17983 }
17984 }
17985}
17986
17987impl std::convert::From<&str> for Infrastructure {
17988 fn from(value: &str) -> Self {
17989 use std::string::ToString;
17990 match value {
17991 "INFRASTRUCTURE_UNSPECIFIED" => Self::Unspecified,
17992 "PSC" => Self::Psc,
17993 _ => Self::UnknownValue(infrastructure::UnknownValue(
17994 wkt::internal::UnknownEnumValue::String(value.to_string()),
17995 )),
17996 }
17997 }
17998}
17999
18000impl serde::ser::Serialize for Infrastructure {
18001 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18002 where
18003 S: serde::Serializer,
18004 {
18005 match self {
18006 Self::Unspecified => serializer.serialize_i32(0),
18007 Self::Psc => serializer.serialize_i32(1),
18008 Self::UnknownValue(u) => u.0.serialize(serializer),
18009 }
18010 }
18011}
18012
18013impl<'de> serde::de::Deserialize<'de> for Infrastructure {
18014 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18015 where
18016 D: serde::Deserializer<'de>,
18017 {
18018 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Infrastructure>::new(
18019 ".google.cloud.networkconnectivity.v1.Infrastructure",
18020 ))
18021 }
18022}
18023
18024/// The error type indicates whether a connection error is consumer facing,
18025/// producer facing or system internal.
18026///
18027/// # Working with unknown values
18028///
18029/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18030/// additional enum variants at any time. Adding new variants is not considered
18031/// a breaking change. Applications should write their code in anticipation of:
18032///
18033/// - New values appearing in future releases of the client library, **and**
18034/// - New values received dynamically, without application changes.
18035///
18036/// Please consult the [Working with enums] section in the user guide for some
18037/// guidelines.
18038///
18039/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18040#[derive(Clone, Debug, PartialEq)]
18041#[non_exhaustive]
18042pub enum ConnectionErrorType {
18043 /// An invalid error type as the default case.
18044 Unspecified,
18045 /// The error is due to Service Automation system internal.
18046 ErrorInternal,
18047 /// The error is due to the setup on consumer side.
18048 ErrorConsumerSide,
18049 /// The error is due to the setup on producer side.
18050 ErrorProducerSide,
18051 /// If set, the enum was initialized with an unknown value.
18052 ///
18053 /// Applications can examine the value using [ConnectionErrorType::value] or
18054 /// [ConnectionErrorType::name].
18055 UnknownValue(connection_error_type::UnknownValue),
18056}
18057
18058#[doc(hidden)]
18059pub mod connection_error_type {
18060 #[allow(unused_imports)]
18061 use super::*;
18062 #[derive(Clone, Debug, PartialEq)]
18063 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18064}
18065
18066impl ConnectionErrorType {
18067 /// Gets the enum value.
18068 ///
18069 /// Returns `None` if the enum contains an unknown value deserialized from
18070 /// the string representation of enums.
18071 pub fn value(&self) -> std::option::Option<i32> {
18072 match self {
18073 Self::Unspecified => std::option::Option::Some(0),
18074 Self::ErrorInternal => std::option::Option::Some(1),
18075 Self::ErrorConsumerSide => std::option::Option::Some(2),
18076 Self::ErrorProducerSide => std::option::Option::Some(3),
18077 Self::UnknownValue(u) => u.0.value(),
18078 }
18079 }
18080
18081 /// Gets the enum value as a string.
18082 ///
18083 /// Returns `None` if the enum contains an unknown value deserialized from
18084 /// the integer representation of enums.
18085 pub fn name(&self) -> std::option::Option<&str> {
18086 match self {
18087 Self::Unspecified => std::option::Option::Some("CONNECTION_ERROR_TYPE_UNSPECIFIED"),
18088 Self::ErrorInternal => std::option::Option::Some("ERROR_INTERNAL"),
18089 Self::ErrorConsumerSide => std::option::Option::Some("ERROR_CONSUMER_SIDE"),
18090 Self::ErrorProducerSide => std::option::Option::Some("ERROR_PRODUCER_SIDE"),
18091 Self::UnknownValue(u) => u.0.name(),
18092 }
18093 }
18094}
18095
18096impl std::default::Default for ConnectionErrorType {
18097 fn default() -> Self {
18098 use std::convert::From;
18099 Self::from(0)
18100 }
18101}
18102
18103impl std::fmt::Display for ConnectionErrorType {
18104 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18105 wkt::internal::display_enum(f, self.name(), self.value())
18106 }
18107}
18108
18109impl std::convert::From<i32> for ConnectionErrorType {
18110 fn from(value: i32) -> Self {
18111 match value {
18112 0 => Self::Unspecified,
18113 1 => Self::ErrorInternal,
18114 2 => Self::ErrorConsumerSide,
18115 3 => Self::ErrorProducerSide,
18116 _ => Self::UnknownValue(connection_error_type::UnknownValue(
18117 wkt::internal::UnknownEnumValue::Integer(value),
18118 )),
18119 }
18120 }
18121}
18122
18123impl std::convert::From<&str> for ConnectionErrorType {
18124 fn from(value: &str) -> Self {
18125 use std::string::ToString;
18126 match value {
18127 "CONNECTION_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
18128 "ERROR_INTERNAL" => Self::ErrorInternal,
18129 "ERROR_CONSUMER_SIDE" => Self::ErrorConsumerSide,
18130 "ERROR_PRODUCER_SIDE" => Self::ErrorProducerSide,
18131 _ => Self::UnknownValue(connection_error_type::UnknownValue(
18132 wkt::internal::UnknownEnumValue::String(value.to_string()),
18133 )),
18134 }
18135 }
18136}
18137
18138impl serde::ser::Serialize for ConnectionErrorType {
18139 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18140 where
18141 S: serde::Serializer,
18142 {
18143 match self {
18144 Self::Unspecified => serializer.serialize_i32(0),
18145 Self::ErrorInternal => serializer.serialize_i32(1),
18146 Self::ErrorConsumerSide => serializer.serialize_i32(2),
18147 Self::ErrorProducerSide => serializer.serialize_i32(3),
18148 Self::UnknownValue(u) => u.0.serialize(serializer),
18149 }
18150 }
18151}
18152
18153impl<'de> serde::de::Deserialize<'de> for ConnectionErrorType {
18154 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18155 where
18156 D: serde::Deserializer<'de>,
18157 {
18158 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionErrorType>::new(
18159 ".google.cloud.networkconnectivity.v1.ConnectionErrorType",
18160 ))
18161 }
18162}
18163
18164/// The requested IP version for the PSC connection.
18165///
18166/// # Working with unknown values
18167///
18168/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18169/// additional enum variants at any time. Adding new variants is not considered
18170/// a breaking change. Applications should write their code in anticipation of:
18171///
18172/// - New values appearing in future releases of the client library, **and**
18173/// - New values received dynamically, without application changes.
18174///
18175/// Please consult the [Working with enums] section in the user guide for some
18176/// guidelines.
18177///
18178/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18179#[derive(Clone, Debug, PartialEq)]
18180#[non_exhaustive]
18181pub enum IPVersion {
18182 /// Default value. We will use IPv4 or IPv6 depending on the IP version of
18183 /// first available subnetwork.
18184 Unspecified,
18185 /// Will use IPv4 only.
18186 Ipv4,
18187 /// Will use IPv6 only.
18188 Ipv6,
18189 /// If set, the enum was initialized with an unknown value.
18190 ///
18191 /// Applications can examine the value using [IPVersion::value] or
18192 /// [IPVersion::name].
18193 UnknownValue(ip_version::UnknownValue),
18194}
18195
18196#[doc(hidden)]
18197pub mod ip_version {
18198 #[allow(unused_imports)]
18199 use super::*;
18200 #[derive(Clone, Debug, PartialEq)]
18201 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18202}
18203
18204impl IPVersion {
18205 /// Gets the enum value.
18206 ///
18207 /// Returns `None` if the enum contains an unknown value deserialized from
18208 /// the string representation of enums.
18209 pub fn value(&self) -> std::option::Option<i32> {
18210 match self {
18211 Self::Unspecified => std::option::Option::Some(0),
18212 Self::Ipv4 => std::option::Option::Some(1),
18213 Self::Ipv6 => std::option::Option::Some(2),
18214 Self::UnknownValue(u) => u.0.value(),
18215 }
18216 }
18217
18218 /// Gets the enum value as a string.
18219 ///
18220 /// Returns `None` if the enum contains an unknown value deserialized from
18221 /// the integer representation of enums.
18222 pub fn name(&self) -> std::option::Option<&str> {
18223 match self {
18224 Self::Unspecified => std::option::Option::Some("IP_VERSION_UNSPECIFIED"),
18225 Self::Ipv4 => std::option::Option::Some("IPV4"),
18226 Self::Ipv6 => std::option::Option::Some("IPV6"),
18227 Self::UnknownValue(u) => u.0.name(),
18228 }
18229 }
18230}
18231
18232impl std::default::Default for IPVersion {
18233 fn default() -> Self {
18234 use std::convert::From;
18235 Self::from(0)
18236 }
18237}
18238
18239impl std::fmt::Display for IPVersion {
18240 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18241 wkt::internal::display_enum(f, self.name(), self.value())
18242 }
18243}
18244
18245impl std::convert::From<i32> for IPVersion {
18246 fn from(value: i32) -> Self {
18247 match value {
18248 0 => Self::Unspecified,
18249 1 => Self::Ipv4,
18250 2 => Self::Ipv6,
18251 _ => Self::UnknownValue(ip_version::UnknownValue(
18252 wkt::internal::UnknownEnumValue::Integer(value),
18253 )),
18254 }
18255 }
18256}
18257
18258impl std::convert::From<&str> for IPVersion {
18259 fn from(value: &str) -> Self {
18260 use std::string::ToString;
18261 match value {
18262 "IP_VERSION_UNSPECIFIED" => Self::Unspecified,
18263 "IPV4" => Self::Ipv4,
18264 "IPV6" => Self::Ipv6,
18265 _ => Self::UnknownValue(ip_version::UnknownValue(
18266 wkt::internal::UnknownEnumValue::String(value.to_string()),
18267 )),
18268 }
18269 }
18270}
18271
18272impl serde::ser::Serialize for IPVersion {
18273 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18274 where
18275 S: serde::Serializer,
18276 {
18277 match self {
18278 Self::Unspecified => serializer.serialize_i32(0),
18279 Self::Ipv4 => serializer.serialize_i32(1),
18280 Self::Ipv6 => serializer.serialize_i32(2),
18281 Self::UnknownValue(u) => u.0.serialize(serializer),
18282 }
18283 }
18284}
18285
18286impl<'de> serde::de::Deserialize<'de> for IPVersion {
18287 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18288 where
18289 D: serde::Deserializer<'de>,
18290 {
18291 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IPVersion>::new(
18292 ".google.cloud.networkconnectivity.v1.IPVersion",
18293 ))
18294 }
18295}
18296
18297/// Supported features for a location
18298///
18299/// # Working with unknown values
18300///
18301/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18302/// additional enum variants at any time. Adding new variants is not considered
18303/// a breaking change. Applications should write their code in anticipation of:
18304///
18305/// - New values appearing in future releases of the client library, **and**
18306/// - New values received dynamically, without application changes.
18307///
18308/// Please consult the [Working with enums] section in the user guide for some
18309/// guidelines.
18310///
18311/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18312#[derive(Clone, Debug, PartialEq)]
18313#[non_exhaustive]
18314pub enum LocationFeature {
18315 /// No publicly supported feature in this location
18316 Unspecified,
18317 /// Site-to-cloud spokes are supported in this location
18318 SiteToCloudSpokes,
18319 /// Site-to-site spokes are supported in this location
18320 SiteToSiteSpokes,
18321 /// If set, the enum was initialized with an unknown value.
18322 ///
18323 /// Applications can examine the value using [LocationFeature::value] or
18324 /// [LocationFeature::name].
18325 UnknownValue(location_feature::UnknownValue),
18326}
18327
18328#[doc(hidden)]
18329pub mod location_feature {
18330 #[allow(unused_imports)]
18331 use super::*;
18332 #[derive(Clone, Debug, PartialEq)]
18333 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18334}
18335
18336impl LocationFeature {
18337 /// Gets the enum value.
18338 ///
18339 /// Returns `None` if the enum contains an unknown value deserialized from
18340 /// the string representation of enums.
18341 pub fn value(&self) -> std::option::Option<i32> {
18342 match self {
18343 Self::Unspecified => std::option::Option::Some(0),
18344 Self::SiteToCloudSpokes => std::option::Option::Some(1),
18345 Self::SiteToSiteSpokes => std::option::Option::Some(2),
18346 Self::UnknownValue(u) => u.0.value(),
18347 }
18348 }
18349
18350 /// Gets the enum value as a string.
18351 ///
18352 /// Returns `None` if the enum contains an unknown value deserialized from
18353 /// the integer representation of enums.
18354 pub fn name(&self) -> std::option::Option<&str> {
18355 match self {
18356 Self::Unspecified => std::option::Option::Some("LOCATION_FEATURE_UNSPECIFIED"),
18357 Self::SiteToCloudSpokes => std::option::Option::Some("SITE_TO_CLOUD_SPOKES"),
18358 Self::SiteToSiteSpokes => std::option::Option::Some("SITE_TO_SITE_SPOKES"),
18359 Self::UnknownValue(u) => u.0.name(),
18360 }
18361 }
18362}
18363
18364impl std::default::Default for LocationFeature {
18365 fn default() -> Self {
18366 use std::convert::From;
18367 Self::from(0)
18368 }
18369}
18370
18371impl std::fmt::Display for LocationFeature {
18372 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18373 wkt::internal::display_enum(f, self.name(), self.value())
18374 }
18375}
18376
18377impl std::convert::From<i32> for LocationFeature {
18378 fn from(value: i32) -> Self {
18379 match value {
18380 0 => Self::Unspecified,
18381 1 => Self::SiteToCloudSpokes,
18382 2 => Self::SiteToSiteSpokes,
18383 _ => Self::UnknownValue(location_feature::UnknownValue(
18384 wkt::internal::UnknownEnumValue::Integer(value),
18385 )),
18386 }
18387 }
18388}
18389
18390impl std::convert::From<&str> for LocationFeature {
18391 fn from(value: &str) -> Self {
18392 use std::string::ToString;
18393 match value {
18394 "LOCATION_FEATURE_UNSPECIFIED" => Self::Unspecified,
18395 "SITE_TO_CLOUD_SPOKES" => Self::SiteToCloudSpokes,
18396 "SITE_TO_SITE_SPOKES" => Self::SiteToSiteSpokes,
18397 _ => Self::UnknownValue(location_feature::UnknownValue(
18398 wkt::internal::UnknownEnumValue::String(value.to_string()),
18399 )),
18400 }
18401 }
18402}
18403
18404impl serde::ser::Serialize for LocationFeature {
18405 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18406 where
18407 S: serde::Serializer,
18408 {
18409 match self {
18410 Self::Unspecified => serializer.serialize_i32(0),
18411 Self::SiteToCloudSpokes => serializer.serialize_i32(1),
18412 Self::SiteToSiteSpokes => serializer.serialize_i32(2),
18413 Self::UnknownValue(u) => u.0.serialize(serializer),
18414 }
18415 }
18416}
18417
18418impl<'de> serde::de::Deserialize<'de> for LocationFeature {
18419 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18420 where
18421 D: serde::Deserializer<'de>,
18422 {
18423 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationFeature>::new(
18424 ".google.cloud.networkconnectivity.v1.LocationFeature",
18425 ))
18426 }
18427}
18428
18429/// The route's type
18430///
18431/// # Working with unknown values
18432///
18433/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18434/// additional enum variants at any time. Adding new variants is not considered
18435/// a breaking change. Applications should write their code in anticipation of:
18436///
18437/// - New values appearing in future releases of the client library, **and**
18438/// - New values received dynamically, without application changes.
18439///
18440/// Please consult the [Working with enums] section in the user guide for some
18441/// guidelines.
18442///
18443/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18444#[derive(Clone, Debug, PartialEq)]
18445#[non_exhaustive]
18446pub enum RouteType {
18447 /// No route type information specified
18448 Unspecified,
18449 /// The route leads to a destination within the primary address range of the
18450 /// VPC network's subnet.
18451 VpcPrimarySubnet,
18452 /// The route leads to a destination within the secondary address range of the
18453 /// VPC network's subnet.
18454 VpcSecondarySubnet,
18455 /// The route leads to a destination in a dynamic route. Dynamic routes are
18456 /// derived from Border Gateway Protocol (BGP) advertisements received from an
18457 /// NCC hybrid spoke.
18458 DynamicRoute,
18459 /// If set, the enum was initialized with an unknown value.
18460 ///
18461 /// Applications can examine the value using [RouteType::value] or
18462 /// [RouteType::name].
18463 UnknownValue(route_type::UnknownValue),
18464}
18465
18466#[doc(hidden)]
18467pub mod route_type {
18468 #[allow(unused_imports)]
18469 use super::*;
18470 #[derive(Clone, Debug, PartialEq)]
18471 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18472}
18473
18474impl RouteType {
18475 /// Gets the enum value.
18476 ///
18477 /// Returns `None` if the enum contains an unknown value deserialized from
18478 /// the string representation of enums.
18479 pub fn value(&self) -> std::option::Option<i32> {
18480 match self {
18481 Self::Unspecified => std::option::Option::Some(0),
18482 Self::VpcPrimarySubnet => std::option::Option::Some(1),
18483 Self::VpcSecondarySubnet => std::option::Option::Some(2),
18484 Self::DynamicRoute => std::option::Option::Some(3),
18485 Self::UnknownValue(u) => u.0.value(),
18486 }
18487 }
18488
18489 /// Gets the enum value as a string.
18490 ///
18491 /// Returns `None` if the enum contains an unknown value deserialized from
18492 /// the integer representation of enums.
18493 pub fn name(&self) -> std::option::Option<&str> {
18494 match self {
18495 Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
18496 Self::VpcPrimarySubnet => std::option::Option::Some("VPC_PRIMARY_SUBNET"),
18497 Self::VpcSecondarySubnet => std::option::Option::Some("VPC_SECONDARY_SUBNET"),
18498 Self::DynamicRoute => std::option::Option::Some("DYNAMIC_ROUTE"),
18499 Self::UnknownValue(u) => u.0.name(),
18500 }
18501 }
18502}
18503
18504impl std::default::Default for RouteType {
18505 fn default() -> Self {
18506 use std::convert::From;
18507 Self::from(0)
18508 }
18509}
18510
18511impl std::fmt::Display for RouteType {
18512 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18513 wkt::internal::display_enum(f, self.name(), self.value())
18514 }
18515}
18516
18517impl std::convert::From<i32> for RouteType {
18518 fn from(value: i32) -> Self {
18519 match value {
18520 0 => Self::Unspecified,
18521 1 => Self::VpcPrimarySubnet,
18522 2 => Self::VpcSecondarySubnet,
18523 3 => Self::DynamicRoute,
18524 _ => Self::UnknownValue(route_type::UnknownValue(
18525 wkt::internal::UnknownEnumValue::Integer(value),
18526 )),
18527 }
18528 }
18529}
18530
18531impl std::convert::From<&str> for RouteType {
18532 fn from(value: &str) -> Self {
18533 use std::string::ToString;
18534 match value {
18535 "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
18536 "VPC_PRIMARY_SUBNET" => Self::VpcPrimarySubnet,
18537 "VPC_SECONDARY_SUBNET" => Self::VpcSecondarySubnet,
18538 "DYNAMIC_ROUTE" => Self::DynamicRoute,
18539 _ => Self::UnknownValue(route_type::UnknownValue(
18540 wkt::internal::UnknownEnumValue::String(value.to_string()),
18541 )),
18542 }
18543 }
18544}
18545
18546impl serde::ser::Serialize for RouteType {
18547 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18548 where
18549 S: serde::Serializer,
18550 {
18551 match self {
18552 Self::Unspecified => serializer.serialize_i32(0),
18553 Self::VpcPrimarySubnet => serializer.serialize_i32(1),
18554 Self::VpcSecondarySubnet => serializer.serialize_i32(2),
18555 Self::DynamicRoute => serializer.serialize_i32(3),
18556 Self::UnknownValue(u) => u.0.serialize(serializer),
18557 }
18558 }
18559}
18560
18561impl<'de> serde::de::Deserialize<'de> for RouteType {
18562 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18563 where
18564 D: serde::Deserializer<'de>,
18565 {
18566 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
18567 ".google.cloud.networkconnectivity.v1.RouteType",
18568 ))
18569 }
18570}
18571
18572/// The State enum represents the lifecycle stage of a Network Connectivity
18573/// Center resource.
18574///
18575/// # Working with unknown values
18576///
18577/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18578/// additional enum variants at any time. Adding new variants is not considered
18579/// a breaking change. Applications should write their code in anticipation of:
18580///
18581/// - New values appearing in future releases of the client library, **and**
18582/// - New values received dynamically, without application changes.
18583///
18584/// Please consult the [Working with enums] section in the user guide for some
18585/// guidelines.
18586///
18587/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18588#[derive(Clone, Debug, PartialEq)]
18589#[non_exhaustive]
18590pub enum State {
18591 /// No state information available
18592 Unspecified,
18593 /// The resource's create operation is in progress.
18594 Creating,
18595 /// The resource is active
18596 Active,
18597 /// The resource's delete operation is in progress.
18598 Deleting,
18599 /// The resource's accept operation is in progress.
18600 Accepting,
18601 /// The resource's reject operation is in progress.
18602 Rejecting,
18603 /// The resource's update operation is in progress.
18604 Updating,
18605 /// The resource is inactive.
18606 Inactive,
18607 /// The hub associated with this spoke resource has been deleted.
18608 /// This state applies to spoke resources only.
18609 Obsolete,
18610 /// The resource is in an undefined state due to resource creation or deletion
18611 /// failure. You can try to delete the resource later or contact support for
18612 /// help.
18613 Failed,
18614 /// If set, the enum was initialized with an unknown value.
18615 ///
18616 /// Applications can examine the value using [State::value] or
18617 /// [State::name].
18618 UnknownValue(state::UnknownValue),
18619}
18620
18621#[doc(hidden)]
18622pub mod state {
18623 #[allow(unused_imports)]
18624 use super::*;
18625 #[derive(Clone, Debug, PartialEq)]
18626 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18627}
18628
18629impl State {
18630 /// Gets the enum value.
18631 ///
18632 /// Returns `None` if the enum contains an unknown value deserialized from
18633 /// the string representation of enums.
18634 pub fn value(&self) -> std::option::Option<i32> {
18635 match self {
18636 Self::Unspecified => std::option::Option::Some(0),
18637 Self::Creating => std::option::Option::Some(1),
18638 Self::Active => std::option::Option::Some(2),
18639 Self::Deleting => std::option::Option::Some(3),
18640 Self::Accepting => std::option::Option::Some(8),
18641 Self::Rejecting => std::option::Option::Some(9),
18642 Self::Updating => std::option::Option::Some(6),
18643 Self::Inactive => std::option::Option::Some(7),
18644 Self::Obsolete => std::option::Option::Some(10),
18645 Self::Failed => std::option::Option::Some(11),
18646 Self::UnknownValue(u) => u.0.value(),
18647 }
18648 }
18649
18650 /// Gets the enum value as a string.
18651 ///
18652 /// Returns `None` if the enum contains an unknown value deserialized from
18653 /// the integer representation of enums.
18654 pub fn name(&self) -> std::option::Option<&str> {
18655 match self {
18656 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18657 Self::Creating => std::option::Option::Some("CREATING"),
18658 Self::Active => std::option::Option::Some("ACTIVE"),
18659 Self::Deleting => std::option::Option::Some("DELETING"),
18660 Self::Accepting => std::option::Option::Some("ACCEPTING"),
18661 Self::Rejecting => std::option::Option::Some("REJECTING"),
18662 Self::Updating => std::option::Option::Some("UPDATING"),
18663 Self::Inactive => std::option::Option::Some("INACTIVE"),
18664 Self::Obsolete => std::option::Option::Some("OBSOLETE"),
18665 Self::Failed => std::option::Option::Some("FAILED"),
18666 Self::UnknownValue(u) => u.0.name(),
18667 }
18668 }
18669}
18670
18671impl std::default::Default for State {
18672 fn default() -> Self {
18673 use std::convert::From;
18674 Self::from(0)
18675 }
18676}
18677
18678impl std::fmt::Display for State {
18679 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18680 wkt::internal::display_enum(f, self.name(), self.value())
18681 }
18682}
18683
18684impl std::convert::From<i32> for State {
18685 fn from(value: i32) -> Self {
18686 match value {
18687 0 => Self::Unspecified,
18688 1 => Self::Creating,
18689 2 => Self::Active,
18690 3 => Self::Deleting,
18691 6 => Self::Updating,
18692 7 => Self::Inactive,
18693 8 => Self::Accepting,
18694 9 => Self::Rejecting,
18695 10 => Self::Obsolete,
18696 11 => Self::Failed,
18697 _ => Self::UnknownValue(state::UnknownValue(
18698 wkt::internal::UnknownEnumValue::Integer(value),
18699 )),
18700 }
18701 }
18702}
18703
18704impl std::convert::From<&str> for State {
18705 fn from(value: &str) -> Self {
18706 use std::string::ToString;
18707 match value {
18708 "STATE_UNSPECIFIED" => Self::Unspecified,
18709 "CREATING" => Self::Creating,
18710 "ACTIVE" => Self::Active,
18711 "DELETING" => Self::Deleting,
18712 "ACCEPTING" => Self::Accepting,
18713 "REJECTING" => Self::Rejecting,
18714 "UPDATING" => Self::Updating,
18715 "INACTIVE" => Self::Inactive,
18716 "OBSOLETE" => Self::Obsolete,
18717 "FAILED" => Self::Failed,
18718 _ => Self::UnknownValue(state::UnknownValue(
18719 wkt::internal::UnknownEnumValue::String(value.to_string()),
18720 )),
18721 }
18722 }
18723}
18724
18725impl serde::ser::Serialize for State {
18726 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18727 where
18728 S: serde::Serializer,
18729 {
18730 match self {
18731 Self::Unspecified => serializer.serialize_i32(0),
18732 Self::Creating => serializer.serialize_i32(1),
18733 Self::Active => serializer.serialize_i32(2),
18734 Self::Deleting => serializer.serialize_i32(3),
18735 Self::Accepting => serializer.serialize_i32(8),
18736 Self::Rejecting => serializer.serialize_i32(9),
18737 Self::Updating => serializer.serialize_i32(6),
18738 Self::Inactive => serializer.serialize_i32(7),
18739 Self::Obsolete => serializer.serialize_i32(10),
18740 Self::Failed => serializer.serialize_i32(11),
18741 Self::UnknownValue(u) => u.0.serialize(serializer),
18742 }
18743 }
18744}
18745
18746impl<'de> serde::de::Deserialize<'de> for State {
18747 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18748 where
18749 D: serde::Deserializer<'de>,
18750 {
18751 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18752 ".google.cloud.networkconnectivity.v1.State",
18753 ))
18754 }
18755}
18756
18757/// The SpokeType enum represents the type of spoke. The type
18758/// reflects the kind of resource that a spoke is associated with.
18759///
18760/// # Working with unknown values
18761///
18762/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18763/// additional enum variants at any time. Adding new variants is not considered
18764/// a breaking change. Applications should write their code in anticipation of:
18765///
18766/// - New values appearing in future releases of the client library, **and**
18767/// - New values received dynamically, without application changes.
18768///
18769/// Please consult the [Working with enums] section in the user guide for some
18770/// guidelines.
18771///
18772/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18773#[derive(Clone, Debug, PartialEq)]
18774#[non_exhaustive]
18775pub enum SpokeType {
18776 /// Unspecified spoke type.
18777 Unspecified,
18778 /// Spokes associated with VPN tunnels.
18779 VpnTunnel,
18780 /// Spokes associated with VLAN attachments.
18781 InterconnectAttachment,
18782 /// Spokes associated with router appliance instances.
18783 RouterAppliance,
18784 /// Spokes associated with VPC networks.
18785 VpcNetwork,
18786 /// Spokes that are backed by a producer VPC network.
18787 ProducerVpcNetwork,
18788 /// If set, the enum was initialized with an unknown value.
18789 ///
18790 /// Applications can examine the value using [SpokeType::value] or
18791 /// [SpokeType::name].
18792 UnknownValue(spoke_type::UnknownValue),
18793}
18794
18795#[doc(hidden)]
18796pub mod spoke_type {
18797 #[allow(unused_imports)]
18798 use super::*;
18799 #[derive(Clone, Debug, PartialEq)]
18800 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18801}
18802
18803impl SpokeType {
18804 /// Gets the enum value.
18805 ///
18806 /// Returns `None` if the enum contains an unknown value deserialized from
18807 /// the string representation of enums.
18808 pub fn value(&self) -> std::option::Option<i32> {
18809 match self {
18810 Self::Unspecified => std::option::Option::Some(0),
18811 Self::VpnTunnel => std::option::Option::Some(1),
18812 Self::InterconnectAttachment => std::option::Option::Some(2),
18813 Self::RouterAppliance => std::option::Option::Some(3),
18814 Self::VpcNetwork => std::option::Option::Some(4),
18815 Self::ProducerVpcNetwork => std::option::Option::Some(7),
18816 Self::UnknownValue(u) => u.0.value(),
18817 }
18818 }
18819
18820 /// Gets the enum value as a string.
18821 ///
18822 /// Returns `None` if the enum contains an unknown value deserialized from
18823 /// the integer representation of enums.
18824 pub fn name(&self) -> std::option::Option<&str> {
18825 match self {
18826 Self::Unspecified => std::option::Option::Some("SPOKE_TYPE_UNSPECIFIED"),
18827 Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
18828 Self::InterconnectAttachment => std::option::Option::Some("INTERCONNECT_ATTACHMENT"),
18829 Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
18830 Self::VpcNetwork => std::option::Option::Some("VPC_NETWORK"),
18831 Self::ProducerVpcNetwork => std::option::Option::Some("PRODUCER_VPC_NETWORK"),
18832 Self::UnknownValue(u) => u.0.name(),
18833 }
18834 }
18835}
18836
18837impl std::default::Default for SpokeType {
18838 fn default() -> Self {
18839 use std::convert::From;
18840 Self::from(0)
18841 }
18842}
18843
18844impl std::fmt::Display for SpokeType {
18845 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18846 wkt::internal::display_enum(f, self.name(), self.value())
18847 }
18848}
18849
18850impl std::convert::From<i32> for SpokeType {
18851 fn from(value: i32) -> Self {
18852 match value {
18853 0 => Self::Unspecified,
18854 1 => Self::VpnTunnel,
18855 2 => Self::InterconnectAttachment,
18856 3 => Self::RouterAppliance,
18857 4 => Self::VpcNetwork,
18858 7 => Self::ProducerVpcNetwork,
18859 _ => Self::UnknownValue(spoke_type::UnknownValue(
18860 wkt::internal::UnknownEnumValue::Integer(value),
18861 )),
18862 }
18863 }
18864}
18865
18866impl std::convert::From<&str> for SpokeType {
18867 fn from(value: &str) -> Self {
18868 use std::string::ToString;
18869 match value {
18870 "SPOKE_TYPE_UNSPECIFIED" => Self::Unspecified,
18871 "VPN_TUNNEL" => Self::VpnTunnel,
18872 "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
18873 "ROUTER_APPLIANCE" => Self::RouterAppliance,
18874 "VPC_NETWORK" => Self::VpcNetwork,
18875 "PRODUCER_VPC_NETWORK" => Self::ProducerVpcNetwork,
18876 _ => Self::UnknownValue(spoke_type::UnknownValue(
18877 wkt::internal::UnknownEnumValue::String(value.to_string()),
18878 )),
18879 }
18880 }
18881}
18882
18883impl serde::ser::Serialize for SpokeType {
18884 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18885 where
18886 S: serde::Serializer,
18887 {
18888 match self {
18889 Self::Unspecified => serializer.serialize_i32(0),
18890 Self::VpnTunnel => serializer.serialize_i32(1),
18891 Self::InterconnectAttachment => serializer.serialize_i32(2),
18892 Self::RouterAppliance => serializer.serialize_i32(3),
18893 Self::VpcNetwork => serializer.serialize_i32(4),
18894 Self::ProducerVpcNetwork => serializer.serialize_i32(7),
18895 Self::UnknownValue(u) => u.0.serialize(serializer),
18896 }
18897 }
18898}
18899
18900impl<'de> serde::de::Deserialize<'de> for SpokeType {
18901 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18902 where
18903 D: serde::Deserializer<'de>,
18904 {
18905 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeType>::new(
18906 ".google.cloud.networkconnectivity.v1.SpokeType",
18907 ))
18908 }
18909}
18910
18911/// This enum controls the policy mode used in a hub.
18912///
18913/// # Working with unknown values
18914///
18915/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18916/// additional enum variants at any time. Adding new variants is not considered
18917/// a breaking change. Applications should write their code in anticipation of:
18918///
18919/// - New values appearing in future releases of the client library, **and**
18920/// - New values received dynamically, without application changes.
18921///
18922/// Please consult the [Working with enums] section in the user guide for some
18923/// guidelines.
18924///
18925/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18926#[derive(Clone, Debug, PartialEq)]
18927#[non_exhaustive]
18928pub enum PolicyMode {
18929 /// Policy mode is unspecified. It defaults to PRESET
18930 /// with preset_topology = MESH.
18931 Unspecified,
18932 /// Hub uses one of the preset topologies.
18933 Preset,
18934 /// If set, the enum was initialized with an unknown value.
18935 ///
18936 /// Applications can examine the value using [PolicyMode::value] or
18937 /// [PolicyMode::name].
18938 UnknownValue(policy_mode::UnknownValue),
18939}
18940
18941#[doc(hidden)]
18942pub mod policy_mode {
18943 #[allow(unused_imports)]
18944 use super::*;
18945 #[derive(Clone, Debug, PartialEq)]
18946 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18947}
18948
18949impl PolicyMode {
18950 /// Gets the enum value.
18951 ///
18952 /// Returns `None` if the enum contains an unknown value deserialized from
18953 /// the string representation of enums.
18954 pub fn value(&self) -> std::option::Option<i32> {
18955 match self {
18956 Self::Unspecified => std::option::Option::Some(0),
18957 Self::Preset => std::option::Option::Some(1),
18958 Self::UnknownValue(u) => u.0.value(),
18959 }
18960 }
18961
18962 /// Gets the enum value as a string.
18963 ///
18964 /// Returns `None` if the enum contains an unknown value deserialized from
18965 /// the integer representation of enums.
18966 pub fn name(&self) -> std::option::Option<&str> {
18967 match self {
18968 Self::Unspecified => std::option::Option::Some("POLICY_MODE_UNSPECIFIED"),
18969 Self::Preset => std::option::Option::Some("PRESET"),
18970 Self::UnknownValue(u) => u.0.name(),
18971 }
18972 }
18973}
18974
18975impl std::default::Default for PolicyMode {
18976 fn default() -> Self {
18977 use std::convert::From;
18978 Self::from(0)
18979 }
18980}
18981
18982impl std::fmt::Display for PolicyMode {
18983 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18984 wkt::internal::display_enum(f, self.name(), self.value())
18985 }
18986}
18987
18988impl std::convert::From<i32> for PolicyMode {
18989 fn from(value: i32) -> Self {
18990 match value {
18991 0 => Self::Unspecified,
18992 1 => Self::Preset,
18993 _ => Self::UnknownValue(policy_mode::UnknownValue(
18994 wkt::internal::UnknownEnumValue::Integer(value),
18995 )),
18996 }
18997 }
18998}
18999
19000impl std::convert::From<&str> for PolicyMode {
19001 fn from(value: &str) -> Self {
19002 use std::string::ToString;
19003 match value {
19004 "POLICY_MODE_UNSPECIFIED" => Self::Unspecified,
19005 "PRESET" => Self::Preset,
19006 _ => Self::UnknownValue(policy_mode::UnknownValue(
19007 wkt::internal::UnknownEnumValue::String(value.to_string()),
19008 )),
19009 }
19010 }
19011}
19012
19013impl serde::ser::Serialize for PolicyMode {
19014 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19015 where
19016 S: serde::Serializer,
19017 {
19018 match self {
19019 Self::Unspecified => serializer.serialize_i32(0),
19020 Self::Preset => serializer.serialize_i32(1),
19021 Self::UnknownValue(u) => u.0.serialize(serializer),
19022 }
19023 }
19024}
19025
19026impl<'de> serde::de::Deserialize<'de> for PolicyMode {
19027 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19028 where
19029 D: serde::Deserializer<'de>,
19030 {
19031 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyMode>::new(
19032 ".google.cloud.networkconnectivity.v1.PolicyMode",
19033 ))
19034 }
19035}
19036
19037/// The list of available preset topologies.
19038///
19039/// # Working with unknown values
19040///
19041/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19042/// additional enum variants at any time. Adding new variants is not considered
19043/// a breaking change. Applications should write their code in anticipation of:
19044///
19045/// - New values appearing in future releases of the client library, **and**
19046/// - New values received dynamically, without application changes.
19047///
19048/// Please consult the [Working with enums] section in the user guide for some
19049/// guidelines.
19050///
19051/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19052#[derive(Clone, Debug, PartialEq)]
19053#[non_exhaustive]
19054pub enum PresetTopology {
19055 /// Preset topology is unspecified. When policy_mode = PRESET,
19056 /// it defaults to MESH.
19057 Unspecified,
19058 /// Mesh topology is implemented. Group `default` is automatically created.
19059 /// All spokes in the hub are added to group `default`.
19060 Mesh,
19061 /// Star topology is implemented. Two groups, `center` and `edge`, are
19062 /// automatically created along with hub creation. Spokes have to join one of
19063 /// the groups during creation.
19064 Star,
19065 /// If set, the enum was initialized with an unknown value.
19066 ///
19067 /// Applications can examine the value using [PresetTopology::value] or
19068 /// [PresetTopology::name].
19069 UnknownValue(preset_topology::UnknownValue),
19070}
19071
19072#[doc(hidden)]
19073pub mod preset_topology {
19074 #[allow(unused_imports)]
19075 use super::*;
19076 #[derive(Clone, Debug, PartialEq)]
19077 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19078}
19079
19080impl PresetTopology {
19081 /// Gets the enum value.
19082 ///
19083 /// Returns `None` if the enum contains an unknown value deserialized from
19084 /// the string representation of enums.
19085 pub fn value(&self) -> std::option::Option<i32> {
19086 match self {
19087 Self::Unspecified => std::option::Option::Some(0),
19088 Self::Mesh => std::option::Option::Some(2),
19089 Self::Star => std::option::Option::Some(3),
19090 Self::UnknownValue(u) => u.0.value(),
19091 }
19092 }
19093
19094 /// Gets the enum value as a string.
19095 ///
19096 /// Returns `None` if the enum contains an unknown value deserialized from
19097 /// the integer representation of enums.
19098 pub fn name(&self) -> std::option::Option<&str> {
19099 match self {
19100 Self::Unspecified => std::option::Option::Some("PRESET_TOPOLOGY_UNSPECIFIED"),
19101 Self::Mesh => std::option::Option::Some("MESH"),
19102 Self::Star => std::option::Option::Some("STAR"),
19103 Self::UnknownValue(u) => u.0.name(),
19104 }
19105 }
19106}
19107
19108impl std::default::Default for PresetTopology {
19109 fn default() -> Self {
19110 use std::convert::From;
19111 Self::from(0)
19112 }
19113}
19114
19115impl std::fmt::Display for PresetTopology {
19116 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19117 wkt::internal::display_enum(f, self.name(), self.value())
19118 }
19119}
19120
19121impl std::convert::From<i32> for PresetTopology {
19122 fn from(value: i32) -> Self {
19123 match value {
19124 0 => Self::Unspecified,
19125 2 => Self::Mesh,
19126 3 => Self::Star,
19127 _ => Self::UnknownValue(preset_topology::UnknownValue(
19128 wkt::internal::UnknownEnumValue::Integer(value),
19129 )),
19130 }
19131 }
19132}
19133
19134impl std::convert::From<&str> for PresetTopology {
19135 fn from(value: &str) -> Self {
19136 use std::string::ToString;
19137 match value {
19138 "PRESET_TOPOLOGY_UNSPECIFIED" => Self::Unspecified,
19139 "MESH" => Self::Mesh,
19140 "STAR" => Self::Star,
19141 _ => Self::UnknownValue(preset_topology::UnknownValue(
19142 wkt::internal::UnknownEnumValue::String(value.to_string()),
19143 )),
19144 }
19145 }
19146}
19147
19148impl serde::ser::Serialize for PresetTopology {
19149 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19150 where
19151 S: serde::Serializer,
19152 {
19153 match self {
19154 Self::Unspecified => serializer.serialize_i32(0),
19155 Self::Mesh => serializer.serialize_i32(2),
19156 Self::Star => serializer.serialize_i32(3),
19157 Self::UnknownValue(u) => u.0.serialize(serializer),
19158 }
19159 }
19160}
19161
19162impl<'de> serde::de::Deserialize<'de> for PresetTopology {
19163 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19164 where
19165 D: serde::Deserializer<'de>,
19166 {
19167 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PresetTopology>::new(
19168 ".google.cloud.networkconnectivity.v1.PresetTopology",
19169 ))
19170 }
19171}