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 /// Output only. Time when the internal range was created.
14619 pub create_time: std::option::Option<wkt::Timestamp>,
14620
14621 /// Output only. 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 /// "172.16.0.0/12", "192.168.0.0/16"] address space (for auto-mode networks,
14665 /// the "10.0.0.0/9" range is used instead of "10.0.0.0/8"). This can be used
14666 /// to target the search in other rfc-1918 address spaces like "172.16.0.0/12"
14667 /// and "192.168.0.0/16" or non-rfc-1918 address spaces used in the VPC.
14668 pub target_cidr_range: std::vec::Vec<std::string::String>,
14669
14670 /// Output only. The list of resources that refer to this internal range.
14671 /// Resources that use the internal range for their range allocation
14672 /// are referred to as users of the range. Other resources mark themselves
14673 /// as users while doing so by creating a reference to this internal range.
14674 /// Having a user, based on this reference, prevents deletion of the
14675 /// internal range referred to. Can be empty.
14676 pub users: std::vec::Vec<std::string::String>,
14677
14678 /// Optional. Types of resources that are allowed to overlap with the current
14679 /// internal range.
14680 pub overlaps: std::vec::Vec<crate::model::internal_range::Overlap>,
14681
14682 /// Optional. Must be present if usage is set to FOR_MIGRATION.
14683 pub migration: std::option::Option<crate::model::internal_range::Migration>,
14684
14685 /// Optional. Immutable ranges cannot have their fields modified, except for
14686 /// labels and description.
14687 pub immutable: bool,
14688
14689 /// Optional. Range auto-allocation options, may be set only when
14690 /// auto-allocation is selected by not setting ip_cidr_range (and setting
14691 /// prefix_length).
14692 pub allocation_options: std::option::Option<crate::model::internal_range::AllocationOptions>,
14693
14694 /// Optional. ExcludeCidrRanges flag. Specifies a set of CIDR blocks that
14695 /// allows exclusion of particular CIDR ranges from the auto-allocation
14696 /// process, without having to reserve these blocks
14697 pub exclude_cidr_ranges: std::vec::Vec<std::string::String>,
14698
14699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14700}
14701
14702impl InternalRange {
14703 pub fn new() -> Self {
14704 std::default::Default::default()
14705 }
14706
14707 /// Sets the value of [name][crate::model::InternalRange::name].
14708 ///
14709 /// # Example
14710 /// ```ignore,no_run
14711 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14712 /// let x = InternalRange::new().set_name("example");
14713 /// ```
14714 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14715 self.name = v.into();
14716 self
14717 }
14718
14719 /// Sets the value of [create_time][crate::model::InternalRange::create_time].
14720 ///
14721 /// # Example
14722 /// ```ignore,no_run
14723 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14724 /// use wkt::Timestamp;
14725 /// let x = InternalRange::new().set_create_time(Timestamp::default()/* use setters */);
14726 /// ```
14727 pub fn set_create_time<T>(mut self, v: T) -> Self
14728 where
14729 T: std::convert::Into<wkt::Timestamp>,
14730 {
14731 self.create_time = std::option::Option::Some(v.into());
14732 self
14733 }
14734
14735 /// Sets or clears the value of [create_time][crate::model::InternalRange::create_time].
14736 ///
14737 /// # Example
14738 /// ```ignore,no_run
14739 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14740 /// use wkt::Timestamp;
14741 /// let x = InternalRange::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14742 /// let x = InternalRange::new().set_or_clear_create_time(None::<Timestamp>);
14743 /// ```
14744 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14745 where
14746 T: std::convert::Into<wkt::Timestamp>,
14747 {
14748 self.create_time = v.map(|x| x.into());
14749 self
14750 }
14751
14752 /// Sets the value of [update_time][crate::model::InternalRange::update_time].
14753 ///
14754 /// # Example
14755 /// ```ignore,no_run
14756 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14757 /// use wkt::Timestamp;
14758 /// let x = InternalRange::new().set_update_time(Timestamp::default()/* use setters */);
14759 /// ```
14760 pub fn set_update_time<T>(mut self, v: T) -> Self
14761 where
14762 T: std::convert::Into<wkt::Timestamp>,
14763 {
14764 self.update_time = std::option::Option::Some(v.into());
14765 self
14766 }
14767
14768 /// Sets or clears the value of [update_time][crate::model::InternalRange::update_time].
14769 ///
14770 /// # Example
14771 /// ```ignore,no_run
14772 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14773 /// use wkt::Timestamp;
14774 /// let x = InternalRange::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14775 /// let x = InternalRange::new().set_or_clear_update_time(None::<Timestamp>);
14776 /// ```
14777 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14778 where
14779 T: std::convert::Into<wkt::Timestamp>,
14780 {
14781 self.update_time = v.map(|x| x.into());
14782 self
14783 }
14784
14785 /// Sets the value of [labels][crate::model::InternalRange::labels].
14786 ///
14787 /// # Example
14788 /// ```ignore,no_run
14789 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14790 /// let x = InternalRange::new().set_labels([
14791 /// ("key0", "abc"),
14792 /// ("key1", "xyz"),
14793 /// ]);
14794 /// ```
14795 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14796 where
14797 T: std::iter::IntoIterator<Item = (K, V)>,
14798 K: std::convert::Into<std::string::String>,
14799 V: std::convert::Into<std::string::String>,
14800 {
14801 use std::iter::Iterator;
14802 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14803 self
14804 }
14805
14806 /// Sets the value of [description][crate::model::InternalRange::description].
14807 ///
14808 /// # Example
14809 /// ```ignore,no_run
14810 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14811 /// let x = InternalRange::new().set_description("example");
14812 /// ```
14813 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14814 self.description = v.into();
14815 self
14816 }
14817
14818 /// Sets the value of [ip_cidr_range][crate::model::InternalRange::ip_cidr_range].
14819 ///
14820 /// # Example
14821 /// ```ignore,no_run
14822 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14823 /// let x = InternalRange::new().set_ip_cidr_range("example");
14824 /// ```
14825 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14826 self.ip_cidr_range = v.into();
14827 self
14828 }
14829
14830 /// Sets the value of [network][crate::model::InternalRange::network].
14831 ///
14832 /// # Example
14833 /// ```ignore,no_run
14834 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14835 /// let x = InternalRange::new().set_network("example");
14836 /// ```
14837 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14838 self.network = v.into();
14839 self
14840 }
14841
14842 /// Sets the value of [usage][crate::model::InternalRange::usage].
14843 ///
14844 /// # Example
14845 /// ```ignore,no_run
14846 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14847 /// use google_cloud_networkconnectivity_v1::model::internal_range::Usage;
14848 /// let x0 = InternalRange::new().set_usage(Usage::ForVpc);
14849 /// let x1 = InternalRange::new().set_usage(Usage::ExternalToVpc);
14850 /// let x2 = InternalRange::new().set_usage(Usage::ForMigration);
14851 /// ```
14852 pub fn set_usage<T: std::convert::Into<crate::model::internal_range::Usage>>(
14853 mut self,
14854 v: T,
14855 ) -> Self {
14856 self.usage = v.into();
14857 self
14858 }
14859
14860 /// Sets the value of [peering][crate::model::InternalRange::peering].
14861 ///
14862 /// # Example
14863 /// ```ignore,no_run
14864 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14865 /// use google_cloud_networkconnectivity_v1::model::internal_range::Peering;
14866 /// let x0 = InternalRange::new().set_peering(Peering::ForSelf);
14867 /// let x1 = InternalRange::new().set_peering(Peering::ForPeer);
14868 /// let x2 = InternalRange::new().set_peering(Peering::NotShared);
14869 /// ```
14870 pub fn set_peering<T: std::convert::Into<crate::model::internal_range::Peering>>(
14871 mut self,
14872 v: T,
14873 ) -> Self {
14874 self.peering = v.into();
14875 self
14876 }
14877
14878 /// Sets the value of [prefix_length][crate::model::InternalRange::prefix_length].
14879 ///
14880 /// # Example
14881 /// ```ignore,no_run
14882 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14883 /// let x = InternalRange::new().set_prefix_length(42);
14884 /// ```
14885 pub fn set_prefix_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14886 self.prefix_length = v.into();
14887 self
14888 }
14889
14890 /// Sets the value of [target_cidr_range][crate::model::InternalRange::target_cidr_range].
14891 ///
14892 /// # Example
14893 /// ```ignore,no_run
14894 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14895 /// let x = InternalRange::new().set_target_cidr_range(["a", "b", "c"]);
14896 /// ```
14897 pub fn set_target_cidr_range<T, V>(mut self, v: T) -> Self
14898 where
14899 T: std::iter::IntoIterator<Item = V>,
14900 V: std::convert::Into<std::string::String>,
14901 {
14902 use std::iter::Iterator;
14903 self.target_cidr_range = v.into_iter().map(|i| i.into()).collect();
14904 self
14905 }
14906
14907 /// Sets the value of [users][crate::model::InternalRange::users].
14908 ///
14909 /// # Example
14910 /// ```ignore,no_run
14911 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14912 /// let x = InternalRange::new().set_users(["a", "b", "c"]);
14913 /// ```
14914 pub fn set_users<T, V>(mut self, v: T) -> Self
14915 where
14916 T: std::iter::IntoIterator<Item = V>,
14917 V: std::convert::Into<std::string::String>,
14918 {
14919 use std::iter::Iterator;
14920 self.users = v.into_iter().map(|i| i.into()).collect();
14921 self
14922 }
14923
14924 /// Sets the value of [overlaps][crate::model::InternalRange::overlaps].
14925 ///
14926 /// # Example
14927 /// ```ignore,no_run
14928 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14929 /// use google_cloud_networkconnectivity_v1::model::internal_range::Overlap;
14930 /// let x = InternalRange::new().set_overlaps([
14931 /// Overlap::RouteRange,
14932 /// Overlap::ExistingSubnetRange,
14933 /// ]);
14934 /// ```
14935 pub fn set_overlaps<T, V>(mut self, v: T) -> Self
14936 where
14937 T: std::iter::IntoIterator<Item = V>,
14938 V: std::convert::Into<crate::model::internal_range::Overlap>,
14939 {
14940 use std::iter::Iterator;
14941 self.overlaps = v.into_iter().map(|i| i.into()).collect();
14942 self
14943 }
14944
14945 /// Sets the value of [migration][crate::model::InternalRange::migration].
14946 ///
14947 /// # Example
14948 /// ```ignore,no_run
14949 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14950 /// use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
14951 /// let x = InternalRange::new().set_migration(Migration::default()/* use setters */);
14952 /// ```
14953 pub fn set_migration<T>(mut self, v: T) -> Self
14954 where
14955 T: std::convert::Into<crate::model::internal_range::Migration>,
14956 {
14957 self.migration = std::option::Option::Some(v.into());
14958 self
14959 }
14960
14961 /// Sets or clears the value of [migration][crate::model::InternalRange::migration].
14962 ///
14963 /// # Example
14964 /// ```ignore,no_run
14965 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14966 /// use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
14967 /// let x = InternalRange::new().set_or_clear_migration(Some(Migration::default()/* use setters */));
14968 /// let x = InternalRange::new().set_or_clear_migration(None::<Migration>);
14969 /// ```
14970 pub fn set_or_clear_migration<T>(mut self, v: std::option::Option<T>) -> Self
14971 where
14972 T: std::convert::Into<crate::model::internal_range::Migration>,
14973 {
14974 self.migration = v.map(|x| x.into());
14975 self
14976 }
14977
14978 /// Sets the value of [immutable][crate::model::InternalRange::immutable].
14979 ///
14980 /// # Example
14981 /// ```ignore,no_run
14982 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14983 /// let x = InternalRange::new().set_immutable(true);
14984 /// ```
14985 pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14986 self.immutable = v.into();
14987 self
14988 }
14989
14990 /// Sets the value of [allocation_options][crate::model::InternalRange::allocation_options].
14991 ///
14992 /// # Example
14993 /// ```ignore,no_run
14994 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14995 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
14996 /// let x = InternalRange::new().set_allocation_options(AllocationOptions::default()/* use setters */);
14997 /// ```
14998 pub fn set_allocation_options<T>(mut self, v: T) -> Self
14999 where
15000 T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
15001 {
15002 self.allocation_options = std::option::Option::Some(v.into());
15003 self
15004 }
15005
15006 /// Sets or clears the value of [allocation_options][crate::model::InternalRange::allocation_options].
15007 ///
15008 /// # Example
15009 /// ```ignore,no_run
15010 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15011 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15012 /// let x = InternalRange::new().set_or_clear_allocation_options(Some(AllocationOptions::default()/* use setters */));
15013 /// let x = InternalRange::new().set_or_clear_allocation_options(None::<AllocationOptions>);
15014 /// ```
15015 pub fn set_or_clear_allocation_options<T>(mut self, v: std::option::Option<T>) -> Self
15016 where
15017 T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
15018 {
15019 self.allocation_options = v.map(|x| x.into());
15020 self
15021 }
15022
15023 /// Sets the value of [exclude_cidr_ranges][crate::model::InternalRange::exclude_cidr_ranges].
15024 ///
15025 /// # Example
15026 /// ```ignore,no_run
15027 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15028 /// let x = InternalRange::new().set_exclude_cidr_ranges(["a", "b", "c"]);
15029 /// ```
15030 pub fn set_exclude_cidr_ranges<T, V>(mut self, v: T) -> Self
15031 where
15032 T: std::iter::IntoIterator<Item = V>,
15033 V: std::convert::Into<std::string::String>,
15034 {
15035 use std::iter::Iterator;
15036 self.exclude_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
15037 self
15038 }
15039}
15040
15041impl wkt::message::Message for InternalRange {
15042 fn typename() -> &'static str {
15043 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange"
15044 }
15045}
15046
15047/// Defines additional types related to [InternalRange].
15048pub mod internal_range {
15049 #[allow(unused_imports)]
15050 use super::*;
15051
15052 /// Specification for migration with source and target resource names.
15053 #[derive(Clone, Default, PartialEq)]
15054 #[non_exhaustive]
15055 pub struct Migration {
15056 /// Immutable. Resource path as an URI of the source resource, for example a
15057 /// subnet. The project for the source resource should match the project for
15058 /// the InternalRange. An example:
15059 /// /projects/{project}/regions/{region}/subnetworks/{subnet}
15060 pub source: std::string::String,
15061
15062 /// Immutable. Resource path of the target resource. The target project can
15063 /// be different, as in the cases when migrating to peer networks. For
15064 /// example:
15065 /// /projects/{project}/regions/{region}/subnetworks/{subnet}
15066 pub target: std::string::String,
15067
15068 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15069 }
15070
15071 impl Migration {
15072 pub fn new() -> Self {
15073 std::default::Default::default()
15074 }
15075
15076 /// Sets the value of [source][crate::model::internal_range::Migration::source].
15077 ///
15078 /// # Example
15079 /// ```ignore,no_run
15080 /// # use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15081 /// let x = Migration::new().set_source("example");
15082 /// ```
15083 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15084 self.source = v.into();
15085 self
15086 }
15087
15088 /// Sets the value of [target][crate::model::internal_range::Migration::target].
15089 ///
15090 /// # Example
15091 /// ```ignore,no_run
15092 /// # use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15093 /// let x = Migration::new().set_target("example");
15094 /// ```
15095 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15096 self.target = v.into();
15097 self
15098 }
15099 }
15100
15101 impl wkt::message::Message for Migration {
15102 fn typename() -> &'static str {
15103 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.Migration"
15104 }
15105 }
15106
15107 /// Range auto-allocation options, to be optionally used when CIDR block is not
15108 /// explicitly set.
15109 #[derive(Clone, Default, PartialEq)]
15110 #[non_exhaustive]
15111 pub struct AllocationOptions {
15112 /// Optional. Allocation strategy Not setting this field when the allocation
15113 /// is requested means an implementation defined strategy is used.
15114 pub allocation_strategy: crate::model::internal_range::AllocationStrategy,
15115
15116 /// Optional. This field must be set only when allocation_strategy is set to
15117 /// RANDOM_FIRST_N_AVAILABLE.
15118 /// The value should be the maximum expected parallelism of range creation
15119 /// requests issued to the same space of peered netwroks.
15120 pub first_available_ranges_lookup_size: i32,
15121
15122 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15123 }
15124
15125 impl AllocationOptions {
15126 pub fn new() -> Self {
15127 std::default::Default::default()
15128 }
15129
15130 /// Sets the value of [allocation_strategy][crate::model::internal_range::AllocationOptions::allocation_strategy].
15131 ///
15132 /// # Example
15133 /// ```ignore,no_run
15134 /// # use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15135 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationStrategy;
15136 /// let x0 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::Random);
15137 /// let x1 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::FirstAvailable);
15138 /// let x2 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::RandomFirstNAvailable);
15139 /// ```
15140 pub fn set_allocation_strategy<
15141 T: std::convert::Into<crate::model::internal_range::AllocationStrategy>,
15142 >(
15143 mut self,
15144 v: T,
15145 ) -> Self {
15146 self.allocation_strategy = v.into();
15147 self
15148 }
15149
15150 /// Sets the value of [first_available_ranges_lookup_size][crate::model::internal_range::AllocationOptions::first_available_ranges_lookup_size].
15151 ///
15152 /// # Example
15153 /// ```ignore,no_run
15154 /// # use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15155 /// let x = AllocationOptions::new().set_first_available_ranges_lookup_size(42);
15156 /// ```
15157 pub fn set_first_available_ranges_lookup_size<T: std::convert::Into<i32>>(
15158 mut self,
15159 v: T,
15160 ) -> Self {
15161 self.first_available_ranges_lookup_size = v.into();
15162 self
15163 }
15164 }
15165
15166 impl wkt::message::Message for AllocationOptions {
15167 fn typename() -> &'static str {
15168 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.AllocationOptions"
15169 }
15170 }
15171
15172 /// Possible usage of an internal range.
15173 ///
15174 /// # Working with unknown values
15175 ///
15176 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15177 /// additional enum variants at any time. Adding new variants is not considered
15178 /// a breaking change. Applications should write their code in anticipation of:
15179 ///
15180 /// - New values appearing in future releases of the client library, **and**
15181 /// - New values received dynamically, without application changes.
15182 ///
15183 /// Please consult the [Working with enums] section in the user guide for some
15184 /// guidelines.
15185 ///
15186 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15187 #[derive(Clone, Debug, PartialEq)]
15188 #[non_exhaustive]
15189 pub enum Usage {
15190 /// Unspecified usage is allowed in calls which identify the resource by
15191 /// other fields and do not need Usage set to complete. These are, i.e.:
15192 /// GetInternalRange and DeleteInternalRange.
15193 /// Usage needs to be specified explicitly in CreateInternalRange
15194 /// or UpdateInternalRange calls.
15195 Unspecified,
15196 /// A VPC resource can use the reserved CIDR block by associating it with the
15197 /// internal range resource if usage is set to FOR_VPC.
15198 ForVpc,
15199 /// Ranges created with EXTERNAL_TO_VPC cannot be associated with VPC
15200 /// resources and are meant to block out address ranges for various use
15201 /// cases, like for example, usage on-prem, with dynamic route announcements
15202 /// via interconnect.
15203 ExternalToVpc,
15204 /// Ranges created FOR_MIGRATION can be used to lock a CIDR range between a
15205 /// source and target subnet. If usage is set to FOR_MIGRATION, the peering
15206 /// value has to be set to FOR_SELF or default to FOR_SELF when unset.
15207 ForMigration,
15208 /// If set, the enum was initialized with an unknown value.
15209 ///
15210 /// Applications can examine the value using [Usage::value] or
15211 /// [Usage::name].
15212 UnknownValue(usage::UnknownValue),
15213 }
15214
15215 #[doc(hidden)]
15216 pub mod usage {
15217 #[allow(unused_imports)]
15218 use super::*;
15219 #[derive(Clone, Debug, PartialEq)]
15220 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15221 }
15222
15223 impl Usage {
15224 /// Gets the enum value.
15225 ///
15226 /// Returns `None` if the enum contains an unknown value deserialized from
15227 /// the string representation of enums.
15228 pub fn value(&self) -> std::option::Option<i32> {
15229 match self {
15230 Self::Unspecified => std::option::Option::Some(0),
15231 Self::ForVpc => std::option::Option::Some(1),
15232 Self::ExternalToVpc => std::option::Option::Some(2),
15233 Self::ForMigration => std::option::Option::Some(3),
15234 Self::UnknownValue(u) => u.0.value(),
15235 }
15236 }
15237
15238 /// Gets the enum value as a string.
15239 ///
15240 /// Returns `None` if the enum contains an unknown value deserialized from
15241 /// the integer representation of enums.
15242 pub fn name(&self) -> std::option::Option<&str> {
15243 match self {
15244 Self::Unspecified => std::option::Option::Some("USAGE_UNSPECIFIED"),
15245 Self::ForVpc => std::option::Option::Some("FOR_VPC"),
15246 Self::ExternalToVpc => std::option::Option::Some("EXTERNAL_TO_VPC"),
15247 Self::ForMigration => std::option::Option::Some("FOR_MIGRATION"),
15248 Self::UnknownValue(u) => u.0.name(),
15249 }
15250 }
15251 }
15252
15253 impl std::default::Default for Usage {
15254 fn default() -> Self {
15255 use std::convert::From;
15256 Self::from(0)
15257 }
15258 }
15259
15260 impl std::fmt::Display for Usage {
15261 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15262 wkt::internal::display_enum(f, self.name(), self.value())
15263 }
15264 }
15265
15266 impl std::convert::From<i32> for Usage {
15267 fn from(value: i32) -> Self {
15268 match value {
15269 0 => Self::Unspecified,
15270 1 => Self::ForVpc,
15271 2 => Self::ExternalToVpc,
15272 3 => Self::ForMigration,
15273 _ => Self::UnknownValue(usage::UnknownValue(
15274 wkt::internal::UnknownEnumValue::Integer(value),
15275 )),
15276 }
15277 }
15278 }
15279
15280 impl std::convert::From<&str> for Usage {
15281 fn from(value: &str) -> Self {
15282 use std::string::ToString;
15283 match value {
15284 "USAGE_UNSPECIFIED" => Self::Unspecified,
15285 "FOR_VPC" => Self::ForVpc,
15286 "EXTERNAL_TO_VPC" => Self::ExternalToVpc,
15287 "FOR_MIGRATION" => Self::ForMigration,
15288 _ => Self::UnknownValue(usage::UnknownValue(
15289 wkt::internal::UnknownEnumValue::String(value.to_string()),
15290 )),
15291 }
15292 }
15293 }
15294
15295 impl serde::ser::Serialize for Usage {
15296 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15297 where
15298 S: serde::Serializer,
15299 {
15300 match self {
15301 Self::Unspecified => serializer.serialize_i32(0),
15302 Self::ForVpc => serializer.serialize_i32(1),
15303 Self::ExternalToVpc => serializer.serialize_i32(2),
15304 Self::ForMigration => serializer.serialize_i32(3),
15305 Self::UnknownValue(u) => u.0.serialize(serializer),
15306 }
15307 }
15308 }
15309
15310 impl<'de> serde::de::Deserialize<'de> for Usage {
15311 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15312 where
15313 D: serde::Deserializer<'de>,
15314 {
15315 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Usage>::new(
15316 ".google.cloud.networkconnectivity.v1.InternalRange.Usage",
15317 ))
15318 }
15319 }
15320
15321 /// Peering type.
15322 ///
15323 /// # Working with unknown values
15324 ///
15325 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15326 /// additional enum variants at any time. Adding new variants is not considered
15327 /// a breaking change. Applications should write their code in anticipation of:
15328 ///
15329 /// - New values appearing in future releases of the client library, **and**
15330 /// - New values received dynamically, without application changes.
15331 ///
15332 /// Please consult the [Working with enums] section in the user guide for some
15333 /// guidelines.
15334 ///
15335 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15336 #[derive(Clone, Debug, PartialEq)]
15337 #[non_exhaustive]
15338 pub enum Peering {
15339 /// If Peering is left unspecified in CreateInternalRange or
15340 /// UpdateInternalRange, it will be defaulted to FOR_SELF.
15341 Unspecified,
15342 /// This is the default behavior and represents the case that this
15343 /// internal range is intended to be used in the VPC in which it is created
15344 /// and is accessible from its peers. This implies that peers or
15345 /// peers-of-peers cannot use this range.
15346 ForSelf,
15347 /// This behavior can be set when the internal range is being reserved for
15348 /// usage by peers. This means that no resource within the VPC in which
15349 /// it is being created can use this to associate with a VPC resource, but
15350 /// one of the peers can. This represents donating a range for peers to
15351 /// use.
15352 ForPeer,
15353 /// This behavior can be set when the internal range is being reserved for
15354 /// usage by the VPC in which it is created, but not shared with peers.
15355 /// In a sense, it is local to the VPC. This can be used to create internal
15356 /// ranges for various purposes like HTTP_INTERNAL_LOAD_BALANCER or for
15357 /// Interconnect routes that are not shared with peers. This also implies
15358 /// that peers cannot use this range in a way that is visible to this VPC,
15359 /// but can re-use this range as long as it is NOT_SHARED from the peer VPC,
15360 /// too.
15361 NotShared,
15362 /// If set, the enum was initialized with an unknown value.
15363 ///
15364 /// Applications can examine the value using [Peering::value] or
15365 /// [Peering::name].
15366 UnknownValue(peering::UnknownValue),
15367 }
15368
15369 #[doc(hidden)]
15370 pub mod peering {
15371 #[allow(unused_imports)]
15372 use super::*;
15373 #[derive(Clone, Debug, PartialEq)]
15374 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15375 }
15376
15377 impl Peering {
15378 /// Gets the enum value.
15379 ///
15380 /// Returns `None` if the enum contains an unknown value deserialized from
15381 /// the string representation of enums.
15382 pub fn value(&self) -> std::option::Option<i32> {
15383 match self {
15384 Self::Unspecified => std::option::Option::Some(0),
15385 Self::ForSelf => std::option::Option::Some(1),
15386 Self::ForPeer => std::option::Option::Some(2),
15387 Self::NotShared => std::option::Option::Some(3),
15388 Self::UnknownValue(u) => u.0.value(),
15389 }
15390 }
15391
15392 /// Gets the enum value as a string.
15393 ///
15394 /// Returns `None` if the enum contains an unknown value deserialized from
15395 /// the integer representation of enums.
15396 pub fn name(&self) -> std::option::Option<&str> {
15397 match self {
15398 Self::Unspecified => std::option::Option::Some("PEERING_UNSPECIFIED"),
15399 Self::ForSelf => std::option::Option::Some("FOR_SELF"),
15400 Self::ForPeer => std::option::Option::Some("FOR_PEER"),
15401 Self::NotShared => std::option::Option::Some("NOT_SHARED"),
15402 Self::UnknownValue(u) => u.0.name(),
15403 }
15404 }
15405 }
15406
15407 impl std::default::Default for Peering {
15408 fn default() -> Self {
15409 use std::convert::From;
15410 Self::from(0)
15411 }
15412 }
15413
15414 impl std::fmt::Display for Peering {
15415 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15416 wkt::internal::display_enum(f, self.name(), self.value())
15417 }
15418 }
15419
15420 impl std::convert::From<i32> for Peering {
15421 fn from(value: i32) -> Self {
15422 match value {
15423 0 => Self::Unspecified,
15424 1 => Self::ForSelf,
15425 2 => Self::ForPeer,
15426 3 => Self::NotShared,
15427 _ => Self::UnknownValue(peering::UnknownValue(
15428 wkt::internal::UnknownEnumValue::Integer(value),
15429 )),
15430 }
15431 }
15432 }
15433
15434 impl std::convert::From<&str> for Peering {
15435 fn from(value: &str) -> Self {
15436 use std::string::ToString;
15437 match value {
15438 "PEERING_UNSPECIFIED" => Self::Unspecified,
15439 "FOR_SELF" => Self::ForSelf,
15440 "FOR_PEER" => Self::ForPeer,
15441 "NOT_SHARED" => Self::NotShared,
15442 _ => Self::UnknownValue(peering::UnknownValue(
15443 wkt::internal::UnknownEnumValue::String(value.to_string()),
15444 )),
15445 }
15446 }
15447 }
15448
15449 impl serde::ser::Serialize for Peering {
15450 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15451 where
15452 S: serde::Serializer,
15453 {
15454 match self {
15455 Self::Unspecified => serializer.serialize_i32(0),
15456 Self::ForSelf => serializer.serialize_i32(1),
15457 Self::ForPeer => serializer.serialize_i32(2),
15458 Self::NotShared => serializer.serialize_i32(3),
15459 Self::UnknownValue(u) => u.0.serialize(serializer),
15460 }
15461 }
15462 }
15463
15464 impl<'de> serde::de::Deserialize<'de> for Peering {
15465 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15466 where
15467 D: serde::Deserializer<'de>,
15468 {
15469 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Peering>::new(
15470 ".google.cloud.networkconnectivity.v1.InternalRange.Peering",
15471 ))
15472 }
15473 }
15474
15475 /// Overlap specifications.
15476 ///
15477 /// # Working with unknown values
15478 ///
15479 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15480 /// additional enum variants at any time. Adding new variants is not considered
15481 /// a breaking change. Applications should write their code in anticipation of:
15482 ///
15483 /// - New values appearing in future releases of the client library, **and**
15484 /// - New values received dynamically, without application changes.
15485 ///
15486 /// Please consult the [Working with enums] section in the user guide for some
15487 /// guidelines.
15488 ///
15489 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15490 #[derive(Clone, Debug, PartialEq)]
15491 #[non_exhaustive]
15492 pub enum Overlap {
15493 /// No overlap overrides.
15494 Unspecified,
15495 /// Allow creation of static routes more specific that the current
15496 /// internal range.
15497 RouteRange,
15498 /// Allow creation of internal ranges that overlap with existing subnets.
15499 ExistingSubnetRange,
15500 /// If set, the enum was initialized with an unknown value.
15501 ///
15502 /// Applications can examine the value using [Overlap::value] or
15503 /// [Overlap::name].
15504 UnknownValue(overlap::UnknownValue),
15505 }
15506
15507 #[doc(hidden)]
15508 pub mod overlap {
15509 #[allow(unused_imports)]
15510 use super::*;
15511 #[derive(Clone, Debug, PartialEq)]
15512 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15513 }
15514
15515 impl Overlap {
15516 /// Gets the enum value.
15517 ///
15518 /// Returns `None` if the enum contains an unknown value deserialized from
15519 /// the string representation of enums.
15520 pub fn value(&self) -> std::option::Option<i32> {
15521 match self {
15522 Self::Unspecified => std::option::Option::Some(0),
15523 Self::RouteRange => std::option::Option::Some(1),
15524 Self::ExistingSubnetRange => std::option::Option::Some(2),
15525 Self::UnknownValue(u) => u.0.value(),
15526 }
15527 }
15528
15529 /// Gets the enum value as a string.
15530 ///
15531 /// Returns `None` if the enum contains an unknown value deserialized from
15532 /// the integer representation of enums.
15533 pub fn name(&self) -> std::option::Option<&str> {
15534 match self {
15535 Self::Unspecified => std::option::Option::Some("OVERLAP_UNSPECIFIED"),
15536 Self::RouteRange => std::option::Option::Some("OVERLAP_ROUTE_RANGE"),
15537 Self::ExistingSubnetRange => {
15538 std::option::Option::Some("OVERLAP_EXISTING_SUBNET_RANGE")
15539 }
15540 Self::UnknownValue(u) => u.0.name(),
15541 }
15542 }
15543 }
15544
15545 impl std::default::Default for Overlap {
15546 fn default() -> Self {
15547 use std::convert::From;
15548 Self::from(0)
15549 }
15550 }
15551
15552 impl std::fmt::Display for Overlap {
15553 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15554 wkt::internal::display_enum(f, self.name(), self.value())
15555 }
15556 }
15557
15558 impl std::convert::From<i32> for Overlap {
15559 fn from(value: i32) -> Self {
15560 match value {
15561 0 => Self::Unspecified,
15562 1 => Self::RouteRange,
15563 2 => Self::ExistingSubnetRange,
15564 _ => Self::UnknownValue(overlap::UnknownValue(
15565 wkt::internal::UnknownEnumValue::Integer(value),
15566 )),
15567 }
15568 }
15569 }
15570
15571 impl std::convert::From<&str> for Overlap {
15572 fn from(value: &str) -> Self {
15573 use std::string::ToString;
15574 match value {
15575 "OVERLAP_UNSPECIFIED" => Self::Unspecified,
15576 "OVERLAP_ROUTE_RANGE" => Self::RouteRange,
15577 "OVERLAP_EXISTING_SUBNET_RANGE" => Self::ExistingSubnetRange,
15578 _ => Self::UnknownValue(overlap::UnknownValue(
15579 wkt::internal::UnknownEnumValue::String(value.to_string()),
15580 )),
15581 }
15582 }
15583 }
15584
15585 impl serde::ser::Serialize for Overlap {
15586 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15587 where
15588 S: serde::Serializer,
15589 {
15590 match self {
15591 Self::Unspecified => serializer.serialize_i32(0),
15592 Self::RouteRange => serializer.serialize_i32(1),
15593 Self::ExistingSubnetRange => serializer.serialize_i32(2),
15594 Self::UnknownValue(u) => u.0.serialize(serializer),
15595 }
15596 }
15597 }
15598
15599 impl<'de> serde::de::Deserialize<'de> for Overlap {
15600 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15601 where
15602 D: serde::Deserializer<'de>,
15603 {
15604 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Overlap>::new(
15605 ".google.cloud.networkconnectivity.v1.InternalRange.Overlap",
15606 ))
15607 }
15608 }
15609
15610 /// Enumeration of range auto-allocation strategies
15611 ///
15612 /// # Working with unknown values
15613 ///
15614 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15615 /// additional enum variants at any time. Adding new variants is not considered
15616 /// a breaking change. Applications should write their code in anticipation of:
15617 ///
15618 /// - New values appearing in future releases of the client library, **and**
15619 /// - New values received dynamically, without application changes.
15620 ///
15621 /// Please consult the [Working with enums] section in the user guide for some
15622 /// guidelines.
15623 ///
15624 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15625 #[derive(Clone, Debug, PartialEq)]
15626 #[non_exhaustive]
15627 pub enum AllocationStrategy {
15628 /// Unspecified is the only valid option when the range is specified
15629 /// explicitly by ip_cidr_range field. Otherwise unspefified means using the
15630 /// default strategy.
15631 Unspecified,
15632 /// Random strategy, the legacy algorithm, used for backwards compatibility.
15633 /// This allocation strategy remains efficient in the case of concurrent
15634 /// allocation requests in the same peered network space and doesn't require
15635 /// providing the level of concurrency in an explicit parameter, but it is
15636 /// prone to fragmenting available address space.
15637 Random,
15638 /// Pick the first available address range. This strategy is deterministic
15639 /// and the result is easy to predict.
15640 FirstAvailable,
15641 /// Pick an arbitrary range out of the first N available ones. The N will be
15642 /// set in the first_available_ranges_lookup_size field. This strategy should
15643 /// be used when concurrent allocation requests are made in the same space of
15644 /// peered networks while the fragmentation of the addrress space is reduced.
15645 RandomFirstNAvailable,
15646 /// Pick the smallest but fitting available range. This deterministic
15647 /// strategy minimizes fragmentation of the address space.
15648 FirstSmallestFitting,
15649 /// If set, the enum was initialized with an unknown value.
15650 ///
15651 /// Applications can examine the value using [AllocationStrategy::value] or
15652 /// [AllocationStrategy::name].
15653 UnknownValue(allocation_strategy::UnknownValue),
15654 }
15655
15656 #[doc(hidden)]
15657 pub mod allocation_strategy {
15658 #[allow(unused_imports)]
15659 use super::*;
15660 #[derive(Clone, Debug, PartialEq)]
15661 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15662 }
15663
15664 impl AllocationStrategy {
15665 /// Gets the enum value.
15666 ///
15667 /// Returns `None` if the enum contains an unknown value deserialized from
15668 /// the string representation of enums.
15669 pub fn value(&self) -> std::option::Option<i32> {
15670 match self {
15671 Self::Unspecified => std::option::Option::Some(0),
15672 Self::Random => std::option::Option::Some(1),
15673 Self::FirstAvailable => std::option::Option::Some(2),
15674 Self::RandomFirstNAvailable => std::option::Option::Some(3),
15675 Self::FirstSmallestFitting => std::option::Option::Some(4),
15676 Self::UnknownValue(u) => u.0.value(),
15677 }
15678 }
15679
15680 /// Gets the enum value as a string.
15681 ///
15682 /// Returns `None` if the enum contains an unknown value deserialized from
15683 /// the integer representation of enums.
15684 pub fn name(&self) -> std::option::Option<&str> {
15685 match self {
15686 Self::Unspecified => std::option::Option::Some("ALLOCATION_STRATEGY_UNSPECIFIED"),
15687 Self::Random => std::option::Option::Some("RANDOM"),
15688 Self::FirstAvailable => std::option::Option::Some("FIRST_AVAILABLE"),
15689 Self::RandomFirstNAvailable => {
15690 std::option::Option::Some("RANDOM_FIRST_N_AVAILABLE")
15691 }
15692 Self::FirstSmallestFitting => std::option::Option::Some("FIRST_SMALLEST_FITTING"),
15693 Self::UnknownValue(u) => u.0.name(),
15694 }
15695 }
15696 }
15697
15698 impl std::default::Default for AllocationStrategy {
15699 fn default() -> Self {
15700 use std::convert::From;
15701 Self::from(0)
15702 }
15703 }
15704
15705 impl std::fmt::Display for AllocationStrategy {
15706 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15707 wkt::internal::display_enum(f, self.name(), self.value())
15708 }
15709 }
15710
15711 impl std::convert::From<i32> for AllocationStrategy {
15712 fn from(value: i32) -> Self {
15713 match value {
15714 0 => Self::Unspecified,
15715 1 => Self::Random,
15716 2 => Self::FirstAvailable,
15717 3 => Self::RandomFirstNAvailable,
15718 4 => Self::FirstSmallestFitting,
15719 _ => Self::UnknownValue(allocation_strategy::UnknownValue(
15720 wkt::internal::UnknownEnumValue::Integer(value),
15721 )),
15722 }
15723 }
15724 }
15725
15726 impl std::convert::From<&str> for AllocationStrategy {
15727 fn from(value: &str) -> Self {
15728 use std::string::ToString;
15729 match value {
15730 "ALLOCATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
15731 "RANDOM" => Self::Random,
15732 "FIRST_AVAILABLE" => Self::FirstAvailable,
15733 "RANDOM_FIRST_N_AVAILABLE" => Self::RandomFirstNAvailable,
15734 "FIRST_SMALLEST_FITTING" => Self::FirstSmallestFitting,
15735 _ => Self::UnknownValue(allocation_strategy::UnknownValue(
15736 wkt::internal::UnknownEnumValue::String(value.to_string()),
15737 )),
15738 }
15739 }
15740 }
15741
15742 impl serde::ser::Serialize for AllocationStrategy {
15743 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15744 where
15745 S: serde::Serializer,
15746 {
15747 match self {
15748 Self::Unspecified => serializer.serialize_i32(0),
15749 Self::Random => serializer.serialize_i32(1),
15750 Self::FirstAvailable => serializer.serialize_i32(2),
15751 Self::RandomFirstNAvailable => serializer.serialize_i32(3),
15752 Self::FirstSmallestFitting => serializer.serialize_i32(4),
15753 Self::UnknownValue(u) => u.0.serialize(serializer),
15754 }
15755 }
15756 }
15757
15758 impl<'de> serde::de::Deserialize<'de> for AllocationStrategy {
15759 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15760 where
15761 D: serde::Deserializer<'de>,
15762 {
15763 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AllocationStrategy>::new(
15764 ".google.cloud.networkconnectivity.v1.InternalRange.AllocationStrategy",
15765 ))
15766 }
15767 }
15768}
15769
15770/// Request for InternalRangeService.ListInternalRanges
15771#[derive(Clone, Default, PartialEq)]
15772#[non_exhaustive]
15773pub struct ListInternalRangesRequest {
15774 /// Required. The parent resource's name.
15775 pub parent: std::string::String,
15776
15777 /// The maximum number of results per page that should be returned.
15778 pub page_size: i32,
15779
15780 /// The page token.
15781 pub page_token: std::string::String,
15782
15783 /// A filter expression that filters the results listed in the response.
15784 pub filter: std::string::String,
15785
15786 /// Sort the results by a certain order.
15787 pub order_by: std::string::String,
15788
15789 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15790}
15791
15792impl ListInternalRangesRequest {
15793 pub fn new() -> Self {
15794 std::default::Default::default()
15795 }
15796
15797 /// Sets the value of [parent][crate::model::ListInternalRangesRequest::parent].
15798 ///
15799 /// # Example
15800 /// ```ignore,no_run
15801 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15802 /// let x = ListInternalRangesRequest::new().set_parent("example");
15803 /// ```
15804 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15805 self.parent = v.into();
15806 self
15807 }
15808
15809 /// Sets the value of [page_size][crate::model::ListInternalRangesRequest::page_size].
15810 ///
15811 /// # Example
15812 /// ```ignore,no_run
15813 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15814 /// let x = ListInternalRangesRequest::new().set_page_size(42);
15815 /// ```
15816 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15817 self.page_size = v.into();
15818 self
15819 }
15820
15821 /// Sets the value of [page_token][crate::model::ListInternalRangesRequest::page_token].
15822 ///
15823 /// # Example
15824 /// ```ignore,no_run
15825 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15826 /// let x = ListInternalRangesRequest::new().set_page_token("example");
15827 /// ```
15828 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15829 self.page_token = v.into();
15830 self
15831 }
15832
15833 /// Sets the value of [filter][crate::model::ListInternalRangesRequest::filter].
15834 ///
15835 /// # Example
15836 /// ```ignore,no_run
15837 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15838 /// let x = ListInternalRangesRequest::new().set_filter("example");
15839 /// ```
15840 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15841 self.filter = v.into();
15842 self
15843 }
15844
15845 /// Sets the value of [order_by][crate::model::ListInternalRangesRequest::order_by].
15846 ///
15847 /// # Example
15848 /// ```ignore,no_run
15849 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15850 /// let x = ListInternalRangesRequest::new().set_order_by("example");
15851 /// ```
15852 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15853 self.order_by = v.into();
15854 self
15855 }
15856}
15857
15858impl wkt::message::Message for ListInternalRangesRequest {
15859 fn typename() -> &'static str {
15860 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesRequest"
15861 }
15862}
15863
15864/// Response for InternalRange.ListInternalRanges
15865#[derive(Clone, Default, PartialEq)]
15866#[non_exhaustive]
15867pub struct ListInternalRangesResponse {
15868 /// Internal ranges to be returned.
15869 pub internal_ranges: std::vec::Vec<crate::model::InternalRange>,
15870
15871 /// The next pagination token in the List response. It should be used as
15872 /// page_token for the following request. An empty value means no more result.
15873 pub next_page_token: std::string::String,
15874
15875 /// Locations that could not be reached.
15876 pub unreachable: std::vec::Vec<std::string::String>,
15877
15878 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15879}
15880
15881impl ListInternalRangesResponse {
15882 pub fn new() -> Self {
15883 std::default::Default::default()
15884 }
15885
15886 /// Sets the value of [internal_ranges][crate::model::ListInternalRangesResponse::internal_ranges].
15887 ///
15888 /// # Example
15889 /// ```ignore,no_run
15890 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
15891 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
15892 /// let x = ListInternalRangesResponse::new()
15893 /// .set_internal_ranges([
15894 /// InternalRange::default()/* use setters */,
15895 /// InternalRange::default()/* use (different) setters */,
15896 /// ]);
15897 /// ```
15898 pub fn set_internal_ranges<T, V>(mut self, v: T) -> Self
15899 where
15900 T: std::iter::IntoIterator<Item = V>,
15901 V: std::convert::Into<crate::model::InternalRange>,
15902 {
15903 use std::iter::Iterator;
15904 self.internal_ranges = v.into_iter().map(|i| i.into()).collect();
15905 self
15906 }
15907
15908 /// Sets the value of [next_page_token][crate::model::ListInternalRangesResponse::next_page_token].
15909 ///
15910 /// # Example
15911 /// ```ignore,no_run
15912 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
15913 /// let x = ListInternalRangesResponse::new().set_next_page_token("example");
15914 /// ```
15915 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15916 self.next_page_token = v.into();
15917 self
15918 }
15919
15920 /// Sets the value of [unreachable][crate::model::ListInternalRangesResponse::unreachable].
15921 ///
15922 /// # Example
15923 /// ```ignore,no_run
15924 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
15925 /// let x = ListInternalRangesResponse::new().set_unreachable(["a", "b", "c"]);
15926 /// ```
15927 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
15928 where
15929 T: std::iter::IntoIterator<Item = V>,
15930 V: std::convert::Into<std::string::String>,
15931 {
15932 use std::iter::Iterator;
15933 self.unreachable = v.into_iter().map(|i| i.into()).collect();
15934 self
15935 }
15936}
15937
15938impl wkt::message::Message for ListInternalRangesResponse {
15939 fn typename() -> &'static str {
15940 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesResponse"
15941 }
15942}
15943
15944#[doc(hidden)]
15945impl gax::paginator::internal::PageableResponse for ListInternalRangesResponse {
15946 type PageItem = crate::model::InternalRange;
15947
15948 fn items(self) -> std::vec::Vec<Self::PageItem> {
15949 self.internal_ranges
15950 }
15951
15952 fn next_page_token(&self) -> std::string::String {
15953 use std::clone::Clone;
15954 self.next_page_token.clone()
15955 }
15956}
15957
15958/// Request for InternalRangeService.GetInternalRange
15959#[derive(Clone, Default, PartialEq)]
15960#[non_exhaustive]
15961pub struct GetInternalRangeRequest {
15962 /// Required. Name of the InternalRange to get.
15963 pub name: std::string::String,
15964
15965 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15966}
15967
15968impl GetInternalRangeRequest {
15969 pub fn new() -> Self {
15970 std::default::Default::default()
15971 }
15972
15973 /// Sets the value of [name][crate::model::GetInternalRangeRequest::name].
15974 ///
15975 /// # Example
15976 /// ```ignore,no_run
15977 /// # use google_cloud_networkconnectivity_v1::model::GetInternalRangeRequest;
15978 /// let x = GetInternalRangeRequest::new().set_name("example");
15979 /// ```
15980 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15981 self.name = v.into();
15982 self
15983 }
15984}
15985
15986impl wkt::message::Message for GetInternalRangeRequest {
15987 fn typename() -> &'static str {
15988 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetInternalRangeRequest"
15989 }
15990}
15991
15992/// Request for InternalRangeService.CreateInternalRange
15993#[derive(Clone, Default, PartialEq)]
15994#[non_exhaustive]
15995pub struct CreateInternalRangeRequest {
15996 /// Required. The parent resource's name of the internal range.
15997 pub parent: std::string::String,
15998
15999 /// Optional. Resource ID
16000 /// (i.e. 'foo' in '[...]/projects/p/locations/l/internalRanges/foo')
16001 /// See <https://google.aip.dev/122#resource-id-segments>
16002 /// Unique per location.
16003 pub internal_range_id: std::string::String,
16004
16005 /// Required. Initial values for a new internal range
16006 pub internal_range: std::option::Option<crate::model::InternalRange>,
16007
16008 /// Optional. An optional request ID to identify requests. Specify a unique
16009 /// request ID so that if you must retry your request, the server will know to
16010 /// ignore the request if it has already been completed. The server will
16011 /// guarantee that for at least 60 minutes since the first request.
16012 ///
16013 /// For example, consider a situation where you make an initial request and
16014 /// the request times out. If you make the request again with the same request
16015 /// ID, the server can check if original operation with the same request ID
16016 /// was received, and if so, will ignore the second request. This prevents
16017 /// clients from accidentally creating duplicate commitments.
16018 ///
16019 /// The request ID must be a valid UUID with the exception that zero UUID is
16020 /// not supported (00000000-0000-0000-0000-000000000000).
16021 pub request_id: std::string::String,
16022
16023 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16024}
16025
16026impl CreateInternalRangeRequest {
16027 pub fn new() -> Self {
16028 std::default::Default::default()
16029 }
16030
16031 /// Sets the value of [parent][crate::model::CreateInternalRangeRequest::parent].
16032 ///
16033 /// # Example
16034 /// ```ignore,no_run
16035 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16036 /// let x = CreateInternalRangeRequest::new().set_parent("example");
16037 /// ```
16038 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16039 self.parent = v.into();
16040 self
16041 }
16042
16043 /// Sets the value of [internal_range_id][crate::model::CreateInternalRangeRequest::internal_range_id].
16044 ///
16045 /// # Example
16046 /// ```ignore,no_run
16047 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16048 /// let x = CreateInternalRangeRequest::new().set_internal_range_id("example");
16049 /// ```
16050 pub fn set_internal_range_id<T: std::convert::Into<std::string::String>>(
16051 mut self,
16052 v: T,
16053 ) -> Self {
16054 self.internal_range_id = v.into();
16055 self
16056 }
16057
16058 /// Sets the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
16059 ///
16060 /// # Example
16061 /// ```ignore,no_run
16062 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16063 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16064 /// let x = CreateInternalRangeRequest::new().set_internal_range(InternalRange::default()/* use setters */);
16065 /// ```
16066 pub fn set_internal_range<T>(mut self, v: T) -> Self
16067 where
16068 T: std::convert::Into<crate::model::InternalRange>,
16069 {
16070 self.internal_range = std::option::Option::Some(v.into());
16071 self
16072 }
16073
16074 /// Sets or clears the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
16075 ///
16076 /// # Example
16077 /// ```ignore,no_run
16078 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16079 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16080 /// let x = CreateInternalRangeRequest::new().set_or_clear_internal_range(Some(InternalRange::default()/* use setters */));
16081 /// let x = CreateInternalRangeRequest::new().set_or_clear_internal_range(None::<InternalRange>);
16082 /// ```
16083 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
16084 where
16085 T: std::convert::Into<crate::model::InternalRange>,
16086 {
16087 self.internal_range = v.map(|x| x.into());
16088 self
16089 }
16090
16091 /// Sets the value of [request_id][crate::model::CreateInternalRangeRequest::request_id].
16092 ///
16093 /// # Example
16094 /// ```ignore,no_run
16095 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16096 /// let x = CreateInternalRangeRequest::new().set_request_id("example");
16097 /// ```
16098 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16099 self.request_id = v.into();
16100 self
16101 }
16102}
16103
16104impl wkt::message::Message for CreateInternalRangeRequest {
16105 fn typename() -> &'static str {
16106 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateInternalRangeRequest"
16107 }
16108}
16109
16110/// Request for InternalRangeService.UpdateInternalRange
16111#[derive(Clone, Default, PartialEq)]
16112#[non_exhaustive]
16113pub struct UpdateInternalRangeRequest {
16114 /// Optional. Field mask is used to specify the fields to be overwritten in the
16115 /// InternalRange resource by the update.
16116 /// The fields specified in the update_mask are relative to the resource, not
16117 /// the full request. A field will be overwritten if it is in the mask. If the
16118 /// user does not provide a mask then all fields will be overwritten.
16119 pub update_mask: std::option::Option<wkt::FieldMask>,
16120
16121 /// Required. New values to be patched into the resource.
16122 pub internal_range: std::option::Option<crate::model::InternalRange>,
16123
16124 /// Optional. An optional request ID to identify requests. Specify a unique
16125 /// request ID so that if you must retry your request, the server will know to
16126 /// ignore the request if it has already been completed. The server will
16127 /// guarantee that for at least 60 minutes since the first request.
16128 ///
16129 /// For example, consider a situation where you make an initial request and
16130 /// the request times out. If you make the request again with the same request
16131 /// ID, the server can check if original operation with the same request ID
16132 /// was received, and if so, will ignore the second request. This prevents
16133 /// clients from accidentally creating duplicate commitments.
16134 ///
16135 /// The request ID must be a valid UUID with the exception that zero UUID is
16136 /// not supported (00000000-0000-0000-0000-000000000000).
16137 pub request_id: std::string::String,
16138
16139 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16140}
16141
16142impl UpdateInternalRangeRequest {
16143 pub fn new() -> Self {
16144 std::default::Default::default()
16145 }
16146
16147 /// Sets the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
16148 ///
16149 /// # Example
16150 /// ```ignore,no_run
16151 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16152 /// use wkt::FieldMask;
16153 /// let x = UpdateInternalRangeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16154 /// ```
16155 pub fn set_update_mask<T>(mut self, v: T) -> Self
16156 where
16157 T: std::convert::Into<wkt::FieldMask>,
16158 {
16159 self.update_mask = std::option::Option::Some(v.into());
16160 self
16161 }
16162
16163 /// Sets or clears the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
16164 ///
16165 /// # Example
16166 /// ```ignore,no_run
16167 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16168 /// use wkt::FieldMask;
16169 /// let x = UpdateInternalRangeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16170 /// let x = UpdateInternalRangeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16171 /// ```
16172 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16173 where
16174 T: std::convert::Into<wkt::FieldMask>,
16175 {
16176 self.update_mask = v.map(|x| x.into());
16177 self
16178 }
16179
16180 /// Sets the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
16181 ///
16182 /// # Example
16183 /// ```ignore,no_run
16184 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16185 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16186 /// let x = UpdateInternalRangeRequest::new().set_internal_range(InternalRange::default()/* use setters */);
16187 /// ```
16188 pub fn set_internal_range<T>(mut self, v: T) -> Self
16189 where
16190 T: std::convert::Into<crate::model::InternalRange>,
16191 {
16192 self.internal_range = std::option::Option::Some(v.into());
16193 self
16194 }
16195
16196 /// Sets or clears the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
16197 ///
16198 /// # Example
16199 /// ```ignore,no_run
16200 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16201 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16202 /// let x = UpdateInternalRangeRequest::new().set_or_clear_internal_range(Some(InternalRange::default()/* use setters */));
16203 /// let x = UpdateInternalRangeRequest::new().set_or_clear_internal_range(None::<InternalRange>);
16204 /// ```
16205 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
16206 where
16207 T: std::convert::Into<crate::model::InternalRange>,
16208 {
16209 self.internal_range = v.map(|x| x.into());
16210 self
16211 }
16212
16213 /// Sets the value of [request_id][crate::model::UpdateInternalRangeRequest::request_id].
16214 ///
16215 /// # Example
16216 /// ```ignore,no_run
16217 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16218 /// let x = UpdateInternalRangeRequest::new().set_request_id("example");
16219 /// ```
16220 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16221 self.request_id = v.into();
16222 self
16223 }
16224}
16225
16226impl wkt::message::Message for UpdateInternalRangeRequest {
16227 fn typename() -> &'static str {
16228 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateInternalRangeRequest"
16229 }
16230}
16231
16232/// Request for InternalRangeService.DeleteInternalRange
16233#[derive(Clone, Default, PartialEq)]
16234#[non_exhaustive]
16235pub struct DeleteInternalRangeRequest {
16236 /// Required. The name of the internal range to delete.
16237 pub name: std::string::String,
16238
16239 /// Optional. An optional request ID to identify requests. Specify a unique
16240 /// request ID so that if you must retry your request, the server will know to
16241 /// ignore the request if it has already been completed. The server will
16242 /// guarantee that for at least 60 minutes after the first request.
16243 ///
16244 /// For example, consider a situation where you make an initial request and
16245 /// the request times out. If you make the request again with the same request
16246 /// ID, the server can check if original operation with the same request ID
16247 /// was received, and if so, will ignore the second request. This prevents
16248 /// clients from accidentally creating duplicate commitments.
16249 ///
16250 /// The request ID must be a valid UUID with the exception that zero UUID is
16251 /// not supported (00000000-0000-0000-0000-000000000000).
16252 pub request_id: std::string::String,
16253
16254 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16255}
16256
16257impl DeleteInternalRangeRequest {
16258 pub fn new() -> Self {
16259 std::default::Default::default()
16260 }
16261
16262 /// Sets the value of [name][crate::model::DeleteInternalRangeRequest::name].
16263 ///
16264 /// # Example
16265 /// ```ignore,no_run
16266 /// # use google_cloud_networkconnectivity_v1::model::DeleteInternalRangeRequest;
16267 /// let x = DeleteInternalRangeRequest::new().set_name("example");
16268 /// ```
16269 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16270 self.name = v.into();
16271 self
16272 }
16273
16274 /// Sets the value of [request_id][crate::model::DeleteInternalRangeRequest::request_id].
16275 ///
16276 /// # Example
16277 /// ```ignore,no_run
16278 /// # use google_cloud_networkconnectivity_v1::model::DeleteInternalRangeRequest;
16279 /// let x = DeleteInternalRangeRequest::new().set_request_id("example");
16280 /// ```
16281 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16282 self.request_id = v.into();
16283 self
16284 }
16285}
16286
16287impl wkt::message::Message for DeleteInternalRangeRequest {
16288 fn typename() -> &'static str {
16289 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteInternalRangeRequest"
16290 }
16291}
16292
16293/// Policy-based routes route L4 network traffic based on not just destination IP
16294/// address, but also source IP address, protocol, and more. If a policy-based
16295/// route conflicts with other types of routes, the policy-based route always
16296/// takes precedence.
16297#[derive(Clone, Default, PartialEq)]
16298#[non_exhaustive]
16299pub struct PolicyBasedRoute {
16300 /// Immutable. A unique name of the resource in the form of
16301 /// `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
16302 pub name: std::string::String,
16303
16304 /// Output only. Time when the policy-based route was created.
16305 pub create_time: std::option::Option<wkt::Timestamp>,
16306
16307 /// Output only. Time when the policy-based route was updated.
16308 pub update_time: std::option::Option<wkt::Timestamp>,
16309
16310 /// User-defined labels.
16311 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16312
16313 /// Optional. An optional description of this resource. Provide this field when
16314 /// you create the resource.
16315 pub description: std::string::String,
16316
16317 /// Required. Fully-qualified URL of the network that this route applies to,
16318 /// for example: projects/my-project/global/networks/my-network.
16319 pub network: std::string::String,
16320
16321 /// Required. The filter to match L4 traffic.
16322 pub filter: std::option::Option<crate::model::policy_based_route::Filter>,
16323
16324 /// Optional. The priority of this policy-based route. Priority is used to
16325 /// break ties in cases where there are more than one matching policy-based
16326 /// routes found. In cases where multiple policy-based routes are matched, the
16327 /// one with the lowest-numbered priority value wins. The default value is
16328 /// 1000. The priority value must be from 1 to 65535, inclusive.
16329 pub priority: i32,
16330
16331 /// Output only. If potential misconfigurations are detected for this route,
16332 /// this field will be populated with warning messages.
16333 pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,
16334
16335 /// Output only. Server-defined fully-qualified URL for this resource.
16336 pub self_link: std::string::String,
16337
16338 /// Output only. Type of this resource. Always
16339 /// networkconnectivity#policyBasedRoute for policy-based Route resources.
16340 pub kind: std::string::String,
16341
16342 /// Target specifies network endpoints that this policy-based route applies to.
16343 /// If no target is specified, the PBR will be installed on all network
16344 /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
16345 pub target: std::option::Option<crate::model::policy_based_route::Target>,
16346
16347 pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,
16348
16349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16350}
16351
16352impl PolicyBasedRoute {
16353 pub fn new() -> Self {
16354 std::default::Default::default()
16355 }
16356
16357 /// Sets the value of [name][crate::model::PolicyBasedRoute::name].
16358 ///
16359 /// # Example
16360 /// ```ignore,no_run
16361 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16362 /// let x = PolicyBasedRoute::new().set_name("example");
16363 /// ```
16364 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16365 self.name = v.into();
16366 self
16367 }
16368
16369 /// Sets the value of [create_time][crate::model::PolicyBasedRoute::create_time].
16370 ///
16371 /// # Example
16372 /// ```ignore,no_run
16373 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16374 /// use wkt::Timestamp;
16375 /// let x = PolicyBasedRoute::new().set_create_time(Timestamp::default()/* use setters */);
16376 /// ```
16377 pub fn set_create_time<T>(mut self, v: T) -> Self
16378 where
16379 T: std::convert::Into<wkt::Timestamp>,
16380 {
16381 self.create_time = std::option::Option::Some(v.into());
16382 self
16383 }
16384
16385 /// Sets or clears the value of [create_time][crate::model::PolicyBasedRoute::create_time].
16386 ///
16387 /// # Example
16388 /// ```ignore,no_run
16389 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16390 /// use wkt::Timestamp;
16391 /// let x = PolicyBasedRoute::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16392 /// let x = PolicyBasedRoute::new().set_or_clear_create_time(None::<Timestamp>);
16393 /// ```
16394 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16395 where
16396 T: std::convert::Into<wkt::Timestamp>,
16397 {
16398 self.create_time = v.map(|x| x.into());
16399 self
16400 }
16401
16402 /// Sets the value of [update_time][crate::model::PolicyBasedRoute::update_time].
16403 ///
16404 /// # Example
16405 /// ```ignore,no_run
16406 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16407 /// use wkt::Timestamp;
16408 /// let x = PolicyBasedRoute::new().set_update_time(Timestamp::default()/* use setters */);
16409 /// ```
16410 pub fn set_update_time<T>(mut self, v: T) -> Self
16411 where
16412 T: std::convert::Into<wkt::Timestamp>,
16413 {
16414 self.update_time = std::option::Option::Some(v.into());
16415 self
16416 }
16417
16418 /// Sets or clears the value of [update_time][crate::model::PolicyBasedRoute::update_time].
16419 ///
16420 /// # Example
16421 /// ```ignore,no_run
16422 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16423 /// use wkt::Timestamp;
16424 /// let x = PolicyBasedRoute::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16425 /// let x = PolicyBasedRoute::new().set_or_clear_update_time(None::<Timestamp>);
16426 /// ```
16427 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16428 where
16429 T: std::convert::Into<wkt::Timestamp>,
16430 {
16431 self.update_time = v.map(|x| x.into());
16432 self
16433 }
16434
16435 /// Sets the value of [labels][crate::model::PolicyBasedRoute::labels].
16436 ///
16437 /// # Example
16438 /// ```ignore,no_run
16439 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16440 /// let x = PolicyBasedRoute::new().set_labels([
16441 /// ("key0", "abc"),
16442 /// ("key1", "xyz"),
16443 /// ]);
16444 /// ```
16445 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16446 where
16447 T: std::iter::IntoIterator<Item = (K, V)>,
16448 K: std::convert::Into<std::string::String>,
16449 V: std::convert::Into<std::string::String>,
16450 {
16451 use std::iter::Iterator;
16452 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16453 self
16454 }
16455
16456 /// Sets the value of [description][crate::model::PolicyBasedRoute::description].
16457 ///
16458 /// # Example
16459 /// ```ignore,no_run
16460 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16461 /// let x = PolicyBasedRoute::new().set_description("example");
16462 /// ```
16463 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16464 self.description = v.into();
16465 self
16466 }
16467
16468 /// Sets the value of [network][crate::model::PolicyBasedRoute::network].
16469 ///
16470 /// # Example
16471 /// ```ignore,no_run
16472 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16473 /// let x = PolicyBasedRoute::new().set_network("example");
16474 /// ```
16475 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16476 self.network = v.into();
16477 self
16478 }
16479
16480 /// Sets the value of [filter][crate::model::PolicyBasedRoute::filter].
16481 ///
16482 /// # Example
16483 /// ```ignore,no_run
16484 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16485 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16486 /// let x = PolicyBasedRoute::new().set_filter(Filter::default()/* use setters */);
16487 /// ```
16488 pub fn set_filter<T>(mut self, v: T) -> Self
16489 where
16490 T: std::convert::Into<crate::model::policy_based_route::Filter>,
16491 {
16492 self.filter = std::option::Option::Some(v.into());
16493 self
16494 }
16495
16496 /// Sets or clears the value of [filter][crate::model::PolicyBasedRoute::filter].
16497 ///
16498 /// # Example
16499 /// ```ignore,no_run
16500 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16501 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16502 /// let x = PolicyBasedRoute::new().set_or_clear_filter(Some(Filter::default()/* use setters */));
16503 /// let x = PolicyBasedRoute::new().set_or_clear_filter(None::<Filter>);
16504 /// ```
16505 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
16506 where
16507 T: std::convert::Into<crate::model::policy_based_route::Filter>,
16508 {
16509 self.filter = v.map(|x| x.into());
16510 self
16511 }
16512
16513 /// Sets the value of [priority][crate::model::PolicyBasedRoute::priority].
16514 ///
16515 /// # Example
16516 /// ```ignore,no_run
16517 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16518 /// let x = PolicyBasedRoute::new().set_priority(42);
16519 /// ```
16520 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16521 self.priority = v.into();
16522 self
16523 }
16524
16525 /// Sets the value of [warnings][crate::model::PolicyBasedRoute::warnings].
16526 ///
16527 /// # Example
16528 /// ```ignore,no_run
16529 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16530 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
16531 /// let x = PolicyBasedRoute::new()
16532 /// .set_warnings([
16533 /// Warnings::default()/* use setters */,
16534 /// Warnings::default()/* use (different) setters */,
16535 /// ]);
16536 /// ```
16537 pub fn set_warnings<T, V>(mut self, v: T) -> Self
16538 where
16539 T: std::iter::IntoIterator<Item = V>,
16540 V: std::convert::Into<crate::model::policy_based_route::Warnings>,
16541 {
16542 use std::iter::Iterator;
16543 self.warnings = v.into_iter().map(|i| i.into()).collect();
16544 self
16545 }
16546
16547 /// Sets the value of [self_link][crate::model::PolicyBasedRoute::self_link].
16548 ///
16549 /// # Example
16550 /// ```ignore,no_run
16551 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16552 /// let x = PolicyBasedRoute::new().set_self_link("example");
16553 /// ```
16554 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16555 self.self_link = v.into();
16556 self
16557 }
16558
16559 /// Sets the value of [kind][crate::model::PolicyBasedRoute::kind].
16560 ///
16561 /// # Example
16562 /// ```ignore,no_run
16563 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16564 /// let x = PolicyBasedRoute::new().set_kind("example");
16565 /// ```
16566 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16567 self.kind = v.into();
16568 self
16569 }
16570
16571 /// Sets the value of [target][crate::model::PolicyBasedRoute::target].
16572 ///
16573 /// Note that all the setters affecting `target` are mutually
16574 /// exclusive.
16575 ///
16576 /// # Example
16577 /// ```ignore,no_run
16578 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16579 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16580 /// let x = PolicyBasedRoute::new().set_target(Some(
16581 /// google_cloud_networkconnectivity_v1::model::policy_based_route::Target::VirtualMachine(VirtualMachine::default().into())));
16582 /// ```
16583 pub fn set_target<
16584 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
16585 >(
16586 mut self,
16587 v: T,
16588 ) -> Self {
16589 self.target = v.into();
16590 self
16591 }
16592
16593 /// The value of [target][crate::model::PolicyBasedRoute::target]
16594 /// if it holds a `VirtualMachine`, `None` if the field is not set or
16595 /// holds a different branch.
16596 pub fn virtual_machine(
16597 &self,
16598 ) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
16599 {
16600 #[allow(unreachable_patterns)]
16601 self.target.as_ref().and_then(|v| match v {
16602 crate::model::policy_based_route::Target::VirtualMachine(v) => {
16603 std::option::Option::Some(v)
16604 }
16605 _ => std::option::Option::None,
16606 })
16607 }
16608
16609 /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
16610 /// to hold a `VirtualMachine`.
16611 ///
16612 /// Note that all the setters affecting `target` are
16613 /// mutually exclusive.
16614 ///
16615 /// # Example
16616 /// ```ignore,no_run
16617 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16618 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16619 /// let x = PolicyBasedRoute::new().set_virtual_machine(VirtualMachine::default()/* use setters */);
16620 /// assert!(x.virtual_machine().is_some());
16621 /// assert!(x.interconnect_attachment().is_none());
16622 /// ```
16623 pub fn set_virtual_machine<
16624 T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
16625 >(
16626 mut self,
16627 v: T,
16628 ) -> Self {
16629 self.target = std::option::Option::Some(
16630 crate::model::policy_based_route::Target::VirtualMachine(v.into()),
16631 );
16632 self
16633 }
16634
16635 /// The value of [target][crate::model::PolicyBasedRoute::target]
16636 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
16637 /// holds a different branch.
16638 pub fn interconnect_attachment(
16639 &self,
16640 ) -> std::option::Option<
16641 &std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
16642 > {
16643 #[allow(unreachable_patterns)]
16644 self.target.as_ref().and_then(|v| match v {
16645 crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
16646 std::option::Option::Some(v)
16647 }
16648 _ => std::option::Option::None,
16649 })
16650 }
16651
16652 /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
16653 /// to hold a `InterconnectAttachment`.
16654 ///
16655 /// Note that all the setters affecting `target` are
16656 /// mutually exclusive.
16657 ///
16658 /// # Example
16659 /// ```ignore,no_run
16660 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16661 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::InterconnectAttachment;
16662 /// let x = PolicyBasedRoute::new().set_interconnect_attachment(InterconnectAttachment::default()/* use setters */);
16663 /// assert!(x.interconnect_attachment().is_some());
16664 /// assert!(x.virtual_machine().is_none());
16665 /// ```
16666 pub fn set_interconnect_attachment<
16667 T: std::convert::Into<
16668 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
16669 >,
16670 >(
16671 mut self,
16672 v: T,
16673 ) -> Self {
16674 self.target = std::option::Option::Some(
16675 crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
16676 );
16677 self
16678 }
16679
16680 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop].
16681 ///
16682 /// Note that all the setters affecting `next_hop` are mutually
16683 /// exclusive.
16684 ///
16685 /// # Example
16686 /// ```ignore,no_run
16687 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16688 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::NextHop;
16689 /// let x = PolicyBasedRoute::new().set_next_hop(Some(NextHop::NextHopIlbIp("example".to_string())));
16690 /// ```
16691 pub fn set_next_hop<
16692 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
16693 >(
16694 mut self,
16695 v: T,
16696 ) -> Self {
16697 self.next_hop = v.into();
16698 self
16699 }
16700
16701 /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16702 /// if it holds a `NextHopIlbIp`, `None` if the field is not set or
16703 /// holds a different branch.
16704 pub fn next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
16705 #[allow(unreachable_patterns)]
16706 self.next_hop.as_ref().and_then(|v| match v {
16707 crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
16708 std::option::Option::Some(v)
16709 }
16710 _ => std::option::Option::None,
16711 })
16712 }
16713
16714 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16715 /// to hold a `NextHopIlbIp`.
16716 ///
16717 /// Note that all the setters affecting `next_hop` are
16718 /// mutually exclusive.
16719 ///
16720 /// # Example
16721 /// ```ignore,no_run
16722 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16723 /// let x = PolicyBasedRoute::new().set_next_hop_ilb_ip("example");
16724 /// assert!(x.next_hop_ilb_ip().is_some());
16725 /// assert!(x.next_hop_other_routes().is_none());
16726 /// ```
16727 pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16728 self.next_hop = std::option::Option::Some(
16729 crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
16730 );
16731 self
16732 }
16733
16734 /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16735 /// if it holds a `NextHopOtherRoutes`, `None` if the field is not set or
16736 /// holds a different branch.
16737 pub fn next_hop_other_routes(
16738 &self,
16739 ) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
16740 #[allow(unreachable_patterns)]
16741 self.next_hop.as_ref().and_then(|v| match v {
16742 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
16743 std::option::Option::Some(v)
16744 }
16745 _ => std::option::Option::None,
16746 })
16747 }
16748
16749 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16750 /// to hold a `NextHopOtherRoutes`.
16751 ///
16752 /// Note that all the setters affecting `next_hop` are
16753 /// mutually exclusive.
16754 ///
16755 /// # Example
16756 /// ```ignore,no_run
16757 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16758 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::OtherRoutes;
16759 /// let x0 = PolicyBasedRoute::new().set_next_hop_other_routes(OtherRoutes::DefaultRouting);
16760 /// assert!(x0.next_hop_other_routes().is_some());
16761 /// assert!(x0.next_hop_ilb_ip().is_none());
16762 /// ```
16763 pub fn set_next_hop_other_routes<
16764 T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
16765 >(
16766 mut self,
16767 v: T,
16768 ) -> Self {
16769 self.next_hop = std::option::Option::Some(
16770 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
16771 );
16772 self
16773 }
16774}
16775
16776impl wkt::message::Message for PolicyBasedRoute {
16777 fn typename() -> &'static str {
16778 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
16779 }
16780}
16781
16782/// Defines additional types related to [PolicyBasedRoute].
16783pub mod policy_based_route {
16784 #[allow(unused_imports)]
16785 use super::*;
16786
16787 /// VM instances that this policy-based route applies to.
16788 #[derive(Clone, Default, PartialEq)]
16789 #[non_exhaustive]
16790 pub struct VirtualMachine {
16791 /// Optional. A list of VM instance tags that this policy-based route applies
16792 /// to. VM instances that have ANY of tags specified here installs this PBR.
16793 pub tags: std::vec::Vec<std::string::String>,
16794
16795 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16796 }
16797
16798 impl VirtualMachine {
16799 pub fn new() -> Self {
16800 std::default::Default::default()
16801 }
16802
16803 /// Sets the value of [tags][crate::model::policy_based_route::VirtualMachine::tags].
16804 ///
16805 /// # Example
16806 /// ```ignore,no_run
16807 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16808 /// let x = VirtualMachine::new().set_tags(["a", "b", "c"]);
16809 /// ```
16810 pub fn set_tags<T, V>(mut self, v: T) -> Self
16811 where
16812 T: std::iter::IntoIterator<Item = V>,
16813 V: std::convert::Into<std::string::String>,
16814 {
16815 use std::iter::Iterator;
16816 self.tags = v.into_iter().map(|i| i.into()).collect();
16817 self
16818 }
16819 }
16820
16821 impl wkt::message::Message for VirtualMachine {
16822 fn typename() -> &'static str {
16823 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
16824 }
16825 }
16826
16827 /// InterconnectAttachment that this route applies to.
16828 #[derive(Clone, Default, PartialEq)]
16829 #[non_exhaustive]
16830 pub struct InterconnectAttachment {
16831 /// Optional. Cloud region to install this policy-based route on interconnect
16832 /// attachment. Use `all` to install it on all interconnect attachments.
16833 pub region: std::string::String,
16834
16835 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16836 }
16837
16838 impl InterconnectAttachment {
16839 pub fn new() -> Self {
16840 std::default::Default::default()
16841 }
16842
16843 /// Sets the value of [region][crate::model::policy_based_route::InterconnectAttachment::region].
16844 ///
16845 /// # Example
16846 /// ```ignore,no_run
16847 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::InterconnectAttachment;
16848 /// let x = InterconnectAttachment::new().set_region("example");
16849 /// ```
16850 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16851 self.region = v.into();
16852 self
16853 }
16854 }
16855
16856 impl wkt::message::Message for InterconnectAttachment {
16857 fn typename() -> &'static str {
16858 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
16859 }
16860 }
16861
16862 /// Filter matches L4 traffic.
16863 #[derive(Clone, Default, PartialEq)]
16864 #[non_exhaustive]
16865 pub struct Filter {
16866 /// Optional. The IP protocol that this policy-based route applies to. Valid
16867 /// values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
16868 pub ip_protocol: std::string::String,
16869
16870 /// Optional. The source IP range of outgoing packets that this policy-based
16871 /// route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
16872 pub src_range: std::string::String,
16873
16874 /// Optional. The destination IP range of outgoing packets that this
16875 /// policy-based route applies to. Default is "0.0.0.0/0" if protocol version
16876 /// is IPv4.
16877 pub dest_range: std::string::String,
16878
16879 /// Required. Internet protocol versions this policy-based route applies to.
16880 /// For this version, only IPV4 is supported. IPV6 is supported in preview.
16881 pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,
16882
16883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16884 }
16885
16886 impl Filter {
16887 pub fn new() -> Self {
16888 std::default::Default::default()
16889 }
16890
16891 /// Sets the value of [ip_protocol][crate::model::policy_based_route::Filter::ip_protocol].
16892 ///
16893 /// # Example
16894 /// ```ignore,no_run
16895 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16896 /// let x = Filter::new().set_ip_protocol("example");
16897 /// ```
16898 pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16899 self.ip_protocol = v.into();
16900 self
16901 }
16902
16903 /// Sets the value of [src_range][crate::model::policy_based_route::Filter::src_range].
16904 ///
16905 /// # Example
16906 /// ```ignore,no_run
16907 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16908 /// let x = Filter::new().set_src_range("example");
16909 /// ```
16910 pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16911 self.src_range = v.into();
16912 self
16913 }
16914
16915 /// Sets the value of [dest_range][crate::model::policy_based_route::Filter::dest_range].
16916 ///
16917 /// # Example
16918 /// ```ignore,no_run
16919 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16920 /// let x = Filter::new().set_dest_range("example");
16921 /// ```
16922 pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16923 self.dest_range = v.into();
16924 self
16925 }
16926
16927 /// Sets the value of [protocol_version][crate::model::policy_based_route::Filter::protocol_version].
16928 ///
16929 /// # Example
16930 /// ```ignore,no_run
16931 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16932 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::filter::ProtocolVersion;
16933 /// let x0 = Filter::new().set_protocol_version(ProtocolVersion::Ipv4);
16934 /// ```
16935 pub fn set_protocol_version<
16936 T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
16937 >(
16938 mut self,
16939 v: T,
16940 ) -> Self {
16941 self.protocol_version = v.into();
16942 self
16943 }
16944 }
16945
16946 impl wkt::message::Message for Filter {
16947 fn typename() -> &'static str {
16948 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
16949 }
16950 }
16951
16952 /// Defines additional types related to [Filter].
16953 pub mod filter {
16954 #[allow(unused_imports)]
16955 use super::*;
16956
16957 /// The internet protocol version.
16958 ///
16959 /// # Working with unknown values
16960 ///
16961 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16962 /// additional enum variants at any time. Adding new variants is not considered
16963 /// a breaking change. Applications should write their code in anticipation of:
16964 ///
16965 /// - New values appearing in future releases of the client library, **and**
16966 /// - New values received dynamically, without application changes.
16967 ///
16968 /// Please consult the [Working with enums] section in the user guide for some
16969 /// guidelines.
16970 ///
16971 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16972 #[derive(Clone, Debug, PartialEq)]
16973 #[non_exhaustive]
16974 pub enum ProtocolVersion {
16975 /// Default value.
16976 Unspecified,
16977 /// The PBR is for IPv4 internet protocol traffic.
16978 Ipv4,
16979 /// If set, the enum was initialized with an unknown value.
16980 ///
16981 /// Applications can examine the value using [ProtocolVersion::value] or
16982 /// [ProtocolVersion::name].
16983 UnknownValue(protocol_version::UnknownValue),
16984 }
16985
16986 #[doc(hidden)]
16987 pub mod protocol_version {
16988 #[allow(unused_imports)]
16989 use super::*;
16990 #[derive(Clone, Debug, PartialEq)]
16991 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16992 }
16993
16994 impl ProtocolVersion {
16995 /// Gets the enum value.
16996 ///
16997 /// Returns `None` if the enum contains an unknown value deserialized from
16998 /// the string representation of enums.
16999 pub fn value(&self) -> std::option::Option<i32> {
17000 match self {
17001 Self::Unspecified => std::option::Option::Some(0),
17002 Self::Ipv4 => std::option::Option::Some(1),
17003 Self::UnknownValue(u) => u.0.value(),
17004 }
17005 }
17006
17007 /// Gets the enum value as a string.
17008 ///
17009 /// Returns `None` if the enum contains an unknown value deserialized from
17010 /// the integer representation of enums.
17011 pub fn name(&self) -> std::option::Option<&str> {
17012 match self {
17013 Self::Unspecified => std::option::Option::Some("PROTOCOL_VERSION_UNSPECIFIED"),
17014 Self::Ipv4 => std::option::Option::Some("IPV4"),
17015 Self::UnknownValue(u) => u.0.name(),
17016 }
17017 }
17018 }
17019
17020 impl std::default::Default for ProtocolVersion {
17021 fn default() -> Self {
17022 use std::convert::From;
17023 Self::from(0)
17024 }
17025 }
17026
17027 impl std::fmt::Display for ProtocolVersion {
17028 fn fmt(
17029 &self,
17030 f: &mut std::fmt::Formatter<'_>,
17031 ) -> std::result::Result<(), std::fmt::Error> {
17032 wkt::internal::display_enum(f, self.name(), self.value())
17033 }
17034 }
17035
17036 impl std::convert::From<i32> for ProtocolVersion {
17037 fn from(value: i32) -> Self {
17038 match value {
17039 0 => Self::Unspecified,
17040 1 => Self::Ipv4,
17041 _ => Self::UnknownValue(protocol_version::UnknownValue(
17042 wkt::internal::UnknownEnumValue::Integer(value),
17043 )),
17044 }
17045 }
17046 }
17047
17048 impl std::convert::From<&str> for ProtocolVersion {
17049 fn from(value: &str) -> Self {
17050 use std::string::ToString;
17051 match value {
17052 "PROTOCOL_VERSION_UNSPECIFIED" => Self::Unspecified,
17053 "IPV4" => Self::Ipv4,
17054 _ => Self::UnknownValue(protocol_version::UnknownValue(
17055 wkt::internal::UnknownEnumValue::String(value.to_string()),
17056 )),
17057 }
17058 }
17059 }
17060
17061 impl serde::ser::Serialize for ProtocolVersion {
17062 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17063 where
17064 S: serde::Serializer,
17065 {
17066 match self {
17067 Self::Unspecified => serializer.serialize_i32(0),
17068 Self::Ipv4 => serializer.serialize_i32(1),
17069 Self::UnknownValue(u) => u.0.serialize(serializer),
17070 }
17071 }
17072 }
17073
17074 impl<'de> serde::de::Deserialize<'de> for ProtocolVersion {
17075 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17076 where
17077 D: serde::Deserializer<'de>,
17078 {
17079 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProtocolVersion>::new(
17080 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion",
17081 ))
17082 }
17083 }
17084 }
17085
17086 /// Informational warning message.
17087 #[derive(Clone, Default, PartialEq)]
17088 #[non_exhaustive]
17089 pub struct Warnings {
17090 /// Output only. A warning code, if applicable.
17091 pub code: crate::model::policy_based_route::warnings::Code,
17092
17093 /// Output only. Metadata about this warning in key: value format. The key
17094 /// should provides more detail on the warning being returned. For example,
17095 /// for warnings where there are no results in a list request for a
17096 /// particular zone, this key might be scope and the key value might be the
17097 /// zone name. Other examples might be a key indicating a deprecated resource
17098 /// and a suggested replacement.
17099 pub data: std::collections::HashMap<std::string::String, std::string::String>,
17100
17101 /// Output only. A human-readable description of the warning code.
17102 pub warning_message: std::string::String,
17103
17104 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17105 }
17106
17107 impl Warnings {
17108 pub fn new() -> Self {
17109 std::default::Default::default()
17110 }
17111
17112 /// Sets the value of [code][crate::model::policy_based_route::Warnings::code].
17113 ///
17114 /// # Example
17115 /// ```ignore,no_run
17116 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17117 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::warnings::Code;
17118 /// let x0 = Warnings::new().set_code(Code::ResourceNotActive);
17119 /// let x1 = Warnings::new().set_code(Code::ResourceBeingModified);
17120 /// ```
17121 pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
17122 mut self,
17123 v: T,
17124 ) -> Self {
17125 self.code = v.into();
17126 self
17127 }
17128
17129 /// Sets the value of [data][crate::model::policy_based_route::Warnings::data].
17130 ///
17131 /// # Example
17132 /// ```ignore,no_run
17133 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17134 /// let x = Warnings::new().set_data([
17135 /// ("key0", "abc"),
17136 /// ("key1", "xyz"),
17137 /// ]);
17138 /// ```
17139 pub fn set_data<T, K, V>(mut self, v: T) -> Self
17140 where
17141 T: std::iter::IntoIterator<Item = (K, V)>,
17142 K: std::convert::Into<std::string::String>,
17143 V: std::convert::Into<std::string::String>,
17144 {
17145 use std::iter::Iterator;
17146 self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17147 self
17148 }
17149
17150 /// Sets the value of [warning_message][crate::model::policy_based_route::Warnings::warning_message].
17151 ///
17152 /// # Example
17153 /// ```ignore,no_run
17154 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17155 /// let x = Warnings::new().set_warning_message("example");
17156 /// ```
17157 pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
17158 mut self,
17159 v: T,
17160 ) -> Self {
17161 self.warning_message = v.into();
17162 self
17163 }
17164 }
17165
17166 impl wkt::message::Message for Warnings {
17167 fn typename() -> &'static str {
17168 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
17169 }
17170 }
17171
17172 /// Defines additional types related to [Warnings].
17173 pub mod warnings {
17174 #[allow(unused_imports)]
17175 use super::*;
17176
17177 /// Warning code for policy-based routing. Expect to add values in the
17178 /// future.
17179 ///
17180 /// # Working with unknown values
17181 ///
17182 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17183 /// additional enum variants at any time. Adding new variants is not considered
17184 /// a breaking change. Applications should write their code in anticipation of:
17185 ///
17186 /// - New values appearing in future releases of the client library, **and**
17187 /// - New values received dynamically, without application changes.
17188 ///
17189 /// Please consult the [Working with enums] section in the user guide for some
17190 /// guidelines.
17191 ///
17192 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17193 #[derive(Clone, Debug, PartialEq)]
17194 #[non_exhaustive]
17195 pub enum Code {
17196 /// Default value.
17197 WarningUnspecified,
17198 /// The policy-based route is not active and functioning. Common causes are
17199 /// that the dependent network was deleted or the resource project was
17200 /// turned off.
17201 ResourceNotActive,
17202 /// The policy-based route is being modified (e.g. created/deleted) at this
17203 /// time.
17204 ResourceBeingModified,
17205 /// If set, the enum was initialized with an unknown value.
17206 ///
17207 /// Applications can examine the value using [Code::value] or
17208 /// [Code::name].
17209 UnknownValue(code::UnknownValue),
17210 }
17211
17212 #[doc(hidden)]
17213 pub mod code {
17214 #[allow(unused_imports)]
17215 use super::*;
17216 #[derive(Clone, Debug, PartialEq)]
17217 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17218 }
17219
17220 impl Code {
17221 /// Gets the enum value.
17222 ///
17223 /// Returns `None` if the enum contains an unknown value deserialized from
17224 /// the string representation of enums.
17225 pub fn value(&self) -> std::option::Option<i32> {
17226 match self {
17227 Self::WarningUnspecified => std::option::Option::Some(0),
17228 Self::ResourceNotActive => std::option::Option::Some(1),
17229 Self::ResourceBeingModified => std::option::Option::Some(2),
17230 Self::UnknownValue(u) => u.0.value(),
17231 }
17232 }
17233
17234 /// Gets the enum value as a string.
17235 ///
17236 /// Returns `None` if the enum contains an unknown value deserialized from
17237 /// the integer representation of enums.
17238 pub fn name(&self) -> std::option::Option<&str> {
17239 match self {
17240 Self::WarningUnspecified => std::option::Option::Some("WARNING_UNSPECIFIED"),
17241 Self::ResourceNotActive => std::option::Option::Some("RESOURCE_NOT_ACTIVE"),
17242 Self::ResourceBeingModified => {
17243 std::option::Option::Some("RESOURCE_BEING_MODIFIED")
17244 }
17245 Self::UnknownValue(u) => u.0.name(),
17246 }
17247 }
17248 }
17249
17250 impl std::default::Default for Code {
17251 fn default() -> Self {
17252 use std::convert::From;
17253 Self::from(0)
17254 }
17255 }
17256
17257 impl std::fmt::Display for Code {
17258 fn fmt(
17259 &self,
17260 f: &mut std::fmt::Formatter<'_>,
17261 ) -> std::result::Result<(), std::fmt::Error> {
17262 wkt::internal::display_enum(f, self.name(), self.value())
17263 }
17264 }
17265
17266 impl std::convert::From<i32> for Code {
17267 fn from(value: i32) -> Self {
17268 match value {
17269 0 => Self::WarningUnspecified,
17270 1 => Self::ResourceNotActive,
17271 2 => Self::ResourceBeingModified,
17272 _ => Self::UnknownValue(code::UnknownValue(
17273 wkt::internal::UnknownEnumValue::Integer(value),
17274 )),
17275 }
17276 }
17277 }
17278
17279 impl std::convert::From<&str> for Code {
17280 fn from(value: &str) -> Self {
17281 use std::string::ToString;
17282 match value {
17283 "WARNING_UNSPECIFIED" => Self::WarningUnspecified,
17284 "RESOURCE_NOT_ACTIVE" => Self::ResourceNotActive,
17285 "RESOURCE_BEING_MODIFIED" => Self::ResourceBeingModified,
17286 _ => Self::UnknownValue(code::UnknownValue(
17287 wkt::internal::UnknownEnumValue::String(value.to_string()),
17288 )),
17289 }
17290 }
17291 }
17292
17293 impl serde::ser::Serialize for Code {
17294 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17295 where
17296 S: serde::Serializer,
17297 {
17298 match self {
17299 Self::WarningUnspecified => serializer.serialize_i32(0),
17300 Self::ResourceNotActive => serializer.serialize_i32(1),
17301 Self::ResourceBeingModified => serializer.serialize_i32(2),
17302 Self::UnknownValue(u) => u.0.serialize(serializer),
17303 }
17304 }
17305 }
17306
17307 impl<'de> serde::de::Deserialize<'de> for Code {
17308 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17309 where
17310 D: serde::Deserializer<'de>,
17311 {
17312 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
17313 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code",
17314 ))
17315 }
17316 }
17317 }
17318
17319 /// The other routing cases.
17320 ///
17321 /// # Working with unknown values
17322 ///
17323 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17324 /// additional enum variants at any time. Adding new variants is not considered
17325 /// a breaking change. Applications should write their code in anticipation of:
17326 ///
17327 /// - New values appearing in future releases of the client library, **and**
17328 /// - New values received dynamically, without application changes.
17329 ///
17330 /// Please consult the [Working with enums] section in the user guide for some
17331 /// guidelines.
17332 ///
17333 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17334 #[derive(Clone, Debug, PartialEq)]
17335 #[non_exhaustive]
17336 pub enum OtherRoutes {
17337 /// Default value.
17338 Unspecified,
17339 /// Use the routes from the default routing tables (system-generated routes,
17340 /// custom routes, peering route) to determine the next hop. This effectively
17341 /// excludes matching packets being applied on other PBRs with a lower
17342 /// priority.
17343 DefaultRouting,
17344 /// If set, the enum was initialized with an unknown value.
17345 ///
17346 /// Applications can examine the value using [OtherRoutes::value] or
17347 /// [OtherRoutes::name].
17348 UnknownValue(other_routes::UnknownValue),
17349 }
17350
17351 #[doc(hidden)]
17352 pub mod other_routes {
17353 #[allow(unused_imports)]
17354 use super::*;
17355 #[derive(Clone, Debug, PartialEq)]
17356 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17357 }
17358
17359 impl OtherRoutes {
17360 /// Gets the enum value.
17361 ///
17362 /// Returns `None` if the enum contains an unknown value deserialized from
17363 /// the string representation of enums.
17364 pub fn value(&self) -> std::option::Option<i32> {
17365 match self {
17366 Self::Unspecified => std::option::Option::Some(0),
17367 Self::DefaultRouting => std::option::Option::Some(1),
17368 Self::UnknownValue(u) => u.0.value(),
17369 }
17370 }
17371
17372 /// Gets the enum value as a string.
17373 ///
17374 /// Returns `None` if the enum contains an unknown value deserialized from
17375 /// the integer representation of enums.
17376 pub fn name(&self) -> std::option::Option<&str> {
17377 match self {
17378 Self::Unspecified => std::option::Option::Some("OTHER_ROUTES_UNSPECIFIED"),
17379 Self::DefaultRouting => std::option::Option::Some("DEFAULT_ROUTING"),
17380 Self::UnknownValue(u) => u.0.name(),
17381 }
17382 }
17383 }
17384
17385 impl std::default::Default for OtherRoutes {
17386 fn default() -> Self {
17387 use std::convert::From;
17388 Self::from(0)
17389 }
17390 }
17391
17392 impl std::fmt::Display for OtherRoutes {
17393 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17394 wkt::internal::display_enum(f, self.name(), self.value())
17395 }
17396 }
17397
17398 impl std::convert::From<i32> for OtherRoutes {
17399 fn from(value: i32) -> Self {
17400 match value {
17401 0 => Self::Unspecified,
17402 1 => Self::DefaultRouting,
17403 _ => Self::UnknownValue(other_routes::UnknownValue(
17404 wkt::internal::UnknownEnumValue::Integer(value),
17405 )),
17406 }
17407 }
17408 }
17409
17410 impl std::convert::From<&str> for OtherRoutes {
17411 fn from(value: &str) -> Self {
17412 use std::string::ToString;
17413 match value {
17414 "OTHER_ROUTES_UNSPECIFIED" => Self::Unspecified,
17415 "DEFAULT_ROUTING" => Self::DefaultRouting,
17416 _ => Self::UnknownValue(other_routes::UnknownValue(
17417 wkt::internal::UnknownEnumValue::String(value.to_string()),
17418 )),
17419 }
17420 }
17421 }
17422
17423 impl serde::ser::Serialize for OtherRoutes {
17424 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17425 where
17426 S: serde::Serializer,
17427 {
17428 match self {
17429 Self::Unspecified => serializer.serialize_i32(0),
17430 Self::DefaultRouting => serializer.serialize_i32(1),
17431 Self::UnknownValue(u) => u.0.serialize(serializer),
17432 }
17433 }
17434 }
17435
17436 impl<'de> serde::de::Deserialize<'de> for OtherRoutes {
17437 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17438 where
17439 D: serde::Deserializer<'de>,
17440 {
17441 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OtherRoutes>::new(
17442 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes",
17443 ))
17444 }
17445 }
17446
17447 /// Target specifies network endpoints that this policy-based route applies to.
17448 /// If no target is specified, the PBR will be installed on all network
17449 /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
17450 #[derive(Clone, Debug, PartialEq)]
17451 #[non_exhaustive]
17452 pub enum Target {
17453 /// Optional. VM instances that this policy-based route applies to.
17454 VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
17455 /// Optional. The interconnect attachments that this policy-based route
17456 /// applies to.
17457 InterconnectAttachment(
17458 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
17459 ),
17460 }
17461
17462 #[derive(Clone, Debug, PartialEq)]
17463 #[non_exhaustive]
17464 pub enum NextHop {
17465 /// Optional. The IP address of a global-access-enabled L4 ILB that is the
17466 /// next hop for matching packets. For this version, only nextHopIlbIp is
17467 /// supported.
17468 NextHopIlbIp(std::string::String),
17469 /// Optional. Other routes that will be referenced to determine the next hop
17470 /// of the packet.
17471 NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
17472 }
17473}
17474
17475/// Request for
17476/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
17477/// method.
17478///
17479/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
17480#[derive(Clone, Default, PartialEq)]
17481#[non_exhaustive]
17482pub struct ListPolicyBasedRoutesRequest {
17483 /// Required. The parent resource's name.
17484 pub parent: std::string::String,
17485
17486 /// The maximum number of results per page that should be returned.
17487 pub page_size: i32,
17488
17489 /// The page token.
17490 pub page_token: std::string::String,
17491
17492 /// A filter expression that filters the results listed in the response.
17493 pub filter: std::string::String,
17494
17495 /// Sort the results by a certain order.
17496 pub order_by: std::string::String,
17497
17498 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17499}
17500
17501impl ListPolicyBasedRoutesRequest {
17502 pub fn new() -> Self {
17503 std::default::Default::default()
17504 }
17505
17506 /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
17507 ///
17508 /// # Example
17509 /// ```ignore,no_run
17510 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17511 /// let x = ListPolicyBasedRoutesRequest::new().set_parent("example");
17512 /// ```
17513 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17514 self.parent = v.into();
17515 self
17516 }
17517
17518 /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
17519 ///
17520 /// # Example
17521 /// ```ignore,no_run
17522 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17523 /// let x = ListPolicyBasedRoutesRequest::new().set_page_size(42);
17524 /// ```
17525 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17526 self.page_size = v.into();
17527 self
17528 }
17529
17530 /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
17531 ///
17532 /// # Example
17533 /// ```ignore,no_run
17534 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17535 /// let x = ListPolicyBasedRoutesRequest::new().set_page_token("example");
17536 /// ```
17537 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17538 self.page_token = v.into();
17539 self
17540 }
17541
17542 /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
17543 ///
17544 /// # Example
17545 /// ```ignore,no_run
17546 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17547 /// let x = ListPolicyBasedRoutesRequest::new().set_filter("example");
17548 /// ```
17549 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17550 self.filter = v.into();
17551 self
17552 }
17553
17554 /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
17555 ///
17556 /// # Example
17557 /// ```ignore,no_run
17558 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17559 /// let x = ListPolicyBasedRoutesRequest::new().set_order_by("example");
17560 /// ```
17561 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17562 self.order_by = v.into();
17563 self
17564 }
17565}
17566
17567impl wkt::message::Message for ListPolicyBasedRoutesRequest {
17568 fn typename() -> &'static str {
17569 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
17570 }
17571}
17572
17573/// Response for
17574/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
17575/// method.
17576///
17577/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
17578#[derive(Clone, Default, PartialEq)]
17579#[non_exhaustive]
17580pub struct ListPolicyBasedRoutesResponse {
17581 /// Policy-based routes to be returned.
17582 pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,
17583
17584 /// The next pagination token in the List response. It should be used as
17585 /// page_token for the following request. An empty value means no more result.
17586 pub next_page_token: std::string::String,
17587
17588 /// Locations that could not be reached.
17589 pub unreachable: std::vec::Vec<std::string::String>,
17590
17591 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17592}
17593
17594impl ListPolicyBasedRoutesResponse {
17595 pub fn new() -> Self {
17596 std::default::Default::default()
17597 }
17598
17599 /// Sets the value of [policy_based_routes][crate::model::ListPolicyBasedRoutesResponse::policy_based_routes].
17600 ///
17601 /// # Example
17602 /// ```ignore,no_run
17603 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17604 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17605 /// let x = ListPolicyBasedRoutesResponse::new()
17606 /// .set_policy_based_routes([
17607 /// PolicyBasedRoute::default()/* use setters */,
17608 /// PolicyBasedRoute::default()/* use (different) setters */,
17609 /// ]);
17610 /// ```
17611 pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
17612 where
17613 T: std::iter::IntoIterator<Item = V>,
17614 V: std::convert::Into<crate::model::PolicyBasedRoute>,
17615 {
17616 use std::iter::Iterator;
17617 self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
17618 self
17619 }
17620
17621 /// Sets the value of [next_page_token][crate::model::ListPolicyBasedRoutesResponse::next_page_token].
17622 ///
17623 /// # Example
17624 /// ```ignore,no_run
17625 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17626 /// let x = ListPolicyBasedRoutesResponse::new().set_next_page_token("example");
17627 /// ```
17628 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17629 self.next_page_token = v.into();
17630 self
17631 }
17632
17633 /// Sets the value of [unreachable][crate::model::ListPolicyBasedRoutesResponse::unreachable].
17634 ///
17635 /// # Example
17636 /// ```ignore,no_run
17637 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17638 /// let x = ListPolicyBasedRoutesResponse::new().set_unreachable(["a", "b", "c"]);
17639 /// ```
17640 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17641 where
17642 T: std::iter::IntoIterator<Item = V>,
17643 V: std::convert::Into<std::string::String>,
17644 {
17645 use std::iter::Iterator;
17646 self.unreachable = v.into_iter().map(|i| i.into()).collect();
17647 self
17648 }
17649}
17650
17651impl wkt::message::Message for ListPolicyBasedRoutesResponse {
17652 fn typename() -> &'static str {
17653 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
17654 }
17655}
17656
17657#[doc(hidden)]
17658impl gax::paginator::internal::PageableResponse for ListPolicyBasedRoutesResponse {
17659 type PageItem = crate::model::PolicyBasedRoute;
17660
17661 fn items(self) -> std::vec::Vec<Self::PageItem> {
17662 self.policy_based_routes
17663 }
17664
17665 fn next_page_token(&self) -> std::string::String {
17666 use std::clone::Clone;
17667 self.next_page_token.clone()
17668 }
17669}
17670
17671/// Request for
17672/// [PolicyBasedRoutingService.GetPolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]
17673/// method.
17674///
17675/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]: crate::client::PolicyBasedRoutingService::get_policy_based_route
17676#[derive(Clone, Default, PartialEq)]
17677#[non_exhaustive]
17678pub struct GetPolicyBasedRouteRequest {
17679 /// Required. Name of the PolicyBasedRoute resource to get.
17680 pub name: std::string::String,
17681
17682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17683}
17684
17685impl GetPolicyBasedRouteRequest {
17686 pub fn new() -> Self {
17687 std::default::Default::default()
17688 }
17689
17690 /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
17691 ///
17692 /// # Example
17693 /// ```ignore,no_run
17694 /// # use google_cloud_networkconnectivity_v1::model::GetPolicyBasedRouteRequest;
17695 /// let x = GetPolicyBasedRouteRequest::new().set_name("example");
17696 /// ```
17697 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17698 self.name = v.into();
17699 self
17700 }
17701}
17702
17703impl wkt::message::Message for GetPolicyBasedRouteRequest {
17704 fn typename() -> &'static str {
17705 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
17706 }
17707}
17708
17709/// Request for
17710/// [PolicyBasedRoutingService.CreatePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]
17711/// method.
17712///
17713/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::create_policy_based_route
17714#[derive(Clone, Default, PartialEq)]
17715#[non_exhaustive]
17716pub struct CreatePolicyBasedRouteRequest {
17717 /// Required. The parent resource's name of the PolicyBasedRoute.
17718 pub parent: std::string::String,
17719
17720 /// Required. Unique id for the policy-based route to create. Provided by the
17721 /// client when the resource is created. The name must comply with
17722 /// <https://google.aip.dev/122#resource-id-segments>. Specifically, the name
17723 /// must be 1-63 characters long and match the regular expression
17724 /// [a-z]([a-z0-9-]*[a-z0-9])?. The first character must be a lowercase letter,
17725 /// and all following characters (except for the last character) must be a
17726 /// dash, lowercase letter, or digit. The last character must be a lowercase
17727 /// letter or digit.
17728 pub policy_based_route_id: std::string::String,
17729
17730 /// Required. Initial values for a new policy-based route.
17731 pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,
17732
17733 /// Optional. An optional request ID to identify requests. Specify a unique
17734 /// request ID so that if you must retry your request, the server knows to
17735 /// ignore the request if it has already been completed. The server guarantees
17736 /// that for at least 60 minutes since the first request.
17737 ///
17738 /// For example, consider a situation where you make an initial request and
17739 /// the request times out. If you make the request again with the same request
17740 /// ID, the server can check if original operation with the same request ID
17741 /// was received, and if so, ignores the second request. This prevents clients
17742 /// from accidentally creating duplicate commitments.
17743 ///
17744 /// The request ID must be a valid UUID with the exception that zero UUID is
17745 /// not supported (00000000-0000-0000-0000-000000000000).
17746 pub request_id: std::string::String,
17747
17748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17749}
17750
17751impl CreatePolicyBasedRouteRequest {
17752 pub fn new() -> Self {
17753 std::default::Default::default()
17754 }
17755
17756 /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
17757 ///
17758 /// # Example
17759 /// ```ignore,no_run
17760 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17761 /// let x = CreatePolicyBasedRouteRequest::new().set_parent("example");
17762 /// ```
17763 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17764 self.parent = v.into();
17765 self
17766 }
17767
17768 /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
17769 ///
17770 /// # Example
17771 /// ```ignore,no_run
17772 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17773 /// let x = CreatePolicyBasedRouteRequest::new().set_policy_based_route_id("example");
17774 /// ```
17775 pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
17776 mut self,
17777 v: T,
17778 ) -> Self {
17779 self.policy_based_route_id = v.into();
17780 self
17781 }
17782
17783 /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
17784 ///
17785 /// # Example
17786 /// ```ignore,no_run
17787 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17788 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17789 /// let x = CreatePolicyBasedRouteRequest::new().set_policy_based_route(PolicyBasedRoute::default()/* use setters */);
17790 /// ```
17791 pub fn set_policy_based_route<T>(mut self, v: T) -> Self
17792 where
17793 T: std::convert::Into<crate::model::PolicyBasedRoute>,
17794 {
17795 self.policy_based_route = std::option::Option::Some(v.into());
17796 self
17797 }
17798
17799 /// Sets or clears the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
17800 ///
17801 /// # Example
17802 /// ```ignore,no_run
17803 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17804 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17805 /// let x = CreatePolicyBasedRouteRequest::new().set_or_clear_policy_based_route(Some(PolicyBasedRoute::default()/* use setters */));
17806 /// let x = CreatePolicyBasedRouteRequest::new().set_or_clear_policy_based_route(None::<PolicyBasedRoute>);
17807 /// ```
17808 pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
17809 where
17810 T: std::convert::Into<crate::model::PolicyBasedRoute>,
17811 {
17812 self.policy_based_route = v.map(|x| x.into());
17813 self
17814 }
17815
17816 /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
17817 ///
17818 /// # Example
17819 /// ```ignore,no_run
17820 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17821 /// let x = CreatePolicyBasedRouteRequest::new().set_request_id("example");
17822 /// ```
17823 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17824 self.request_id = v.into();
17825 self
17826 }
17827}
17828
17829impl wkt::message::Message for CreatePolicyBasedRouteRequest {
17830 fn typename() -> &'static str {
17831 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
17832 }
17833}
17834
17835/// Request for
17836/// [PolicyBasedRoutingService.DeletePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]
17837/// method.
17838///
17839/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::delete_policy_based_route
17840#[derive(Clone, Default, PartialEq)]
17841#[non_exhaustive]
17842pub struct DeletePolicyBasedRouteRequest {
17843 /// Required. Name of the policy-based route resource to delete.
17844 pub name: std::string::String,
17845
17846 /// Optional. An optional request ID to identify requests. Specify a unique
17847 /// request ID so that if you must retry your request, the server knows to
17848 /// ignore the request if it has already been completed. The server guarantees
17849 /// that for at least 60 minutes after the first request.
17850 ///
17851 /// For example, consider a situation where you make an initial request and
17852 /// the request times out. If you make the request again with the same request
17853 /// ID, the server can check if original operation with the same request ID
17854 /// was received, and if so, ignores the second request. This prevents clients
17855 /// from accidentally creating duplicate commitments.
17856 ///
17857 /// The request ID must be a valid UUID with the exception that zero UUID is
17858 /// not supported (00000000-0000-0000-0000-000000000000).
17859 pub request_id: std::string::String,
17860
17861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17862}
17863
17864impl DeletePolicyBasedRouteRequest {
17865 pub fn new() -> Self {
17866 std::default::Default::default()
17867 }
17868
17869 /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
17870 ///
17871 /// # Example
17872 /// ```ignore,no_run
17873 /// # use google_cloud_networkconnectivity_v1::model::DeletePolicyBasedRouteRequest;
17874 /// let x = DeletePolicyBasedRouteRequest::new().set_name("example");
17875 /// ```
17876 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17877 self.name = v.into();
17878 self
17879 }
17880
17881 /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
17882 ///
17883 /// # Example
17884 /// ```ignore,no_run
17885 /// # use google_cloud_networkconnectivity_v1::model::DeletePolicyBasedRouteRequest;
17886 /// let x = DeletePolicyBasedRouteRequest::new().set_request_id("example");
17887 /// ```
17888 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17889 self.request_id = v.into();
17890 self
17891 }
17892}
17893
17894impl wkt::message::Message for DeletePolicyBasedRouteRequest {
17895 fn typename() -> &'static str {
17896 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
17897 }
17898}
17899
17900/// The infrastructure used for connections between consumers/producers.
17901///
17902/// # Working with unknown values
17903///
17904/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17905/// additional enum variants at any time. Adding new variants is not considered
17906/// a breaking change. Applications should write their code in anticipation of:
17907///
17908/// - New values appearing in future releases of the client library, **and**
17909/// - New values received dynamically, without application changes.
17910///
17911/// Please consult the [Working with enums] section in the user guide for some
17912/// guidelines.
17913///
17914/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17915#[derive(Clone, Debug, PartialEq)]
17916#[non_exhaustive]
17917pub enum Infrastructure {
17918 /// An invalid infrastructure as the default case.
17919 Unspecified,
17920 /// Private Service Connect is used for connections.
17921 Psc,
17922 /// If set, the enum was initialized with an unknown value.
17923 ///
17924 /// Applications can examine the value using [Infrastructure::value] or
17925 /// [Infrastructure::name].
17926 UnknownValue(infrastructure::UnknownValue),
17927}
17928
17929#[doc(hidden)]
17930pub mod infrastructure {
17931 #[allow(unused_imports)]
17932 use super::*;
17933 #[derive(Clone, Debug, PartialEq)]
17934 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17935}
17936
17937impl Infrastructure {
17938 /// Gets the enum value.
17939 ///
17940 /// Returns `None` if the enum contains an unknown value deserialized from
17941 /// the string representation of enums.
17942 pub fn value(&self) -> std::option::Option<i32> {
17943 match self {
17944 Self::Unspecified => std::option::Option::Some(0),
17945 Self::Psc => std::option::Option::Some(1),
17946 Self::UnknownValue(u) => u.0.value(),
17947 }
17948 }
17949
17950 /// Gets the enum value as a string.
17951 ///
17952 /// Returns `None` if the enum contains an unknown value deserialized from
17953 /// the integer representation of enums.
17954 pub fn name(&self) -> std::option::Option<&str> {
17955 match self {
17956 Self::Unspecified => std::option::Option::Some("INFRASTRUCTURE_UNSPECIFIED"),
17957 Self::Psc => std::option::Option::Some("PSC"),
17958 Self::UnknownValue(u) => u.0.name(),
17959 }
17960 }
17961}
17962
17963impl std::default::Default for Infrastructure {
17964 fn default() -> Self {
17965 use std::convert::From;
17966 Self::from(0)
17967 }
17968}
17969
17970impl std::fmt::Display for Infrastructure {
17971 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17972 wkt::internal::display_enum(f, self.name(), self.value())
17973 }
17974}
17975
17976impl std::convert::From<i32> for Infrastructure {
17977 fn from(value: i32) -> Self {
17978 match value {
17979 0 => Self::Unspecified,
17980 1 => Self::Psc,
17981 _ => Self::UnknownValue(infrastructure::UnknownValue(
17982 wkt::internal::UnknownEnumValue::Integer(value),
17983 )),
17984 }
17985 }
17986}
17987
17988impl std::convert::From<&str> for Infrastructure {
17989 fn from(value: &str) -> Self {
17990 use std::string::ToString;
17991 match value {
17992 "INFRASTRUCTURE_UNSPECIFIED" => Self::Unspecified,
17993 "PSC" => Self::Psc,
17994 _ => Self::UnknownValue(infrastructure::UnknownValue(
17995 wkt::internal::UnknownEnumValue::String(value.to_string()),
17996 )),
17997 }
17998 }
17999}
18000
18001impl serde::ser::Serialize for Infrastructure {
18002 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18003 where
18004 S: serde::Serializer,
18005 {
18006 match self {
18007 Self::Unspecified => serializer.serialize_i32(0),
18008 Self::Psc => serializer.serialize_i32(1),
18009 Self::UnknownValue(u) => u.0.serialize(serializer),
18010 }
18011 }
18012}
18013
18014impl<'de> serde::de::Deserialize<'de> for Infrastructure {
18015 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18016 where
18017 D: serde::Deserializer<'de>,
18018 {
18019 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Infrastructure>::new(
18020 ".google.cloud.networkconnectivity.v1.Infrastructure",
18021 ))
18022 }
18023}
18024
18025/// The error type indicates whether a connection error is consumer facing,
18026/// producer facing or system internal.
18027///
18028/// # Working with unknown values
18029///
18030/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18031/// additional enum variants at any time. Adding new variants is not considered
18032/// a breaking change. Applications should write their code in anticipation of:
18033///
18034/// - New values appearing in future releases of the client library, **and**
18035/// - New values received dynamically, without application changes.
18036///
18037/// Please consult the [Working with enums] section in the user guide for some
18038/// guidelines.
18039///
18040/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18041#[derive(Clone, Debug, PartialEq)]
18042#[non_exhaustive]
18043pub enum ConnectionErrorType {
18044 /// An invalid error type as the default case.
18045 Unspecified,
18046 /// The error is due to Service Automation system internal.
18047 ErrorInternal,
18048 /// The error is due to the setup on consumer side.
18049 ErrorConsumerSide,
18050 /// The error is due to the setup on producer side.
18051 ErrorProducerSide,
18052 /// If set, the enum was initialized with an unknown value.
18053 ///
18054 /// Applications can examine the value using [ConnectionErrorType::value] or
18055 /// [ConnectionErrorType::name].
18056 UnknownValue(connection_error_type::UnknownValue),
18057}
18058
18059#[doc(hidden)]
18060pub mod connection_error_type {
18061 #[allow(unused_imports)]
18062 use super::*;
18063 #[derive(Clone, Debug, PartialEq)]
18064 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18065}
18066
18067impl ConnectionErrorType {
18068 /// Gets the enum value.
18069 ///
18070 /// Returns `None` if the enum contains an unknown value deserialized from
18071 /// the string representation of enums.
18072 pub fn value(&self) -> std::option::Option<i32> {
18073 match self {
18074 Self::Unspecified => std::option::Option::Some(0),
18075 Self::ErrorInternal => std::option::Option::Some(1),
18076 Self::ErrorConsumerSide => std::option::Option::Some(2),
18077 Self::ErrorProducerSide => std::option::Option::Some(3),
18078 Self::UnknownValue(u) => u.0.value(),
18079 }
18080 }
18081
18082 /// Gets the enum value as a string.
18083 ///
18084 /// Returns `None` if the enum contains an unknown value deserialized from
18085 /// the integer representation of enums.
18086 pub fn name(&self) -> std::option::Option<&str> {
18087 match self {
18088 Self::Unspecified => std::option::Option::Some("CONNECTION_ERROR_TYPE_UNSPECIFIED"),
18089 Self::ErrorInternal => std::option::Option::Some("ERROR_INTERNAL"),
18090 Self::ErrorConsumerSide => std::option::Option::Some("ERROR_CONSUMER_SIDE"),
18091 Self::ErrorProducerSide => std::option::Option::Some("ERROR_PRODUCER_SIDE"),
18092 Self::UnknownValue(u) => u.0.name(),
18093 }
18094 }
18095}
18096
18097impl std::default::Default for ConnectionErrorType {
18098 fn default() -> Self {
18099 use std::convert::From;
18100 Self::from(0)
18101 }
18102}
18103
18104impl std::fmt::Display for ConnectionErrorType {
18105 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18106 wkt::internal::display_enum(f, self.name(), self.value())
18107 }
18108}
18109
18110impl std::convert::From<i32> for ConnectionErrorType {
18111 fn from(value: i32) -> Self {
18112 match value {
18113 0 => Self::Unspecified,
18114 1 => Self::ErrorInternal,
18115 2 => Self::ErrorConsumerSide,
18116 3 => Self::ErrorProducerSide,
18117 _ => Self::UnknownValue(connection_error_type::UnknownValue(
18118 wkt::internal::UnknownEnumValue::Integer(value),
18119 )),
18120 }
18121 }
18122}
18123
18124impl std::convert::From<&str> for ConnectionErrorType {
18125 fn from(value: &str) -> Self {
18126 use std::string::ToString;
18127 match value {
18128 "CONNECTION_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
18129 "ERROR_INTERNAL" => Self::ErrorInternal,
18130 "ERROR_CONSUMER_SIDE" => Self::ErrorConsumerSide,
18131 "ERROR_PRODUCER_SIDE" => Self::ErrorProducerSide,
18132 _ => Self::UnknownValue(connection_error_type::UnknownValue(
18133 wkt::internal::UnknownEnumValue::String(value.to_string()),
18134 )),
18135 }
18136 }
18137}
18138
18139impl serde::ser::Serialize for ConnectionErrorType {
18140 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18141 where
18142 S: serde::Serializer,
18143 {
18144 match self {
18145 Self::Unspecified => serializer.serialize_i32(0),
18146 Self::ErrorInternal => serializer.serialize_i32(1),
18147 Self::ErrorConsumerSide => serializer.serialize_i32(2),
18148 Self::ErrorProducerSide => serializer.serialize_i32(3),
18149 Self::UnknownValue(u) => u.0.serialize(serializer),
18150 }
18151 }
18152}
18153
18154impl<'de> serde::de::Deserialize<'de> for ConnectionErrorType {
18155 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18156 where
18157 D: serde::Deserializer<'de>,
18158 {
18159 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionErrorType>::new(
18160 ".google.cloud.networkconnectivity.v1.ConnectionErrorType",
18161 ))
18162 }
18163}
18164
18165/// The requested IP version for the PSC connection.
18166///
18167/// # Working with unknown values
18168///
18169/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18170/// additional enum variants at any time. Adding new variants is not considered
18171/// a breaking change. Applications should write their code in anticipation of:
18172///
18173/// - New values appearing in future releases of the client library, **and**
18174/// - New values received dynamically, without application changes.
18175///
18176/// Please consult the [Working with enums] section in the user guide for some
18177/// guidelines.
18178///
18179/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18180#[derive(Clone, Debug, PartialEq)]
18181#[non_exhaustive]
18182pub enum IPVersion {
18183 /// Default value. We will use IPv4 or IPv6 depending on the IP version of
18184 /// first available subnetwork.
18185 Unspecified,
18186 /// Will use IPv4 only.
18187 Ipv4,
18188 /// Will use IPv6 only.
18189 Ipv6,
18190 /// If set, the enum was initialized with an unknown value.
18191 ///
18192 /// Applications can examine the value using [IPVersion::value] or
18193 /// [IPVersion::name].
18194 UnknownValue(ip_version::UnknownValue),
18195}
18196
18197#[doc(hidden)]
18198pub mod ip_version {
18199 #[allow(unused_imports)]
18200 use super::*;
18201 #[derive(Clone, Debug, PartialEq)]
18202 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18203}
18204
18205impl IPVersion {
18206 /// Gets the enum value.
18207 ///
18208 /// Returns `None` if the enum contains an unknown value deserialized from
18209 /// the string representation of enums.
18210 pub fn value(&self) -> std::option::Option<i32> {
18211 match self {
18212 Self::Unspecified => std::option::Option::Some(0),
18213 Self::Ipv4 => std::option::Option::Some(1),
18214 Self::Ipv6 => std::option::Option::Some(2),
18215 Self::UnknownValue(u) => u.0.value(),
18216 }
18217 }
18218
18219 /// Gets the enum value as a string.
18220 ///
18221 /// Returns `None` if the enum contains an unknown value deserialized from
18222 /// the integer representation of enums.
18223 pub fn name(&self) -> std::option::Option<&str> {
18224 match self {
18225 Self::Unspecified => std::option::Option::Some("IP_VERSION_UNSPECIFIED"),
18226 Self::Ipv4 => std::option::Option::Some("IPV4"),
18227 Self::Ipv6 => std::option::Option::Some("IPV6"),
18228 Self::UnknownValue(u) => u.0.name(),
18229 }
18230 }
18231}
18232
18233impl std::default::Default for IPVersion {
18234 fn default() -> Self {
18235 use std::convert::From;
18236 Self::from(0)
18237 }
18238}
18239
18240impl std::fmt::Display for IPVersion {
18241 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18242 wkt::internal::display_enum(f, self.name(), self.value())
18243 }
18244}
18245
18246impl std::convert::From<i32> for IPVersion {
18247 fn from(value: i32) -> Self {
18248 match value {
18249 0 => Self::Unspecified,
18250 1 => Self::Ipv4,
18251 2 => Self::Ipv6,
18252 _ => Self::UnknownValue(ip_version::UnknownValue(
18253 wkt::internal::UnknownEnumValue::Integer(value),
18254 )),
18255 }
18256 }
18257}
18258
18259impl std::convert::From<&str> for IPVersion {
18260 fn from(value: &str) -> Self {
18261 use std::string::ToString;
18262 match value {
18263 "IP_VERSION_UNSPECIFIED" => Self::Unspecified,
18264 "IPV4" => Self::Ipv4,
18265 "IPV6" => Self::Ipv6,
18266 _ => Self::UnknownValue(ip_version::UnknownValue(
18267 wkt::internal::UnknownEnumValue::String(value.to_string()),
18268 )),
18269 }
18270 }
18271}
18272
18273impl serde::ser::Serialize for IPVersion {
18274 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18275 where
18276 S: serde::Serializer,
18277 {
18278 match self {
18279 Self::Unspecified => serializer.serialize_i32(0),
18280 Self::Ipv4 => serializer.serialize_i32(1),
18281 Self::Ipv6 => serializer.serialize_i32(2),
18282 Self::UnknownValue(u) => u.0.serialize(serializer),
18283 }
18284 }
18285}
18286
18287impl<'de> serde::de::Deserialize<'de> for IPVersion {
18288 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18289 where
18290 D: serde::Deserializer<'de>,
18291 {
18292 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IPVersion>::new(
18293 ".google.cloud.networkconnectivity.v1.IPVersion",
18294 ))
18295 }
18296}
18297
18298/// Supported features for a location
18299///
18300/// # Working with unknown values
18301///
18302/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18303/// additional enum variants at any time. Adding new variants is not considered
18304/// a breaking change. Applications should write their code in anticipation of:
18305///
18306/// - New values appearing in future releases of the client library, **and**
18307/// - New values received dynamically, without application changes.
18308///
18309/// Please consult the [Working with enums] section in the user guide for some
18310/// guidelines.
18311///
18312/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18313#[derive(Clone, Debug, PartialEq)]
18314#[non_exhaustive]
18315pub enum LocationFeature {
18316 /// No publicly supported feature in this location
18317 Unspecified,
18318 /// Site-to-cloud spokes are supported in this location
18319 SiteToCloudSpokes,
18320 /// Site-to-site spokes are supported in this location
18321 SiteToSiteSpokes,
18322 /// If set, the enum was initialized with an unknown value.
18323 ///
18324 /// Applications can examine the value using [LocationFeature::value] or
18325 /// [LocationFeature::name].
18326 UnknownValue(location_feature::UnknownValue),
18327}
18328
18329#[doc(hidden)]
18330pub mod location_feature {
18331 #[allow(unused_imports)]
18332 use super::*;
18333 #[derive(Clone, Debug, PartialEq)]
18334 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18335}
18336
18337impl LocationFeature {
18338 /// Gets the enum value.
18339 ///
18340 /// Returns `None` if the enum contains an unknown value deserialized from
18341 /// the string representation of enums.
18342 pub fn value(&self) -> std::option::Option<i32> {
18343 match self {
18344 Self::Unspecified => std::option::Option::Some(0),
18345 Self::SiteToCloudSpokes => std::option::Option::Some(1),
18346 Self::SiteToSiteSpokes => std::option::Option::Some(2),
18347 Self::UnknownValue(u) => u.0.value(),
18348 }
18349 }
18350
18351 /// Gets the enum value as a string.
18352 ///
18353 /// Returns `None` if the enum contains an unknown value deserialized from
18354 /// the integer representation of enums.
18355 pub fn name(&self) -> std::option::Option<&str> {
18356 match self {
18357 Self::Unspecified => std::option::Option::Some("LOCATION_FEATURE_UNSPECIFIED"),
18358 Self::SiteToCloudSpokes => std::option::Option::Some("SITE_TO_CLOUD_SPOKES"),
18359 Self::SiteToSiteSpokes => std::option::Option::Some("SITE_TO_SITE_SPOKES"),
18360 Self::UnknownValue(u) => u.0.name(),
18361 }
18362 }
18363}
18364
18365impl std::default::Default for LocationFeature {
18366 fn default() -> Self {
18367 use std::convert::From;
18368 Self::from(0)
18369 }
18370}
18371
18372impl std::fmt::Display for LocationFeature {
18373 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18374 wkt::internal::display_enum(f, self.name(), self.value())
18375 }
18376}
18377
18378impl std::convert::From<i32> for LocationFeature {
18379 fn from(value: i32) -> Self {
18380 match value {
18381 0 => Self::Unspecified,
18382 1 => Self::SiteToCloudSpokes,
18383 2 => Self::SiteToSiteSpokes,
18384 _ => Self::UnknownValue(location_feature::UnknownValue(
18385 wkt::internal::UnknownEnumValue::Integer(value),
18386 )),
18387 }
18388 }
18389}
18390
18391impl std::convert::From<&str> for LocationFeature {
18392 fn from(value: &str) -> Self {
18393 use std::string::ToString;
18394 match value {
18395 "LOCATION_FEATURE_UNSPECIFIED" => Self::Unspecified,
18396 "SITE_TO_CLOUD_SPOKES" => Self::SiteToCloudSpokes,
18397 "SITE_TO_SITE_SPOKES" => Self::SiteToSiteSpokes,
18398 _ => Self::UnknownValue(location_feature::UnknownValue(
18399 wkt::internal::UnknownEnumValue::String(value.to_string()),
18400 )),
18401 }
18402 }
18403}
18404
18405impl serde::ser::Serialize for LocationFeature {
18406 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18407 where
18408 S: serde::Serializer,
18409 {
18410 match self {
18411 Self::Unspecified => serializer.serialize_i32(0),
18412 Self::SiteToCloudSpokes => serializer.serialize_i32(1),
18413 Self::SiteToSiteSpokes => serializer.serialize_i32(2),
18414 Self::UnknownValue(u) => u.0.serialize(serializer),
18415 }
18416 }
18417}
18418
18419impl<'de> serde::de::Deserialize<'de> for LocationFeature {
18420 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18421 where
18422 D: serde::Deserializer<'de>,
18423 {
18424 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationFeature>::new(
18425 ".google.cloud.networkconnectivity.v1.LocationFeature",
18426 ))
18427 }
18428}
18429
18430/// The route's type
18431///
18432/// # Working with unknown values
18433///
18434/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18435/// additional enum variants at any time. Adding new variants is not considered
18436/// a breaking change. Applications should write their code in anticipation of:
18437///
18438/// - New values appearing in future releases of the client library, **and**
18439/// - New values received dynamically, without application changes.
18440///
18441/// Please consult the [Working with enums] section in the user guide for some
18442/// guidelines.
18443///
18444/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18445#[derive(Clone, Debug, PartialEq)]
18446#[non_exhaustive]
18447pub enum RouteType {
18448 /// No route type information specified
18449 Unspecified,
18450 /// The route leads to a destination within the primary address range of the
18451 /// VPC network's subnet.
18452 VpcPrimarySubnet,
18453 /// The route leads to a destination within the secondary address range of the
18454 /// VPC network's subnet.
18455 VpcSecondarySubnet,
18456 /// The route leads to a destination in a dynamic route. Dynamic routes are
18457 /// derived from Border Gateway Protocol (BGP) advertisements received from an
18458 /// NCC hybrid spoke.
18459 DynamicRoute,
18460 /// If set, the enum was initialized with an unknown value.
18461 ///
18462 /// Applications can examine the value using [RouteType::value] or
18463 /// [RouteType::name].
18464 UnknownValue(route_type::UnknownValue),
18465}
18466
18467#[doc(hidden)]
18468pub mod route_type {
18469 #[allow(unused_imports)]
18470 use super::*;
18471 #[derive(Clone, Debug, PartialEq)]
18472 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18473}
18474
18475impl RouteType {
18476 /// Gets the enum value.
18477 ///
18478 /// Returns `None` if the enum contains an unknown value deserialized from
18479 /// the string representation of enums.
18480 pub fn value(&self) -> std::option::Option<i32> {
18481 match self {
18482 Self::Unspecified => std::option::Option::Some(0),
18483 Self::VpcPrimarySubnet => std::option::Option::Some(1),
18484 Self::VpcSecondarySubnet => std::option::Option::Some(2),
18485 Self::DynamicRoute => std::option::Option::Some(3),
18486 Self::UnknownValue(u) => u.0.value(),
18487 }
18488 }
18489
18490 /// Gets the enum value as a string.
18491 ///
18492 /// Returns `None` if the enum contains an unknown value deserialized from
18493 /// the integer representation of enums.
18494 pub fn name(&self) -> std::option::Option<&str> {
18495 match self {
18496 Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
18497 Self::VpcPrimarySubnet => std::option::Option::Some("VPC_PRIMARY_SUBNET"),
18498 Self::VpcSecondarySubnet => std::option::Option::Some("VPC_SECONDARY_SUBNET"),
18499 Self::DynamicRoute => std::option::Option::Some("DYNAMIC_ROUTE"),
18500 Self::UnknownValue(u) => u.0.name(),
18501 }
18502 }
18503}
18504
18505impl std::default::Default for RouteType {
18506 fn default() -> Self {
18507 use std::convert::From;
18508 Self::from(0)
18509 }
18510}
18511
18512impl std::fmt::Display for RouteType {
18513 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18514 wkt::internal::display_enum(f, self.name(), self.value())
18515 }
18516}
18517
18518impl std::convert::From<i32> for RouteType {
18519 fn from(value: i32) -> Self {
18520 match value {
18521 0 => Self::Unspecified,
18522 1 => Self::VpcPrimarySubnet,
18523 2 => Self::VpcSecondarySubnet,
18524 3 => Self::DynamicRoute,
18525 _ => Self::UnknownValue(route_type::UnknownValue(
18526 wkt::internal::UnknownEnumValue::Integer(value),
18527 )),
18528 }
18529 }
18530}
18531
18532impl std::convert::From<&str> for RouteType {
18533 fn from(value: &str) -> Self {
18534 use std::string::ToString;
18535 match value {
18536 "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
18537 "VPC_PRIMARY_SUBNET" => Self::VpcPrimarySubnet,
18538 "VPC_SECONDARY_SUBNET" => Self::VpcSecondarySubnet,
18539 "DYNAMIC_ROUTE" => Self::DynamicRoute,
18540 _ => Self::UnknownValue(route_type::UnknownValue(
18541 wkt::internal::UnknownEnumValue::String(value.to_string()),
18542 )),
18543 }
18544 }
18545}
18546
18547impl serde::ser::Serialize for RouteType {
18548 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18549 where
18550 S: serde::Serializer,
18551 {
18552 match self {
18553 Self::Unspecified => serializer.serialize_i32(0),
18554 Self::VpcPrimarySubnet => serializer.serialize_i32(1),
18555 Self::VpcSecondarySubnet => serializer.serialize_i32(2),
18556 Self::DynamicRoute => serializer.serialize_i32(3),
18557 Self::UnknownValue(u) => u.0.serialize(serializer),
18558 }
18559 }
18560}
18561
18562impl<'de> serde::de::Deserialize<'de> for RouteType {
18563 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18564 where
18565 D: serde::Deserializer<'de>,
18566 {
18567 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
18568 ".google.cloud.networkconnectivity.v1.RouteType",
18569 ))
18570 }
18571}
18572
18573/// The State enum represents the lifecycle stage of a Network Connectivity
18574/// Center resource.
18575///
18576/// # Working with unknown values
18577///
18578/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18579/// additional enum variants at any time. Adding new variants is not considered
18580/// a breaking change. Applications should write their code in anticipation of:
18581///
18582/// - New values appearing in future releases of the client library, **and**
18583/// - New values received dynamically, without application changes.
18584///
18585/// Please consult the [Working with enums] section in the user guide for some
18586/// guidelines.
18587///
18588/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18589#[derive(Clone, Debug, PartialEq)]
18590#[non_exhaustive]
18591pub enum State {
18592 /// No state information available
18593 Unspecified,
18594 /// The resource's create operation is in progress.
18595 Creating,
18596 /// The resource is active
18597 Active,
18598 /// The resource's delete operation is in progress.
18599 Deleting,
18600 /// The resource's accept operation is in progress.
18601 Accepting,
18602 /// The resource's reject operation is in progress.
18603 Rejecting,
18604 /// The resource's update operation is in progress.
18605 Updating,
18606 /// The resource is inactive.
18607 Inactive,
18608 /// The hub associated with this spoke resource has been deleted.
18609 /// This state applies to spoke resources only.
18610 Obsolete,
18611 /// The resource is in an undefined state due to resource creation or deletion
18612 /// failure. You can try to delete the resource later or contact support for
18613 /// help.
18614 Failed,
18615 /// If set, the enum was initialized with an unknown value.
18616 ///
18617 /// Applications can examine the value using [State::value] or
18618 /// [State::name].
18619 UnknownValue(state::UnknownValue),
18620}
18621
18622#[doc(hidden)]
18623pub mod state {
18624 #[allow(unused_imports)]
18625 use super::*;
18626 #[derive(Clone, Debug, PartialEq)]
18627 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18628}
18629
18630impl State {
18631 /// Gets the enum value.
18632 ///
18633 /// Returns `None` if the enum contains an unknown value deserialized from
18634 /// the string representation of enums.
18635 pub fn value(&self) -> std::option::Option<i32> {
18636 match self {
18637 Self::Unspecified => std::option::Option::Some(0),
18638 Self::Creating => std::option::Option::Some(1),
18639 Self::Active => std::option::Option::Some(2),
18640 Self::Deleting => std::option::Option::Some(3),
18641 Self::Accepting => std::option::Option::Some(8),
18642 Self::Rejecting => std::option::Option::Some(9),
18643 Self::Updating => std::option::Option::Some(6),
18644 Self::Inactive => std::option::Option::Some(7),
18645 Self::Obsolete => std::option::Option::Some(10),
18646 Self::Failed => std::option::Option::Some(11),
18647 Self::UnknownValue(u) => u.0.value(),
18648 }
18649 }
18650
18651 /// Gets the enum value as a string.
18652 ///
18653 /// Returns `None` if the enum contains an unknown value deserialized from
18654 /// the integer representation of enums.
18655 pub fn name(&self) -> std::option::Option<&str> {
18656 match self {
18657 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18658 Self::Creating => std::option::Option::Some("CREATING"),
18659 Self::Active => std::option::Option::Some("ACTIVE"),
18660 Self::Deleting => std::option::Option::Some("DELETING"),
18661 Self::Accepting => std::option::Option::Some("ACCEPTING"),
18662 Self::Rejecting => std::option::Option::Some("REJECTING"),
18663 Self::Updating => std::option::Option::Some("UPDATING"),
18664 Self::Inactive => std::option::Option::Some("INACTIVE"),
18665 Self::Obsolete => std::option::Option::Some("OBSOLETE"),
18666 Self::Failed => std::option::Option::Some("FAILED"),
18667 Self::UnknownValue(u) => u.0.name(),
18668 }
18669 }
18670}
18671
18672impl std::default::Default for State {
18673 fn default() -> Self {
18674 use std::convert::From;
18675 Self::from(0)
18676 }
18677}
18678
18679impl std::fmt::Display for State {
18680 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18681 wkt::internal::display_enum(f, self.name(), self.value())
18682 }
18683}
18684
18685impl std::convert::From<i32> for State {
18686 fn from(value: i32) -> Self {
18687 match value {
18688 0 => Self::Unspecified,
18689 1 => Self::Creating,
18690 2 => Self::Active,
18691 3 => Self::Deleting,
18692 6 => Self::Updating,
18693 7 => Self::Inactive,
18694 8 => Self::Accepting,
18695 9 => Self::Rejecting,
18696 10 => Self::Obsolete,
18697 11 => Self::Failed,
18698 _ => Self::UnknownValue(state::UnknownValue(
18699 wkt::internal::UnknownEnumValue::Integer(value),
18700 )),
18701 }
18702 }
18703}
18704
18705impl std::convert::From<&str> for State {
18706 fn from(value: &str) -> Self {
18707 use std::string::ToString;
18708 match value {
18709 "STATE_UNSPECIFIED" => Self::Unspecified,
18710 "CREATING" => Self::Creating,
18711 "ACTIVE" => Self::Active,
18712 "DELETING" => Self::Deleting,
18713 "ACCEPTING" => Self::Accepting,
18714 "REJECTING" => Self::Rejecting,
18715 "UPDATING" => Self::Updating,
18716 "INACTIVE" => Self::Inactive,
18717 "OBSOLETE" => Self::Obsolete,
18718 "FAILED" => Self::Failed,
18719 _ => Self::UnknownValue(state::UnknownValue(
18720 wkt::internal::UnknownEnumValue::String(value.to_string()),
18721 )),
18722 }
18723 }
18724}
18725
18726impl serde::ser::Serialize for State {
18727 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18728 where
18729 S: serde::Serializer,
18730 {
18731 match self {
18732 Self::Unspecified => serializer.serialize_i32(0),
18733 Self::Creating => serializer.serialize_i32(1),
18734 Self::Active => serializer.serialize_i32(2),
18735 Self::Deleting => serializer.serialize_i32(3),
18736 Self::Accepting => serializer.serialize_i32(8),
18737 Self::Rejecting => serializer.serialize_i32(9),
18738 Self::Updating => serializer.serialize_i32(6),
18739 Self::Inactive => serializer.serialize_i32(7),
18740 Self::Obsolete => serializer.serialize_i32(10),
18741 Self::Failed => serializer.serialize_i32(11),
18742 Self::UnknownValue(u) => u.0.serialize(serializer),
18743 }
18744 }
18745}
18746
18747impl<'de> serde::de::Deserialize<'de> for State {
18748 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18749 where
18750 D: serde::Deserializer<'de>,
18751 {
18752 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18753 ".google.cloud.networkconnectivity.v1.State",
18754 ))
18755 }
18756}
18757
18758/// The SpokeType enum represents the type of spoke. The type
18759/// reflects the kind of resource that a spoke is associated with.
18760///
18761/// # Working with unknown values
18762///
18763/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18764/// additional enum variants at any time. Adding new variants is not considered
18765/// a breaking change. Applications should write their code in anticipation of:
18766///
18767/// - New values appearing in future releases of the client library, **and**
18768/// - New values received dynamically, without application changes.
18769///
18770/// Please consult the [Working with enums] section in the user guide for some
18771/// guidelines.
18772///
18773/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18774#[derive(Clone, Debug, PartialEq)]
18775#[non_exhaustive]
18776pub enum SpokeType {
18777 /// Unspecified spoke type.
18778 Unspecified,
18779 /// Spokes associated with VPN tunnels.
18780 VpnTunnel,
18781 /// Spokes associated with VLAN attachments.
18782 InterconnectAttachment,
18783 /// Spokes associated with router appliance instances.
18784 RouterAppliance,
18785 /// Spokes associated with VPC networks.
18786 VpcNetwork,
18787 /// Spokes that are backed by a producer VPC network.
18788 ProducerVpcNetwork,
18789 /// If set, the enum was initialized with an unknown value.
18790 ///
18791 /// Applications can examine the value using [SpokeType::value] or
18792 /// [SpokeType::name].
18793 UnknownValue(spoke_type::UnknownValue),
18794}
18795
18796#[doc(hidden)]
18797pub mod spoke_type {
18798 #[allow(unused_imports)]
18799 use super::*;
18800 #[derive(Clone, Debug, PartialEq)]
18801 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18802}
18803
18804impl SpokeType {
18805 /// Gets the enum value.
18806 ///
18807 /// Returns `None` if the enum contains an unknown value deserialized from
18808 /// the string representation of enums.
18809 pub fn value(&self) -> std::option::Option<i32> {
18810 match self {
18811 Self::Unspecified => std::option::Option::Some(0),
18812 Self::VpnTunnel => std::option::Option::Some(1),
18813 Self::InterconnectAttachment => std::option::Option::Some(2),
18814 Self::RouterAppliance => std::option::Option::Some(3),
18815 Self::VpcNetwork => std::option::Option::Some(4),
18816 Self::ProducerVpcNetwork => std::option::Option::Some(7),
18817 Self::UnknownValue(u) => u.0.value(),
18818 }
18819 }
18820
18821 /// Gets the enum value as a string.
18822 ///
18823 /// Returns `None` if the enum contains an unknown value deserialized from
18824 /// the integer representation of enums.
18825 pub fn name(&self) -> std::option::Option<&str> {
18826 match self {
18827 Self::Unspecified => std::option::Option::Some("SPOKE_TYPE_UNSPECIFIED"),
18828 Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
18829 Self::InterconnectAttachment => std::option::Option::Some("INTERCONNECT_ATTACHMENT"),
18830 Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
18831 Self::VpcNetwork => std::option::Option::Some("VPC_NETWORK"),
18832 Self::ProducerVpcNetwork => std::option::Option::Some("PRODUCER_VPC_NETWORK"),
18833 Self::UnknownValue(u) => u.0.name(),
18834 }
18835 }
18836}
18837
18838impl std::default::Default for SpokeType {
18839 fn default() -> Self {
18840 use std::convert::From;
18841 Self::from(0)
18842 }
18843}
18844
18845impl std::fmt::Display for SpokeType {
18846 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18847 wkt::internal::display_enum(f, self.name(), self.value())
18848 }
18849}
18850
18851impl std::convert::From<i32> for SpokeType {
18852 fn from(value: i32) -> Self {
18853 match value {
18854 0 => Self::Unspecified,
18855 1 => Self::VpnTunnel,
18856 2 => Self::InterconnectAttachment,
18857 3 => Self::RouterAppliance,
18858 4 => Self::VpcNetwork,
18859 7 => Self::ProducerVpcNetwork,
18860 _ => Self::UnknownValue(spoke_type::UnknownValue(
18861 wkt::internal::UnknownEnumValue::Integer(value),
18862 )),
18863 }
18864 }
18865}
18866
18867impl std::convert::From<&str> for SpokeType {
18868 fn from(value: &str) -> Self {
18869 use std::string::ToString;
18870 match value {
18871 "SPOKE_TYPE_UNSPECIFIED" => Self::Unspecified,
18872 "VPN_TUNNEL" => Self::VpnTunnel,
18873 "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
18874 "ROUTER_APPLIANCE" => Self::RouterAppliance,
18875 "VPC_NETWORK" => Self::VpcNetwork,
18876 "PRODUCER_VPC_NETWORK" => Self::ProducerVpcNetwork,
18877 _ => Self::UnknownValue(spoke_type::UnknownValue(
18878 wkt::internal::UnknownEnumValue::String(value.to_string()),
18879 )),
18880 }
18881 }
18882}
18883
18884impl serde::ser::Serialize for SpokeType {
18885 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18886 where
18887 S: serde::Serializer,
18888 {
18889 match self {
18890 Self::Unspecified => serializer.serialize_i32(0),
18891 Self::VpnTunnel => serializer.serialize_i32(1),
18892 Self::InterconnectAttachment => serializer.serialize_i32(2),
18893 Self::RouterAppliance => serializer.serialize_i32(3),
18894 Self::VpcNetwork => serializer.serialize_i32(4),
18895 Self::ProducerVpcNetwork => serializer.serialize_i32(7),
18896 Self::UnknownValue(u) => u.0.serialize(serializer),
18897 }
18898 }
18899}
18900
18901impl<'de> serde::de::Deserialize<'de> for SpokeType {
18902 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18903 where
18904 D: serde::Deserializer<'de>,
18905 {
18906 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeType>::new(
18907 ".google.cloud.networkconnectivity.v1.SpokeType",
18908 ))
18909 }
18910}
18911
18912/// This enum controls the policy mode used in a hub.
18913///
18914/// # Working with unknown values
18915///
18916/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18917/// additional enum variants at any time. Adding new variants is not considered
18918/// a breaking change. Applications should write their code in anticipation of:
18919///
18920/// - New values appearing in future releases of the client library, **and**
18921/// - New values received dynamically, without application changes.
18922///
18923/// Please consult the [Working with enums] section in the user guide for some
18924/// guidelines.
18925///
18926/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18927#[derive(Clone, Debug, PartialEq)]
18928#[non_exhaustive]
18929pub enum PolicyMode {
18930 /// Policy mode is unspecified. It defaults to PRESET
18931 /// with preset_topology = MESH.
18932 Unspecified,
18933 /// Hub uses one of the preset topologies.
18934 Preset,
18935 /// If set, the enum was initialized with an unknown value.
18936 ///
18937 /// Applications can examine the value using [PolicyMode::value] or
18938 /// [PolicyMode::name].
18939 UnknownValue(policy_mode::UnknownValue),
18940}
18941
18942#[doc(hidden)]
18943pub mod policy_mode {
18944 #[allow(unused_imports)]
18945 use super::*;
18946 #[derive(Clone, Debug, PartialEq)]
18947 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18948}
18949
18950impl PolicyMode {
18951 /// Gets the enum value.
18952 ///
18953 /// Returns `None` if the enum contains an unknown value deserialized from
18954 /// the string representation of enums.
18955 pub fn value(&self) -> std::option::Option<i32> {
18956 match self {
18957 Self::Unspecified => std::option::Option::Some(0),
18958 Self::Preset => std::option::Option::Some(1),
18959 Self::UnknownValue(u) => u.0.value(),
18960 }
18961 }
18962
18963 /// Gets the enum value as a string.
18964 ///
18965 /// Returns `None` if the enum contains an unknown value deserialized from
18966 /// the integer representation of enums.
18967 pub fn name(&self) -> std::option::Option<&str> {
18968 match self {
18969 Self::Unspecified => std::option::Option::Some("POLICY_MODE_UNSPECIFIED"),
18970 Self::Preset => std::option::Option::Some("PRESET"),
18971 Self::UnknownValue(u) => u.0.name(),
18972 }
18973 }
18974}
18975
18976impl std::default::Default for PolicyMode {
18977 fn default() -> Self {
18978 use std::convert::From;
18979 Self::from(0)
18980 }
18981}
18982
18983impl std::fmt::Display for PolicyMode {
18984 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18985 wkt::internal::display_enum(f, self.name(), self.value())
18986 }
18987}
18988
18989impl std::convert::From<i32> for PolicyMode {
18990 fn from(value: i32) -> Self {
18991 match value {
18992 0 => Self::Unspecified,
18993 1 => Self::Preset,
18994 _ => Self::UnknownValue(policy_mode::UnknownValue(
18995 wkt::internal::UnknownEnumValue::Integer(value),
18996 )),
18997 }
18998 }
18999}
19000
19001impl std::convert::From<&str> for PolicyMode {
19002 fn from(value: &str) -> Self {
19003 use std::string::ToString;
19004 match value {
19005 "POLICY_MODE_UNSPECIFIED" => Self::Unspecified,
19006 "PRESET" => Self::Preset,
19007 _ => Self::UnknownValue(policy_mode::UnknownValue(
19008 wkt::internal::UnknownEnumValue::String(value.to_string()),
19009 )),
19010 }
19011 }
19012}
19013
19014impl serde::ser::Serialize for PolicyMode {
19015 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19016 where
19017 S: serde::Serializer,
19018 {
19019 match self {
19020 Self::Unspecified => serializer.serialize_i32(0),
19021 Self::Preset => serializer.serialize_i32(1),
19022 Self::UnknownValue(u) => u.0.serialize(serializer),
19023 }
19024 }
19025}
19026
19027impl<'de> serde::de::Deserialize<'de> for PolicyMode {
19028 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19029 where
19030 D: serde::Deserializer<'de>,
19031 {
19032 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyMode>::new(
19033 ".google.cloud.networkconnectivity.v1.PolicyMode",
19034 ))
19035 }
19036}
19037
19038/// The list of available preset topologies.
19039///
19040/// # Working with unknown values
19041///
19042/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19043/// additional enum variants at any time. Adding new variants is not considered
19044/// a breaking change. Applications should write their code in anticipation of:
19045///
19046/// - New values appearing in future releases of the client library, **and**
19047/// - New values received dynamically, without application changes.
19048///
19049/// Please consult the [Working with enums] section in the user guide for some
19050/// guidelines.
19051///
19052/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19053#[derive(Clone, Debug, PartialEq)]
19054#[non_exhaustive]
19055pub enum PresetTopology {
19056 /// Preset topology is unspecified. When policy_mode = PRESET,
19057 /// it defaults to MESH.
19058 Unspecified,
19059 /// Mesh topology is implemented. Group `default` is automatically created.
19060 /// All spokes in the hub are added to group `default`.
19061 Mesh,
19062 /// Star topology is implemented. Two groups, `center` and `edge`, are
19063 /// automatically created along with hub creation. Spokes have to join one of
19064 /// the groups during creation.
19065 Star,
19066 /// If set, the enum was initialized with an unknown value.
19067 ///
19068 /// Applications can examine the value using [PresetTopology::value] or
19069 /// [PresetTopology::name].
19070 UnknownValue(preset_topology::UnknownValue),
19071}
19072
19073#[doc(hidden)]
19074pub mod preset_topology {
19075 #[allow(unused_imports)]
19076 use super::*;
19077 #[derive(Clone, Debug, PartialEq)]
19078 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19079}
19080
19081impl PresetTopology {
19082 /// Gets the enum value.
19083 ///
19084 /// Returns `None` if the enum contains an unknown value deserialized from
19085 /// the string representation of enums.
19086 pub fn value(&self) -> std::option::Option<i32> {
19087 match self {
19088 Self::Unspecified => std::option::Option::Some(0),
19089 Self::Mesh => std::option::Option::Some(2),
19090 Self::Star => std::option::Option::Some(3),
19091 Self::UnknownValue(u) => u.0.value(),
19092 }
19093 }
19094
19095 /// Gets the enum value as a string.
19096 ///
19097 /// Returns `None` if the enum contains an unknown value deserialized from
19098 /// the integer representation of enums.
19099 pub fn name(&self) -> std::option::Option<&str> {
19100 match self {
19101 Self::Unspecified => std::option::Option::Some("PRESET_TOPOLOGY_UNSPECIFIED"),
19102 Self::Mesh => std::option::Option::Some("MESH"),
19103 Self::Star => std::option::Option::Some("STAR"),
19104 Self::UnknownValue(u) => u.0.name(),
19105 }
19106 }
19107}
19108
19109impl std::default::Default for PresetTopology {
19110 fn default() -> Self {
19111 use std::convert::From;
19112 Self::from(0)
19113 }
19114}
19115
19116impl std::fmt::Display for PresetTopology {
19117 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19118 wkt::internal::display_enum(f, self.name(), self.value())
19119 }
19120}
19121
19122impl std::convert::From<i32> for PresetTopology {
19123 fn from(value: i32) -> Self {
19124 match value {
19125 0 => Self::Unspecified,
19126 2 => Self::Mesh,
19127 3 => Self::Star,
19128 _ => Self::UnknownValue(preset_topology::UnknownValue(
19129 wkt::internal::UnknownEnumValue::Integer(value),
19130 )),
19131 }
19132 }
19133}
19134
19135impl std::convert::From<&str> for PresetTopology {
19136 fn from(value: &str) -> Self {
19137 use std::string::ToString;
19138 match value {
19139 "PRESET_TOPOLOGY_UNSPECIFIED" => Self::Unspecified,
19140 "MESH" => Self::Mesh,
19141 "STAR" => Self::Star,
19142 _ => Self::UnknownValue(preset_topology::UnknownValue(
19143 wkt::internal::UnknownEnumValue::String(value.to_string()),
19144 )),
19145 }
19146 }
19147}
19148
19149impl serde::ser::Serialize for PresetTopology {
19150 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19151 where
19152 S: serde::Serializer,
19153 {
19154 match self {
19155 Self::Unspecified => serializer.serialize_i32(0),
19156 Self::Mesh => serializer.serialize_i32(2),
19157 Self::Star => serializer.serialize_i32(3),
19158 Self::UnknownValue(u) => u.0.serialize(serializer),
19159 }
19160 }
19161}
19162
19163impl<'de> serde::de::Deserialize<'de> for PresetTopology {
19164 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19165 where
19166 D: serde::Deserializer<'de>,
19167 {
19168 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PresetTopology>::new(
19169 ".google.cloud.networkconnectivity.v1.PresetTopology",
19170 ))
19171 }
19172}