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 gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_rpc;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// Represents the metadata of the long-running operation.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct OperationMetadata {
44 /// Output only. The time the operation was created.
45 pub create_time: std::option::Option<wkt::Timestamp>,
46
47 /// Output only. The time the operation finished running.
48 pub end_time: std::option::Option<wkt::Timestamp>,
49
50 /// Output only. Server-defined resource path for the target of the operation.
51 pub target: std::string::String,
52
53 /// Output only. Name of the verb executed by the operation.
54 pub verb: std::string::String,
55
56 /// Output only. Human-readable status of the operation, if any.
57 pub status_message: std::string::String,
58
59 /// Output only. Identifies whether the user has requested cancellation
60 /// of the operation. Operations that have been cancelled successfully
61 /// have
62 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
63 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
64 /// corresponding to `Code.CANCELLED`.
65 ///
66 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
67 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
68 pub requested_cancellation: bool,
69
70 /// Output only. API version used to start the operation.
71 pub api_version: std::string::String,
72
73 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
74}
75
76impl OperationMetadata {
77 pub fn new() -> Self {
78 std::default::Default::default()
79 }
80
81 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
82 ///
83 /// # Example
84 /// ```ignore,no_run
85 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
86 /// use wkt::Timestamp;
87 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
88 /// ```
89 pub fn set_create_time<T>(mut self, v: T) -> Self
90 where
91 T: std::convert::Into<wkt::Timestamp>,
92 {
93 self.create_time = std::option::Option::Some(v.into());
94 self
95 }
96
97 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
98 ///
99 /// # Example
100 /// ```ignore,no_run
101 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
102 /// use wkt::Timestamp;
103 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
104 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
105 /// ```
106 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
107 where
108 T: std::convert::Into<wkt::Timestamp>,
109 {
110 self.create_time = v.map(|x| x.into());
111 self
112 }
113
114 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
115 ///
116 /// # Example
117 /// ```ignore,no_run
118 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
119 /// use wkt::Timestamp;
120 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
121 /// ```
122 pub fn set_end_time<T>(mut self, v: T) -> Self
123 where
124 T: std::convert::Into<wkt::Timestamp>,
125 {
126 self.end_time = std::option::Option::Some(v.into());
127 self
128 }
129
130 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
131 ///
132 /// # Example
133 /// ```ignore,no_run
134 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
135 /// use wkt::Timestamp;
136 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
137 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
138 /// ```
139 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
140 where
141 T: std::convert::Into<wkt::Timestamp>,
142 {
143 self.end_time = v.map(|x| x.into());
144 self
145 }
146
147 /// Sets the value of [target][crate::model::OperationMetadata::target].
148 ///
149 /// # Example
150 /// ```ignore,no_run
151 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
152 /// let x = OperationMetadata::new().set_target("example");
153 /// ```
154 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
155 self.target = v.into();
156 self
157 }
158
159 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
160 ///
161 /// # Example
162 /// ```ignore,no_run
163 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
164 /// let x = OperationMetadata::new().set_verb("example");
165 /// ```
166 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
167 self.verb = v.into();
168 self
169 }
170
171 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
172 ///
173 /// # Example
174 /// ```ignore,no_run
175 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
176 /// let x = OperationMetadata::new().set_status_message("example");
177 /// ```
178 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
179 self.status_message = v.into();
180 self
181 }
182
183 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
184 ///
185 /// # Example
186 /// ```ignore,no_run
187 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
188 /// let x = OperationMetadata::new().set_requested_cancellation(true);
189 /// ```
190 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
191 self.requested_cancellation = v.into();
192 self
193 }
194
195 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
196 ///
197 /// # Example
198 /// ```ignore,no_run
199 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
200 /// let x = OperationMetadata::new().set_api_version("example");
201 /// ```
202 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
203 self.api_version = v.into();
204 self
205 }
206}
207
208impl wkt::message::Message for OperationMetadata {
209 fn typename() -> &'static str {
210 "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata"
211 }
212}
213
214/// The ServiceConnectionMap resource.
215#[derive(Clone, Default, PartialEq)]
216#[non_exhaustive]
217pub struct ServiceConnectionMap {
218 /// Immutable. The name of a ServiceConnectionMap.
219 /// Format:
220 /// projects/{project}/locations/{location}/serviceConnectionMaps/{service_connection_map}
221 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
222 pub name: std::string::String,
223
224 /// Output only. Time when the ServiceConnectionMap was created.
225 pub create_time: std::option::Option<wkt::Timestamp>,
226
227 /// Output only. Time when the ServiceConnectionMap was updated.
228 pub update_time: std::option::Option<wkt::Timestamp>,
229
230 /// User-defined labels.
231 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
232
233 /// A description of this resource.
234 pub description: std::string::String,
235
236 /// The service class identifier this ServiceConnectionMap is for.
237 /// The user of ServiceConnectionMap create API needs to have
238 /// networkconnecitivty.serviceclasses.use iam permission for the service
239 /// class.
240 pub service_class: std::string::String,
241
242 /// Output only. The service class uri this ServiceConnectionMap is for.
243 pub service_class_uri: std::string::String,
244
245 /// Output only. The infrastructure used for connections between
246 /// consumers/producers.
247 pub infrastructure: crate::model::Infrastructure,
248
249 /// The PSC configurations on producer side.
250 pub producer_psc_configs:
251 std::vec::Vec<crate::model::service_connection_map::ProducerPscConfig>,
252
253 /// The PSC configurations on consumer side.
254 pub consumer_psc_configs:
255 std::vec::Vec<crate::model::service_connection_map::ConsumerPscConfig>,
256
257 /// Output only. PSC connection details on consumer side.
258 pub consumer_psc_connections:
259 std::vec::Vec<crate::model::service_connection_map::ConsumerPscConnection>,
260
261 /// The token provided by the consumer. This token authenticates that the
262 /// consumer can create a connection within the specified project and network.
263 pub token: std::string::String,
264
265 /// Optional. The etag is computed by the server, and may be sent on update and
266 /// delete requests to ensure the client has an up-to-date value before
267 /// proceeding.
268 pub etag: std::option::Option<std::string::String>,
269
270 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
271}
272
273impl ServiceConnectionMap {
274 pub fn new() -> Self {
275 std::default::Default::default()
276 }
277
278 /// Sets the value of [name][crate::model::ServiceConnectionMap::name].
279 ///
280 /// # Example
281 /// ```ignore,no_run
282 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
283 /// let x = ServiceConnectionMap::new().set_name("example");
284 /// ```
285 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
286 self.name = v.into();
287 self
288 }
289
290 /// Sets the value of [create_time][crate::model::ServiceConnectionMap::create_time].
291 ///
292 /// # Example
293 /// ```ignore,no_run
294 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
295 /// use wkt::Timestamp;
296 /// let x = ServiceConnectionMap::new().set_create_time(Timestamp::default()/* use setters */);
297 /// ```
298 pub fn set_create_time<T>(mut self, v: T) -> Self
299 where
300 T: std::convert::Into<wkt::Timestamp>,
301 {
302 self.create_time = std::option::Option::Some(v.into());
303 self
304 }
305
306 /// Sets or clears the value of [create_time][crate::model::ServiceConnectionMap::create_time].
307 ///
308 /// # Example
309 /// ```ignore,no_run
310 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
311 /// use wkt::Timestamp;
312 /// let x = ServiceConnectionMap::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
313 /// let x = ServiceConnectionMap::new().set_or_clear_create_time(None::<Timestamp>);
314 /// ```
315 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
316 where
317 T: std::convert::Into<wkt::Timestamp>,
318 {
319 self.create_time = v.map(|x| x.into());
320 self
321 }
322
323 /// Sets the value of [update_time][crate::model::ServiceConnectionMap::update_time].
324 ///
325 /// # Example
326 /// ```ignore,no_run
327 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
328 /// use wkt::Timestamp;
329 /// let x = ServiceConnectionMap::new().set_update_time(Timestamp::default()/* use setters */);
330 /// ```
331 pub fn set_update_time<T>(mut self, v: T) -> Self
332 where
333 T: std::convert::Into<wkt::Timestamp>,
334 {
335 self.update_time = std::option::Option::Some(v.into());
336 self
337 }
338
339 /// Sets or clears the value of [update_time][crate::model::ServiceConnectionMap::update_time].
340 ///
341 /// # Example
342 /// ```ignore,no_run
343 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
344 /// use wkt::Timestamp;
345 /// let x = ServiceConnectionMap::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
346 /// let x = ServiceConnectionMap::new().set_or_clear_update_time(None::<Timestamp>);
347 /// ```
348 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
349 where
350 T: std::convert::Into<wkt::Timestamp>,
351 {
352 self.update_time = v.map(|x| x.into());
353 self
354 }
355
356 /// Sets the value of [labels][crate::model::ServiceConnectionMap::labels].
357 ///
358 /// # Example
359 /// ```ignore,no_run
360 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
361 /// let x = ServiceConnectionMap::new().set_labels([
362 /// ("key0", "abc"),
363 /// ("key1", "xyz"),
364 /// ]);
365 /// ```
366 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
367 where
368 T: std::iter::IntoIterator<Item = (K, V)>,
369 K: std::convert::Into<std::string::String>,
370 V: std::convert::Into<std::string::String>,
371 {
372 use std::iter::Iterator;
373 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
374 self
375 }
376
377 /// Sets the value of [description][crate::model::ServiceConnectionMap::description].
378 ///
379 /// # Example
380 /// ```ignore,no_run
381 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
382 /// let x = ServiceConnectionMap::new().set_description("example");
383 /// ```
384 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
385 self.description = v.into();
386 self
387 }
388
389 /// Sets the value of [service_class][crate::model::ServiceConnectionMap::service_class].
390 ///
391 /// # Example
392 /// ```ignore,no_run
393 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
394 /// let x = ServiceConnectionMap::new().set_service_class("example");
395 /// ```
396 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
397 self.service_class = v.into();
398 self
399 }
400
401 /// Sets the value of [service_class_uri][crate::model::ServiceConnectionMap::service_class_uri].
402 ///
403 /// # Example
404 /// ```ignore,no_run
405 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
406 /// let x = ServiceConnectionMap::new().set_service_class_uri("example");
407 /// ```
408 pub fn set_service_class_uri<T: std::convert::Into<std::string::String>>(
409 mut self,
410 v: T,
411 ) -> Self {
412 self.service_class_uri = v.into();
413 self
414 }
415
416 /// Sets the value of [infrastructure][crate::model::ServiceConnectionMap::infrastructure].
417 ///
418 /// # Example
419 /// ```ignore,no_run
420 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
421 /// use google_cloud_networkconnectivity_v1::model::Infrastructure;
422 /// let x0 = ServiceConnectionMap::new().set_infrastructure(Infrastructure::Psc);
423 /// ```
424 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
425 mut self,
426 v: T,
427 ) -> Self {
428 self.infrastructure = v.into();
429 self
430 }
431
432 /// Sets the value of [producer_psc_configs][crate::model::ServiceConnectionMap::producer_psc_configs].
433 ///
434 /// # Example
435 /// ```ignore,no_run
436 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
437 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ProducerPscConfig;
438 /// let x = ServiceConnectionMap::new()
439 /// .set_producer_psc_configs([
440 /// ProducerPscConfig::default()/* use setters */,
441 /// ProducerPscConfig::default()/* use (different) setters */,
442 /// ]);
443 /// ```
444 pub fn set_producer_psc_configs<T, V>(mut self, v: T) -> Self
445 where
446 T: std::iter::IntoIterator<Item = V>,
447 V: std::convert::Into<crate::model::service_connection_map::ProducerPscConfig>,
448 {
449 use std::iter::Iterator;
450 self.producer_psc_configs = v.into_iter().map(|i| i.into()).collect();
451 self
452 }
453
454 /// Sets the value of [consumer_psc_configs][crate::model::ServiceConnectionMap::consumer_psc_configs].
455 ///
456 /// # Example
457 /// ```ignore,no_run
458 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
459 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
460 /// let x = ServiceConnectionMap::new()
461 /// .set_consumer_psc_configs([
462 /// ConsumerPscConfig::default()/* use setters */,
463 /// ConsumerPscConfig::default()/* use (different) setters */,
464 /// ]);
465 /// ```
466 pub fn set_consumer_psc_configs<T, V>(mut self, v: T) -> Self
467 where
468 T: std::iter::IntoIterator<Item = V>,
469 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConfig>,
470 {
471 use std::iter::Iterator;
472 self.consumer_psc_configs = v.into_iter().map(|i| i.into()).collect();
473 self
474 }
475
476 /// Sets the value of [consumer_psc_connections][crate::model::ServiceConnectionMap::consumer_psc_connections].
477 ///
478 /// # Example
479 /// ```ignore,no_run
480 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
481 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
482 /// let x = ServiceConnectionMap::new()
483 /// .set_consumer_psc_connections([
484 /// ConsumerPscConnection::default()/* use setters */,
485 /// ConsumerPscConnection::default()/* use (different) setters */,
486 /// ]);
487 /// ```
488 pub fn set_consumer_psc_connections<T, V>(mut self, v: T) -> Self
489 where
490 T: std::iter::IntoIterator<Item = V>,
491 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConnection>,
492 {
493 use std::iter::Iterator;
494 self.consumer_psc_connections = v.into_iter().map(|i| i.into()).collect();
495 self
496 }
497
498 /// Sets the value of [token][crate::model::ServiceConnectionMap::token].
499 ///
500 /// # Example
501 /// ```ignore,no_run
502 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
503 /// let x = ServiceConnectionMap::new().set_token("example");
504 /// ```
505 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
506 self.token = v.into();
507 self
508 }
509
510 /// Sets the value of [etag][crate::model::ServiceConnectionMap::etag].
511 ///
512 /// # Example
513 /// ```ignore,no_run
514 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
515 /// let x = ServiceConnectionMap::new().set_etag("example");
516 /// ```
517 pub fn set_etag<T>(mut self, v: T) -> Self
518 where
519 T: std::convert::Into<std::string::String>,
520 {
521 self.etag = std::option::Option::Some(v.into());
522 self
523 }
524
525 /// Sets or clears the value of [etag][crate::model::ServiceConnectionMap::etag].
526 ///
527 /// # Example
528 /// ```ignore,no_run
529 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
530 /// let x = ServiceConnectionMap::new().set_or_clear_etag(Some("example"));
531 /// let x = ServiceConnectionMap::new().set_or_clear_etag(None::<String>);
532 /// ```
533 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
534 where
535 T: std::convert::Into<std::string::String>,
536 {
537 self.etag = v.map(|x| x.into());
538 self
539 }
540}
541
542impl wkt::message::Message for ServiceConnectionMap {
543 fn typename() -> &'static str {
544 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap"
545 }
546}
547
548/// Defines additional types related to [ServiceConnectionMap].
549pub mod service_connection_map {
550 #[allow(unused_imports)]
551 use super::*;
552
553 /// The PSC configurations on producer side.
554 #[derive(Clone, Default, PartialEq)]
555 #[non_exhaustive]
556 pub struct ProducerPscConfig {
557 /// The resource path of a service attachment.
558 /// Example:
559 /// projects/{projectNumOrId}/regions/{region}/serviceAttachments/{resourceId}.
560 pub service_attachment_uri: std::string::String,
561
562 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
563 }
564
565 impl ProducerPscConfig {
566 pub fn new() -> Self {
567 std::default::Default::default()
568 }
569
570 /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ProducerPscConfig::service_attachment_uri].
571 ///
572 /// # Example
573 /// ```ignore,no_run
574 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ProducerPscConfig;
575 /// let x = ProducerPscConfig::new().set_service_attachment_uri("example");
576 /// ```
577 pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
578 mut self,
579 v: T,
580 ) -> Self {
581 self.service_attachment_uri = v.into();
582 self
583 }
584 }
585
586 impl wkt::message::Message for ProducerPscConfig {
587 fn typename() -> &'static str {
588 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ProducerPscConfig"
589 }
590 }
591
592 /// Allow the producer to specify which consumers can connect to it.
593 #[derive(Clone, Default, PartialEq)]
594 #[non_exhaustive]
595 pub struct ConsumerPscConfig {
596 /// The consumer project where PSC connections are allowed to be created in.
597 pub project: std::string::String,
598
599 /// The resource path of the consumer network where PSC connections are
600 /// allowed to be created in. Note, this network does not need be in the
601 /// ConsumerPscConfig.project in the case of SharedVPC.
602 /// Example:
603 /// projects/{projectNumOrId}/global/networks/{networkId}.
604 pub network: std::string::String,
605
606 /// This is used in PSC consumer ForwardingRule to control whether the PSC
607 /// endpoint can be accessed from another region.
608 pub disable_global_access: bool,
609
610 /// Output only. Overall state of PSC Connections management for this
611 /// consumer psc config.
612 pub state: crate::model::service_connection_map::consumer_psc_config::State,
613
614 /// Immutable. Deprecated. Use producer_instance_metadata instead.
615 /// An immutable identifier for the producer instance.
616 #[deprecated]
617 pub producer_instance_id: std::string::String,
618
619 /// Output only. A map to store mapping between customer vip and target
620 /// service attachment. Only service attachment with producer specified ip
621 /// addresses are stored here.
622 pub service_attachment_ip_address_map:
623 std::collections::HashMap<std::string::String, std::string::String>,
624
625 /// Required. The project ID or project number of the consumer project. This
626 /// project is the one that the consumer uses to interact with the producer
627 /// instance. From the perspective of a consumer who's created a producer
628 /// instance, this is the project of the producer instance. Format:
629 /// 'projects/<project_id_or_number>' Eg. 'projects/consumer-project' or
630 /// 'projects/1234'
631 pub consumer_instance_project: std::string::String,
632
633 /// Immutable. An immutable map for the producer instance metadata.
634 pub producer_instance_metadata:
635 std::collections::HashMap<std::string::String, std::string::String>,
636
637 /// The requested IP version for the PSC connection.
638 pub ip_version: std::option::Option<crate::model::IPVersion>,
639
640 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
641 }
642
643 impl ConsumerPscConfig {
644 pub fn new() -> Self {
645 std::default::Default::default()
646 }
647
648 /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConfig::project].
649 ///
650 /// # Example
651 /// ```ignore,no_run
652 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
653 /// let x = ConsumerPscConfig::new().set_project("example");
654 /// ```
655 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
656 self.project = v.into();
657 self
658 }
659
660 /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConfig::network].
661 ///
662 /// # Example
663 /// ```ignore,no_run
664 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
665 /// let x = ConsumerPscConfig::new().set_network("example");
666 /// ```
667 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
668 self.network = v.into();
669 self
670 }
671
672 /// Sets the value of [disable_global_access][crate::model::service_connection_map::ConsumerPscConfig::disable_global_access].
673 ///
674 /// # Example
675 /// ```ignore,no_run
676 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
677 /// let x = ConsumerPscConfig::new().set_disable_global_access(true);
678 /// ```
679 pub fn set_disable_global_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
680 self.disable_global_access = v.into();
681 self
682 }
683
684 /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConfig::state].
685 ///
686 /// # Example
687 /// ```ignore,no_run
688 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
689 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::consumer_psc_config::State;
690 /// let x0 = ConsumerPscConfig::new().set_state(State::Valid);
691 /// let x1 = ConsumerPscConfig::new().set_state(State::ConnectionPolicyMissing);
692 /// let x2 = ConsumerPscConfig::new().set_state(State::PolicyLimitReached);
693 /// ```
694 pub fn set_state<
695 T: std::convert::Into<crate::model::service_connection_map::consumer_psc_config::State>,
696 >(
697 mut self,
698 v: T,
699 ) -> Self {
700 self.state = v.into();
701 self
702 }
703
704 /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_id].
705 ///
706 /// # Example
707 /// ```ignore,no_run
708 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
709 /// let x = ConsumerPscConfig::new().set_producer_instance_id("example");
710 /// ```
711 #[deprecated]
712 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
713 mut self,
714 v: T,
715 ) -> Self {
716 self.producer_instance_id = v.into();
717 self
718 }
719
720 /// Sets the value of [service_attachment_ip_address_map][crate::model::service_connection_map::ConsumerPscConfig::service_attachment_ip_address_map].
721 ///
722 /// # Example
723 /// ```ignore,no_run
724 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
725 /// let x = ConsumerPscConfig::new().set_service_attachment_ip_address_map([
726 /// ("key0", "abc"),
727 /// ("key1", "xyz"),
728 /// ]);
729 /// ```
730 pub fn set_service_attachment_ip_address_map<T, K, V>(mut self, v: T) -> Self
731 where
732 T: std::iter::IntoIterator<Item = (K, V)>,
733 K: std::convert::Into<std::string::String>,
734 V: std::convert::Into<std::string::String>,
735 {
736 use std::iter::Iterator;
737 self.service_attachment_ip_address_map =
738 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
739 self
740 }
741
742 /// Sets the value of [consumer_instance_project][crate::model::service_connection_map::ConsumerPscConfig::consumer_instance_project].
743 ///
744 /// # Example
745 /// ```ignore,no_run
746 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
747 /// let x = ConsumerPscConfig::new().set_consumer_instance_project("example");
748 /// ```
749 pub fn set_consumer_instance_project<T: std::convert::Into<std::string::String>>(
750 mut self,
751 v: T,
752 ) -> Self {
753 self.consumer_instance_project = v.into();
754 self
755 }
756
757 /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_metadata].
758 ///
759 /// # Example
760 /// ```ignore,no_run
761 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
762 /// let x = ConsumerPscConfig::new().set_producer_instance_metadata([
763 /// ("key0", "abc"),
764 /// ("key1", "xyz"),
765 /// ]);
766 /// ```
767 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
768 where
769 T: std::iter::IntoIterator<Item = (K, V)>,
770 K: std::convert::Into<std::string::String>,
771 V: std::convert::Into<std::string::String>,
772 {
773 use std::iter::Iterator;
774 self.producer_instance_metadata =
775 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
776 self
777 }
778
779 /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
780 ///
781 /// # Example
782 /// ```ignore,no_run
783 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
784 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
785 /// let x0 = ConsumerPscConfig::new().set_ip_version(IPVersion::Ipv4);
786 /// let x1 = ConsumerPscConfig::new().set_ip_version(IPVersion::Ipv6);
787 /// ```
788 pub fn set_ip_version<T>(mut self, v: T) -> Self
789 where
790 T: std::convert::Into<crate::model::IPVersion>,
791 {
792 self.ip_version = std::option::Option::Some(v.into());
793 self
794 }
795
796 /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
797 ///
798 /// # Example
799 /// ```ignore,no_run
800 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
801 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
802 /// let x0 = ConsumerPscConfig::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
803 /// let x1 = ConsumerPscConfig::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
804 /// let x_none = ConsumerPscConfig::new().set_or_clear_ip_version(None::<IPVersion>);
805 /// ```
806 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
807 where
808 T: std::convert::Into<crate::model::IPVersion>,
809 {
810 self.ip_version = v.map(|x| x.into());
811 self
812 }
813 }
814
815 impl wkt::message::Message for ConsumerPscConfig {
816 fn typename() -> &'static str {
817 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig"
818 }
819 }
820
821 /// Defines additional types related to [ConsumerPscConfig].
822 pub mod consumer_psc_config {
823 #[allow(unused_imports)]
824 use super::*;
825
826 /// PSC Consumer Config State.
827 ///
828 /// # Working with unknown values
829 ///
830 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
831 /// additional enum variants at any time. Adding new variants is not considered
832 /// a breaking change. Applications should write their code in anticipation of:
833 ///
834 /// - New values appearing in future releases of the client library, **and**
835 /// - New values received dynamically, without application changes.
836 ///
837 /// Please consult the [Working with enums] section in the user guide for some
838 /// guidelines.
839 ///
840 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
841 #[derive(Clone, Debug, PartialEq)]
842 #[non_exhaustive]
843 pub enum State {
844 /// Default state, when Connection Map is created initially.
845 Unspecified,
846 /// Set when policy and map configuration is valid,
847 /// and their matching can lead to allowing creation of PSC Connections
848 /// subject to other constraints like connections limit.
849 Valid,
850 /// No Service Connection Policy found for this network and Service
851 /// Class
852 ConnectionPolicyMissing,
853 /// Service Connection Policy limit reached for this network and Service
854 /// Class
855 PolicyLimitReached,
856 /// The consumer instance project is not in
857 /// AllowedGoogleProducersResourceHierarchyLevels of the matching
858 /// ServiceConnectionPolicy.
859 ConsumerInstanceProjectNotAllowlisted,
860 /// If set, the enum was initialized with an unknown value.
861 ///
862 /// Applications can examine the value using [State::value] or
863 /// [State::name].
864 UnknownValue(state::UnknownValue),
865 }
866
867 #[doc(hidden)]
868 pub mod state {
869 #[allow(unused_imports)]
870 use super::*;
871 #[derive(Clone, Debug, PartialEq)]
872 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
873 }
874
875 impl State {
876 /// Gets the enum value.
877 ///
878 /// Returns `None` if the enum contains an unknown value deserialized from
879 /// the string representation of enums.
880 pub fn value(&self) -> std::option::Option<i32> {
881 match self {
882 Self::Unspecified => std::option::Option::Some(0),
883 Self::Valid => std::option::Option::Some(1),
884 Self::ConnectionPolicyMissing => std::option::Option::Some(2),
885 Self::PolicyLimitReached => std::option::Option::Some(3),
886 Self::ConsumerInstanceProjectNotAllowlisted => std::option::Option::Some(4),
887 Self::UnknownValue(u) => u.0.value(),
888 }
889 }
890
891 /// Gets the enum value as a string.
892 ///
893 /// Returns `None` if the enum contains an unknown value deserialized from
894 /// the integer representation of enums.
895 pub fn name(&self) -> std::option::Option<&str> {
896 match self {
897 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
898 Self::Valid => std::option::Option::Some("VALID"),
899 Self::ConnectionPolicyMissing => {
900 std::option::Option::Some("CONNECTION_POLICY_MISSING")
901 }
902 Self::PolicyLimitReached => std::option::Option::Some("POLICY_LIMIT_REACHED"),
903 Self::ConsumerInstanceProjectNotAllowlisted => {
904 std::option::Option::Some("CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED")
905 }
906 Self::UnknownValue(u) => u.0.name(),
907 }
908 }
909 }
910
911 impl std::default::Default for State {
912 fn default() -> Self {
913 use std::convert::From;
914 Self::from(0)
915 }
916 }
917
918 impl std::fmt::Display for State {
919 fn fmt(
920 &self,
921 f: &mut std::fmt::Formatter<'_>,
922 ) -> std::result::Result<(), std::fmt::Error> {
923 wkt::internal::display_enum(f, self.name(), self.value())
924 }
925 }
926
927 impl std::convert::From<i32> for State {
928 fn from(value: i32) -> Self {
929 match value {
930 0 => Self::Unspecified,
931 1 => Self::Valid,
932 2 => Self::ConnectionPolicyMissing,
933 3 => Self::PolicyLimitReached,
934 4 => Self::ConsumerInstanceProjectNotAllowlisted,
935 _ => Self::UnknownValue(state::UnknownValue(
936 wkt::internal::UnknownEnumValue::Integer(value),
937 )),
938 }
939 }
940 }
941
942 impl std::convert::From<&str> for State {
943 fn from(value: &str) -> Self {
944 use std::string::ToString;
945 match value {
946 "STATE_UNSPECIFIED" => Self::Unspecified,
947 "VALID" => Self::Valid,
948 "CONNECTION_POLICY_MISSING" => Self::ConnectionPolicyMissing,
949 "POLICY_LIMIT_REACHED" => Self::PolicyLimitReached,
950 "CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" => {
951 Self::ConsumerInstanceProjectNotAllowlisted
952 }
953 _ => Self::UnknownValue(state::UnknownValue(
954 wkt::internal::UnknownEnumValue::String(value.to_string()),
955 )),
956 }
957 }
958 }
959
960 impl serde::ser::Serialize for State {
961 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
962 where
963 S: serde::Serializer,
964 {
965 match self {
966 Self::Unspecified => serializer.serialize_i32(0),
967 Self::Valid => serializer.serialize_i32(1),
968 Self::ConnectionPolicyMissing => serializer.serialize_i32(2),
969 Self::PolicyLimitReached => serializer.serialize_i32(3),
970 Self::ConsumerInstanceProjectNotAllowlisted => serializer.serialize_i32(4),
971 Self::UnknownValue(u) => u.0.serialize(serializer),
972 }
973 }
974 }
975
976 impl<'de> serde::de::Deserialize<'de> for State {
977 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
978 where
979 D: serde::Deserializer<'de>,
980 {
981 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
982 ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig.State"))
983 }
984 }
985 }
986
987 /// PSC connection details on consumer side.
988 #[derive(Clone, Default, PartialEq)]
989 #[non_exhaustive]
990 pub struct ConsumerPscConnection {
991 /// The URI of a service attachment which is the target of the PSC
992 /// connection.
993 pub service_attachment_uri: std::string::String,
994
995 /// The state of the PSC connection.
996 pub state: crate::model::service_connection_map::consumer_psc_connection::State,
997
998 /// The consumer project whose PSC forwarding rule is connected to the
999 /// service attachments in this service connection map.
1000 pub project: std::string::String,
1001
1002 /// The consumer network whose PSC forwarding rule is connected to the
1003 /// service attachments in this service connection map.
1004 /// Note that the network could be on a different project (shared VPC).
1005 pub network: std::string::String,
1006
1007 /// The PSC connection id of the PSC forwarding rule connected
1008 /// to the service attachments in this service connection map.
1009 pub psc_connection_id: std::string::String,
1010
1011 /// The IP literal allocated on the consumer network for the PSC forwarding
1012 /// rule that is created to connect to the producer service attachment in
1013 /// this service connection map.
1014 pub ip: std::string::String,
1015
1016 /// The error type indicates whether the error is consumer facing, producer
1017 /// facing or system internal.
1018 #[deprecated]
1019 pub error_type: crate::model::ConnectionErrorType,
1020
1021 /// The most recent error during operating this connection.
1022 #[deprecated]
1023 pub error: std::option::Option<google_cloud_rpc::model::Status>,
1024
1025 /// The last Compute Engine operation to setup PSC connection.
1026 pub gce_operation: std::string::String,
1027
1028 /// The URI of the consumer forwarding rule created.
1029 /// Example:
1030 /// projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.
1031 pub forwarding_rule: std::string::String,
1032
1033 /// Output only. The error info for the latest error during operating this
1034 /// connection.
1035 pub error_info: std::option::Option<google_cloud_rpc::model::ErrorInfo>,
1036
1037 /// Output only. The URI of the selected subnetwork selected to allocate IP
1038 /// address for this connection.
1039 pub selected_subnetwork: std::string::String,
1040
1041 /// Immutable. Deprecated. Use producer_instance_metadata instead.
1042 /// An immutable identifier for the producer instance.
1043 #[deprecated]
1044 pub producer_instance_id: std::string::String,
1045
1046 /// Immutable. An immutable map for the producer instance metadata.
1047 pub producer_instance_metadata:
1048 std::collections::HashMap<std::string::String, std::string::String>,
1049
1050 /// The requested IP version for the PSC connection.
1051 pub ip_version: std::option::Option<crate::model::IPVersion>,
1052
1053 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1054 }
1055
1056 impl ConsumerPscConnection {
1057 pub fn new() -> Self {
1058 std::default::Default::default()
1059 }
1060
1061 /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ConsumerPscConnection::service_attachment_uri].
1062 ///
1063 /// # Example
1064 /// ```ignore,no_run
1065 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1066 /// let x = ConsumerPscConnection::new().set_service_attachment_uri("example");
1067 /// ```
1068 pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
1069 mut self,
1070 v: T,
1071 ) -> Self {
1072 self.service_attachment_uri = v.into();
1073 self
1074 }
1075
1076 /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConnection::state].
1077 ///
1078 /// # Example
1079 /// ```ignore,no_run
1080 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1081 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::consumer_psc_connection::State;
1082 /// let x0 = ConsumerPscConnection::new().set_state(State::Active);
1083 /// let x1 = ConsumerPscConnection::new().set_state(State::Failed);
1084 /// let x2 = ConsumerPscConnection::new().set_state(State::Creating);
1085 /// ```
1086 pub fn set_state<
1087 T: std::convert::Into<
1088 crate::model::service_connection_map::consumer_psc_connection::State,
1089 >,
1090 >(
1091 mut self,
1092 v: T,
1093 ) -> Self {
1094 self.state = v.into();
1095 self
1096 }
1097
1098 /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConnection::project].
1099 ///
1100 /// # Example
1101 /// ```ignore,no_run
1102 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1103 /// let x = ConsumerPscConnection::new().set_project("example");
1104 /// ```
1105 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1106 self.project = v.into();
1107 self
1108 }
1109
1110 /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConnection::network].
1111 ///
1112 /// # Example
1113 /// ```ignore,no_run
1114 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1115 /// let x = ConsumerPscConnection::new().set_network("example");
1116 /// ```
1117 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1118 self.network = v.into();
1119 self
1120 }
1121
1122 /// Sets the value of [psc_connection_id][crate::model::service_connection_map::ConsumerPscConnection::psc_connection_id].
1123 ///
1124 /// # Example
1125 /// ```ignore,no_run
1126 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1127 /// let x = ConsumerPscConnection::new().set_psc_connection_id("example");
1128 /// ```
1129 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
1130 mut self,
1131 v: T,
1132 ) -> Self {
1133 self.psc_connection_id = v.into();
1134 self
1135 }
1136
1137 /// Sets the value of [ip][crate::model::service_connection_map::ConsumerPscConnection::ip].
1138 ///
1139 /// # Example
1140 /// ```ignore,no_run
1141 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1142 /// let x = ConsumerPscConnection::new().set_ip("example");
1143 /// ```
1144 pub fn set_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1145 self.ip = v.into();
1146 self
1147 }
1148
1149 /// Sets the value of [error_type][crate::model::service_connection_map::ConsumerPscConnection::error_type].
1150 ///
1151 /// # Example
1152 /// ```ignore,no_run
1153 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1154 /// use google_cloud_networkconnectivity_v1::model::ConnectionErrorType;
1155 /// let x0 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorInternal);
1156 /// let x1 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorConsumerSide);
1157 /// let x2 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorProducerSide);
1158 /// ```
1159 #[deprecated]
1160 pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
1161 mut self,
1162 v: T,
1163 ) -> Self {
1164 self.error_type = v.into();
1165 self
1166 }
1167
1168 /// Sets the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
1169 ///
1170 /// # Example
1171 /// ```ignore,no_run
1172 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1173 /// use google_cloud_rpc::model::Status;
1174 /// let x = ConsumerPscConnection::new().set_error(Status::default()/* use setters */);
1175 /// ```
1176 #[deprecated]
1177 pub fn set_error<T>(mut self, v: T) -> Self
1178 where
1179 T: std::convert::Into<google_cloud_rpc::model::Status>,
1180 {
1181 self.error = std::option::Option::Some(v.into());
1182 self
1183 }
1184
1185 /// Sets or clears the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
1186 ///
1187 /// # Example
1188 /// ```ignore,no_run
1189 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1190 /// use google_cloud_rpc::model::Status;
1191 /// let x = ConsumerPscConnection::new().set_or_clear_error(Some(Status::default()/* use setters */));
1192 /// let x = ConsumerPscConnection::new().set_or_clear_error(None::<Status>);
1193 /// ```
1194 #[deprecated]
1195 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1196 where
1197 T: std::convert::Into<google_cloud_rpc::model::Status>,
1198 {
1199 self.error = v.map(|x| x.into());
1200 self
1201 }
1202
1203 /// Sets the value of [gce_operation][crate::model::service_connection_map::ConsumerPscConnection::gce_operation].
1204 ///
1205 /// # Example
1206 /// ```ignore,no_run
1207 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1208 /// let x = ConsumerPscConnection::new().set_gce_operation("example");
1209 /// ```
1210 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
1211 mut self,
1212 v: T,
1213 ) -> Self {
1214 self.gce_operation = v.into();
1215 self
1216 }
1217
1218 /// Sets the value of [forwarding_rule][crate::model::service_connection_map::ConsumerPscConnection::forwarding_rule].
1219 ///
1220 /// # Example
1221 /// ```ignore,no_run
1222 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1223 /// let x = ConsumerPscConnection::new().set_forwarding_rule("example");
1224 /// ```
1225 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(
1226 mut self,
1227 v: T,
1228 ) -> Self {
1229 self.forwarding_rule = v.into();
1230 self
1231 }
1232
1233 /// Sets the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
1234 ///
1235 /// # Example
1236 /// ```ignore,no_run
1237 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1238 /// use google_cloud_rpc::model::ErrorInfo;
1239 /// let x = ConsumerPscConnection::new().set_error_info(ErrorInfo::default()/* use setters */);
1240 /// ```
1241 pub fn set_error_info<T>(mut self, v: T) -> Self
1242 where
1243 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
1244 {
1245 self.error_info = std::option::Option::Some(v.into());
1246 self
1247 }
1248
1249 /// Sets or clears the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
1250 ///
1251 /// # Example
1252 /// ```ignore,no_run
1253 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1254 /// use google_cloud_rpc::model::ErrorInfo;
1255 /// let x = ConsumerPscConnection::new().set_or_clear_error_info(Some(ErrorInfo::default()/* use setters */));
1256 /// let x = ConsumerPscConnection::new().set_or_clear_error_info(None::<ErrorInfo>);
1257 /// ```
1258 pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
1259 where
1260 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
1261 {
1262 self.error_info = v.map(|x| x.into());
1263 self
1264 }
1265
1266 /// Sets the value of [selected_subnetwork][crate::model::service_connection_map::ConsumerPscConnection::selected_subnetwork].
1267 ///
1268 /// # Example
1269 /// ```ignore,no_run
1270 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1271 /// let x = ConsumerPscConnection::new().set_selected_subnetwork("example");
1272 /// ```
1273 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
1274 mut self,
1275 v: T,
1276 ) -> Self {
1277 self.selected_subnetwork = v.into();
1278 self
1279 }
1280
1281 /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_id].
1282 ///
1283 /// # Example
1284 /// ```ignore,no_run
1285 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1286 /// let x = ConsumerPscConnection::new().set_producer_instance_id("example");
1287 /// ```
1288 #[deprecated]
1289 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
1290 mut self,
1291 v: T,
1292 ) -> Self {
1293 self.producer_instance_id = v.into();
1294 self
1295 }
1296
1297 /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_metadata].
1298 ///
1299 /// # Example
1300 /// ```ignore,no_run
1301 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1302 /// let x = ConsumerPscConnection::new().set_producer_instance_metadata([
1303 /// ("key0", "abc"),
1304 /// ("key1", "xyz"),
1305 /// ]);
1306 /// ```
1307 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
1308 where
1309 T: std::iter::IntoIterator<Item = (K, V)>,
1310 K: std::convert::Into<std::string::String>,
1311 V: std::convert::Into<std::string::String>,
1312 {
1313 use std::iter::Iterator;
1314 self.producer_instance_metadata =
1315 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1316 self
1317 }
1318
1319 /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
1320 ///
1321 /// # Example
1322 /// ```ignore,no_run
1323 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1324 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
1325 /// let x0 = ConsumerPscConnection::new().set_ip_version(IPVersion::Ipv4);
1326 /// let x1 = ConsumerPscConnection::new().set_ip_version(IPVersion::Ipv6);
1327 /// ```
1328 pub fn set_ip_version<T>(mut self, v: T) -> Self
1329 where
1330 T: std::convert::Into<crate::model::IPVersion>,
1331 {
1332 self.ip_version = std::option::Option::Some(v.into());
1333 self
1334 }
1335
1336 /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
1337 ///
1338 /// # Example
1339 /// ```ignore,no_run
1340 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1341 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
1342 /// let x0 = ConsumerPscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
1343 /// let x1 = ConsumerPscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
1344 /// let x_none = ConsumerPscConnection::new().set_or_clear_ip_version(None::<IPVersion>);
1345 /// ```
1346 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
1347 where
1348 T: std::convert::Into<crate::model::IPVersion>,
1349 {
1350 self.ip_version = v.map(|x| x.into());
1351 self
1352 }
1353 }
1354
1355 impl wkt::message::Message for ConsumerPscConnection {
1356 fn typename() -> &'static str {
1357 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection"
1358 }
1359 }
1360
1361 /// Defines additional types related to [ConsumerPscConnection].
1362 pub mod consumer_psc_connection {
1363 #[allow(unused_imports)]
1364 use super::*;
1365
1366 /// The state of the PSC connection.
1367 /// We reserve the right to add more states without notice in the future.
1368 /// Users should not use exhaustive switch statements on this enum.
1369 /// See <https://google.aip.dev/216>.
1370 ///
1371 /// # Working with unknown values
1372 ///
1373 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1374 /// additional enum variants at any time. Adding new variants is not considered
1375 /// a breaking change. Applications should write their code in anticipation of:
1376 ///
1377 /// - New values appearing in future releases of the client library, **and**
1378 /// - New values received dynamically, without application changes.
1379 ///
1380 /// Please consult the [Working with enums] section in the user guide for some
1381 /// guidelines.
1382 ///
1383 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1384 #[derive(Clone, Debug, PartialEq)]
1385 #[non_exhaustive]
1386 pub enum State {
1387 /// An invalid state as the default case.
1388 Unspecified,
1389 /// The connection has been created successfully. However, for the
1390 /// up-to-date connection status, please use the service attachment's
1391 /// "ConnectedEndpoint.status" as the source of truth.
1392 Active,
1393 /// The connection is not functional since some resources on the connection
1394 /// fail to be created.
1395 Failed,
1396 /// The connection is being created.
1397 Creating,
1398 /// The connection is being deleted.
1399 Deleting,
1400 /// The connection is being repaired to complete creation.
1401 CreateRepairing,
1402 /// The connection is being repaired to complete deletion.
1403 DeleteRepairing,
1404 /// If set, the enum was initialized with an unknown value.
1405 ///
1406 /// Applications can examine the value using [State::value] or
1407 /// [State::name].
1408 UnknownValue(state::UnknownValue),
1409 }
1410
1411 #[doc(hidden)]
1412 pub mod state {
1413 #[allow(unused_imports)]
1414 use super::*;
1415 #[derive(Clone, Debug, PartialEq)]
1416 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1417 }
1418
1419 impl State {
1420 /// Gets the enum value.
1421 ///
1422 /// Returns `None` if the enum contains an unknown value deserialized from
1423 /// the string representation of enums.
1424 pub fn value(&self) -> std::option::Option<i32> {
1425 match self {
1426 Self::Unspecified => std::option::Option::Some(0),
1427 Self::Active => std::option::Option::Some(1),
1428 Self::Failed => std::option::Option::Some(2),
1429 Self::Creating => std::option::Option::Some(3),
1430 Self::Deleting => std::option::Option::Some(4),
1431 Self::CreateRepairing => std::option::Option::Some(5),
1432 Self::DeleteRepairing => std::option::Option::Some(6),
1433 Self::UnknownValue(u) => u.0.value(),
1434 }
1435 }
1436
1437 /// Gets the enum value as a string.
1438 ///
1439 /// Returns `None` if the enum contains an unknown value deserialized from
1440 /// the integer representation of enums.
1441 pub fn name(&self) -> std::option::Option<&str> {
1442 match self {
1443 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1444 Self::Active => std::option::Option::Some("ACTIVE"),
1445 Self::Failed => std::option::Option::Some("FAILED"),
1446 Self::Creating => std::option::Option::Some("CREATING"),
1447 Self::Deleting => std::option::Option::Some("DELETING"),
1448 Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
1449 Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
1450 Self::UnknownValue(u) => u.0.name(),
1451 }
1452 }
1453 }
1454
1455 impl std::default::Default for State {
1456 fn default() -> Self {
1457 use std::convert::From;
1458 Self::from(0)
1459 }
1460 }
1461
1462 impl std::fmt::Display for State {
1463 fn fmt(
1464 &self,
1465 f: &mut std::fmt::Formatter<'_>,
1466 ) -> std::result::Result<(), std::fmt::Error> {
1467 wkt::internal::display_enum(f, self.name(), self.value())
1468 }
1469 }
1470
1471 impl std::convert::From<i32> for State {
1472 fn from(value: i32) -> Self {
1473 match value {
1474 0 => Self::Unspecified,
1475 1 => Self::Active,
1476 2 => Self::Failed,
1477 3 => Self::Creating,
1478 4 => Self::Deleting,
1479 5 => Self::CreateRepairing,
1480 6 => Self::DeleteRepairing,
1481 _ => Self::UnknownValue(state::UnknownValue(
1482 wkt::internal::UnknownEnumValue::Integer(value),
1483 )),
1484 }
1485 }
1486 }
1487
1488 impl std::convert::From<&str> for State {
1489 fn from(value: &str) -> Self {
1490 use std::string::ToString;
1491 match value {
1492 "STATE_UNSPECIFIED" => Self::Unspecified,
1493 "ACTIVE" => Self::Active,
1494 "FAILED" => Self::Failed,
1495 "CREATING" => Self::Creating,
1496 "DELETING" => Self::Deleting,
1497 "CREATE_REPAIRING" => Self::CreateRepairing,
1498 "DELETE_REPAIRING" => Self::DeleteRepairing,
1499 _ => Self::UnknownValue(state::UnknownValue(
1500 wkt::internal::UnknownEnumValue::String(value.to_string()),
1501 )),
1502 }
1503 }
1504 }
1505
1506 impl serde::ser::Serialize for State {
1507 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1508 where
1509 S: serde::Serializer,
1510 {
1511 match self {
1512 Self::Unspecified => serializer.serialize_i32(0),
1513 Self::Active => serializer.serialize_i32(1),
1514 Self::Failed => serializer.serialize_i32(2),
1515 Self::Creating => serializer.serialize_i32(3),
1516 Self::Deleting => serializer.serialize_i32(4),
1517 Self::CreateRepairing => serializer.serialize_i32(5),
1518 Self::DeleteRepairing => serializer.serialize_i32(6),
1519 Self::UnknownValue(u) => u.0.serialize(serializer),
1520 }
1521 }
1522 }
1523
1524 impl<'de> serde::de::Deserialize<'de> for State {
1525 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1526 where
1527 D: serde::Deserializer<'de>,
1528 {
1529 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1530 ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection.State"))
1531 }
1532 }
1533 }
1534}
1535
1536/// Request for ListServiceConnectionMaps.
1537#[derive(Clone, Default, PartialEq)]
1538#[non_exhaustive]
1539pub struct ListServiceConnectionMapsRequest {
1540 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
1541 pub parent: std::string::String,
1542
1543 /// The maximum number of results per page that should be returned.
1544 pub page_size: i32,
1545
1546 /// The page token.
1547 pub page_token: std::string::String,
1548
1549 /// A filter expression that filters the results listed in the response.
1550 pub filter: std::string::String,
1551
1552 /// Sort the results by a certain order.
1553 pub order_by: std::string::String,
1554
1555 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1556}
1557
1558impl ListServiceConnectionMapsRequest {
1559 pub fn new() -> Self {
1560 std::default::Default::default()
1561 }
1562
1563 /// Sets the value of [parent][crate::model::ListServiceConnectionMapsRequest::parent].
1564 ///
1565 /// # Example
1566 /// ```ignore,no_run
1567 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1568 /// let x = ListServiceConnectionMapsRequest::new().set_parent("example");
1569 /// ```
1570 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1571 self.parent = v.into();
1572 self
1573 }
1574
1575 /// Sets the value of [page_size][crate::model::ListServiceConnectionMapsRequest::page_size].
1576 ///
1577 /// # Example
1578 /// ```ignore,no_run
1579 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1580 /// let x = ListServiceConnectionMapsRequest::new().set_page_size(42);
1581 /// ```
1582 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1583 self.page_size = v.into();
1584 self
1585 }
1586
1587 /// Sets the value of [page_token][crate::model::ListServiceConnectionMapsRequest::page_token].
1588 ///
1589 /// # Example
1590 /// ```ignore,no_run
1591 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1592 /// let x = ListServiceConnectionMapsRequest::new().set_page_token("example");
1593 /// ```
1594 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1595 self.page_token = v.into();
1596 self
1597 }
1598
1599 /// Sets the value of [filter][crate::model::ListServiceConnectionMapsRequest::filter].
1600 ///
1601 /// # Example
1602 /// ```ignore,no_run
1603 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1604 /// let x = ListServiceConnectionMapsRequest::new().set_filter("example");
1605 /// ```
1606 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1607 self.filter = v.into();
1608 self
1609 }
1610
1611 /// Sets the value of [order_by][crate::model::ListServiceConnectionMapsRequest::order_by].
1612 ///
1613 /// # Example
1614 /// ```ignore,no_run
1615 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1616 /// let x = ListServiceConnectionMapsRequest::new().set_order_by("example");
1617 /// ```
1618 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1619 self.order_by = v.into();
1620 self
1621 }
1622}
1623
1624impl wkt::message::Message for ListServiceConnectionMapsRequest {
1625 fn typename() -> &'static str {
1626 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsRequest"
1627 }
1628}
1629
1630/// Response for ListServiceConnectionMaps.
1631#[derive(Clone, Default, PartialEq)]
1632#[non_exhaustive]
1633pub struct ListServiceConnectionMapsResponse {
1634 /// ServiceConnectionMaps to be returned.
1635 pub service_connection_maps: std::vec::Vec<crate::model::ServiceConnectionMap>,
1636
1637 /// The next pagination token in the List response. It should be used as
1638 /// page_token for the following request. An empty value means no more result.
1639 pub next_page_token: std::string::String,
1640
1641 /// Locations that could not be reached.
1642 pub unreachable: std::vec::Vec<std::string::String>,
1643
1644 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1645}
1646
1647impl ListServiceConnectionMapsResponse {
1648 pub fn new() -> Self {
1649 std::default::Default::default()
1650 }
1651
1652 /// Sets the value of [service_connection_maps][crate::model::ListServiceConnectionMapsResponse::service_connection_maps].
1653 ///
1654 /// # Example
1655 /// ```ignore,no_run
1656 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1657 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1658 /// let x = ListServiceConnectionMapsResponse::new()
1659 /// .set_service_connection_maps([
1660 /// ServiceConnectionMap::default()/* use setters */,
1661 /// ServiceConnectionMap::default()/* use (different) setters */,
1662 /// ]);
1663 /// ```
1664 pub fn set_service_connection_maps<T, V>(mut self, v: T) -> Self
1665 where
1666 T: std::iter::IntoIterator<Item = V>,
1667 V: std::convert::Into<crate::model::ServiceConnectionMap>,
1668 {
1669 use std::iter::Iterator;
1670 self.service_connection_maps = v.into_iter().map(|i| i.into()).collect();
1671 self
1672 }
1673
1674 /// Sets the value of [next_page_token][crate::model::ListServiceConnectionMapsResponse::next_page_token].
1675 ///
1676 /// # Example
1677 /// ```ignore,no_run
1678 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1679 /// let x = ListServiceConnectionMapsResponse::new().set_next_page_token("example");
1680 /// ```
1681 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1682 self.next_page_token = v.into();
1683 self
1684 }
1685
1686 /// Sets the value of [unreachable][crate::model::ListServiceConnectionMapsResponse::unreachable].
1687 ///
1688 /// # Example
1689 /// ```ignore,no_run
1690 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1691 /// let x = ListServiceConnectionMapsResponse::new().set_unreachable(["a", "b", "c"]);
1692 /// ```
1693 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1694 where
1695 T: std::iter::IntoIterator<Item = V>,
1696 V: std::convert::Into<std::string::String>,
1697 {
1698 use std::iter::Iterator;
1699 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1700 self
1701 }
1702}
1703
1704impl wkt::message::Message for ListServiceConnectionMapsResponse {
1705 fn typename() -> &'static str {
1706 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsResponse"
1707 }
1708}
1709
1710#[doc(hidden)]
1711impl google_cloud_gax::paginator::internal::PageableResponse for ListServiceConnectionMapsResponse {
1712 type PageItem = crate::model::ServiceConnectionMap;
1713
1714 fn items(self) -> std::vec::Vec<Self::PageItem> {
1715 self.service_connection_maps
1716 }
1717
1718 fn next_page_token(&self) -> std::string::String {
1719 use std::clone::Clone;
1720 self.next_page_token.clone()
1721 }
1722}
1723
1724/// Request for GetServiceConnectionMap.
1725#[derive(Clone, Default, PartialEq)]
1726#[non_exhaustive]
1727pub struct GetServiceConnectionMapRequest {
1728 /// Required. Name of the ServiceConnectionMap to get.
1729 pub name: std::string::String,
1730
1731 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1732}
1733
1734impl GetServiceConnectionMapRequest {
1735 pub fn new() -> Self {
1736 std::default::Default::default()
1737 }
1738
1739 /// Sets the value of [name][crate::model::GetServiceConnectionMapRequest::name].
1740 ///
1741 /// # Example
1742 /// ```ignore,no_run
1743 /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionMapRequest;
1744 /// let x = GetServiceConnectionMapRequest::new().set_name("example");
1745 /// ```
1746 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1747 self.name = v.into();
1748 self
1749 }
1750}
1751
1752impl wkt::message::Message for GetServiceConnectionMapRequest {
1753 fn typename() -> &'static str {
1754 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionMapRequest"
1755 }
1756}
1757
1758/// Request for CreateServiceConnectionMap.
1759#[derive(Clone, Default, PartialEq)]
1760#[non_exhaustive]
1761pub struct CreateServiceConnectionMapRequest {
1762 /// Required. The parent resource's name of the ServiceConnectionMap. ex.
1763 /// projects/123/locations/us-east1
1764 pub parent: std::string::String,
1765
1766 /// Optional. Resource ID
1767 /// (i.e. 'foo' in '[...]/projects/p/locations/l/serviceConnectionMaps/foo')
1768 /// See <https://google.aip.dev/122#resource-id-segments>
1769 /// Unique per location.
1770 /// If one is not provided, one will be generated.
1771 pub service_connection_map_id: std::string::String,
1772
1773 /// Required. Initial values for a new ServiceConnectionMaps
1774 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1775
1776 /// Optional. An optional request ID to identify requests. Specify a unique
1777 /// request ID so that if you must retry your request, the server will know to
1778 /// ignore the request if it has already been completed. The server will
1779 /// guarantee that for at least 60 minutes since the first request.
1780 ///
1781 /// For example, consider a situation where you make an initial request and
1782 /// the request times out. If you make the request again with the same request
1783 /// ID, the server can check if original operation with the same request ID
1784 /// was received, and if so, will ignore the second request. This prevents
1785 /// clients from accidentally creating duplicate commitments.
1786 ///
1787 /// The request ID must be a valid UUID with the exception that zero UUID is
1788 /// not supported (00000000-0000-0000-0000-000000000000).
1789 pub request_id: std::string::String,
1790
1791 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1792}
1793
1794impl CreateServiceConnectionMapRequest {
1795 pub fn new() -> Self {
1796 std::default::Default::default()
1797 }
1798
1799 /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
1800 ///
1801 /// # Example
1802 /// ```ignore,no_run
1803 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1804 /// let x = CreateServiceConnectionMapRequest::new().set_parent("example");
1805 /// ```
1806 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1807 self.parent = v.into();
1808 self
1809 }
1810
1811 /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
1812 ///
1813 /// # Example
1814 /// ```ignore,no_run
1815 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1816 /// let x = CreateServiceConnectionMapRequest::new().set_service_connection_map_id("example");
1817 /// ```
1818 pub fn set_service_connection_map_id<T: std::convert::Into<std::string::String>>(
1819 mut self,
1820 v: T,
1821 ) -> Self {
1822 self.service_connection_map_id = v.into();
1823 self
1824 }
1825
1826 /// Sets the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
1827 ///
1828 /// # Example
1829 /// ```ignore,no_run
1830 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1831 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1832 /// let x = CreateServiceConnectionMapRequest::new().set_service_connection_map(ServiceConnectionMap::default()/* use setters */);
1833 /// ```
1834 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1835 where
1836 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1837 {
1838 self.service_connection_map = std::option::Option::Some(v.into());
1839 self
1840 }
1841
1842 /// Sets or clears the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
1843 ///
1844 /// # Example
1845 /// ```ignore,no_run
1846 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1847 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1848 /// let x = CreateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(Some(ServiceConnectionMap::default()/* use setters */));
1849 /// let x = CreateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(None::<ServiceConnectionMap>);
1850 /// ```
1851 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1852 where
1853 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1854 {
1855 self.service_connection_map = v.map(|x| x.into());
1856 self
1857 }
1858
1859 /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
1860 ///
1861 /// # Example
1862 /// ```ignore,no_run
1863 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1864 /// let x = CreateServiceConnectionMapRequest::new().set_request_id("example");
1865 /// ```
1866 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1867 self.request_id = v.into();
1868 self
1869 }
1870}
1871
1872impl wkt::message::Message for CreateServiceConnectionMapRequest {
1873 fn typename() -> &'static str {
1874 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionMapRequest"
1875 }
1876}
1877
1878/// Request for UpdateServiceConnectionMap.
1879#[derive(Clone, Default, PartialEq)]
1880#[non_exhaustive]
1881pub struct UpdateServiceConnectionMapRequest {
1882 /// Optional. Field mask is used to specify the fields to be overwritten in the
1883 /// ServiceConnectionMap resource by the update.
1884 /// The fields specified in the update_mask are relative to the resource, not
1885 /// the full request. A field will be overwritten if it is in the mask. If the
1886 /// user does not provide a mask then all fields will be overwritten.
1887 pub update_mask: std::option::Option<wkt::FieldMask>,
1888
1889 /// Required. New values to be patched into the resource.
1890 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1891
1892 /// Optional. An optional request ID to identify requests. Specify a unique
1893 /// request ID so that if you must retry your request, the server will know to
1894 /// ignore the request if it has already been completed. The server will
1895 /// guarantee that for at least 60 minutes since the first request.
1896 ///
1897 /// For example, consider a situation where you make an initial request and
1898 /// the request times out. If you make the request again with the same request
1899 /// ID, the server can check if original operation with the same request ID
1900 /// was received, and if so, will ignore the second request. This prevents
1901 /// clients from accidentally creating duplicate commitments.
1902 ///
1903 /// The request ID must be a valid UUID with the exception that zero UUID is
1904 /// not supported (00000000-0000-0000-0000-000000000000).
1905 pub request_id: std::string::String,
1906
1907 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1908}
1909
1910impl UpdateServiceConnectionMapRequest {
1911 pub fn new() -> Self {
1912 std::default::Default::default()
1913 }
1914
1915 /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1916 ///
1917 /// # Example
1918 /// ```ignore,no_run
1919 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1920 /// use wkt::FieldMask;
1921 /// let x = UpdateServiceConnectionMapRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1922 /// ```
1923 pub fn set_update_mask<T>(mut self, v: T) -> Self
1924 where
1925 T: std::convert::Into<wkt::FieldMask>,
1926 {
1927 self.update_mask = std::option::Option::Some(v.into());
1928 self
1929 }
1930
1931 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1932 ///
1933 /// # Example
1934 /// ```ignore,no_run
1935 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1936 /// use wkt::FieldMask;
1937 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1938 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1939 /// ```
1940 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1941 where
1942 T: std::convert::Into<wkt::FieldMask>,
1943 {
1944 self.update_mask = v.map(|x| x.into());
1945 self
1946 }
1947
1948 /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1949 ///
1950 /// # Example
1951 /// ```ignore,no_run
1952 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1953 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1954 /// let x = UpdateServiceConnectionMapRequest::new().set_service_connection_map(ServiceConnectionMap::default()/* use setters */);
1955 /// ```
1956 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1957 where
1958 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1959 {
1960 self.service_connection_map = std::option::Option::Some(v.into());
1961 self
1962 }
1963
1964 /// Sets or clears the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1965 ///
1966 /// # Example
1967 /// ```ignore,no_run
1968 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1969 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1970 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(Some(ServiceConnectionMap::default()/* use setters */));
1971 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(None::<ServiceConnectionMap>);
1972 /// ```
1973 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1974 where
1975 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1976 {
1977 self.service_connection_map = v.map(|x| x.into());
1978 self
1979 }
1980
1981 /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
1982 ///
1983 /// # Example
1984 /// ```ignore,no_run
1985 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1986 /// let x = UpdateServiceConnectionMapRequest::new().set_request_id("example");
1987 /// ```
1988 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1989 self.request_id = v.into();
1990 self
1991 }
1992}
1993
1994impl wkt::message::Message for UpdateServiceConnectionMapRequest {
1995 fn typename() -> &'static str {
1996 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionMapRequest"
1997 }
1998}
1999
2000/// Request for DeleteServiceConnectionMap.
2001#[derive(Clone, Default, PartialEq)]
2002#[non_exhaustive]
2003pub struct DeleteServiceConnectionMapRequest {
2004 /// Required. The name of the ServiceConnectionMap to delete.
2005 pub name: std::string::String,
2006
2007 /// Optional. An optional request ID to identify requests. Specify a unique
2008 /// request ID so that if you must retry your request, the server will know to
2009 /// ignore the request if it has already been completed. The server will
2010 /// guarantee that for at least 60 minutes after the first request.
2011 ///
2012 /// For example, consider a situation where you make an initial request and
2013 /// the request times out. If you make the request again with the same request
2014 /// ID, the server can check if original operation with the same request ID
2015 /// was received, and if so, will ignore the second request. This prevents
2016 /// clients from accidentally creating duplicate commitments.
2017 ///
2018 /// The request ID must be a valid UUID with the exception that zero UUID is
2019 /// not supported (00000000-0000-0000-0000-000000000000).
2020 pub request_id: std::string::String,
2021
2022 /// Optional. The etag is computed by the server, and may be sent on update and
2023 /// delete requests to ensure the client has an up-to-date value before
2024 /// proceeding.
2025 pub etag: std::option::Option<std::string::String>,
2026
2027 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2028}
2029
2030impl DeleteServiceConnectionMapRequest {
2031 pub fn new() -> Self {
2032 std::default::Default::default()
2033 }
2034
2035 /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
2036 ///
2037 /// # Example
2038 /// ```ignore,no_run
2039 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2040 /// let x = DeleteServiceConnectionMapRequest::new().set_name("example");
2041 /// ```
2042 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2043 self.name = v.into();
2044 self
2045 }
2046
2047 /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
2048 ///
2049 /// # Example
2050 /// ```ignore,no_run
2051 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2052 /// let x = DeleteServiceConnectionMapRequest::new().set_request_id("example");
2053 /// ```
2054 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2055 self.request_id = v.into();
2056 self
2057 }
2058
2059 /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
2060 ///
2061 /// # Example
2062 /// ```ignore,no_run
2063 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2064 /// let x = DeleteServiceConnectionMapRequest::new().set_etag("example");
2065 /// ```
2066 pub fn set_etag<T>(mut self, v: T) -> Self
2067 where
2068 T: std::convert::Into<std::string::String>,
2069 {
2070 self.etag = std::option::Option::Some(v.into());
2071 self
2072 }
2073
2074 /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
2075 ///
2076 /// # Example
2077 /// ```ignore,no_run
2078 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2079 /// let x = DeleteServiceConnectionMapRequest::new().set_or_clear_etag(Some("example"));
2080 /// let x = DeleteServiceConnectionMapRequest::new().set_or_clear_etag(None::<String>);
2081 /// ```
2082 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2083 where
2084 T: std::convert::Into<std::string::String>,
2085 {
2086 self.etag = v.map(|x| x.into());
2087 self
2088 }
2089}
2090
2091impl wkt::message::Message for DeleteServiceConnectionMapRequest {
2092 fn typename() -> &'static str {
2093 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionMapRequest"
2094 }
2095}
2096
2097/// The ServiceConnectionPolicy resource.
2098#[derive(Clone, Default, PartialEq)]
2099#[non_exhaustive]
2100pub struct ServiceConnectionPolicy {
2101 /// Immutable. The name of a ServiceConnectionPolicy.
2102 /// Format:
2103 /// projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy}
2104 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
2105 pub name: std::string::String,
2106
2107 /// Output only. Time when the ServiceConnectionPolicy was created.
2108 pub create_time: std::option::Option<wkt::Timestamp>,
2109
2110 /// Output only. Time when the ServiceConnectionPolicy was updated.
2111 pub update_time: std::option::Option<wkt::Timestamp>,
2112
2113 /// User-defined labels.
2114 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2115
2116 /// A description of this resource.
2117 pub description: std::string::String,
2118
2119 /// The resource path of the consumer network.
2120 /// Example:
2121 ///
2122 /// - projects/{projectNumOrId}/global/networks/{resourceId}.
2123 pub network: std::string::String,
2124
2125 /// The service class identifier for which this ServiceConnectionPolicy is for.
2126 /// The service class identifier is a unique, symbolic representation of a
2127 /// ServiceClass. It is provided by the Service Producer. Google services have
2128 /// a prefix of gcp or google-cloud. For example, gcp-memorystore-redis or
2129 /// google-cloud-sql. 3rd party services do not. For example,
2130 /// test-service-a3dfcx.
2131 pub service_class: std::string::String,
2132
2133 /// Output only. The type of underlying resources used to create the
2134 /// connection.
2135 pub infrastructure: crate::model::Infrastructure,
2136
2137 /// Configuration used for Private Service Connect connections. Used when
2138 /// Infrastructure is PSC.
2139 pub psc_config: std::option::Option<crate::model::service_connection_policy::PscConfig>,
2140
2141 /// Output only. [Output only] Information about each Private Service Connect
2142 /// connection.
2143 pub psc_connections: std::vec::Vec<crate::model::service_connection_policy::PscConnection>,
2144
2145 /// Optional. The etag is computed by the server, and may be sent on update and
2146 /// delete requests to ensure the client has an up-to-date value before
2147 /// proceeding.
2148 pub etag: std::option::Option<std::string::String>,
2149
2150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2151}
2152
2153impl ServiceConnectionPolicy {
2154 pub fn new() -> Self {
2155 std::default::Default::default()
2156 }
2157
2158 /// Sets the value of [name][crate::model::ServiceConnectionPolicy::name].
2159 ///
2160 /// # Example
2161 /// ```ignore,no_run
2162 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2163 /// let x = ServiceConnectionPolicy::new().set_name("example");
2164 /// ```
2165 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2166 self.name = v.into();
2167 self
2168 }
2169
2170 /// Sets the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
2171 ///
2172 /// # Example
2173 /// ```ignore,no_run
2174 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2175 /// use wkt::Timestamp;
2176 /// let x = ServiceConnectionPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2177 /// ```
2178 pub fn set_create_time<T>(mut self, v: T) -> Self
2179 where
2180 T: std::convert::Into<wkt::Timestamp>,
2181 {
2182 self.create_time = std::option::Option::Some(v.into());
2183 self
2184 }
2185
2186 /// Sets or clears the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
2187 ///
2188 /// # Example
2189 /// ```ignore,no_run
2190 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2191 /// use wkt::Timestamp;
2192 /// let x = ServiceConnectionPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2193 /// let x = ServiceConnectionPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2194 /// ```
2195 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2196 where
2197 T: std::convert::Into<wkt::Timestamp>,
2198 {
2199 self.create_time = v.map(|x| x.into());
2200 self
2201 }
2202
2203 /// Sets the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
2204 ///
2205 /// # Example
2206 /// ```ignore,no_run
2207 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2208 /// use wkt::Timestamp;
2209 /// let x = ServiceConnectionPolicy::new().set_update_time(Timestamp::default()/* use setters */);
2210 /// ```
2211 pub fn set_update_time<T>(mut self, v: T) -> Self
2212 where
2213 T: std::convert::Into<wkt::Timestamp>,
2214 {
2215 self.update_time = std::option::Option::Some(v.into());
2216 self
2217 }
2218
2219 /// Sets or clears the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
2220 ///
2221 /// # Example
2222 /// ```ignore,no_run
2223 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2224 /// use wkt::Timestamp;
2225 /// let x = ServiceConnectionPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2226 /// let x = ServiceConnectionPolicy::new().set_or_clear_update_time(None::<Timestamp>);
2227 /// ```
2228 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2229 where
2230 T: std::convert::Into<wkt::Timestamp>,
2231 {
2232 self.update_time = v.map(|x| x.into());
2233 self
2234 }
2235
2236 /// Sets the value of [labels][crate::model::ServiceConnectionPolicy::labels].
2237 ///
2238 /// # Example
2239 /// ```ignore,no_run
2240 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2241 /// let x = ServiceConnectionPolicy::new().set_labels([
2242 /// ("key0", "abc"),
2243 /// ("key1", "xyz"),
2244 /// ]);
2245 /// ```
2246 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2247 where
2248 T: std::iter::IntoIterator<Item = (K, V)>,
2249 K: std::convert::Into<std::string::String>,
2250 V: std::convert::Into<std::string::String>,
2251 {
2252 use std::iter::Iterator;
2253 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2254 self
2255 }
2256
2257 /// Sets the value of [description][crate::model::ServiceConnectionPolicy::description].
2258 ///
2259 /// # Example
2260 /// ```ignore,no_run
2261 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2262 /// let x = ServiceConnectionPolicy::new().set_description("example");
2263 /// ```
2264 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2265 self.description = v.into();
2266 self
2267 }
2268
2269 /// Sets the value of [network][crate::model::ServiceConnectionPolicy::network].
2270 ///
2271 /// # Example
2272 /// ```ignore,no_run
2273 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2274 /// let x = ServiceConnectionPolicy::new().set_network("example");
2275 /// ```
2276 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2277 self.network = v.into();
2278 self
2279 }
2280
2281 /// Sets the value of [service_class][crate::model::ServiceConnectionPolicy::service_class].
2282 ///
2283 /// # Example
2284 /// ```ignore,no_run
2285 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2286 /// let x = ServiceConnectionPolicy::new().set_service_class("example");
2287 /// ```
2288 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2289 self.service_class = v.into();
2290 self
2291 }
2292
2293 /// Sets the value of [infrastructure][crate::model::ServiceConnectionPolicy::infrastructure].
2294 ///
2295 /// # Example
2296 /// ```ignore,no_run
2297 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2298 /// use google_cloud_networkconnectivity_v1::model::Infrastructure;
2299 /// let x0 = ServiceConnectionPolicy::new().set_infrastructure(Infrastructure::Psc);
2300 /// ```
2301 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
2302 mut self,
2303 v: T,
2304 ) -> Self {
2305 self.infrastructure = v.into();
2306 self
2307 }
2308
2309 /// Sets the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
2310 ///
2311 /// # Example
2312 /// ```ignore,no_run
2313 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2314 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2315 /// let x = ServiceConnectionPolicy::new().set_psc_config(PscConfig::default()/* use setters */);
2316 /// ```
2317 pub fn set_psc_config<T>(mut self, v: T) -> Self
2318 where
2319 T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
2320 {
2321 self.psc_config = std::option::Option::Some(v.into());
2322 self
2323 }
2324
2325 /// Sets or clears the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
2326 ///
2327 /// # Example
2328 /// ```ignore,no_run
2329 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2330 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2331 /// let x = ServiceConnectionPolicy::new().set_or_clear_psc_config(Some(PscConfig::default()/* use setters */));
2332 /// let x = ServiceConnectionPolicy::new().set_or_clear_psc_config(None::<PscConfig>);
2333 /// ```
2334 pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
2335 where
2336 T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
2337 {
2338 self.psc_config = v.map(|x| x.into());
2339 self
2340 }
2341
2342 /// Sets the value of [psc_connections][crate::model::ServiceConnectionPolicy::psc_connections].
2343 ///
2344 /// # Example
2345 /// ```ignore,no_run
2346 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2347 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2348 /// let x = ServiceConnectionPolicy::new()
2349 /// .set_psc_connections([
2350 /// PscConnection::default()/* use setters */,
2351 /// PscConnection::default()/* use (different) setters */,
2352 /// ]);
2353 /// ```
2354 pub fn set_psc_connections<T, V>(mut self, v: T) -> Self
2355 where
2356 T: std::iter::IntoIterator<Item = V>,
2357 V: std::convert::Into<crate::model::service_connection_policy::PscConnection>,
2358 {
2359 use std::iter::Iterator;
2360 self.psc_connections = v.into_iter().map(|i| i.into()).collect();
2361 self
2362 }
2363
2364 /// Sets the value of [etag][crate::model::ServiceConnectionPolicy::etag].
2365 ///
2366 /// # Example
2367 /// ```ignore,no_run
2368 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2369 /// let x = ServiceConnectionPolicy::new().set_etag("example");
2370 /// ```
2371 pub fn set_etag<T>(mut self, v: T) -> Self
2372 where
2373 T: std::convert::Into<std::string::String>,
2374 {
2375 self.etag = std::option::Option::Some(v.into());
2376 self
2377 }
2378
2379 /// Sets or clears the value of [etag][crate::model::ServiceConnectionPolicy::etag].
2380 ///
2381 /// # Example
2382 /// ```ignore,no_run
2383 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2384 /// let x = ServiceConnectionPolicy::new().set_or_clear_etag(Some("example"));
2385 /// let x = ServiceConnectionPolicy::new().set_or_clear_etag(None::<String>);
2386 /// ```
2387 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2388 where
2389 T: std::convert::Into<std::string::String>,
2390 {
2391 self.etag = v.map(|x| x.into());
2392 self
2393 }
2394}
2395
2396impl wkt::message::Message for ServiceConnectionPolicy {
2397 fn typename() -> &'static str {
2398 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy"
2399 }
2400}
2401
2402/// Defines additional types related to [ServiceConnectionPolicy].
2403pub mod service_connection_policy {
2404 #[allow(unused_imports)]
2405 use super::*;
2406
2407 /// Configuration used for Private Service Connect connections. Used when
2408 /// Infrastructure is PSC.
2409 #[derive(Clone, Default, PartialEq)]
2410 #[non_exhaustive]
2411 pub struct PscConfig {
2412 /// The resource paths of subnetworks to use for IP address management.
2413 /// Example:
2414 /// projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}.
2415 pub subnetworks: std::vec::Vec<std::string::String>,
2416
2417 /// Optional. Max number of PSC connections for this policy.
2418 pub limit: std::option::Option<i64>,
2419
2420 /// Required. ProducerInstanceLocation is used to specify which authorization
2421 /// mechanism to use to determine which projects the Producer instance can be
2422 /// within.
2423 pub producer_instance_location:
2424 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
2425
2426 /// Optional. List of Projects, Folders, or Organizations from where the
2427 /// Producer instance can be within. For example, a network administrator can
2428 /// provide both 'organizations/foo' and 'projects/bar' as
2429 /// allowed_google_producers_resource_hierarchy_levels. This allowlists this
2430 /// network to connect with any Producer instance within the 'foo'
2431 /// organization or the 'bar' project. By default,
2432 /// allowed_google_producers_resource_hierarchy_level is empty. The format
2433 /// for each allowed_google_producers_resource_hierarchy_level is \<resource
2434 /// type\>/\<id\> where <resource type\> is one of 'projects', 'folders', or
2435 /// 'organizations' and \<id\> is either the ID or the number of the resource
2436 /// type. Format for each allowed_google_producers_resource_hierarchy_level
2437 /// value: 'projects/<project_id_or_number>' or 'folders/<folder_id>' or
2438 /// 'organizations/<organization_id>'
2439 /// Eg. [projects/my-project-id, projects/567, folders/891,
2440 /// organizations/123]
2441 pub allowed_google_producers_resource_hierarchy_level: std::vec::Vec<std::string::String>,
2442
2443 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2444 }
2445
2446 impl PscConfig {
2447 pub fn new() -> Self {
2448 std::default::Default::default()
2449 }
2450
2451 /// Sets the value of [subnetworks][crate::model::service_connection_policy::PscConfig::subnetworks].
2452 ///
2453 /// # Example
2454 /// ```ignore,no_run
2455 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2456 /// let x = PscConfig::new().set_subnetworks(["a", "b", "c"]);
2457 /// ```
2458 pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
2459 where
2460 T: std::iter::IntoIterator<Item = V>,
2461 V: std::convert::Into<std::string::String>,
2462 {
2463 use std::iter::Iterator;
2464 self.subnetworks = v.into_iter().map(|i| i.into()).collect();
2465 self
2466 }
2467
2468 /// Sets the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
2469 ///
2470 /// # Example
2471 /// ```ignore,no_run
2472 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2473 /// let x = PscConfig::new().set_limit(42);
2474 /// ```
2475 pub fn set_limit<T>(mut self, v: T) -> Self
2476 where
2477 T: std::convert::Into<i64>,
2478 {
2479 self.limit = std::option::Option::Some(v.into());
2480 self
2481 }
2482
2483 /// Sets or clears the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
2484 ///
2485 /// # Example
2486 /// ```ignore,no_run
2487 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2488 /// let x = PscConfig::new().set_or_clear_limit(Some(42));
2489 /// let x = PscConfig::new().set_or_clear_limit(None::<i32>);
2490 /// ```
2491 pub fn set_or_clear_limit<T>(mut self, v: std::option::Option<T>) -> Self
2492 where
2493 T: std::convert::Into<i64>,
2494 {
2495 self.limit = v.map(|x| x.into());
2496 self
2497 }
2498
2499 /// Sets the value of [producer_instance_location][crate::model::service_connection_policy::PscConfig::producer_instance_location].
2500 ///
2501 /// # Example
2502 /// ```ignore,no_run
2503 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2504 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::psc_config::ProducerInstanceLocation;
2505 /// let x0 = PscConfig::new().set_producer_instance_location(ProducerInstanceLocation::CustomResourceHierarchyLevels);
2506 /// ```
2507 pub fn set_producer_instance_location<
2508 T: std::convert::Into<
2509 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
2510 >,
2511 >(
2512 mut self,
2513 v: T,
2514 ) -> Self {
2515 self.producer_instance_location = v.into();
2516 self
2517 }
2518
2519 /// Sets the value of [allowed_google_producers_resource_hierarchy_level][crate::model::service_connection_policy::PscConfig::allowed_google_producers_resource_hierarchy_level].
2520 ///
2521 /// # Example
2522 /// ```ignore,no_run
2523 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2524 /// let x = PscConfig::new().set_allowed_google_producers_resource_hierarchy_level(["a", "b", "c"]);
2525 /// ```
2526 pub fn set_allowed_google_producers_resource_hierarchy_level<T, V>(mut self, v: T) -> Self
2527 where
2528 T: std::iter::IntoIterator<Item = V>,
2529 V: std::convert::Into<std::string::String>,
2530 {
2531 use std::iter::Iterator;
2532 self.allowed_google_producers_resource_hierarchy_level =
2533 v.into_iter().map(|i| i.into()).collect();
2534 self
2535 }
2536 }
2537
2538 impl wkt::message::Message for PscConfig {
2539 fn typename() -> &'static str {
2540 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig"
2541 }
2542 }
2543
2544 /// Defines additional types related to [PscConfig].
2545 pub mod psc_config {
2546 #[allow(unused_imports)]
2547 use super::*;
2548
2549 /// ProducerInstanceLocation is used to specify which authorization mechanism
2550 /// to use to determine which projects the Producer instance can be within.
2551 ///
2552 /// # Working with unknown values
2553 ///
2554 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2555 /// additional enum variants at any time. Adding new variants is not considered
2556 /// a breaking change. Applications should write their code in anticipation of:
2557 ///
2558 /// - New values appearing in future releases of the client library, **and**
2559 /// - New values received dynamically, without application changes.
2560 ///
2561 /// Please consult the [Working with enums] section in the user guide for some
2562 /// guidelines.
2563 ///
2564 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2565 #[derive(Clone, Debug, PartialEq)]
2566 #[non_exhaustive]
2567 pub enum ProducerInstanceLocation {
2568 /// Producer instance location is not specified. When this option is
2569 /// chosen, then the PSC connections created by this
2570 /// ServiceConnectionPolicy must be within the same project as the Producer
2571 /// instance. This is the default ProducerInstanceLocation value.
2572 /// To allow for PSC connections from this network to other networks, use
2573 /// the CUSTOM_RESOURCE_HIERARCHY_LEVELS option.
2574 Unspecified,
2575 /// Producer instance must be within one of the values provided in
2576 /// allowed_google_producers_resource_hierarchy_level.
2577 CustomResourceHierarchyLevels,
2578 /// If set, the enum was initialized with an unknown value.
2579 ///
2580 /// Applications can examine the value using [ProducerInstanceLocation::value] or
2581 /// [ProducerInstanceLocation::name].
2582 UnknownValue(producer_instance_location::UnknownValue),
2583 }
2584
2585 #[doc(hidden)]
2586 pub mod producer_instance_location {
2587 #[allow(unused_imports)]
2588 use super::*;
2589 #[derive(Clone, Debug, PartialEq)]
2590 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2591 }
2592
2593 impl ProducerInstanceLocation {
2594 /// Gets the enum value.
2595 ///
2596 /// Returns `None` if the enum contains an unknown value deserialized from
2597 /// the string representation of enums.
2598 pub fn value(&self) -> std::option::Option<i32> {
2599 match self {
2600 Self::Unspecified => std::option::Option::Some(0),
2601 Self::CustomResourceHierarchyLevels => std::option::Option::Some(1),
2602 Self::UnknownValue(u) => u.0.value(),
2603 }
2604 }
2605
2606 /// Gets the enum value as a string.
2607 ///
2608 /// Returns `None` if the enum contains an unknown value deserialized from
2609 /// the integer representation of enums.
2610 pub fn name(&self) -> std::option::Option<&str> {
2611 match self {
2612 Self::Unspecified => {
2613 std::option::Option::Some("PRODUCER_INSTANCE_LOCATION_UNSPECIFIED")
2614 }
2615 Self::CustomResourceHierarchyLevels => {
2616 std::option::Option::Some("CUSTOM_RESOURCE_HIERARCHY_LEVELS")
2617 }
2618 Self::UnknownValue(u) => u.0.name(),
2619 }
2620 }
2621 }
2622
2623 impl std::default::Default for ProducerInstanceLocation {
2624 fn default() -> Self {
2625 use std::convert::From;
2626 Self::from(0)
2627 }
2628 }
2629
2630 impl std::fmt::Display for ProducerInstanceLocation {
2631 fn fmt(
2632 &self,
2633 f: &mut std::fmt::Formatter<'_>,
2634 ) -> std::result::Result<(), std::fmt::Error> {
2635 wkt::internal::display_enum(f, self.name(), self.value())
2636 }
2637 }
2638
2639 impl std::convert::From<i32> for ProducerInstanceLocation {
2640 fn from(value: i32) -> Self {
2641 match value {
2642 0 => Self::Unspecified,
2643 1 => Self::CustomResourceHierarchyLevels,
2644 _ => Self::UnknownValue(producer_instance_location::UnknownValue(
2645 wkt::internal::UnknownEnumValue::Integer(value),
2646 )),
2647 }
2648 }
2649 }
2650
2651 impl std::convert::From<&str> for ProducerInstanceLocation {
2652 fn from(value: &str) -> Self {
2653 use std::string::ToString;
2654 match value {
2655 "PRODUCER_INSTANCE_LOCATION_UNSPECIFIED" => Self::Unspecified,
2656 "CUSTOM_RESOURCE_HIERARCHY_LEVELS" => Self::CustomResourceHierarchyLevels,
2657 _ => Self::UnknownValue(producer_instance_location::UnknownValue(
2658 wkt::internal::UnknownEnumValue::String(value.to_string()),
2659 )),
2660 }
2661 }
2662 }
2663
2664 impl serde::ser::Serialize for ProducerInstanceLocation {
2665 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2666 where
2667 S: serde::Serializer,
2668 {
2669 match self {
2670 Self::Unspecified => serializer.serialize_i32(0),
2671 Self::CustomResourceHierarchyLevels => serializer.serialize_i32(1),
2672 Self::UnknownValue(u) => u.0.serialize(serializer),
2673 }
2674 }
2675 }
2676
2677 impl<'de> serde::de::Deserialize<'de> for ProducerInstanceLocation {
2678 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2679 where
2680 D: serde::Deserializer<'de>,
2681 {
2682 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProducerInstanceLocation>::new(
2683 ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig.ProducerInstanceLocation"))
2684 }
2685 }
2686 }
2687
2688 /// Information about a specific Private Service Connect connection.
2689 #[derive(Clone, Default, PartialEq)]
2690 #[non_exhaustive]
2691 pub struct PscConnection {
2692 /// State of the PSC Connection
2693 pub state: crate::model::service_connection_policy::State,
2694
2695 /// The resource reference of the PSC Forwarding Rule within the consumer
2696 /// VPC.
2697 pub consumer_forwarding_rule: std::string::String,
2698
2699 /// The resource reference of the consumer address.
2700 pub consumer_address: std::string::String,
2701
2702 /// The error type indicates whether the error is consumer facing, producer
2703 /// facing or system internal.
2704 #[deprecated]
2705 pub error_type: crate::model::ConnectionErrorType,
2706
2707 /// The most recent error during operating this connection.
2708 /// Deprecated, please use error_info instead.
2709 #[deprecated]
2710 pub error: std::option::Option<google_cloud_rpc::model::Status>,
2711
2712 /// The last Compute Engine operation to setup PSC connection.
2713 pub gce_operation: std::string::String,
2714
2715 /// The project where the PSC connection is created.
2716 pub consumer_target_project: std::string::String,
2717
2718 /// The PSC connection id of the PSC forwarding rule.
2719 pub psc_connection_id: std::string::String,
2720
2721 /// Output only. The error info for the latest error during operating this
2722 /// connection.
2723 pub error_info: std::option::Option<google_cloud_rpc::model::ErrorInfo>,
2724
2725 /// Output only. The URI of the subnetwork selected to allocate IP address
2726 /// for this connection.
2727 pub selected_subnetwork: std::string::String,
2728
2729 /// Immutable. Deprecated. Use producer_instance_metadata instead.
2730 /// An immutable identifier for the producer instance.
2731 #[deprecated]
2732 pub producer_instance_id: std::string::String,
2733
2734 /// Immutable. An immutable map for the producer instance metadata.
2735 pub producer_instance_metadata:
2736 std::collections::HashMap<std::string::String, std::string::String>,
2737
2738 /// Output only. [Output only] The service class associated with this PSC
2739 /// Connection. The value is derived from the SCPolicy and matches the
2740 /// service class name provided by the customer.
2741 pub service_class: std::string::String,
2742
2743 /// The requested IP version for the PSC connection.
2744 pub ip_version: std::option::Option<crate::model::IPVersion>,
2745
2746 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2747 }
2748
2749 impl PscConnection {
2750 pub fn new() -> Self {
2751 std::default::Default::default()
2752 }
2753
2754 /// Sets the value of [state][crate::model::service_connection_policy::PscConnection::state].
2755 ///
2756 /// # Example
2757 /// ```ignore,no_run
2758 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2759 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::State;
2760 /// let x0 = PscConnection::new().set_state(State::Active);
2761 /// let x1 = PscConnection::new().set_state(State::Failed);
2762 /// let x2 = PscConnection::new().set_state(State::Creating);
2763 /// ```
2764 pub fn set_state<T: std::convert::Into<crate::model::service_connection_policy::State>>(
2765 mut self,
2766 v: T,
2767 ) -> Self {
2768 self.state = v.into();
2769 self
2770 }
2771
2772 /// Sets the value of [consumer_forwarding_rule][crate::model::service_connection_policy::PscConnection::consumer_forwarding_rule].
2773 ///
2774 /// # Example
2775 /// ```ignore,no_run
2776 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2777 /// let x = PscConnection::new().set_consumer_forwarding_rule("example");
2778 /// ```
2779 pub fn set_consumer_forwarding_rule<T: std::convert::Into<std::string::String>>(
2780 mut self,
2781 v: T,
2782 ) -> Self {
2783 self.consumer_forwarding_rule = v.into();
2784 self
2785 }
2786
2787 /// Sets the value of [consumer_address][crate::model::service_connection_policy::PscConnection::consumer_address].
2788 ///
2789 /// # Example
2790 /// ```ignore,no_run
2791 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2792 /// let x = PscConnection::new().set_consumer_address("example");
2793 /// ```
2794 pub fn set_consumer_address<T: std::convert::Into<std::string::String>>(
2795 mut self,
2796 v: T,
2797 ) -> Self {
2798 self.consumer_address = v.into();
2799 self
2800 }
2801
2802 /// Sets the value of [error_type][crate::model::service_connection_policy::PscConnection::error_type].
2803 ///
2804 /// # Example
2805 /// ```ignore,no_run
2806 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2807 /// use google_cloud_networkconnectivity_v1::model::ConnectionErrorType;
2808 /// let x0 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorInternal);
2809 /// let x1 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorConsumerSide);
2810 /// let x2 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorProducerSide);
2811 /// ```
2812 #[deprecated]
2813 pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
2814 mut self,
2815 v: T,
2816 ) -> Self {
2817 self.error_type = v.into();
2818 self
2819 }
2820
2821 /// Sets the value of [error][crate::model::service_connection_policy::PscConnection::error].
2822 ///
2823 /// # Example
2824 /// ```ignore,no_run
2825 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2826 /// use google_cloud_rpc::model::Status;
2827 /// let x = PscConnection::new().set_error(Status::default()/* use setters */);
2828 /// ```
2829 #[deprecated]
2830 pub fn set_error<T>(mut self, v: T) -> Self
2831 where
2832 T: std::convert::Into<google_cloud_rpc::model::Status>,
2833 {
2834 self.error = std::option::Option::Some(v.into());
2835 self
2836 }
2837
2838 /// Sets or clears the value of [error][crate::model::service_connection_policy::PscConnection::error].
2839 ///
2840 /// # Example
2841 /// ```ignore,no_run
2842 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2843 /// use google_cloud_rpc::model::Status;
2844 /// let x = PscConnection::new().set_or_clear_error(Some(Status::default()/* use setters */));
2845 /// let x = PscConnection::new().set_or_clear_error(None::<Status>);
2846 /// ```
2847 #[deprecated]
2848 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
2849 where
2850 T: std::convert::Into<google_cloud_rpc::model::Status>,
2851 {
2852 self.error = v.map(|x| x.into());
2853 self
2854 }
2855
2856 /// Sets the value of [gce_operation][crate::model::service_connection_policy::PscConnection::gce_operation].
2857 ///
2858 /// # Example
2859 /// ```ignore,no_run
2860 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2861 /// let x = PscConnection::new().set_gce_operation("example");
2862 /// ```
2863 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
2864 mut self,
2865 v: T,
2866 ) -> Self {
2867 self.gce_operation = v.into();
2868 self
2869 }
2870
2871 /// Sets the value of [consumer_target_project][crate::model::service_connection_policy::PscConnection::consumer_target_project].
2872 ///
2873 /// # Example
2874 /// ```ignore,no_run
2875 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2876 /// let x = PscConnection::new().set_consumer_target_project("example");
2877 /// ```
2878 pub fn set_consumer_target_project<T: std::convert::Into<std::string::String>>(
2879 mut self,
2880 v: T,
2881 ) -> Self {
2882 self.consumer_target_project = v.into();
2883 self
2884 }
2885
2886 /// Sets the value of [psc_connection_id][crate::model::service_connection_policy::PscConnection::psc_connection_id].
2887 ///
2888 /// # Example
2889 /// ```ignore,no_run
2890 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2891 /// let x = PscConnection::new().set_psc_connection_id("example");
2892 /// ```
2893 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
2894 mut self,
2895 v: T,
2896 ) -> Self {
2897 self.psc_connection_id = v.into();
2898 self
2899 }
2900
2901 /// Sets the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
2902 ///
2903 /// # Example
2904 /// ```ignore,no_run
2905 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2906 /// use google_cloud_rpc::model::ErrorInfo;
2907 /// let x = PscConnection::new().set_error_info(ErrorInfo::default()/* use setters */);
2908 /// ```
2909 pub fn set_error_info<T>(mut self, v: T) -> Self
2910 where
2911 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
2912 {
2913 self.error_info = std::option::Option::Some(v.into());
2914 self
2915 }
2916
2917 /// Sets or clears the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
2918 ///
2919 /// # Example
2920 /// ```ignore,no_run
2921 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2922 /// use google_cloud_rpc::model::ErrorInfo;
2923 /// let x = PscConnection::new().set_or_clear_error_info(Some(ErrorInfo::default()/* use setters */));
2924 /// let x = PscConnection::new().set_or_clear_error_info(None::<ErrorInfo>);
2925 /// ```
2926 pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
2927 where
2928 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
2929 {
2930 self.error_info = v.map(|x| x.into());
2931 self
2932 }
2933
2934 /// Sets the value of [selected_subnetwork][crate::model::service_connection_policy::PscConnection::selected_subnetwork].
2935 ///
2936 /// # Example
2937 /// ```ignore,no_run
2938 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2939 /// let x = PscConnection::new().set_selected_subnetwork("example");
2940 /// ```
2941 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
2942 mut self,
2943 v: T,
2944 ) -> Self {
2945 self.selected_subnetwork = v.into();
2946 self
2947 }
2948
2949 /// Sets the value of [producer_instance_id][crate::model::service_connection_policy::PscConnection::producer_instance_id].
2950 ///
2951 /// # Example
2952 /// ```ignore,no_run
2953 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2954 /// let x = PscConnection::new().set_producer_instance_id("example");
2955 /// ```
2956 #[deprecated]
2957 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
2958 mut self,
2959 v: T,
2960 ) -> Self {
2961 self.producer_instance_id = v.into();
2962 self
2963 }
2964
2965 /// Sets the value of [producer_instance_metadata][crate::model::service_connection_policy::PscConnection::producer_instance_metadata].
2966 ///
2967 /// # Example
2968 /// ```ignore,no_run
2969 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2970 /// let x = PscConnection::new().set_producer_instance_metadata([
2971 /// ("key0", "abc"),
2972 /// ("key1", "xyz"),
2973 /// ]);
2974 /// ```
2975 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
2976 where
2977 T: std::iter::IntoIterator<Item = (K, V)>,
2978 K: std::convert::Into<std::string::String>,
2979 V: std::convert::Into<std::string::String>,
2980 {
2981 use std::iter::Iterator;
2982 self.producer_instance_metadata =
2983 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2984 self
2985 }
2986
2987 /// Sets the value of [service_class][crate::model::service_connection_policy::PscConnection::service_class].
2988 ///
2989 /// # Example
2990 /// ```ignore,no_run
2991 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2992 /// let x = PscConnection::new().set_service_class("example");
2993 /// ```
2994 pub fn set_service_class<T: std::convert::Into<std::string::String>>(
2995 mut self,
2996 v: T,
2997 ) -> Self {
2998 self.service_class = v.into();
2999 self
3000 }
3001
3002 /// Sets the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
3003 ///
3004 /// # Example
3005 /// ```ignore,no_run
3006 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3007 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
3008 /// let x0 = PscConnection::new().set_ip_version(IPVersion::Ipv4);
3009 /// let x1 = PscConnection::new().set_ip_version(IPVersion::Ipv6);
3010 /// ```
3011 pub fn set_ip_version<T>(mut self, v: T) -> Self
3012 where
3013 T: std::convert::Into<crate::model::IPVersion>,
3014 {
3015 self.ip_version = std::option::Option::Some(v.into());
3016 self
3017 }
3018
3019 /// Sets or clears the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
3020 ///
3021 /// # Example
3022 /// ```ignore,no_run
3023 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3024 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
3025 /// let x0 = PscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
3026 /// let x1 = PscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
3027 /// let x_none = PscConnection::new().set_or_clear_ip_version(None::<IPVersion>);
3028 /// ```
3029 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
3030 where
3031 T: std::convert::Into<crate::model::IPVersion>,
3032 {
3033 self.ip_version = v.map(|x| x.into());
3034 self
3035 }
3036 }
3037
3038 impl wkt::message::Message for PscConnection {
3039 fn typename() -> &'static str {
3040 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection"
3041 }
3042 }
3043
3044 /// The state of the PSC connection.
3045 /// We reserve the right to add more states without notice in the future.
3046 /// Users should not use exhaustive switch statements on this enum.
3047 /// See <https://google.aip.dev/216>.
3048 ///
3049 /// # Working with unknown values
3050 ///
3051 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3052 /// additional enum variants at any time. Adding new variants is not considered
3053 /// a breaking change. Applications should write their code in anticipation of:
3054 ///
3055 /// - New values appearing in future releases of the client library, **and**
3056 /// - New values received dynamically, without application changes.
3057 ///
3058 /// Please consult the [Working with enums] section in the user guide for some
3059 /// guidelines.
3060 ///
3061 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3062 #[derive(Clone, Debug, PartialEq)]
3063 #[non_exhaustive]
3064 pub enum State {
3065 /// An invalid state as the default case.
3066 Unspecified,
3067 /// The connection has been created successfully. However, for the
3068 /// up-to-date connection status, please use the created forwarding rule's
3069 /// "PscConnectionStatus" as the source of truth.
3070 Active,
3071 /// The connection is not functional since some resources on the connection
3072 /// fail to be created.
3073 Failed,
3074 /// The connection is being created.
3075 Creating,
3076 /// The connection is being deleted.
3077 Deleting,
3078 /// The connection is being repaired to complete creation.
3079 CreateRepairing,
3080 /// The connection is being repaired to complete deletion.
3081 DeleteRepairing,
3082 /// If set, the enum was initialized with an unknown value.
3083 ///
3084 /// Applications can examine the value using [State::value] or
3085 /// [State::name].
3086 UnknownValue(state::UnknownValue),
3087 }
3088
3089 #[doc(hidden)]
3090 pub mod state {
3091 #[allow(unused_imports)]
3092 use super::*;
3093 #[derive(Clone, Debug, PartialEq)]
3094 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3095 }
3096
3097 impl State {
3098 /// Gets the enum value.
3099 ///
3100 /// Returns `None` if the enum contains an unknown value deserialized from
3101 /// the string representation of enums.
3102 pub fn value(&self) -> std::option::Option<i32> {
3103 match self {
3104 Self::Unspecified => std::option::Option::Some(0),
3105 Self::Active => std::option::Option::Some(1),
3106 Self::Failed => std::option::Option::Some(2),
3107 Self::Creating => std::option::Option::Some(3),
3108 Self::Deleting => std::option::Option::Some(4),
3109 Self::CreateRepairing => std::option::Option::Some(5),
3110 Self::DeleteRepairing => std::option::Option::Some(6),
3111 Self::UnknownValue(u) => u.0.value(),
3112 }
3113 }
3114
3115 /// Gets the enum value as a string.
3116 ///
3117 /// Returns `None` if the enum contains an unknown value deserialized from
3118 /// the integer representation of enums.
3119 pub fn name(&self) -> std::option::Option<&str> {
3120 match self {
3121 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3122 Self::Active => std::option::Option::Some("ACTIVE"),
3123 Self::Failed => std::option::Option::Some("FAILED"),
3124 Self::Creating => std::option::Option::Some("CREATING"),
3125 Self::Deleting => std::option::Option::Some("DELETING"),
3126 Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
3127 Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
3128 Self::UnknownValue(u) => u.0.name(),
3129 }
3130 }
3131 }
3132
3133 impl std::default::Default for State {
3134 fn default() -> Self {
3135 use std::convert::From;
3136 Self::from(0)
3137 }
3138 }
3139
3140 impl std::fmt::Display for State {
3141 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3142 wkt::internal::display_enum(f, self.name(), self.value())
3143 }
3144 }
3145
3146 impl std::convert::From<i32> for State {
3147 fn from(value: i32) -> Self {
3148 match value {
3149 0 => Self::Unspecified,
3150 1 => Self::Active,
3151 2 => Self::Failed,
3152 3 => Self::Creating,
3153 4 => Self::Deleting,
3154 5 => Self::CreateRepairing,
3155 6 => Self::DeleteRepairing,
3156 _ => Self::UnknownValue(state::UnknownValue(
3157 wkt::internal::UnknownEnumValue::Integer(value),
3158 )),
3159 }
3160 }
3161 }
3162
3163 impl std::convert::From<&str> for State {
3164 fn from(value: &str) -> Self {
3165 use std::string::ToString;
3166 match value {
3167 "STATE_UNSPECIFIED" => Self::Unspecified,
3168 "ACTIVE" => Self::Active,
3169 "FAILED" => Self::Failed,
3170 "CREATING" => Self::Creating,
3171 "DELETING" => Self::Deleting,
3172 "CREATE_REPAIRING" => Self::CreateRepairing,
3173 "DELETE_REPAIRING" => Self::DeleteRepairing,
3174 _ => Self::UnknownValue(state::UnknownValue(
3175 wkt::internal::UnknownEnumValue::String(value.to_string()),
3176 )),
3177 }
3178 }
3179 }
3180
3181 impl serde::ser::Serialize for State {
3182 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3183 where
3184 S: serde::Serializer,
3185 {
3186 match self {
3187 Self::Unspecified => serializer.serialize_i32(0),
3188 Self::Active => serializer.serialize_i32(1),
3189 Self::Failed => serializer.serialize_i32(2),
3190 Self::Creating => serializer.serialize_i32(3),
3191 Self::Deleting => serializer.serialize_i32(4),
3192 Self::CreateRepairing => serializer.serialize_i32(5),
3193 Self::DeleteRepairing => serializer.serialize_i32(6),
3194 Self::UnknownValue(u) => u.0.serialize(serializer),
3195 }
3196 }
3197 }
3198
3199 impl<'de> serde::de::Deserialize<'de> for State {
3200 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3201 where
3202 D: serde::Deserializer<'de>,
3203 {
3204 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3205 ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.State",
3206 ))
3207 }
3208 }
3209}
3210
3211/// Request for ListServiceConnectionPolicies.
3212#[derive(Clone, Default, PartialEq)]
3213#[non_exhaustive]
3214pub struct ListServiceConnectionPoliciesRequest {
3215 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
3216 pub parent: std::string::String,
3217
3218 /// The maximum number of results per page that should be returned.
3219 pub page_size: i32,
3220
3221 /// The page token.
3222 pub page_token: std::string::String,
3223
3224 /// A filter expression that filters the results listed in the response.
3225 pub filter: std::string::String,
3226
3227 /// Sort the results by a certain order.
3228 pub order_by: std::string::String,
3229
3230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3231}
3232
3233impl ListServiceConnectionPoliciesRequest {
3234 pub fn new() -> Self {
3235 std::default::Default::default()
3236 }
3237
3238 /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
3239 ///
3240 /// # Example
3241 /// ```ignore,no_run
3242 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3243 /// let x = ListServiceConnectionPoliciesRequest::new().set_parent("example");
3244 /// ```
3245 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3246 self.parent = v.into();
3247 self
3248 }
3249
3250 /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
3251 ///
3252 /// # Example
3253 /// ```ignore,no_run
3254 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3255 /// let x = ListServiceConnectionPoliciesRequest::new().set_page_size(42);
3256 /// ```
3257 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3258 self.page_size = v.into();
3259 self
3260 }
3261
3262 /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
3263 ///
3264 /// # Example
3265 /// ```ignore,no_run
3266 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3267 /// let x = ListServiceConnectionPoliciesRequest::new().set_page_token("example");
3268 /// ```
3269 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3270 self.page_token = v.into();
3271 self
3272 }
3273
3274 /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
3275 ///
3276 /// # Example
3277 /// ```ignore,no_run
3278 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3279 /// let x = ListServiceConnectionPoliciesRequest::new().set_filter("example");
3280 /// ```
3281 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3282 self.filter = v.into();
3283 self
3284 }
3285
3286 /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
3287 ///
3288 /// # Example
3289 /// ```ignore,no_run
3290 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3291 /// let x = ListServiceConnectionPoliciesRequest::new().set_order_by("example");
3292 /// ```
3293 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3294 self.order_by = v.into();
3295 self
3296 }
3297}
3298
3299impl wkt::message::Message for ListServiceConnectionPoliciesRequest {
3300 fn typename() -> &'static str {
3301 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesRequest"
3302 }
3303}
3304
3305/// Response for ListServiceConnectionPolicies.
3306#[derive(Clone, Default, PartialEq)]
3307#[non_exhaustive]
3308pub struct ListServiceConnectionPoliciesResponse {
3309 /// ServiceConnectionPolicies to be returned.
3310 pub service_connection_policies: std::vec::Vec<crate::model::ServiceConnectionPolicy>,
3311
3312 /// The next pagination token in the List response. It should be used as
3313 /// page_token for the following request. An empty value means no more result.
3314 pub next_page_token: std::string::String,
3315
3316 /// Locations that could not be reached.
3317 pub unreachable: std::vec::Vec<std::string::String>,
3318
3319 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3320}
3321
3322impl ListServiceConnectionPoliciesResponse {
3323 pub fn new() -> Self {
3324 std::default::Default::default()
3325 }
3326
3327 /// Sets the value of [service_connection_policies][crate::model::ListServiceConnectionPoliciesResponse::service_connection_policies].
3328 ///
3329 /// # Example
3330 /// ```ignore,no_run
3331 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3332 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3333 /// let x = ListServiceConnectionPoliciesResponse::new()
3334 /// .set_service_connection_policies([
3335 /// ServiceConnectionPolicy::default()/* use setters */,
3336 /// ServiceConnectionPolicy::default()/* use (different) setters */,
3337 /// ]);
3338 /// ```
3339 pub fn set_service_connection_policies<T, V>(mut self, v: T) -> Self
3340 where
3341 T: std::iter::IntoIterator<Item = V>,
3342 V: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3343 {
3344 use std::iter::Iterator;
3345 self.service_connection_policies = v.into_iter().map(|i| i.into()).collect();
3346 self
3347 }
3348
3349 /// Sets the value of [next_page_token][crate::model::ListServiceConnectionPoliciesResponse::next_page_token].
3350 ///
3351 /// # Example
3352 /// ```ignore,no_run
3353 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3354 /// let x = ListServiceConnectionPoliciesResponse::new().set_next_page_token("example");
3355 /// ```
3356 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3357 self.next_page_token = v.into();
3358 self
3359 }
3360
3361 /// Sets the value of [unreachable][crate::model::ListServiceConnectionPoliciesResponse::unreachable].
3362 ///
3363 /// # Example
3364 /// ```ignore,no_run
3365 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3366 /// let x = ListServiceConnectionPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
3367 /// ```
3368 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3369 where
3370 T: std::iter::IntoIterator<Item = V>,
3371 V: std::convert::Into<std::string::String>,
3372 {
3373 use std::iter::Iterator;
3374 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3375 self
3376 }
3377}
3378
3379impl wkt::message::Message for ListServiceConnectionPoliciesResponse {
3380 fn typename() -> &'static str {
3381 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesResponse"
3382 }
3383}
3384
3385#[doc(hidden)]
3386impl google_cloud_gax::paginator::internal::PageableResponse
3387 for ListServiceConnectionPoliciesResponse
3388{
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 google_cloud_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 google_cloud_gax::paginator::internal::PageableResponse
4843 for ListServiceConnectionTokensResponse
4844{
4845 type PageItem = crate::model::ServiceConnectionToken;
4846
4847 fn items(self) -> std::vec::Vec<Self::PageItem> {
4848 self.service_connection_tokens
4849 }
4850
4851 fn next_page_token(&self) -> std::string::String {
4852 use std::clone::Clone;
4853 self.next_page_token.clone()
4854 }
4855}
4856
4857/// Request for GetServiceConnectionToken.
4858#[derive(Clone, Default, PartialEq)]
4859#[non_exhaustive]
4860pub struct GetServiceConnectionTokenRequest {
4861 /// Required. Name of the ServiceConnectionToken to get.
4862 pub name: std::string::String,
4863
4864 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4865}
4866
4867impl GetServiceConnectionTokenRequest {
4868 pub fn new() -> Self {
4869 std::default::Default::default()
4870 }
4871
4872 /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
4873 ///
4874 /// # Example
4875 /// ```ignore,no_run
4876 /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionTokenRequest;
4877 /// let x = GetServiceConnectionTokenRequest::new().set_name("example");
4878 /// ```
4879 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4880 self.name = v.into();
4881 self
4882 }
4883}
4884
4885impl wkt::message::Message for GetServiceConnectionTokenRequest {
4886 fn typename() -> &'static str {
4887 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionTokenRequest"
4888 }
4889}
4890
4891/// Request for CreateServiceConnectionToken.
4892#[derive(Clone, Default, PartialEq)]
4893#[non_exhaustive]
4894pub struct CreateServiceConnectionTokenRequest {
4895 /// Required. The parent resource's name of the ServiceConnectionToken. ex.
4896 /// projects/123/locations/us-east1
4897 pub parent: std::string::String,
4898
4899 /// Optional. Resource ID
4900 /// (i.e. 'foo' in '[...]/projects/p/locations/l/ServiceConnectionTokens/foo')
4901 /// See <https://google.aip.dev/122#resource-id-segments>
4902 /// Unique per location.
4903 /// If one is not provided, one will be generated.
4904 pub service_connection_token_id: std::string::String,
4905
4906 /// Required. Initial values for a new ServiceConnectionTokens
4907 pub service_connection_token: std::option::Option<crate::model::ServiceConnectionToken>,
4908
4909 /// Optional. An optional request ID to identify requests. Specify a unique
4910 /// request ID so that if you must retry your request, the server will know to
4911 /// ignore the request if it has already been completed. The server will
4912 /// guarantee that for at least 60 minutes since the first request.
4913 ///
4914 /// For example, consider a situation where you make an initial request and
4915 /// the request times out. If you make the request again with the same request
4916 /// ID, the server can check if original operation with the same request ID
4917 /// was received, and if so, will ignore the second request. This prevents
4918 /// clients from accidentally creating duplicate commitments.
4919 ///
4920 /// The request ID must be a valid UUID with the exception that zero UUID is
4921 /// not supported (00000000-0000-0000-0000-000000000000).
4922 pub request_id: std::string::String,
4923
4924 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4925}
4926
4927impl CreateServiceConnectionTokenRequest {
4928 pub fn new() -> Self {
4929 std::default::Default::default()
4930 }
4931
4932 /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
4933 ///
4934 /// # Example
4935 /// ```ignore,no_run
4936 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4937 /// let x = CreateServiceConnectionTokenRequest::new().set_parent("example");
4938 /// ```
4939 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4940 self.parent = v.into();
4941 self
4942 }
4943
4944 /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
4945 ///
4946 /// # Example
4947 /// ```ignore,no_run
4948 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4949 /// let x = CreateServiceConnectionTokenRequest::new().set_service_connection_token_id("example");
4950 /// ```
4951 pub fn set_service_connection_token_id<T: std::convert::Into<std::string::String>>(
4952 mut self,
4953 v: T,
4954 ) -> Self {
4955 self.service_connection_token_id = v.into();
4956 self
4957 }
4958
4959 /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
4960 ///
4961 /// # Example
4962 /// ```ignore,no_run
4963 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4964 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4965 /// let x = CreateServiceConnectionTokenRequest::new().set_service_connection_token(ServiceConnectionToken::default()/* use setters */);
4966 /// ```
4967 pub fn set_service_connection_token<T>(mut self, v: T) -> Self
4968 where
4969 T: std::convert::Into<crate::model::ServiceConnectionToken>,
4970 {
4971 self.service_connection_token = std::option::Option::Some(v.into());
4972 self
4973 }
4974
4975 /// Sets or clears the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
4976 ///
4977 /// # Example
4978 /// ```ignore,no_run
4979 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4980 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4981 /// let x = CreateServiceConnectionTokenRequest::new().set_or_clear_service_connection_token(Some(ServiceConnectionToken::default()/* use setters */));
4982 /// let x = CreateServiceConnectionTokenRequest::new().set_or_clear_service_connection_token(None::<ServiceConnectionToken>);
4983 /// ```
4984 pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
4985 where
4986 T: std::convert::Into<crate::model::ServiceConnectionToken>,
4987 {
4988 self.service_connection_token = v.map(|x| x.into());
4989 self
4990 }
4991
4992 /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
4993 ///
4994 /// # Example
4995 /// ```ignore,no_run
4996 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4997 /// let x = CreateServiceConnectionTokenRequest::new().set_request_id("example");
4998 /// ```
4999 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5000 self.request_id = v.into();
5001 self
5002 }
5003}
5004
5005impl wkt::message::Message for CreateServiceConnectionTokenRequest {
5006 fn typename() -> &'static str {
5007 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionTokenRequest"
5008 }
5009}
5010
5011/// Request for DeleteServiceConnectionToken.
5012#[derive(Clone, Default, PartialEq)]
5013#[non_exhaustive]
5014pub struct DeleteServiceConnectionTokenRequest {
5015 /// Required. The name of the ServiceConnectionToken to delete.
5016 pub name: std::string::String,
5017
5018 /// Optional. An optional request ID to identify requests. Specify a unique
5019 /// request ID so that if you must retry your request, the server will know to
5020 /// ignore the request if it has already been completed. The server will
5021 /// guarantee that for at least 60 minutes after the first request.
5022 ///
5023 /// For example, consider a situation where you make an initial request and
5024 /// the request times out. If you make the request again with the same request
5025 /// ID, the server can check if original operation with the same request ID
5026 /// was received, and if so, will ignore the second request. This prevents
5027 /// clients from accidentally creating duplicate commitments.
5028 ///
5029 /// The request ID must be a valid UUID with the exception that zero UUID is
5030 /// not supported (00000000-0000-0000-0000-000000000000).
5031 pub request_id: std::string::String,
5032
5033 /// Optional. The etag is computed by the server, and may be sent on update and
5034 /// delete requests to ensure the client has an up-to-date value before
5035 /// proceeding.
5036 pub etag: std::option::Option<std::string::String>,
5037
5038 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5039}
5040
5041impl DeleteServiceConnectionTokenRequest {
5042 pub fn new() -> Self {
5043 std::default::Default::default()
5044 }
5045
5046 /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
5047 ///
5048 /// # Example
5049 /// ```ignore,no_run
5050 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5051 /// let x = DeleteServiceConnectionTokenRequest::new().set_name("example");
5052 /// ```
5053 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5054 self.name = v.into();
5055 self
5056 }
5057
5058 /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
5059 ///
5060 /// # Example
5061 /// ```ignore,no_run
5062 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5063 /// let x = DeleteServiceConnectionTokenRequest::new().set_request_id("example");
5064 /// ```
5065 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5066 self.request_id = v.into();
5067 self
5068 }
5069
5070 /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
5071 ///
5072 /// # Example
5073 /// ```ignore,no_run
5074 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5075 /// let x = DeleteServiceConnectionTokenRequest::new().set_etag("example");
5076 /// ```
5077 pub fn set_etag<T>(mut self, v: T) -> Self
5078 where
5079 T: std::convert::Into<std::string::String>,
5080 {
5081 self.etag = std::option::Option::Some(v.into());
5082 self
5083 }
5084
5085 /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
5086 ///
5087 /// # Example
5088 /// ```ignore,no_run
5089 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5090 /// let x = DeleteServiceConnectionTokenRequest::new().set_or_clear_etag(Some("example"));
5091 /// let x = DeleteServiceConnectionTokenRequest::new().set_or_clear_etag(None::<String>);
5092 /// ```
5093 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
5094 where
5095 T: std::convert::Into<std::string::String>,
5096 {
5097 self.etag = v.map(|x| x.into());
5098 self
5099 }
5100}
5101
5102impl wkt::message::Message for DeleteServiceConnectionTokenRequest {
5103 fn typename() -> &'static str {
5104 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionTokenRequest"
5105 }
5106}
5107
5108/// The `MulticloudDataTransferConfig` resource. It lists the services that you
5109/// configure for Data Transfer Essentials billing and metering.
5110#[derive(Clone, Default, PartialEq)]
5111#[non_exhaustive]
5112pub struct MulticloudDataTransferConfig {
5113 /// Identifier. The name of the `MulticloudDataTransferConfig` resource.
5114 /// Format:
5115 /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}`.
5116 pub name: std::string::String,
5117
5118 /// Output only. Time when the `MulticloudDataTransferConfig` resource was
5119 /// created.
5120 pub create_time: std::option::Option<wkt::Timestamp>,
5121
5122 /// Output only. Time when the `MulticloudDataTransferConfig` resource was
5123 /// updated.
5124 pub update_time: std::option::Option<wkt::Timestamp>,
5125
5126 /// Optional. User-defined labels.
5127 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5128
5129 /// The etag is computed by the server, and might be sent with update and
5130 /// delete requests so that the client has an up-to-date value before
5131 /// proceeding.
5132 pub etag: std::string::String,
5133
5134 /// Optional. A description of this resource.
5135 pub description: std::string::String,
5136
5137 /// Output only. The number of `Destination` resources configured for the
5138 /// `MulticloudDataTransferConfig` resource.
5139 pub destinations_count: i32,
5140
5141 /// Output only. The number of `Destination` resources in use with the
5142 /// `MulticloudDataTransferConfig` resource.
5143 pub destinations_active_count: i32,
5144
5145 /// Optional. Maps services to their current or planned states. Service names
5146 /// are keys, and the associated values describe the state of the service. If a
5147 /// state change is expected, the value is either `ADDING` or `DELETING`,
5148 /// depending on the actions taken.
5149 ///
5150 /// Sample output:
5151 /// "services": {
5152 /// "big-query": {
5153 /// "states": [
5154 /// {
5155 /// "effectiveTime": "2024-12-12T08:00:00Z"
5156 /// "state": "ADDING",
5157 /// },
5158 /// ]
5159 /// },
5160 /// "cloud-storage": {
5161 /// "states": [
5162 /// {
5163 /// "state": "ACTIVE",
5164 /// }
5165 /// ]
5166 /// }
5167 /// }
5168 pub services: std::collections::HashMap<std::string::String, crate::model::StateTimeline>,
5169
5170 /// Output only. The Google-generated unique ID for the
5171 /// `MulticloudDataTransferConfig` resource. This value is unique across all
5172 /// `MulticloudDataTransferConfig` resources. If a resource is deleted and
5173 /// another with the same name is created, the new resource is assigned a
5174 /// different and unique ID.
5175 pub uid: std::string::String,
5176
5177 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5178}
5179
5180impl MulticloudDataTransferConfig {
5181 pub fn new() -> Self {
5182 std::default::Default::default()
5183 }
5184
5185 /// Sets the value of [name][crate::model::MulticloudDataTransferConfig::name].
5186 ///
5187 /// # Example
5188 /// ```ignore,no_run
5189 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5190 /// let x = MulticloudDataTransferConfig::new().set_name("example");
5191 /// ```
5192 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5193 self.name = v.into();
5194 self
5195 }
5196
5197 /// Sets the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
5198 ///
5199 /// # Example
5200 /// ```ignore,no_run
5201 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5202 /// use wkt::Timestamp;
5203 /// let x = MulticloudDataTransferConfig::new().set_create_time(Timestamp::default()/* use setters */);
5204 /// ```
5205 pub fn set_create_time<T>(mut self, v: T) -> Self
5206 where
5207 T: std::convert::Into<wkt::Timestamp>,
5208 {
5209 self.create_time = std::option::Option::Some(v.into());
5210 self
5211 }
5212
5213 /// Sets or clears the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
5214 ///
5215 /// # Example
5216 /// ```ignore,no_run
5217 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5218 /// use wkt::Timestamp;
5219 /// let x = MulticloudDataTransferConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5220 /// let x = MulticloudDataTransferConfig::new().set_or_clear_create_time(None::<Timestamp>);
5221 /// ```
5222 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5223 where
5224 T: std::convert::Into<wkt::Timestamp>,
5225 {
5226 self.create_time = v.map(|x| x.into());
5227 self
5228 }
5229
5230 /// Sets the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
5231 ///
5232 /// # Example
5233 /// ```ignore,no_run
5234 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5235 /// use wkt::Timestamp;
5236 /// let x = MulticloudDataTransferConfig::new().set_update_time(Timestamp::default()/* use setters */);
5237 /// ```
5238 pub fn set_update_time<T>(mut self, v: T) -> Self
5239 where
5240 T: std::convert::Into<wkt::Timestamp>,
5241 {
5242 self.update_time = std::option::Option::Some(v.into());
5243 self
5244 }
5245
5246 /// Sets or clears the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
5247 ///
5248 /// # Example
5249 /// ```ignore,no_run
5250 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5251 /// use wkt::Timestamp;
5252 /// let x = MulticloudDataTransferConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5253 /// let x = MulticloudDataTransferConfig::new().set_or_clear_update_time(None::<Timestamp>);
5254 /// ```
5255 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5256 where
5257 T: std::convert::Into<wkt::Timestamp>,
5258 {
5259 self.update_time = v.map(|x| x.into());
5260 self
5261 }
5262
5263 /// Sets the value of [labels][crate::model::MulticloudDataTransferConfig::labels].
5264 ///
5265 /// # Example
5266 /// ```ignore,no_run
5267 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5268 /// let x = MulticloudDataTransferConfig::new().set_labels([
5269 /// ("key0", "abc"),
5270 /// ("key1", "xyz"),
5271 /// ]);
5272 /// ```
5273 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5274 where
5275 T: std::iter::IntoIterator<Item = (K, V)>,
5276 K: std::convert::Into<std::string::String>,
5277 V: std::convert::Into<std::string::String>,
5278 {
5279 use std::iter::Iterator;
5280 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5281 self
5282 }
5283
5284 /// Sets the value of [etag][crate::model::MulticloudDataTransferConfig::etag].
5285 ///
5286 /// # Example
5287 /// ```ignore,no_run
5288 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5289 /// let x = MulticloudDataTransferConfig::new().set_etag("example");
5290 /// ```
5291 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5292 self.etag = v.into();
5293 self
5294 }
5295
5296 /// Sets the value of [description][crate::model::MulticloudDataTransferConfig::description].
5297 ///
5298 /// # Example
5299 /// ```ignore,no_run
5300 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5301 /// let x = MulticloudDataTransferConfig::new().set_description("example");
5302 /// ```
5303 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5304 self.description = v.into();
5305 self
5306 }
5307
5308 /// Sets the value of [destinations_count][crate::model::MulticloudDataTransferConfig::destinations_count].
5309 ///
5310 /// # Example
5311 /// ```ignore,no_run
5312 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5313 /// let x = MulticloudDataTransferConfig::new().set_destinations_count(42);
5314 /// ```
5315 pub fn set_destinations_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5316 self.destinations_count = v.into();
5317 self
5318 }
5319
5320 /// Sets the value of [destinations_active_count][crate::model::MulticloudDataTransferConfig::destinations_active_count].
5321 ///
5322 /// # Example
5323 /// ```ignore,no_run
5324 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5325 /// let x = MulticloudDataTransferConfig::new().set_destinations_active_count(42);
5326 /// ```
5327 pub fn set_destinations_active_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5328 self.destinations_active_count = v.into();
5329 self
5330 }
5331
5332 /// Sets the value of [services][crate::model::MulticloudDataTransferConfig::services].
5333 ///
5334 /// # Example
5335 /// ```ignore,no_run
5336 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5337 /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
5338 /// let x = MulticloudDataTransferConfig::new().set_services([
5339 /// ("key0", StateTimeline::default()/* use setters */),
5340 /// ("key1", StateTimeline::default()/* use (different) setters */),
5341 /// ]);
5342 /// ```
5343 pub fn set_services<T, K, V>(mut self, v: T) -> Self
5344 where
5345 T: std::iter::IntoIterator<Item = (K, V)>,
5346 K: std::convert::Into<std::string::String>,
5347 V: std::convert::Into<crate::model::StateTimeline>,
5348 {
5349 use std::iter::Iterator;
5350 self.services = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5351 self
5352 }
5353
5354 /// Sets the value of [uid][crate::model::MulticloudDataTransferConfig::uid].
5355 ///
5356 /// # Example
5357 /// ```ignore,no_run
5358 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5359 /// let x = MulticloudDataTransferConfig::new().set_uid("example");
5360 /// ```
5361 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5362 self.uid = v.into();
5363 self
5364 }
5365}
5366
5367impl wkt::message::Message for MulticloudDataTransferConfig {
5368 fn typename() -> &'static str {
5369 "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferConfig"
5370 }
5371}
5372
5373/// Request message to list `MulticloudDataTransferConfig` resources.
5374#[derive(Clone, Default, PartialEq)]
5375#[non_exhaustive]
5376pub struct ListMulticloudDataTransferConfigsRequest {
5377 /// Required. The name of the parent resource.
5378 pub parent: std::string::String,
5379
5380 /// Optional. The maximum number of results listed per page.
5381 pub page_size: i32,
5382
5383 /// Optional. The page token.
5384 pub page_token: std::string::String,
5385
5386 /// Optional. An expression that filters the results listed in the response.
5387 pub filter: std::string::String,
5388
5389 /// Optional. The sort order of the results.
5390 pub order_by: std::string::String,
5391
5392 /// Optional. If `true`, allows partial responses for multi-regional aggregated
5393 /// list requests.
5394 pub return_partial_success: bool,
5395
5396 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5397}
5398
5399impl ListMulticloudDataTransferConfigsRequest {
5400 pub fn new() -> Self {
5401 std::default::Default::default()
5402 }
5403
5404 /// Sets the value of [parent][crate::model::ListMulticloudDataTransferConfigsRequest::parent].
5405 ///
5406 /// # Example
5407 /// ```ignore,no_run
5408 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5409 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_parent("example");
5410 /// ```
5411 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5412 self.parent = v.into();
5413 self
5414 }
5415
5416 /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferConfigsRequest::page_size].
5417 ///
5418 /// # Example
5419 /// ```ignore,no_run
5420 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5421 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_page_size(42);
5422 /// ```
5423 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5424 self.page_size = v.into();
5425 self
5426 }
5427
5428 /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferConfigsRequest::page_token].
5429 ///
5430 /// # Example
5431 /// ```ignore,no_run
5432 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5433 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_page_token("example");
5434 /// ```
5435 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5436 self.page_token = v.into();
5437 self
5438 }
5439
5440 /// Sets the value of [filter][crate::model::ListMulticloudDataTransferConfigsRequest::filter].
5441 ///
5442 /// # Example
5443 /// ```ignore,no_run
5444 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5445 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_filter("example");
5446 /// ```
5447 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5448 self.filter = v.into();
5449 self
5450 }
5451
5452 /// Sets the value of [order_by][crate::model::ListMulticloudDataTransferConfigsRequest::order_by].
5453 ///
5454 /// # Example
5455 /// ```ignore,no_run
5456 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5457 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_order_by("example");
5458 /// ```
5459 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5460 self.order_by = v.into();
5461 self
5462 }
5463
5464 /// Sets the value of [return_partial_success][crate::model::ListMulticloudDataTransferConfigsRequest::return_partial_success].
5465 ///
5466 /// # Example
5467 /// ```ignore,no_run
5468 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5469 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_return_partial_success(true);
5470 /// ```
5471 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5472 self.return_partial_success = v.into();
5473 self
5474 }
5475}
5476
5477impl wkt::message::Message for ListMulticloudDataTransferConfigsRequest {
5478 fn typename() -> &'static str {
5479 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsRequest"
5480 }
5481}
5482
5483/// Response message to list `MulticloudDataTransferConfig` resources.
5484#[derive(Clone, Default, PartialEq)]
5485#[non_exhaustive]
5486pub struct ListMulticloudDataTransferConfigsResponse {
5487 /// The list of `MulticloudDataTransferConfig` resources to be listed.
5488 pub multicloud_data_transfer_configs: std::vec::Vec<crate::model::MulticloudDataTransferConfig>,
5489
5490 /// The next page token.
5491 pub next_page_token: std::string::String,
5492
5493 /// Locations that could not be reached.
5494 pub unreachable: std::vec::Vec<std::string::String>,
5495
5496 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5497}
5498
5499impl ListMulticloudDataTransferConfigsResponse {
5500 pub fn new() -> Self {
5501 std::default::Default::default()
5502 }
5503
5504 /// Sets the value of [multicloud_data_transfer_configs][crate::model::ListMulticloudDataTransferConfigsResponse::multicloud_data_transfer_configs].
5505 ///
5506 /// # Example
5507 /// ```ignore,no_run
5508 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5509 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5510 /// let x = ListMulticloudDataTransferConfigsResponse::new()
5511 /// .set_multicloud_data_transfer_configs([
5512 /// MulticloudDataTransferConfig::default()/* use setters */,
5513 /// MulticloudDataTransferConfig::default()/* use (different) setters */,
5514 /// ]);
5515 /// ```
5516 pub fn set_multicloud_data_transfer_configs<T, V>(mut self, v: T) -> Self
5517 where
5518 T: std::iter::IntoIterator<Item = V>,
5519 V: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5520 {
5521 use std::iter::Iterator;
5522 self.multicloud_data_transfer_configs = v.into_iter().map(|i| i.into()).collect();
5523 self
5524 }
5525
5526 /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferConfigsResponse::next_page_token].
5527 ///
5528 /// # Example
5529 /// ```ignore,no_run
5530 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5531 /// let x = ListMulticloudDataTransferConfigsResponse::new().set_next_page_token("example");
5532 /// ```
5533 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5534 self.next_page_token = v.into();
5535 self
5536 }
5537
5538 /// Sets the value of [unreachable][crate::model::ListMulticloudDataTransferConfigsResponse::unreachable].
5539 ///
5540 /// # Example
5541 /// ```ignore,no_run
5542 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5543 /// let x = ListMulticloudDataTransferConfigsResponse::new().set_unreachable(["a", "b", "c"]);
5544 /// ```
5545 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5546 where
5547 T: std::iter::IntoIterator<Item = V>,
5548 V: std::convert::Into<std::string::String>,
5549 {
5550 use std::iter::Iterator;
5551 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5552 self
5553 }
5554}
5555
5556impl wkt::message::Message for ListMulticloudDataTransferConfigsResponse {
5557 fn typename() -> &'static str {
5558 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsResponse"
5559 }
5560}
5561
5562#[doc(hidden)]
5563impl google_cloud_gax::paginator::internal::PageableResponse
5564 for ListMulticloudDataTransferConfigsResponse
5565{
5566 type PageItem = crate::model::MulticloudDataTransferConfig;
5567
5568 fn items(self) -> std::vec::Vec<Self::PageItem> {
5569 self.multicloud_data_transfer_configs
5570 }
5571
5572 fn next_page_token(&self) -> std::string::String {
5573 use std::clone::Clone;
5574 self.next_page_token.clone()
5575 }
5576}
5577
5578/// Request message to get the details of a `MulticloudDataTransferConfig`
5579/// resource.
5580#[derive(Clone, Default, PartialEq)]
5581#[non_exhaustive]
5582pub struct GetMulticloudDataTransferConfigRequest {
5583 /// Required. The name of the `MulticloudDataTransferConfig` resource to get.
5584 pub name: std::string::String,
5585
5586 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5587}
5588
5589impl GetMulticloudDataTransferConfigRequest {
5590 pub fn new() -> Self {
5591 std::default::Default::default()
5592 }
5593
5594 /// Sets the value of [name][crate::model::GetMulticloudDataTransferConfigRequest::name].
5595 ///
5596 /// # Example
5597 /// ```ignore,no_run
5598 /// # use google_cloud_networkconnectivity_v1::model::GetMulticloudDataTransferConfigRequest;
5599 /// let x = GetMulticloudDataTransferConfigRequest::new().set_name("example");
5600 /// ```
5601 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5602 self.name = v.into();
5603 self
5604 }
5605}
5606
5607impl wkt::message::Message for GetMulticloudDataTransferConfigRequest {
5608 fn typename() -> &'static str {
5609 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferConfigRequest"
5610 }
5611}
5612
5613/// Request message to create a `MulticloudDataTransferConfig` resource.
5614#[derive(Clone, Default, PartialEq)]
5615#[non_exhaustive]
5616pub struct CreateMulticloudDataTransferConfigRequest {
5617 /// Required. The name of the parent resource.
5618 pub parent: std::string::String,
5619
5620 /// Required. The ID to use for the `MulticloudDataTransferConfig` resource,
5621 /// which becomes the final component of the `MulticloudDataTransferConfig`
5622 /// resource name.
5623 pub multicloud_data_transfer_config_id: std::string::String,
5624
5625 /// Required. The `MulticloudDataTransferConfig` resource to create.
5626 pub multicloud_data_transfer_config:
5627 std::option::Option<crate::model::MulticloudDataTransferConfig>,
5628
5629 /// Optional. A request ID to identify requests. Specify a unique request ID
5630 /// so that if you must retry your request, the server can ignore
5631 /// the request if it has already been completed. The server waits
5632 /// for at least 60 minutes since the first request.
5633 ///
5634 /// For example, consider a situation where you make an initial request and
5635 /// the request times out. If you make the request again with the same request
5636 /// ID, the server can check if original operation with the same request ID
5637 /// was received, and if so, can ignore the second request. This prevents
5638 /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5639 /// resources.
5640 ///
5641 /// The request ID must be a valid UUID with the exception that zero UUID
5642 /// (00000000-0000-0000-0000-000000000000) isn't supported.
5643 pub request_id: std::string::String,
5644
5645 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5646}
5647
5648impl CreateMulticloudDataTransferConfigRequest {
5649 pub fn new() -> Self {
5650 std::default::Default::default()
5651 }
5652
5653 /// Sets the value of [parent][crate::model::CreateMulticloudDataTransferConfigRequest::parent].
5654 ///
5655 /// # Example
5656 /// ```ignore,no_run
5657 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5658 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_parent("example");
5659 /// ```
5660 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5661 self.parent = v.into();
5662 self
5663 }
5664
5665 /// Sets the value of [multicloud_data_transfer_config_id][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config_id].
5666 ///
5667 /// # Example
5668 /// ```ignore,no_run
5669 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5670 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config_id("example");
5671 /// ```
5672 pub fn set_multicloud_data_transfer_config_id<T: std::convert::Into<std::string::String>>(
5673 mut self,
5674 v: T,
5675 ) -> Self {
5676 self.multicloud_data_transfer_config_id = v.into();
5677 self
5678 }
5679
5680 /// Sets the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5681 ///
5682 /// # Example
5683 /// ```ignore,no_run
5684 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5685 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5686 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config(MulticloudDataTransferConfig::default()/* use setters */);
5687 /// ```
5688 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
5689 where
5690 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5691 {
5692 self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
5693 self
5694 }
5695
5696 /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5697 ///
5698 /// # Example
5699 /// ```ignore,no_run
5700 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5701 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5702 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(Some(MulticloudDataTransferConfig::default()/* use setters */));
5703 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(None::<MulticloudDataTransferConfig>);
5704 /// ```
5705 pub fn set_or_clear_multicloud_data_transfer_config<T>(
5706 mut self,
5707 v: std::option::Option<T>,
5708 ) -> Self
5709 where
5710 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5711 {
5712 self.multicloud_data_transfer_config = v.map(|x| x.into());
5713 self
5714 }
5715
5716 /// Sets the value of [request_id][crate::model::CreateMulticloudDataTransferConfigRequest::request_id].
5717 ///
5718 /// # Example
5719 /// ```ignore,no_run
5720 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5721 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_request_id("example");
5722 /// ```
5723 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5724 self.request_id = v.into();
5725 self
5726 }
5727}
5728
5729impl wkt::message::Message for CreateMulticloudDataTransferConfigRequest {
5730 fn typename() -> &'static str {
5731 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateMulticloudDataTransferConfigRequest"
5732 }
5733}
5734
5735/// Request message to update a `MulticloudDataTransferConfig` resource.
5736#[derive(Clone, Default, PartialEq)]
5737#[non_exhaustive]
5738pub struct UpdateMulticloudDataTransferConfigRequest {
5739 /// Optional. `FieldMask` is used to specify the fields in the
5740 /// `MulticloudDataTransferConfig` resource to be overwritten by the update.
5741 /// The fields specified in `update_mask` are relative to the resource, not
5742 /// the full request. A field is overwritten if it is in the mask. If you
5743 /// don't specify a mask, all fields are overwritten.
5744 pub update_mask: std::option::Option<wkt::FieldMask>,
5745
5746 /// Required. The `MulticloudDataTransferConfig` resource to update.
5747 pub multicloud_data_transfer_config:
5748 std::option::Option<crate::model::MulticloudDataTransferConfig>,
5749
5750 /// Optional. A request ID to identify requests. Specify a unique request ID
5751 /// so that if you must retry your request, the server can ignore
5752 /// the request if it has already been completed. The server waits
5753 /// for at least 60 minutes since the first request.
5754 ///
5755 /// For example, consider a situation where you make an initial request and
5756 /// the request times out. If you make the request again with the same request
5757 /// ID, the server can check if original operation with the same request ID
5758 /// was received, and if so, can ignore the second request. This prevents
5759 /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5760 /// resources.
5761 ///
5762 /// The request ID must be a valid UUID with the exception that zero UUID
5763 /// (00000000-0000-0000-0000-000000000000) isn't supported.
5764 pub request_id: std::string::String,
5765
5766 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5767}
5768
5769impl UpdateMulticloudDataTransferConfigRequest {
5770 pub fn new() -> Self {
5771 std::default::Default::default()
5772 }
5773
5774 /// Sets the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
5775 ///
5776 /// # Example
5777 /// ```ignore,no_run
5778 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5779 /// use wkt::FieldMask;
5780 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5781 /// ```
5782 pub fn set_update_mask<T>(mut self, v: T) -> Self
5783 where
5784 T: std::convert::Into<wkt::FieldMask>,
5785 {
5786 self.update_mask = std::option::Option::Some(v.into());
5787 self
5788 }
5789
5790 /// Sets or clears the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
5791 ///
5792 /// # Example
5793 /// ```ignore,no_run
5794 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5795 /// use wkt::FieldMask;
5796 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5797 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5798 /// ```
5799 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5800 where
5801 T: std::convert::Into<wkt::FieldMask>,
5802 {
5803 self.update_mask = v.map(|x| x.into());
5804 self
5805 }
5806
5807 /// Sets the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5808 ///
5809 /// # Example
5810 /// ```ignore,no_run
5811 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5812 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5813 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config(MulticloudDataTransferConfig::default()/* use setters */);
5814 /// ```
5815 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
5816 where
5817 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5818 {
5819 self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
5820 self
5821 }
5822
5823 /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5824 ///
5825 /// # Example
5826 /// ```ignore,no_run
5827 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5828 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5829 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(Some(MulticloudDataTransferConfig::default()/* use setters */));
5830 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(None::<MulticloudDataTransferConfig>);
5831 /// ```
5832 pub fn set_or_clear_multicloud_data_transfer_config<T>(
5833 mut self,
5834 v: std::option::Option<T>,
5835 ) -> Self
5836 where
5837 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5838 {
5839 self.multicloud_data_transfer_config = v.map(|x| x.into());
5840 self
5841 }
5842
5843 /// Sets the value of [request_id][crate::model::UpdateMulticloudDataTransferConfigRequest::request_id].
5844 ///
5845 /// # Example
5846 /// ```ignore,no_run
5847 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5848 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_request_id("example");
5849 /// ```
5850 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5851 self.request_id = v.into();
5852 self
5853 }
5854}
5855
5856impl wkt::message::Message for UpdateMulticloudDataTransferConfigRequest {
5857 fn typename() -> &'static str {
5858 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateMulticloudDataTransferConfigRequest"
5859 }
5860}
5861
5862/// Request message to delete a `MulticloudDataTransferConfig` resource.
5863#[derive(Clone, Default, PartialEq)]
5864#[non_exhaustive]
5865pub struct DeleteMulticloudDataTransferConfigRequest {
5866 /// Required. The name of the `MulticloudDataTransferConfig` resource to
5867 /// delete.
5868 pub name: std::string::String,
5869
5870 /// Optional. A request ID to identify requests. Specify a unique request ID
5871 /// so that if you must retry your request, the server can ignore
5872 /// the request if it has already been completed. The server waits
5873 /// for at least 60 minutes since the first request.
5874 ///
5875 /// For example, consider a situation where you make an initial request and
5876 /// the request times out. If you make the request again with the same request
5877 /// ID, the server can check if original operation with the same request ID
5878 /// was received, and if so, can ignore the second request. This prevents
5879 /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5880 /// resources.
5881 ///
5882 /// The request ID must be a valid UUID with the exception that zero UUID
5883 /// (00000000-0000-0000-0000-000000000000) isn't supported.
5884 pub request_id: std::string::String,
5885
5886 /// Optional. The etag is computed by the server, and might be sent with update
5887 /// and delete requests so that the client has an up-to-date value before
5888 /// proceeding.
5889 pub etag: std::string::String,
5890
5891 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5892}
5893
5894impl DeleteMulticloudDataTransferConfigRequest {
5895 pub fn new() -> Self {
5896 std::default::Default::default()
5897 }
5898
5899 /// Sets the value of [name][crate::model::DeleteMulticloudDataTransferConfigRequest::name].
5900 ///
5901 /// # Example
5902 /// ```ignore,no_run
5903 /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
5904 /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_name("example");
5905 /// ```
5906 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5907 self.name = v.into();
5908 self
5909 }
5910
5911 /// Sets the value of [request_id][crate::model::DeleteMulticloudDataTransferConfigRequest::request_id].
5912 ///
5913 /// # Example
5914 /// ```ignore,no_run
5915 /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
5916 /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_request_id("example");
5917 /// ```
5918 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5919 self.request_id = v.into();
5920 self
5921 }
5922
5923 /// Sets the value of [etag][crate::model::DeleteMulticloudDataTransferConfigRequest::etag].
5924 ///
5925 /// # Example
5926 /// ```ignore,no_run
5927 /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
5928 /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_etag("example");
5929 /// ```
5930 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5931 self.etag = v.into();
5932 self
5933 }
5934}
5935
5936impl wkt::message::Message for DeleteMulticloudDataTransferConfigRequest {
5937 fn typename() -> &'static str {
5938 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteMulticloudDataTransferConfigRequest"
5939 }
5940}
5941
5942/// The `Destination` resource. It specifies the IP prefix and the associated
5943/// autonomous system numbers (ASN) that you want to include in a
5944/// `MulticloudDataTransferConfig` resource.
5945#[derive(Clone, Default, PartialEq)]
5946#[non_exhaustive]
5947pub struct Destination {
5948 /// Identifier. The name of the `Destination` resource.
5949 /// Format:
5950 /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}/destinations/{destination}`.
5951 pub name: std::string::String,
5952
5953 /// Output only. Time when the `Destination` resource was created.
5954 pub create_time: std::option::Option<wkt::Timestamp>,
5955
5956 /// Output only. Time when the `Destination` resource was updated.
5957 pub update_time: std::option::Option<wkt::Timestamp>,
5958
5959 /// Optional. User-defined labels.
5960 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5961
5962 /// The etag is computed by the server, and might be sent with update and
5963 /// delete requests so that the client has an up-to-date value before
5964 /// proceeding.
5965 pub etag: std::string::String,
5966
5967 /// Optional. A description of this resource.
5968 pub description: std::string::String,
5969
5970 /// Required. Immutable. The IP prefix that represents your workload on another
5971 /// CSP.
5972 pub ip_prefix: std::string::String,
5973
5974 /// Required. Unordered list. The list of `DestinationEndpoint` resources
5975 /// configured for the IP prefix.
5976 pub endpoints: std::vec::Vec<crate::model::destination::DestinationEndpoint>,
5977
5978 /// Output only. The timeline of the expected `Destination` states or the
5979 /// current rest state. If a state change is expected, the value is `ADDING`,
5980 /// `DELETING` or `SUSPENDING`, depending on the action specified.
5981 ///
5982 /// Example:
5983 /// "state_timeline": {
5984 /// "states": [
5985 /// {
5986 /// // The time when the `Destination` resource will be activated.
5987 /// "effectiveTime": "2024-12-01T08:00:00Z",
5988 /// "state": "ADDING"
5989 /// },
5990 /// {
5991 /// // The time when the `Destination` resource will be suspended.
5992 /// "effectiveTime": "2024-12-01T20:00:00Z",
5993 /// "state": "SUSPENDING"
5994 /// }
5995 /// ]
5996 /// }
5997 pub state_timeline: std::option::Option<crate::model::StateTimeline>,
5998
5999 /// Output only. The Google-generated unique ID for the `Destination` resource.
6000 /// This value is unique across all `Destination` resources.
6001 /// If a resource is deleted and another with the same name is
6002 /// created, the new resource is assigned a different and unique ID.
6003 pub uid: std::string::String,
6004
6005 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6006}
6007
6008impl Destination {
6009 pub fn new() -> Self {
6010 std::default::Default::default()
6011 }
6012
6013 /// Sets the value of [name][crate::model::Destination::name].
6014 ///
6015 /// # Example
6016 /// ```ignore,no_run
6017 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6018 /// let x = Destination::new().set_name("example");
6019 /// ```
6020 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6021 self.name = v.into();
6022 self
6023 }
6024
6025 /// Sets the value of [create_time][crate::model::Destination::create_time].
6026 ///
6027 /// # Example
6028 /// ```ignore,no_run
6029 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6030 /// use wkt::Timestamp;
6031 /// let x = Destination::new().set_create_time(Timestamp::default()/* use setters */);
6032 /// ```
6033 pub fn set_create_time<T>(mut self, v: T) -> Self
6034 where
6035 T: std::convert::Into<wkt::Timestamp>,
6036 {
6037 self.create_time = std::option::Option::Some(v.into());
6038 self
6039 }
6040
6041 /// Sets or clears the value of [create_time][crate::model::Destination::create_time].
6042 ///
6043 /// # Example
6044 /// ```ignore,no_run
6045 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6046 /// use wkt::Timestamp;
6047 /// let x = Destination::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6048 /// let x = Destination::new().set_or_clear_create_time(None::<Timestamp>);
6049 /// ```
6050 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6051 where
6052 T: std::convert::Into<wkt::Timestamp>,
6053 {
6054 self.create_time = v.map(|x| x.into());
6055 self
6056 }
6057
6058 /// Sets the value of [update_time][crate::model::Destination::update_time].
6059 ///
6060 /// # Example
6061 /// ```ignore,no_run
6062 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6063 /// use wkt::Timestamp;
6064 /// let x = Destination::new().set_update_time(Timestamp::default()/* use setters */);
6065 /// ```
6066 pub fn set_update_time<T>(mut self, v: T) -> Self
6067 where
6068 T: std::convert::Into<wkt::Timestamp>,
6069 {
6070 self.update_time = std::option::Option::Some(v.into());
6071 self
6072 }
6073
6074 /// Sets or clears the value of [update_time][crate::model::Destination::update_time].
6075 ///
6076 /// # Example
6077 /// ```ignore,no_run
6078 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6079 /// use wkt::Timestamp;
6080 /// let x = Destination::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6081 /// let x = Destination::new().set_or_clear_update_time(None::<Timestamp>);
6082 /// ```
6083 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6084 where
6085 T: std::convert::Into<wkt::Timestamp>,
6086 {
6087 self.update_time = v.map(|x| x.into());
6088 self
6089 }
6090
6091 /// Sets the value of [labels][crate::model::Destination::labels].
6092 ///
6093 /// # Example
6094 /// ```ignore,no_run
6095 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6096 /// let x = Destination::new().set_labels([
6097 /// ("key0", "abc"),
6098 /// ("key1", "xyz"),
6099 /// ]);
6100 /// ```
6101 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6102 where
6103 T: std::iter::IntoIterator<Item = (K, V)>,
6104 K: std::convert::Into<std::string::String>,
6105 V: std::convert::Into<std::string::String>,
6106 {
6107 use std::iter::Iterator;
6108 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6109 self
6110 }
6111
6112 /// Sets the value of [etag][crate::model::Destination::etag].
6113 ///
6114 /// # Example
6115 /// ```ignore,no_run
6116 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6117 /// let x = Destination::new().set_etag("example");
6118 /// ```
6119 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6120 self.etag = v.into();
6121 self
6122 }
6123
6124 /// Sets the value of [description][crate::model::Destination::description].
6125 ///
6126 /// # Example
6127 /// ```ignore,no_run
6128 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6129 /// let x = Destination::new().set_description("example");
6130 /// ```
6131 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6132 self.description = v.into();
6133 self
6134 }
6135
6136 /// Sets the value of [ip_prefix][crate::model::Destination::ip_prefix].
6137 ///
6138 /// # Example
6139 /// ```ignore,no_run
6140 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6141 /// let x = Destination::new().set_ip_prefix("example");
6142 /// ```
6143 pub fn set_ip_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6144 self.ip_prefix = v.into();
6145 self
6146 }
6147
6148 /// Sets the value of [endpoints][crate::model::Destination::endpoints].
6149 ///
6150 /// # Example
6151 /// ```ignore,no_run
6152 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6153 /// use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6154 /// let x = Destination::new()
6155 /// .set_endpoints([
6156 /// DestinationEndpoint::default()/* use setters */,
6157 /// DestinationEndpoint::default()/* use (different) setters */,
6158 /// ]);
6159 /// ```
6160 pub fn set_endpoints<T, V>(mut self, v: T) -> Self
6161 where
6162 T: std::iter::IntoIterator<Item = V>,
6163 V: std::convert::Into<crate::model::destination::DestinationEndpoint>,
6164 {
6165 use std::iter::Iterator;
6166 self.endpoints = v.into_iter().map(|i| i.into()).collect();
6167 self
6168 }
6169
6170 /// Sets the value of [state_timeline][crate::model::Destination::state_timeline].
6171 ///
6172 /// # Example
6173 /// ```ignore,no_run
6174 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6175 /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
6176 /// let x = Destination::new().set_state_timeline(StateTimeline::default()/* use setters */);
6177 /// ```
6178 pub fn set_state_timeline<T>(mut self, v: T) -> Self
6179 where
6180 T: std::convert::Into<crate::model::StateTimeline>,
6181 {
6182 self.state_timeline = std::option::Option::Some(v.into());
6183 self
6184 }
6185
6186 /// Sets or clears the value of [state_timeline][crate::model::Destination::state_timeline].
6187 ///
6188 /// # Example
6189 /// ```ignore,no_run
6190 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6191 /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
6192 /// let x = Destination::new().set_or_clear_state_timeline(Some(StateTimeline::default()/* use setters */));
6193 /// let x = Destination::new().set_or_clear_state_timeline(None::<StateTimeline>);
6194 /// ```
6195 pub fn set_or_clear_state_timeline<T>(mut self, v: std::option::Option<T>) -> Self
6196 where
6197 T: std::convert::Into<crate::model::StateTimeline>,
6198 {
6199 self.state_timeline = v.map(|x| x.into());
6200 self
6201 }
6202
6203 /// Sets the value of [uid][crate::model::Destination::uid].
6204 ///
6205 /// # Example
6206 /// ```ignore,no_run
6207 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6208 /// let x = Destination::new().set_uid("example");
6209 /// ```
6210 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6211 self.uid = v.into();
6212 self
6213 }
6214}
6215
6216impl wkt::message::Message for Destination {
6217 fn typename() -> &'static str {
6218 "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination"
6219 }
6220}
6221
6222/// Defines additional types related to [Destination].
6223pub mod destination {
6224 #[allow(unused_imports)]
6225 use super::*;
6226
6227 /// The metadata for a `DestinationEndpoint` resource.
6228 #[derive(Clone, Default, PartialEq)]
6229 #[non_exhaustive]
6230 pub struct DestinationEndpoint {
6231 /// Required. The ASN of the remote IP prefix.
6232 pub asn: i64,
6233
6234 /// Required. The CSP of the remote IP prefix.
6235 pub csp: std::string::String,
6236
6237 /// Output only. The state of the `DestinationEndpoint` resource.
6238 pub state: crate::model::destination::destination_endpoint::State,
6239
6240 /// Output only. Time when the `DestinationEndpoint` resource was updated.
6241 pub update_time: std::option::Option<wkt::Timestamp>,
6242
6243 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6244 }
6245
6246 impl DestinationEndpoint {
6247 pub fn new() -> Self {
6248 std::default::Default::default()
6249 }
6250
6251 /// Sets the value of [asn][crate::model::destination::DestinationEndpoint::asn].
6252 ///
6253 /// # Example
6254 /// ```ignore,no_run
6255 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6256 /// let x = DestinationEndpoint::new().set_asn(42);
6257 /// ```
6258 pub fn set_asn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6259 self.asn = v.into();
6260 self
6261 }
6262
6263 /// Sets the value of [csp][crate::model::destination::DestinationEndpoint::csp].
6264 ///
6265 /// # Example
6266 /// ```ignore,no_run
6267 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6268 /// let x = DestinationEndpoint::new().set_csp("example");
6269 /// ```
6270 pub fn set_csp<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6271 self.csp = v.into();
6272 self
6273 }
6274
6275 /// Sets the value of [state][crate::model::destination::DestinationEndpoint::state].
6276 ///
6277 /// # Example
6278 /// ```ignore,no_run
6279 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6280 /// use google_cloud_networkconnectivity_v1::model::destination::destination_endpoint::State;
6281 /// let x0 = DestinationEndpoint::new().set_state(State::Valid);
6282 /// let x1 = DestinationEndpoint::new().set_state(State::Invalid);
6283 /// ```
6284 pub fn set_state<
6285 T: std::convert::Into<crate::model::destination::destination_endpoint::State>,
6286 >(
6287 mut self,
6288 v: T,
6289 ) -> Self {
6290 self.state = v.into();
6291 self
6292 }
6293
6294 /// Sets the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
6295 ///
6296 /// # Example
6297 /// ```ignore,no_run
6298 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6299 /// use wkt::Timestamp;
6300 /// let x = DestinationEndpoint::new().set_update_time(Timestamp::default()/* use setters */);
6301 /// ```
6302 pub fn set_update_time<T>(mut self, v: T) -> Self
6303 where
6304 T: std::convert::Into<wkt::Timestamp>,
6305 {
6306 self.update_time = std::option::Option::Some(v.into());
6307 self
6308 }
6309
6310 /// Sets or clears the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
6311 ///
6312 /// # Example
6313 /// ```ignore,no_run
6314 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6315 /// use wkt::Timestamp;
6316 /// let x = DestinationEndpoint::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6317 /// let x = DestinationEndpoint::new().set_or_clear_update_time(None::<Timestamp>);
6318 /// ```
6319 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6320 where
6321 T: std::convert::Into<wkt::Timestamp>,
6322 {
6323 self.update_time = v.map(|x| x.into());
6324 self
6325 }
6326 }
6327
6328 impl wkt::message::Message for DestinationEndpoint {
6329 fn typename() -> &'static str {
6330 "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint"
6331 }
6332 }
6333
6334 /// Defines additional types related to [DestinationEndpoint].
6335 pub mod destination_endpoint {
6336 #[allow(unused_imports)]
6337 use super::*;
6338
6339 /// The state of the `DestinationEndpoint` resource.
6340 ///
6341 /// # Working with unknown values
6342 ///
6343 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6344 /// additional enum variants at any time. Adding new variants is not considered
6345 /// a breaking change. Applications should write their code in anticipation of:
6346 ///
6347 /// - New values appearing in future releases of the client library, **and**
6348 /// - New values received dynamically, without application changes.
6349 ///
6350 /// Please consult the [Working with enums] section in the user guide for some
6351 /// guidelines.
6352 ///
6353 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6354 #[derive(Clone, Debug, PartialEq)]
6355 #[non_exhaustive]
6356 pub enum State {
6357 /// An invalid state, which is the default case.
6358 Unspecified,
6359 /// The `DestinationEndpoint` resource is valid.
6360 Valid,
6361 /// The `DestinationEndpoint` resource is invalid.
6362 Invalid,
6363 /// If set, the enum was initialized with an unknown value.
6364 ///
6365 /// Applications can examine the value using [State::value] or
6366 /// [State::name].
6367 UnknownValue(state::UnknownValue),
6368 }
6369
6370 #[doc(hidden)]
6371 pub mod state {
6372 #[allow(unused_imports)]
6373 use super::*;
6374 #[derive(Clone, Debug, PartialEq)]
6375 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6376 }
6377
6378 impl State {
6379 /// Gets the enum value.
6380 ///
6381 /// Returns `None` if the enum contains an unknown value deserialized from
6382 /// the string representation of enums.
6383 pub fn value(&self) -> std::option::Option<i32> {
6384 match self {
6385 Self::Unspecified => std::option::Option::Some(0),
6386 Self::Valid => std::option::Option::Some(1),
6387 Self::Invalid => std::option::Option::Some(2),
6388 Self::UnknownValue(u) => u.0.value(),
6389 }
6390 }
6391
6392 /// Gets the enum value as a string.
6393 ///
6394 /// Returns `None` if the enum contains an unknown value deserialized from
6395 /// the integer representation of enums.
6396 pub fn name(&self) -> std::option::Option<&str> {
6397 match self {
6398 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6399 Self::Valid => std::option::Option::Some("VALID"),
6400 Self::Invalid => std::option::Option::Some("INVALID"),
6401 Self::UnknownValue(u) => u.0.name(),
6402 }
6403 }
6404 }
6405
6406 impl std::default::Default for State {
6407 fn default() -> Self {
6408 use std::convert::From;
6409 Self::from(0)
6410 }
6411 }
6412
6413 impl std::fmt::Display for State {
6414 fn fmt(
6415 &self,
6416 f: &mut std::fmt::Formatter<'_>,
6417 ) -> std::result::Result<(), std::fmt::Error> {
6418 wkt::internal::display_enum(f, self.name(), self.value())
6419 }
6420 }
6421
6422 impl std::convert::From<i32> for State {
6423 fn from(value: i32) -> Self {
6424 match value {
6425 0 => Self::Unspecified,
6426 1 => Self::Valid,
6427 2 => Self::Invalid,
6428 _ => Self::UnknownValue(state::UnknownValue(
6429 wkt::internal::UnknownEnumValue::Integer(value),
6430 )),
6431 }
6432 }
6433 }
6434
6435 impl std::convert::From<&str> for State {
6436 fn from(value: &str) -> Self {
6437 use std::string::ToString;
6438 match value {
6439 "STATE_UNSPECIFIED" => Self::Unspecified,
6440 "VALID" => Self::Valid,
6441 "INVALID" => Self::Invalid,
6442 _ => Self::UnknownValue(state::UnknownValue(
6443 wkt::internal::UnknownEnumValue::String(value.to_string()),
6444 )),
6445 }
6446 }
6447 }
6448
6449 impl serde::ser::Serialize for State {
6450 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6451 where
6452 S: serde::Serializer,
6453 {
6454 match self {
6455 Self::Unspecified => serializer.serialize_i32(0),
6456 Self::Valid => serializer.serialize_i32(1),
6457 Self::Invalid => serializer.serialize_i32(2),
6458 Self::UnknownValue(u) => u.0.serialize(serializer),
6459 }
6460 }
6461 }
6462
6463 impl<'de> serde::de::Deserialize<'de> for State {
6464 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6465 where
6466 D: serde::Deserializer<'de>,
6467 {
6468 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6469 ".google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint.State",
6470 ))
6471 }
6472 }
6473 }
6474}
6475
6476/// Request message to list `Destination` resources.
6477#[derive(Clone, Default, PartialEq)]
6478#[non_exhaustive]
6479pub struct ListDestinationsRequest {
6480 /// Required. The name of the parent resource.
6481 pub parent: std::string::String,
6482
6483 /// Optional. The maximum number of results listed per page.
6484 pub page_size: i32,
6485
6486 /// Optional. The page token.
6487 pub page_token: std::string::String,
6488
6489 /// Optional. An expression that filters the results listed in the response.
6490 pub filter: std::string::String,
6491
6492 /// Optional. The sort order of the results.
6493 pub order_by: std::string::String,
6494
6495 /// Optional. If `true`, allow partial responses for multi-regional aggregated
6496 /// list requests.
6497 pub return_partial_success: bool,
6498
6499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6500}
6501
6502impl ListDestinationsRequest {
6503 pub fn new() -> Self {
6504 std::default::Default::default()
6505 }
6506
6507 /// Sets the value of [parent][crate::model::ListDestinationsRequest::parent].
6508 ///
6509 /// # Example
6510 /// ```ignore,no_run
6511 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6512 /// let x = ListDestinationsRequest::new().set_parent("example");
6513 /// ```
6514 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6515 self.parent = v.into();
6516 self
6517 }
6518
6519 /// Sets the value of [page_size][crate::model::ListDestinationsRequest::page_size].
6520 ///
6521 /// # Example
6522 /// ```ignore,no_run
6523 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6524 /// let x = ListDestinationsRequest::new().set_page_size(42);
6525 /// ```
6526 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6527 self.page_size = v.into();
6528 self
6529 }
6530
6531 /// Sets the value of [page_token][crate::model::ListDestinationsRequest::page_token].
6532 ///
6533 /// # Example
6534 /// ```ignore,no_run
6535 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6536 /// let x = ListDestinationsRequest::new().set_page_token("example");
6537 /// ```
6538 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6539 self.page_token = v.into();
6540 self
6541 }
6542
6543 /// Sets the value of [filter][crate::model::ListDestinationsRequest::filter].
6544 ///
6545 /// # Example
6546 /// ```ignore,no_run
6547 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6548 /// let x = ListDestinationsRequest::new().set_filter("example");
6549 /// ```
6550 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6551 self.filter = v.into();
6552 self
6553 }
6554
6555 /// Sets the value of [order_by][crate::model::ListDestinationsRequest::order_by].
6556 ///
6557 /// # Example
6558 /// ```ignore,no_run
6559 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6560 /// let x = ListDestinationsRequest::new().set_order_by("example");
6561 /// ```
6562 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6563 self.order_by = v.into();
6564 self
6565 }
6566
6567 /// Sets the value of [return_partial_success][crate::model::ListDestinationsRequest::return_partial_success].
6568 ///
6569 /// # Example
6570 /// ```ignore,no_run
6571 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6572 /// let x = ListDestinationsRequest::new().set_return_partial_success(true);
6573 /// ```
6574 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6575 self.return_partial_success = v.into();
6576 self
6577 }
6578}
6579
6580impl wkt::message::Message for ListDestinationsRequest {
6581 fn typename() -> &'static str {
6582 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsRequest"
6583 }
6584}
6585
6586/// Response message to list `Destination` resources.
6587#[derive(Clone, Default, PartialEq)]
6588#[non_exhaustive]
6589pub struct ListDestinationsResponse {
6590 /// The list of `Destination` resources to be listed.
6591 pub destinations: std::vec::Vec<crate::model::Destination>,
6592
6593 /// The next page token.
6594 pub next_page_token: std::string::String,
6595
6596 /// Locations that could not be reached.
6597 pub unreachable: std::vec::Vec<std::string::String>,
6598
6599 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6600}
6601
6602impl ListDestinationsResponse {
6603 pub fn new() -> Self {
6604 std::default::Default::default()
6605 }
6606
6607 /// Sets the value of [destinations][crate::model::ListDestinationsResponse::destinations].
6608 ///
6609 /// # Example
6610 /// ```ignore,no_run
6611 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6612 /// use google_cloud_networkconnectivity_v1::model::Destination;
6613 /// let x = ListDestinationsResponse::new()
6614 /// .set_destinations([
6615 /// Destination::default()/* use setters */,
6616 /// Destination::default()/* use (different) setters */,
6617 /// ]);
6618 /// ```
6619 pub fn set_destinations<T, V>(mut self, v: T) -> Self
6620 where
6621 T: std::iter::IntoIterator<Item = V>,
6622 V: std::convert::Into<crate::model::Destination>,
6623 {
6624 use std::iter::Iterator;
6625 self.destinations = v.into_iter().map(|i| i.into()).collect();
6626 self
6627 }
6628
6629 /// Sets the value of [next_page_token][crate::model::ListDestinationsResponse::next_page_token].
6630 ///
6631 /// # Example
6632 /// ```ignore,no_run
6633 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6634 /// let x = ListDestinationsResponse::new().set_next_page_token("example");
6635 /// ```
6636 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6637 self.next_page_token = v.into();
6638 self
6639 }
6640
6641 /// Sets the value of [unreachable][crate::model::ListDestinationsResponse::unreachable].
6642 ///
6643 /// # Example
6644 /// ```ignore,no_run
6645 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6646 /// let x = ListDestinationsResponse::new().set_unreachable(["a", "b", "c"]);
6647 /// ```
6648 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6649 where
6650 T: std::iter::IntoIterator<Item = V>,
6651 V: std::convert::Into<std::string::String>,
6652 {
6653 use std::iter::Iterator;
6654 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6655 self
6656 }
6657}
6658
6659impl wkt::message::Message for ListDestinationsResponse {
6660 fn typename() -> &'static str {
6661 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsResponse"
6662 }
6663}
6664
6665#[doc(hidden)]
6666impl google_cloud_gax::paginator::internal::PageableResponse for ListDestinationsResponse {
6667 type PageItem = crate::model::Destination;
6668
6669 fn items(self) -> std::vec::Vec<Self::PageItem> {
6670 self.destinations
6671 }
6672
6673 fn next_page_token(&self) -> std::string::String {
6674 use std::clone::Clone;
6675 self.next_page_token.clone()
6676 }
6677}
6678
6679/// Request message to get the details of a `Destination` resource.
6680#[derive(Clone, Default, PartialEq)]
6681#[non_exhaustive]
6682pub struct GetDestinationRequest {
6683 /// Required. The name of the `Destination` resource to get.
6684 pub name: std::string::String,
6685
6686 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6687}
6688
6689impl GetDestinationRequest {
6690 pub fn new() -> Self {
6691 std::default::Default::default()
6692 }
6693
6694 /// Sets the value of [name][crate::model::GetDestinationRequest::name].
6695 ///
6696 /// # Example
6697 /// ```ignore,no_run
6698 /// # use google_cloud_networkconnectivity_v1::model::GetDestinationRequest;
6699 /// let x = GetDestinationRequest::new().set_name("example");
6700 /// ```
6701 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6702 self.name = v.into();
6703 self
6704 }
6705}
6706
6707impl wkt::message::Message for GetDestinationRequest {
6708 fn typename() -> &'static str {
6709 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetDestinationRequest"
6710 }
6711}
6712
6713/// Request message to create a `Destination` resource.
6714#[derive(Clone, Default, PartialEq)]
6715#[non_exhaustive]
6716pub struct CreateDestinationRequest {
6717 /// Required. The name of the parent resource.
6718 pub parent: std::string::String,
6719
6720 /// Required. The ID to use for the `Destination` resource, which becomes the
6721 /// final component of the `Destination` resource name.
6722 pub destination_id: std::string::String,
6723
6724 /// Required. The `Destination` resource to create.
6725 pub destination: std::option::Option<crate::model::Destination>,
6726
6727 /// Optional. A request ID to identify requests. Specify a unique request ID
6728 /// so that if you must retry your request, the server can ignore
6729 /// the request if it has already been completed. The server waits
6730 /// for at least 60 minutes since the first request.
6731 ///
6732 /// For example, consider a situation where you make an initial request and
6733 /// the request times out. If you make the request again with the same request
6734 /// ID, the server can check if original operation with the same request ID
6735 /// was received, and if so, can ignore the second request. This prevents
6736 /// clients from accidentally creating duplicate `Destination`
6737 /// resources.
6738 ///
6739 /// The request ID must be a valid UUID with the exception that zero UUID
6740 /// (00000000-0000-0000-0000-000000000000) isn't supported.
6741 pub request_id: std::string::String,
6742
6743 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6744}
6745
6746impl CreateDestinationRequest {
6747 pub fn new() -> Self {
6748 std::default::Default::default()
6749 }
6750
6751 /// Sets the value of [parent][crate::model::CreateDestinationRequest::parent].
6752 ///
6753 /// # Example
6754 /// ```ignore,no_run
6755 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6756 /// let x = CreateDestinationRequest::new().set_parent("example");
6757 /// ```
6758 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6759 self.parent = v.into();
6760 self
6761 }
6762
6763 /// Sets the value of [destination_id][crate::model::CreateDestinationRequest::destination_id].
6764 ///
6765 /// # Example
6766 /// ```ignore,no_run
6767 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6768 /// let x = CreateDestinationRequest::new().set_destination_id("example");
6769 /// ```
6770 pub fn set_destination_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6771 self.destination_id = v.into();
6772 self
6773 }
6774
6775 /// Sets the value of [destination][crate::model::CreateDestinationRequest::destination].
6776 ///
6777 /// # Example
6778 /// ```ignore,no_run
6779 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6780 /// use google_cloud_networkconnectivity_v1::model::Destination;
6781 /// let x = CreateDestinationRequest::new().set_destination(Destination::default()/* use setters */);
6782 /// ```
6783 pub fn set_destination<T>(mut self, v: T) -> Self
6784 where
6785 T: std::convert::Into<crate::model::Destination>,
6786 {
6787 self.destination = std::option::Option::Some(v.into());
6788 self
6789 }
6790
6791 /// Sets or clears the value of [destination][crate::model::CreateDestinationRequest::destination].
6792 ///
6793 /// # Example
6794 /// ```ignore,no_run
6795 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6796 /// use google_cloud_networkconnectivity_v1::model::Destination;
6797 /// let x = CreateDestinationRequest::new().set_or_clear_destination(Some(Destination::default()/* use setters */));
6798 /// let x = CreateDestinationRequest::new().set_or_clear_destination(None::<Destination>);
6799 /// ```
6800 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
6801 where
6802 T: std::convert::Into<crate::model::Destination>,
6803 {
6804 self.destination = v.map(|x| x.into());
6805 self
6806 }
6807
6808 /// Sets the value of [request_id][crate::model::CreateDestinationRequest::request_id].
6809 ///
6810 /// # Example
6811 /// ```ignore,no_run
6812 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6813 /// let x = CreateDestinationRequest::new().set_request_id("example");
6814 /// ```
6815 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6816 self.request_id = v.into();
6817 self
6818 }
6819}
6820
6821impl wkt::message::Message for CreateDestinationRequest {
6822 fn typename() -> &'static str {
6823 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateDestinationRequest"
6824 }
6825}
6826
6827/// Request message to update a `Destination` resource.
6828#[derive(Clone, Default, PartialEq)]
6829#[non_exhaustive]
6830pub struct UpdateDestinationRequest {
6831 /// Optional. `FieldMask is used to specify the fields to be overwritten in the
6832 /// `Destination` resource by the update.
6833 /// The fields specified in `update_mask` are relative to the resource, not
6834 /// the full request. A field is overwritten if it is in the mask. If you
6835 /// don't specify a mask, all fields are overwritten.
6836 pub update_mask: std::option::Option<wkt::FieldMask>,
6837
6838 /// Required. The `Destination` resource to update.
6839 pub destination: std::option::Option<crate::model::Destination>,
6840
6841 /// Optional. A request ID to identify requests. Specify a unique request ID
6842 /// so that if you must retry your request, the server can ignore
6843 /// the request if it has already been completed. The server waits
6844 /// for at least 60 minutes since the first request.
6845 ///
6846 /// For example, consider a situation where you make an initial request and
6847 /// the request times out. If you make the request again with the same request
6848 /// ID, the server can check if original operation with the same request ID
6849 /// was received, and if so, can ignore the second request.
6850 ///
6851 /// The request ID must be a valid UUID with the exception that zero UUID
6852 /// (00000000-0000-0000-0000-000000000000) isn't supported.
6853 pub request_id: std::string::String,
6854
6855 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6856}
6857
6858impl UpdateDestinationRequest {
6859 pub fn new() -> Self {
6860 std::default::Default::default()
6861 }
6862
6863 /// Sets the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
6864 ///
6865 /// # Example
6866 /// ```ignore,no_run
6867 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6868 /// use wkt::FieldMask;
6869 /// let x = UpdateDestinationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6870 /// ```
6871 pub fn set_update_mask<T>(mut self, v: T) -> Self
6872 where
6873 T: std::convert::Into<wkt::FieldMask>,
6874 {
6875 self.update_mask = std::option::Option::Some(v.into());
6876 self
6877 }
6878
6879 /// Sets or clears the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
6880 ///
6881 /// # Example
6882 /// ```ignore,no_run
6883 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6884 /// use wkt::FieldMask;
6885 /// let x = UpdateDestinationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6886 /// let x = UpdateDestinationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6887 /// ```
6888 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6889 where
6890 T: std::convert::Into<wkt::FieldMask>,
6891 {
6892 self.update_mask = v.map(|x| x.into());
6893 self
6894 }
6895
6896 /// Sets the value of [destination][crate::model::UpdateDestinationRequest::destination].
6897 ///
6898 /// # Example
6899 /// ```ignore,no_run
6900 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6901 /// use google_cloud_networkconnectivity_v1::model::Destination;
6902 /// let x = UpdateDestinationRequest::new().set_destination(Destination::default()/* use setters */);
6903 /// ```
6904 pub fn set_destination<T>(mut self, v: T) -> Self
6905 where
6906 T: std::convert::Into<crate::model::Destination>,
6907 {
6908 self.destination = std::option::Option::Some(v.into());
6909 self
6910 }
6911
6912 /// Sets or clears the value of [destination][crate::model::UpdateDestinationRequest::destination].
6913 ///
6914 /// # Example
6915 /// ```ignore,no_run
6916 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6917 /// use google_cloud_networkconnectivity_v1::model::Destination;
6918 /// let x = UpdateDestinationRequest::new().set_or_clear_destination(Some(Destination::default()/* use setters */));
6919 /// let x = UpdateDestinationRequest::new().set_or_clear_destination(None::<Destination>);
6920 /// ```
6921 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
6922 where
6923 T: std::convert::Into<crate::model::Destination>,
6924 {
6925 self.destination = v.map(|x| x.into());
6926 self
6927 }
6928
6929 /// Sets the value of [request_id][crate::model::UpdateDestinationRequest::request_id].
6930 ///
6931 /// # Example
6932 /// ```ignore,no_run
6933 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6934 /// let x = UpdateDestinationRequest::new().set_request_id("example");
6935 /// ```
6936 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6937 self.request_id = v.into();
6938 self
6939 }
6940}
6941
6942impl wkt::message::Message for UpdateDestinationRequest {
6943 fn typename() -> &'static str {
6944 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateDestinationRequest"
6945 }
6946}
6947
6948/// Request message to delete a `Destination` resource.
6949#[derive(Clone, Default, PartialEq)]
6950#[non_exhaustive]
6951pub struct DeleteDestinationRequest {
6952 /// Required. The name of the `Destination` resource to delete.
6953 pub name: std::string::String,
6954
6955 /// Optional. A request ID to identify requests. Specify a unique request ID
6956 /// so that if you must retry your request, the server can ignore
6957 /// the request if it has already been completed. The server waits
6958 /// for at least 60 minutes since the first request.
6959 ///
6960 /// For example, consider a situation where you make an initial request and
6961 /// the request times out. If you make the request again with the same request
6962 /// ID, the server can check if original operation with the same request ID
6963 /// was received, and if so, can ignore the second request.
6964 ///
6965 /// The request ID must be a valid UUID with the exception that zero UUID
6966 /// (00000000-0000-0000-0000-000000000000) isn't supported.
6967 pub request_id: std::string::String,
6968
6969 /// Optional. The etag is computed by the server, and might be sent with update
6970 /// and delete requests so that the client has an up-to-date value before
6971 /// proceeding.
6972 pub etag: std::string::String,
6973
6974 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6975}
6976
6977impl DeleteDestinationRequest {
6978 pub fn new() -> Self {
6979 std::default::Default::default()
6980 }
6981
6982 /// Sets the value of [name][crate::model::DeleteDestinationRequest::name].
6983 ///
6984 /// # Example
6985 /// ```ignore,no_run
6986 /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
6987 /// let x = DeleteDestinationRequest::new().set_name("example");
6988 /// ```
6989 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6990 self.name = v.into();
6991 self
6992 }
6993
6994 /// Sets the value of [request_id][crate::model::DeleteDestinationRequest::request_id].
6995 ///
6996 /// # Example
6997 /// ```ignore,no_run
6998 /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
6999 /// let x = DeleteDestinationRequest::new().set_request_id("example");
7000 /// ```
7001 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7002 self.request_id = v.into();
7003 self
7004 }
7005
7006 /// Sets the value of [etag][crate::model::DeleteDestinationRequest::etag].
7007 ///
7008 /// # Example
7009 /// ```ignore,no_run
7010 /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
7011 /// let x = DeleteDestinationRequest::new().set_etag("example");
7012 /// ```
7013 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7014 self.etag = v.into();
7015 self
7016 }
7017}
7018
7019impl wkt::message::Message for DeleteDestinationRequest {
7020 fn typename() -> &'static str {
7021 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteDestinationRequest"
7022 }
7023}
7024
7025/// The timeline of the pending states for a resource.
7026#[derive(Clone, Default, PartialEq)]
7027#[non_exhaustive]
7028pub struct StateTimeline {
7029 /// Output only. The state and activation time details of the resource state.
7030 pub states: std::vec::Vec<crate::model::state_timeline::StateMetadata>,
7031
7032 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7033}
7034
7035impl StateTimeline {
7036 pub fn new() -> Self {
7037 std::default::Default::default()
7038 }
7039
7040 /// Sets the value of [states][crate::model::StateTimeline::states].
7041 ///
7042 /// # Example
7043 /// ```ignore,no_run
7044 /// # use google_cloud_networkconnectivity_v1::model::StateTimeline;
7045 /// use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7046 /// let x = StateTimeline::new()
7047 /// .set_states([
7048 /// StateMetadata::default()/* use setters */,
7049 /// StateMetadata::default()/* use (different) setters */,
7050 /// ]);
7051 /// ```
7052 pub fn set_states<T, V>(mut self, v: T) -> Self
7053 where
7054 T: std::iter::IntoIterator<Item = V>,
7055 V: std::convert::Into<crate::model::state_timeline::StateMetadata>,
7056 {
7057 use std::iter::Iterator;
7058 self.states = v.into_iter().map(|i| i.into()).collect();
7059 self
7060 }
7061}
7062
7063impl wkt::message::Message for StateTimeline {
7064 fn typename() -> &'static str {
7065 "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline"
7066 }
7067}
7068
7069/// Defines additional types related to [StateTimeline].
7070pub mod state_timeline {
7071 #[allow(unused_imports)]
7072 use super::*;
7073
7074 /// The state and activation time details of the resource state.
7075 #[derive(Clone, Default, PartialEq)]
7076 #[non_exhaustive]
7077 pub struct StateMetadata {
7078 /// Output only. The state of the resource.
7079 pub state: crate::model::state_timeline::state_metadata::State,
7080
7081 /// Output only. Accompanies only the transient states, which include
7082 /// `ADDING`, `DELETING`, and `SUSPENDING`, to denote the time until which
7083 /// the transient state of the resource will be effective. For instance, if
7084 /// the state is `ADDING`, this field shows the time when the resource state
7085 /// transitions to `ACTIVE`.
7086 pub effective_time: std::option::Option<wkt::Timestamp>,
7087
7088 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7089 }
7090
7091 impl StateMetadata {
7092 pub fn new() -> Self {
7093 std::default::Default::default()
7094 }
7095
7096 /// Sets the value of [state][crate::model::state_timeline::StateMetadata::state].
7097 ///
7098 /// # Example
7099 /// ```ignore,no_run
7100 /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7101 /// use google_cloud_networkconnectivity_v1::model::state_timeline::state_metadata::State;
7102 /// let x0 = StateMetadata::new().set_state(State::Adding);
7103 /// let x1 = StateMetadata::new().set_state(State::Active);
7104 /// let x2 = StateMetadata::new().set_state(State::Deleting);
7105 /// ```
7106 pub fn set_state<
7107 T: std::convert::Into<crate::model::state_timeline::state_metadata::State>,
7108 >(
7109 mut self,
7110 v: T,
7111 ) -> Self {
7112 self.state = v.into();
7113 self
7114 }
7115
7116 /// Sets the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
7117 ///
7118 /// # Example
7119 /// ```ignore,no_run
7120 /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7121 /// use wkt::Timestamp;
7122 /// let x = StateMetadata::new().set_effective_time(Timestamp::default()/* use setters */);
7123 /// ```
7124 pub fn set_effective_time<T>(mut self, v: T) -> Self
7125 where
7126 T: std::convert::Into<wkt::Timestamp>,
7127 {
7128 self.effective_time = std::option::Option::Some(v.into());
7129 self
7130 }
7131
7132 /// Sets or clears the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
7133 ///
7134 /// # Example
7135 /// ```ignore,no_run
7136 /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7137 /// use wkt::Timestamp;
7138 /// let x = StateMetadata::new().set_or_clear_effective_time(Some(Timestamp::default()/* use setters */));
7139 /// let x = StateMetadata::new().set_or_clear_effective_time(None::<Timestamp>);
7140 /// ```
7141 pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
7142 where
7143 T: std::convert::Into<wkt::Timestamp>,
7144 {
7145 self.effective_time = v.map(|x| x.into());
7146 self
7147 }
7148 }
7149
7150 impl wkt::message::Message for StateMetadata {
7151 fn typename() -> &'static str {
7152 "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata"
7153 }
7154 }
7155
7156 /// Defines additional types related to [StateMetadata].
7157 pub mod state_metadata {
7158 #[allow(unused_imports)]
7159 use super::*;
7160
7161 /// The state of the resource.
7162 ///
7163 /// # Working with unknown values
7164 ///
7165 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7166 /// additional enum variants at any time. Adding new variants is not considered
7167 /// a breaking change. Applications should write their code in anticipation of:
7168 ///
7169 /// - New values appearing in future releases of the client library, **and**
7170 /// - New values received dynamically, without application changes.
7171 ///
7172 /// Please consult the [Working with enums] section in the user guide for some
7173 /// guidelines.
7174 ///
7175 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7176 #[derive(Clone, Debug, PartialEq)]
7177 #[non_exhaustive]
7178 pub enum State {
7179 /// An invalid state, which is the default case.
7180 Unspecified,
7181 /// The resource is being added.
7182 Adding,
7183 /// The resource is in use.
7184 Active,
7185 /// The resource is being deleted.
7186 Deleting,
7187 /// The resource is being suspended.
7188 Suspending,
7189 /// The resource is suspended and not in use.
7190 Suspended,
7191 /// If set, the enum was initialized with an unknown value.
7192 ///
7193 /// Applications can examine the value using [State::value] or
7194 /// [State::name].
7195 UnknownValue(state::UnknownValue),
7196 }
7197
7198 #[doc(hidden)]
7199 pub mod state {
7200 #[allow(unused_imports)]
7201 use super::*;
7202 #[derive(Clone, Debug, PartialEq)]
7203 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7204 }
7205
7206 impl State {
7207 /// Gets the enum value.
7208 ///
7209 /// Returns `None` if the enum contains an unknown value deserialized from
7210 /// the string representation of enums.
7211 pub fn value(&self) -> std::option::Option<i32> {
7212 match self {
7213 Self::Unspecified => std::option::Option::Some(0),
7214 Self::Adding => std::option::Option::Some(1),
7215 Self::Active => std::option::Option::Some(2),
7216 Self::Deleting => std::option::Option::Some(3),
7217 Self::Suspending => std::option::Option::Some(4),
7218 Self::Suspended => std::option::Option::Some(5),
7219 Self::UnknownValue(u) => u.0.value(),
7220 }
7221 }
7222
7223 /// Gets the enum value as a string.
7224 ///
7225 /// Returns `None` if the enum contains an unknown value deserialized from
7226 /// the integer representation of enums.
7227 pub fn name(&self) -> std::option::Option<&str> {
7228 match self {
7229 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7230 Self::Adding => std::option::Option::Some("ADDING"),
7231 Self::Active => std::option::Option::Some("ACTIVE"),
7232 Self::Deleting => std::option::Option::Some("DELETING"),
7233 Self::Suspending => std::option::Option::Some("SUSPENDING"),
7234 Self::Suspended => std::option::Option::Some("SUSPENDED"),
7235 Self::UnknownValue(u) => u.0.name(),
7236 }
7237 }
7238 }
7239
7240 impl std::default::Default for State {
7241 fn default() -> Self {
7242 use std::convert::From;
7243 Self::from(0)
7244 }
7245 }
7246
7247 impl std::fmt::Display for State {
7248 fn fmt(
7249 &self,
7250 f: &mut std::fmt::Formatter<'_>,
7251 ) -> std::result::Result<(), std::fmt::Error> {
7252 wkt::internal::display_enum(f, self.name(), self.value())
7253 }
7254 }
7255
7256 impl std::convert::From<i32> for State {
7257 fn from(value: i32) -> Self {
7258 match value {
7259 0 => Self::Unspecified,
7260 1 => Self::Adding,
7261 2 => Self::Active,
7262 3 => Self::Deleting,
7263 4 => Self::Suspending,
7264 5 => Self::Suspended,
7265 _ => Self::UnknownValue(state::UnknownValue(
7266 wkt::internal::UnknownEnumValue::Integer(value),
7267 )),
7268 }
7269 }
7270 }
7271
7272 impl std::convert::From<&str> for State {
7273 fn from(value: &str) -> Self {
7274 use std::string::ToString;
7275 match value {
7276 "STATE_UNSPECIFIED" => Self::Unspecified,
7277 "ADDING" => Self::Adding,
7278 "ACTIVE" => Self::Active,
7279 "DELETING" => Self::Deleting,
7280 "SUSPENDING" => Self::Suspending,
7281 "SUSPENDED" => Self::Suspended,
7282 _ => Self::UnknownValue(state::UnknownValue(
7283 wkt::internal::UnknownEnumValue::String(value.to_string()),
7284 )),
7285 }
7286 }
7287 }
7288
7289 impl serde::ser::Serialize for State {
7290 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7291 where
7292 S: serde::Serializer,
7293 {
7294 match self {
7295 Self::Unspecified => serializer.serialize_i32(0),
7296 Self::Adding => serializer.serialize_i32(1),
7297 Self::Active => serializer.serialize_i32(2),
7298 Self::Deleting => serializer.serialize_i32(3),
7299 Self::Suspending => serializer.serialize_i32(4),
7300 Self::Suspended => serializer.serialize_i32(5),
7301 Self::UnknownValue(u) => u.0.serialize(serializer),
7302 }
7303 }
7304 }
7305
7306 impl<'de> serde::de::Deserialize<'de> for State {
7307 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7308 where
7309 D: serde::Deserializer<'de>,
7310 {
7311 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7312 ".google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata.State",
7313 ))
7314 }
7315 }
7316 }
7317}
7318
7319/// A service in your project in a region that is eligible for Data Transfer
7320/// Essentials configuration.
7321#[derive(Clone, Default, PartialEq)]
7322#[non_exhaustive]
7323pub struct MulticloudDataTransferSupportedService {
7324 /// Identifier. The name of the service.
7325 pub name: std::string::String,
7326
7327 /// Output only. The network service tier or regional endpoint supported for
7328 /// the service.
7329 pub service_configs: std::vec::Vec<crate::model::ServiceConfig>,
7330
7331 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7332}
7333
7334impl MulticloudDataTransferSupportedService {
7335 pub fn new() -> Self {
7336 std::default::Default::default()
7337 }
7338
7339 /// Sets the value of [name][crate::model::MulticloudDataTransferSupportedService::name].
7340 ///
7341 /// # Example
7342 /// ```ignore,no_run
7343 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7344 /// let x = MulticloudDataTransferSupportedService::new().set_name("example");
7345 /// ```
7346 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7347 self.name = v.into();
7348 self
7349 }
7350
7351 /// Sets the value of [service_configs][crate::model::MulticloudDataTransferSupportedService::service_configs].
7352 ///
7353 /// # Example
7354 /// ```ignore,no_run
7355 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7356 /// use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7357 /// let x = MulticloudDataTransferSupportedService::new()
7358 /// .set_service_configs([
7359 /// ServiceConfig::default()/* use setters */,
7360 /// ServiceConfig::default()/* use (different) setters */,
7361 /// ]);
7362 /// ```
7363 pub fn set_service_configs<T, V>(mut self, v: T) -> Self
7364 where
7365 T: std::iter::IntoIterator<Item = V>,
7366 V: std::convert::Into<crate::model::ServiceConfig>,
7367 {
7368 use std::iter::Iterator;
7369 self.service_configs = v.into_iter().map(|i| i.into()).collect();
7370 self
7371 }
7372}
7373
7374impl wkt::message::Message for MulticloudDataTransferSupportedService {
7375 fn typename() -> &'static str {
7376 "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferSupportedService"
7377 }
7378}
7379
7380/// Specifies eligibility information for the service.
7381#[derive(Clone, Default, PartialEq)]
7382#[non_exhaustive]
7383pub struct ServiceConfig {
7384 /// Output only. The eligibility criteria for the service.
7385 pub eligibility_criteria: crate::model::service_config::EligibilityCriteria,
7386
7387 /// Output only. The end time for eligibility criteria support. If not
7388 /// specified, no planned end time is set.
7389 pub support_end_time: std::option::Option<wkt::Timestamp>,
7390
7391 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7392}
7393
7394impl ServiceConfig {
7395 pub fn new() -> Self {
7396 std::default::Default::default()
7397 }
7398
7399 /// Sets the value of [eligibility_criteria][crate::model::ServiceConfig::eligibility_criteria].
7400 ///
7401 /// # Example
7402 /// ```ignore,no_run
7403 /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7404 /// use google_cloud_networkconnectivity_v1::model::service_config::EligibilityCriteria;
7405 /// let x0 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::NetworkServiceTierPremiumOnly);
7406 /// let x1 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::NetworkServiceTierStandardOnly);
7407 /// let x2 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::RequestEndpointRegionalEndpointOnly);
7408 /// ```
7409 pub fn set_eligibility_criteria<
7410 T: std::convert::Into<crate::model::service_config::EligibilityCriteria>,
7411 >(
7412 mut self,
7413 v: T,
7414 ) -> Self {
7415 self.eligibility_criteria = v.into();
7416 self
7417 }
7418
7419 /// Sets the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
7420 ///
7421 /// # Example
7422 /// ```ignore,no_run
7423 /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7424 /// use wkt::Timestamp;
7425 /// let x = ServiceConfig::new().set_support_end_time(Timestamp::default()/* use setters */);
7426 /// ```
7427 pub fn set_support_end_time<T>(mut self, v: T) -> Self
7428 where
7429 T: std::convert::Into<wkt::Timestamp>,
7430 {
7431 self.support_end_time = std::option::Option::Some(v.into());
7432 self
7433 }
7434
7435 /// Sets or clears the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
7436 ///
7437 /// # Example
7438 /// ```ignore,no_run
7439 /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7440 /// use wkt::Timestamp;
7441 /// let x = ServiceConfig::new().set_or_clear_support_end_time(Some(Timestamp::default()/* use setters */));
7442 /// let x = ServiceConfig::new().set_or_clear_support_end_time(None::<Timestamp>);
7443 /// ```
7444 pub fn set_or_clear_support_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7445 where
7446 T: std::convert::Into<wkt::Timestamp>,
7447 {
7448 self.support_end_time = v.map(|x| x.into());
7449 self
7450 }
7451}
7452
7453impl wkt::message::Message for ServiceConfig {
7454 fn typename() -> &'static str {
7455 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConfig"
7456 }
7457}
7458
7459/// Defines additional types related to [ServiceConfig].
7460pub mod service_config {
7461 #[allow(unused_imports)]
7462 use super::*;
7463
7464 /// The eligibility information for the service.
7465 ///
7466 /// # Working with unknown values
7467 ///
7468 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7469 /// additional enum variants at any time. Adding new variants is not considered
7470 /// a breaking change. Applications should write their code in anticipation of:
7471 ///
7472 /// - New values appearing in future releases of the client library, **and**
7473 /// - New values received dynamically, without application changes.
7474 ///
7475 /// Please consult the [Working with enums] section in the user guide for some
7476 /// guidelines.
7477 ///
7478 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7479 #[derive(Clone, Debug, PartialEq)]
7480 #[non_exhaustive]
7481 pub enum EligibilityCriteria {
7482 /// The service is not eligible for Data Transfer Essentials configuration.
7483 /// This is the default case.
7484 Unspecified,
7485 /// The service is eligible for Data Transfer Essentials configuration only
7486 /// for Premium Tier.
7487 NetworkServiceTierPremiumOnly,
7488 /// The service is eligible for Data Transfer Essentials configuration only
7489 /// for Standard Tier.
7490 NetworkServiceTierStandardOnly,
7491 /// The service is eligible for Data Transfer Essentials configuration only
7492 /// for the regional endpoint.
7493 RequestEndpointRegionalEndpointOnly,
7494 /// If set, the enum was initialized with an unknown value.
7495 ///
7496 /// Applications can examine the value using [EligibilityCriteria::value] or
7497 /// [EligibilityCriteria::name].
7498 UnknownValue(eligibility_criteria::UnknownValue),
7499 }
7500
7501 #[doc(hidden)]
7502 pub mod eligibility_criteria {
7503 #[allow(unused_imports)]
7504 use super::*;
7505 #[derive(Clone, Debug, PartialEq)]
7506 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7507 }
7508
7509 impl EligibilityCriteria {
7510 /// Gets the enum value.
7511 ///
7512 /// Returns `None` if the enum contains an unknown value deserialized from
7513 /// the string representation of enums.
7514 pub fn value(&self) -> std::option::Option<i32> {
7515 match self {
7516 Self::Unspecified => std::option::Option::Some(0),
7517 Self::NetworkServiceTierPremiumOnly => std::option::Option::Some(1),
7518 Self::NetworkServiceTierStandardOnly => std::option::Option::Some(2),
7519 Self::RequestEndpointRegionalEndpointOnly => std::option::Option::Some(3),
7520 Self::UnknownValue(u) => u.0.value(),
7521 }
7522 }
7523
7524 /// Gets the enum value as a string.
7525 ///
7526 /// Returns `None` if the enum contains an unknown value deserialized from
7527 /// the integer representation of enums.
7528 pub fn name(&self) -> std::option::Option<&str> {
7529 match self {
7530 Self::Unspecified => std::option::Option::Some("ELIGIBILITY_CRITERIA_UNSPECIFIED"),
7531 Self::NetworkServiceTierPremiumOnly => {
7532 std::option::Option::Some("NETWORK_SERVICE_TIER_PREMIUM_ONLY")
7533 }
7534 Self::NetworkServiceTierStandardOnly => {
7535 std::option::Option::Some("NETWORK_SERVICE_TIER_STANDARD_ONLY")
7536 }
7537 Self::RequestEndpointRegionalEndpointOnly => {
7538 std::option::Option::Some("REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY")
7539 }
7540 Self::UnknownValue(u) => u.0.name(),
7541 }
7542 }
7543 }
7544
7545 impl std::default::Default for EligibilityCriteria {
7546 fn default() -> Self {
7547 use std::convert::From;
7548 Self::from(0)
7549 }
7550 }
7551
7552 impl std::fmt::Display for EligibilityCriteria {
7553 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7554 wkt::internal::display_enum(f, self.name(), self.value())
7555 }
7556 }
7557
7558 impl std::convert::From<i32> for EligibilityCriteria {
7559 fn from(value: i32) -> Self {
7560 match value {
7561 0 => Self::Unspecified,
7562 1 => Self::NetworkServiceTierPremiumOnly,
7563 2 => Self::NetworkServiceTierStandardOnly,
7564 3 => Self::RequestEndpointRegionalEndpointOnly,
7565 _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
7566 wkt::internal::UnknownEnumValue::Integer(value),
7567 )),
7568 }
7569 }
7570 }
7571
7572 impl std::convert::From<&str> for EligibilityCriteria {
7573 fn from(value: &str) -> Self {
7574 use std::string::ToString;
7575 match value {
7576 "ELIGIBILITY_CRITERIA_UNSPECIFIED" => Self::Unspecified,
7577 "NETWORK_SERVICE_TIER_PREMIUM_ONLY" => Self::NetworkServiceTierPremiumOnly,
7578 "NETWORK_SERVICE_TIER_STANDARD_ONLY" => Self::NetworkServiceTierStandardOnly,
7579 "REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY" => {
7580 Self::RequestEndpointRegionalEndpointOnly
7581 }
7582 _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
7583 wkt::internal::UnknownEnumValue::String(value.to_string()),
7584 )),
7585 }
7586 }
7587 }
7588
7589 impl serde::ser::Serialize for EligibilityCriteria {
7590 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7591 where
7592 S: serde::Serializer,
7593 {
7594 match self {
7595 Self::Unspecified => serializer.serialize_i32(0),
7596 Self::NetworkServiceTierPremiumOnly => serializer.serialize_i32(1),
7597 Self::NetworkServiceTierStandardOnly => serializer.serialize_i32(2),
7598 Self::RequestEndpointRegionalEndpointOnly => serializer.serialize_i32(3),
7599 Self::UnknownValue(u) => u.0.serialize(serializer),
7600 }
7601 }
7602 }
7603
7604 impl<'de> serde::de::Deserialize<'de> for EligibilityCriteria {
7605 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7606 where
7607 D: serde::Deserializer<'de>,
7608 {
7609 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EligibilityCriteria>::new(
7610 ".google.cloud.networkconnectivity.v1.ServiceConfig.EligibilityCriteria",
7611 ))
7612 }
7613 }
7614}
7615
7616/// Request message to check if a service in your project in a region is
7617/// eligible for Data Transfer Essentials configuration.
7618#[derive(Clone, Default, PartialEq)]
7619#[non_exhaustive]
7620pub struct GetMulticloudDataTransferSupportedServiceRequest {
7621 /// Required. The name of the service.
7622 pub name: std::string::String,
7623
7624 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7625}
7626
7627impl GetMulticloudDataTransferSupportedServiceRequest {
7628 pub fn new() -> Self {
7629 std::default::Default::default()
7630 }
7631
7632 /// Sets the value of [name][crate::model::GetMulticloudDataTransferSupportedServiceRequest::name].
7633 ///
7634 /// # Example
7635 /// ```ignore,no_run
7636 /// # use google_cloud_networkconnectivity_v1::model::GetMulticloudDataTransferSupportedServiceRequest;
7637 /// let x = GetMulticloudDataTransferSupportedServiceRequest::new().set_name("example");
7638 /// ```
7639 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7640 self.name = v.into();
7641 self
7642 }
7643}
7644
7645impl wkt::message::Message for GetMulticloudDataTransferSupportedServiceRequest {
7646 fn typename() -> &'static str {
7647 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferSupportedServiceRequest"
7648 }
7649}
7650
7651/// Request message to list the services in your project that are eligible for
7652/// Data Transfer Essentials configuration.
7653#[derive(Clone, Default, PartialEq)]
7654#[non_exhaustive]
7655pub struct ListMulticloudDataTransferSupportedServicesRequest {
7656 /// Required. The name of the parent resource.
7657 pub parent: std::string::String,
7658
7659 /// Optional. The maximum number of results listed per page.
7660 pub page_size: i32,
7661
7662 /// Optional. The page token.
7663 pub page_token: std::string::String,
7664
7665 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7666}
7667
7668impl ListMulticloudDataTransferSupportedServicesRequest {
7669 pub fn new() -> Self {
7670 std::default::Default::default()
7671 }
7672
7673 /// Sets the value of [parent][crate::model::ListMulticloudDataTransferSupportedServicesRequest::parent].
7674 ///
7675 /// # Example
7676 /// ```ignore,no_run
7677 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7678 /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_parent("example");
7679 /// ```
7680 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7681 self.parent = v.into();
7682 self
7683 }
7684
7685 /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_size].
7686 ///
7687 /// # Example
7688 /// ```ignore,no_run
7689 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7690 /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_page_size(42);
7691 /// ```
7692 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7693 self.page_size = v.into();
7694 self
7695 }
7696
7697 /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_token].
7698 ///
7699 /// # Example
7700 /// ```ignore,no_run
7701 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7702 /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_page_token("example");
7703 /// ```
7704 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7705 self.page_token = v.into();
7706 self
7707 }
7708}
7709
7710impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesRequest {
7711 fn typename() -> &'static str {
7712 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesRequest"
7713 }
7714}
7715
7716/// Response message to list the services in your project in regions that are
7717/// eligible for Data Transfer Essentials configuration.
7718#[derive(Clone, Default, PartialEq)]
7719#[non_exhaustive]
7720pub struct ListMulticloudDataTransferSupportedServicesResponse {
7721 /// The list of supported services.
7722 pub multicloud_data_transfer_supported_services:
7723 std::vec::Vec<crate::model::MulticloudDataTransferSupportedService>,
7724
7725 /// The next page token.
7726 pub next_page_token: std::string::String,
7727
7728 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7729}
7730
7731impl ListMulticloudDataTransferSupportedServicesResponse {
7732 pub fn new() -> Self {
7733 std::default::Default::default()
7734 }
7735
7736 /// Sets the value of [multicloud_data_transfer_supported_services][crate::model::ListMulticloudDataTransferSupportedServicesResponse::multicloud_data_transfer_supported_services].
7737 ///
7738 /// # Example
7739 /// ```ignore,no_run
7740 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesResponse;
7741 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7742 /// let x = ListMulticloudDataTransferSupportedServicesResponse::new()
7743 /// .set_multicloud_data_transfer_supported_services([
7744 /// MulticloudDataTransferSupportedService::default()/* use setters */,
7745 /// MulticloudDataTransferSupportedService::default()/* use (different) setters */,
7746 /// ]);
7747 /// ```
7748 pub fn set_multicloud_data_transfer_supported_services<T, V>(mut self, v: T) -> Self
7749 where
7750 T: std::iter::IntoIterator<Item = V>,
7751 V: std::convert::Into<crate::model::MulticloudDataTransferSupportedService>,
7752 {
7753 use std::iter::Iterator;
7754 self.multicloud_data_transfer_supported_services =
7755 v.into_iter().map(|i| i.into()).collect();
7756 self
7757 }
7758
7759 /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferSupportedServicesResponse::next_page_token].
7760 ///
7761 /// # Example
7762 /// ```ignore,no_run
7763 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesResponse;
7764 /// let x = ListMulticloudDataTransferSupportedServicesResponse::new().set_next_page_token("example");
7765 /// ```
7766 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7767 self.next_page_token = v.into();
7768 self
7769 }
7770}
7771
7772impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesResponse {
7773 fn typename() -> &'static str {
7774 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesResponse"
7775 }
7776}
7777
7778#[doc(hidden)]
7779impl google_cloud_gax::paginator::internal::PageableResponse
7780 for ListMulticloudDataTransferSupportedServicesResponse
7781{
7782 type PageItem = crate::model::MulticloudDataTransferSupportedService;
7783
7784 fn items(self) -> std::vec::Vec<Self::PageItem> {
7785 self.multicloud_data_transfer_supported_services
7786 }
7787
7788 fn next_page_token(&self) -> std::string::String {
7789 use std::clone::Clone;
7790 self.next_page_token.clone()
7791 }
7792}
7793
7794/// A Network Connectivity Center hub is a global management resource to which
7795/// you attach spokes. A single hub can contain spokes from multiple regions.
7796/// However, if any of a hub's spokes use the site-to-site data transfer feature,
7797/// the resources associated with those spokes must all be in the same VPC
7798/// network. Spokes that do not use site-to-site data transfer can be associated
7799/// with any VPC network in your project.
7800#[derive(Clone, Default, PartialEq)]
7801#[non_exhaustive]
7802pub struct Hub {
7803 /// Immutable. The name of the hub. Hub names must be unique. They use the
7804 /// following form:
7805 /// `projects/{project_number}/locations/global/hubs/{hub_id}`
7806 pub name: std::string::String,
7807
7808 /// Output only. The time the hub was created.
7809 pub create_time: std::option::Option<wkt::Timestamp>,
7810
7811 /// Output only. The time the hub was last updated.
7812 pub update_time: std::option::Option<wkt::Timestamp>,
7813
7814 /// Optional labels in key-value pair format. For more information about
7815 /// labels, see [Requirements for
7816 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
7817 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7818
7819 /// Optional. An optional description of the hub.
7820 pub description: std::string::String,
7821
7822 /// Output only. The Google-generated UUID for the hub. This value is unique
7823 /// across all hub resources. If a hub is deleted and another with the same
7824 /// name is created, the new hub is assigned a different unique_id.
7825 pub unique_id: std::string::String,
7826
7827 /// Output only. The current lifecycle state of this hub.
7828 pub state: crate::model::State,
7829
7830 /// The VPC networks associated with this hub's spokes.
7831 ///
7832 /// This field is read-only. Network Connectivity Center automatically
7833 /// populates it based on the set of spokes attached to the hub.
7834 pub routing_vpcs: std::vec::Vec<crate::model::RoutingVPC>,
7835
7836 /// Output only. The route tables that belong to this hub. They use the
7837 /// following form:
7838 /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
7839 ///
7840 /// This field is read-only. Network Connectivity Center automatically
7841 /// populates it based on the route tables nested under the hub.
7842 pub route_tables: std::vec::Vec<std::string::String>,
7843
7844 /// Output only. A summary of the spokes associated with a hub. The
7845 /// summary includes a count of spokes according to type
7846 /// and according to state. If any spokes are inactive,
7847 /// the summary also lists the reasons they are inactive,
7848 /// including a count for each reason.
7849 pub spoke_summary: std::option::Option<crate::model::SpokeSummary>,
7850
7851 /// Optional. The policy mode of this hub. This field can be either
7852 /// PRESET or CUSTOM. If unspecified, the
7853 /// policy_mode defaults to PRESET.
7854 pub policy_mode: crate::model::PolicyMode,
7855
7856 /// Optional. The topology implemented in this hub. Currently, this field is
7857 /// only used when policy_mode = PRESET. The available preset topologies are
7858 /// MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET,
7859 /// the preset_topology defaults to MESH. When policy_mode = CUSTOM,
7860 /// the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED.
7861 pub preset_topology: crate::model::PresetTopology,
7862
7863 /// Optional. Whether Private Service Connect connection propagation is enabled
7864 /// for the hub. If true, Private Service Connect endpoints in VPC spokes
7865 /// attached to the hub are made accessible to other VPC spokes attached to the
7866 /// hub. The default value is false.
7867 pub export_psc: std::option::Option<bool>,
7868
7869 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7870}
7871
7872impl Hub {
7873 pub fn new() -> Self {
7874 std::default::Default::default()
7875 }
7876
7877 /// Sets the value of [name][crate::model::Hub::name].
7878 ///
7879 /// # Example
7880 /// ```ignore,no_run
7881 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7882 /// let x = Hub::new().set_name("example");
7883 /// ```
7884 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7885 self.name = v.into();
7886 self
7887 }
7888
7889 /// Sets the value of [create_time][crate::model::Hub::create_time].
7890 ///
7891 /// # Example
7892 /// ```ignore,no_run
7893 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7894 /// use wkt::Timestamp;
7895 /// let x = Hub::new().set_create_time(Timestamp::default()/* use setters */);
7896 /// ```
7897 pub fn set_create_time<T>(mut self, v: T) -> Self
7898 where
7899 T: std::convert::Into<wkt::Timestamp>,
7900 {
7901 self.create_time = std::option::Option::Some(v.into());
7902 self
7903 }
7904
7905 /// Sets or clears the value of [create_time][crate::model::Hub::create_time].
7906 ///
7907 /// # Example
7908 /// ```ignore,no_run
7909 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7910 /// use wkt::Timestamp;
7911 /// let x = Hub::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7912 /// let x = Hub::new().set_or_clear_create_time(None::<Timestamp>);
7913 /// ```
7914 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7915 where
7916 T: std::convert::Into<wkt::Timestamp>,
7917 {
7918 self.create_time = v.map(|x| x.into());
7919 self
7920 }
7921
7922 /// Sets the value of [update_time][crate::model::Hub::update_time].
7923 ///
7924 /// # Example
7925 /// ```ignore,no_run
7926 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7927 /// use wkt::Timestamp;
7928 /// let x = Hub::new().set_update_time(Timestamp::default()/* use setters */);
7929 /// ```
7930 pub fn set_update_time<T>(mut self, v: T) -> Self
7931 where
7932 T: std::convert::Into<wkt::Timestamp>,
7933 {
7934 self.update_time = std::option::Option::Some(v.into());
7935 self
7936 }
7937
7938 /// Sets or clears the value of [update_time][crate::model::Hub::update_time].
7939 ///
7940 /// # Example
7941 /// ```ignore,no_run
7942 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7943 /// use wkt::Timestamp;
7944 /// let x = Hub::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7945 /// let x = Hub::new().set_or_clear_update_time(None::<Timestamp>);
7946 /// ```
7947 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7948 where
7949 T: std::convert::Into<wkt::Timestamp>,
7950 {
7951 self.update_time = v.map(|x| x.into());
7952 self
7953 }
7954
7955 /// Sets the value of [labels][crate::model::Hub::labels].
7956 ///
7957 /// # Example
7958 /// ```ignore,no_run
7959 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7960 /// let x = Hub::new().set_labels([
7961 /// ("key0", "abc"),
7962 /// ("key1", "xyz"),
7963 /// ]);
7964 /// ```
7965 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7966 where
7967 T: std::iter::IntoIterator<Item = (K, V)>,
7968 K: std::convert::Into<std::string::String>,
7969 V: std::convert::Into<std::string::String>,
7970 {
7971 use std::iter::Iterator;
7972 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7973 self
7974 }
7975
7976 /// Sets the value of [description][crate::model::Hub::description].
7977 ///
7978 /// # Example
7979 /// ```ignore,no_run
7980 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7981 /// let x = Hub::new().set_description("example");
7982 /// ```
7983 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7984 self.description = v.into();
7985 self
7986 }
7987
7988 /// Sets the value of [unique_id][crate::model::Hub::unique_id].
7989 ///
7990 /// # Example
7991 /// ```ignore,no_run
7992 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7993 /// let x = Hub::new().set_unique_id("example");
7994 /// ```
7995 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7996 self.unique_id = v.into();
7997 self
7998 }
7999
8000 /// Sets the value of [state][crate::model::Hub::state].
8001 ///
8002 /// # Example
8003 /// ```ignore,no_run
8004 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8005 /// use google_cloud_networkconnectivity_v1::model::State;
8006 /// let x0 = Hub::new().set_state(State::Creating);
8007 /// let x1 = Hub::new().set_state(State::Active);
8008 /// let x2 = Hub::new().set_state(State::Deleting);
8009 /// ```
8010 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
8011 self.state = v.into();
8012 self
8013 }
8014
8015 /// Sets the value of [routing_vpcs][crate::model::Hub::routing_vpcs].
8016 ///
8017 /// # Example
8018 /// ```ignore,no_run
8019 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8020 /// use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8021 /// let x = Hub::new()
8022 /// .set_routing_vpcs([
8023 /// RoutingVPC::default()/* use setters */,
8024 /// RoutingVPC::default()/* use (different) setters */,
8025 /// ]);
8026 /// ```
8027 pub fn set_routing_vpcs<T, V>(mut self, v: T) -> Self
8028 where
8029 T: std::iter::IntoIterator<Item = V>,
8030 V: std::convert::Into<crate::model::RoutingVPC>,
8031 {
8032 use std::iter::Iterator;
8033 self.routing_vpcs = v.into_iter().map(|i| i.into()).collect();
8034 self
8035 }
8036
8037 /// Sets the value of [route_tables][crate::model::Hub::route_tables].
8038 ///
8039 /// # Example
8040 /// ```ignore,no_run
8041 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8042 /// let x = Hub::new().set_route_tables(["a", "b", "c"]);
8043 /// ```
8044 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
8045 where
8046 T: std::iter::IntoIterator<Item = V>,
8047 V: std::convert::Into<std::string::String>,
8048 {
8049 use std::iter::Iterator;
8050 self.route_tables = v.into_iter().map(|i| i.into()).collect();
8051 self
8052 }
8053
8054 /// Sets the value of [spoke_summary][crate::model::Hub::spoke_summary].
8055 ///
8056 /// # Example
8057 /// ```ignore,no_run
8058 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8059 /// use google_cloud_networkconnectivity_v1::model::SpokeSummary;
8060 /// let x = Hub::new().set_spoke_summary(SpokeSummary::default()/* use setters */);
8061 /// ```
8062 pub fn set_spoke_summary<T>(mut self, v: T) -> Self
8063 where
8064 T: std::convert::Into<crate::model::SpokeSummary>,
8065 {
8066 self.spoke_summary = std::option::Option::Some(v.into());
8067 self
8068 }
8069
8070 /// Sets or clears the value of [spoke_summary][crate::model::Hub::spoke_summary].
8071 ///
8072 /// # Example
8073 /// ```ignore,no_run
8074 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8075 /// use google_cloud_networkconnectivity_v1::model::SpokeSummary;
8076 /// let x = Hub::new().set_or_clear_spoke_summary(Some(SpokeSummary::default()/* use setters */));
8077 /// let x = Hub::new().set_or_clear_spoke_summary(None::<SpokeSummary>);
8078 /// ```
8079 pub fn set_or_clear_spoke_summary<T>(mut self, v: std::option::Option<T>) -> Self
8080 where
8081 T: std::convert::Into<crate::model::SpokeSummary>,
8082 {
8083 self.spoke_summary = v.map(|x| x.into());
8084 self
8085 }
8086
8087 /// Sets the value of [policy_mode][crate::model::Hub::policy_mode].
8088 ///
8089 /// # Example
8090 /// ```ignore,no_run
8091 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8092 /// use google_cloud_networkconnectivity_v1::model::PolicyMode;
8093 /// let x0 = Hub::new().set_policy_mode(PolicyMode::Preset);
8094 /// ```
8095 pub fn set_policy_mode<T: std::convert::Into<crate::model::PolicyMode>>(
8096 mut self,
8097 v: T,
8098 ) -> Self {
8099 self.policy_mode = v.into();
8100 self
8101 }
8102
8103 /// Sets the value of [preset_topology][crate::model::Hub::preset_topology].
8104 ///
8105 /// # Example
8106 /// ```ignore,no_run
8107 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8108 /// use google_cloud_networkconnectivity_v1::model::PresetTopology;
8109 /// let x0 = Hub::new().set_preset_topology(PresetTopology::Mesh);
8110 /// let x1 = Hub::new().set_preset_topology(PresetTopology::Star);
8111 /// ```
8112 pub fn set_preset_topology<T: std::convert::Into<crate::model::PresetTopology>>(
8113 mut self,
8114 v: T,
8115 ) -> Self {
8116 self.preset_topology = v.into();
8117 self
8118 }
8119
8120 /// Sets the value of [export_psc][crate::model::Hub::export_psc].
8121 ///
8122 /// # Example
8123 /// ```ignore,no_run
8124 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8125 /// let x = Hub::new().set_export_psc(true);
8126 /// ```
8127 pub fn set_export_psc<T>(mut self, v: T) -> Self
8128 where
8129 T: std::convert::Into<bool>,
8130 {
8131 self.export_psc = std::option::Option::Some(v.into());
8132 self
8133 }
8134
8135 /// Sets or clears the value of [export_psc][crate::model::Hub::export_psc].
8136 ///
8137 /// # Example
8138 /// ```ignore,no_run
8139 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8140 /// let x = Hub::new().set_or_clear_export_psc(Some(false));
8141 /// let x = Hub::new().set_or_clear_export_psc(None::<bool>);
8142 /// ```
8143 pub fn set_or_clear_export_psc<T>(mut self, v: std::option::Option<T>) -> Self
8144 where
8145 T: std::convert::Into<bool>,
8146 {
8147 self.export_psc = v.map(|x| x.into());
8148 self
8149 }
8150}
8151
8152impl wkt::message::Message for Hub {
8153 fn typename() -> &'static str {
8154 "type.googleapis.com/google.cloud.networkconnectivity.v1.Hub"
8155 }
8156}
8157
8158/// RoutingVPC contains information about the VPC networks associated
8159/// with the spokes of a Network Connectivity Center hub.
8160#[derive(Clone, Default, PartialEq)]
8161#[non_exhaustive]
8162pub struct RoutingVPC {
8163 /// The URI of the VPC network.
8164 pub uri: std::string::String,
8165
8166 /// Output only. If true, indicates that this VPC network is currently
8167 /// associated with spokes that use the data transfer feature (spokes where the
8168 /// site_to_site_data_transfer field is set to true). If you create new spokes
8169 /// that use data transfer, they must be associated with this VPC network. At
8170 /// most, one VPC network will have this field set to true.
8171 pub required_for_new_site_to_site_data_transfer_spokes: bool,
8172
8173 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8174}
8175
8176impl RoutingVPC {
8177 pub fn new() -> Self {
8178 std::default::Default::default()
8179 }
8180
8181 /// Sets the value of [uri][crate::model::RoutingVPC::uri].
8182 ///
8183 /// # Example
8184 /// ```ignore,no_run
8185 /// # use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8186 /// let x = RoutingVPC::new().set_uri("example");
8187 /// ```
8188 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8189 self.uri = v.into();
8190 self
8191 }
8192
8193 /// 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].
8194 ///
8195 /// # Example
8196 /// ```ignore,no_run
8197 /// # use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8198 /// let x = RoutingVPC::new().set_required_for_new_site_to_site_data_transfer_spokes(true);
8199 /// ```
8200 pub fn set_required_for_new_site_to_site_data_transfer_spokes<T: std::convert::Into<bool>>(
8201 mut self,
8202 v: T,
8203 ) -> Self {
8204 self.required_for_new_site_to_site_data_transfer_spokes = v.into();
8205 self
8206 }
8207}
8208
8209impl wkt::message::Message for RoutingVPC {
8210 fn typename() -> &'static str {
8211 "type.googleapis.com/google.cloud.networkconnectivity.v1.RoutingVPC"
8212 }
8213}
8214
8215/// A Network Connectivity Center spoke represents one or more network
8216/// connectivity resources.
8217///
8218/// When you create a spoke, you associate it with a hub. You must also
8219/// identify a value for exactly one of the following fields:
8220///
8221/// * linked_vpn_tunnels
8222/// * linked_interconnect_attachments
8223/// * linked_router_appliance_instances
8224/// * linked_vpc_network
8225#[derive(Clone, Default, PartialEq)]
8226#[non_exhaustive]
8227pub struct Spoke {
8228 /// Immutable. The name of the spoke. Spoke names must be unique. They use the
8229 /// following form:
8230 /// `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
8231 pub name: std::string::String,
8232
8233 /// Output only. The time the spoke was created.
8234 pub create_time: std::option::Option<wkt::Timestamp>,
8235
8236 /// Output only. The time the spoke was last updated.
8237 pub update_time: std::option::Option<wkt::Timestamp>,
8238
8239 /// Optional labels in key-value pair format. For more information about
8240 /// labels, see [Requirements for
8241 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
8242 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8243
8244 /// Optional. An optional description of the spoke.
8245 pub description: std::string::String,
8246
8247 /// Immutable. The name of the hub that this spoke is attached to.
8248 pub hub: std::string::String,
8249
8250 /// Optional. The name of the group that this spoke is associated with.
8251 pub group: std::string::String,
8252
8253 /// Optional. VPN tunnels that are associated with the spoke.
8254 pub linked_vpn_tunnels: std::option::Option<crate::model::LinkedVpnTunnels>,
8255
8256 /// Optional. VLAN attachments that are associated with the spoke.
8257 pub linked_interconnect_attachments:
8258 std::option::Option<crate::model::LinkedInterconnectAttachments>,
8259
8260 /// Optional. Router appliance instances that are associated with the spoke.
8261 pub linked_router_appliance_instances:
8262 std::option::Option<crate::model::LinkedRouterApplianceInstances>,
8263
8264 /// Optional. VPC network that is associated with the spoke.
8265 pub linked_vpc_network: std::option::Option<crate::model::LinkedVpcNetwork>,
8266
8267 /// Optional. The linked producer VPC that is associated with the spoke.
8268 pub linked_producer_vpc_network: std::option::Option<crate::model::LinkedProducerVpcNetwork>,
8269
8270 /// Output only. The Google-generated UUID for the spoke. This value is unique
8271 /// across all spoke resources. If a spoke is deleted and another with the same
8272 /// name is created, the new spoke is assigned a different `unique_id`.
8273 pub unique_id: std::string::String,
8274
8275 /// Output only. The current lifecycle state of this spoke.
8276 pub state: crate::model::State,
8277
8278 /// Output only. The reasons for current state of the spoke.
8279 pub reasons: std::vec::Vec<crate::model::spoke::StateReason>,
8280
8281 /// Output only. The type of resource associated with the spoke.
8282 pub spoke_type: crate::model::SpokeType,
8283
8284 /// Optional. This checksum is computed by the server based on the value of
8285 /// other fields, and may be sent on update and delete requests to ensure the
8286 /// client has an up-to-date value before proceeding.
8287 pub etag: std::string::String,
8288
8289 /// Optional. The list of fields waiting for hub administration's approval.
8290 pub field_paths_pending_update: std::vec::Vec<std::string::String>,
8291
8292 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8293}
8294
8295impl Spoke {
8296 pub fn new() -> Self {
8297 std::default::Default::default()
8298 }
8299
8300 /// Sets the value of [name][crate::model::Spoke::name].
8301 ///
8302 /// # Example
8303 /// ```ignore,no_run
8304 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8305 /// let x = Spoke::new().set_name("example");
8306 /// ```
8307 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8308 self.name = v.into();
8309 self
8310 }
8311
8312 /// Sets the value of [create_time][crate::model::Spoke::create_time].
8313 ///
8314 /// # Example
8315 /// ```ignore,no_run
8316 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8317 /// use wkt::Timestamp;
8318 /// let x = Spoke::new().set_create_time(Timestamp::default()/* use setters */);
8319 /// ```
8320 pub fn set_create_time<T>(mut self, v: T) -> Self
8321 where
8322 T: std::convert::Into<wkt::Timestamp>,
8323 {
8324 self.create_time = std::option::Option::Some(v.into());
8325 self
8326 }
8327
8328 /// Sets or clears the value of [create_time][crate::model::Spoke::create_time].
8329 ///
8330 /// # Example
8331 /// ```ignore,no_run
8332 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8333 /// use wkt::Timestamp;
8334 /// let x = Spoke::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8335 /// let x = Spoke::new().set_or_clear_create_time(None::<Timestamp>);
8336 /// ```
8337 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8338 where
8339 T: std::convert::Into<wkt::Timestamp>,
8340 {
8341 self.create_time = v.map(|x| x.into());
8342 self
8343 }
8344
8345 /// Sets the value of [update_time][crate::model::Spoke::update_time].
8346 ///
8347 /// # Example
8348 /// ```ignore,no_run
8349 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8350 /// use wkt::Timestamp;
8351 /// let x = Spoke::new().set_update_time(Timestamp::default()/* use setters */);
8352 /// ```
8353 pub fn set_update_time<T>(mut self, v: T) -> Self
8354 where
8355 T: std::convert::Into<wkt::Timestamp>,
8356 {
8357 self.update_time = std::option::Option::Some(v.into());
8358 self
8359 }
8360
8361 /// Sets or clears the value of [update_time][crate::model::Spoke::update_time].
8362 ///
8363 /// # Example
8364 /// ```ignore,no_run
8365 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8366 /// use wkt::Timestamp;
8367 /// let x = Spoke::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8368 /// let x = Spoke::new().set_or_clear_update_time(None::<Timestamp>);
8369 /// ```
8370 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8371 where
8372 T: std::convert::Into<wkt::Timestamp>,
8373 {
8374 self.update_time = v.map(|x| x.into());
8375 self
8376 }
8377
8378 /// Sets the value of [labels][crate::model::Spoke::labels].
8379 ///
8380 /// # Example
8381 /// ```ignore,no_run
8382 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8383 /// let x = Spoke::new().set_labels([
8384 /// ("key0", "abc"),
8385 /// ("key1", "xyz"),
8386 /// ]);
8387 /// ```
8388 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8389 where
8390 T: std::iter::IntoIterator<Item = (K, V)>,
8391 K: std::convert::Into<std::string::String>,
8392 V: std::convert::Into<std::string::String>,
8393 {
8394 use std::iter::Iterator;
8395 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8396 self
8397 }
8398
8399 /// Sets the value of [description][crate::model::Spoke::description].
8400 ///
8401 /// # Example
8402 /// ```ignore,no_run
8403 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8404 /// let x = Spoke::new().set_description("example");
8405 /// ```
8406 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8407 self.description = v.into();
8408 self
8409 }
8410
8411 /// Sets the value of [hub][crate::model::Spoke::hub].
8412 ///
8413 /// # Example
8414 /// ```ignore,no_run
8415 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8416 /// let x = Spoke::new().set_hub("example");
8417 /// ```
8418 pub fn set_hub<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8419 self.hub = v.into();
8420 self
8421 }
8422
8423 /// Sets the value of [group][crate::model::Spoke::group].
8424 ///
8425 /// # Example
8426 /// ```ignore,no_run
8427 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8428 /// let x = Spoke::new().set_group("example");
8429 /// ```
8430 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8431 self.group = v.into();
8432 self
8433 }
8434
8435 /// Sets the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
8436 ///
8437 /// # Example
8438 /// ```ignore,no_run
8439 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8440 /// use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
8441 /// let x = Spoke::new().set_linked_vpn_tunnels(LinkedVpnTunnels::default()/* use setters */);
8442 /// ```
8443 pub fn set_linked_vpn_tunnels<T>(mut self, v: T) -> Self
8444 where
8445 T: std::convert::Into<crate::model::LinkedVpnTunnels>,
8446 {
8447 self.linked_vpn_tunnels = std::option::Option::Some(v.into());
8448 self
8449 }
8450
8451 /// Sets or clears the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
8452 ///
8453 /// # Example
8454 /// ```ignore,no_run
8455 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8456 /// use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
8457 /// let x = Spoke::new().set_or_clear_linked_vpn_tunnels(Some(LinkedVpnTunnels::default()/* use setters */));
8458 /// let x = Spoke::new().set_or_clear_linked_vpn_tunnels(None::<LinkedVpnTunnels>);
8459 /// ```
8460 pub fn set_or_clear_linked_vpn_tunnels<T>(mut self, v: std::option::Option<T>) -> Self
8461 where
8462 T: std::convert::Into<crate::model::LinkedVpnTunnels>,
8463 {
8464 self.linked_vpn_tunnels = v.map(|x| x.into());
8465 self
8466 }
8467
8468 /// Sets the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
8469 ///
8470 /// # Example
8471 /// ```ignore,no_run
8472 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8473 /// use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
8474 /// let x = Spoke::new().set_linked_interconnect_attachments(LinkedInterconnectAttachments::default()/* use setters */);
8475 /// ```
8476 pub fn set_linked_interconnect_attachments<T>(mut self, v: T) -> Self
8477 where
8478 T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
8479 {
8480 self.linked_interconnect_attachments = std::option::Option::Some(v.into());
8481 self
8482 }
8483
8484 /// Sets or clears the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
8485 ///
8486 /// # Example
8487 /// ```ignore,no_run
8488 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8489 /// use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
8490 /// let x = Spoke::new().set_or_clear_linked_interconnect_attachments(Some(LinkedInterconnectAttachments::default()/* use setters */));
8491 /// let x = Spoke::new().set_or_clear_linked_interconnect_attachments(None::<LinkedInterconnectAttachments>);
8492 /// ```
8493 pub fn set_or_clear_linked_interconnect_attachments<T>(
8494 mut self,
8495 v: std::option::Option<T>,
8496 ) -> Self
8497 where
8498 T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
8499 {
8500 self.linked_interconnect_attachments = v.map(|x| x.into());
8501 self
8502 }
8503
8504 /// Sets the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
8505 ///
8506 /// # Example
8507 /// ```ignore,no_run
8508 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8509 /// use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
8510 /// let x = Spoke::new().set_linked_router_appliance_instances(LinkedRouterApplianceInstances::default()/* use setters */);
8511 /// ```
8512 pub fn set_linked_router_appliance_instances<T>(mut self, v: T) -> Self
8513 where
8514 T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
8515 {
8516 self.linked_router_appliance_instances = std::option::Option::Some(v.into());
8517 self
8518 }
8519
8520 /// Sets or clears the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
8521 ///
8522 /// # Example
8523 /// ```ignore,no_run
8524 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8525 /// use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
8526 /// let x = Spoke::new().set_or_clear_linked_router_appliance_instances(Some(LinkedRouterApplianceInstances::default()/* use setters */));
8527 /// let x = Spoke::new().set_or_clear_linked_router_appliance_instances(None::<LinkedRouterApplianceInstances>);
8528 /// ```
8529 pub fn set_or_clear_linked_router_appliance_instances<T>(
8530 mut self,
8531 v: std::option::Option<T>,
8532 ) -> Self
8533 where
8534 T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
8535 {
8536 self.linked_router_appliance_instances = v.map(|x| x.into());
8537 self
8538 }
8539
8540 /// Sets the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
8541 ///
8542 /// # Example
8543 /// ```ignore,no_run
8544 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8545 /// use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
8546 /// let x = Spoke::new().set_linked_vpc_network(LinkedVpcNetwork::default()/* use setters */);
8547 /// ```
8548 pub fn set_linked_vpc_network<T>(mut self, v: T) -> Self
8549 where
8550 T: std::convert::Into<crate::model::LinkedVpcNetwork>,
8551 {
8552 self.linked_vpc_network = std::option::Option::Some(v.into());
8553 self
8554 }
8555
8556 /// Sets or clears the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
8557 ///
8558 /// # Example
8559 /// ```ignore,no_run
8560 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8561 /// use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
8562 /// let x = Spoke::new().set_or_clear_linked_vpc_network(Some(LinkedVpcNetwork::default()/* use setters */));
8563 /// let x = Spoke::new().set_or_clear_linked_vpc_network(None::<LinkedVpcNetwork>);
8564 /// ```
8565 pub fn set_or_clear_linked_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
8566 where
8567 T: std::convert::Into<crate::model::LinkedVpcNetwork>,
8568 {
8569 self.linked_vpc_network = v.map(|x| x.into());
8570 self
8571 }
8572
8573 /// Sets the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
8574 ///
8575 /// # Example
8576 /// ```ignore,no_run
8577 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8578 /// use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
8579 /// let x = Spoke::new().set_linked_producer_vpc_network(LinkedProducerVpcNetwork::default()/* use setters */);
8580 /// ```
8581 pub fn set_linked_producer_vpc_network<T>(mut self, v: T) -> Self
8582 where
8583 T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
8584 {
8585 self.linked_producer_vpc_network = std::option::Option::Some(v.into());
8586 self
8587 }
8588
8589 /// Sets or clears the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
8590 ///
8591 /// # Example
8592 /// ```ignore,no_run
8593 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8594 /// use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
8595 /// let x = Spoke::new().set_or_clear_linked_producer_vpc_network(Some(LinkedProducerVpcNetwork::default()/* use setters */));
8596 /// let x = Spoke::new().set_or_clear_linked_producer_vpc_network(None::<LinkedProducerVpcNetwork>);
8597 /// ```
8598 pub fn set_or_clear_linked_producer_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
8599 where
8600 T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
8601 {
8602 self.linked_producer_vpc_network = v.map(|x| x.into());
8603 self
8604 }
8605
8606 /// Sets the value of [unique_id][crate::model::Spoke::unique_id].
8607 ///
8608 /// # Example
8609 /// ```ignore,no_run
8610 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8611 /// let x = Spoke::new().set_unique_id("example");
8612 /// ```
8613 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8614 self.unique_id = v.into();
8615 self
8616 }
8617
8618 /// Sets the value of [state][crate::model::Spoke::state].
8619 ///
8620 /// # Example
8621 /// ```ignore,no_run
8622 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8623 /// use google_cloud_networkconnectivity_v1::model::State;
8624 /// let x0 = Spoke::new().set_state(State::Creating);
8625 /// let x1 = Spoke::new().set_state(State::Active);
8626 /// let x2 = Spoke::new().set_state(State::Deleting);
8627 /// ```
8628 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
8629 self.state = v.into();
8630 self
8631 }
8632
8633 /// Sets the value of [reasons][crate::model::Spoke::reasons].
8634 ///
8635 /// # Example
8636 /// ```ignore,no_run
8637 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8638 /// use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8639 /// let x = Spoke::new()
8640 /// .set_reasons([
8641 /// StateReason::default()/* use setters */,
8642 /// StateReason::default()/* use (different) setters */,
8643 /// ]);
8644 /// ```
8645 pub fn set_reasons<T, V>(mut self, v: T) -> Self
8646 where
8647 T: std::iter::IntoIterator<Item = V>,
8648 V: std::convert::Into<crate::model::spoke::StateReason>,
8649 {
8650 use std::iter::Iterator;
8651 self.reasons = v.into_iter().map(|i| i.into()).collect();
8652 self
8653 }
8654
8655 /// Sets the value of [spoke_type][crate::model::Spoke::spoke_type].
8656 ///
8657 /// # Example
8658 /// ```ignore,no_run
8659 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8660 /// use google_cloud_networkconnectivity_v1::model::SpokeType;
8661 /// let x0 = Spoke::new().set_spoke_type(SpokeType::VpnTunnel);
8662 /// let x1 = Spoke::new().set_spoke_type(SpokeType::InterconnectAttachment);
8663 /// let x2 = Spoke::new().set_spoke_type(SpokeType::RouterAppliance);
8664 /// ```
8665 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(mut self, v: T) -> Self {
8666 self.spoke_type = v.into();
8667 self
8668 }
8669
8670 /// Sets the value of [etag][crate::model::Spoke::etag].
8671 ///
8672 /// # Example
8673 /// ```ignore,no_run
8674 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8675 /// let x = Spoke::new().set_etag("example");
8676 /// ```
8677 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8678 self.etag = v.into();
8679 self
8680 }
8681
8682 /// Sets the value of [field_paths_pending_update][crate::model::Spoke::field_paths_pending_update].
8683 ///
8684 /// # Example
8685 /// ```ignore,no_run
8686 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8687 /// let x = Spoke::new().set_field_paths_pending_update(["a", "b", "c"]);
8688 /// ```
8689 pub fn set_field_paths_pending_update<T, V>(mut self, v: T) -> Self
8690 where
8691 T: std::iter::IntoIterator<Item = V>,
8692 V: std::convert::Into<std::string::String>,
8693 {
8694 use std::iter::Iterator;
8695 self.field_paths_pending_update = v.into_iter().map(|i| i.into()).collect();
8696 self
8697 }
8698}
8699
8700impl wkt::message::Message for Spoke {
8701 fn typename() -> &'static str {
8702 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke"
8703 }
8704}
8705
8706/// Defines additional types related to [Spoke].
8707pub mod spoke {
8708 #[allow(unused_imports)]
8709 use super::*;
8710
8711 /// The reason a spoke is inactive.
8712 #[derive(Clone, Default, PartialEq)]
8713 #[non_exhaustive]
8714 pub struct StateReason {
8715 /// The code associated with this reason.
8716 pub code: crate::model::spoke::state_reason::Code,
8717
8718 /// Human-readable details about this reason.
8719 pub message: std::string::String,
8720
8721 /// Additional information provided by the user in the RejectSpoke call.
8722 pub user_details: std::string::String,
8723
8724 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8725 }
8726
8727 impl StateReason {
8728 pub fn new() -> Self {
8729 std::default::Default::default()
8730 }
8731
8732 /// Sets the value of [code][crate::model::spoke::StateReason::code].
8733 ///
8734 /// # Example
8735 /// ```ignore,no_run
8736 /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8737 /// use google_cloud_networkconnectivity_v1::model::spoke::state_reason::Code;
8738 /// let x0 = StateReason::new().set_code(Code::PendingReview);
8739 /// let x1 = StateReason::new().set_code(Code::Rejected);
8740 /// let x2 = StateReason::new().set_code(Code::Paused);
8741 /// ```
8742 pub fn set_code<T: std::convert::Into<crate::model::spoke::state_reason::Code>>(
8743 mut self,
8744 v: T,
8745 ) -> Self {
8746 self.code = v.into();
8747 self
8748 }
8749
8750 /// Sets the value of [message][crate::model::spoke::StateReason::message].
8751 ///
8752 /// # Example
8753 /// ```ignore,no_run
8754 /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8755 /// let x = StateReason::new().set_message("example");
8756 /// ```
8757 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8758 self.message = v.into();
8759 self
8760 }
8761
8762 /// Sets the value of [user_details][crate::model::spoke::StateReason::user_details].
8763 ///
8764 /// # Example
8765 /// ```ignore,no_run
8766 /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8767 /// let x = StateReason::new().set_user_details("example");
8768 /// ```
8769 pub fn set_user_details<T: std::convert::Into<std::string::String>>(
8770 mut self,
8771 v: T,
8772 ) -> Self {
8773 self.user_details = v.into();
8774 self
8775 }
8776 }
8777
8778 impl wkt::message::Message for StateReason {
8779 fn typename() -> &'static str {
8780 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke.StateReason"
8781 }
8782 }
8783
8784 /// Defines additional types related to [StateReason].
8785 pub mod state_reason {
8786 #[allow(unused_imports)]
8787 use super::*;
8788
8789 /// The Code enum represents the various reasons a state can be `INACTIVE`.
8790 ///
8791 /// # Working with unknown values
8792 ///
8793 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8794 /// additional enum variants at any time. Adding new variants is not considered
8795 /// a breaking change. Applications should write their code in anticipation of:
8796 ///
8797 /// - New values appearing in future releases of the client library, **and**
8798 /// - New values received dynamically, without application changes.
8799 ///
8800 /// Please consult the [Working with enums] section in the user guide for some
8801 /// guidelines.
8802 ///
8803 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8804 #[derive(Clone, Debug, PartialEq)]
8805 #[non_exhaustive]
8806 pub enum Code {
8807 /// No information available.
8808 Unspecified,
8809 /// The proposed spoke is pending review.
8810 PendingReview,
8811 /// The proposed spoke has been rejected by the hub administrator.
8812 Rejected,
8813 /// The spoke has been deactivated internally.
8814 Paused,
8815 /// Network Connectivity Center encountered errors while accepting
8816 /// the spoke.
8817 Failed,
8818 /// The proposed spoke update is pending review.
8819 UpdatePendingReview,
8820 /// The proposed spoke update has been rejected by the hub administrator.
8821 UpdateRejected,
8822 /// Network Connectivity Center encountered errors while accepting
8823 /// the spoke update.
8824 UpdateFailed,
8825 /// If set, the enum was initialized with an unknown value.
8826 ///
8827 /// Applications can examine the value using [Code::value] or
8828 /// [Code::name].
8829 UnknownValue(code::UnknownValue),
8830 }
8831
8832 #[doc(hidden)]
8833 pub mod code {
8834 #[allow(unused_imports)]
8835 use super::*;
8836 #[derive(Clone, Debug, PartialEq)]
8837 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8838 }
8839
8840 impl Code {
8841 /// Gets the enum value.
8842 ///
8843 /// Returns `None` if the enum contains an unknown value deserialized from
8844 /// the string representation of enums.
8845 pub fn value(&self) -> std::option::Option<i32> {
8846 match self {
8847 Self::Unspecified => std::option::Option::Some(0),
8848 Self::PendingReview => std::option::Option::Some(1),
8849 Self::Rejected => std::option::Option::Some(2),
8850 Self::Paused => std::option::Option::Some(3),
8851 Self::Failed => std::option::Option::Some(4),
8852 Self::UpdatePendingReview => std::option::Option::Some(5),
8853 Self::UpdateRejected => std::option::Option::Some(6),
8854 Self::UpdateFailed => std::option::Option::Some(7),
8855 Self::UnknownValue(u) => u.0.value(),
8856 }
8857 }
8858
8859 /// Gets the enum value as a string.
8860 ///
8861 /// Returns `None` if the enum contains an unknown value deserialized from
8862 /// the integer representation of enums.
8863 pub fn name(&self) -> std::option::Option<&str> {
8864 match self {
8865 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
8866 Self::PendingReview => std::option::Option::Some("PENDING_REVIEW"),
8867 Self::Rejected => std::option::Option::Some("REJECTED"),
8868 Self::Paused => std::option::Option::Some("PAUSED"),
8869 Self::Failed => std::option::Option::Some("FAILED"),
8870 Self::UpdatePendingReview => std::option::Option::Some("UPDATE_PENDING_REVIEW"),
8871 Self::UpdateRejected => std::option::Option::Some("UPDATE_REJECTED"),
8872 Self::UpdateFailed => std::option::Option::Some("UPDATE_FAILED"),
8873 Self::UnknownValue(u) => u.0.name(),
8874 }
8875 }
8876 }
8877
8878 impl std::default::Default for Code {
8879 fn default() -> Self {
8880 use std::convert::From;
8881 Self::from(0)
8882 }
8883 }
8884
8885 impl std::fmt::Display for Code {
8886 fn fmt(
8887 &self,
8888 f: &mut std::fmt::Formatter<'_>,
8889 ) -> std::result::Result<(), std::fmt::Error> {
8890 wkt::internal::display_enum(f, self.name(), self.value())
8891 }
8892 }
8893
8894 impl std::convert::From<i32> for Code {
8895 fn from(value: i32) -> Self {
8896 match value {
8897 0 => Self::Unspecified,
8898 1 => Self::PendingReview,
8899 2 => Self::Rejected,
8900 3 => Self::Paused,
8901 4 => Self::Failed,
8902 5 => Self::UpdatePendingReview,
8903 6 => Self::UpdateRejected,
8904 7 => Self::UpdateFailed,
8905 _ => Self::UnknownValue(code::UnknownValue(
8906 wkt::internal::UnknownEnumValue::Integer(value),
8907 )),
8908 }
8909 }
8910 }
8911
8912 impl std::convert::From<&str> for Code {
8913 fn from(value: &str) -> Self {
8914 use std::string::ToString;
8915 match value {
8916 "CODE_UNSPECIFIED" => Self::Unspecified,
8917 "PENDING_REVIEW" => Self::PendingReview,
8918 "REJECTED" => Self::Rejected,
8919 "PAUSED" => Self::Paused,
8920 "FAILED" => Self::Failed,
8921 "UPDATE_PENDING_REVIEW" => Self::UpdatePendingReview,
8922 "UPDATE_REJECTED" => Self::UpdateRejected,
8923 "UPDATE_FAILED" => Self::UpdateFailed,
8924 _ => Self::UnknownValue(code::UnknownValue(
8925 wkt::internal::UnknownEnumValue::String(value.to_string()),
8926 )),
8927 }
8928 }
8929 }
8930
8931 impl serde::ser::Serialize for Code {
8932 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8933 where
8934 S: serde::Serializer,
8935 {
8936 match self {
8937 Self::Unspecified => serializer.serialize_i32(0),
8938 Self::PendingReview => serializer.serialize_i32(1),
8939 Self::Rejected => serializer.serialize_i32(2),
8940 Self::Paused => serializer.serialize_i32(3),
8941 Self::Failed => serializer.serialize_i32(4),
8942 Self::UpdatePendingReview => serializer.serialize_i32(5),
8943 Self::UpdateRejected => serializer.serialize_i32(6),
8944 Self::UpdateFailed => serializer.serialize_i32(7),
8945 Self::UnknownValue(u) => u.0.serialize(serializer),
8946 }
8947 }
8948 }
8949
8950 impl<'de> serde::de::Deserialize<'de> for Code {
8951 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8952 where
8953 D: serde::Deserializer<'de>,
8954 {
8955 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
8956 ".google.cloud.networkconnectivity.v1.Spoke.StateReason.Code",
8957 ))
8958 }
8959 }
8960 }
8961}
8962
8963#[derive(Clone, Default, PartialEq)]
8964#[non_exhaustive]
8965pub struct RouteTable {
8966 /// Immutable. The name of the route table. Route table names must be unique.
8967 /// They use the following form:
8968 /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}`
8969 pub name: std::string::String,
8970
8971 /// Output only. The time the route table was created.
8972 pub create_time: std::option::Option<wkt::Timestamp>,
8973
8974 /// Output only. The time the route table was last updated.
8975 pub update_time: std::option::Option<wkt::Timestamp>,
8976
8977 /// Optional labels in key-value pair format. For more information about
8978 /// labels, see [Requirements for
8979 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
8980 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8981
8982 /// An optional description of the route table.
8983 pub description: std::string::String,
8984
8985 /// Output only. The Google-generated UUID for the route table. This value is
8986 /// unique across all route table resources. If a route table is deleted and
8987 /// another with the same name is created, the new route table is assigned
8988 /// a different `uid`.
8989 pub uid: std::string::String,
8990
8991 /// Output only. The current lifecycle state of this route table.
8992 pub state: crate::model::State,
8993
8994 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8995}
8996
8997impl RouteTable {
8998 pub fn new() -> Self {
8999 std::default::Default::default()
9000 }
9001
9002 /// Sets the value of [name][crate::model::RouteTable::name].
9003 ///
9004 /// # Example
9005 /// ```ignore,no_run
9006 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9007 /// let x = RouteTable::new().set_name("example");
9008 /// ```
9009 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9010 self.name = v.into();
9011 self
9012 }
9013
9014 /// Sets the value of [create_time][crate::model::RouteTable::create_time].
9015 ///
9016 /// # Example
9017 /// ```ignore,no_run
9018 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9019 /// use wkt::Timestamp;
9020 /// let x = RouteTable::new().set_create_time(Timestamp::default()/* use setters */);
9021 /// ```
9022 pub fn set_create_time<T>(mut self, v: T) -> Self
9023 where
9024 T: std::convert::Into<wkt::Timestamp>,
9025 {
9026 self.create_time = std::option::Option::Some(v.into());
9027 self
9028 }
9029
9030 /// Sets or clears the value of [create_time][crate::model::RouteTable::create_time].
9031 ///
9032 /// # Example
9033 /// ```ignore,no_run
9034 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9035 /// use wkt::Timestamp;
9036 /// let x = RouteTable::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9037 /// let x = RouteTable::new().set_or_clear_create_time(None::<Timestamp>);
9038 /// ```
9039 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9040 where
9041 T: std::convert::Into<wkt::Timestamp>,
9042 {
9043 self.create_time = v.map(|x| x.into());
9044 self
9045 }
9046
9047 /// Sets the value of [update_time][crate::model::RouteTable::update_time].
9048 ///
9049 /// # Example
9050 /// ```ignore,no_run
9051 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9052 /// use wkt::Timestamp;
9053 /// let x = RouteTable::new().set_update_time(Timestamp::default()/* use setters */);
9054 /// ```
9055 pub fn set_update_time<T>(mut self, v: T) -> Self
9056 where
9057 T: std::convert::Into<wkt::Timestamp>,
9058 {
9059 self.update_time = std::option::Option::Some(v.into());
9060 self
9061 }
9062
9063 /// Sets or clears the value of [update_time][crate::model::RouteTable::update_time].
9064 ///
9065 /// # Example
9066 /// ```ignore,no_run
9067 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9068 /// use wkt::Timestamp;
9069 /// let x = RouteTable::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9070 /// let x = RouteTable::new().set_or_clear_update_time(None::<Timestamp>);
9071 /// ```
9072 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9073 where
9074 T: std::convert::Into<wkt::Timestamp>,
9075 {
9076 self.update_time = v.map(|x| x.into());
9077 self
9078 }
9079
9080 /// Sets the value of [labels][crate::model::RouteTable::labels].
9081 ///
9082 /// # Example
9083 /// ```ignore,no_run
9084 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9085 /// let x = RouteTable::new().set_labels([
9086 /// ("key0", "abc"),
9087 /// ("key1", "xyz"),
9088 /// ]);
9089 /// ```
9090 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9091 where
9092 T: std::iter::IntoIterator<Item = (K, V)>,
9093 K: std::convert::Into<std::string::String>,
9094 V: std::convert::Into<std::string::String>,
9095 {
9096 use std::iter::Iterator;
9097 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9098 self
9099 }
9100
9101 /// Sets the value of [description][crate::model::RouteTable::description].
9102 ///
9103 /// # Example
9104 /// ```ignore,no_run
9105 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9106 /// let x = RouteTable::new().set_description("example");
9107 /// ```
9108 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9109 self.description = v.into();
9110 self
9111 }
9112
9113 /// Sets the value of [uid][crate::model::RouteTable::uid].
9114 ///
9115 /// # Example
9116 /// ```ignore,no_run
9117 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9118 /// let x = RouteTable::new().set_uid("example");
9119 /// ```
9120 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9121 self.uid = v.into();
9122 self
9123 }
9124
9125 /// Sets the value of [state][crate::model::RouteTable::state].
9126 ///
9127 /// # Example
9128 /// ```ignore,no_run
9129 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9130 /// use google_cloud_networkconnectivity_v1::model::State;
9131 /// let x0 = RouteTable::new().set_state(State::Creating);
9132 /// let x1 = RouteTable::new().set_state(State::Active);
9133 /// let x2 = RouteTable::new().set_state(State::Deleting);
9134 /// ```
9135 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9136 self.state = v.into();
9137 self
9138 }
9139}
9140
9141impl wkt::message::Message for RouteTable {
9142 fn typename() -> &'static str {
9143 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouteTable"
9144 }
9145}
9146
9147/// A route defines a path from VM instances within a spoke to a specific
9148/// destination resource. Only VPC spokes have routes.
9149#[derive(Clone, Default, PartialEq)]
9150#[non_exhaustive]
9151pub struct Route {
9152 /// Immutable. The name of the route. Route names must be unique. Route names
9153 /// use the following form:
9154 /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}/routes/{route_id}`
9155 pub name: std::string::String,
9156
9157 /// Output only. The time the route was created.
9158 pub create_time: std::option::Option<wkt::Timestamp>,
9159
9160 /// Output only. The time the route was last updated.
9161 pub update_time: std::option::Option<wkt::Timestamp>,
9162
9163 /// The destination IP address range.
9164 pub ip_cidr_range: std::string::String,
9165
9166 /// Output only. The route's type. Its type is determined by the properties of
9167 /// its IP address range.
9168 pub r#type: crate::model::RouteType,
9169
9170 /// Immutable. The destination VPC network for packets on this route.
9171 pub next_hop_vpc_network: std::option::Option<crate::model::NextHopVpcNetwork>,
9172
9173 /// Optional labels in key-value pair format. For more information about
9174 /// labels, see [Requirements for
9175 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
9176 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9177
9178 /// An optional description of the route.
9179 pub description: std::string::String,
9180
9181 /// Output only. The Google-generated UUID for the route. This value is unique
9182 /// across all Network Connectivity Center route resources. If a
9183 /// route is deleted and another with the same name is created,
9184 /// the new route is assigned a different `uid`.
9185 pub uid: std::string::String,
9186
9187 /// Output only. The current lifecycle state of the route.
9188 pub state: crate::model::State,
9189
9190 /// Immutable. The spoke that this route leads to.
9191 /// Example: projects/12345/locations/global/spokes/SPOKE
9192 pub spoke: std::string::String,
9193
9194 /// Output only. The origin location of the route.
9195 /// Uses the following form: "projects/{project}/locations/{location}"
9196 /// Example: projects/1234/locations/us-central1
9197 pub location: std::string::String,
9198
9199 /// Output only. The priority of this route. Priority is used to break ties in
9200 /// cases where a destination matches more than one route. In these cases the
9201 /// route with the lowest-numbered priority value wins.
9202 pub priority: i64,
9203
9204 /// Immutable. The next-hop VPN tunnel for packets on this route.
9205 pub next_hop_vpn_tunnel: std::option::Option<crate::model::NextHopVPNTunnel>,
9206
9207 /// Immutable. The next-hop Router appliance instance for packets on this
9208 /// route.
9209 pub next_hop_router_appliance_instance:
9210 std::option::Option<crate::model::NextHopRouterApplianceInstance>,
9211
9212 /// Immutable. The next-hop VLAN attachment for packets on this route.
9213 pub next_hop_interconnect_attachment:
9214 std::option::Option<crate::model::NextHopInterconnectAttachment>,
9215
9216 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9217}
9218
9219impl Route {
9220 pub fn new() -> Self {
9221 std::default::Default::default()
9222 }
9223
9224 /// Sets the value of [name][crate::model::Route::name].
9225 ///
9226 /// # Example
9227 /// ```ignore,no_run
9228 /// # use google_cloud_networkconnectivity_v1::model::Route;
9229 /// let x = Route::new().set_name("example");
9230 /// ```
9231 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9232 self.name = v.into();
9233 self
9234 }
9235
9236 /// Sets the value of [create_time][crate::model::Route::create_time].
9237 ///
9238 /// # Example
9239 /// ```ignore,no_run
9240 /// # use google_cloud_networkconnectivity_v1::model::Route;
9241 /// use wkt::Timestamp;
9242 /// let x = Route::new().set_create_time(Timestamp::default()/* use setters */);
9243 /// ```
9244 pub fn set_create_time<T>(mut self, v: T) -> Self
9245 where
9246 T: std::convert::Into<wkt::Timestamp>,
9247 {
9248 self.create_time = std::option::Option::Some(v.into());
9249 self
9250 }
9251
9252 /// Sets or clears the value of [create_time][crate::model::Route::create_time].
9253 ///
9254 /// # Example
9255 /// ```ignore,no_run
9256 /// # use google_cloud_networkconnectivity_v1::model::Route;
9257 /// use wkt::Timestamp;
9258 /// let x = Route::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9259 /// let x = Route::new().set_or_clear_create_time(None::<Timestamp>);
9260 /// ```
9261 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9262 where
9263 T: std::convert::Into<wkt::Timestamp>,
9264 {
9265 self.create_time = v.map(|x| x.into());
9266 self
9267 }
9268
9269 /// Sets the value of [update_time][crate::model::Route::update_time].
9270 ///
9271 /// # Example
9272 /// ```ignore,no_run
9273 /// # use google_cloud_networkconnectivity_v1::model::Route;
9274 /// use wkt::Timestamp;
9275 /// let x = Route::new().set_update_time(Timestamp::default()/* use setters */);
9276 /// ```
9277 pub fn set_update_time<T>(mut self, v: T) -> Self
9278 where
9279 T: std::convert::Into<wkt::Timestamp>,
9280 {
9281 self.update_time = std::option::Option::Some(v.into());
9282 self
9283 }
9284
9285 /// Sets or clears the value of [update_time][crate::model::Route::update_time].
9286 ///
9287 /// # Example
9288 /// ```ignore,no_run
9289 /// # use google_cloud_networkconnectivity_v1::model::Route;
9290 /// use wkt::Timestamp;
9291 /// let x = Route::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9292 /// let x = Route::new().set_or_clear_update_time(None::<Timestamp>);
9293 /// ```
9294 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9295 where
9296 T: std::convert::Into<wkt::Timestamp>,
9297 {
9298 self.update_time = v.map(|x| x.into());
9299 self
9300 }
9301
9302 /// Sets the value of [ip_cidr_range][crate::model::Route::ip_cidr_range].
9303 ///
9304 /// # Example
9305 /// ```ignore,no_run
9306 /// # use google_cloud_networkconnectivity_v1::model::Route;
9307 /// let x = Route::new().set_ip_cidr_range("example");
9308 /// ```
9309 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9310 self.ip_cidr_range = v.into();
9311 self
9312 }
9313
9314 /// Sets the value of [r#type][crate::model::Route::type].
9315 ///
9316 /// # Example
9317 /// ```ignore,no_run
9318 /// # use google_cloud_networkconnectivity_v1::model::Route;
9319 /// use google_cloud_networkconnectivity_v1::model::RouteType;
9320 /// let x0 = Route::new().set_type(RouteType::VpcPrimarySubnet);
9321 /// let x1 = Route::new().set_type(RouteType::VpcSecondarySubnet);
9322 /// let x2 = Route::new().set_type(RouteType::DynamicRoute);
9323 /// ```
9324 pub fn set_type<T: std::convert::Into<crate::model::RouteType>>(mut self, v: T) -> Self {
9325 self.r#type = v.into();
9326 self
9327 }
9328
9329 /// Sets the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
9330 ///
9331 /// # Example
9332 /// ```ignore,no_run
9333 /// # use google_cloud_networkconnectivity_v1::model::Route;
9334 /// use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
9335 /// let x = Route::new().set_next_hop_vpc_network(NextHopVpcNetwork::default()/* use setters */);
9336 /// ```
9337 pub fn set_next_hop_vpc_network<T>(mut self, v: T) -> Self
9338 where
9339 T: std::convert::Into<crate::model::NextHopVpcNetwork>,
9340 {
9341 self.next_hop_vpc_network = std::option::Option::Some(v.into());
9342 self
9343 }
9344
9345 /// Sets or clears the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
9346 ///
9347 /// # Example
9348 /// ```ignore,no_run
9349 /// # use google_cloud_networkconnectivity_v1::model::Route;
9350 /// use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
9351 /// let x = Route::new().set_or_clear_next_hop_vpc_network(Some(NextHopVpcNetwork::default()/* use setters */));
9352 /// let x = Route::new().set_or_clear_next_hop_vpc_network(None::<NextHopVpcNetwork>);
9353 /// ```
9354 pub fn set_or_clear_next_hop_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
9355 where
9356 T: std::convert::Into<crate::model::NextHopVpcNetwork>,
9357 {
9358 self.next_hop_vpc_network = v.map(|x| x.into());
9359 self
9360 }
9361
9362 /// Sets the value of [labels][crate::model::Route::labels].
9363 ///
9364 /// # Example
9365 /// ```ignore,no_run
9366 /// # use google_cloud_networkconnectivity_v1::model::Route;
9367 /// let x = Route::new().set_labels([
9368 /// ("key0", "abc"),
9369 /// ("key1", "xyz"),
9370 /// ]);
9371 /// ```
9372 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9373 where
9374 T: std::iter::IntoIterator<Item = (K, V)>,
9375 K: std::convert::Into<std::string::String>,
9376 V: std::convert::Into<std::string::String>,
9377 {
9378 use std::iter::Iterator;
9379 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9380 self
9381 }
9382
9383 /// Sets the value of [description][crate::model::Route::description].
9384 ///
9385 /// # Example
9386 /// ```ignore,no_run
9387 /// # use google_cloud_networkconnectivity_v1::model::Route;
9388 /// let x = Route::new().set_description("example");
9389 /// ```
9390 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9391 self.description = v.into();
9392 self
9393 }
9394
9395 /// Sets the value of [uid][crate::model::Route::uid].
9396 ///
9397 /// # Example
9398 /// ```ignore,no_run
9399 /// # use google_cloud_networkconnectivity_v1::model::Route;
9400 /// let x = Route::new().set_uid("example");
9401 /// ```
9402 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9403 self.uid = v.into();
9404 self
9405 }
9406
9407 /// Sets the value of [state][crate::model::Route::state].
9408 ///
9409 /// # Example
9410 /// ```ignore,no_run
9411 /// # use google_cloud_networkconnectivity_v1::model::Route;
9412 /// use google_cloud_networkconnectivity_v1::model::State;
9413 /// let x0 = Route::new().set_state(State::Creating);
9414 /// let x1 = Route::new().set_state(State::Active);
9415 /// let x2 = Route::new().set_state(State::Deleting);
9416 /// ```
9417 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9418 self.state = v.into();
9419 self
9420 }
9421
9422 /// Sets the value of [spoke][crate::model::Route::spoke].
9423 ///
9424 /// # Example
9425 /// ```ignore,no_run
9426 /// # use google_cloud_networkconnectivity_v1::model::Route;
9427 /// let x = Route::new().set_spoke("example");
9428 /// ```
9429 pub fn set_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9430 self.spoke = v.into();
9431 self
9432 }
9433
9434 /// Sets the value of [location][crate::model::Route::location].
9435 ///
9436 /// # Example
9437 /// ```ignore,no_run
9438 /// # use google_cloud_networkconnectivity_v1::model::Route;
9439 /// let x = Route::new().set_location("example");
9440 /// ```
9441 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9442 self.location = v.into();
9443 self
9444 }
9445
9446 /// Sets the value of [priority][crate::model::Route::priority].
9447 ///
9448 /// # Example
9449 /// ```ignore,no_run
9450 /// # use google_cloud_networkconnectivity_v1::model::Route;
9451 /// let x = Route::new().set_priority(42);
9452 /// ```
9453 pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9454 self.priority = v.into();
9455 self
9456 }
9457
9458 /// Sets the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
9459 ///
9460 /// # Example
9461 /// ```ignore,no_run
9462 /// # use google_cloud_networkconnectivity_v1::model::Route;
9463 /// use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
9464 /// let x = Route::new().set_next_hop_vpn_tunnel(NextHopVPNTunnel::default()/* use setters */);
9465 /// ```
9466 pub fn set_next_hop_vpn_tunnel<T>(mut self, v: T) -> Self
9467 where
9468 T: std::convert::Into<crate::model::NextHopVPNTunnel>,
9469 {
9470 self.next_hop_vpn_tunnel = std::option::Option::Some(v.into());
9471 self
9472 }
9473
9474 /// Sets or clears the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
9475 ///
9476 /// # Example
9477 /// ```ignore,no_run
9478 /// # use google_cloud_networkconnectivity_v1::model::Route;
9479 /// use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
9480 /// let x = Route::new().set_or_clear_next_hop_vpn_tunnel(Some(NextHopVPNTunnel::default()/* use setters */));
9481 /// let x = Route::new().set_or_clear_next_hop_vpn_tunnel(None::<NextHopVPNTunnel>);
9482 /// ```
9483 pub fn set_or_clear_next_hop_vpn_tunnel<T>(mut self, v: std::option::Option<T>) -> Self
9484 where
9485 T: std::convert::Into<crate::model::NextHopVPNTunnel>,
9486 {
9487 self.next_hop_vpn_tunnel = v.map(|x| x.into());
9488 self
9489 }
9490
9491 /// Sets the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
9492 ///
9493 /// # Example
9494 /// ```ignore,no_run
9495 /// # use google_cloud_networkconnectivity_v1::model::Route;
9496 /// use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
9497 /// let x = Route::new().set_next_hop_router_appliance_instance(NextHopRouterApplianceInstance::default()/* use setters */);
9498 /// ```
9499 pub fn set_next_hop_router_appliance_instance<T>(mut self, v: T) -> Self
9500 where
9501 T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
9502 {
9503 self.next_hop_router_appliance_instance = std::option::Option::Some(v.into());
9504 self
9505 }
9506
9507 /// Sets or clears the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
9508 ///
9509 /// # Example
9510 /// ```ignore,no_run
9511 /// # use google_cloud_networkconnectivity_v1::model::Route;
9512 /// use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
9513 /// let x = Route::new().set_or_clear_next_hop_router_appliance_instance(Some(NextHopRouterApplianceInstance::default()/* use setters */));
9514 /// let x = Route::new().set_or_clear_next_hop_router_appliance_instance(None::<NextHopRouterApplianceInstance>);
9515 /// ```
9516 pub fn set_or_clear_next_hop_router_appliance_instance<T>(
9517 mut self,
9518 v: std::option::Option<T>,
9519 ) -> Self
9520 where
9521 T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
9522 {
9523 self.next_hop_router_appliance_instance = v.map(|x| x.into());
9524 self
9525 }
9526
9527 /// Sets the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
9528 ///
9529 /// # Example
9530 /// ```ignore,no_run
9531 /// # use google_cloud_networkconnectivity_v1::model::Route;
9532 /// use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
9533 /// let x = Route::new().set_next_hop_interconnect_attachment(NextHopInterconnectAttachment::default()/* use setters */);
9534 /// ```
9535 pub fn set_next_hop_interconnect_attachment<T>(mut self, v: T) -> Self
9536 where
9537 T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
9538 {
9539 self.next_hop_interconnect_attachment = std::option::Option::Some(v.into());
9540 self
9541 }
9542
9543 /// Sets or clears the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
9544 ///
9545 /// # Example
9546 /// ```ignore,no_run
9547 /// # use google_cloud_networkconnectivity_v1::model::Route;
9548 /// use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
9549 /// let x = Route::new().set_or_clear_next_hop_interconnect_attachment(Some(NextHopInterconnectAttachment::default()/* use setters */));
9550 /// let x = Route::new().set_or_clear_next_hop_interconnect_attachment(None::<NextHopInterconnectAttachment>);
9551 /// ```
9552 pub fn set_or_clear_next_hop_interconnect_attachment<T>(
9553 mut self,
9554 v: std::option::Option<T>,
9555 ) -> Self
9556 where
9557 T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
9558 {
9559 self.next_hop_interconnect_attachment = v.map(|x| x.into());
9560 self
9561 }
9562}
9563
9564impl wkt::message::Message for Route {
9565 fn typename() -> &'static str {
9566 "type.googleapis.com/google.cloud.networkconnectivity.v1.Route"
9567 }
9568}
9569
9570/// A group represents a subset of spokes attached to a hub.
9571#[derive(Clone, Default, PartialEq)]
9572#[non_exhaustive]
9573pub struct Group {
9574 /// Immutable. The name of the group. Group names must be unique. They
9575 /// use the following form:
9576 /// `projects/{project_number}/locations/global/hubs/{hub}/groups/{group_id}`
9577 pub name: std::string::String,
9578
9579 /// Output only. The time the group was created.
9580 pub create_time: std::option::Option<wkt::Timestamp>,
9581
9582 /// Output only. The time the group was last updated.
9583 pub update_time: std::option::Option<wkt::Timestamp>,
9584
9585 /// Optional. Labels in key-value pair format. For more information about
9586 /// labels, see [Requirements for
9587 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
9588 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9589
9590 /// Optional. The description of the group.
9591 pub description: std::string::String,
9592
9593 /// Output only. The Google-generated UUID for the group. This value is unique
9594 /// across all group resources. If a group is deleted and
9595 /// another with the same name is created, the new route table is assigned
9596 /// a different unique_id.
9597 pub uid: std::string::String,
9598
9599 /// Output only. The current lifecycle state of this group.
9600 pub state: crate::model::State,
9601
9602 /// Optional. The auto-accept setting for this group.
9603 pub auto_accept: std::option::Option<crate::model::AutoAccept>,
9604
9605 /// Output only. The name of the route table that corresponds to this group.
9606 /// They use the following form:
9607 /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
9608 pub route_table: std::string::String,
9609
9610 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9611}
9612
9613impl Group {
9614 pub fn new() -> Self {
9615 std::default::Default::default()
9616 }
9617
9618 /// Sets the value of [name][crate::model::Group::name].
9619 ///
9620 /// # Example
9621 /// ```ignore,no_run
9622 /// # use google_cloud_networkconnectivity_v1::model::Group;
9623 /// let x = Group::new().set_name("example");
9624 /// ```
9625 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9626 self.name = v.into();
9627 self
9628 }
9629
9630 /// Sets the value of [create_time][crate::model::Group::create_time].
9631 ///
9632 /// # Example
9633 /// ```ignore,no_run
9634 /// # use google_cloud_networkconnectivity_v1::model::Group;
9635 /// use wkt::Timestamp;
9636 /// let x = Group::new().set_create_time(Timestamp::default()/* use setters */);
9637 /// ```
9638 pub fn set_create_time<T>(mut self, v: T) -> Self
9639 where
9640 T: std::convert::Into<wkt::Timestamp>,
9641 {
9642 self.create_time = std::option::Option::Some(v.into());
9643 self
9644 }
9645
9646 /// Sets or clears the value of [create_time][crate::model::Group::create_time].
9647 ///
9648 /// # Example
9649 /// ```ignore,no_run
9650 /// # use google_cloud_networkconnectivity_v1::model::Group;
9651 /// use wkt::Timestamp;
9652 /// let x = Group::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9653 /// let x = Group::new().set_or_clear_create_time(None::<Timestamp>);
9654 /// ```
9655 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9656 where
9657 T: std::convert::Into<wkt::Timestamp>,
9658 {
9659 self.create_time = v.map(|x| x.into());
9660 self
9661 }
9662
9663 /// Sets the value of [update_time][crate::model::Group::update_time].
9664 ///
9665 /// # Example
9666 /// ```ignore,no_run
9667 /// # use google_cloud_networkconnectivity_v1::model::Group;
9668 /// use wkt::Timestamp;
9669 /// let x = Group::new().set_update_time(Timestamp::default()/* use setters */);
9670 /// ```
9671 pub fn set_update_time<T>(mut self, v: T) -> Self
9672 where
9673 T: std::convert::Into<wkt::Timestamp>,
9674 {
9675 self.update_time = std::option::Option::Some(v.into());
9676 self
9677 }
9678
9679 /// Sets or clears the value of [update_time][crate::model::Group::update_time].
9680 ///
9681 /// # Example
9682 /// ```ignore,no_run
9683 /// # use google_cloud_networkconnectivity_v1::model::Group;
9684 /// use wkt::Timestamp;
9685 /// let x = Group::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9686 /// let x = Group::new().set_or_clear_update_time(None::<Timestamp>);
9687 /// ```
9688 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9689 where
9690 T: std::convert::Into<wkt::Timestamp>,
9691 {
9692 self.update_time = v.map(|x| x.into());
9693 self
9694 }
9695
9696 /// Sets the value of [labels][crate::model::Group::labels].
9697 ///
9698 /// # Example
9699 /// ```ignore,no_run
9700 /// # use google_cloud_networkconnectivity_v1::model::Group;
9701 /// let x = Group::new().set_labels([
9702 /// ("key0", "abc"),
9703 /// ("key1", "xyz"),
9704 /// ]);
9705 /// ```
9706 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9707 where
9708 T: std::iter::IntoIterator<Item = (K, V)>,
9709 K: std::convert::Into<std::string::String>,
9710 V: std::convert::Into<std::string::String>,
9711 {
9712 use std::iter::Iterator;
9713 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9714 self
9715 }
9716
9717 /// Sets the value of [description][crate::model::Group::description].
9718 ///
9719 /// # Example
9720 /// ```ignore,no_run
9721 /// # use google_cloud_networkconnectivity_v1::model::Group;
9722 /// let x = Group::new().set_description("example");
9723 /// ```
9724 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9725 self.description = v.into();
9726 self
9727 }
9728
9729 /// Sets the value of [uid][crate::model::Group::uid].
9730 ///
9731 /// # Example
9732 /// ```ignore,no_run
9733 /// # use google_cloud_networkconnectivity_v1::model::Group;
9734 /// let x = Group::new().set_uid("example");
9735 /// ```
9736 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9737 self.uid = v.into();
9738 self
9739 }
9740
9741 /// Sets the value of [state][crate::model::Group::state].
9742 ///
9743 /// # Example
9744 /// ```ignore,no_run
9745 /// # use google_cloud_networkconnectivity_v1::model::Group;
9746 /// use google_cloud_networkconnectivity_v1::model::State;
9747 /// let x0 = Group::new().set_state(State::Creating);
9748 /// let x1 = Group::new().set_state(State::Active);
9749 /// let x2 = Group::new().set_state(State::Deleting);
9750 /// ```
9751 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9752 self.state = v.into();
9753 self
9754 }
9755
9756 /// Sets the value of [auto_accept][crate::model::Group::auto_accept].
9757 ///
9758 /// # Example
9759 /// ```ignore,no_run
9760 /// # use google_cloud_networkconnectivity_v1::model::Group;
9761 /// use google_cloud_networkconnectivity_v1::model::AutoAccept;
9762 /// let x = Group::new().set_auto_accept(AutoAccept::default()/* use setters */);
9763 /// ```
9764 pub fn set_auto_accept<T>(mut self, v: T) -> Self
9765 where
9766 T: std::convert::Into<crate::model::AutoAccept>,
9767 {
9768 self.auto_accept = std::option::Option::Some(v.into());
9769 self
9770 }
9771
9772 /// Sets or clears the value of [auto_accept][crate::model::Group::auto_accept].
9773 ///
9774 /// # Example
9775 /// ```ignore,no_run
9776 /// # use google_cloud_networkconnectivity_v1::model::Group;
9777 /// use google_cloud_networkconnectivity_v1::model::AutoAccept;
9778 /// let x = Group::new().set_or_clear_auto_accept(Some(AutoAccept::default()/* use setters */));
9779 /// let x = Group::new().set_or_clear_auto_accept(None::<AutoAccept>);
9780 /// ```
9781 pub fn set_or_clear_auto_accept<T>(mut self, v: std::option::Option<T>) -> Self
9782 where
9783 T: std::convert::Into<crate::model::AutoAccept>,
9784 {
9785 self.auto_accept = v.map(|x| x.into());
9786 self
9787 }
9788
9789 /// Sets the value of [route_table][crate::model::Group::route_table].
9790 ///
9791 /// # Example
9792 /// ```ignore,no_run
9793 /// # use google_cloud_networkconnectivity_v1::model::Group;
9794 /// let x = Group::new().set_route_table("example");
9795 /// ```
9796 pub fn set_route_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9797 self.route_table = v.into();
9798 self
9799 }
9800}
9801
9802impl wkt::message::Message for Group {
9803 fn typename() -> &'static str {
9804 "type.googleapis.com/google.cloud.networkconnectivity.v1.Group"
9805 }
9806}
9807
9808/// The auto-accept setting for a group controls whether
9809/// proposed spokes are automatically attached to the hub. If auto-accept is
9810/// enabled, the spoke immediately is attached to the hub and becomes part of the
9811/// group. In this case, the new spoke is in the ACTIVE state.
9812/// If auto-accept is disabled, the spoke goes to the INACTIVE
9813/// state, and it must be reviewed and accepted by a hub
9814/// administrator.
9815#[derive(Clone, Default, PartialEq)]
9816#[non_exhaustive]
9817pub struct AutoAccept {
9818 /// Optional. A list of project ids or project numbers for which you want
9819 /// to enable auto-accept. The auto-accept setting is applied to
9820 /// spokes being created or updated in these projects.
9821 pub auto_accept_projects: std::vec::Vec<std::string::String>,
9822
9823 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9824}
9825
9826impl AutoAccept {
9827 pub fn new() -> Self {
9828 std::default::Default::default()
9829 }
9830
9831 /// Sets the value of [auto_accept_projects][crate::model::AutoAccept::auto_accept_projects].
9832 ///
9833 /// # Example
9834 /// ```ignore,no_run
9835 /// # use google_cloud_networkconnectivity_v1::model::AutoAccept;
9836 /// let x = AutoAccept::new().set_auto_accept_projects(["a", "b", "c"]);
9837 /// ```
9838 pub fn set_auto_accept_projects<T, V>(mut self, v: T) -> Self
9839 where
9840 T: std::iter::IntoIterator<Item = V>,
9841 V: std::convert::Into<std::string::String>,
9842 {
9843 use std::iter::Iterator;
9844 self.auto_accept_projects = v.into_iter().map(|i| i.into()).collect();
9845 self
9846 }
9847}
9848
9849impl wkt::message::Message for AutoAccept {
9850 fn typename() -> &'static str {
9851 "type.googleapis.com/google.cloud.networkconnectivity.v1.AutoAccept"
9852 }
9853}
9854
9855/// Request for
9856/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
9857/// method.
9858///
9859/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
9860#[derive(Clone, Default, PartialEq)]
9861#[non_exhaustive]
9862pub struct ListHubsRequest {
9863 /// Required. The parent resource's name.
9864 pub parent: std::string::String,
9865
9866 /// The maximum number of results per page to return.
9867 pub page_size: i32,
9868
9869 /// The page token.
9870 pub page_token: std::string::String,
9871
9872 /// An expression that filters the list of results.
9873 pub filter: std::string::String,
9874
9875 /// Sort the results by a certain order.
9876 pub order_by: std::string::String,
9877
9878 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9879}
9880
9881impl ListHubsRequest {
9882 pub fn new() -> Self {
9883 std::default::Default::default()
9884 }
9885
9886 /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
9887 ///
9888 /// # Example
9889 /// ```ignore,no_run
9890 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9891 /// let x = ListHubsRequest::new().set_parent("example");
9892 /// ```
9893 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9894 self.parent = v.into();
9895 self
9896 }
9897
9898 /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
9899 ///
9900 /// # Example
9901 /// ```ignore,no_run
9902 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9903 /// let x = ListHubsRequest::new().set_page_size(42);
9904 /// ```
9905 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9906 self.page_size = v.into();
9907 self
9908 }
9909
9910 /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
9911 ///
9912 /// # Example
9913 /// ```ignore,no_run
9914 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9915 /// let x = ListHubsRequest::new().set_page_token("example");
9916 /// ```
9917 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9918 self.page_token = v.into();
9919 self
9920 }
9921
9922 /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
9923 ///
9924 /// # Example
9925 /// ```ignore,no_run
9926 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9927 /// let x = ListHubsRequest::new().set_filter("example");
9928 /// ```
9929 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9930 self.filter = v.into();
9931 self
9932 }
9933
9934 /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
9935 ///
9936 /// # Example
9937 /// ```ignore,no_run
9938 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9939 /// let x = ListHubsRequest::new().set_order_by("example");
9940 /// ```
9941 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9942 self.order_by = v.into();
9943 self
9944 }
9945}
9946
9947impl wkt::message::Message for ListHubsRequest {
9948 fn typename() -> &'static str {
9949 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsRequest"
9950 }
9951}
9952
9953/// Response for
9954/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
9955/// method.
9956///
9957/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
9958#[derive(Clone, Default, PartialEq)]
9959#[non_exhaustive]
9960pub struct ListHubsResponse {
9961 /// The requested hubs.
9962 pub hubs: std::vec::Vec<crate::model::Hub>,
9963
9964 /// The token for the next page of the response. To see more results,
9965 /// use this value as the page_token for your next request. If this value
9966 /// is empty, there are no more results.
9967 pub next_page_token: std::string::String,
9968
9969 /// Locations that could not be reached.
9970 pub unreachable: std::vec::Vec<std::string::String>,
9971
9972 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9973}
9974
9975impl ListHubsResponse {
9976 pub fn new() -> Self {
9977 std::default::Default::default()
9978 }
9979
9980 /// Sets the value of [hubs][crate::model::ListHubsResponse::hubs].
9981 ///
9982 /// # Example
9983 /// ```ignore,no_run
9984 /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
9985 /// use google_cloud_networkconnectivity_v1::model::Hub;
9986 /// let x = ListHubsResponse::new()
9987 /// .set_hubs([
9988 /// Hub::default()/* use setters */,
9989 /// Hub::default()/* use (different) setters */,
9990 /// ]);
9991 /// ```
9992 pub fn set_hubs<T, V>(mut self, v: T) -> Self
9993 where
9994 T: std::iter::IntoIterator<Item = V>,
9995 V: std::convert::Into<crate::model::Hub>,
9996 {
9997 use std::iter::Iterator;
9998 self.hubs = v.into_iter().map(|i| i.into()).collect();
9999 self
10000 }
10001
10002 /// Sets the value of [next_page_token][crate::model::ListHubsResponse::next_page_token].
10003 ///
10004 /// # Example
10005 /// ```ignore,no_run
10006 /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
10007 /// let x = ListHubsResponse::new().set_next_page_token("example");
10008 /// ```
10009 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10010 self.next_page_token = v.into();
10011 self
10012 }
10013
10014 /// Sets the value of [unreachable][crate::model::ListHubsResponse::unreachable].
10015 ///
10016 /// # Example
10017 /// ```ignore,no_run
10018 /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
10019 /// let x = ListHubsResponse::new().set_unreachable(["a", "b", "c"]);
10020 /// ```
10021 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10022 where
10023 T: std::iter::IntoIterator<Item = V>,
10024 V: std::convert::Into<std::string::String>,
10025 {
10026 use std::iter::Iterator;
10027 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10028 self
10029 }
10030}
10031
10032impl wkt::message::Message for ListHubsResponse {
10033 fn typename() -> &'static str {
10034 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsResponse"
10035 }
10036}
10037
10038#[doc(hidden)]
10039impl google_cloud_gax::paginator::internal::PageableResponse for ListHubsResponse {
10040 type PageItem = crate::model::Hub;
10041
10042 fn items(self) -> std::vec::Vec<Self::PageItem> {
10043 self.hubs
10044 }
10045
10046 fn next_page_token(&self) -> std::string::String {
10047 use std::clone::Clone;
10048 self.next_page_token.clone()
10049 }
10050}
10051
10052/// Request for
10053/// [HubService.GetHub][google.cloud.networkconnectivity.v1.HubService.GetHub]
10054/// method.
10055///
10056/// [google.cloud.networkconnectivity.v1.HubService.GetHub]: crate::client::HubService::get_hub
10057#[derive(Clone, Default, PartialEq)]
10058#[non_exhaustive]
10059pub struct GetHubRequest {
10060 /// Required. The name of the hub resource to get.
10061 pub name: std::string::String,
10062
10063 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10064}
10065
10066impl GetHubRequest {
10067 pub fn new() -> Self {
10068 std::default::Default::default()
10069 }
10070
10071 /// Sets the value of [name][crate::model::GetHubRequest::name].
10072 ///
10073 /// # Example
10074 /// ```ignore,no_run
10075 /// # use google_cloud_networkconnectivity_v1::model::GetHubRequest;
10076 /// let x = GetHubRequest::new().set_name("example");
10077 /// ```
10078 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10079 self.name = v.into();
10080 self
10081 }
10082}
10083
10084impl wkt::message::Message for GetHubRequest {
10085 fn typename() -> &'static str {
10086 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetHubRequest"
10087 }
10088}
10089
10090/// Request for
10091/// [HubService.CreateHub][google.cloud.networkconnectivity.v1.HubService.CreateHub]
10092/// method.
10093///
10094/// [google.cloud.networkconnectivity.v1.HubService.CreateHub]: crate::client::HubService::create_hub
10095#[derive(Clone, Default, PartialEq)]
10096#[non_exhaustive]
10097pub struct CreateHubRequest {
10098 /// Required. The parent resource.
10099 pub parent: std::string::String,
10100
10101 /// Required. A unique identifier for the hub.
10102 pub hub_id: std::string::String,
10103
10104 /// Required. The initial values for a new hub.
10105 pub hub: std::option::Option<crate::model::Hub>,
10106
10107 /// Optional. A request ID to identify requests. Specify a unique request ID so
10108 /// that if you must retry your request, the server knows to ignore the request
10109 /// if it has already been completed. The server guarantees that a request
10110 /// doesn't result in creation of duplicate commitments for at least 60
10111 /// minutes.
10112 ///
10113 /// For example, consider a situation where you make an initial request and
10114 /// the request times out. If you make the request again with the same request
10115 /// ID, the server can check to see whether the original operation
10116 /// was received. If it was, the server ignores the second request. This
10117 /// behavior prevents clients from mistakenly creating duplicate commitments.
10118 ///
10119 /// The request ID must be a valid UUID, with the exception that zero UUID is
10120 /// not supported (00000000-0000-0000-0000-000000000000).
10121 pub request_id: std::string::String,
10122
10123 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10124}
10125
10126impl CreateHubRequest {
10127 pub fn new() -> Self {
10128 std::default::Default::default()
10129 }
10130
10131 /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
10132 ///
10133 /// # Example
10134 /// ```ignore,no_run
10135 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10136 /// let x = CreateHubRequest::new().set_parent("example");
10137 /// ```
10138 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10139 self.parent = v.into();
10140 self
10141 }
10142
10143 /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
10144 ///
10145 /// # Example
10146 /// ```ignore,no_run
10147 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10148 /// let x = CreateHubRequest::new().set_hub_id("example");
10149 /// ```
10150 pub fn set_hub_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10151 self.hub_id = v.into();
10152 self
10153 }
10154
10155 /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
10156 ///
10157 /// # Example
10158 /// ```ignore,no_run
10159 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10160 /// use google_cloud_networkconnectivity_v1::model::Hub;
10161 /// let x = CreateHubRequest::new().set_hub(Hub::default()/* use setters */);
10162 /// ```
10163 pub fn set_hub<T>(mut self, v: T) -> Self
10164 where
10165 T: std::convert::Into<crate::model::Hub>,
10166 {
10167 self.hub = std::option::Option::Some(v.into());
10168 self
10169 }
10170
10171 /// Sets or clears the value of [hub][crate::model::CreateHubRequest::hub].
10172 ///
10173 /// # Example
10174 /// ```ignore,no_run
10175 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10176 /// use google_cloud_networkconnectivity_v1::model::Hub;
10177 /// let x = CreateHubRequest::new().set_or_clear_hub(Some(Hub::default()/* use setters */));
10178 /// let x = CreateHubRequest::new().set_or_clear_hub(None::<Hub>);
10179 /// ```
10180 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
10181 where
10182 T: std::convert::Into<crate::model::Hub>,
10183 {
10184 self.hub = v.map(|x| x.into());
10185 self
10186 }
10187
10188 /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
10189 ///
10190 /// # Example
10191 /// ```ignore,no_run
10192 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10193 /// let x = CreateHubRequest::new().set_request_id("example");
10194 /// ```
10195 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10196 self.request_id = v.into();
10197 self
10198 }
10199}
10200
10201impl wkt::message::Message for CreateHubRequest {
10202 fn typename() -> &'static str {
10203 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateHubRequest"
10204 }
10205}
10206
10207/// Request for
10208/// [HubService.UpdateHub][google.cloud.networkconnectivity.v1.HubService.UpdateHub]
10209/// method.
10210///
10211/// [google.cloud.networkconnectivity.v1.HubService.UpdateHub]: crate::client::HubService::update_hub
10212#[derive(Clone, Default, PartialEq)]
10213#[non_exhaustive]
10214pub struct UpdateHubRequest {
10215 /// Optional. In the case of an update to an existing hub, field mask is used
10216 /// to specify the fields to be overwritten. The fields specified in the
10217 /// update_mask are relative to the resource, not the full request. A field is
10218 /// overwritten if it is in the mask. If the user does not provide a mask, then
10219 /// all fields are overwritten.
10220 pub update_mask: std::option::Option<wkt::FieldMask>,
10221
10222 /// Required. The state that the hub should be in after the update.
10223 pub hub: std::option::Option<crate::model::Hub>,
10224
10225 /// Optional. A request ID to identify requests. Specify a unique request ID so
10226 /// that if you must retry your request, the server knows to ignore the request
10227 /// if it has already been completed. The server guarantees that a request
10228 /// doesn't result in creation of duplicate commitments for at least 60
10229 /// minutes.
10230 ///
10231 /// For example, consider a situation where you make an initial request and
10232 /// the request times out. If you make the request again with the same request
10233 /// ID, the server can check to see whether the original operation
10234 /// was received. If it was, the server ignores the second request. This
10235 /// behavior prevents clients from mistakenly creating duplicate commitments.
10236 ///
10237 /// The request ID must be a valid UUID, with the exception that zero UUID is
10238 /// not supported (00000000-0000-0000-0000-000000000000).
10239 pub request_id: std::string::String,
10240
10241 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10242}
10243
10244impl UpdateHubRequest {
10245 pub fn new() -> Self {
10246 std::default::Default::default()
10247 }
10248
10249 /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
10250 ///
10251 /// # Example
10252 /// ```ignore,no_run
10253 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10254 /// use wkt::FieldMask;
10255 /// let x = UpdateHubRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10256 /// ```
10257 pub fn set_update_mask<T>(mut self, v: T) -> Self
10258 where
10259 T: std::convert::Into<wkt::FieldMask>,
10260 {
10261 self.update_mask = std::option::Option::Some(v.into());
10262 self
10263 }
10264
10265 /// Sets or clears the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
10266 ///
10267 /// # Example
10268 /// ```ignore,no_run
10269 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10270 /// use wkt::FieldMask;
10271 /// let x = UpdateHubRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10272 /// let x = UpdateHubRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10273 /// ```
10274 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10275 where
10276 T: std::convert::Into<wkt::FieldMask>,
10277 {
10278 self.update_mask = v.map(|x| x.into());
10279 self
10280 }
10281
10282 /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
10283 ///
10284 /// # Example
10285 /// ```ignore,no_run
10286 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10287 /// use google_cloud_networkconnectivity_v1::model::Hub;
10288 /// let x = UpdateHubRequest::new().set_hub(Hub::default()/* use setters */);
10289 /// ```
10290 pub fn set_hub<T>(mut self, v: T) -> Self
10291 where
10292 T: std::convert::Into<crate::model::Hub>,
10293 {
10294 self.hub = std::option::Option::Some(v.into());
10295 self
10296 }
10297
10298 /// Sets or clears the value of [hub][crate::model::UpdateHubRequest::hub].
10299 ///
10300 /// # Example
10301 /// ```ignore,no_run
10302 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10303 /// use google_cloud_networkconnectivity_v1::model::Hub;
10304 /// let x = UpdateHubRequest::new().set_or_clear_hub(Some(Hub::default()/* use setters */));
10305 /// let x = UpdateHubRequest::new().set_or_clear_hub(None::<Hub>);
10306 /// ```
10307 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
10308 where
10309 T: std::convert::Into<crate::model::Hub>,
10310 {
10311 self.hub = v.map(|x| x.into());
10312 self
10313 }
10314
10315 /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
10316 ///
10317 /// # Example
10318 /// ```ignore,no_run
10319 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10320 /// let x = UpdateHubRequest::new().set_request_id("example");
10321 /// ```
10322 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10323 self.request_id = v.into();
10324 self
10325 }
10326}
10327
10328impl wkt::message::Message for UpdateHubRequest {
10329 fn typename() -> &'static str {
10330 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateHubRequest"
10331 }
10332}
10333
10334/// The request for
10335/// [HubService.DeleteHub][google.cloud.networkconnectivity.v1.HubService.DeleteHub].
10336///
10337/// [google.cloud.networkconnectivity.v1.HubService.DeleteHub]: crate::client::HubService::delete_hub
10338#[derive(Clone, Default, PartialEq)]
10339#[non_exhaustive]
10340pub struct DeleteHubRequest {
10341 /// Required. The name of the hub to delete.
10342 pub name: std::string::String,
10343
10344 /// Optional. A request ID to identify requests. Specify a unique request ID so
10345 /// that if you must retry your request, the server knows to ignore the request
10346 /// if it has already been completed. The server guarantees that a request
10347 /// doesn't result in creation of duplicate commitments for at least 60
10348 /// minutes.
10349 ///
10350 /// For example, consider a situation where you make an initial request and
10351 /// the request times out. If you make the request again with the same request
10352 /// ID, the server can check to see whether the original operation
10353 /// was received. If it was, the server ignores the second request. This
10354 /// behavior prevents clients from mistakenly creating duplicate commitments.
10355 ///
10356 /// The request ID must be a valid UUID, with the exception that zero UUID is
10357 /// not supported (00000000-0000-0000-0000-000000000000).
10358 pub request_id: std::string::String,
10359
10360 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10361}
10362
10363impl DeleteHubRequest {
10364 pub fn new() -> Self {
10365 std::default::Default::default()
10366 }
10367
10368 /// Sets the value of [name][crate::model::DeleteHubRequest::name].
10369 ///
10370 /// # Example
10371 /// ```ignore,no_run
10372 /// # use google_cloud_networkconnectivity_v1::model::DeleteHubRequest;
10373 /// let x = DeleteHubRequest::new().set_name("example");
10374 /// ```
10375 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10376 self.name = v.into();
10377 self
10378 }
10379
10380 /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
10381 ///
10382 /// # Example
10383 /// ```ignore,no_run
10384 /// # use google_cloud_networkconnectivity_v1::model::DeleteHubRequest;
10385 /// let x = DeleteHubRequest::new().set_request_id("example");
10386 /// ```
10387 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10388 self.request_id = v.into();
10389 self
10390 }
10391}
10392
10393impl wkt::message::Message for DeleteHubRequest {
10394 fn typename() -> &'static str {
10395 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteHubRequest"
10396 }
10397}
10398
10399/// The request for
10400/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
10401///
10402/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
10403#[derive(Clone, Default, PartialEq)]
10404#[non_exhaustive]
10405pub struct ListHubSpokesRequest {
10406 /// Required. The name of the hub.
10407 pub name: std::string::String,
10408
10409 /// A list of locations.
10410 /// Specify one of the following: `[global]`, a single region (for
10411 /// example, `[us-central1]`), or a combination of
10412 /// values (for example, `[global, us-central1, us-west1]`).
10413 /// If the spoke_locations field is populated, the list of results
10414 /// includes only spokes in the specified location.
10415 /// If the spoke_locations field is not populated, the list of results
10416 /// includes spokes in all locations.
10417 pub spoke_locations: std::vec::Vec<std::string::String>,
10418
10419 /// The maximum number of results to return per page.
10420 pub page_size: i32,
10421
10422 /// The page token.
10423 pub page_token: std::string::String,
10424
10425 /// An expression that filters the list of results.
10426 pub filter: std::string::String,
10427
10428 /// Sort the results by name or create_time.
10429 pub order_by: std::string::String,
10430
10431 /// The view of the spoke to return.
10432 /// The view that you use determines which spoke fields are included in the
10433 /// response.
10434 pub view: crate::model::list_hub_spokes_request::SpokeView,
10435
10436 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10437}
10438
10439impl ListHubSpokesRequest {
10440 pub fn new() -> Self {
10441 std::default::Default::default()
10442 }
10443
10444 /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
10445 ///
10446 /// # Example
10447 /// ```ignore,no_run
10448 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10449 /// let x = ListHubSpokesRequest::new().set_name("example");
10450 /// ```
10451 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10452 self.name = v.into();
10453 self
10454 }
10455
10456 /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
10457 ///
10458 /// # Example
10459 /// ```ignore,no_run
10460 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10461 /// let x = ListHubSpokesRequest::new().set_spoke_locations(["a", "b", "c"]);
10462 /// ```
10463 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
10464 where
10465 T: std::iter::IntoIterator<Item = V>,
10466 V: std::convert::Into<std::string::String>,
10467 {
10468 use std::iter::Iterator;
10469 self.spoke_locations = v.into_iter().map(|i| i.into()).collect();
10470 self
10471 }
10472
10473 /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
10474 ///
10475 /// # Example
10476 /// ```ignore,no_run
10477 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10478 /// let x = ListHubSpokesRequest::new().set_page_size(42);
10479 /// ```
10480 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10481 self.page_size = v.into();
10482 self
10483 }
10484
10485 /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
10486 ///
10487 /// # Example
10488 /// ```ignore,no_run
10489 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10490 /// let x = ListHubSpokesRequest::new().set_page_token("example");
10491 /// ```
10492 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10493 self.page_token = v.into();
10494 self
10495 }
10496
10497 /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
10498 ///
10499 /// # Example
10500 /// ```ignore,no_run
10501 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10502 /// let x = ListHubSpokesRequest::new().set_filter("example");
10503 /// ```
10504 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10505 self.filter = v.into();
10506 self
10507 }
10508
10509 /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
10510 ///
10511 /// # Example
10512 /// ```ignore,no_run
10513 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10514 /// let x = ListHubSpokesRequest::new().set_order_by("example");
10515 /// ```
10516 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10517 self.order_by = v.into();
10518 self
10519 }
10520
10521 /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
10522 ///
10523 /// # Example
10524 /// ```ignore,no_run
10525 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10526 /// use google_cloud_networkconnectivity_v1::model::list_hub_spokes_request::SpokeView;
10527 /// let x0 = ListHubSpokesRequest::new().set_view(SpokeView::Basic);
10528 /// let x1 = ListHubSpokesRequest::new().set_view(SpokeView::Detailed);
10529 /// ```
10530 pub fn set_view<T: std::convert::Into<crate::model::list_hub_spokes_request::SpokeView>>(
10531 mut self,
10532 v: T,
10533 ) -> Self {
10534 self.view = v.into();
10535 self
10536 }
10537}
10538
10539impl wkt::message::Message for ListHubSpokesRequest {
10540 fn typename() -> &'static str {
10541 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"
10542 }
10543}
10544
10545/// Defines additional types related to [ListHubSpokesRequest].
10546pub mod list_hub_spokes_request {
10547 #[allow(unused_imports)]
10548 use super::*;
10549
10550 /// Enum that controls which spoke fields are included in the response.
10551 ///
10552 /// # Working with unknown values
10553 ///
10554 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10555 /// additional enum variants at any time. Adding new variants is not considered
10556 /// a breaking change. Applications should write their code in anticipation of:
10557 ///
10558 /// - New values appearing in future releases of the client library, **and**
10559 /// - New values received dynamically, without application changes.
10560 ///
10561 /// Please consult the [Working with enums] section in the user guide for some
10562 /// guidelines.
10563 ///
10564 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10565 #[derive(Clone, Debug, PartialEq)]
10566 #[non_exhaustive]
10567 pub enum SpokeView {
10568 /// The spoke view is unspecified. When the spoke view is unspecified, the
10569 /// API returns the same fields as the `BASIC` view.
10570 Unspecified,
10571 /// Includes `name`, `create_time`, `hub`, `unique_id`, `state`, `reasons`,
10572 /// and `spoke_type`. This is the default value.
10573 Basic,
10574 /// Includes all spoke fields except `labels`.
10575 /// You can use the `DETAILED` view only when you set the `spoke_locations`
10576 /// field to `[global]`.
10577 Detailed,
10578 /// If set, the enum was initialized with an unknown value.
10579 ///
10580 /// Applications can examine the value using [SpokeView::value] or
10581 /// [SpokeView::name].
10582 UnknownValue(spoke_view::UnknownValue),
10583 }
10584
10585 #[doc(hidden)]
10586 pub mod spoke_view {
10587 #[allow(unused_imports)]
10588 use super::*;
10589 #[derive(Clone, Debug, PartialEq)]
10590 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10591 }
10592
10593 impl SpokeView {
10594 /// Gets the enum value.
10595 ///
10596 /// Returns `None` if the enum contains an unknown value deserialized from
10597 /// the string representation of enums.
10598 pub fn value(&self) -> std::option::Option<i32> {
10599 match self {
10600 Self::Unspecified => std::option::Option::Some(0),
10601 Self::Basic => std::option::Option::Some(1),
10602 Self::Detailed => std::option::Option::Some(2),
10603 Self::UnknownValue(u) => u.0.value(),
10604 }
10605 }
10606
10607 /// Gets the enum value as a string.
10608 ///
10609 /// Returns `None` if the enum contains an unknown value deserialized from
10610 /// the integer representation of enums.
10611 pub fn name(&self) -> std::option::Option<&str> {
10612 match self {
10613 Self::Unspecified => std::option::Option::Some("SPOKE_VIEW_UNSPECIFIED"),
10614 Self::Basic => std::option::Option::Some("BASIC"),
10615 Self::Detailed => std::option::Option::Some("DETAILED"),
10616 Self::UnknownValue(u) => u.0.name(),
10617 }
10618 }
10619 }
10620
10621 impl std::default::Default for SpokeView {
10622 fn default() -> Self {
10623 use std::convert::From;
10624 Self::from(0)
10625 }
10626 }
10627
10628 impl std::fmt::Display for SpokeView {
10629 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10630 wkt::internal::display_enum(f, self.name(), self.value())
10631 }
10632 }
10633
10634 impl std::convert::From<i32> for SpokeView {
10635 fn from(value: i32) -> Self {
10636 match value {
10637 0 => Self::Unspecified,
10638 1 => Self::Basic,
10639 2 => Self::Detailed,
10640 _ => Self::UnknownValue(spoke_view::UnknownValue(
10641 wkt::internal::UnknownEnumValue::Integer(value),
10642 )),
10643 }
10644 }
10645 }
10646
10647 impl std::convert::From<&str> for SpokeView {
10648 fn from(value: &str) -> Self {
10649 use std::string::ToString;
10650 match value {
10651 "SPOKE_VIEW_UNSPECIFIED" => Self::Unspecified,
10652 "BASIC" => Self::Basic,
10653 "DETAILED" => Self::Detailed,
10654 _ => Self::UnknownValue(spoke_view::UnknownValue(
10655 wkt::internal::UnknownEnumValue::String(value.to_string()),
10656 )),
10657 }
10658 }
10659 }
10660
10661 impl serde::ser::Serialize for SpokeView {
10662 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10663 where
10664 S: serde::Serializer,
10665 {
10666 match self {
10667 Self::Unspecified => serializer.serialize_i32(0),
10668 Self::Basic => serializer.serialize_i32(1),
10669 Self::Detailed => serializer.serialize_i32(2),
10670 Self::UnknownValue(u) => u.0.serialize(serializer),
10671 }
10672 }
10673 }
10674
10675 impl<'de> serde::de::Deserialize<'de> for SpokeView {
10676 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10677 where
10678 D: serde::Deserializer<'de>,
10679 {
10680 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeView>::new(
10681 ".google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView",
10682 ))
10683 }
10684 }
10685}
10686
10687/// The response for
10688/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
10689///
10690/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
10691#[derive(Clone, Default, PartialEq)]
10692#[non_exhaustive]
10693pub struct ListHubSpokesResponse {
10694 /// The requested spokes.
10695 /// The spoke fields can be partially populated based on the `view` field in
10696 /// the request message.
10697 pub spokes: std::vec::Vec<crate::model::Spoke>,
10698
10699 /// The token for the next page of the response. To see more results,
10700 /// use this value as the page_token for your next request. If this value
10701 /// is empty, there are no more results.
10702 pub next_page_token: std::string::String,
10703
10704 /// Locations that could not be reached.
10705 pub unreachable: std::vec::Vec<std::string::String>,
10706
10707 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10708}
10709
10710impl ListHubSpokesResponse {
10711 pub fn new() -> Self {
10712 std::default::Default::default()
10713 }
10714
10715 /// Sets the value of [spokes][crate::model::ListHubSpokesResponse::spokes].
10716 ///
10717 /// # Example
10718 /// ```ignore,no_run
10719 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10720 /// use google_cloud_networkconnectivity_v1::model::Spoke;
10721 /// let x = ListHubSpokesResponse::new()
10722 /// .set_spokes([
10723 /// Spoke::default()/* use setters */,
10724 /// Spoke::default()/* use (different) setters */,
10725 /// ]);
10726 /// ```
10727 pub fn set_spokes<T, V>(mut self, v: T) -> Self
10728 where
10729 T: std::iter::IntoIterator<Item = V>,
10730 V: std::convert::Into<crate::model::Spoke>,
10731 {
10732 use std::iter::Iterator;
10733 self.spokes = v.into_iter().map(|i| i.into()).collect();
10734 self
10735 }
10736
10737 /// Sets the value of [next_page_token][crate::model::ListHubSpokesResponse::next_page_token].
10738 ///
10739 /// # Example
10740 /// ```ignore,no_run
10741 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10742 /// let x = ListHubSpokesResponse::new().set_next_page_token("example");
10743 /// ```
10744 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10745 self.next_page_token = v.into();
10746 self
10747 }
10748
10749 /// Sets the value of [unreachable][crate::model::ListHubSpokesResponse::unreachable].
10750 ///
10751 /// # Example
10752 /// ```ignore,no_run
10753 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10754 /// let x = ListHubSpokesResponse::new().set_unreachable(["a", "b", "c"]);
10755 /// ```
10756 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10757 where
10758 T: std::iter::IntoIterator<Item = V>,
10759 V: std::convert::Into<std::string::String>,
10760 {
10761 use std::iter::Iterator;
10762 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10763 self
10764 }
10765}
10766
10767impl wkt::message::Message for ListHubSpokesResponse {
10768 fn typename() -> &'static str {
10769 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"
10770 }
10771}
10772
10773#[doc(hidden)]
10774impl google_cloud_gax::paginator::internal::PageableResponse for ListHubSpokesResponse {
10775 type PageItem = crate::model::Spoke;
10776
10777 fn items(self) -> std::vec::Vec<Self::PageItem> {
10778 self.spokes
10779 }
10780
10781 fn next_page_token(&self) -> std::string::String {
10782 use std::clone::Clone;
10783 self.next_page_token.clone()
10784 }
10785}
10786
10787/// The request for
10788/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
10789///
10790/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
10791#[derive(Clone, Default, PartialEq)]
10792#[non_exhaustive]
10793pub struct QueryHubStatusRequest {
10794 /// Required. The name of the hub.
10795 pub name: std::string::String,
10796
10797 /// Optional. The maximum number of results to return per page.
10798 pub page_size: i32,
10799
10800 /// Optional. The page token.
10801 pub page_token: std::string::String,
10802
10803 /// Optional. An expression that filters the list of results.
10804 /// The filter can be used to filter the results by the following fields:
10805 ///
10806 /// * `psc_propagation_status.source_spoke`
10807 /// * `psc_propagation_status.source_group`
10808 /// * `psc_propagation_status.source_forwarding_rule`
10809 /// * `psc_propagation_status.target_spoke`
10810 /// * `psc_propagation_status.target_group`
10811 /// * `psc_propagation_status.code`
10812 /// * `psc_propagation_status.message`
10813 pub filter: std::string::String,
10814
10815 /// Optional. Sort the results in ascending order by the specified fields.
10816 /// A comma-separated list of any of these fields:
10817 ///
10818 /// * `psc_propagation_status.source_spoke`
10819 /// * `psc_propagation_status.source_group`
10820 /// * `psc_propagation_status.source_forwarding_rule`
10821 /// * `psc_propagation_status.target_spoke`
10822 /// * `psc_propagation_status.target_group`
10823 /// * `psc_propagation_status.code`
10824 /// If `group_by` is set, the value of the `order_by` field must be the
10825 /// same as or a subset of the `group_by` field.
10826 pub order_by: std::string::String,
10827
10828 /// Optional. Aggregate the results by the specified fields.
10829 /// A comma-separated list of any of these fields:
10830 ///
10831 /// * `psc_propagation_status.source_spoke`
10832 /// * `psc_propagation_status.source_group`
10833 /// * `psc_propagation_status.source_forwarding_rule`
10834 /// * `psc_propagation_status.target_spoke`
10835 /// * `psc_propagation_status.target_group`
10836 /// * `psc_propagation_status.code`
10837 pub group_by: std::string::String,
10838
10839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10840}
10841
10842impl QueryHubStatusRequest {
10843 pub fn new() -> Self {
10844 std::default::Default::default()
10845 }
10846
10847 /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
10848 ///
10849 /// # Example
10850 /// ```ignore,no_run
10851 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10852 /// let x = QueryHubStatusRequest::new().set_name("example");
10853 /// ```
10854 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10855 self.name = v.into();
10856 self
10857 }
10858
10859 /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
10860 ///
10861 /// # Example
10862 /// ```ignore,no_run
10863 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10864 /// let x = QueryHubStatusRequest::new().set_page_size(42);
10865 /// ```
10866 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10867 self.page_size = v.into();
10868 self
10869 }
10870
10871 /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
10872 ///
10873 /// # Example
10874 /// ```ignore,no_run
10875 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10876 /// let x = QueryHubStatusRequest::new().set_page_token("example");
10877 /// ```
10878 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10879 self.page_token = v.into();
10880 self
10881 }
10882
10883 /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
10884 ///
10885 /// # Example
10886 /// ```ignore,no_run
10887 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10888 /// let x = QueryHubStatusRequest::new().set_filter("example");
10889 /// ```
10890 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10891 self.filter = v.into();
10892 self
10893 }
10894
10895 /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
10896 ///
10897 /// # Example
10898 /// ```ignore,no_run
10899 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10900 /// let x = QueryHubStatusRequest::new().set_order_by("example");
10901 /// ```
10902 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10903 self.order_by = v.into();
10904 self
10905 }
10906
10907 /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
10908 ///
10909 /// # Example
10910 /// ```ignore,no_run
10911 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10912 /// let x = QueryHubStatusRequest::new().set_group_by("example");
10913 /// ```
10914 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10915 self.group_by = v.into();
10916 self
10917 }
10918}
10919
10920impl wkt::message::Message for QueryHubStatusRequest {
10921 fn typename() -> &'static str {
10922 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusRequest"
10923 }
10924}
10925
10926/// The response for
10927/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
10928///
10929/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
10930#[derive(Clone, Default, PartialEq)]
10931#[non_exhaustive]
10932pub struct QueryHubStatusResponse {
10933 /// The list of hub status.
10934 pub hub_status_entries: std::vec::Vec<crate::model::HubStatusEntry>,
10935
10936 /// The token for the next page of the response. To see more results,
10937 /// use this value as the page_token for your next request. If this value
10938 /// is empty, there are no more results.
10939 pub next_page_token: std::string::String,
10940
10941 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10942}
10943
10944impl QueryHubStatusResponse {
10945 pub fn new() -> Self {
10946 std::default::Default::default()
10947 }
10948
10949 /// Sets the value of [hub_status_entries][crate::model::QueryHubStatusResponse::hub_status_entries].
10950 ///
10951 /// # Example
10952 /// ```ignore,no_run
10953 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusResponse;
10954 /// use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
10955 /// let x = QueryHubStatusResponse::new()
10956 /// .set_hub_status_entries([
10957 /// HubStatusEntry::default()/* use setters */,
10958 /// HubStatusEntry::default()/* use (different) setters */,
10959 /// ]);
10960 /// ```
10961 pub fn set_hub_status_entries<T, V>(mut self, v: T) -> Self
10962 where
10963 T: std::iter::IntoIterator<Item = V>,
10964 V: std::convert::Into<crate::model::HubStatusEntry>,
10965 {
10966 use std::iter::Iterator;
10967 self.hub_status_entries = v.into_iter().map(|i| i.into()).collect();
10968 self
10969 }
10970
10971 /// Sets the value of [next_page_token][crate::model::QueryHubStatusResponse::next_page_token].
10972 ///
10973 /// # Example
10974 /// ```ignore,no_run
10975 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusResponse;
10976 /// let x = QueryHubStatusResponse::new().set_next_page_token("example");
10977 /// ```
10978 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10979 self.next_page_token = v.into();
10980 self
10981 }
10982}
10983
10984impl wkt::message::Message for QueryHubStatusResponse {
10985 fn typename() -> &'static str {
10986 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusResponse"
10987 }
10988}
10989
10990#[doc(hidden)]
10991impl google_cloud_gax::paginator::internal::PageableResponse for QueryHubStatusResponse {
10992 type PageItem = crate::model::HubStatusEntry;
10993
10994 fn items(self) -> std::vec::Vec<Self::PageItem> {
10995 self.hub_status_entries
10996 }
10997
10998 fn next_page_token(&self) -> std::string::String {
10999 use std::clone::Clone;
11000 self.next_page_token.clone()
11001 }
11002}
11003
11004/// A hub status entry represents the status of a set of propagated Private
11005/// Service Connect connections grouped by certain fields.
11006#[derive(Clone, Default, PartialEq)]
11007#[non_exhaustive]
11008pub struct HubStatusEntry {
11009 /// The number of propagated Private Service Connect connections with this
11010 /// status. If the `group_by` field was not set in the request message, the
11011 /// value of this field is 1.
11012 pub count: i32,
11013
11014 /// The fields that this entry is grouped by. This has the same value as the
11015 /// `group_by` field in the request message.
11016 pub group_by: std::string::String,
11017
11018 /// The Private Service Connect propagation status.
11019 pub psc_propagation_status: std::option::Option<crate::model::PscPropagationStatus>,
11020
11021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11022}
11023
11024impl HubStatusEntry {
11025 pub fn new() -> Self {
11026 std::default::Default::default()
11027 }
11028
11029 /// Sets the value of [count][crate::model::HubStatusEntry::count].
11030 ///
11031 /// # Example
11032 /// ```ignore,no_run
11033 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11034 /// let x = HubStatusEntry::new().set_count(42);
11035 /// ```
11036 pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11037 self.count = v.into();
11038 self
11039 }
11040
11041 /// Sets the value of [group_by][crate::model::HubStatusEntry::group_by].
11042 ///
11043 /// # Example
11044 /// ```ignore,no_run
11045 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11046 /// let x = HubStatusEntry::new().set_group_by("example");
11047 /// ```
11048 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11049 self.group_by = v.into();
11050 self
11051 }
11052
11053 /// Sets the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
11054 ///
11055 /// # Example
11056 /// ```ignore,no_run
11057 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11058 /// use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11059 /// let x = HubStatusEntry::new().set_psc_propagation_status(PscPropagationStatus::default()/* use setters */);
11060 /// ```
11061 pub fn set_psc_propagation_status<T>(mut self, v: T) -> Self
11062 where
11063 T: std::convert::Into<crate::model::PscPropagationStatus>,
11064 {
11065 self.psc_propagation_status = std::option::Option::Some(v.into());
11066 self
11067 }
11068
11069 /// Sets or clears the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
11070 ///
11071 /// # Example
11072 /// ```ignore,no_run
11073 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11074 /// use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11075 /// let x = HubStatusEntry::new().set_or_clear_psc_propagation_status(Some(PscPropagationStatus::default()/* use setters */));
11076 /// let x = HubStatusEntry::new().set_or_clear_psc_propagation_status(None::<PscPropagationStatus>);
11077 /// ```
11078 pub fn set_or_clear_psc_propagation_status<T>(mut self, v: std::option::Option<T>) -> Self
11079 where
11080 T: std::convert::Into<crate::model::PscPropagationStatus>,
11081 {
11082 self.psc_propagation_status = v.map(|x| x.into());
11083 self
11084 }
11085}
11086
11087impl wkt::message::Message for HubStatusEntry {
11088 fn typename() -> &'static str {
11089 "type.googleapis.com/google.cloud.networkconnectivity.v1.HubStatusEntry"
11090 }
11091}
11092
11093/// The status of one or more propagated Private Service Connect connections in a
11094/// hub.
11095#[derive(Clone, Default, PartialEq)]
11096#[non_exhaustive]
11097pub struct PscPropagationStatus {
11098 /// The name of the spoke that the source forwarding rule belongs to.
11099 pub source_spoke: std::string::String,
11100
11101 /// The name of the group that the source spoke belongs to.
11102 pub source_group: std::string::String,
11103
11104 /// The name of the forwarding rule exported to the hub.
11105 pub source_forwarding_rule: std::string::String,
11106
11107 /// The name of the spoke that the source forwarding rule propagates to.
11108 pub target_spoke: std::string::String,
11109
11110 /// The name of the group that the target spoke belongs to.
11111 pub target_group: std::string::String,
11112
11113 /// The propagation status.
11114 pub code: crate::model::psc_propagation_status::Code,
11115
11116 /// The human-readable summary of the Private Service Connect connection
11117 /// propagation status.
11118 pub message: std::string::String,
11119
11120 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11121}
11122
11123impl PscPropagationStatus {
11124 pub fn new() -> Self {
11125 std::default::Default::default()
11126 }
11127
11128 /// Sets the value of [source_spoke][crate::model::PscPropagationStatus::source_spoke].
11129 ///
11130 /// # Example
11131 /// ```ignore,no_run
11132 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11133 /// let x = PscPropagationStatus::new().set_source_spoke("example");
11134 /// ```
11135 pub fn set_source_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11136 self.source_spoke = v.into();
11137 self
11138 }
11139
11140 /// Sets the value of [source_group][crate::model::PscPropagationStatus::source_group].
11141 ///
11142 /// # Example
11143 /// ```ignore,no_run
11144 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11145 /// let x = PscPropagationStatus::new().set_source_group("example");
11146 /// ```
11147 pub fn set_source_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11148 self.source_group = v.into();
11149 self
11150 }
11151
11152 /// Sets the value of [source_forwarding_rule][crate::model::PscPropagationStatus::source_forwarding_rule].
11153 ///
11154 /// # Example
11155 /// ```ignore,no_run
11156 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11157 /// let x = PscPropagationStatus::new().set_source_forwarding_rule("example");
11158 /// ```
11159 pub fn set_source_forwarding_rule<T: std::convert::Into<std::string::String>>(
11160 mut self,
11161 v: T,
11162 ) -> Self {
11163 self.source_forwarding_rule = v.into();
11164 self
11165 }
11166
11167 /// Sets the value of [target_spoke][crate::model::PscPropagationStatus::target_spoke].
11168 ///
11169 /// # Example
11170 /// ```ignore,no_run
11171 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11172 /// let x = PscPropagationStatus::new().set_target_spoke("example");
11173 /// ```
11174 pub fn set_target_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11175 self.target_spoke = v.into();
11176 self
11177 }
11178
11179 /// Sets the value of [target_group][crate::model::PscPropagationStatus::target_group].
11180 ///
11181 /// # Example
11182 /// ```ignore,no_run
11183 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11184 /// let x = PscPropagationStatus::new().set_target_group("example");
11185 /// ```
11186 pub fn set_target_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11187 self.target_group = v.into();
11188 self
11189 }
11190
11191 /// Sets the value of [code][crate::model::PscPropagationStatus::code].
11192 ///
11193 /// # Example
11194 /// ```ignore,no_run
11195 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11196 /// use google_cloud_networkconnectivity_v1::model::psc_propagation_status::Code;
11197 /// let x0 = PscPropagationStatus::new().set_code(Code::Ready);
11198 /// let x1 = PscPropagationStatus::new().set_code(Code::Propagating);
11199 /// let x2 = PscPropagationStatus::new().set_code(Code::ErrorProducerPropagatedConnectionLimitExceeded);
11200 /// ```
11201 pub fn set_code<T: std::convert::Into<crate::model::psc_propagation_status::Code>>(
11202 mut self,
11203 v: T,
11204 ) -> Self {
11205 self.code = v.into();
11206 self
11207 }
11208
11209 /// Sets the value of [message][crate::model::PscPropagationStatus::message].
11210 ///
11211 /// # Example
11212 /// ```ignore,no_run
11213 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11214 /// let x = PscPropagationStatus::new().set_message("example");
11215 /// ```
11216 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11217 self.message = v.into();
11218 self
11219 }
11220}
11221
11222impl wkt::message::Message for PscPropagationStatus {
11223 fn typename() -> &'static str {
11224 "type.googleapis.com/google.cloud.networkconnectivity.v1.PscPropagationStatus"
11225 }
11226}
11227
11228/// Defines additional types related to [PscPropagationStatus].
11229pub mod psc_propagation_status {
11230 #[allow(unused_imports)]
11231 use super::*;
11232
11233 /// The Code enum represents the state of the Private Service Connect
11234 /// propagation.
11235 ///
11236 /// # Working with unknown values
11237 ///
11238 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11239 /// additional enum variants at any time. Adding new variants is not considered
11240 /// a breaking change. Applications should write their code in anticipation of:
11241 ///
11242 /// - New values appearing in future releases of the client library, **and**
11243 /// - New values received dynamically, without application changes.
11244 ///
11245 /// Please consult the [Working with enums] section in the user guide for some
11246 /// guidelines.
11247 ///
11248 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11249 #[derive(Clone, Debug, PartialEq)]
11250 #[non_exhaustive]
11251 pub enum Code {
11252 /// The code is unspecified.
11253 Unspecified,
11254 /// The propagated Private Service Connect connection is ready.
11255 Ready,
11256 /// The Private Service Connect connection is propagating. This is a
11257 /// transient state.
11258 Propagating,
11259 /// The Private Service Connect connection propagation failed because the VPC
11260 /// network or the project of the target spoke has exceeded the connection
11261 /// limit set by the producer.
11262 ErrorProducerPropagatedConnectionLimitExceeded,
11263 /// The Private Service Connect connection propagation failed because the NAT
11264 /// IP subnet space has been exhausted. It is equivalent to the `Needs
11265 /// attention` status of the Private Service Connect connection. See
11266 /// <https://cloud.google.com/vpc/docs/about-accessing-vpc-hosted-services-endpoints#connection-statuses>.
11267 ErrorProducerNatIpSpaceExhausted,
11268 /// The Private Service Connect connection propagation failed because the
11269 /// `PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK` quota in the
11270 /// producer VPC network has been exceeded.
11271 ErrorProducerQuotaExceeded,
11272 /// The Private Service Connect connection propagation failed because the
11273 /// `PSC_PROPAGATED_CONNECTIONS_PER_VPC_NETWORK` quota in the consumer
11274 /// VPC network has been exceeded.
11275 ErrorConsumerQuotaExceeded,
11276 /// If set, the enum was initialized with an unknown value.
11277 ///
11278 /// Applications can examine the value using [Code::value] or
11279 /// [Code::name].
11280 UnknownValue(code::UnknownValue),
11281 }
11282
11283 #[doc(hidden)]
11284 pub mod code {
11285 #[allow(unused_imports)]
11286 use super::*;
11287 #[derive(Clone, Debug, PartialEq)]
11288 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11289 }
11290
11291 impl Code {
11292 /// Gets the enum value.
11293 ///
11294 /// Returns `None` if the enum contains an unknown value deserialized from
11295 /// the string representation of enums.
11296 pub fn value(&self) -> std::option::Option<i32> {
11297 match self {
11298 Self::Unspecified => std::option::Option::Some(0),
11299 Self::Ready => std::option::Option::Some(1),
11300 Self::Propagating => std::option::Option::Some(2),
11301 Self::ErrorProducerPropagatedConnectionLimitExceeded => {
11302 std::option::Option::Some(3)
11303 }
11304 Self::ErrorProducerNatIpSpaceExhausted => std::option::Option::Some(4),
11305 Self::ErrorProducerQuotaExceeded => std::option::Option::Some(5),
11306 Self::ErrorConsumerQuotaExceeded => std::option::Option::Some(6),
11307 Self::UnknownValue(u) => u.0.value(),
11308 }
11309 }
11310
11311 /// Gets the enum value as a string.
11312 ///
11313 /// Returns `None` if the enum contains an unknown value deserialized from
11314 /// the integer representation of enums.
11315 pub fn name(&self) -> std::option::Option<&str> {
11316 match self {
11317 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
11318 Self::Ready => std::option::Option::Some("READY"),
11319 Self::Propagating => std::option::Option::Some("PROPAGATING"),
11320 Self::ErrorProducerPropagatedConnectionLimitExceeded => {
11321 std::option::Option::Some("ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED")
11322 }
11323 Self::ErrorProducerNatIpSpaceExhausted => {
11324 std::option::Option::Some("ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED")
11325 }
11326 Self::ErrorProducerQuotaExceeded => {
11327 std::option::Option::Some("ERROR_PRODUCER_QUOTA_EXCEEDED")
11328 }
11329 Self::ErrorConsumerQuotaExceeded => {
11330 std::option::Option::Some("ERROR_CONSUMER_QUOTA_EXCEEDED")
11331 }
11332 Self::UnknownValue(u) => u.0.name(),
11333 }
11334 }
11335 }
11336
11337 impl std::default::Default for Code {
11338 fn default() -> Self {
11339 use std::convert::From;
11340 Self::from(0)
11341 }
11342 }
11343
11344 impl std::fmt::Display for Code {
11345 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11346 wkt::internal::display_enum(f, self.name(), self.value())
11347 }
11348 }
11349
11350 impl std::convert::From<i32> for Code {
11351 fn from(value: i32) -> Self {
11352 match value {
11353 0 => Self::Unspecified,
11354 1 => Self::Ready,
11355 2 => Self::Propagating,
11356 3 => Self::ErrorProducerPropagatedConnectionLimitExceeded,
11357 4 => Self::ErrorProducerNatIpSpaceExhausted,
11358 5 => Self::ErrorProducerQuotaExceeded,
11359 6 => Self::ErrorConsumerQuotaExceeded,
11360 _ => Self::UnknownValue(code::UnknownValue(
11361 wkt::internal::UnknownEnumValue::Integer(value),
11362 )),
11363 }
11364 }
11365 }
11366
11367 impl std::convert::From<&str> for Code {
11368 fn from(value: &str) -> Self {
11369 use std::string::ToString;
11370 match value {
11371 "CODE_UNSPECIFIED" => Self::Unspecified,
11372 "READY" => Self::Ready,
11373 "PROPAGATING" => Self::Propagating,
11374 "ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED" => {
11375 Self::ErrorProducerPropagatedConnectionLimitExceeded
11376 }
11377 "ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED" => Self::ErrorProducerNatIpSpaceExhausted,
11378 "ERROR_PRODUCER_QUOTA_EXCEEDED" => Self::ErrorProducerQuotaExceeded,
11379 "ERROR_CONSUMER_QUOTA_EXCEEDED" => Self::ErrorConsumerQuotaExceeded,
11380 _ => Self::UnknownValue(code::UnknownValue(
11381 wkt::internal::UnknownEnumValue::String(value.to_string()),
11382 )),
11383 }
11384 }
11385 }
11386
11387 impl serde::ser::Serialize for Code {
11388 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11389 where
11390 S: serde::Serializer,
11391 {
11392 match self {
11393 Self::Unspecified => serializer.serialize_i32(0),
11394 Self::Ready => serializer.serialize_i32(1),
11395 Self::Propagating => serializer.serialize_i32(2),
11396 Self::ErrorProducerPropagatedConnectionLimitExceeded => serializer.serialize_i32(3),
11397 Self::ErrorProducerNatIpSpaceExhausted => serializer.serialize_i32(4),
11398 Self::ErrorProducerQuotaExceeded => serializer.serialize_i32(5),
11399 Self::ErrorConsumerQuotaExceeded => serializer.serialize_i32(6),
11400 Self::UnknownValue(u) => u.0.serialize(serializer),
11401 }
11402 }
11403 }
11404
11405 impl<'de> serde::de::Deserialize<'de> for Code {
11406 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11407 where
11408 D: serde::Deserializer<'de>,
11409 {
11410 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
11411 ".google.cloud.networkconnectivity.v1.PscPropagationStatus.Code",
11412 ))
11413 }
11414 }
11415}
11416
11417/// The request for
11418/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
11419///
11420/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
11421#[derive(Clone, Default, PartialEq)]
11422#[non_exhaustive]
11423pub struct ListSpokesRequest {
11424 /// Required. The parent resource.
11425 pub parent: std::string::String,
11426
11427 /// The maximum number of results to return per page.
11428 pub page_size: i32,
11429
11430 /// The page token.
11431 pub page_token: std::string::String,
11432
11433 /// An expression that filters the list of results.
11434 pub filter: std::string::String,
11435
11436 /// Sort the results by a certain order.
11437 pub order_by: std::string::String,
11438
11439 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11440}
11441
11442impl ListSpokesRequest {
11443 pub fn new() -> Self {
11444 std::default::Default::default()
11445 }
11446
11447 /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
11448 ///
11449 /// # Example
11450 /// ```ignore,no_run
11451 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11452 /// let x = ListSpokesRequest::new().set_parent("example");
11453 /// ```
11454 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11455 self.parent = v.into();
11456 self
11457 }
11458
11459 /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
11460 ///
11461 /// # Example
11462 /// ```ignore,no_run
11463 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11464 /// let x = ListSpokesRequest::new().set_page_size(42);
11465 /// ```
11466 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11467 self.page_size = v.into();
11468 self
11469 }
11470
11471 /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
11472 ///
11473 /// # Example
11474 /// ```ignore,no_run
11475 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11476 /// let x = ListSpokesRequest::new().set_page_token("example");
11477 /// ```
11478 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11479 self.page_token = v.into();
11480 self
11481 }
11482
11483 /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
11484 ///
11485 /// # Example
11486 /// ```ignore,no_run
11487 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11488 /// let x = ListSpokesRequest::new().set_filter("example");
11489 /// ```
11490 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11491 self.filter = v.into();
11492 self
11493 }
11494
11495 /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
11496 ///
11497 /// # Example
11498 /// ```ignore,no_run
11499 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11500 /// let x = ListSpokesRequest::new().set_order_by("example");
11501 /// ```
11502 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11503 self.order_by = v.into();
11504 self
11505 }
11506}
11507
11508impl wkt::message::Message for ListSpokesRequest {
11509 fn typename() -> &'static str {
11510 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesRequest"
11511 }
11512}
11513
11514/// The response for
11515/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
11516///
11517/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
11518#[derive(Clone, Default, PartialEq)]
11519#[non_exhaustive]
11520pub struct ListSpokesResponse {
11521 /// The requested spokes.
11522 pub spokes: std::vec::Vec<crate::model::Spoke>,
11523
11524 /// The token for the next page of the response. To see more results,
11525 /// use this value as the page_token for your next request. If this value
11526 /// is empty, there are no more results.
11527 pub next_page_token: std::string::String,
11528
11529 /// Locations that could not be reached.
11530 pub unreachable: std::vec::Vec<std::string::String>,
11531
11532 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11533}
11534
11535impl ListSpokesResponse {
11536 pub fn new() -> Self {
11537 std::default::Default::default()
11538 }
11539
11540 /// Sets the value of [spokes][crate::model::ListSpokesResponse::spokes].
11541 ///
11542 /// # Example
11543 /// ```ignore,no_run
11544 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11545 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11546 /// let x = ListSpokesResponse::new()
11547 /// .set_spokes([
11548 /// Spoke::default()/* use setters */,
11549 /// Spoke::default()/* use (different) setters */,
11550 /// ]);
11551 /// ```
11552 pub fn set_spokes<T, V>(mut self, v: T) -> Self
11553 where
11554 T: std::iter::IntoIterator<Item = V>,
11555 V: std::convert::Into<crate::model::Spoke>,
11556 {
11557 use std::iter::Iterator;
11558 self.spokes = v.into_iter().map(|i| i.into()).collect();
11559 self
11560 }
11561
11562 /// Sets the value of [next_page_token][crate::model::ListSpokesResponse::next_page_token].
11563 ///
11564 /// # Example
11565 /// ```ignore,no_run
11566 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11567 /// let x = ListSpokesResponse::new().set_next_page_token("example");
11568 /// ```
11569 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11570 self.next_page_token = v.into();
11571 self
11572 }
11573
11574 /// Sets the value of [unreachable][crate::model::ListSpokesResponse::unreachable].
11575 ///
11576 /// # Example
11577 /// ```ignore,no_run
11578 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11579 /// let x = ListSpokesResponse::new().set_unreachable(["a", "b", "c"]);
11580 /// ```
11581 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11582 where
11583 T: std::iter::IntoIterator<Item = V>,
11584 V: std::convert::Into<std::string::String>,
11585 {
11586 use std::iter::Iterator;
11587 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11588 self
11589 }
11590}
11591
11592impl wkt::message::Message for ListSpokesResponse {
11593 fn typename() -> &'static str {
11594 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesResponse"
11595 }
11596}
11597
11598#[doc(hidden)]
11599impl google_cloud_gax::paginator::internal::PageableResponse for ListSpokesResponse {
11600 type PageItem = crate::model::Spoke;
11601
11602 fn items(self) -> std::vec::Vec<Self::PageItem> {
11603 self.spokes
11604 }
11605
11606 fn next_page_token(&self) -> std::string::String {
11607 use std::clone::Clone;
11608 self.next_page_token.clone()
11609 }
11610}
11611
11612/// The request for
11613/// [HubService.GetSpoke][google.cloud.networkconnectivity.v1.HubService.GetSpoke].
11614///
11615/// [google.cloud.networkconnectivity.v1.HubService.GetSpoke]: crate::client::HubService::get_spoke
11616#[derive(Clone, Default, PartialEq)]
11617#[non_exhaustive]
11618pub struct GetSpokeRequest {
11619 /// Required. The name of the spoke resource.
11620 pub name: std::string::String,
11621
11622 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11623}
11624
11625impl GetSpokeRequest {
11626 pub fn new() -> Self {
11627 std::default::Default::default()
11628 }
11629
11630 /// Sets the value of [name][crate::model::GetSpokeRequest::name].
11631 ///
11632 /// # Example
11633 /// ```ignore,no_run
11634 /// # use google_cloud_networkconnectivity_v1::model::GetSpokeRequest;
11635 /// let x = GetSpokeRequest::new().set_name("example");
11636 /// ```
11637 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11638 self.name = v.into();
11639 self
11640 }
11641}
11642
11643impl wkt::message::Message for GetSpokeRequest {
11644 fn typename() -> &'static str {
11645 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetSpokeRequest"
11646 }
11647}
11648
11649/// The request for
11650/// [HubService.CreateSpoke][google.cloud.networkconnectivity.v1.HubService.CreateSpoke].
11651///
11652/// [google.cloud.networkconnectivity.v1.HubService.CreateSpoke]: crate::client::HubService::create_spoke
11653#[derive(Clone, Default, PartialEq)]
11654#[non_exhaustive]
11655pub struct CreateSpokeRequest {
11656 /// Required. The parent resource.
11657 pub parent: std::string::String,
11658
11659 /// Required. Unique id for the spoke to create.
11660 pub spoke_id: std::string::String,
11661
11662 /// Required. The initial values for a new spoke.
11663 pub spoke: std::option::Option<crate::model::Spoke>,
11664
11665 /// Optional. A request ID to identify requests. Specify a unique request ID so
11666 /// that if you must retry your request, the server knows to ignore the request
11667 /// if it has already been completed. The server guarantees that a request
11668 /// doesn't result in creation of duplicate commitments for at least 60
11669 /// minutes.
11670 ///
11671 /// For example, consider a situation where you make an initial request and
11672 /// the request times out. If you make the request again with the same request
11673 /// ID, the server can check to see whether the original operation
11674 /// was received. If it was, the server ignores the second request. This
11675 /// behavior prevents clients from mistakenly creating duplicate commitments.
11676 ///
11677 /// The request ID must be a valid UUID, with the exception that zero UUID is
11678 /// not supported (00000000-0000-0000-0000-000000000000).
11679 pub request_id: std::string::String,
11680
11681 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11682}
11683
11684impl CreateSpokeRequest {
11685 pub fn new() -> Self {
11686 std::default::Default::default()
11687 }
11688
11689 /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
11690 ///
11691 /// # Example
11692 /// ```ignore,no_run
11693 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11694 /// let x = CreateSpokeRequest::new().set_parent("example");
11695 /// ```
11696 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11697 self.parent = v.into();
11698 self
11699 }
11700
11701 /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
11702 ///
11703 /// # Example
11704 /// ```ignore,no_run
11705 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11706 /// let x = CreateSpokeRequest::new().set_spoke_id("example");
11707 /// ```
11708 pub fn set_spoke_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11709 self.spoke_id = v.into();
11710 self
11711 }
11712
11713 /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
11714 ///
11715 /// # Example
11716 /// ```ignore,no_run
11717 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11718 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11719 /// let x = CreateSpokeRequest::new().set_spoke(Spoke::default()/* use setters */);
11720 /// ```
11721 pub fn set_spoke<T>(mut self, v: T) -> Self
11722 where
11723 T: std::convert::Into<crate::model::Spoke>,
11724 {
11725 self.spoke = std::option::Option::Some(v.into());
11726 self
11727 }
11728
11729 /// Sets or clears the value of [spoke][crate::model::CreateSpokeRequest::spoke].
11730 ///
11731 /// # Example
11732 /// ```ignore,no_run
11733 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11734 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11735 /// let x = CreateSpokeRequest::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
11736 /// let x = CreateSpokeRequest::new().set_or_clear_spoke(None::<Spoke>);
11737 /// ```
11738 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
11739 where
11740 T: std::convert::Into<crate::model::Spoke>,
11741 {
11742 self.spoke = v.map(|x| x.into());
11743 self
11744 }
11745
11746 /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
11747 ///
11748 /// # Example
11749 /// ```ignore,no_run
11750 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11751 /// let x = CreateSpokeRequest::new().set_request_id("example");
11752 /// ```
11753 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11754 self.request_id = v.into();
11755 self
11756 }
11757}
11758
11759impl wkt::message::Message for CreateSpokeRequest {
11760 fn typename() -> &'static str {
11761 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateSpokeRequest"
11762 }
11763}
11764
11765/// Request for
11766/// [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]
11767/// method.
11768///
11769/// [google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]: crate::client::HubService::update_spoke
11770#[derive(Clone, Default, PartialEq)]
11771#[non_exhaustive]
11772pub struct UpdateSpokeRequest {
11773 /// Optional. In the case of an update to an existing spoke, field mask is used
11774 /// to specify the fields to be overwritten. The fields specified in the
11775 /// update_mask are relative to the resource, not the full request. A field is
11776 /// overwritten if it is in the mask. If the user does not provide a mask, then
11777 /// all fields are overwritten.
11778 pub update_mask: std::option::Option<wkt::FieldMask>,
11779
11780 /// Required. The state that the spoke should be in after the update.
11781 pub spoke: std::option::Option<crate::model::Spoke>,
11782
11783 /// Optional. A request ID to identify requests. Specify a unique request ID so
11784 /// that if you must retry your request, the server knows to ignore the request
11785 /// if it has already been completed. The server guarantees that a request
11786 /// doesn't result in creation of duplicate commitments for at least 60
11787 /// minutes.
11788 ///
11789 /// For example, consider a situation where you make an initial request and
11790 /// the request times out. If you make the request again with the same request
11791 /// ID, the server can check to see whether the original operation
11792 /// was received. If it was, the server ignores the second request. This
11793 /// behavior prevents clients from mistakenly creating duplicate commitments.
11794 ///
11795 /// The request ID must be a valid UUID, with the exception that zero UUID is
11796 /// not supported (00000000-0000-0000-0000-000000000000).
11797 pub request_id: std::string::String,
11798
11799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11800}
11801
11802impl UpdateSpokeRequest {
11803 pub fn new() -> Self {
11804 std::default::Default::default()
11805 }
11806
11807 /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
11808 ///
11809 /// # Example
11810 /// ```ignore,no_run
11811 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11812 /// use wkt::FieldMask;
11813 /// let x = UpdateSpokeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11814 /// ```
11815 pub fn set_update_mask<T>(mut self, v: T) -> Self
11816 where
11817 T: std::convert::Into<wkt::FieldMask>,
11818 {
11819 self.update_mask = std::option::Option::Some(v.into());
11820 self
11821 }
11822
11823 /// Sets or clears the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
11824 ///
11825 /// # Example
11826 /// ```ignore,no_run
11827 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11828 /// use wkt::FieldMask;
11829 /// let x = UpdateSpokeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11830 /// let x = UpdateSpokeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11831 /// ```
11832 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11833 where
11834 T: std::convert::Into<wkt::FieldMask>,
11835 {
11836 self.update_mask = v.map(|x| x.into());
11837 self
11838 }
11839
11840 /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
11841 ///
11842 /// # Example
11843 /// ```ignore,no_run
11844 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11845 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11846 /// let x = UpdateSpokeRequest::new().set_spoke(Spoke::default()/* use setters */);
11847 /// ```
11848 pub fn set_spoke<T>(mut self, v: T) -> Self
11849 where
11850 T: std::convert::Into<crate::model::Spoke>,
11851 {
11852 self.spoke = std::option::Option::Some(v.into());
11853 self
11854 }
11855
11856 /// Sets or clears the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
11857 ///
11858 /// # Example
11859 /// ```ignore,no_run
11860 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11861 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11862 /// let x = UpdateSpokeRequest::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
11863 /// let x = UpdateSpokeRequest::new().set_or_clear_spoke(None::<Spoke>);
11864 /// ```
11865 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
11866 where
11867 T: std::convert::Into<crate::model::Spoke>,
11868 {
11869 self.spoke = v.map(|x| x.into());
11870 self
11871 }
11872
11873 /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
11874 ///
11875 /// # Example
11876 /// ```ignore,no_run
11877 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11878 /// let x = UpdateSpokeRequest::new().set_request_id("example");
11879 /// ```
11880 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11881 self.request_id = v.into();
11882 self
11883 }
11884}
11885
11886impl wkt::message::Message for UpdateSpokeRequest {
11887 fn typename() -> &'static str {
11888 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"
11889 }
11890}
11891
11892/// The request for
11893/// [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1.HubService.DeleteSpoke].
11894///
11895/// [google.cloud.networkconnectivity.v1.HubService.DeleteSpoke]: crate::client::HubService::delete_spoke
11896#[derive(Clone, Default, PartialEq)]
11897#[non_exhaustive]
11898pub struct DeleteSpokeRequest {
11899 /// Required. The name of the spoke to delete.
11900 pub name: std::string::String,
11901
11902 /// Optional. A request ID to identify requests. Specify a unique request ID so
11903 /// that if you must retry your request, the server knows to ignore the request
11904 /// if it has already been completed. The server guarantees that a request
11905 /// doesn't result in creation of duplicate commitments for at least 60
11906 /// minutes.
11907 ///
11908 /// For example, consider a situation where you make an initial request and
11909 /// the request times out. If you make the request again with the same request
11910 /// ID, the server can check to see whether the original operation
11911 /// was received. If it was, the server ignores the second request. This
11912 /// behavior prevents clients from mistakenly creating duplicate commitments.
11913 ///
11914 /// The request ID must be a valid UUID, with the exception that zero UUID is
11915 /// not supported (00000000-0000-0000-0000-000000000000).
11916 pub request_id: std::string::String,
11917
11918 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11919}
11920
11921impl DeleteSpokeRequest {
11922 pub fn new() -> Self {
11923 std::default::Default::default()
11924 }
11925
11926 /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
11927 ///
11928 /// # Example
11929 /// ```ignore,no_run
11930 /// # use google_cloud_networkconnectivity_v1::model::DeleteSpokeRequest;
11931 /// let x = DeleteSpokeRequest::new().set_name("example");
11932 /// ```
11933 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11934 self.name = v.into();
11935 self
11936 }
11937
11938 /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
11939 ///
11940 /// # Example
11941 /// ```ignore,no_run
11942 /// # use google_cloud_networkconnectivity_v1::model::DeleteSpokeRequest;
11943 /// let x = DeleteSpokeRequest::new().set_request_id("example");
11944 /// ```
11945 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11946 self.request_id = v.into();
11947 self
11948 }
11949}
11950
11951impl wkt::message::Message for DeleteSpokeRequest {
11952 fn typename() -> &'static str {
11953 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"
11954 }
11955}
11956
11957/// The request for
11958/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
11959///
11960/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
11961#[derive(Clone, Default, PartialEq)]
11962#[non_exhaustive]
11963pub struct AcceptHubSpokeRequest {
11964 /// Required. The name of the hub into which to accept the spoke.
11965 pub name: std::string::String,
11966
11967 /// Required. The URI of the spoke to accept into the hub.
11968 pub spoke_uri: std::string::String,
11969
11970 /// Optional. A request ID to identify requests. Specify a unique request ID so
11971 /// that if you must retry your request, the server knows to ignore the request
11972 /// if it has already been completed. The server guarantees that a request
11973 /// doesn't result in creation of duplicate commitments for at least 60
11974 /// minutes.
11975 ///
11976 /// For example, consider a situation where you make an initial request and
11977 /// the request times out. If you make the request again with the same request
11978 /// ID, the server can check to see whether the original operation
11979 /// was received. If it was, the server ignores the second request. This
11980 /// behavior prevents clients from mistakenly creating duplicate commitments.
11981 ///
11982 /// The request ID must be a valid UUID, with the exception that zero UUID is
11983 /// not supported (00000000-0000-0000-0000-000000000000).
11984 pub request_id: std::string::String,
11985
11986 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11987}
11988
11989impl AcceptHubSpokeRequest {
11990 pub fn new() -> Self {
11991 std::default::Default::default()
11992 }
11993
11994 /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
11995 ///
11996 /// # Example
11997 /// ```ignore,no_run
11998 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
11999 /// let x = AcceptHubSpokeRequest::new().set_name("example");
12000 /// ```
12001 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12002 self.name = v.into();
12003 self
12004 }
12005
12006 /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
12007 ///
12008 /// # Example
12009 /// ```ignore,no_run
12010 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12011 /// let x = AcceptHubSpokeRequest::new().set_spoke_uri("example");
12012 /// ```
12013 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12014 self.spoke_uri = v.into();
12015 self
12016 }
12017
12018 /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
12019 ///
12020 /// # Example
12021 /// ```ignore,no_run
12022 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12023 /// let x = AcceptHubSpokeRequest::new().set_request_id("example");
12024 /// ```
12025 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12026 self.request_id = v.into();
12027 self
12028 }
12029}
12030
12031impl wkt::message::Message for AcceptHubSpokeRequest {
12032 fn typename() -> &'static str {
12033 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"
12034 }
12035}
12036
12037/// The response for
12038/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
12039///
12040/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
12041#[derive(Clone, Default, PartialEq)]
12042#[non_exhaustive]
12043pub struct AcceptHubSpokeResponse {
12044 /// The spoke that was operated on.
12045 pub spoke: std::option::Option<crate::model::Spoke>,
12046
12047 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12048}
12049
12050impl AcceptHubSpokeResponse {
12051 pub fn new() -> Self {
12052 std::default::Default::default()
12053 }
12054
12055 /// Sets the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
12056 ///
12057 /// # Example
12058 /// ```ignore,no_run
12059 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeResponse;
12060 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12061 /// let x = AcceptHubSpokeResponse::new().set_spoke(Spoke::default()/* use setters */);
12062 /// ```
12063 pub fn set_spoke<T>(mut self, v: T) -> Self
12064 where
12065 T: std::convert::Into<crate::model::Spoke>,
12066 {
12067 self.spoke = std::option::Option::Some(v.into());
12068 self
12069 }
12070
12071 /// Sets or clears the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
12072 ///
12073 /// # Example
12074 /// ```ignore,no_run
12075 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeResponse;
12076 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12077 /// let x = AcceptHubSpokeResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12078 /// let x = AcceptHubSpokeResponse::new().set_or_clear_spoke(None::<Spoke>);
12079 /// ```
12080 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12081 where
12082 T: std::convert::Into<crate::model::Spoke>,
12083 {
12084 self.spoke = v.map(|x| x.into());
12085 self
12086 }
12087}
12088
12089impl wkt::message::Message for AcceptHubSpokeResponse {
12090 fn typename() -> &'static str {
12091 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"
12092 }
12093}
12094
12095/// The request for
12096/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
12097///
12098/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
12099#[derive(Clone, Default, PartialEq)]
12100#[non_exhaustive]
12101pub struct RejectHubSpokeRequest {
12102 /// Required. The name of the hub from which to reject the spoke.
12103 pub name: std::string::String,
12104
12105 /// Required. The URI of the spoke to reject from the hub.
12106 pub spoke_uri: std::string::String,
12107
12108 /// Optional. A request ID to identify requests. Specify a unique request ID so
12109 /// that if you must retry your request, the server knows to ignore the request
12110 /// if it has already been completed. The server guarantees that a request
12111 /// doesn't result in creation of duplicate commitments for at least 60
12112 /// minutes.
12113 ///
12114 /// For example, consider a situation where you make an initial request and
12115 /// the request times out. If you make the request again with the same request
12116 /// ID, the server can check to see whether the original operation
12117 /// was received. If it was, the server ignores the second request. This
12118 /// behavior prevents clients from mistakenly creating duplicate commitments.
12119 ///
12120 /// The request ID must be a valid UUID, with the exception that zero UUID is
12121 /// not supported (00000000-0000-0000-0000-000000000000).
12122 pub request_id: std::string::String,
12123
12124 /// Optional. Additional information provided by the hub administrator.
12125 pub details: std::string::String,
12126
12127 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12128}
12129
12130impl RejectHubSpokeRequest {
12131 pub fn new() -> Self {
12132 std::default::Default::default()
12133 }
12134
12135 /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
12136 ///
12137 /// # Example
12138 /// ```ignore,no_run
12139 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12140 /// let x = RejectHubSpokeRequest::new().set_name("example");
12141 /// ```
12142 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12143 self.name = v.into();
12144 self
12145 }
12146
12147 /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
12148 ///
12149 /// # Example
12150 /// ```ignore,no_run
12151 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12152 /// let x = RejectHubSpokeRequest::new().set_spoke_uri("example");
12153 /// ```
12154 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12155 self.spoke_uri = v.into();
12156 self
12157 }
12158
12159 /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
12160 ///
12161 /// # Example
12162 /// ```ignore,no_run
12163 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12164 /// let x = RejectHubSpokeRequest::new().set_request_id("example");
12165 /// ```
12166 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12167 self.request_id = v.into();
12168 self
12169 }
12170
12171 /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
12172 ///
12173 /// # Example
12174 /// ```ignore,no_run
12175 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12176 /// let x = RejectHubSpokeRequest::new().set_details("example");
12177 /// ```
12178 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12179 self.details = v.into();
12180 self
12181 }
12182}
12183
12184impl wkt::message::Message for RejectHubSpokeRequest {
12185 fn typename() -> &'static str {
12186 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"
12187 }
12188}
12189
12190/// The response for
12191/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
12192///
12193/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
12194#[derive(Clone, Default, PartialEq)]
12195#[non_exhaustive]
12196pub struct RejectHubSpokeResponse {
12197 /// The spoke that was operated on.
12198 pub spoke: std::option::Option<crate::model::Spoke>,
12199
12200 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12201}
12202
12203impl RejectHubSpokeResponse {
12204 pub fn new() -> Self {
12205 std::default::Default::default()
12206 }
12207
12208 /// Sets the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
12209 ///
12210 /// # Example
12211 /// ```ignore,no_run
12212 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeResponse;
12213 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12214 /// let x = RejectHubSpokeResponse::new().set_spoke(Spoke::default()/* use setters */);
12215 /// ```
12216 pub fn set_spoke<T>(mut self, v: T) -> Self
12217 where
12218 T: std::convert::Into<crate::model::Spoke>,
12219 {
12220 self.spoke = std::option::Option::Some(v.into());
12221 self
12222 }
12223
12224 /// Sets or clears the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
12225 ///
12226 /// # Example
12227 /// ```ignore,no_run
12228 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeResponse;
12229 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12230 /// let x = RejectHubSpokeResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12231 /// let x = RejectHubSpokeResponse::new().set_or_clear_spoke(None::<Spoke>);
12232 /// ```
12233 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12234 where
12235 T: std::convert::Into<crate::model::Spoke>,
12236 {
12237 self.spoke = v.map(|x| x.into());
12238 self
12239 }
12240}
12241
12242impl wkt::message::Message for RejectHubSpokeResponse {
12243 fn typename() -> &'static str {
12244 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"
12245 }
12246}
12247
12248/// The request for
12249/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
12250///
12251/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
12252#[derive(Clone, Default, PartialEq)]
12253#[non_exhaustive]
12254pub struct AcceptSpokeUpdateRequest {
12255 /// Required. The name of the hub to accept spoke update.
12256 pub name: std::string::String,
12257
12258 /// Required. The URI of the spoke to accept update.
12259 pub spoke_uri: std::string::String,
12260
12261 /// Required. The etag of the spoke to accept update.
12262 pub spoke_etag: std::string::String,
12263
12264 /// Optional. A request ID to identify requests. Specify a unique request ID so
12265 /// that if you must retry your request, the server knows to ignore the request
12266 /// if it has already been completed. The server guarantees that a request
12267 /// doesn't result in creation of duplicate commitments for at least 60
12268 /// minutes.
12269 ///
12270 /// For example, consider a situation where you make an initial request and
12271 /// the request times out. If you make the request again with the same request
12272 /// ID, the server can check to see whether the original operation
12273 /// was received. If it was, the server ignores the second request. This
12274 /// behavior prevents clients from mistakenly creating duplicate commitments.
12275 ///
12276 /// The request ID must be a valid UUID, with the exception that zero UUID is
12277 /// not supported (00000000-0000-0000-0000-000000000000).
12278 pub request_id: std::string::String,
12279
12280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12281}
12282
12283impl AcceptSpokeUpdateRequest {
12284 pub fn new() -> Self {
12285 std::default::Default::default()
12286 }
12287
12288 /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
12289 ///
12290 /// # Example
12291 /// ```ignore,no_run
12292 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12293 /// let x = AcceptSpokeUpdateRequest::new().set_name("example");
12294 /// ```
12295 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12296 self.name = v.into();
12297 self
12298 }
12299
12300 /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
12301 ///
12302 /// # Example
12303 /// ```ignore,no_run
12304 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12305 /// let x = AcceptSpokeUpdateRequest::new().set_spoke_uri("example");
12306 /// ```
12307 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12308 self.spoke_uri = v.into();
12309 self
12310 }
12311
12312 /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
12313 ///
12314 /// # Example
12315 /// ```ignore,no_run
12316 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12317 /// let x = AcceptSpokeUpdateRequest::new().set_spoke_etag("example");
12318 /// ```
12319 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12320 self.spoke_etag = v.into();
12321 self
12322 }
12323
12324 /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
12325 ///
12326 /// # Example
12327 /// ```ignore,no_run
12328 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12329 /// let x = AcceptSpokeUpdateRequest::new().set_request_id("example");
12330 /// ```
12331 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12332 self.request_id = v.into();
12333 self
12334 }
12335}
12336
12337impl wkt::message::Message for AcceptSpokeUpdateRequest {
12338 fn typename() -> &'static str {
12339 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateRequest"
12340 }
12341}
12342
12343/// The response for
12344/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
12345///
12346/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
12347#[derive(Clone, Default, PartialEq)]
12348#[non_exhaustive]
12349pub struct AcceptSpokeUpdateResponse {
12350 /// The spoke that was operated on.
12351 pub spoke: std::option::Option<crate::model::Spoke>,
12352
12353 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12354}
12355
12356impl AcceptSpokeUpdateResponse {
12357 pub fn new() -> Self {
12358 std::default::Default::default()
12359 }
12360
12361 /// Sets the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
12362 ///
12363 /// # Example
12364 /// ```ignore,no_run
12365 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateResponse;
12366 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12367 /// let x = AcceptSpokeUpdateResponse::new().set_spoke(Spoke::default()/* use setters */);
12368 /// ```
12369 pub fn set_spoke<T>(mut self, v: T) -> Self
12370 where
12371 T: std::convert::Into<crate::model::Spoke>,
12372 {
12373 self.spoke = std::option::Option::Some(v.into());
12374 self
12375 }
12376
12377 /// Sets or clears the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
12378 ///
12379 /// # Example
12380 /// ```ignore,no_run
12381 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateResponse;
12382 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12383 /// let x = AcceptSpokeUpdateResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12384 /// let x = AcceptSpokeUpdateResponse::new().set_or_clear_spoke(None::<Spoke>);
12385 /// ```
12386 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12387 where
12388 T: std::convert::Into<crate::model::Spoke>,
12389 {
12390 self.spoke = v.map(|x| x.into());
12391 self
12392 }
12393}
12394
12395impl wkt::message::Message for AcceptSpokeUpdateResponse {
12396 fn typename() -> &'static str {
12397 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateResponse"
12398 }
12399}
12400
12401/// The request for
12402/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
12403///
12404/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
12405#[derive(Clone, Default, PartialEq)]
12406#[non_exhaustive]
12407pub struct RejectSpokeUpdateRequest {
12408 /// Required. The name of the hub to reject spoke update.
12409 pub name: std::string::String,
12410
12411 /// Required. The URI of the spoke to reject update.
12412 pub spoke_uri: std::string::String,
12413
12414 /// Required. The etag of the spoke to reject update.
12415 pub spoke_etag: std::string::String,
12416
12417 /// Optional. Additional information provided by the hub administrator.
12418 pub details: std::string::String,
12419
12420 /// Optional. A request ID to identify requests. Specify a unique request ID so
12421 /// that if you must retry your request, the server knows to ignore the request
12422 /// if it has already been completed. The server guarantees that a request
12423 /// doesn't result in creation of duplicate commitments for at least 60
12424 /// minutes.
12425 ///
12426 /// For example, consider a situation where you make an initial request and
12427 /// the request times out. If you make the request again with the same request
12428 /// ID, the server can check to see whether the original operation
12429 /// was received. If it was, the server ignores the second request. This
12430 /// behavior prevents clients from mistakenly creating duplicate commitments.
12431 ///
12432 /// The request ID must be a valid UUID, with the exception that zero UUID is
12433 /// not supported (00000000-0000-0000-0000-000000000000).
12434 pub request_id: std::string::String,
12435
12436 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12437}
12438
12439impl RejectSpokeUpdateRequest {
12440 pub fn new() -> Self {
12441 std::default::Default::default()
12442 }
12443
12444 /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
12445 ///
12446 /// # Example
12447 /// ```ignore,no_run
12448 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12449 /// let x = RejectSpokeUpdateRequest::new().set_name("example");
12450 /// ```
12451 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12452 self.name = v.into();
12453 self
12454 }
12455
12456 /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
12457 ///
12458 /// # Example
12459 /// ```ignore,no_run
12460 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12461 /// let x = RejectSpokeUpdateRequest::new().set_spoke_uri("example");
12462 /// ```
12463 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12464 self.spoke_uri = v.into();
12465 self
12466 }
12467
12468 /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
12469 ///
12470 /// # Example
12471 /// ```ignore,no_run
12472 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12473 /// let x = RejectSpokeUpdateRequest::new().set_spoke_etag("example");
12474 /// ```
12475 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12476 self.spoke_etag = v.into();
12477 self
12478 }
12479
12480 /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
12481 ///
12482 /// # Example
12483 /// ```ignore,no_run
12484 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12485 /// let x = RejectSpokeUpdateRequest::new().set_details("example");
12486 /// ```
12487 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12488 self.details = v.into();
12489 self
12490 }
12491
12492 /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
12493 ///
12494 /// # Example
12495 /// ```ignore,no_run
12496 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12497 /// let x = RejectSpokeUpdateRequest::new().set_request_id("example");
12498 /// ```
12499 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12500 self.request_id = v.into();
12501 self
12502 }
12503}
12504
12505impl wkt::message::Message for RejectSpokeUpdateRequest {
12506 fn typename() -> &'static str {
12507 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateRequest"
12508 }
12509}
12510
12511/// The response for
12512/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
12513///
12514/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
12515#[derive(Clone, Default, PartialEq)]
12516#[non_exhaustive]
12517pub struct RejectSpokeUpdateResponse {
12518 /// The spoke that was operated on.
12519 pub spoke: std::option::Option<crate::model::Spoke>,
12520
12521 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12522}
12523
12524impl RejectSpokeUpdateResponse {
12525 pub fn new() -> Self {
12526 std::default::Default::default()
12527 }
12528
12529 /// Sets the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
12530 ///
12531 /// # Example
12532 /// ```ignore,no_run
12533 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateResponse;
12534 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12535 /// let x = RejectSpokeUpdateResponse::new().set_spoke(Spoke::default()/* use setters */);
12536 /// ```
12537 pub fn set_spoke<T>(mut self, v: T) -> Self
12538 where
12539 T: std::convert::Into<crate::model::Spoke>,
12540 {
12541 self.spoke = std::option::Option::Some(v.into());
12542 self
12543 }
12544
12545 /// Sets or clears the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
12546 ///
12547 /// # Example
12548 /// ```ignore,no_run
12549 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateResponse;
12550 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12551 /// let x = RejectSpokeUpdateResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12552 /// let x = RejectSpokeUpdateResponse::new().set_or_clear_spoke(None::<Spoke>);
12553 /// ```
12554 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12555 where
12556 T: std::convert::Into<crate::model::Spoke>,
12557 {
12558 self.spoke = v.map(|x| x.into());
12559 self
12560 }
12561}
12562
12563impl wkt::message::Message for RejectSpokeUpdateResponse {
12564 fn typename() -> &'static str {
12565 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateResponse"
12566 }
12567}
12568
12569/// The request for
12570/// [HubService.GetRouteTable][google.cloud.networkconnectivity.v1.HubService.GetRouteTable].
12571///
12572/// [google.cloud.networkconnectivity.v1.HubService.GetRouteTable]: crate::client::HubService::get_route_table
12573#[derive(Clone, Default, PartialEq)]
12574#[non_exhaustive]
12575pub struct GetRouteTableRequest {
12576 /// Required. The name of the route table resource.
12577 pub name: std::string::String,
12578
12579 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12580}
12581
12582impl GetRouteTableRequest {
12583 pub fn new() -> Self {
12584 std::default::Default::default()
12585 }
12586
12587 /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
12588 ///
12589 /// # Example
12590 /// ```ignore,no_run
12591 /// # use google_cloud_networkconnectivity_v1::model::GetRouteTableRequest;
12592 /// let x = GetRouteTableRequest::new().set_name("example");
12593 /// ```
12594 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12595 self.name = v.into();
12596 self
12597 }
12598}
12599
12600impl wkt::message::Message for GetRouteTableRequest {
12601 fn typename() -> &'static str {
12602 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteTableRequest"
12603 }
12604}
12605
12606/// The request for
12607/// [HubService.GetRoute][google.cloud.networkconnectivity.v1.HubService.GetRoute].
12608///
12609/// [google.cloud.networkconnectivity.v1.HubService.GetRoute]: crate::client::HubService::get_route
12610#[derive(Clone, Default, PartialEq)]
12611#[non_exhaustive]
12612pub struct GetRouteRequest {
12613 /// Required. The name of the route resource.
12614 pub name: std::string::String,
12615
12616 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12617}
12618
12619impl GetRouteRequest {
12620 pub fn new() -> Self {
12621 std::default::Default::default()
12622 }
12623
12624 /// Sets the value of [name][crate::model::GetRouteRequest::name].
12625 ///
12626 /// # Example
12627 /// ```ignore,no_run
12628 /// # use google_cloud_networkconnectivity_v1::model::GetRouteRequest;
12629 /// let x = GetRouteRequest::new().set_name("example");
12630 /// ```
12631 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12632 self.name = v.into();
12633 self
12634 }
12635}
12636
12637impl wkt::message::Message for GetRouteRequest {
12638 fn typename() -> &'static str {
12639 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteRequest"
12640 }
12641}
12642
12643/// Request for
12644/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
12645/// method.
12646///
12647/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
12648#[derive(Clone, Default, PartialEq)]
12649#[non_exhaustive]
12650pub struct ListRoutesRequest {
12651 /// Required. The parent resource's name.
12652 pub parent: std::string::String,
12653
12654 /// The maximum number of results to return per page.
12655 pub page_size: i32,
12656
12657 /// The page token.
12658 pub page_token: std::string::String,
12659
12660 /// An expression that filters the list of results.
12661 pub filter: std::string::String,
12662
12663 /// Sort the results by a certain order.
12664 pub order_by: std::string::String,
12665
12666 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12667}
12668
12669impl ListRoutesRequest {
12670 pub fn new() -> Self {
12671 std::default::Default::default()
12672 }
12673
12674 /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
12675 ///
12676 /// # Example
12677 /// ```ignore,no_run
12678 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12679 /// let x = ListRoutesRequest::new().set_parent("example");
12680 /// ```
12681 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12682 self.parent = v.into();
12683 self
12684 }
12685
12686 /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
12687 ///
12688 /// # Example
12689 /// ```ignore,no_run
12690 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12691 /// let x = ListRoutesRequest::new().set_page_size(42);
12692 /// ```
12693 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12694 self.page_size = v.into();
12695 self
12696 }
12697
12698 /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
12699 ///
12700 /// # Example
12701 /// ```ignore,no_run
12702 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12703 /// let x = ListRoutesRequest::new().set_page_token("example");
12704 /// ```
12705 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12706 self.page_token = v.into();
12707 self
12708 }
12709
12710 /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
12711 ///
12712 /// # Example
12713 /// ```ignore,no_run
12714 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12715 /// let x = ListRoutesRequest::new().set_filter("example");
12716 /// ```
12717 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12718 self.filter = v.into();
12719 self
12720 }
12721
12722 /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
12723 ///
12724 /// # Example
12725 /// ```ignore,no_run
12726 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12727 /// let x = ListRoutesRequest::new().set_order_by("example");
12728 /// ```
12729 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12730 self.order_by = v.into();
12731 self
12732 }
12733}
12734
12735impl wkt::message::Message for ListRoutesRequest {
12736 fn typename() -> &'static str {
12737 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesRequest"
12738 }
12739}
12740
12741/// Response for
12742/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
12743/// method.
12744///
12745/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
12746#[derive(Clone, Default, PartialEq)]
12747#[non_exhaustive]
12748pub struct ListRoutesResponse {
12749 /// The requested routes.
12750 pub routes: std::vec::Vec<crate::model::Route>,
12751
12752 /// The token for the next page of the response. To see more results,
12753 /// use this value as the page_token for your next request. If this value
12754 /// is empty, there are no more results.
12755 pub next_page_token: std::string::String,
12756
12757 /// RouteTables that could not be reached.
12758 pub unreachable: std::vec::Vec<std::string::String>,
12759
12760 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12761}
12762
12763impl ListRoutesResponse {
12764 pub fn new() -> Self {
12765 std::default::Default::default()
12766 }
12767
12768 /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
12769 ///
12770 /// # Example
12771 /// ```ignore,no_run
12772 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
12773 /// use google_cloud_networkconnectivity_v1::model::Route;
12774 /// let x = ListRoutesResponse::new()
12775 /// .set_routes([
12776 /// Route::default()/* use setters */,
12777 /// Route::default()/* use (different) setters */,
12778 /// ]);
12779 /// ```
12780 pub fn set_routes<T, V>(mut self, v: T) -> Self
12781 where
12782 T: std::iter::IntoIterator<Item = V>,
12783 V: std::convert::Into<crate::model::Route>,
12784 {
12785 use std::iter::Iterator;
12786 self.routes = v.into_iter().map(|i| i.into()).collect();
12787 self
12788 }
12789
12790 /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
12791 ///
12792 /// # Example
12793 /// ```ignore,no_run
12794 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
12795 /// let x = ListRoutesResponse::new().set_next_page_token("example");
12796 /// ```
12797 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12798 self.next_page_token = v.into();
12799 self
12800 }
12801
12802 /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
12803 ///
12804 /// # Example
12805 /// ```ignore,no_run
12806 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
12807 /// let x = ListRoutesResponse::new().set_unreachable(["a", "b", "c"]);
12808 /// ```
12809 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12810 where
12811 T: std::iter::IntoIterator<Item = V>,
12812 V: std::convert::Into<std::string::String>,
12813 {
12814 use std::iter::Iterator;
12815 self.unreachable = v.into_iter().map(|i| i.into()).collect();
12816 self
12817 }
12818}
12819
12820impl wkt::message::Message for ListRoutesResponse {
12821 fn typename() -> &'static str {
12822 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesResponse"
12823 }
12824}
12825
12826#[doc(hidden)]
12827impl google_cloud_gax::paginator::internal::PageableResponse for ListRoutesResponse {
12828 type PageItem = crate::model::Route;
12829
12830 fn items(self) -> std::vec::Vec<Self::PageItem> {
12831 self.routes
12832 }
12833
12834 fn next_page_token(&self) -> std::string::String {
12835 use std::clone::Clone;
12836 self.next_page_token.clone()
12837 }
12838}
12839
12840/// Request for
12841/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
12842/// method.
12843///
12844/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
12845#[derive(Clone, Default, PartialEq)]
12846#[non_exhaustive]
12847pub struct ListRouteTablesRequest {
12848 /// Required. The parent resource's name.
12849 pub parent: std::string::String,
12850
12851 /// The maximum number of results to return per page.
12852 pub page_size: i32,
12853
12854 /// The page token.
12855 pub page_token: std::string::String,
12856
12857 /// An expression that filters the list of results.
12858 pub filter: std::string::String,
12859
12860 /// Sort the results by a certain order.
12861 pub order_by: std::string::String,
12862
12863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12864}
12865
12866impl ListRouteTablesRequest {
12867 pub fn new() -> Self {
12868 std::default::Default::default()
12869 }
12870
12871 /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
12872 ///
12873 /// # Example
12874 /// ```ignore,no_run
12875 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12876 /// let x = ListRouteTablesRequest::new().set_parent("example");
12877 /// ```
12878 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12879 self.parent = v.into();
12880 self
12881 }
12882
12883 /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
12884 ///
12885 /// # Example
12886 /// ```ignore,no_run
12887 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12888 /// let x = ListRouteTablesRequest::new().set_page_size(42);
12889 /// ```
12890 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12891 self.page_size = v.into();
12892 self
12893 }
12894
12895 /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
12896 ///
12897 /// # Example
12898 /// ```ignore,no_run
12899 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12900 /// let x = ListRouteTablesRequest::new().set_page_token("example");
12901 /// ```
12902 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12903 self.page_token = v.into();
12904 self
12905 }
12906
12907 /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
12908 ///
12909 /// # Example
12910 /// ```ignore,no_run
12911 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12912 /// let x = ListRouteTablesRequest::new().set_filter("example");
12913 /// ```
12914 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12915 self.filter = v.into();
12916 self
12917 }
12918
12919 /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
12920 ///
12921 /// # Example
12922 /// ```ignore,no_run
12923 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12924 /// let x = ListRouteTablesRequest::new().set_order_by("example");
12925 /// ```
12926 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12927 self.order_by = v.into();
12928 self
12929 }
12930}
12931
12932impl wkt::message::Message for ListRouteTablesRequest {
12933 fn typename() -> &'static str {
12934 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"
12935 }
12936}
12937
12938/// Response for
12939/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
12940/// method.
12941///
12942/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
12943#[derive(Clone, Default, PartialEq)]
12944#[non_exhaustive]
12945pub struct ListRouteTablesResponse {
12946 /// The requested route tables.
12947 pub route_tables: std::vec::Vec<crate::model::RouteTable>,
12948
12949 /// The token for the next page of the response. To see more results,
12950 /// use this value as the page_token for your next request. If this value
12951 /// is empty, there are no more results.
12952 pub next_page_token: std::string::String,
12953
12954 /// Hubs that could not be reached.
12955 pub unreachable: std::vec::Vec<std::string::String>,
12956
12957 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12958}
12959
12960impl ListRouteTablesResponse {
12961 pub fn new() -> Self {
12962 std::default::Default::default()
12963 }
12964
12965 /// Sets the value of [route_tables][crate::model::ListRouteTablesResponse::route_tables].
12966 ///
12967 /// # Example
12968 /// ```ignore,no_run
12969 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
12970 /// use google_cloud_networkconnectivity_v1::model::RouteTable;
12971 /// let x = ListRouteTablesResponse::new()
12972 /// .set_route_tables([
12973 /// RouteTable::default()/* use setters */,
12974 /// RouteTable::default()/* use (different) setters */,
12975 /// ]);
12976 /// ```
12977 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
12978 where
12979 T: std::iter::IntoIterator<Item = V>,
12980 V: std::convert::Into<crate::model::RouteTable>,
12981 {
12982 use std::iter::Iterator;
12983 self.route_tables = v.into_iter().map(|i| i.into()).collect();
12984 self
12985 }
12986
12987 /// Sets the value of [next_page_token][crate::model::ListRouteTablesResponse::next_page_token].
12988 ///
12989 /// # Example
12990 /// ```ignore,no_run
12991 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
12992 /// let x = ListRouteTablesResponse::new().set_next_page_token("example");
12993 /// ```
12994 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12995 self.next_page_token = v.into();
12996 self
12997 }
12998
12999 /// Sets the value of [unreachable][crate::model::ListRouteTablesResponse::unreachable].
13000 ///
13001 /// # Example
13002 /// ```ignore,no_run
13003 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
13004 /// let x = ListRouteTablesResponse::new().set_unreachable(["a", "b", "c"]);
13005 /// ```
13006 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13007 where
13008 T: std::iter::IntoIterator<Item = V>,
13009 V: std::convert::Into<std::string::String>,
13010 {
13011 use std::iter::Iterator;
13012 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13013 self
13014 }
13015}
13016
13017impl wkt::message::Message for ListRouteTablesResponse {
13018 fn typename() -> &'static str {
13019 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"
13020 }
13021}
13022
13023#[doc(hidden)]
13024impl google_cloud_gax::paginator::internal::PageableResponse for ListRouteTablesResponse {
13025 type PageItem = crate::model::RouteTable;
13026
13027 fn items(self) -> std::vec::Vec<Self::PageItem> {
13028 self.route_tables
13029 }
13030
13031 fn next_page_token(&self) -> std::string::String {
13032 use std::clone::Clone;
13033 self.next_page_token.clone()
13034 }
13035}
13036
13037/// Request for
13038/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
13039/// method.
13040///
13041/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
13042#[derive(Clone, Default, PartialEq)]
13043#[non_exhaustive]
13044pub struct ListGroupsRequest {
13045 /// Required. The parent resource's name.
13046 pub parent: std::string::String,
13047
13048 /// The maximum number of results to return per page.
13049 pub page_size: i32,
13050
13051 /// The page token.
13052 pub page_token: std::string::String,
13053
13054 /// An expression that filters the list of results.
13055 pub filter: std::string::String,
13056
13057 /// Sort the results by a certain order.
13058 pub order_by: std::string::String,
13059
13060 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13061}
13062
13063impl ListGroupsRequest {
13064 pub fn new() -> Self {
13065 std::default::Default::default()
13066 }
13067
13068 /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
13069 ///
13070 /// # Example
13071 /// ```ignore,no_run
13072 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13073 /// let x = ListGroupsRequest::new().set_parent("example");
13074 /// ```
13075 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13076 self.parent = v.into();
13077 self
13078 }
13079
13080 /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
13081 ///
13082 /// # Example
13083 /// ```ignore,no_run
13084 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13085 /// let x = ListGroupsRequest::new().set_page_size(42);
13086 /// ```
13087 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13088 self.page_size = v.into();
13089 self
13090 }
13091
13092 /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
13093 ///
13094 /// # Example
13095 /// ```ignore,no_run
13096 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13097 /// let x = ListGroupsRequest::new().set_page_token("example");
13098 /// ```
13099 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13100 self.page_token = v.into();
13101 self
13102 }
13103
13104 /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
13105 ///
13106 /// # Example
13107 /// ```ignore,no_run
13108 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13109 /// let x = ListGroupsRequest::new().set_filter("example");
13110 /// ```
13111 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13112 self.filter = v.into();
13113 self
13114 }
13115
13116 /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
13117 ///
13118 /// # Example
13119 /// ```ignore,no_run
13120 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13121 /// let x = ListGroupsRequest::new().set_order_by("example");
13122 /// ```
13123 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13124 self.order_by = v.into();
13125 self
13126 }
13127}
13128
13129impl wkt::message::Message for ListGroupsRequest {
13130 fn typename() -> &'static str {
13131 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsRequest"
13132 }
13133}
13134
13135/// Response for
13136/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
13137/// method.
13138///
13139/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
13140#[derive(Clone, Default, PartialEq)]
13141#[non_exhaustive]
13142pub struct ListGroupsResponse {
13143 /// The requested groups.
13144 pub groups: std::vec::Vec<crate::model::Group>,
13145
13146 /// The token for the next page of the response. To see more results,
13147 /// use this value as the page_token for your next request. If this value
13148 /// is empty, there are no more results.
13149 pub next_page_token: std::string::String,
13150
13151 /// Hubs that could not be reached.
13152 pub unreachable: std::vec::Vec<std::string::String>,
13153
13154 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13155}
13156
13157impl ListGroupsResponse {
13158 pub fn new() -> Self {
13159 std::default::Default::default()
13160 }
13161
13162 /// Sets the value of [groups][crate::model::ListGroupsResponse::groups].
13163 ///
13164 /// # Example
13165 /// ```ignore,no_run
13166 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13167 /// use google_cloud_networkconnectivity_v1::model::Group;
13168 /// let x = ListGroupsResponse::new()
13169 /// .set_groups([
13170 /// Group::default()/* use setters */,
13171 /// Group::default()/* use (different) setters */,
13172 /// ]);
13173 /// ```
13174 pub fn set_groups<T, V>(mut self, v: T) -> Self
13175 where
13176 T: std::iter::IntoIterator<Item = V>,
13177 V: std::convert::Into<crate::model::Group>,
13178 {
13179 use std::iter::Iterator;
13180 self.groups = v.into_iter().map(|i| i.into()).collect();
13181 self
13182 }
13183
13184 /// Sets the value of [next_page_token][crate::model::ListGroupsResponse::next_page_token].
13185 ///
13186 /// # Example
13187 /// ```ignore,no_run
13188 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13189 /// let x = ListGroupsResponse::new().set_next_page_token("example");
13190 /// ```
13191 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13192 self.next_page_token = v.into();
13193 self
13194 }
13195
13196 /// Sets the value of [unreachable][crate::model::ListGroupsResponse::unreachable].
13197 ///
13198 /// # Example
13199 /// ```ignore,no_run
13200 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13201 /// let x = ListGroupsResponse::new().set_unreachable(["a", "b", "c"]);
13202 /// ```
13203 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13204 where
13205 T: std::iter::IntoIterator<Item = V>,
13206 V: std::convert::Into<std::string::String>,
13207 {
13208 use std::iter::Iterator;
13209 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13210 self
13211 }
13212}
13213
13214impl wkt::message::Message for ListGroupsResponse {
13215 fn typename() -> &'static str {
13216 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsResponse"
13217 }
13218}
13219
13220#[doc(hidden)]
13221impl google_cloud_gax::paginator::internal::PageableResponse for ListGroupsResponse {
13222 type PageItem = crate::model::Group;
13223
13224 fn items(self) -> std::vec::Vec<Self::PageItem> {
13225 self.groups
13226 }
13227
13228 fn next_page_token(&self) -> std::string::String {
13229 use std::clone::Clone;
13230 self.next_page_token.clone()
13231 }
13232}
13233
13234/// A collection of Cloud VPN tunnel resources. These resources should be
13235/// redundant HA VPN tunnels that all advertise the same prefixes to Google
13236/// Cloud. Alternatively, in a passive/active configuration, all tunnels
13237/// should be capable of advertising the same prefixes.
13238#[derive(Clone, Default, PartialEq)]
13239#[non_exhaustive]
13240pub struct LinkedVpnTunnels {
13241 /// The URIs of linked VPN tunnel resources.
13242 pub uris: std::vec::Vec<std::string::String>,
13243
13244 /// A value that controls whether site-to-site data transfer is enabled for
13245 /// these resources. Data transfer is available only in [supported
13246 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13247 pub site_to_site_data_transfer: bool,
13248
13249 /// Output only. The VPC network where these VPN tunnels are located.
13250 pub vpc_network: std::string::String,
13251
13252 /// Optional. IP ranges allowed to be included during import from hub (does not
13253 /// control transit connectivity). The only allowed value for now is
13254 /// "ALL_IPV4_RANGES".
13255 pub include_import_ranges: std::vec::Vec<std::string::String>,
13256
13257 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13258}
13259
13260impl LinkedVpnTunnels {
13261 pub fn new() -> Self {
13262 std::default::Default::default()
13263 }
13264
13265 /// Sets the value of [uris][crate::model::LinkedVpnTunnels::uris].
13266 ///
13267 /// # Example
13268 /// ```ignore,no_run
13269 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13270 /// let x = LinkedVpnTunnels::new().set_uris(["a", "b", "c"]);
13271 /// ```
13272 pub fn set_uris<T, V>(mut self, v: T) -> Self
13273 where
13274 T: std::iter::IntoIterator<Item = V>,
13275 V: std::convert::Into<std::string::String>,
13276 {
13277 use std::iter::Iterator;
13278 self.uris = v.into_iter().map(|i| i.into()).collect();
13279 self
13280 }
13281
13282 /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedVpnTunnels::site_to_site_data_transfer].
13283 ///
13284 /// # Example
13285 /// ```ignore,no_run
13286 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13287 /// let x = LinkedVpnTunnels::new().set_site_to_site_data_transfer(true);
13288 /// ```
13289 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13290 self.site_to_site_data_transfer = v.into();
13291 self
13292 }
13293
13294 /// Sets the value of [vpc_network][crate::model::LinkedVpnTunnels::vpc_network].
13295 ///
13296 /// # Example
13297 /// ```ignore,no_run
13298 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13299 /// let x = LinkedVpnTunnels::new().set_vpc_network("example");
13300 /// ```
13301 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13302 self.vpc_network = v.into();
13303 self
13304 }
13305
13306 /// Sets the value of [include_import_ranges][crate::model::LinkedVpnTunnels::include_import_ranges].
13307 ///
13308 /// # Example
13309 /// ```ignore,no_run
13310 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13311 /// let x = LinkedVpnTunnels::new().set_include_import_ranges(["a", "b", "c"]);
13312 /// ```
13313 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13314 where
13315 T: std::iter::IntoIterator<Item = V>,
13316 V: std::convert::Into<std::string::String>,
13317 {
13318 use std::iter::Iterator;
13319 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13320 self
13321 }
13322}
13323
13324impl wkt::message::Message for LinkedVpnTunnels {
13325 fn typename() -> &'static str {
13326 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"
13327 }
13328}
13329
13330/// A collection of VLAN attachment resources. These resources should
13331/// be redundant attachments that all advertise the same prefixes to Google
13332/// Cloud. Alternatively, in active/passive configurations, all attachments
13333/// should be capable of advertising the same prefixes.
13334#[derive(Clone, Default, PartialEq)]
13335#[non_exhaustive]
13336pub struct LinkedInterconnectAttachments {
13337 /// The URIs of linked interconnect attachment resources
13338 pub uris: std::vec::Vec<std::string::String>,
13339
13340 /// A value that controls whether site-to-site data transfer is enabled for
13341 /// these resources. Data transfer is available only in [supported
13342 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13343 pub site_to_site_data_transfer: bool,
13344
13345 /// Output only. The VPC network where these VLAN attachments are located.
13346 pub vpc_network: std::string::String,
13347
13348 /// Optional. IP ranges allowed to be included during import from hub (does not
13349 /// control transit connectivity). The only allowed value for now is
13350 /// "ALL_IPV4_RANGES".
13351 pub include_import_ranges: std::vec::Vec<std::string::String>,
13352
13353 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13354}
13355
13356impl LinkedInterconnectAttachments {
13357 pub fn new() -> Self {
13358 std::default::Default::default()
13359 }
13360
13361 /// Sets the value of [uris][crate::model::LinkedInterconnectAttachments::uris].
13362 ///
13363 /// # Example
13364 /// ```ignore,no_run
13365 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13366 /// let x = LinkedInterconnectAttachments::new().set_uris(["a", "b", "c"]);
13367 /// ```
13368 pub fn set_uris<T, V>(mut self, v: T) -> Self
13369 where
13370 T: std::iter::IntoIterator<Item = V>,
13371 V: std::convert::Into<std::string::String>,
13372 {
13373 use std::iter::Iterator;
13374 self.uris = v.into_iter().map(|i| i.into()).collect();
13375 self
13376 }
13377
13378 /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedInterconnectAttachments::site_to_site_data_transfer].
13379 ///
13380 /// # Example
13381 /// ```ignore,no_run
13382 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13383 /// let x = LinkedInterconnectAttachments::new().set_site_to_site_data_transfer(true);
13384 /// ```
13385 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13386 self.site_to_site_data_transfer = v.into();
13387 self
13388 }
13389
13390 /// Sets the value of [vpc_network][crate::model::LinkedInterconnectAttachments::vpc_network].
13391 ///
13392 /// # Example
13393 /// ```ignore,no_run
13394 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13395 /// let x = LinkedInterconnectAttachments::new().set_vpc_network("example");
13396 /// ```
13397 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13398 self.vpc_network = v.into();
13399 self
13400 }
13401
13402 /// Sets the value of [include_import_ranges][crate::model::LinkedInterconnectAttachments::include_import_ranges].
13403 ///
13404 /// # Example
13405 /// ```ignore,no_run
13406 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13407 /// let x = LinkedInterconnectAttachments::new().set_include_import_ranges(["a", "b", "c"]);
13408 /// ```
13409 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13410 where
13411 T: std::iter::IntoIterator<Item = V>,
13412 V: std::convert::Into<std::string::String>,
13413 {
13414 use std::iter::Iterator;
13415 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13416 self
13417 }
13418}
13419
13420impl wkt::message::Message for LinkedInterconnectAttachments {
13421 fn typename() -> &'static str {
13422 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"
13423 }
13424}
13425
13426/// A collection of router appliance instances. If you configure multiple router
13427/// appliance instances to receive data from the same set of sites outside of
13428/// Google Cloud, we recommend that you associate those instances with the same
13429/// spoke.
13430#[derive(Clone, Default, PartialEq)]
13431#[non_exhaustive]
13432pub struct LinkedRouterApplianceInstances {
13433 /// The list of router appliance instances.
13434 pub instances: std::vec::Vec<crate::model::RouterApplianceInstance>,
13435
13436 /// A value that controls whether site-to-site data transfer is enabled for
13437 /// these resources. Data transfer is available only in [supported
13438 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13439 pub site_to_site_data_transfer: bool,
13440
13441 /// Output only. The VPC network where these router appliance instances are
13442 /// located.
13443 pub vpc_network: std::string::String,
13444
13445 /// Optional. IP ranges allowed to be included during import from hub (does not
13446 /// control transit connectivity). The only allowed value for now is
13447 /// "ALL_IPV4_RANGES".
13448 pub include_import_ranges: std::vec::Vec<std::string::String>,
13449
13450 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13451}
13452
13453impl LinkedRouterApplianceInstances {
13454 pub fn new() -> Self {
13455 std::default::Default::default()
13456 }
13457
13458 /// Sets the value of [instances][crate::model::LinkedRouterApplianceInstances::instances].
13459 ///
13460 /// # Example
13461 /// ```ignore,no_run
13462 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13463 /// use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
13464 /// let x = LinkedRouterApplianceInstances::new()
13465 /// .set_instances([
13466 /// RouterApplianceInstance::default()/* use setters */,
13467 /// RouterApplianceInstance::default()/* use (different) setters */,
13468 /// ]);
13469 /// ```
13470 pub fn set_instances<T, V>(mut self, v: T) -> Self
13471 where
13472 T: std::iter::IntoIterator<Item = V>,
13473 V: std::convert::Into<crate::model::RouterApplianceInstance>,
13474 {
13475 use std::iter::Iterator;
13476 self.instances = v.into_iter().map(|i| i.into()).collect();
13477 self
13478 }
13479
13480 /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedRouterApplianceInstances::site_to_site_data_transfer].
13481 ///
13482 /// # Example
13483 /// ```ignore,no_run
13484 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13485 /// let x = LinkedRouterApplianceInstances::new().set_site_to_site_data_transfer(true);
13486 /// ```
13487 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13488 self.site_to_site_data_transfer = v.into();
13489 self
13490 }
13491
13492 /// Sets the value of [vpc_network][crate::model::LinkedRouterApplianceInstances::vpc_network].
13493 ///
13494 /// # Example
13495 /// ```ignore,no_run
13496 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13497 /// let x = LinkedRouterApplianceInstances::new().set_vpc_network("example");
13498 /// ```
13499 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13500 self.vpc_network = v.into();
13501 self
13502 }
13503
13504 /// Sets the value of [include_import_ranges][crate::model::LinkedRouterApplianceInstances::include_import_ranges].
13505 ///
13506 /// # Example
13507 /// ```ignore,no_run
13508 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13509 /// let x = LinkedRouterApplianceInstances::new().set_include_import_ranges(["a", "b", "c"]);
13510 /// ```
13511 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13512 where
13513 T: std::iter::IntoIterator<Item = V>,
13514 V: std::convert::Into<std::string::String>,
13515 {
13516 use std::iter::Iterator;
13517 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13518 self
13519 }
13520}
13521
13522impl wkt::message::Message for LinkedRouterApplianceInstances {
13523 fn typename() -> &'static str {
13524 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"
13525 }
13526}
13527
13528/// An existing VPC network.
13529#[derive(Clone, Default, PartialEq)]
13530#[non_exhaustive]
13531pub struct LinkedVpcNetwork {
13532 /// Required. The URI of the VPC network resource.
13533 pub uri: std::string::String,
13534
13535 /// Optional. IP ranges encompassing the subnets to be excluded from peering.
13536 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
13537
13538 /// Optional. IP ranges allowed to be included from peering.
13539 pub include_export_ranges: std::vec::Vec<std::string::String>,
13540
13541 /// Optional. The proposed include export IP ranges waiting for hub
13542 /// administration's approval.
13543 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
13544
13545 /// Output only. The proposed exclude export IP ranges waiting for hub
13546 /// administration's approval.
13547 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
13548
13549 /// Output only. The list of Producer VPC spokes that this VPC spoke is a
13550 /// service consumer VPC spoke for. These producer VPCs are connected through
13551 /// VPC peering to this spoke's backing VPC network. Because they are directly
13552 /// connected throuh VPC peering, NCC export filters do not apply between the
13553 /// service consumer VPC spoke and any of its producer VPC spokes. This VPC
13554 /// spoke cannot be deleted as long as any of these producer VPC spokes are
13555 /// connected to the NCC Hub.
13556 pub producer_vpc_spokes: std::vec::Vec<std::string::String>,
13557
13558 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13559}
13560
13561impl LinkedVpcNetwork {
13562 pub fn new() -> Self {
13563 std::default::Default::default()
13564 }
13565
13566 /// Sets the value of [uri][crate::model::LinkedVpcNetwork::uri].
13567 ///
13568 /// # Example
13569 /// ```ignore,no_run
13570 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13571 /// let x = LinkedVpcNetwork::new().set_uri("example");
13572 /// ```
13573 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13574 self.uri = v.into();
13575 self
13576 }
13577
13578 /// Sets the value of [exclude_export_ranges][crate::model::LinkedVpcNetwork::exclude_export_ranges].
13579 ///
13580 /// # Example
13581 /// ```ignore,no_run
13582 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13583 /// let x = LinkedVpcNetwork::new().set_exclude_export_ranges(["a", "b", "c"]);
13584 /// ```
13585 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13586 where
13587 T: std::iter::IntoIterator<Item = V>,
13588 V: std::convert::Into<std::string::String>,
13589 {
13590 use std::iter::Iterator;
13591 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13592 self
13593 }
13594
13595 /// Sets the value of [include_export_ranges][crate::model::LinkedVpcNetwork::include_export_ranges].
13596 ///
13597 /// # Example
13598 /// ```ignore,no_run
13599 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13600 /// let x = LinkedVpcNetwork::new().set_include_export_ranges(["a", "b", "c"]);
13601 /// ```
13602 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
13603 where
13604 T: std::iter::IntoIterator<Item = V>,
13605 V: std::convert::Into<std::string::String>,
13606 {
13607 use std::iter::Iterator;
13608 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13609 self
13610 }
13611
13612 /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedVpcNetwork::proposed_include_export_ranges].
13613 ///
13614 /// # Example
13615 /// ```ignore,no_run
13616 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13617 /// let x = LinkedVpcNetwork::new().set_proposed_include_export_ranges(["a", "b", "c"]);
13618 /// ```
13619 pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
13620 where
13621 T: std::iter::IntoIterator<Item = V>,
13622 V: std::convert::Into<std::string::String>,
13623 {
13624 use std::iter::Iterator;
13625 self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13626 self
13627 }
13628
13629 /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedVpcNetwork::proposed_exclude_export_ranges].
13630 ///
13631 /// # Example
13632 /// ```ignore,no_run
13633 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13634 /// let x = LinkedVpcNetwork::new().set_proposed_exclude_export_ranges(["a", "b", "c"]);
13635 /// ```
13636 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13637 where
13638 T: std::iter::IntoIterator<Item = V>,
13639 V: std::convert::Into<std::string::String>,
13640 {
13641 use std::iter::Iterator;
13642 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13643 self
13644 }
13645
13646 /// Sets the value of [producer_vpc_spokes][crate::model::LinkedVpcNetwork::producer_vpc_spokes].
13647 ///
13648 /// # Example
13649 /// ```ignore,no_run
13650 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13651 /// let x = LinkedVpcNetwork::new().set_producer_vpc_spokes(["a", "b", "c"]);
13652 /// ```
13653 pub fn set_producer_vpc_spokes<T, V>(mut self, v: T) -> Self
13654 where
13655 T: std::iter::IntoIterator<Item = V>,
13656 V: std::convert::Into<std::string::String>,
13657 {
13658 use std::iter::Iterator;
13659 self.producer_vpc_spokes = v.into_iter().map(|i| i.into()).collect();
13660 self
13661 }
13662}
13663
13664impl wkt::message::Message for LinkedVpcNetwork {
13665 fn typename() -> &'static str {
13666 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"
13667 }
13668}
13669
13670#[derive(Clone, Default, PartialEq)]
13671#[non_exhaustive]
13672pub struct LinkedProducerVpcNetwork {
13673 /// Immutable. The URI of the Service Consumer VPC that the Producer VPC is
13674 /// peered with.
13675 pub network: std::string::String,
13676
13677 /// Output only. The Service Consumer Network spoke.
13678 pub service_consumer_vpc_spoke: std::string::String,
13679
13680 /// Immutable. The name of the VPC peering between the Service Consumer VPC and
13681 /// the Producer VPC (defined in the Tenant project) which is added to the NCC
13682 /// hub. This peering must be in ACTIVE state.
13683 pub peering: std::string::String,
13684
13685 /// Output only. The URI of the Producer VPC.
13686 pub producer_network: std::string::String,
13687
13688 /// Optional. IP ranges encompassing the subnets to be excluded from peering.
13689 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
13690
13691 /// Optional. IP ranges allowed to be included from peering.
13692 pub include_export_ranges: std::vec::Vec<std::string::String>,
13693
13694 /// Optional. The proposed include export IP ranges waiting for hub
13695 /// administration's approval.
13696 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
13697
13698 /// Output only. The proposed exclude export IP ranges waiting for hub
13699 /// administration's approval.
13700 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
13701
13702 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13703}
13704
13705impl LinkedProducerVpcNetwork {
13706 pub fn new() -> Self {
13707 std::default::Default::default()
13708 }
13709
13710 /// Sets the value of [network][crate::model::LinkedProducerVpcNetwork::network].
13711 ///
13712 /// # Example
13713 /// ```ignore,no_run
13714 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13715 /// let x = LinkedProducerVpcNetwork::new().set_network("example");
13716 /// ```
13717 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13718 self.network = v.into();
13719 self
13720 }
13721
13722 /// Sets the value of [service_consumer_vpc_spoke][crate::model::LinkedProducerVpcNetwork::service_consumer_vpc_spoke].
13723 ///
13724 /// # Example
13725 /// ```ignore,no_run
13726 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13727 /// let x = LinkedProducerVpcNetwork::new().set_service_consumer_vpc_spoke("example");
13728 /// ```
13729 pub fn set_service_consumer_vpc_spoke<T: std::convert::Into<std::string::String>>(
13730 mut self,
13731 v: T,
13732 ) -> Self {
13733 self.service_consumer_vpc_spoke = v.into();
13734 self
13735 }
13736
13737 /// Sets the value of [peering][crate::model::LinkedProducerVpcNetwork::peering].
13738 ///
13739 /// # Example
13740 /// ```ignore,no_run
13741 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13742 /// let x = LinkedProducerVpcNetwork::new().set_peering("example");
13743 /// ```
13744 pub fn set_peering<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13745 self.peering = v.into();
13746 self
13747 }
13748
13749 /// Sets the value of [producer_network][crate::model::LinkedProducerVpcNetwork::producer_network].
13750 ///
13751 /// # Example
13752 /// ```ignore,no_run
13753 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13754 /// let x = LinkedProducerVpcNetwork::new().set_producer_network("example");
13755 /// ```
13756 pub fn set_producer_network<T: std::convert::Into<std::string::String>>(
13757 mut self,
13758 v: T,
13759 ) -> Self {
13760 self.producer_network = v.into();
13761 self
13762 }
13763
13764 /// Sets the value of [exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::exclude_export_ranges].
13765 ///
13766 /// # Example
13767 /// ```ignore,no_run
13768 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13769 /// let x = LinkedProducerVpcNetwork::new().set_exclude_export_ranges(["a", "b", "c"]);
13770 /// ```
13771 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13772 where
13773 T: std::iter::IntoIterator<Item = V>,
13774 V: std::convert::Into<std::string::String>,
13775 {
13776 use std::iter::Iterator;
13777 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13778 self
13779 }
13780
13781 /// Sets the value of [include_export_ranges][crate::model::LinkedProducerVpcNetwork::include_export_ranges].
13782 ///
13783 /// # Example
13784 /// ```ignore,no_run
13785 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13786 /// let x = LinkedProducerVpcNetwork::new().set_include_export_ranges(["a", "b", "c"]);
13787 /// ```
13788 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
13789 where
13790 T: std::iter::IntoIterator<Item = V>,
13791 V: std::convert::Into<std::string::String>,
13792 {
13793 use std::iter::Iterator;
13794 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13795 self
13796 }
13797
13798 /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_include_export_ranges].
13799 ///
13800 /// # Example
13801 /// ```ignore,no_run
13802 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13803 /// let x = LinkedProducerVpcNetwork::new().set_proposed_include_export_ranges(["a", "b", "c"]);
13804 /// ```
13805 pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
13806 where
13807 T: std::iter::IntoIterator<Item = V>,
13808 V: std::convert::Into<std::string::String>,
13809 {
13810 use std::iter::Iterator;
13811 self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13812 self
13813 }
13814
13815 /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_exclude_export_ranges].
13816 ///
13817 /// # Example
13818 /// ```ignore,no_run
13819 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13820 /// let x = LinkedProducerVpcNetwork::new().set_proposed_exclude_export_ranges(["a", "b", "c"]);
13821 /// ```
13822 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13823 where
13824 T: std::iter::IntoIterator<Item = V>,
13825 V: std::convert::Into<std::string::String>,
13826 {
13827 use std::iter::Iterator;
13828 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13829 self
13830 }
13831}
13832
13833impl wkt::message::Message for LinkedProducerVpcNetwork {
13834 fn typename() -> &'static str {
13835 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedProducerVpcNetwork"
13836 }
13837}
13838
13839/// A router appliance instance is a Compute Engine virtual machine (VM) instance
13840/// that acts as a BGP speaker. A router appliance instance is specified by the
13841/// URI of the VM and the internal IP address of one of the VM's network
13842/// interfaces.
13843#[derive(Clone, Default, PartialEq)]
13844#[non_exhaustive]
13845pub struct RouterApplianceInstance {
13846 /// The URI of the VM.
13847 pub virtual_machine: std::string::String,
13848
13849 /// The IP address on the VM to use for peering.
13850 pub ip_address: std::string::String,
13851
13852 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13853}
13854
13855impl RouterApplianceInstance {
13856 pub fn new() -> Self {
13857 std::default::Default::default()
13858 }
13859
13860 /// Sets the value of [virtual_machine][crate::model::RouterApplianceInstance::virtual_machine].
13861 ///
13862 /// # Example
13863 /// ```ignore,no_run
13864 /// # use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
13865 /// let x = RouterApplianceInstance::new().set_virtual_machine("example");
13866 /// ```
13867 pub fn set_virtual_machine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13868 self.virtual_machine = v.into();
13869 self
13870 }
13871
13872 /// Sets the value of [ip_address][crate::model::RouterApplianceInstance::ip_address].
13873 ///
13874 /// # Example
13875 /// ```ignore,no_run
13876 /// # use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
13877 /// let x = RouterApplianceInstance::new().set_ip_address("example");
13878 /// ```
13879 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13880 self.ip_address = v.into();
13881 self
13882 }
13883}
13884
13885impl wkt::message::Message for RouterApplianceInstance {
13886 fn typename() -> &'static str {
13887 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouterApplianceInstance"
13888 }
13889}
13890
13891/// Metadata about locations
13892#[derive(Clone, Default, PartialEq)]
13893#[non_exhaustive]
13894pub struct LocationMetadata {
13895 /// List of supported features
13896 pub location_features: std::vec::Vec<crate::model::LocationFeature>,
13897
13898 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13899}
13900
13901impl LocationMetadata {
13902 pub fn new() -> Self {
13903 std::default::Default::default()
13904 }
13905
13906 /// Sets the value of [location_features][crate::model::LocationMetadata::location_features].
13907 ///
13908 /// # Example
13909 /// ```ignore,no_run
13910 /// # use google_cloud_networkconnectivity_v1::model::LocationMetadata;
13911 /// use google_cloud_networkconnectivity_v1::model::LocationFeature;
13912 /// let x = LocationMetadata::new().set_location_features([
13913 /// LocationFeature::SiteToCloudSpokes,
13914 /// LocationFeature::SiteToSiteSpokes,
13915 /// ]);
13916 /// ```
13917 pub fn set_location_features<T, V>(mut self, v: T) -> Self
13918 where
13919 T: std::iter::IntoIterator<Item = V>,
13920 V: std::convert::Into<crate::model::LocationFeature>,
13921 {
13922 use std::iter::Iterator;
13923 self.location_features = v.into_iter().map(|i| i.into()).collect();
13924 self
13925 }
13926}
13927
13928impl wkt::message::Message for LocationMetadata {
13929 fn typename() -> &'static str {
13930 "type.googleapis.com/google.cloud.networkconnectivity.v1.LocationMetadata"
13931 }
13932}
13933
13934#[derive(Clone, Default, PartialEq)]
13935#[non_exhaustive]
13936pub struct NextHopVpcNetwork {
13937 /// The URI of the VPC network resource
13938 pub uri: std::string::String,
13939
13940 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13941}
13942
13943impl NextHopVpcNetwork {
13944 pub fn new() -> Self {
13945 std::default::Default::default()
13946 }
13947
13948 /// Sets the value of [uri][crate::model::NextHopVpcNetwork::uri].
13949 ///
13950 /// # Example
13951 /// ```ignore,no_run
13952 /// # use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
13953 /// let x = NextHopVpcNetwork::new().set_uri("example");
13954 /// ```
13955 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13956 self.uri = v.into();
13957 self
13958 }
13959}
13960
13961impl wkt::message::Message for NextHopVpcNetwork {
13962 fn typename() -> &'static str {
13963 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"
13964 }
13965}
13966
13967/// A route next hop that leads to a VPN tunnel resource.
13968#[derive(Clone, Default, PartialEq)]
13969#[non_exhaustive]
13970pub struct NextHopVPNTunnel {
13971 /// The URI of the VPN tunnel resource.
13972 pub uri: std::string::String,
13973
13974 /// The VPC network where this VPN tunnel is located.
13975 pub vpc_network: std::string::String,
13976
13977 /// Indicates whether site-to-site data transfer is allowed for this VPN tunnel
13978 /// resource. Data transfer is available only in [supported
13979 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13980 pub site_to_site_data_transfer: bool,
13981
13982 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13983}
13984
13985impl NextHopVPNTunnel {
13986 pub fn new() -> Self {
13987 std::default::Default::default()
13988 }
13989
13990 /// Sets the value of [uri][crate::model::NextHopVPNTunnel::uri].
13991 ///
13992 /// # Example
13993 /// ```ignore,no_run
13994 /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
13995 /// let x = NextHopVPNTunnel::new().set_uri("example");
13996 /// ```
13997 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13998 self.uri = v.into();
13999 self
14000 }
14001
14002 /// Sets the value of [vpc_network][crate::model::NextHopVPNTunnel::vpc_network].
14003 ///
14004 /// # Example
14005 /// ```ignore,no_run
14006 /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
14007 /// let x = NextHopVPNTunnel::new().set_vpc_network("example");
14008 /// ```
14009 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14010 self.vpc_network = v.into();
14011 self
14012 }
14013
14014 /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopVPNTunnel::site_to_site_data_transfer].
14015 ///
14016 /// # Example
14017 /// ```ignore,no_run
14018 /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
14019 /// let x = NextHopVPNTunnel::new().set_site_to_site_data_transfer(true);
14020 /// ```
14021 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14022 self.site_to_site_data_transfer = v.into();
14023 self
14024 }
14025}
14026
14027impl wkt::message::Message for NextHopVPNTunnel {
14028 fn typename() -> &'static str {
14029 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVPNTunnel"
14030 }
14031}
14032
14033/// A route next hop that leads to a Router appliance instance.
14034#[derive(Clone, Default, PartialEq)]
14035#[non_exhaustive]
14036pub struct NextHopRouterApplianceInstance {
14037 /// The URI of the Router appliance instance.
14038 pub uri: std::string::String,
14039
14040 /// The VPC network where this VM is located.
14041 pub vpc_network: std::string::String,
14042
14043 /// Indicates whether site-to-site data transfer is allowed for this Router
14044 /// appliance instance resource. Data transfer is available only in [supported
14045 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
14046 pub site_to_site_data_transfer: bool,
14047
14048 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14049}
14050
14051impl NextHopRouterApplianceInstance {
14052 pub fn new() -> Self {
14053 std::default::Default::default()
14054 }
14055
14056 /// Sets the value of [uri][crate::model::NextHopRouterApplianceInstance::uri].
14057 ///
14058 /// # Example
14059 /// ```ignore,no_run
14060 /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14061 /// let x = NextHopRouterApplianceInstance::new().set_uri("example");
14062 /// ```
14063 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14064 self.uri = v.into();
14065 self
14066 }
14067
14068 /// Sets the value of [vpc_network][crate::model::NextHopRouterApplianceInstance::vpc_network].
14069 ///
14070 /// # Example
14071 /// ```ignore,no_run
14072 /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14073 /// let x = NextHopRouterApplianceInstance::new().set_vpc_network("example");
14074 /// ```
14075 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14076 self.vpc_network = v.into();
14077 self
14078 }
14079
14080 /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopRouterApplianceInstance::site_to_site_data_transfer].
14081 ///
14082 /// # Example
14083 /// ```ignore,no_run
14084 /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14085 /// let x = NextHopRouterApplianceInstance::new().set_site_to_site_data_transfer(true);
14086 /// ```
14087 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14088 self.site_to_site_data_transfer = v.into();
14089 self
14090 }
14091}
14092
14093impl wkt::message::Message for NextHopRouterApplianceInstance {
14094 fn typename() -> &'static str {
14095 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance"
14096 }
14097}
14098
14099/// A route next hop that leads to an interconnect attachment resource.
14100#[derive(Clone, Default, PartialEq)]
14101#[non_exhaustive]
14102pub struct NextHopInterconnectAttachment {
14103 /// The URI of the interconnect attachment resource.
14104 pub uri: std::string::String,
14105
14106 /// The VPC network where this interconnect attachment is located.
14107 pub vpc_network: std::string::String,
14108
14109 /// Indicates whether site-to-site data transfer is allowed for this
14110 /// interconnect attachment resource. Data transfer is available only in
14111 /// [supported
14112 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
14113 pub site_to_site_data_transfer: bool,
14114
14115 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14116}
14117
14118impl NextHopInterconnectAttachment {
14119 pub fn new() -> Self {
14120 std::default::Default::default()
14121 }
14122
14123 /// Sets the value of [uri][crate::model::NextHopInterconnectAttachment::uri].
14124 ///
14125 /// # Example
14126 /// ```ignore,no_run
14127 /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14128 /// let x = NextHopInterconnectAttachment::new().set_uri("example");
14129 /// ```
14130 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14131 self.uri = v.into();
14132 self
14133 }
14134
14135 /// Sets the value of [vpc_network][crate::model::NextHopInterconnectAttachment::vpc_network].
14136 ///
14137 /// # Example
14138 /// ```ignore,no_run
14139 /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14140 /// let x = NextHopInterconnectAttachment::new().set_vpc_network("example");
14141 /// ```
14142 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14143 self.vpc_network = v.into();
14144 self
14145 }
14146
14147 /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopInterconnectAttachment::site_to_site_data_transfer].
14148 ///
14149 /// # Example
14150 /// ```ignore,no_run
14151 /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14152 /// let x = NextHopInterconnectAttachment::new().set_site_to_site_data_transfer(true);
14153 /// ```
14154 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14155 self.site_to_site_data_transfer = v.into();
14156 self
14157 }
14158}
14159
14160impl wkt::message::Message for NextHopInterconnectAttachment {
14161 fn typename() -> &'static str {
14162 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopInterconnectAttachment"
14163 }
14164}
14165
14166/// Summarizes information about the spokes associated with a hub.
14167/// The summary includes a count of spokes according to type
14168/// and according to state. If any spokes are inactive,
14169/// the summary also lists the reasons they are inactive,
14170/// including a count for each reason.
14171#[derive(Clone, Default, PartialEq)]
14172#[non_exhaustive]
14173pub struct SpokeSummary {
14174 /// Output only. Counts the number of spokes of each type that are
14175 /// associated with a specific hub.
14176 pub spoke_type_counts: std::vec::Vec<crate::model::spoke_summary::SpokeTypeCount>,
14177
14178 /// Output only. Counts the number of spokes that are in each state
14179 /// and associated with a given hub.
14180 pub spoke_state_counts: std::vec::Vec<crate::model::spoke_summary::SpokeStateCount>,
14181
14182 /// Output only. Counts the number of spokes that are inactive for each
14183 /// possible reason and associated with a given hub.
14184 pub spoke_state_reason_counts:
14185 std::vec::Vec<crate::model::spoke_summary::SpokeStateReasonCount>,
14186
14187 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14188}
14189
14190impl SpokeSummary {
14191 pub fn new() -> Self {
14192 std::default::Default::default()
14193 }
14194
14195 /// Sets the value of [spoke_type_counts][crate::model::SpokeSummary::spoke_type_counts].
14196 ///
14197 /// # Example
14198 /// ```ignore,no_run
14199 /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14200 /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14201 /// let x = SpokeSummary::new()
14202 /// .set_spoke_type_counts([
14203 /// SpokeTypeCount::default()/* use setters */,
14204 /// SpokeTypeCount::default()/* use (different) setters */,
14205 /// ]);
14206 /// ```
14207 pub fn set_spoke_type_counts<T, V>(mut self, v: T) -> Self
14208 where
14209 T: std::iter::IntoIterator<Item = V>,
14210 V: std::convert::Into<crate::model::spoke_summary::SpokeTypeCount>,
14211 {
14212 use std::iter::Iterator;
14213 self.spoke_type_counts = v.into_iter().map(|i| i.into()).collect();
14214 self
14215 }
14216
14217 /// Sets the value of [spoke_state_counts][crate::model::SpokeSummary::spoke_state_counts].
14218 ///
14219 /// # Example
14220 /// ```ignore,no_run
14221 /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14222 /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14223 /// let x = SpokeSummary::new()
14224 /// .set_spoke_state_counts([
14225 /// SpokeStateCount::default()/* use setters */,
14226 /// SpokeStateCount::default()/* use (different) setters */,
14227 /// ]);
14228 /// ```
14229 pub fn set_spoke_state_counts<T, V>(mut self, v: T) -> Self
14230 where
14231 T: std::iter::IntoIterator<Item = V>,
14232 V: std::convert::Into<crate::model::spoke_summary::SpokeStateCount>,
14233 {
14234 use std::iter::Iterator;
14235 self.spoke_state_counts = v.into_iter().map(|i| i.into()).collect();
14236 self
14237 }
14238
14239 /// Sets the value of [spoke_state_reason_counts][crate::model::SpokeSummary::spoke_state_reason_counts].
14240 ///
14241 /// # Example
14242 /// ```ignore,no_run
14243 /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14244 /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14245 /// let x = SpokeSummary::new()
14246 /// .set_spoke_state_reason_counts([
14247 /// SpokeStateReasonCount::default()/* use setters */,
14248 /// SpokeStateReasonCount::default()/* use (different) setters */,
14249 /// ]);
14250 /// ```
14251 pub fn set_spoke_state_reason_counts<T, V>(mut self, v: T) -> Self
14252 where
14253 T: std::iter::IntoIterator<Item = V>,
14254 V: std::convert::Into<crate::model::spoke_summary::SpokeStateReasonCount>,
14255 {
14256 use std::iter::Iterator;
14257 self.spoke_state_reason_counts = v.into_iter().map(|i| i.into()).collect();
14258 self
14259 }
14260}
14261
14262impl wkt::message::Message for SpokeSummary {
14263 fn typename() -> &'static str {
14264 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary"
14265 }
14266}
14267
14268/// Defines additional types related to [SpokeSummary].
14269pub mod spoke_summary {
14270 #[allow(unused_imports)]
14271 use super::*;
14272
14273 /// The number of spokes of a given type that are associated
14274 /// with a specific hub. The type indicates what kind of
14275 /// resource is associated with the spoke.
14276 #[derive(Clone, Default, PartialEq)]
14277 #[non_exhaustive]
14278 pub struct SpokeTypeCount {
14279 /// Output only. The type of the spokes.
14280 pub spoke_type: crate::model::SpokeType,
14281
14282 /// Output only. The total number of spokes of this type that are
14283 /// associated with the hub.
14284 pub count: i64,
14285
14286 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14287 }
14288
14289 impl SpokeTypeCount {
14290 pub fn new() -> Self {
14291 std::default::Default::default()
14292 }
14293
14294 /// Sets the value of [spoke_type][crate::model::spoke_summary::SpokeTypeCount::spoke_type].
14295 ///
14296 /// # Example
14297 /// ```ignore,no_run
14298 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14299 /// use google_cloud_networkconnectivity_v1::model::SpokeType;
14300 /// let x0 = SpokeTypeCount::new().set_spoke_type(SpokeType::VpnTunnel);
14301 /// let x1 = SpokeTypeCount::new().set_spoke_type(SpokeType::InterconnectAttachment);
14302 /// let x2 = SpokeTypeCount::new().set_spoke_type(SpokeType::RouterAppliance);
14303 /// ```
14304 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(
14305 mut self,
14306 v: T,
14307 ) -> Self {
14308 self.spoke_type = v.into();
14309 self
14310 }
14311
14312 /// Sets the value of [count][crate::model::spoke_summary::SpokeTypeCount::count].
14313 ///
14314 /// # Example
14315 /// ```ignore,no_run
14316 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14317 /// let x = SpokeTypeCount::new().set_count(42);
14318 /// ```
14319 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14320 self.count = v.into();
14321 self
14322 }
14323 }
14324
14325 impl wkt::message::Message for SpokeTypeCount {
14326 fn typename() -> &'static str {
14327 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"
14328 }
14329 }
14330
14331 /// The number of spokes that are in a particular state
14332 /// and associated with a given hub.
14333 #[derive(Clone, Default, PartialEq)]
14334 #[non_exhaustive]
14335 pub struct SpokeStateCount {
14336 /// Output only. The state of the spokes.
14337 pub state: crate::model::State,
14338
14339 /// Output only. The total number of spokes that are in this state
14340 /// and associated with a given hub.
14341 pub count: i64,
14342
14343 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14344 }
14345
14346 impl SpokeStateCount {
14347 pub fn new() -> Self {
14348 std::default::Default::default()
14349 }
14350
14351 /// Sets the value of [state][crate::model::spoke_summary::SpokeStateCount::state].
14352 ///
14353 /// # Example
14354 /// ```ignore,no_run
14355 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14356 /// use google_cloud_networkconnectivity_v1::model::State;
14357 /// let x0 = SpokeStateCount::new().set_state(State::Creating);
14358 /// let x1 = SpokeStateCount::new().set_state(State::Active);
14359 /// let x2 = SpokeStateCount::new().set_state(State::Deleting);
14360 /// ```
14361 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
14362 self.state = v.into();
14363 self
14364 }
14365
14366 /// Sets the value of [count][crate::model::spoke_summary::SpokeStateCount::count].
14367 ///
14368 /// # Example
14369 /// ```ignore,no_run
14370 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14371 /// let x = SpokeStateCount::new().set_count(42);
14372 /// ```
14373 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14374 self.count = v.into();
14375 self
14376 }
14377 }
14378
14379 impl wkt::message::Message for SpokeStateCount {
14380 fn typename() -> &'static str {
14381 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"
14382 }
14383 }
14384
14385 /// The number of spokes in the hub that are inactive for this reason.
14386 #[derive(Clone, Default, PartialEq)]
14387 #[non_exhaustive]
14388 pub struct SpokeStateReasonCount {
14389 /// Output only. The reason that a spoke is inactive.
14390 pub state_reason_code: crate::model::spoke::state_reason::Code,
14391
14392 /// Output only. The total number of spokes that are inactive for a
14393 /// particular reason and associated with a given hub.
14394 pub count: i64,
14395
14396 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14397 }
14398
14399 impl SpokeStateReasonCount {
14400 pub fn new() -> Self {
14401 std::default::Default::default()
14402 }
14403
14404 /// Sets the value of [state_reason_code][crate::model::spoke_summary::SpokeStateReasonCount::state_reason_code].
14405 ///
14406 /// # Example
14407 /// ```ignore,no_run
14408 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14409 /// use google_cloud_networkconnectivity_v1::model::spoke::state_reason::Code;
14410 /// let x0 = SpokeStateReasonCount::new().set_state_reason_code(Code::PendingReview);
14411 /// let x1 = SpokeStateReasonCount::new().set_state_reason_code(Code::Rejected);
14412 /// let x2 = SpokeStateReasonCount::new().set_state_reason_code(Code::Paused);
14413 /// ```
14414 pub fn set_state_reason_code<
14415 T: std::convert::Into<crate::model::spoke::state_reason::Code>,
14416 >(
14417 mut self,
14418 v: T,
14419 ) -> Self {
14420 self.state_reason_code = v.into();
14421 self
14422 }
14423
14424 /// Sets the value of [count][crate::model::spoke_summary::SpokeStateReasonCount::count].
14425 ///
14426 /// # Example
14427 /// ```ignore,no_run
14428 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14429 /// let x = SpokeStateReasonCount::new().set_count(42);
14430 /// ```
14431 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14432 self.count = v.into();
14433 self
14434 }
14435 }
14436
14437 impl wkt::message::Message for SpokeStateReasonCount {
14438 fn typename() -> &'static str {
14439 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"
14440 }
14441 }
14442}
14443
14444/// The request for
14445/// [HubService.GetGroup][google.cloud.networkconnectivity.v1.HubService.GetGroup].
14446///
14447/// [google.cloud.networkconnectivity.v1.HubService.GetGroup]: crate::client::HubService::get_group
14448#[derive(Clone, Default, PartialEq)]
14449#[non_exhaustive]
14450pub struct GetGroupRequest {
14451 /// Required. The name of the route table resource.
14452 pub name: std::string::String,
14453
14454 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14455}
14456
14457impl GetGroupRequest {
14458 pub fn new() -> Self {
14459 std::default::Default::default()
14460 }
14461
14462 /// Sets the value of [name][crate::model::GetGroupRequest::name].
14463 ///
14464 /// # Example
14465 /// ```ignore,no_run
14466 /// # use google_cloud_networkconnectivity_v1::model::GetGroupRequest;
14467 /// let x = GetGroupRequest::new().set_name("example");
14468 /// ```
14469 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14470 self.name = v.into();
14471 self
14472 }
14473}
14474
14475impl wkt::message::Message for GetGroupRequest {
14476 fn typename() -> &'static str {
14477 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetGroupRequest"
14478 }
14479}
14480
14481/// Request for
14482/// [HubService.UpdateGroup][google.cloud.networkconnectivity.v1.HubService.UpdateGroup]
14483/// method.
14484///
14485/// [google.cloud.networkconnectivity.v1.HubService.UpdateGroup]: crate::client::HubService::update_group
14486#[derive(Clone, Default, PartialEq)]
14487#[non_exhaustive]
14488pub struct UpdateGroupRequest {
14489 /// Optional. In the case of an update to an existing group, field mask is used
14490 /// to specify the fields to be overwritten. The fields specified in the
14491 /// update_mask are relative to the resource, not the full request. A field is
14492 /// overwritten if it is in the mask. If the user does not provide a mask, then
14493 /// all fields are overwritten.
14494 pub update_mask: std::option::Option<wkt::FieldMask>,
14495
14496 /// Required. The state that the group should be in after the update.
14497 pub group: std::option::Option<crate::model::Group>,
14498
14499 /// Optional. A request ID to identify requests. Specify a unique request ID so
14500 /// that if you must retry your request, the server knows to ignore the request
14501 /// if it has already been completed. The server guarantees that a request
14502 /// doesn't result in creation of duplicate commitments for at least 60
14503 /// minutes.
14504 ///
14505 /// For example, consider a situation where you make an initial request and
14506 /// the request times out. If you make the request again with the same request
14507 /// ID, the server can check to see whether the original operation
14508 /// was received. If it was, the server ignores the second request. This
14509 /// behavior prevents clients from mistakenly creating duplicate commitments.
14510 ///
14511 /// The request ID must be a valid UUID, with the exception that zero UUID is
14512 /// not supported (00000000-0000-0000-0000-000000000000).
14513 pub request_id: std::string::String,
14514
14515 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14516}
14517
14518impl UpdateGroupRequest {
14519 pub fn new() -> Self {
14520 std::default::Default::default()
14521 }
14522
14523 /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
14524 ///
14525 /// # Example
14526 /// ```ignore,no_run
14527 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14528 /// use wkt::FieldMask;
14529 /// let x = UpdateGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
14530 /// ```
14531 pub fn set_update_mask<T>(mut self, v: T) -> Self
14532 where
14533 T: std::convert::Into<wkt::FieldMask>,
14534 {
14535 self.update_mask = std::option::Option::Some(v.into());
14536 self
14537 }
14538
14539 /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
14540 ///
14541 /// # Example
14542 /// ```ignore,no_run
14543 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14544 /// use wkt::FieldMask;
14545 /// let x = UpdateGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
14546 /// let x = UpdateGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
14547 /// ```
14548 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14549 where
14550 T: std::convert::Into<wkt::FieldMask>,
14551 {
14552 self.update_mask = v.map(|x| x.into());
14553 self
14554 }
14555
14556 /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
14557 ///
14558 /// # Example
14559 /// ```ignore,no_run
14560 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14561 /// use google_cloud_networkconnectivity_v1::model::Group;
14562 /// let x = UpdateGroupRequest::new().set_group(Group::default()/* use setters */);
14563 /// ```
14564 pub fn set_group<T>(mut self, v: T) -> Self
14565 where
14566 T: std::convert::Into<crate::model::Group>,
14567 {
14568 self.group = std::option::Option::Some(v.into());
14569 self
14570 }
14571
14572 /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
14573 ///
14574 /// # Example
14575 /// ```ignore,no_run
14576 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14577 /// use google_cloud_networkconnectivity_v1::model::Group;
14578 /// let x = UpdateGroupRequest::new().set_or_clear_group(Some(Group::default()/* use setters */));
14579 /// let x = UpdateGroupRequest::new().set_or_clear_group(None::<Group>);
14580 /// ```
14581 pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
14582 where
14583 T: std::convert::Into<crate::model::Group>,
14584 {
14585 self.group = v.map(|x| x.into());
14586 self
14587 }
14588
14589 /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
14590 ///
14591 /// # Example
14592 /// ```ignore,no_run
14593 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14594 /// let x = UpdateGroupRequest::new().set_request_id("example");
14595 /// ```
14596 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14597 self.request_id = v.into();
14598 self
14599 }
14600}
14601
14602impl wkt::message::Message for UpdateGroupRequest {
14603 fn typename() -> &'static str {
14604 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateGroupRequest"
14605 }
14606}
14607
14608/// The internal range resource for IPAM operations within a VPC network.
14609/// Used to represent a private address range along with behavioral
14610/// characteristics of that range (its usage and peering behavior).
14611/// Networking resources can link to this range if they are created
14612/// as belonging to it.
14613#[derive(Clone, Default, PartialEq)]
14614#[non_exhaustive]
14615pub struct InternalRange {
14616 /// Identifier. The name of an internal range.
14617 /// Format:
14618 /// projects/{project}/locations/{location}/internalRanges/{internal_range}
14619 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
14620 pub name: std::string::String,
14621
14622 /// Output only. Time when the internal range was created.
14623 pub create_time: std::option::Option<wkt::Timestamp>,
14624
14625 /// Output only. Time when the internal range was updated.
14626 pub update_time: std::option::Option<wkt::Timestamp>,
14627
14628 /// User-defined labels.
14629 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14630
14631 /// Optional. A description of this resource.
14632 pub description: std::string::String,
14633
14634 /// Optional. The IP range that this internal range defines.
14635 /// NOTE: IPv6 ranges are limited to usage=EXTERNAL_TO_VPC and
14636 /// peering=FOR_SELF.
14637 /// NOTE: For IPv6 Ranges this field is compulsory, i.e. the address range must
14638 /// be specified explicitly.
14639 pub ip_cidr_range: std::string::String,
14640
14641 /// Immutable. The URL or resource ID of the network in which to reserve the
14642 /// internal range. The network cannot be deleted if there are any reserved
14643 /// internal ranges referring to it. Legacy networks are not supported. For
14644 /// example:
14645 /// <https://www.googleapis.com/compute/v1/projects/{project}/locations/global/networks/{network}>
14646 /// projects/{project}/locations/global/networks/{network}
14647 /// {network}
14648 pub network: std::string::String,
14649
14650 /// Optional. The type of usage set for this InternalRange.
14651 pub usage: crate::model::internal_range::Usage,
14652
14653 /// Optional. The type of peering set for this internal range.
14654 pub peering: crate::model::internal_range::Peering,
14655
14656 /// Optional. An alternate to ip_cidr_range. Can be set when trying to create
14657 /// an IPv4 reservation that automatically finds a free range of the given
14658 /// size. If both ip_cidr_range and prefix_length are set, there is an error if
14659 /// the range sizes do not match. Can also be used during updates to change the
14660 /// range size.
14661 /// NOTE: For IPv6 this field only works if ip_cidr_range is set as well, and
14662 /// both fields must match. In other words, with IPv6 this field only works as
14663 /// a redundant parameter.
14664 pub prefix_length: i32,
14665
14666 /// Optional. Can be set to narrow down or pick a different address space while
14667 /// searching for a free range. If not set, defaults to the ["10.0.0.0/8",
14668 /// "172.16.0.0/12", "192.168.0.0/16"] address space (for auto-mode networks,
14669 /// the "10.0.0.0/9" range is used instead of "10.0.0.0/8"). This can be used
14670 /// to target the search in other rfc-1918 address spaces like "172.16.0.0/12"
14671 /// and "192.168.0.0/16" or non-rfc-1918 address spaces used in the VPC.
14672 pub target_cidr_range: std::vec::Vec<std::string::String>,
14673
14674 /// Output only. The list of resources that refer to this internal range.
14675 /// Resources that use the internal range for their range allocation
14676 /// are referred to as users of the range. Other resources mark themselves
14677 /// as users while doing so by creating a reference to this internal range.
14678 /// Having a user, based on this reference, prevents deletion of the
14679 /// internal range referred to. Can be empty.
14680 pub users: std::vec::Vec<std::string::String>,
14681
14682 /// Optional. Types of resources that are allowed to overlap with the current
14683 /// internal range.
14684 pub overlaps: std::vec::Vec<crate::model::internal_range::Overlap>,
14685
14686 /// Optional. Must be present if usage is set to FOR_MIGRATION.
14687 pub migration: std::option::Option<crate::model::internal_range::Migration>,
14688
14689 /// Optional. Immutable ranges cannot have their fields modified, except for
14690 /// labels and description.
14691 pub immutable: bool,
14692
14693 /// Optional. Range auto-allocation options, may be set only when
14694 /// auto-allocation is selected by not setting ip_cidr_range (and setting
14695 /// prefix_length).
14696 pub allocation_options: std::option::Option<crate::model::internal_range::AllocationOptions>,
14697
14698 /// Optional. ExcludeCidrRanges flag. Specifies a set of CIDR blocks that
14699 /// allows exclusion of particular CIDR ranges from the auto-allocation
14700 /// process, without having to reserve these blocks
14701 pub exclude_cidr_ranges: std::vec::Vec<std::string::String>,
14702
14703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14704}
14705
14706impl InternalRange {
14707 pub fn new() -> Self {
14708 std::default::Default::default()
14709 }
14710
14711 /// Sets the value of [name][crate::model::InternalRange::name].
14712 ///
14713 /// # Example
14714 /// ```ignore,no_run
14715 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14716 /// let x = InternalRange::new().set_name("example");
14717 /// ```
14718 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14719 self.name = v.into();
14720 self
14721 }
14722
14723 /// Sets the value of [create_time][crate::model::InternalRange::create_time].
14724 ///
14725 /// # Example
14726 /// ```ignore,no_run
14727 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14728 /// use wkt::Timestamp;
14729 /// let x = InternalRange::new().set_create_time(Timestamp::default()/* use setters */);
14730 /// ```
14731 pub fn set_create_time<T>(mut self, v: T) -> Self
14732 where
14733 T: std::convert::Into<wkt::Timestamp>,
14734 {
14735 self.create_time = std::option::Option::Some(v.into());
14736 self
14737 }
14738
14739 /// Sets or clears the value of [create_time][crate::model::InternalRange::create_time].
14740 ///
14741 /// # Example
14742 /// ```ignore,no_run
14743 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14744 /// use wkt::Timestamp;
14745 /// let x = InternalRange::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14746 /// let x = InternalRange::new().set_or_clear_create_time(None::<Timestamp>);
14747 /// ```
14748 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14749 where
14750 T: std::convert::Into<wkt::Timestamp>,
14751 {
14752 self.create_time = v.map(|x| x.into());
14753 self
14754 }
14755
14756 /// Sets the value of [update_time][crate::model::InternalRange::update_time].
14757 ///
14758 /// # Example
14759 /// ```ignore,no_run
14760 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14761 /// use wkt::Timestamp;
14762 /// let x = InternalRange::new().set_update_time(Timestamp::default()/* use setters */);
14763 /// ```
14764 pub fn set_update_time<T>(mut self, v: T) -> Self
14765 where
14766 T: std::convert::Into<wkt::Timestamp>,
14767 {
14768 self.update_time = std::option::Option::Some(v.into());
14769 self
14770 }
14771
14772 /// Sets or clears the value of [update_time][crate::model::InternalRange::update_time].
14773 ///
14774 /// # Example
14775 /// ```ignore,no_run
14776 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14777 /// use wkt::Timestamp;
14778 /// let x = InternalRange::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14779 /// let x = InternalRange::new().set_or_clear_update_time(None::<Timestamp>);
14780 /// ```
14781 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14782 where
14783 T: std::convert::Into<wkt::Timestamp>,
14784 {
14785 self.update_time = v.map(|x| x.into());
14786 self
14787 }
14788
14789 /// Sets the value of [labels][crate::model::InternalRange::labels].
14790 ///
14791 /// # Example
14792 /// ```ignore,no_run
14793 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14794 /// let x = InternalRange::new().set_labels([
14795 /// ("key0", "abc"),
14796 /// ("key1", "xyz"),
14797 /// ]);
14798 /// ```
14799 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14800 where
14801 T: std::iter::IntoIterator<Item = (K, V)>,
14802 K: std::convert::Into<std::string::String>,
14803 V: std::convert::Into<std::string::String>,
14804 {
14805 use std::iter::Iterator;
14806 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14807 self
14808 }
14809
14810 /// Sets the value of [description][crate::model::InternalRange::description].
14811 ///
14812 /// # Example
14813 /// ```ignore,no_run
14814 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14815 /// let x = InternalRange::new().set_description("example");
14816 /// ```
14817 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14818 self.description = v.into();
14819 self
14820 }
14821
14822 /// Sets the value of [ip_cidr_range][crate::model::InternalRange::ip_cidr_range].
14823 ///
14824 /// # Example
14825 /// ```ignore,no_run
14826 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14827 /// let x = InternalRange::new().set_ip_cidr_range("example");
14828 /// ```
14829 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14830 self.ip_cidr_range = v.into();
14831 self
14832 }
14833
14834 /// Sets the value of [network][crate::model::InternalRange::network].
14835 ///
14836 /// # Example
14837 /// ```ignore,no_run
14838 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14839 /// let x = InternalRange::new().set_network("example");
14840 /// ```
14841 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14842 self.network = v.into();
14843 self
14844 }
14845
14846 /// Sets the value of [usage][crate::model::InternalRange::usage].
14847 ///
14848 /// # Example
14849 /// ```ignore,no_run
14850 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14851 /// use google_cloud_networkconnectivity_v1::model::internal_range::Usage;
14852 /// let x0 = InternalRange::new().set_usage(Usage::ForVpc);
14853 /// let x1 = InternalRange::new().set_usage(Usage::ExternalToVpc);
14854 /// let x2 = InternalRange::new().set_usage(Usage::ForMigration);
14855 /// ```
14856 pub fn set_usage<T: std::convert::Into<crate::model::internal_range::Usage>>(
14857 mut self,
14858 v: T,
14859 ) -> Self {
14860 self.usage = v.into();
14861 self
14862 }
14863
14864 /// Sets the value of [peering][crate::model::InternalRange::peering].
14865 ///
14866 /// # Example
14867 /// ```ignore,no_run
14868 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14869 /// use google_cloud_networkconnectivity_v1::model::internal_range::Peering;
14870 /// let x0 = InternalRange::new().set_peering(Peering::ForSelf);
14871 /// let x1 = InternalRange::new().set_peering(Peering::ForPeer);
14872 /// let x2 = InternalRange::new().set_peering(Peering::NotShared);
14873 /// ```
14874 pub fn set_peering<T: std::convert::Into<crate::model::internal_range::Peering>>(
14875 mut self,
14876 v: T,
14877 ) -> Self {
14878 self.peering = v.into();
14879 self
14880 }
14881
14882 /// Sets the value of [prefix_length][crate::model::InternalRange::prefix_length].
14883 ///
14884 /// # Example
14885 /// ```ignore,no_run
14886 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14887 /// let x = InternalRange::new().set_prefix_length(42);
14888 /// ```
14889 pub fn set_prefix_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14890 self.prefix_length = v.into();
14891 self
14892 }
14893
14894 /// Sets the value of [target_cidr_range][crate::model::InternalRange::target_cidr_range].
14895 ///
14896 /// # Example
14897 /// ```ignore,no_run
14898 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14899 /// let x = InternalRange::new().set_target_cidr_range(["a", "b", "c"]);
14900 /// ```
14901 pub fn set_target_cidr_range<T, V>(mut self, v: T) -> Self
14902 where
14903 T: std::iter::IntoIterator<Item = V>,
14904 V: std::convert::Into<std::string::String>,
14905 {
14906 use std::iter::Iterator;
14907 self.target_cidr_range = v.into_iter().map(|i| i.into()).collect();
14908 self
14909 }
14910
14911 /// Sets the value of [users][crate::model::InternalRange::users].
14912 ///
14913 /// # Example
14914 /// ```ignore,no_run
14915 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14916 /// let x = InternalRange::new().set_users(["a", "b", "c"]);
14917 /// ```
14918 pub fn set_users<T, V>(mut self, v: T) -> Self
14919 where
14920 T: std::iter::IntoIterator<Item = V>,
14921 V: std::convert::Into<std::string::String>,
14922 {
14923 use std::iter::Iterator;
14924 self.users = v.into_iter().map(|i| i.into()).collect();
14925 self
14926 }
14927
14928 /// Sets the value of [overlaps][crate::model::InternalRange::overlaps].
14929 ///
14930 /// # Example
14931 /// ```ignore,no_run
14932 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14933 /// use google_cloud_networkconnectivity_v1::model::internal_range::Overlap;
14934 /// let x = InternalRange::new().set_overlaps([
14935 /// Overlap::RouteRange,
14936 /// Overlap::ExistingSubnetRange,
14937 /// ]);
14938 /// ```
14939 pub fn set_overlaps<T, V>(mut self, v: T) -> Self
14940 where
14941 T: std::iter::IntoIterator<Item = V>,
14942 V: std::convert::Into<crate::model::internal_range::Overlap>,
14943 {
14944 use std::iter::Iterator;
14945 self.overlaps = v.into_iter().map(|i| i.into()).collect();
14946 self
14947 }
14948
14949 /// Sets the value of [migration][crate::model::InternalRange::migration].
14950 ///
14951 /// # Example
14952 /// ```ignore,no_run
14953 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14954 /// use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
14955 /// let x = InternalRange::new().set_migration(Migration::default()/* use setters */);
14956 /// ```
14957 pub fn set_migration<T>(mut self, v: T) -> Self
14958 where
14959 T: std::convert::Into<crate::model::internal_range::Migration>,
14960 {
14961 self.migration = std::option::Option::Some(v.into());
14962 self
14963 }
14964
14965 /// Sets or clears the value of [migration][crate::model::InternalRange::migration].
14966 ///
14967 /// # Example
14968 /// ```ignore,no_run
14969 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14970 /// use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
14971 /// let x = InternalRange::new().set_or_clear_migration(Some(Migration::default()/* use setters */));
14972 /// let x = InternalRange::new().set_or_clear_migration(None::<Migration>);
14973 /// ```
14974 pub fn set_or_clear_migration<T>(mut self, v: std::option::Option<T>) -> Self
14975 where
14976 T: std::convert::Into<crate::model::internal_range::Migration>,
14977 {
14978 self.migration = v.map(|x| x.into());
14979 self
14980 }
14981
14982 /// Sets the value of [immutable][crate::model::InternalRange::immutable].
14983 ///
14984 /// # Example
14985 /// ```ignore,no_run
14986 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14987 /// let x = InternalRange::new().set_immutable(true);
14988 /// ```
14989 pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14990 self.immutable = v.into();
14991 self
14992 }
14993
14994 /// Sets the value of [allocation_options][crate::model::InternalRange::allocation_options].
14995 ///
14996 /// # Example
14997 /// ```ignore,no_run
14998 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14999 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15000 /// let x = InternalRange::new().set_allocation_options(AllocationOptions::default()/* use setters */);
15001 /// ```
15002 pub fn set_allocation_options<T>(mut self, v: T) -> Self
15003 where
15004 T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
15005 {
15006 self.allocation_options = std::option::Option::Some(v.into());
15007 self
15008 }
15009
15010 /// Sets or clears the value of [allocation_options][crate::model::InternalRange::allocation_options].
15011 ///
15012 /// # Example
15013 /// ```ignore,no_run
15014 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15015 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15016 /// let x = InternalRange::new().set_or_clear_allocation_options(Some(AllocationOptions::default()/* use setters */));
15017 /// let x = InternalRange::new().set_or_clear_allocation_options(None::<AllocationOptions>);
15018 /// ```
15019 pub fn set_or_clear_allocation_options<T>(mut self, v: std::option::Option<T>) -> Self
15020 where
15021 T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
15022 {
15023 self.allocation_options = v.map(|x| x.into());
15024 self
15025 }
15026
15027 /// Sets the value of [exclude_cidr_ranges][crate::model::InternalRange::exclude_cidr_ranges].
15028 ///
15029 /// # Example
15030 /// ```ignore,no_run
15031 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15032 /// let x = InternalRange::new().set_exclude_cidr_ranges(["a", "b", "c"]);
15033 /// ```
15034 pub fn set_exclude_cidr_ranges<T, V>(mut self, v: T) -> Self
15035 where
15036 T: std::iter::IntoIterator<Item = V>,
15037 V: std::convert::Into<std::string::String>,
15038 {
15039 use std::iter::Iterator;
15040 self.exclude_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
15041 self
15042 }
15043}
15044
15045impl wkt::message::Message for InternalRange {
15046 fn typename() -> &'static str {
15047 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange"
15048 }
15049}
15050
15051/// Defines additional types related to [InternalRange].
15052pub mod internal_range {
15053 #[allow(unused_imports)]
15054 use super::*;
15055
15056 /// Specification for migration with source and target resource names.
15057 #[derive(Clone, Default, PartialEq)]
15058 #[non_exhaustive]
15059 pub struct Migration {
15060 /// Immutable. Resource path as an URI of the source resource, for example a
15061 /// subnet. The project for the source resource should match the project for
15062 /// the InternalRange. An example:
15063 /// /projects/{project}/regions/{region}/subnetworks/{subnet}
15064 pub source: std::string::String,
15065
15066 /// Immutable. Resource path of the target resource. The target project can
15067 /// be different, as in the cases when migrating to peer networks. For
15068 /// example:
15069 /// /projects/{project}/regions/{region}/subnetworks/{subnet}
15070 pub target: std::string::String,
15071
15072 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15073 }
15074
15075 impl Migration {
15076 pub fn new() -> Self {
15077 std::default::Default::default()
15078 }
15079
15080 /// Sets the value of [source][crate::model::internal_range::Migration::source].
15081 ///
15082 /// # Example
15083 /// ```ignore,no_run
15084 /// # use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15085 /// let x = Migration::new().set_source("example");
15086 /// ```
15087 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15088 self.source = v.into();
15089 self
15090 }
15091
15092 /// Sets the value of [target][crate::model::internal_range::Migration::target].
15093 ///
15094 /// # Example
15095 /// ```ignore,no_run
15096 /// # use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15097 /// let x = Migration::new().set_target("example");
15098 /// ```
15099 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15100 self.target = v.into();
15101 self
15102 }
15103 }
15104
15105 impl wkt::message::Message for Migration {
15106 fn typename() -> &'static str {
15107 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.Migration"
15108 }
15109 }
15110
15111 /// Range auto-allocation options, to be optionally used when CIDR block is not
15112 /// explicitly set.
15113 #[derive(Clone, Default, PartialEq)]
15114 #[non_exhaustive]
15115 pub struct AllocationOptions {
15116 /// Optional. Allocation strategy Not setting this field when the allocation
15117 /// is requested means an implementation defined strategy is used.
15118 pub allocation_strategy: crate::model::internal_range::AllocationStrategy,
15119
15120 /// Optional. This field must be set only when allocation_strategy is set to
15121 /// RANDOM_FIRST_N_AVAILABLE.
15122 /// The value should be the maximum expected parallelism of range creation
15123 /// requests issued to the same space of peered netwroks.
15124 pub first_available_ranges_lookup_size: i32,
15125
15126 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15127 }
15128
15129 impl AllocationOptions {
15130 pub fn new() -> Self {
15131 std::default::Default::default()
15132 }
15133
15134 /// Sets the value of [allocation_strategy][crate::model::internal_range::AllocationOptions::allocation_strategy].
15135 ///
15136 /// # Example
15137 /// ```ignore,no_run
15138 /// # use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15139 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationStrategy;
15140 /// let x0 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::Random);
15141 /// let x1 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::FirstAvailable);
15142 /// let x2 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::RandomFirstNAvailable);
15143 /// ```
15144 pub fn set_allocation_strategy<
15145 T: std::convert::Into<crate::model::internal_range::AllocationStrategy>,
15146 >(
15147 mut self,
15148 v: T,
15149 ) -> Self {
15150 self.allocation_strategy = v.into();
15151 self
15152 }
15153
15154 /// Sets the value of [first_available_ranges_lookup_size][crate::model::internal_range::AllocationOptions::first_available_ranges_lookup_size].
15155 ///
15156 /// # Example
15157 /// ```ignore,no_run
15158 /// # use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15159 /// let x = AllocationOptions::new().set_first_available_ranges_lookup_size(42);
15160 /// ```
15161 pub fn set_first_available_ranges_lookup_size<T: std::convert::Into<i32>>(
15162 mut self,
15163 v: T,
15164 ) -> Self {
15165 self.first_available_ranges_lookup_size = v.into();
15166 self
15167 }
15168 }
15169
15170 impl wkt::message::Message for AllocationOptions {
15171 fn typename() -> &'static str {
15172 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.AllocationOptions"
15173 }
15174 }
15175
15176 /// Possible usage of an internal range.
15177 ///
15178 /// # Working with unknown values
15179 ///
15180 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15181 /// additional enum variants at any time. Adding new variants is not considered
15182 /// a breaking change. Applications should write their code in anticipation of:
15183 ///
15184 /// - New values appearing in future releases of the client library, **and**
15185 /// - New values received dynamically, without application changes.
15186 ///
15187 /// Please consult the [Working with enums] section in the user guide for some
15188 /// guidelines.
15189 ///
15190 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15191 #[derive(Clone, Debug, PartialEq)]
15192 #[non_exhaustive]
15193 pub enum Usage {
15194 /// Unspecified usage is allowed in calls which identify the resource by
15195 /// other fields and do not need Usage set to complete. These are, i.e.:
15196 /// GetInternalRange and DeleteInternalRange.
15197 /// Usage needs to be specified explicitly in CreateInternalRange
15198 /// or UpdateInternalRange calls.
15199 Unspecified,
15200 /// A VPC resource can use the reserved CIDR block by associating it with the
15201 /// internal range resource if usage is set to FOR_VPC.
15202 ForVpc,
15203 /// Ranges created with EXTERNAL_TO_VPC cannot be associated with VPC
15204 /// resources and are meant to block out address ranges for various use
15205 /// cases, like for example, usage on-prem, with dynamic route announcements
15206 /// via interconnect.
15207 ExternalToVpc,
15208 /// Ranges created FOR_MIGRATION can be used to lock a CIDR range between a
15209 /// source and target subnet. If usage is set to FOR_MIGRATION, the peering
15210 /// value has to be set to FOR_SELF or default to FOR_SELF when unset.
15211 ForMigration,
15212 /// If set, the enum was initialized with an unknown value.
15213 ///
15214 /// Applications can examine the value using [Usage::value] or
15215 /// [Usage::name].
15216 UnknownValue(usage::UnknownValue),
15217 }
15218
15219 #[doc(hidden)]
15220 pub mod usage {
15221 #[allow(unused_imports)]
15222 use super::*;
15223 #[derive(Clone, Debug, PartialEq)]
15224 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15225 }
15226
15227 impl Usage {
15228 /// Gets the enum value.
15229 ///
15230 /// Returns `None` if the enum contains an unknown value deserialized from
15231 /// the string representation of enums.
15232 pub fn value(&self) -> std::option::Option<i32> {
15233 match self {
15234 Self::Unspecified => std::option::Option::Some(0),
15235 Self::ForVpc => std::option::Option::Some(1),
15236 Self::ExternalToVpc => std::option::Option::Some(2),
15237 Self::ForMigration => std::option::Option::Some(3),
15238 Self::UnknownValue(u) => u.0.value(),
15239 }
15240 }
15241
15242 /// Gets the enum value as a string.
15243 ///
15244 /// Returns `None` if the enum contains an unknown value deserialized from
15245 /// the integer representation of enums.
15246 pub fn name(&self) -> std::option::Option<&str> {
15247 match self {
15248 Self::Unspecified => std::option::Option::Some("USAGE_UNSPECIFIED"),
15249 Self::ForVpc => std::option::Option::Some("FOR_VPC"),
15250 Self::ExternalToVpc => std::option::Option::Some("EXTERNAL_TO_VPC"),
15251 Self::ForMigration => std::option::Option::Some("FOR_MIGRATION"),
15252 Self::UnknownValue(u) => u.0.name(),
15253 }
15254 }
15255 }
15256
15257 impl std::default::Default for Usage {
15258 fn default() -> Self {
15259 use std::convert::From;
15260 Self::from(0)
15261 }
15262 }
15263
15264 impl std::fmt::Display for Usage {
15265 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15266 wkt::internal::display_enum(f, self.name(), self.value())
15267 }
15268 }
15269
15270 impl std::convert::From<i32> for Usage {
15271 fn from(value: i32) -> Self {
15272 match value {
15273 0 => Self::Unspecified,
15274 1 => Self::ForVpc,
15275 2 => Self::ExternalToVpc,
15276 3 => Self::ForMigration,
15277 _ => Self::UnknownValue(usage::UnknownValue(
15278 wkt::internal::UnknownEnumValue::Integer(value),
15279 )),
15280 }
15281 }
15282 }
15283
15284 impl std::convert::From<&str> for Usage {
15285 fn from(value: &str) -> Self {
15286 use std::string::ToString;
15287 match value {
15288 "USAGE_UNSPECIFIED" => Self::Unspecified,
15289 "FOR_VPC" => Self::ForVpc,
15290 "EXTERNAL_TO_VPC" => Self::ExternalToVpc,
15291 "FOR_MIGRATION" => Self::ForMigration,
15292 _ => Self::UnknownValue(usage::UnknownValue(
15293 wkt::internal::UnknownEnumValue::String(value.to_string()),
15294 )),
15295 }
15296 }
15297 }
15298
15299 impl serde::ser::Serialize for Usage {
15300 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15301 where
15302 S: serde::Serializer,
15303 {
15304 match self {
15305 Self::Unspecified => serializer.serialize_i32(0),
15306 Self::ForVpc => serializer.serialize_i32(1),
15307 Self::ExternalToVpc => serializer.serialize_i32(2),
15308 Self::ForMigration => serializer.serialize_i32(3),
15309 Self::UnknownValue(u) => u.0.serialize(serializer),
15310 }
15311 }
15312 }
15313
15314 impl<'de> serde::de::Deserialize<'de> for Usage {
15315 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15316 where
15317 D: serde::Deserializer<'de>,
15318 {
15319 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Usage>::new(
15320 ".google.cloud.networkconnectivity.v1.InternalRange.Usage",
15321 ))
15322 }
15323 }
15324
15325 /// Peering type.
15326 ///
15327 /// # Working with unknown values
15328 ///
15329 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15330 /// additional enum variants at any time. Adding new variants is not considered
15331 /// a breaking change. Applications should write their code in anticipation of:
15332 ///
15333 /// - New values appearing in future releases of the client library, **and**
15334 /// - New values received dynamically, without application changes.
15335 ///
15336 /// Please consult the [Working with enums] section in the user guide for some
15337 /// guidelines.
15338 ///
15339 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15340 #[derive(Clone, Debug, PartialEq)]
15341 #[non_exhaustive]
15342 pub enum Peering {
15343 /// If Peering is left unspecified in CreateInternalRange or
15344 /// UpdateInternalRange, it will be defaulted to FOR_SELF.
15345 Unspecified,
15346 /// This is the default behavior and represents the case that this
15347 /// internal range is intended to be used in the VPC in which it is created
15348 /// and is accessible from its peers. This implies that peers or
15349 /// peers-of-peers cannot use this range.
15350 ForSelf,
15351 /// This behavior can be set when the internal range is being reserved for
15352 /// usage by peers. This means that no resource within the VPC in which
15353 /// it is being created can use this to associate with a VPC resource, but
15354 /// one of the peers can. This represents donating a range for peers to
15355 /// use.
15356 ForPeer,
15357 /// This behavior can be set when the internal range is being reserved for
15358 /// usage by the VPC in which it is created, but not shared with peers.
15359 /// In a sense, it is local to the VPC. This can be used to create internal
15360 /// ranges for various purposes like HTTP_INTERNAL_LOAD_BALANCER or for
15361 /// Interconnect routes that are not shared with peers. This also implies
15362 /// that peers cannot use this range in a way that is visible to this VPC,
15363 /// but can re-use this range as long as it is NOT_SHARED from the peer VPC,
15364 /// too.
15365 NotShared,
15366 /// If set, the enum was initialized with an unknown value.
15367 ///
15368 /// Applications can examine the value using [Peering::value] or
15369 /// [Peering::name].
15370 UnknownValue(peering::UnknownValue),
15371 }
15372
15373 #[doc(hidden)]
15374 pub mod peering {
15375 #[allow(unused_imports)]
15376 use super::*;
15377 #[derive(Clone, Debug, PartialEq)]
15378 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15379 }
15380
15381 impl Peering {
15382 /// Gets the enum value.
15383 ///
15384 /// Returns `None` if the enum contains an unknown value deserialized from
15385 /// the string representation of enums.
15386 pub fn value(&self) -> std::option::Option<i32> {
15387 match self {
15388 Self::Unspecified => std::option::Option::Some(0),
15389 Self::ForSelf => std::option::Option::Some(1),
15390 Self::ForPeer => std::option::Option::Some(2),
15391 Self::NotShared => std::option::Option::Some(3),
15392 Self::UnknownValue(u) => u.0.value(),
15393 }
15394 }
15395
15396 /// Gets the enum value as a string.
15397 ///
15398 /// Returns `None` if the enum contains an unknown value deserialized from
15399 /// the integer representation of enums.
15400 pub fn name(&self) -> std::option::Option<&str> {
15401 match self {
15402 Self::Unspecified => std::option::Option::Some("PEERING_UNSPECIFIED"),
15403 Self::ForSelf => std::option::Option::Some("FOR_SELF"),
15404 Self::ForPeer => std::option::Option::Some("FOR_PEER"),
15405 Self::NotShared => std::option::Option::Some("NOT_SHARED"),
15406 Self::UnknownValue(u) => u.0.name(),
15407 }
15408 }
15409 }
15410
15411 impl std::default::Default for Peering {
15412 fn default() -> Self {
15413 use std::convert::From;
15414 Self::from(0)
15415 }
15416 }
15417
15418 impl std::fmt::Display for Peering {
15419 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15420 wkt::internal::display_enum(f, self.name(), self.value())
15421 }
15422 }
15423
15424 impl std::convert::From<i32> for Peering {
15425 fn from(value: i32) -> Self {
15426 match value {
15427 0 => Self::Unspecified,
15428 1 => Self::ForSelf,
15429 2 => Self::ForPeer,
15430 3 => Self::NotShared,
15431 _ => Self::UnknownValue(peering::UnknownValue(
15432 wkt::internal::UnknownEnumValue::Integer(value),
15433 )),
15434 }
15435 }
15436 }
15437
15438 impl std::convert::From<&str> for Peering {
15439 fn from(value: &str) -> Self {
15440 use std::string::ToString;
15441 match value {
15442 "PEERING_UNSPECIFIED" => Self::Unspecified,
15443 "FOR_SELF" => Self::ForSelf,
15444 "FOR_PEER" => Self::ForPeer,
15445 "NOT_SHARED" => Self::NotShared,
15446 _ => Self::UnknownValue(peering::UnknownValue(
15447 wkt::internal::UnknownEnumValue::String(value.to_string()),
15448 )),
15449 }
15450 }
15451 }
15452
15453 impl serde::ser::Serialize for Peering {
15454 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15455 where
15456 S: serde::Serializer,
15457 {
15458 match self {
15459 Self::Unspecified => serializer.serialize_i32(0),
15460 Self::ForSelf => serializer.serialize_i32(1),
15461 Self::ForPeer => serializer.serialize_i32(2),
15462 Self::NotShared => serializer.serialize_i32(3),
15463 Self::UnknownValue(u) => u.0.serialize(serializer),
15464 }
15465 }
15466 }
15467
15468 impl<'de> serde::de::Deserialize<'de> for Peering {
15469 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15470 where
15471 D: serde::Deserializer<'de>,
15472 {
15473 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Peering>::new(
15474 ".google.cloud.networkconnectivity.v1.InternalRange.Peering",
15475 ))
15476 }
15477 }
15478
15479 /// Overlap specifications.
15480 ///
15481 /// # Working with unknown values
15482 ///
15483 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15484 /// additional enum variants at any time. Adding new variants is not considered
15485 /// a breaking change. Applications should write their code in anticipation of:
15486 ///
15487 /// - New values appearing in future releases of the client library, **and**
15488 /// - New values received dynamically, without application changes.
15489 ///
15490 /// Please consult the [Working with enums] section in the user guide for some
15491 /// guidelines.
15492 ///
15493 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15494 #[derive(Clone, Debug, PartialEq)]
15495 #[non_exhaustive]
15496 pub enum Overlap {
15497 /// No overlap overrides.
15498 Unspecified,
15499 /// Allow creation of static routes more specific that the current
15500 /// internal range.
15501 RouteRange,
15502 /// Allow creation of internal ranges that overlap with existing subnets.
15503 ExistingSubnetRange,
15504 /// If set, the enum was initialized with an unknown value.
15505 ///
15506 /// Applications can examine the value using [Overlap::value] or
15507 /// [Overlap::name].
15508 UnknownValue(overlap::UnknownValue),
15509 }
15510
15511 #[doc(hidden)]
15512 pub mod overlap {
15513 #[allow(unused_imports)]
15514 use super::*;
15515 #[derive(Clone, Debug, PartialEq)]
15516 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15517 }
15518
15519 impl Overlap {
15520 /// Gets the enum value.
15521 ///
15522 /// Returns `None` if the enum contains an unknown value deserialized from
15523 /// the string representation of enums.
15524 pub fn value(&self) -> std::option::Option<i32> {
15525 match self {
15526 Self::Unspecified => std::option::Option::Some(0),
15527 Self::RouteRange => std::option::Option::Some(1),
15528 Self::ExistingSubnetRange => std::option::Option::Some(2),
15529 Self::UnknownValue(u) => u.0.value(),
15530 }
15531 }
15532
15533 /// Gets the enum value as a string.
15534 ///
15535 /// Returns `None` if the enum contains an unknown value deserialized from
15536 /// the integer representation of enums.
15537 pub fn name(&self) -> std::option::Option<&str> {
15538 match self {
15539 Self::Unspecified => std::option::Option::Some("OVERLAP_UNSPECIFIED"),
15540 Self::RouteRange => std::option::Option::Some("OVERLAP_ROUTE_RANGE"),
15541 Self::ExistingSubnetRange => {
15542 std::option::Option::Some("OVERLAP_EXISTING_SUBNET_RANGE")
15543 }
15544 Self::UnknownValue(u) => u.0.name(),
15545 }
15546 }
15547 }
15548
15549 impl std::default::Default for Overlap {
15550 fn default() -> Self {
15551 use std::convert::From;
15552 Self::from(0)
15553 }
15554 }
15555
15556 impl std::fmt::Display for Overlap {
15557 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15558 wkt::internal::display_enum(f, self.name(), self.value())
15559 }
15560 }
15561
15562 impl std::convert::From<i32> for Overlap {
15563 fn from(value: i32) -> Self {
15564 match value {
15565 0 => Self::Unspecified,
15566 1 => Self::RouteRange,
15567 2 => Self::ExistingSubnetRange,
15568 _ => Self::UnknownValue(overlap::UnknownValue(
15569 wkt::internal::UnknownEnumValue::Integer(value),
15570 )),
15571 }
15572 }
15573 }
15574
15575 impl std::convert::From<&str> for Overlap {
15576 fn from(value: &str) -> Self {
15577 use std::string::ToString;
15578 match value {
15579 "OVERLAP_UNSPECIFIED" => Self::Unspecified,
15580 "OVERLAP_ROUTE_RANGE" => Self::RouteRange,
15581 "OVERLAP_EXISTING_SUBNET_RANGE" => Self::ExistingSubnetRange,
15582 _ => Self::UnknownValue(overlap::UnknownValue(
15583 wkt::internal::UnknownEnumValue::String(value.to_string()),
15584 )),
15585 }
15586 }
15587 }
15588
15589 impl serde::ser::Serialize for Overlap {
15590 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15591 where
15592 S: serde::Serializer,
15593 {
15594 match self {
15595 Self::Unspecified => serializer.serialize_i32(0),
15596 Self::RouteRange => serializer.serialize_i32(1),
15597 Self::ExistingSubnetRange => serializer.serialize_i32(2),
15598 Self::UnknownValue(u) => u.0.serialize(serializer),
15599 }
15600 }
15601 }
15602
15603 impl<'de> serde::de::Deserialize<'de> for Overlap {
15604 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15605 where
15606 D: serde::Deserializer<'de>,
15607 {
15608 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Overlap>::new(
15609 ".google.cloud.networkconnectivity.v1.InternalRange.Overlap",
15610 ))
15611 }
15612 }
15613
15614 /// Enumeration of range auto-allocation strategies
15615 ///
15616 /// # Working with unknown values
15617 ///
15618 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15619 /// additional enum variants at any time. Adding new variants is not considered
15620 /// a breaking change. Applications should write their code in anticipation of:
15621 ///
15622 /// - New values appearing in future releases of the client library, **and**
15623 /// - New values received dynamically, without application changes.
15624 ///
15625 /// Please consult the [Working with enums] section in the user guide for some
15626 /// guidelines.
15627 ///
15628 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15629 #[derive(Clone, Debug, PartialEq)]
15630 #[non_exhaustive]
15631 pub enum AllocationStrategy {
15632 /// Unspecified is the only valid option when the range is specified
15633 /// explicitly by ip_cidr_range field. Otherwise unspefified means using the
15634 /// default strategy.
15635 Unspecified,
15636 /// Random strategy, the legacy algorithm, used for backwards compatibility.
15637 /// This allocation strategy remains efficient in the case of concurrent
15638 /// allocation requests in the same peered network space and doesn't require
15639 /// providing the level of concurrency in an explicit parameter, but it is
15640 /// prone to fragmenting available address space.
15641 Random,
15642 /// Pick the first available address range. This strategy is deterministic
15643 /// and the result is easy to predict.
15644 FirstAvailable,
15645 /// Pick an arbitrary range out of the first N available ones. The N will be
15646 /// set in the first_available_ranges_lookup_size field. This strategy should
15647 /// be used when concurrent allocation requests are made in the same space of
15648 /// peered networks while the fragmentation of the addrress space is reduced.
15649 RandomFirstNAvailable,
15650 /// Pick the smallest but fitting available range. This deterministic
15651 /// strategy minimizes fragmentation of the address space.
15652 FirstSmallestFitting,
15653 /// If set, the enum was initialized with an unknown value.
15654 ///
15655 /// Applications can examine the value using [AllocationStrategy::value] or
15656 /// [AllocationStrategy::name].
15657 UnknownValue(allocation_strategy::UnknownValue),
15658 }
15659
15660 #[doc(hidden)]
15661 pub mod allocation_strategy {
15662 #[allow(unused_imports)]
15663 use super::*;
15664 #[derive(Clone, Debug, PartialEq)]
15665 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15666 }
15667
15668 impl AllocationStrategy {
15669 /// Gets the enum value.
15670 ///
15671 /// Returns `None` if the enum contains an unknown value deserialized from
15672 /// the string representation of enums.
15673 pub fn value(&self) -> std::option::Option<i32> {
15674 match self {
15675 Self::Unspecified => std::option::Option::Some(0),
15676 Self::Random => std::option::Option::Some(1),
15677 Self::FirstAvailable => std::option::Option::Some(2),
15678 Self::RandomFirstNAvailable => std::option::Option::Some(3),
15679 Self::FirstSmallestFitting => std::option::Option::Some(4),
15680 Self::UnknownValue(u) => u.0.value(),
15681 }
15682 }
15683
15684 /// Gets the enum value as a string.
15685 ///
15686 /// Returns `None` if the enum contains an unknown value deserialized from
15687 /// the integer representation of enums.
15688 pub fn name(&self) -> std::option::Option<&str> {
15689 match self {
15690 Self::Unspecified => std::option::Option::Some("ALLOCATION_STRATEGY_UNSPECIFIED"),
15691 Self::Random => std::option::Option::Some("RANDOM"),
15692 Self::FirstAvailable => std::option::Option::Some("FIRST_AVAILABLE"),
15693 Self::RandomFirstNAvailable => {
15694 std::option::Option::Some("RANDOM_FIRST_N_AVAILABLE")
15695 }
15696 Self::FirstSmallestFitting => std::option::Option::Some("FIRST_SMALLEST_FITTING"),
15697 Self::UnknownValue(u) => u.0.name(),
15698 }
15699 }
15700 }
15701
15702 impl std::default::Default for AllocationStrategy {
15703 fn default() -> Self {
15704 use std::convert::From;
15705 Self::from(0)
15706 }
15707 }
15708
15709 impl std::fmt::Display for AllocationStrategy {
15710 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15711 wkt::internal::display_enum(f, self.name(), self.value())
15712 }
15713 }
15714
15715 impl std::convert::From<i32> for AllocationStrategy {
15716 fn from(value: i32) -> Self {
15717 match value {
15718 0 => Self::Unspecified,
15719 1 => Self::Random,
15720 2 => Self::FirstAvailable,
15721 3 => Self::RandomFirstNAvailable,
15722 4 => Self::FirstSmallestFitting,
15723 _ => Self::UnknownValue(allocation_strategy::UnknownValue(
15724 wkt::internal::UnknownEnumValue::Integer(value),
15725 )),
15726 }
15727 }
15728 }
15729
15730 impl std::convert::From<&str> for AllocationStrategy {
15731 fn from(value: &str) -> Self {
15732 use std::string::ToString;
15733 match value {
15734 "ALLOCATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
15735 "RANDOM" => Self::Random,
15736 "FIRST_AVAILABLE" => Self::FirstAvailable,
15737 "RANDOM_FIRST_N_AVAILABLE" => Self::RandomFirstNAvailable,
15738 "FIRST_SMALLEST_FITTING" => Self::FirstSmallestFitting,
15739 _ => Self::UnknownValue(allocation_strategy::UnknownValue(
15740 wkt::internal::UnknownEnumValue::String(value.to_string()),
15741 )),
15742 }
15743 }
15744 }
15745
15746 impl serde::ser::Serialize for AllocationStrategy {
15747 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15748 where
15749 S: serde::Serializer,
15750 {
15751 match self {
15752 Self::Unspecified => serializer.serialize_i32(0),
15753 Self::Random => serializer.serialize_i32(1),
15754 Self::FirstAvailable => serializer.serialize_i32(2),
15755 Self::RandomFirstNAvailable => serializer.serialize_i32(3),
15756 Self::FirstSmallestFitting => serializer.serialize_i32(4),
15757 Self::UnknownValue(u) => u.0.serialize(serializer),
15758 }
15759 }
15760 }
15761
15762 impl<'de> serde::de::Deserialize<'de> for AllocationStrategy {
15763 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15764 where
15765 D: serde::Deserializer<'de>,
15766 {
15767 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AllocationStrategy>::new(
15768 ".google.cloud.networkconnectivity.v1.InternalRange.AllocationStrategy",
15769 ))
15770 }
15771 }
15772}
15773
15774/// Request for InternalRangeService.ListInternalRanges
15775#[derive(Clone, Default, PartialEq)]
15776#[non_exhaustive]
15777pub struct ListInternalRangesRequest {
15778 /// Required. The parent resource's name.
15779 pub parent: std::string::String,
15780
15781 /// The maximum number of results per page that should be returned.
15782 pub page_size: i32,
15783
15784 /// The page token.
15785 pub page_token: std::string::String,
15786
15787 /// A filter expression that filters the results listed in the response.
15788 pub filter: std::string::String,
15789
15790 /// Sort the results by a certain order.
15791 pub order_by: std::string::String,
15792
15793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15794}
15795
15796impl ListInternalRangesRequest {
15797 pub fn new() -> Self {
15798 std::default::Default::default()
15799 }
15800
15801 /// Sets the value of [parent][crate::model::ListInternalRangesRequest::parent].
15802 ///
15803 /// # Example
15804 /// ```ignore,no_run
15805 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15806 /// let x = ListInternalRangesRequest::new().set_parent("example");
15807 /// ```
15808 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15809 self.parent = v.into();
15810 self
15811 }
15812
15813 /// Sets the value of [page_size][crate::model::ListInternalRangesRequest::page_size].
15814 ///
15815 /// # Example
15816 /// ```ignore,no_run
15817 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15818 /// let x = ListInternalRangesRequest::new().set_page_size(42);
15819 /// ```
15820 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15821 self.page_size = v.into();
15822 self
15823 }
15824
15825 /// Sets the value of [page_token][crate::model::ListInternalRangesRequest::page_token].
15826 ///
15827 /// # Example
15828 /// ```ignore,no_run
15829 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15830 /// let x = ListInternalRangesRequest::new().set_page_token("example");
15831 /// ```
15832 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15833 self.page_token = v.into();
15834 self
15835 }
15836
15837 /// Sets the value of [filter][crate::model::ListInternalRangesRequest::filter].
15838 ///
15839 /// # Example
15840 /// ```ignore,no_run
15841 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15842 /// let x = ListInternalRangesRequest::new().set_filter("example");
15843 /// ```
15844 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15845 self.filter = v.into();
15846 self
15847 }
15848
15849 /// Sets the value of [order_by][crate::model::ListInternalRangesRequest::order_by].
15850 ///
15851 /// # Example
15852 /// ```ignore,no_run
15853 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15854 /// let x = ListInternalRangesRequest::new().set_order_by("example");
15855 /// ```
15856 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15857 self.order_by = v.into();
15858 self
15859 }
15860}
15861
15862impl wkt::message::Message for ListInternalRangesRequest {
15863 fn typename() -> &'static str {
15864 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesRequest"
15865 }
15866}
15867
15868/// Response for InternalRange.ListInternalRanges
15869#[derive(Clone, Default, PartialEq)]
15870#[non_exhaustive]
15871pub struct ListInternalRangesResponse {
15872 /// Internal ranges to be returned.
15873 pub internal_ranges: std::vec::Vec<crate::model::InternalRange>,
15874
15875 /// The next pagination token in the List response. It should be used as
15876 /// page_token for the following request. An empty value means no more result.
15877 pub next_page_token: std::string::String,
15878
15879 /// Locations that could not be reached.
15880 pub unreachable: std::vec::Vec<std::string::String>,
15881
15882 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15883}
15884
15885impl ListInternalRangesResponse {
15886 pub fn new() -> Self {
15887 std::default::Default::default()
15888 }
15889
15890 /// Sets the value of [internal_ranges][crate::model::ListInternalRangesResponse::internal_ranges].
15891 ///
15892 /// # Example
15893 /// ```ignore,no_run
15894 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
15895 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
15896 /// let x = ListInternalRangesResponse::new()
15897 /// .set_internal_ranges([
15898 /// InternalRange::default()/* use setters */,
15899 /// InternalRange::default()/* use (different) setters */,
15900 /// ]);
15901 /// ```
15902 pub fn set_internal_ranges<T, V>(mut self, v: T) -> Self
15903 where
15904 T: std::iter::IntoIterator<Item = V>,
15905 V: std::convert::Into<crate::model::InternalRange>,
15906 {
15907 use std::iter::Iterator;
15908 self.internal_ranges = v.into_iter().map(|i| i.into()).collect();
15909 self
15910 }
15911
15912 /// Sets the value of [next_page_token][crate::model::ListInternalRangesResponse::next_page_token].
15913 ///
15914 /// # Example
15915 /// ```ignore,no_run
15916 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
15917 /// let x = ListInternalRangesResponse::new().set_next_page_token("example");
15918 /// ```
15919 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15920 self.next_page_token = v.into();
15921 self
15922 }
15923
15924 /// Sets the value of [unreachable][crate::model::ListInternalRangesResponse::unreachable].
15925 ///
15926 /// # Example
15927 /// ```ignore,no_run
15928 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
15929 /// let x = ListInternalRangesResponse::new().set_unreachable(["a", "b", "c"]);
15930 /// ```
15931 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
15932 where
15933 T: std::iter::IntoIterator<Item = V>,
15934 V: std::convert::Into<std::string::String>,
15935 {
15936 use std::iter::Iterator;
15937 self.unreachable = v.into_iter().map(|i| i.into()).collect();
15938 self
15939 }
15940}
15941
15942impl wkt::message::Message for ListInternalRangesResponse {
15943 fn typename() -> &'static str {
15944 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesResponse"
15945 }
15946}
15947
15948#[doc(hidden)]
15949impl google_cloud_gax::paginator::internal::PageableResponse for ListInternalRangesResponse {
15950 type PageItem = crate::model::InternalRange;
15951
15952 fn items(self) -> std::vec::Vec<Self::PageItem> {
15953 self.internal_ranges
15954 }
15955
15956 fn next_page_token(&self) -> std::string::String {
15957 use std::clone::Clone;
15958 self.next_page_token.clone()
15959 }
15960}
15961
15962/// Request for InternalRangeService.GetInternalRange
15963#[derive(Clone, Default, PartialEq)]
15964#[non_exhaustive]
15965pub struct GetInternalRangeRequest {
15966 /// Required. Name of the InternalRange to get.
15967 pub name: std::string::String,
15968
15969 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15970}
15971
15972impl GetInternalRangeRequest {
15973 pub fn new() -> Self {
15974 std::default::Default::default()
15975 }
15976
15977 /// Sets the value of [name][crate::model::GetInternalRangeRequest::name].
15978 ///
15979 /// # Example
15980 /// ```ignore,no_run
15981 /// # use google_cloud_networkconnectivity_v1::model::GetInternalRangeRequest;
15982 /// let x = GetInternalRangeRequest::new().set_name("example");
15983 /// ```
15984 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15985 self.name = v.into();
15986 self
15987 }
15988}
15989
15990impl wkt::message::Message for GetInternalRangeRequest {
15991 fn typename() -> &'static str {
15992 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetInternalRangeRequest"
15993 }
15994}
15995
15996/// Request for InternalRangeService.CreateInternalRange
15997#[derive(Clone, Default, PartialEq)]
15998#[non_exhaustive]
15999pub struct CreateInternalRangeRequest {
16000 /// Required. The parent resource's name of the internal range.
16001 pub parent: std::string::String,
16002
16003 /// Optional. Resource ID
16004 /// (i.e. 'foo' in '[...]/projects/p/locations/l/internalRanges/foo')
16005 /// See <https://google.aip.dev/122#resource-id-segments>
16006 /// Unique per location.
16007 pub internal_range_id: std::string::String,
16008
16009 /// Required. Initial values for a new internal range
16010 pub internal_range: std::option::Option<crate::model::InternalRange>,
16011
16012 /// Optional. An optional request ID to identify requests. Specify a unique
16013 /// request ID so that if you must retry your request, the server will know to
16014 /// ignore the request if it has already been completed. The server will
16015 /// guarantee that for at least 60 minutes since the first request.
16016 ///
16017 /// For example, consider a situation where you make an initial request and
16018 /// the request times out. If you make the request again with the same request
16019 /// ID, the server can check if original operation with the same request ID
16020 /// was received, and if so, will ignore the second request. This prevents
16021 /// clients from accidentally creating duplicate commitments.
16022 ///
16023 /// The request ID must be a valid UUID with the exception that zero UUID is
16024 /// not supported (00000000-0000-0000-0000-000000000000).
16025 pub request_id: std::string::String,
16026
16027 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16028}
16029
16030impl CreateInternalRangeRequest {
16031 pub fn new() -> Self {
16032 std::default::Default::default()
16033 }
16034
16035 /// Sets the value of [parent][crate::model::CreateInternalRangeRequest::parent].
16036 ///
16037 /// # Example
16038 /// ```ignore,no_run
16039 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16040 /// let x = CreateInternalRangeRequest::new().set_parent("example");
16041 /// ```
16042 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16043 self.parent = v.into();
16044 self
16045 }
16046
16047 /// Sets the value of [internal_range_id][crate::model::CreateInternalRangeRequest::internal_range_id].
16048 ///
16049 /// # Example
16050 /// ```ignore,no_run
16051 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16052 /// let x = CreateInternalRangeRequest::new().set_internal_range_id("example");
16053 /// ```
16054 pub fn set_internal_range_id<T: std::convert::Into<std::string::String>>(
16055 mut self,
16056 v: T,
16057 ) -> Self {
16058 self.internal_range_id = v.into();
16059 self
16060 }
16061
16062 /// Sets the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
16063 ///
16064 /// # Example
16065 /// ```ignore,no_run
16066 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16067 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16068 /// let x = CreateInternalRangeRequest::new().set_internal_range(InternalRange::default()/* use setters */);
16069 /// ```
16070 pub fn set_internal_range<T>(mut self, v: T) -> Self
16071 where
16072 T: std::convert::Into<crate::model::InternalRange>,
16073 {
16074 self.internal_range = std::option::Option::Some(v.into());
16075 self
16076 }
16077
16078 /// Sets or clears the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
16079 ///
16080 /// # Example
16081 /// ```ignore,no_run
16082 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16083 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16084 /// let x = CreateInternalRangeRequest::new().set_or_clear_internal_range(Some(InternalRange::default()/* use setters */));
16085 /// let x = CreateInternalRangeRequest::new().set_or_clear_internal_range(None::<InternalRange>);
16086 /// ```
16087 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
16088 where
16089 T: std::convert::Into<crate::model::InternalRange>,
16090 {
16091 self.internal_range = v.map(|x| x.into());
16092 self
16093 }
16094
16095 /// Sets the value of [request_id][crate::model::CreateInternalRangeRequest::request_id].
16096 ///
16097 /// # Example
16098 /// ```ignore,no_run
16099 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16100 /// let x = CreateInternalRangeRequest::new().set_request_id("example");
16101 /// ```
16102 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16103 self.request_id = v.into();
16104 self
16105 }
16106}
16107
16108impl wkt::message::Message for CreateInternalRangeRequest {
16109 fn typename() -> &'static str {
16110 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateInternalRangeRequest"
16111 }
16112}
16113
16114/// Request for InternalRangeService.UpdateInternalRange
16115#[derive(Clone, Default, PartialEq)]
16116#[non_exhaustive]
16117pub struct UpdateInternalRangeRequest {
16118 /// Optional. Field mask is used to specify the fields to be overwritten in the
16119 /// InternalRange resource by the update.
16120 /// The fields specified in the update_mask are relative to the resource, not
16121 /// the full request. A field will be overwritten if it is in the mask. If the
16122 /// user does not provide a mask then all fields will be overwritten.
16123 pub update_mask: std::option::Option<wkt::FieldMask>,
16124
16125 /// Required. New values to be patched into the resource.
16126 pub internal_range: std::option::Option<crate::model::InternalRange>,
16127
16128 /// Optional. An optional request ID to identify requests. Specify a unique
16129 /// request ID so that if you must retry your request, the server will know to
16130 /// ignore the request if it has already been completed. The server will
16131 /// guarantee that for at least 60 minutes since the first request.
16132 ///
16133 /// For example, consider a situation where you make an initial request and
16134 /// the request times out. If you make the request again with the same request
16135 /// ID, the server can check if original operation with the same request ID
16136 /// was received, and if so, will ignore the second request. This prevents
16137 /// clients from accidentally creating duplicate commitments.
16138 ///
16139 /// The request ID must be a valid UUID with the exception that zero UUID is
16140 /// not supported (00000000-0000-0000-0000-000000000000).
16141 pub request_id: std::string::String,
16142
16143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16144}
16145
16146impl UpdateInternalRangeRequest {
16147 pub fn new() -> Self {
16148 std::default::Default::default()
16149 }
16150
16151 /// Sets the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
16152 ///
16153 /// # Example
16154 /// ```ignore,no_run
16155 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16156 /// use wkt::FieldMask;
16157 /// let x = UpdateInternalRangeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16158 /// ```
16159 pub fn set_update_mask<T>(mut self, v: T) -> Self
16160 where
16161 T: std::convert::Into<wkt::FieldMask>,
16162 {
16163 self.update_mask = std::option::Option::Some(v.into());
16164 self
16165 }
16166
16167 /// Sets or clears the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
16168 ///
16169 /// # Example
16170 /// ```ignore,no_run
16171 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16172 /// use wkt::FieldMask;
16173 /// let x = UpdateInternalRangeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16174 /// let x = UpdateInternalRangeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16175 /// ```
16176 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16177 where
16178 T: std::convert::Into<wkt::FieldMask>,
16179 {
16180 self.update_mask = v.map(|x| x.into());
16181 self
16182 }
16183
16184 /// Sets the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
16185 ///
16186 /// # Example
16187 /// ```ignore,no_run
16188 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16189 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16190 /// let x = UpdateInternalRangeRequest::new().set_internal_range(InternalRange::default()/* use setters */);
16191 /// ```
16192 pub fn set_internal_range<T>(mut self, v: T) -> Self
16193 where
16194 T: std::convert::Into<crate::model::InternalRange>,
16195 {
16196 self.internal_range = std::option::Option::Some(v.into());
16197 self
16198 }
16199
16200 /// Sets or clears the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
16201 ///
16202 /// # Example
16203 /// ```ignore,no_run
16204 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16205 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16206 /// let x = UpdateInternalRangeRequest::new().set_or_clear_internal_range(Some(InternalRange::default()/* use setters */));
16207 /// let x = UpdateInternalRangeRequest::new().set_or_clear_internal_range(None::<InternalRange>);
16208 /// ```
16209 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
16210 where
16211 T: std::convert::Into<crate::model::InternalRange>,
16212 {
16213 self.internal_range = v.map(|x| x.into());
16214 self
16215 }
16216
16217 /// Sets the value of [request_id][crate::model::UpdateInternalRangeRequest::request_id].
16218 ///
16219 /// # Example
16220 /// ```ignore,no_run
16221 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16222 /// let x = UpdateInternalRangeRequest::new().set_request_id("example");
16223 /// ```
16224 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16225 self.request_id = v.into();
16226 self
16227 }
16228}
16229
16230impl wkt::message::Message for UpdateInternalRangeRequest {
16231 fn typename() -> &'static str {
16232 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateInternalRangeRequest"
16233 }
16234}
16235
16236/// Request for InternalRangeService.DeleteInternalRange
16237#[derive(Clone, Default, PartialEq)]
16238#[non_exhaustive]
16239pub struct DeleteInternalRangeRequest {
16240 /// Required. The name of the internal range to delete.
16241 pub name: std::string::String,
16242
16243 /// Optional. An optional request ID to identify requests. Specify a unique
16244 /// request ID so that if you must retry your request, the server will know to
16245 /// ignore the request if it has already been completed. The server will
16246 /// guarantee that for at least 60 minutes after the first request.
16247 ///
16248 /// For example, consider a situation where you make an initial request and
16249 /// the request times out. If you make the request again with the same request
16250 /// ID, the server can check if original operation with the same request ID
16251 /// was received, and if so, will ignore the second request. This prevents
16252 /// clients from accidentally creating duplicate commitments.
16253 ///
16254 /// The request ID must be a valid UUID with the exception that zero UUID is
16255 /// not supported (00000000-0000-0000-0000-000000000000).
16256 pub request_id: std::string::String,
16257
16258 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16259}
16260
16261impl DeleteInternalRangeRequest {
16262 pub fn new() -> Self {
16263 std::default::Default::default()
16264 }
16265
16266 /// Sets the value of [name][crate::model::DeleteInternalRangeRequest::name].
16267 ///
16268 /// # Example
16269 /// ```ignore,no_run
16270 /// # use google_cloud_networkconnectivity_v1::model::DeleteInternalRangeRequest;
16271 /// let x = DeleteInternalRangeRequest::new().set_name("example");
16272 /// ```
16273 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16274 self.name = v.into();
16275 self
16276 }
16277
16278 /// Sets the value of [request_id][crate::model::DeleteInternalRangeRequest::request_id].
16279 ///
16280 /// # Example
16281 /// ```ignore,no_run
16282 /// # use google_cloud_networkconnectivity_v1::model::DeleteInternalRangeRequest;
16283 /// let x = DeleteInternalRangeRequest::new().set_request_id("example");
16284 /// ```
16285 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16286 self.request_id = v.into();
16287 self
16288 }
16289}
16290
16291impl wkt::message::Message for DeleteInternalRangeRequest {
16292 fn typename() -> &'static str {
16293 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteInternalRangeRequest"
16294 }
16295}
16296
16297/// Policy-based routes route L4 network traffic based on not just destination IP
16298/// address, but also source IP address, protocol, and more. If a policy-based
16299/// route conflicts with other types of routes, the policy-based route always
16300/// takes precedence.
16301#[derive(Clone, Default, PartialEq)]
16302#[non_exhaustive]
16303pub struct PolicyBasedRoute {
16304 /// Immutable. A unique name of the resource in the form of
16305 /// `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
16306 pub name: std::string::String,
16307
16308 /// Output only. Time when the policy-based route was created.
16309 pub create_time: std::option::Option<wkt::Timestamp>,
16310
16311 /// Output only. Time when the policy-based route was updated.
16312 pub update_time: std::option::Option<wkt::Timestamp>,
16313
16314 /// User-defined labels.
16315 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16316
16317 /// Optional. An optional description of this resource. Provide this field when
16318 /// you create the resource.
16319 pub description: std::string::String,
16320
16321 /// Required. Fully-qualified URL of the network that this route applies to,
16322 /// for example: projects/my-project/global/networks/my-network.
16323 pub network: std::string::String,
16324
16325 /// Required. The filter to match L4 traffic.
16326 pub filter: std::option::Option<crate::model::policy_based_route::Filter>,
16327
16328 /// Optional. The priority of this policy-based route. Priority is used to
16329 /// break ties in cases where there are more than one matching policy-based
16330 /// routes found. In cases where multiple policy-based routes are matched, the
16331 /// one with the lowest-numbered priority value wins. The default value is
16332 /// 1000. The priority value must be from 1 to 65535, inclusive.
16333 pub priority: i32,
16334
16335 /// Output only. If potential misconfigurations are detected for this route,
16336 /// this field will be populated with warning messages.
16337 pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,
16338
16339 /// Output only. Server-defined fully-qualified URL for this resource.
16340 pub self_link: std::string::String,
16341
16342 /// Output only. Type of this resource. Always
16343 /// networkconnectivity#policyBasedRoute for policy-based Route resources.
16344 pub kind: std::string::String,
16345
16346 /// Target specifies network endpoints that this policy-based route applies to.
16347 /// If no target is specified, the PBR will be installed on all network
16348 /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
16349 pub target: std::option::Option<crate::model::policy_based_route::Target>,
16350
16351 pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,
16352
16353 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16354}
16355
16356impl PolicyBasedRoute {
16357 pub fn new() -> Self {
16358 std::default::Default::default()
16359 }
16360
16361 /// Sets the value of [name][crate::model::PolicyBasedRoute::name].
16362 ///
16363 /// # Example
16364 /// ```ignore,no_run
16365 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16366 /// let x = PolicyBasedRoute::new().set_name("example");
16367 /// ```
16368 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16369 self.name = v.into();
16370 self
16371 }
16372
16373 /// Sets the value of [create_time][crate::model::PolicyBasedRoute::create_time].
16374 ///
16375 /// # Example
16376 /// ```ignore,no_run
16377 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16378 /// use wkt::Timestamp;
16379 /// let x = PolicyBasedRoute::new().set_create_time(Timestamp::default()/* use setters */);
16380 /// ```
16381 pub fn set_create_time<T>(mut self, v: T) -> Self
16382 where
16383 T: std::convert::Into<wkt::Timestamp>,
16384 {
16385 self.create_time = std::option::Option::Some(v.into());
16386 self
16387 }
16388
16389 /// Sets or clears the value of [create_time][crate::model::PolicyBasedRoute::create_time].
16390 ///
16391 /// # Example
16392 /// ```ignore,no_run
16393 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16394 /// use wkt::Timestamp;
16395 /// let x = PolicyBasedRoute::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16396 /// let x = PolicyBasedRoute::new().set_or_clear_create_time(None::<Timestamp>);
16397 /// ```
16398 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16399 where
16400 T: std::convert::Into<wkt::Timestamp>,
16401 {
16402 self.create_time = v.map(|x| x.into());
16403 self
16404 }
16405
16406 /// Sets the value of [update_time][crate::model::PolicyBasedRoute::update_time].
16407 ///
16408 /// # Example
16409 /// ```ignore,no_run
16410 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16411 /// use wkt::Timestamp;
16412 /// let x = PolicyBasedRoute::new().set_update_time(Timestamp::default()/* use setters */);
16413 /// ```
16414 pub fn set_update_time<T>(mut self, v: T) -> Self
16415 where
16416 T: std::convert::Into<wkt::Timestamp>,
16417 {
16418 self.update_time = std::option::Option::Some(v.into());
16419 self
16420 }
16421
16422 /// Sets or clears the value of [update_time][crate::model::PolicyBasedRoute::update_time].
16423 ///
16424 /// # Example
16425 /// ```ignore,no_run
16426 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16427 /// use wkt::Timestamp;
16428 /// let x = PolicyBasedRoute::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16429 /// let x = PolicyBasedRoute::new().set_or_clear_update_time(None::<Timestamp>);
16430 /// ```
16431 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16432 where
16433 T: std::convert::Into<wkt::Timestamp>,
16434 {
16435 self.update_time = v.map(|x| x.into());
16436 self
16437 }
16438
16439 /// Sets the value of [labels][crate::model::PolicyBasedRoute::labels].
16440 ///
16441 /// # Example
16442 /// ```ignore,no_run
16443 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16444 /// let x = PolicyBasedRoute::new().set_labels([
16445 /// ("key0", "abc"),
16446 /// ("key1", "xyz"),
16447 /// ]);
16448 /// ```
16449 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16450 where
16451 T: std::iter::IntoIterator<Item = (K, V)>,
16452 K: std::convert::Into<std::string::String>,
16453 V: std::convert::Into<std::string::String>,
16454 {
16455 use std::iter::Iterator;
16456 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16457 self
16458 }
16459
16460 /// Sets the value of [description][crate::model::PolicyBasedRoute::description].
16461 ///
16462 /// # Example
16463 /// ```ignore,no_run
16464 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16465 /// let x = PolicyBasedRoute::new().set_description("example");
16466 /// ```
16467 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16468 self.description = v.into();
16469 self
16470 }
16471
16472 /// Sets the value of [network][crate::model::PolicyBasedRoute::network].
16473 ///
16474 /// # Example
16475 /// ```ignore,no_run
16476 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16477 /// let x = PolicyBasedRoute::new().set_network("example");
16478 /// ```
16479 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16480 self.network = v.into();
16481 self
16482 }
16483
16484 /// Sets the value of [filter][crate::model::PolicyBasedRoute::filter].
16485 ///
16486 /// # Example
16487 /// ```ignore,no_run
16488 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16489 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16490 /// let x = PolicyBasedRoute::new().set_filter(Filter::default()/* use setters */);
16491 /// ```
16492 pub fn set_filter<T>(mut self, v: T) -> Self
16493 where
16494 T: std::convert::Into<crate::model::policy_based_route::Filter>,
16495 {
16496 self.filter = std::option::Option::Some(v.into());
16497 self
16498 }
16499
16500 /// Sets or clears the value of [filter][crate::model::PolicyBasedRoute::filter].
16501 ///
16502 /// # Example
16503 /// ```ignore,no_run
16504 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16505 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16506 /// let x = PolicyBasedRoute::new().set_or_clear_filter(Some(Filter::default()/* use setters */));
16507 /// let x = PolicyBasedRoute::new().set_or_clear_filter(None::<Filter>);
16508 /// ```
16509 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
16510 where
16511 T: std::convert::Into<crate::model::policy_based_route::Filter>,
16512 {
16513 self.filter = v.map(|x| x.into());
16514 self
16515 }
16516
16517 /// Sets the value of [priority][crate::model::PolicyBasedRoute::priority].
16518 ///
16519 /// # Example
16520 /// ```ignore,no_run
16521 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16522 /// let x = PolicyBasedRoute::new().set_priority(42);
16523 /// ```
16524 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16525 self.priority = v.into();
16526 self
16527 }
16528
16529 /// Sets the value of [warnings][crate::model::PolicyBasedRoute::warnings].
16530 ///
16531 /// # Example
16532 /// ```ignore,no_run
16533 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16534 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
16535 /// let x = PolicyBasedRoute::new()
16536 /// .set_warnings([
16537 /// Warnings::default()/* use setters */,
16538 /// Warnings::default()/* use (different) setters */,
16539 /// ]);
16540 /// ```
16541 pub fn set_warnings<T, V>(mut self, v: T) -> Self
16542 where
16543 T: std::iter::IntoIterator<Item = V>,
16544 V: std::convert::Into<crate::model::policy_based_route::Warnings>,
16545 {
16546 use std::iter::Iterator;
16547 self.warnings = v.into_iter().map(|i| i.into()).collect();
16548 self
16549 }
16550
16551 /// Sets the value of [self_link][crate::model::PolicyBasedRoute::self_link].
16552 ///
16553 /// # Example
16554 /// ```ignore,no_run
16555 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16556 /// let x = PolicyBasedRoute::new().set_self_link("example");
16557 /// ```
16558 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16559 self.self_link = v.into();
16560 self
16561 }
16562
16563 /// Sets the value of [kind][crate::model::PolicyBasedRoute::kind].
16564 ///
16565 /// # Example
16566 /// ```ignore,no_run
16567 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16568 /// let x = PolicyBasedRoute::new().set_kind("example");
16569 /// ```
16570 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16571 self.kind = v.into();
16572 self
16573 }
16574
16575 /// Sets the value of [target][crate::model::PolicyBasedRoute::target].
16576 ///
16577 /// Note that all the setters affecting `target` are mutually
16578 /// exclusive.
16579 ///
16580 /// # Example
16581 /// ```ignore,no_run
16582 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16583 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16584 /// let x = PolicyBasedRoute::new().set_target(Some(
16585 /// google_cloud_networkconnectivity_v1::model::policy_based_route::Target::VirtualMachine(VirtualMachine::default().into())));
16586 /// ```
16587 pub fn set_target<
16588 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
16589 >(
16590 mut self,
16591 v: T,
16592 ) -> Self {
16593 self.target = v.into();
16594 self
16595 }
16596
16597 /// The value of [target][crate::model::PolicyBasedRoute::target]
16598 /// if it holds a `VirtualMachine`, `None` if the field is not set or
16599 /// holds a different branch.
16600 pub fn virtual_machine(
16601 &self,
16602 ) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
16603 {
16604 #[allow(unreachable_patterns)]
16605 self.target.as_ref().and_then(|v| match v {
16606 crate::model::policy_based_route::Target::VirtualMachine(v) => {
16607 std::option::Option::Some(v)
16608 }
16609 _ => std::option::Option::None,
16610 })
16611 }
16612
16613 /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
16614 /// to hold a `VirtualMachine`.
16615 ///
16616 /// Note that all the setters affecting `target` are
16617 /// mutually exclusive.
16618 ///
16619 /// # Example
16620 /// ```ignore,no_run
16621 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16622 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16623 /// let x = PolicyBasedRoute::new().set_virtual_machine(VirtualMachine::default()/* use setters */);
16624 /// assert!(x.virtual_machine().is_some());
16625 /// assert!(x.interconnect_attachment().is_none());
16626 /// ```
16627 pub fn set_virtual_machine<
16628 T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
16629 >(
16630 mut self,
16631 v: T,
16632 ) -> Self {
16633 self.target = std::option::Option::Some(
16634 crate::model::policy_based_route::Target::VirtualMachine(v.into()),
16635 );
16636 self
16637 }
16638
16639 /// The value of [target][crate::model::PolicyBasedRoute::target]
16640 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
16641 /// holds a different branch.
16642 pub fn interconnect_attachment(
16643 &self,
16644 ) -> std::option::Option<
16645 &std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
16646 > {
16647 #[allow(unreachable_patterns)]
16648 self.target.as_ref().and_then(|v| match v {
16649 crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
16650 std::option::Option::Some(v)
16651 }
16652 _ => std::option::Option::None,
16653 })
16654 }
16655
16656 /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
16657 /// to hold a `InterconnectAttachment`.
16658 ///
16659 /// Note that all the setters affecting `target` are
16660 /// mutually exclusive.
16661 ///
16662 /// # Example
16663 /// ```ignore,no_run
16664 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16665 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::InterconnectAttachment;
16666 /// let x = PolicyBasedRoute::new().set_interconnect_attachment(InterconnectAttachment::default()/* use setters */);
16667 /// assert!(x.interconnect_attachment().is_some());
16668 /// assert!(x.virtual_machine().is_none());
16669 /// ```
16670 pub fn set_interconnect_attachment<
16671 T: std::convert::Into<
16672 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
16673 >,
16674 >(
16675 mut self,
16676 v: T,
16677 ) -> Self {
16678 self.target = std::option::Option::Some(
16679 crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
16680 );
16681 self
16682 }
16683
16684 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop].
16685 ///
16686 /// Note that all the setters affecting `next_hop` are mutually
16687 /// exclusive.
16688 ///
16689 /// # Example
16690 /// ```ignore,no_run
16691 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16692 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::NextHop;
16693 /// let x = PolicyBasedRoute::new().set_next_hop(Some(NextHop::NextHopIlbIp("example".to_string())));
16694 /// ```
16695 pub fn set_next_hop<
16696 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
16697 >(
16698 mut self,
16699 v: T,
16700 ) -> Self {
16701 self.next_hop = v.into();
16702 self
16703 }
16704
16705 /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16706 /// if it holds a `NextHopIlbIp`, `None` if the field is not set or
16707 /// holds a different branch.
16708 pub fn next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
16709 #[allow(unreachable_patterns)]
16710 self.next_hop.as_ref().and_then(|v| match v {
16711 crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
16712 std::option::Option::Some(v)
16713 }
16714 _ => std::option::Option::None,
16715 })
16716 }
16717
16718 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16719 /// to hold a `NextHopIlbIp`.
16720 ///
16721 /// Note that all the setters affecting `next_hop` are
16722 /// mutually exclusive.
16723 ///
16724 /// # Example
16725 /// ```ignore,no_run
16726 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16727 /// let x = PolicyBasedRoute::new().set_next_hop_ilb_ip("example");
16728 /// assert!(x.next_hop_ilb_ip().is_some());
16729 /// assert!(x.next_hop_other_routes().is_none());
16730 /// ```
16731 pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16732 self.next_hop = std::option::Option::Some(
16733 crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
16734 );
16735 self
16736 }
16737
16738 /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16739 /// if it holds a `NextHopOtherRoutes`, `None` if the field is not set or
16740 /// holds a different branch.
16741 pub fn next_hop_other_routes(
16742 &self,
16743 ) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
16744 #[allow(unreachable_patterns)]
16745 self.next_hop.as_ref().and_then(|v| match v {
16746 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
16747 std::option::Option::Some(v)
16748 }
16749 _ => std::option::Option::None,
16750 })
16751 }
16752
16753 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16754 /// to hold a `NextHopOtherRoutes`.
16755 ///
16756 /// Note that all the setters affecting `next_hop` are
16757 /// mutually exclusive.
16758 ///
16759 /// # Example
16760 /// ```ignore,no_run
16761 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16762 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::OtherRoutes;
16763 /// let x0 = PolicyBasedRoute::new().set_next_hop_other_routes(OtherRoutes::DefaultRouting);
16764 /// assert!(x0.next_hop_other_routes().is_some());
16765 /// assert!(x0.next_hop_ilb_ip().is_none());
16766 /// ```
16767 pub fn set_next_hop_other_routes<
16768 T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
16769 >(
16770 mut self,
16771 v: T,
16772 ) -> Self {
16773 self.next_hop = std::option::Option::Some(
16774 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
16775 );
16776 self
16777 }
16778}
16779
16780impl wkt::message::Message for PolicyBasedRoute {
16781 fn typename() -> &'static str {
16782 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
16783 }
16784}
16785
16786/// Defines additional types related to [PolicyBasedRoute].
16787pub mod policy_based_route {
16788 #[allow(unused_imports)]
16789 use super::*;
16790
16791 /// VM instances that this policy-based route applies to.
16792 #[derive(Clone, Default, PartialEq)]
16793 #[non_exhaustive]
16794 pub struct VirtualMachine {
16795 /// Optional. A list of VM instance tags that this policy-based route applies
16796 /// to. VM instances that have ANY of tags specified here installs this PBR.
16797 pub tags: std::vec::Vec<std::string::String>,
16798
16799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16800 }
16801
16802 impl VirtualMachine {
16803 pub fn new() -> Self {
16804 std::default::Default::default()
16805 }
16806
16807 /// Sets the value of [tags][crate::model::policy_based_route::VirtualMachine::tags].
16808 ///
16809 /// # Example
16810 /// ```ignore,no_run
16811 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16812 /// let x = VirtualMachine::new().set_tags(["a", "b", "c"]);
16813 /// ```
16814 pub fn set_tags<T, V>(mut self, v: T) -> Self
16815 where
16816 T: std::iter::IntoIterator<Item = V>,
16817 V: std::convert::Into<std::string::String>,
16818 {
16819 use std::iter::Iterator;
16820 self.tags = v.into_iter().map(|i| i.into()).collect();
16821 self
16822 }
16823 }
16824
16825 impl wkt::message::Message for VirtualMachine {
16826 fn typename() -> &'static str {
16827 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
16828 }
16829 }
16830
16831 /// InterconnectAttachment that this route applies to.
16832 #[derive(Clone, Default, PartialEq)]
16833 #[non_exhaustive]
16834 pub struct InterconnectAttachment {
16835 /// Optional. Cloud region to install this policy-based route on interconnect
16836 /// attachment. Use `all` to install it on all interconnect attachments.
16837 pub region: std::string::String,
16838
16839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16840 }
16841
16842 impl InterconnectAttachment {
16843 pub fn new() -> Self {
16844 std::default::Default::default()
16845 }
16846
16847 /// Sets the value of [region][crate::model::policy_based_route::InterconnectAttachment::region].
16848 ///
16849 /// # Example
16850 /// ```ignore,no_run
16851 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::InterconnectAttachment;
16852 /// let x = InterconnectAttachment::new().set_region("example");
16853 /// ```
16854 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16855 self.region = v.into();
16856 self
16857 }
16858 }
16859
16860 impl wkt::message::Message for InterconnectAttachment {
16861 fn typename() -> &'static str {
16862 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
16863 }
16864 }
16865
16866 /// Filter matches L4 traffic.
16867 #[derive(Clone, Default, PartialEq)]
16868 #[non_exhaustive]
16869 pub struct Filter {
16870 /// Optional. The IP protocol that this policy-based route applies to. Valid
16871 /// values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
16872 pub ip_protocol: std::string::String,
16873
16874 /// Optional. The source IP range of outgoing packets that this policy-based
16875 /// route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
16876 pub src_range: std::string::String,
16877
16878 /// Optional. The destination IP range of outgoing packets that this
16879 /// policy-based route applies to. Default is "0.0.0.0/0" if protocol version
16880 /// is IPv4.
16881 pub dest_range: std::string::String,
16882
16883 /// Required. Internet protocol versions this policy-based route applies to.
16884 /// For this version, only IPV4 is supported. IPV6 is supported in preview.
16885 pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,
16886
16887 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16888 }
16889
16890 impl Filter {
16891 pub fn new() -> Self {
16892 std::default::Default::default()
16893 }
16894
16895 /// Sets the value of [ip_protocol][crate::model::policy_based_route::Filter::ip_protocol].
16896 ///
16897 /// # Example
16898 /// ```ignore,no_run
16899 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16900 /// let x = Filter::new().set_ip_protocol("example");
16901 /// ```
16902 pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16903 self.ip_protocol = v.into();
16904 self
16905 }
16906
16907 /// Sets the value of [src_range][crate::model::policy_based_route::Filter::src_range].
16908 ///
16909 /// # Example
16910 /// ```ignore,no_run
16911 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16912 /// let x = Filter::new().set_src_range("example");
16913 /// ```
16914 pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16915 self.src_range = v.into();
16916 self
16917 }
16918
16919 /// Sets the value of [dest_range][crate::model::policy_based_route::Filter::dest_range].
16920 ///
16921 /// # Example
16922 /// ```ignore,no_run
16923 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16924 /// let x = Filter::new().set_dest_range("example");
16925 /// ```
16926 pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16927 self.dest_range = v.into();
16928 self
16929 }
16930
16931 /// Sets the value of [protocol_version][crate::model::policy_based_route::Filter::protocol_version].
16932 ///
16933 /// # Example
16934 /// ```ignore,no_run
16935 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16936 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::filter::ProtocolVersion;
16937 /// let x0 = Filter::new().set_protocol_version(ProtocolVersion::Ipv4);
16938 /// ```
16939 pub fn set_protocol_version<
16940 T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
16941 >(
16942 mut self,
16943 v: T,
16944 ) -> Self {
16945 self.protocol_version = v.into();
16946 self
16947 }
16948 }
16949
16950 impl wkt::message::Message for Filter {
16951 fn typename() -> &'static str {
16952 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
16953 }
16954 }
16955
16956 /// Defines additional types related to [Filter].
16957 pub mod filter {
16958 #[allow(unused_imports)]
16959 use super::*;
16960
16961 /// The internet protocol version.
16962 ///
16963 /// # Working with unknown values
16964 ///
16965 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16966 /// additional enum variants at any time. Adding new variants is not considered
16967 /// a breaking change. Applications should write their code in anticipation of:
16968 ///
16969 /// - New values appearing in future releases of the client library, **and**
16970 /// - New values received dynamically, without application changes.
16971 ///
16972 /// Please consult the [Working with enums] section in the user guide for some
16973 /// guidelines.
16974 ///
16975 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16976 #[derive(Clone, Debug, PartialEq)]
16977 #[non_exhaustive]
16978 pub enum ProtocolVersion {
16979 /// Default value.
16980 Unspecified,
16981 /// The PBR is for IPv4 internet protocol traffic.
16982 Ipv4,
16983 /// If set, the enum was initialized with an unknown value.
16984 ///
16985 /// Applications can examine the value using [ProtocolVersion::value] or
16986 /// [ProtocolVersion::name].
16987 UnknownValue(protocol_version::UnknownValue),
16988 }
16989
16990 #[doc(hidden)]
16991 pub mod protocol_version {
16992 #[allow(unused_imports)]
16993 use super::*;
16994 #[derive(Clone, Debug, PartialEq)]
16995 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16996 }
16997
16998 impl ProtocolVersion {
16999 /// Gets the enum value.
17000 ///
17001 /// Returns `None` if the enum contains an unknown value deserialized from
17002 /// the string representation of enums.
17003 pub fn value(&self) -> std::option::Option<i32> {
17004 match self {
17005 Self::Unspecified => std::option::Option::Some(0),
17006 Self::Ipv4 => std::option::Option::Some(1),
17007 Self::UnknownValue(u) => u.0.value(),
17008 }
17009 }
17010
17011 /// Gets the enum value as a string.
17012 ///
17013 /// Returns `None` if the enum contains an unknown value deserialized from
17014 /// the integer representation of enums.
17015 pub fn name(&self) -> std::option::Option<&str> {
17016 match self {
17017 Self::Unspecified => std::option::Option::Some("PROTOCOL_VERSION_UNSPECIFIED"),
17018 Self::Ipv4 => std::option::Option::Some("IPV4"),
17019 Self::UnknownValue(u) => u.0.name(),
17020 }
17021 }
17022 }
17023
17024 impl std::default::Default for ProtocolVersion {
17025 fn default() -> Self {
17026 use std::convert::From;
17027 Self::from(0)
17028 }
17029 }
17030
17031 impl std::fmt::Display for ProtocolVersion {
17032 fn fmt(
17033 &self,
17034 f: &mut std::fmt::Formatter<'_>,
17035 ) -> std::result::Result<(), std::fmt::Error> {
17036 wkt::internal::display_enum(f, self.name(), self.value())
17037 }
17038 }
17039
17040 impl std::convert::From<i32> for ProtocolVersion {
17041 fn from(value: i32) -> Self {
17042 match value {
17043 0 => Self::Unspecified,
17044 1 => Self::Ipv4,
17045 _ => Self::UnknownValue(protocol_version::UnknownValue(
17046 wkt::internal::UnknownEnumValue::Integer(value),
17047 )),
17048 }
17049 }
17050 }
17051
17052 impl std::convert::From<&str> for ProtocolVersion {
17053 fn from(value: &str) -> Self {
17054 use std::string::ToString;
17055 match value {
17056 "PROTOCOL_VERSION_UNSPECIFIED" => Self::Unspecified,
17057 "IPV4" => Self::Ipv4,
17058 _ => Self::UnknownValue(protocol_version::UnknownValue(
17059 wkt::internal::UnknownEnumValue::String(value.to_string()),
17060 )),
17061 }
17062 }
17063 }
17064
17065 impl serde::ser::Serialize for ProtocolVersion {
17066 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17067 where
17068 S: serde::Serializer,
17069 {
17070 match self {
17071 Self::Unspecified => serializer.serialize_i32(0),
17072 Self::Ipv4 => serializer.serialize_i32(1),
17073 Self::UnknownValue(u) => u.0.serialize(serializer),
17074 }
17075 }
17076 }
17077
17078 impl<'de> serde::de::Deserialize<'de> for ProtocolVersion {
17079 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17080 where
17081 D: serde::Deserializer<'de>,
17082 {
17083 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProtocolVersion>::new(
17084 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion",
17085 ))
17086 }
17087 }
17088 }
17089
17090 /// Informational warning message.
17091 #[derive(Clone, Default, PartialEq)]
17092 #[non_exhaustive]
17093 pub struct Warnings {
17094 /// Output only. A warning code, if applicable.
17095 pub code: crate::model::policy_based_route::warnings::Code,
17096
17097 /// Output only. Metadata about this warning in key: value format. The key
17098 /// should provides more detail on the warning being returned. For example,
17099 /// for warnings where there are no results in a list request for a
17100 /// particular zone, this key might be scope and the key value might be the
17101 /// zone name. Other examples might be a key indicating a deprecated resource
17102 /// and a suggested replacement.
17103 pub data: std::collections::HashMap<std::string::String, std::string::String>,
17104
17105 /// Output only. A human-readable description of the warning code.
17106 pub warning_message: std::string::String,
17107
17108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17109 }
17110
17111 impl Warnings {
17112 pub fn new() -> Self {
17113 std::default::Default::default()
17114 }
17115
17116 /// Sets the value of [code][crate::model::policy_based_route::Warnings::code].
17117 ///
17118 /// # Example
17119 /// ```ignore,no_run
17120 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17121 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::warnings::Code;
17122 /// let x0 = Warnings::new().set_code(Code::ResourceNotActive);
17123 /// let x1 = Warnings::new().set_code(Code::ResourceBeingModified);
17124 /// ```
17125 pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
17126 mut self,
17127 v: T,
17128 ) -> Self {
17129 self.code = v.into();
17130 self
17131 }
17132
17133 /// Sets the value of [data][crate::model::policy_based_route::Warnings::data].
17134 ///
17135 /// # Example
17136 /// ```ignore,no_run
17137 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17138 /// let x = Warnings::new().set_data([
17139 /// ("key0", "abc"),
17140 /// ("key1", "xyz"),
17141 /// ]);
17142 /// ```
17143 pub fn set_data<T, K, V>(mut self, v: T) -> Self
17144 where
17145 T: std::iter::IntoIterator<Item = (K, V)>,
17146 K: std::convert::Into<std::string::String>,
17147 V: std::convert::Into<std::string::String>,
17148 {
17149 use std::iter::Iterator;
17150 self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17151 self
17152 }
17153
17154 /// Sets the value of [warning_message][crate::model::policy_based_route::Warnings::warning_message].
17155 ///
17156 /// # Example
17157 /// ```ignore,no_run
17158 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17159 /// let x = Warnings::new().set_warning_message("example");
17160 /// ```
17161 pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
17162 mut self,
17163 v: T,
17164 ) -> Self {
17165 self.warning_message = v.into();
17166 self
17167 }
17168 }
17169
17170 impl wkt::message::Message for Warnings {
17171 fn typename() -> &'static str {
17172 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
17173 }
17174 }
17175
17176 /// Defines additional types related to [Warnings].
17177 pub mod warnings {
17178 #[allow(unused_imports)]
17179 use super::*;
17180
17181 /// Warning code for policy-based routing. Expect to add values in the
17182 /// future.
17183 ///
17184 /// # Working with unknown values
17185 ///
17186 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17187 /// additional enum variants at any time. Adding new variants is not considered
17188 /// a breaking change. Applications should write their code in anticipation of:
17189 ///
17190 /// - New values appearing in future releases of the client library, **and**
17191 /// - New values received dynamically, without application changes.
17192 ///
17193 /// Please consult the [Working with enums] section in the user guide for some
17194 /// guidelines.
17195 ///
17196 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17197 #[derive(Clone, Debug, PartialEq)]
17198 #[non_exhaustive]
17199 pub enum Code {
17200 /// Default value.
17201 WarningUnspecified,
17202 /// The policy-based route is not active and functioning. Common causes are
17203 /// that the dependent network was deleted or the resource project was
17204 /// turned off.
17205 ResourceNotActive,
17206 /// The policy-based route is being modified (e.g. created/deleted) at this
17207 /// time.
17208 ResourceBeingModified,
17209 /// If set, the enum was initialized with an unknown value.
17210 ///
17211 /// Applications can examine the value using [Code::value] or
17212 /// [Code::name].
17213 UnknownValue(code::UnknownValue),
17214 }
17215
17216 #[doc(hidden)]
17217 pub mod code {
17218 #[allow(unused_imports)]
17219 use super::*;
17220 #[derive(Clone, Debug, PartialEq)]
17221 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17222 }
17223
17224 impl Code {
17225 /// Gets the enum value.
17226 ///
17227 /// Returns `None` if the enum contains an unknown value deserialized from
17228 /// the string representation of enums.
17229 pub fn value(&self) -> std::option::Option<i32> {
17230 match self {
17231 Self::WarningUnspecified => std::option::Option::Some(0),
17232 Self::ResourceNotActive => std::option::Option::Some(1),
17233 Self::ResourceBeingModified => std::option::Option::Some(2),
17234 Self::UnknownValue(u) => u.0.value(),
17235 }
17236 }
17237
17238 /// Gets the enum value as a string.
17239 ///
17240 /// Returns `None` if the enum contains an unknown value deserialized from
17241 /// the integer representation of enums.
17242 pub fn name(&self) -> std::option::Option<&str> {
17243 match self {
17244 Self::WarningUnspecified => std::option::Option::Some("WARNING_UNSPECIFIED"),
17245 Self::ResourceNotActive => std::option::Option::Some("RESOURCE_NOT_ACTIVE"),
17246 Self::ResourceBeingModified => {
17247 std::option::Option::Some("RESOURCE_BEING_MODIFIED")
17248 }
17249 Self::UnknownValue(u) => u.0.name(),
17250 }
17251 }
17252 }
17253
17254 impl std::default::Default for Code {
17255 fn default() -> Self {
17256 use std::convert::From;
17257 Self::from(0)
17258 }
17259 }
17260
17261 impl std::fmt::Display for Code {
17262 fn fmt(
17263 &self,
17264 f: &mut std::fmt::Formatter<'_>,
17265 ) -> std::result::Result<(), std::fmt::Error> {
17266 wkt::internal::display_enum(f, self.name(), self.value())
17267 }
17268 }
17269
17270 impl std::convert::From<i32> for Code {
17271 fn from(value: i32) -> Self {
17272 match value {
17273 0 => Self::WarningUnspecified,
17274 1 => Self::ResourceNotActive,
17275 2 => Self::ResourceBeingModified,
17276 _ => Self::UnknownValue(code::UnknownValue(
17277 wkt::internal::UnknownEnumValue::Integer(value),
17278 )),
17279 }
17280 }
17281 }
17282
17283 impl std::convert::From<&str> for Code {
17284 fn from(value: &str) -> Self {
17285 use std::string::ToString;
17286 match value {
17287 "WARNING_UNSPECIFIED" => Self::WarningUnspecified,
17288 "RESOURCE_NOT_ACTIVE" => Self::ResourceNotActive,
17289 "RESOURCE_BEING_MODIFIED" => Self::ResourceBeingModified,
17290 _ => Self::UnknownValue(code::UnknownValue(
17291 wkt::internal::UnknownEnumValue::String(value.to_string()),
17292 )),
17293 }
17294 }
17295 }
17296
17297 impl serde::ser::Serialize for Code {
17298 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17299 where
17300 S: serde::Serializer,
17301 {
17302 match self {
17303 Self::WarningUnspecified => serializer.serialize_i32(0),
17304 Self::ResourceNotActive => serializer.serialize_i32(1),
17305 Self::ResourceBeingModified => serializer.serialize_i32(2),
17306 Self::UnknownValue(u) => u.0.serialize(serializer),
17307 }
17308 }
17309 }
17310
17311 impl<'de> serde::de::Deserialize<'de> for Code {
17312 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17313 where
17314 D: serde::Deserializer<'de>,
17315 {
17316 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
17317 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code",
17318 ))
17319 }
17320 }
17321 }
17322
17323 /// The other routing cases.
17324 ///
17325 /// # Working with unknown values
17326 ///
17327 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17328 /// additional enum variants at any time. Adding new variants is not considered
17329 /// a breaking change. Applications should write their code in anticipation of:
17330 ///
17331 /// - New values appearing in future releases of the client library, **and**
17332 /// - New values received dynamically, without application changes.
17333 ///
17334 /// Please consult the [Working with enums] section in the user guide for some
17335 /// guidelines.
17336 ///
17337 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17338 #[derive(Clone, Debug, PartialEq)]
17339 #[non_exhaustive]
17340 pub enum OtherRoutes {
17341 /// Default value.
17342 Unspecified,
17343 /// Use the routes from the default routing tables (system-generated routes,
17344 /// custom routes, peering route) to determine the next hop. This effectively
17345 /// excludes matching packets being applied on other PBRs with a lower
17346 /// priority.
17347 DefaultRouting,
17348 /// If set, the enum was initialized with an unknown value.
17349 ///
17350 /// Applications can examine the value using [OtherRoutes::value] or
17351 /// [OtherRoutes::name].
17352 UnknownValue(other_routes::UnknownValue),
17353 }
17354
17355 #[doc(hidden)]
17356 pub mod other_routes {
17357 #[allow(unused_imports)]
17358 use super::*;
17359 #[derive(Clone, Debug, PartialEq)]
17360 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17361 }
17362
17363 impl OtherRoutes {
17364 /// Gets the enum value.
17365 ///
17366 /// Returns `None` if the enum contains an unknown value deserialized from
17367 /// the string representation of enums.
17368 pub fn value(&self) -> std::option::Option<i32> {
17369 match self {
17370 Self::Unspecified => std::option::Option::Some(0),
17371 Self::DefaultRouting => std::option::Option::Some(1),
17372 Self::UnknownValue(u) => u.0.value(),
17373 }
17374 }
17375
17376 /// Gets the enum value as a string.
17377 ///
17378 /// Returns `None` if the enum contains an unknown value deserialized from
17379 /// the integer representation of enums.
17380 pub fn name(&self) -> std::option::Option<&str> {
17381 match self {
17382 Self::Unspecified => std::option::Option::Some("OTHER_ROUTES_UNSPECIFIED"),
17383 Self::DefaultRouting => std::option::Option::Some("DEFAULT_ROUTING"),
17384 Self::UnknownValue(u) => u.0.name(),
17385 }
17386 }
17387 }
17388
17389 impl std::default::Default for OtherRoutes {
17390 fn default() -> Self {
17391 use std::convert::From;
17392 Self::from(0)
17393 }
17394 }
17395
17396 impl std::fmt::Display for OtherRoutes {
17397 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17398 wkt::internal::display_enum(f, self.name(), self.value())
17399 }
17400 }
17401
17402 impl std::convert::From<i32> for OtherRoutes {
17403 fn from(value: i32) -> Self {
17404 match value {
17405 0 => Self::Unspecified,
17406 1 => Self::DefaultRouting,
17407 _ => Self::UnknownValue(other_routes::UnknownValue(
17408 wkt::internal::UnknownEnumValue::Integer(value),
17409 )),
17410 }
17411 }
17412 }
17413
17414 impl std::convert::From<&str> for OtherRoutes {
17415 fn from(value: &str) -> Self {
17416 use std::string::ToString;
17417 match value {
17418 "OTHER_ROUTES_UNSPECIFIED" => Self::Unspecified,
17419 "DEFAULT_ROUTING" => Self::DefaultRouting,
17420 _ => Self::UnknownValue(other_routes::UnknownValue(
17421 wkt::internal::UnknownEnumValue::String(value.to_string()),
17422 )),
17423 }
17424 }
17425 }
17426
17427 impl serde::ser::Serialize for OtherRoutes {
17428 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17429 where
17430 S: serde::Serializer,
17431 {
17432 match self {
17433 Self::Unspecified => serializer.serialize_i32(0),
17434 Self::DefaultRouting => serializer.serialize_i32(1),
17435 Self::UnknownValue(u) => u.0.serialize(serializer),
17436 }
17437 }
17438 }
17439
17440 impl<'de> serde::de::Deserialize<'de> for OtherRoutes {
17441 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17442 where
17443 D: serde::Deserializer<'de>,
17444 {
17445 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OtherRoutes>::new(
17446 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes",
17447 ))
17448 }
17449 }
17450
17451 /// Target specifies network endpoints that this policy-based route applies to.
17452 /// If no target is specified, the PBR will be installed on all network
17453 /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
17454 #[derive(Clone, Debug, PartialEq)]
17455 #[non_exhaustive]
17456 pub enum Target {
17457 /// Optional. VM instances that this policy-based route applies to.
17458 VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
17459 /// Optional. The interconnect attachments that this policy-based route
17460 /// applies to.
17461 InterconnectAttachment(
17462 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
17463 ),
17464 }
17465
17466 #[derive(Clone, Debug, PartialEq)]
17467 #[non_exhaustive]
17468 pub enum NextHop {
17469 /// Optional. The IP address of a global-access-enabled L4 ILB that is the
17470 /// next hop for matching packets. For this version, only nextHopIlbIp is
17471 /// supported.
17472 NextHopIlbIp(std::string::String),
17473 /// Optional. Other routes that will be referenced to determine the next hop
17474 /// of the packet.
17475 NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
17476 }
17477}
17478
17479/// Request for
17480/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
17481/// method.
17482///
17483/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
17484#[derive(Clone, Default, PartialEq)]
17485#[non_exhaustive]
17486pub struct ListPolicyBasedRoutesRequest {
17487 /// Required. The parent resource's name.
17488 pub parent: std::string::String,
17489
17490 /// The maximum number of results per page that should be returned.
17491 pub page_size: i32,
17492
17493 /// The page token.
17494 pub page_token: std::string::String,
17495
17496 /// A filter expression that filters the results listed in the response.
17497 pub filter: std::string::String,
17498
17499 /// Sort the results by a certain order.
17500 pub order_by: std::string::String,
17501
17502 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17503}
17504
17505impl ListPolicyBasedRoutesRequest {
17506 pub fn new() -> Self {
17507 std::default::Default::default()
17508 }
17509
17510 /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
17511 ///
17512 /// # Example
17513 /// ```ignore,no_run
17514 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17515 /// let x = ListPolicyBasedRoutesRequest::new().set_parent("example");
17516 /// ```
17517 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17518 self.parent = v.into();
17519 self
17520 }
17521
17522 /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
17523 ///
17524 /// # Example
17525 /// ```ignore,no_run
17526 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17527 /// let x = ListPolicyBasedRoutesRequest::new().set_page_size(42);
17528 /// ```
17529 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17530 self.page_size = v.into();
17531 self
17532 }
17533
17534 /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
17535 ///
17536 /// # Example
17537 /// ```ignore,no_run
17538 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17539 /// let x = ListPolicyBasedRoutesRequest::new().set_page_token("example");
17540 /// ```
17541 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17542 self.page_token = v.into();
17543 self
17544 }
17545
17546 /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
17547 ///
17548 /// # Example
17549 /// ```ignore,no_run
17550 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17551 /// let x = ListPolicyBasedRoutesRequest::new().set_filter("example");
17552 /// ```
17553 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17554 self.filter = v.into();
17555 self
17556 }
17557
17558 /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
17559 ///
17560 /// # Example
17561 /// ```ignore,no_run
17562 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17563 /// let x = ListPolicyBasedRoutesRequest::new().set_order_by("example");
17564 /// ```
17565 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17566 self.order_by = v.into();
17567 self
17568 }
17569}
17570
17571impl wkt::message::Message for ListPolicyBasedRoutesRequest {
17572 fn typename() -> &'static str {
17573 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
17574 }
17575}
17576
17577/// Response for
17578/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
17579/// method.
17580///
17581/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
17582#[derive(Clone, Default, PartialEq)]
17583#[non_exhaustive]
17584pub struct ListPolicyBasedRoutesResponse {
17585 /// Policy-based routes to be returned.
17586 pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,
17587
17588 /// The next pagination token in the List response. It should be used as
17589 /// page_token for the following request. An empty value means no more result.
17590 pub next_page_token: std::string::String,
17591
17592 /// Locations that could not be reached.
17593 pub unreachable: std::vec::Vec<std::string::String>,
17594
17595 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17596}
17597
17598impl ListPolicyBasedRoutesResponse {
17599 pub fn new() -> Self {
17600 std::default::Default::default()
17601 }
17602
17603 /// Sets the value of [policy_based_routes][crate::model::ListPolicyBasedRoutesResponse::policy_based_routes].
17604 ///
17605 /// # Example
17606 /// ```ignore,no_run
17607 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17608 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17609 /// let x = ListPolicyBasedRoutesResponse::new()
17610 /// .set_policy_based_routes([
17611 /// PolicyBasedRoute::default()/* use setters */,
17612 /// PolicyBasedRoute::default()/* use (different) setters */,
17613 /// ]);
17614 /// ```
17615 pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
17616 where
17617 T: std::iter::IntoIterator<Item = V>,
17618 V: std::convert::Into<crate::model::PolicyBasedRoute>,
17619 {
17620 use std::iter::Iterator;
17621 self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
17622 self
17623 }
17624
17625 /// Sets the value of [next_page_token][crate::model::ListPolicyBasedRoutesResponse::next_page_token].
17626 ///
17627 /// # Example
17628 /// ```ignore,no_run
17629 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17630 /// let x = ListPolicyBasedRoutesResponse::new().set_next_page_token("example");
17631 /// ```
17632 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17633 self.next_page_token = v.into();
17634 self
17635 }
17636
17637 /// Sets the value of [unreachable][crate::model::ListPolicyBasedRoutesResponse::unreachable].
17638 ///
17639 /// # Example
17640 /// ```ignore,no_run
17641 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17642 /// let x = ListPolicyBasedRoutesResponse::new().set_unreachable(["a", "b", "c"]);
17643 /// ```
17644 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17645 where
17646 T: std::iter::IntoIterator<Item = V>,
17647 V: std::convert::Into<std::string::String>,
17648 {
17649 use std::iter::Iterator;
17650 self.unreachable = v.into_iter().map(|i| i.into()).collect();
17651 self
17652 }
17653}
17654
17655impl wkt::message::Message for ListPolicyBasedRoutesResponse {
17656 fn typename() -> &'static str {
17657 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
17658 }
17659}
17660
17661#[doc(hidden)]
17662impl google_cloud_gax::paginator::internal::PageableResponse for ListPolicyBasedRoutesResponse {
17663 type PageItem = crate::model::PolicyBasedRoute;
17664
17665 fn items(self) -> std::vec::Vec<Self::PageItem> {
17666 self.policy_based_routes
17667 }
17668
17669 fn next_page_token(&self) -> std::string::String {
17670 use std::clone::Clone;
17671 self.next_page_token.clone()
17672 }
17673}
17674
17675/// Request for
17676/// [PolicyBasedRoutingService.GetPolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]
17677/// method.
17678///
17679/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]: crate::client::PolicyBasedRoutingService::get_policy_based_route
17680#[derive(Clone, Default, PartialEq)]
17681#[non_exhaustive]
17682pub struct GetPolicyBasedRouteRequest {
17683 /// Required. Name of the PolicyBasedRoute resource to get.
17684 pub name: std::string::String,
17685
17686 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17687}
17688
17689impl GetPolicyBasedRouteRequest {
17690 pub fn new() -> Self {
17691 std::default::Default::default()
17692 }
17693
17694 /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
17695 ///
17696 /// # Example
17697 /// ```ignore,no_run
17698 /// # use google_cloud_networkconnectivity_v1::model::GetPolicyBasedRouteRequest;
17699 /// let x = GetPolicyBasedRouteRequest::new().set_name("example");
17700 /// ```
17701 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17702 self.name = v.into();
17703 self
17704 }
17705}
17706
17707impl wkt::message::Message for GetPolicyBasedRouteRequest {
17708 fn typename() -> &'static str {
17709 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
17710 }
17711}
17712
17713/// Request for
17714/// [PolicyBasedRoutingService.CreatePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]
17715/// method.
17716///
17717/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::create_policy_based_route
17718#[derive(Clone, Default, PartialEq)]
17719#[non_exhaustive]
17720pub struct CreatePolicyBasedRouteRequest {
17721 /// Required. The parent resource's name of the PolicyBasedRoute.
17722 pub parent: std::string::String,
17723
17724 /// Required. Unique id for the policy-based route to create. Provided by the
17725 /// client when the resource is created. The name must comply with
17726 /// <https://google.aip.dev/122#resource-id-segments>. Specifically, the name
17727 /// must be 1-63 characters long and match the regular expression
17728 /// [a-z]([a-z0-9-]*[a-z0-9])?. The first character must be a lowercase letter,
17729 /// and all following characters (except for the last character) must be a
17730 /// dash, lowercase letter, or digit. The last character must be a lowercase
17731 /// letter or digit.
17732 pub policy_based_route_id: std::string::String,
17733
17734 /// Required. Initial values for a new policy-based route.
17735 pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,
17736
17737 /// Optional. An optional request ID to identify requests. Specify a unique
17738 /// request ID so that if you must retry your request, the server knows to
17739 /// ignore the request if it has already been completed. The server guarantees
17740 /// that for at least 60 minutes since the first request.
17741 ///
17742 /// For example, consider a situation where you make an initial request and
17743 /// the request times out. If you make the request again with the same request
17744 /// ID, the server can check if original operation with the same request ID
17745 /// was received, and if so, ignores the second request. This prevents clients
17746 /// from accidentally creating duplicate commitments.
17747 ///
17748 /// The request ID must be a valid UUID with the exception that zero UUID is
17749 /// not supported (00000000-0000-0000-0000-000000000000).
17750 pub request_id: std::string::String,
17751
17752 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17753}
17754
17755impl CreatePolicyBasedRouteRequest {
17756 pub fn new() -> Self {
17757 std::default::Default::default()
17758 }
17759
17760 /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
17761 ///
17762 /// # Example
17763 /// ```ignore,no_run
17764 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17765 /// let x = CreatePolicyBasedRouteRequest::new().set_parent("example");
17766 /// ```
17767 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17768 self.parent = v.into();
17769 self
17770 }
17771
17772 /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
17773 ///
17774 /// # Example
17775 /// ```ignore,no_run
17776 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17777 /// let x = CreatePolicyBasedRouteRequest::new().set_policy_based_route_id("example");
17778 /// ```
17779 pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
17780 mut self,
17781 v: T,
17782 ) -> Self {
17783 self.policy_based_route_id = v.into();
17784 self
17785 }
17786
17787 /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
17788 ///
17789 /// # Example
17790 /// ```ignore,no_run
17791 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17792 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17793 /// let x = CreatePolicyBasedRouteRequest::new().set_policy_based_route(PolicyBasedRoute::default()/* use setters */);
17794 /// ```
17795 pub fn set_policy_based_route<T>(mut self, v: T) -> Self
17796 where
17797 T: std::convert::Into<crate::model::PolicyBasedRoute>,
17798 {
17799 self.policy_based_route = std::option::Option::Some(v.into());
17800 self
17801 }
17802
17803 /// Sets or clears the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
17804 ///
17805 /// # Example
17806 /// ```ignore,no_run
17807 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17808 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17809 /// let x = CreatePolicyBasedRouteRequest::new().set_or_clear_policy_based_route(Some(PolicyBasedRoute::default()/* use setters */));
17810 /// let x = CreatePolicyBasedRouteRequest::new().set_or_clear_policy_based_route(None::<PolicyBasedRoute>);
17811 /// ```
17812 pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
17813 where
17814 T: std::convert::Into<crate::model::PolicyBasedRoute>,
17815 {
17816 self.policy_based_route = v.map(|x| x.into());
17817 self
17818 }
17819
17820 /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
17821 ///
17822 /// # Example
17823 /// ```ignore,no_run
17824 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17825 /// let x = CreatePolicyBasedRouteRequest::new().set_request_id("example");
17826 /// ```
17827 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17828 self.request_id = v.into();
17829 self
17830 }
17831}
17832
17833impl wkt::message::Message for CreatePolicyBasedRouteRequest {
17834 fn typename() -> &'static str {
17835 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
17836 }
17837}
17838
17839/// Request for
17840/// [PolicyBasedRoutingService.DeletePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]
17841/// method.
17842///
17843/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::delete_policy_based_route
17844#[derive(Clone, Default, PartialEq)]
17845#[non_exhaustive]
17846pub struct DeletePolicyBasedRouteRequest {
17847 /// Required. Name of the policy-based route resource to delete.
17848 pub name: std::string::String,
17849
17850 /// Optional. An optional request ID to identify requests. Specify a unique
17851 /// request ID so that if you must retry your request, the server knows to
17852 /// ignore the request if it has already been completed. The server guarantees
17853 /// that for at least 60 minutes after the first request.
17854 ///
17855 /// For example, consider a situation where you make an initial request and
17856 /// the request times out. If you make the request again with the same request
17857 /// ID, the server can check if original operation with the same request ID
17858 /// was received, and if so, ignores the second request. This prevents clients
17859 /// from accidentally creating duplicate commitments.
17860 ///
17861 /// The request ID must be a valid UUID with the exception that zero UUID is
17862 /// not supported (00000000-0000-0000-0000-000000000000).
17863 pub request_id: std::string::String,
17864
17865 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17866}
17867
17868impl DeletePolicyBasedRouteRequest {
17869 pub fn new() -> Self {
17870 std::default::Default::default()
17871 }
17872
17873 /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
17874 ///
17875 /// # Example
17876 /// ```ignore,no_run
17877 /// # use google_cloud_networkconnectivity_v1::model::DeletePolicyBasedRouteRequest;
17878 /// let x = DeletePolicyBasedRouteRequest::new().set_name("example");
17879 /// ```
17880 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17881 self.name = v.into();
17882 self
17883 }
17884
17885 /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
17886 ///
17887 /// # Example
17888 /// ```ignore,no_run
17889 /// # use google_cloud_networkconnectivity_v1::model::DeletePolicyBasedRouteRequest;
17890 /// let x = DeletePolicyBasedRouteRequest::new().set_request_id("example");
17891 /// ```
17892 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17893 self.request_id = v.into();
17894 self
17895 }
17896}
17897
17898impl wkt::message::Message for DeletePolicyBasedRouteRequest {
17899 fn typename() -> &'static str {
17900 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
17901 }
17902}
17903
17904/// The infrastructure used for connections between consumers/producers.
17905///
17906/// # Working with unknown values
17907///
17908/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17909/// additional enum variants at any time. Adding new variants is not considered
17910/// a breaking change. Applications should write their code in anticipation of:
17911///
17912/// - New values appearing in future releases of the client library, **and**
17913/// - New values received dynamically, without application changes.
17914///
17915/// Please consult the [Working with enums] section in the user guide for some
17916/// guidelines.
17917///
17918/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17919#[derive(Clone, Debug, PartialEq)]
17920#[non_exhaustive]
17921pub enum Infrastructure {
17922 /// An invalid infrastructure as the default case.
17923 Unspecified,
17924 /// Private Service Connect is used for connections.
17925 Psc,
17926 /// If set, the enum was initialized with an unknown value.
17927 ///
17928 /// Applications can examine the value using [Infrastructure::value] or
17929 /// [Infrastructure::name].
17930 UnknownValue(infrastructure::UnknownValue),
17931}
17932
17933#[doc(hidden)]
17934pub mod infrastructure {
17935 #[allow(unused_imports)]
17936 use super::*;
17937 #[derive(Clone, Debug, PartialEq)]
17938 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17939}
17940
17941impl Infrastructure {
17942 /// Gets the enum value.
17943 ///
17944 /// Returns `None` if the enum contains an unknown value deserialized from
17945 /// the string representation of enums.
17946 pub fn value(&self) -> std::option::Option<i32> {
17947 match self {
17948 Self::Unspecified => std::option::Option::Some(0),
17949 Self::Psc => std::option::Option::Some(1),
17950 Self::UnknownValue(u) => u.0.value(),
17951 }
17952 }
17953
17954 /// Gets the enum value as a string.
17955 ///
17956 /// Returns `None` if the enum contains an unknown value deserialized from
17957 /// the integer representation of enums.
17958 pub fn name(&self) -> std::option::Option<&str> {
17959 match self {
17960 Self::Unspecified => std::option::Option::Some("INFRASTRUCTURE_UNSPECIFIED"),
17961 Self::Psc => std::option::Option::Some("PSC"),
17962 Self::UnknownValue(u) => u.0.name(),
17963 }
17964 }
17965}
17966
17967impl std::default::Default for Infrastructure {
17968 fn default() -> Self {
17969 use std::convert::From;
17970 Self::from(0)
17971 }
17972}
17973
17974impl std::fmt::Display for Infrastructure {
17975 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17976 wkt::internal::display_enum(f, self.name(), self.value())
17977 }
17978}
17979
17980impl std::convert::From<i32> for Infrastructure {
17981 fn from(value: i32) -> Self {
17982 match value {
17983 0 => Self::Unspecified,
17984 1 => Self::Psc,
17985 _ => Self::UnknownValue(infrastructure::UnknownValue(
17986 wkt::internal::UnknownEnumValue::Integer(value),
17987 )),
17988 }
17989 }
17990}
17991
17992impl std::convert::From<&str> for Infrastructure {
17993 fn from(value: &str) -> Self {
17994 use std::string::ToString;
17995 match value {
17996 "INFRASTRUCTURE_UNSPECIFIED" => Self::Unspecified,
17997 "PSC" => Self::Psc,
17998 _ => Self::UnknownValue(infrastructure::UnknownValue(
17999 wkt::internal::UnknownEnumValue::String(value.to_string()),
18000 )),
18001 }
18002 }
18003}
18004
18005impl serde::ser::Serialize for Infrastructure {
18006 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18007 where
18008 S: serde::Serializer,
18009 {
18010 match self {
18011 Self::Unspecified => serializer.serialize_i32(0),
18012 Self::Psc => serializer.serialize_i32(1),
18013 Self::UnknownValue(u) => u.0.serialize(serializer),
18014 }
18015 }
18016}
18017
18018impl<'de> serde::de::Deserialize<'de> for Infrastructure {
18019 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18020 where
18021 D: serde::Deserializer<'de>,
18022 {
18023 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Infrastructure>::new(
18024 ".google.cloud.networkconnectivity.v1.Infrastructure",
18025 ))
18026 }
18027}
18028
18029/// The error type indicates whether a connection error is consumer facing,
18030/// producer facing or system internal.
18031///
18032/// # Working with unknown values
18033///
18034/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18035/// additional enum variants at any time. Adding new variants is not considered
18036/// a breaking change. Applications should write their code in anticipation of:
18037///
18038/// - New values appearing in future releases of the client library, **and**
18039/// - New values received dynamically, without application changes.
18040///
18041/// Please consult the [Working with enums] section in the user guide for some
18042/// guidelines.
18043///
18044/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18045#[derive(Clone, Debug, PartialEq)]
18046#[non_exhaustive]
18047pub enum ConnectionErrorType {
18048 /// An invalid error type as the default case.
18049 Unspecified,
18050 /// The error is due to Service Automation system internal.
18051 ErrorInternal,
18052 /// The error is due to the setup on consumer side.
18053 ErrorConsumerSide,
18054 /// The error is due to the setup on producer side.
18055 ErrorProducerSide,
18056 /// If set, the enum was initialized with an unknown value.
18057 ///
18058 /// Applications can examine the value using [ConnectionErrorType::value] or
18059 /// [ConnectionErrorType::name].
18060 UnknownValue(connection_error_type::UnknownValue),
18061}
18062
18063#[doc(hidden)]
18064pub mod connection_error_type {
18065 #[allow(unused_imports)]
18066 use super::*;
18067 #[derive(Clone, Debug, PartialEq)]
18068 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18069}
18070
18071impl ConnectionErrorType {
18072 /// Gets the enum value.
18073 ///
18074 /// Returns `None` if the enum contains an unknown value deserialized from
18075 /// the string representation of enums.
18076 pub fn value(&self) -> std::option::Option<i32> {
18077 match self {
18078 Self::Unspecified => std::option::Option::Some(0),
18079 Self::ErrorInternal => std::option::Option::Some(1),
18080 Self::ErrorConsumerSide => std::option::Option::Some(2),
18081 Self::ErrorProducerSide => std::option::Option::Some(3),
18082 Self::UnknownValue(u) => u.0.value(),
18083 }
18084 }
18085
18086 /// Gets the enum value as a string.
18087 ///
18088 /// Returns `None` if the enum contains an unknown value deserialized from
18089 /// the integer representation of enums.
18090 pub fn name(&self) -> std::option::Option<&str> {
18091 match self {
18092 Self::Unspecified => std::option::Option::Some("CONNECTION_ERROR_TYPE_UNSPECIFIED"),
18093 Self::ErrorInternal => std::option::Option::Some("ERROR_INTERNAL"),
18094 Self::ErrorConsumerSide => std::option::Option::Some("ERROR_CONSUMER_SIDE"),
18095 Self::ErrorProducerSide => std::option::Option::Some("ERROR_PRODUCER_SIDE"),
18096 Self::UnknownValue(u) => u.0.name(),
18097 }
18098 }
18099}
18100
18101impl std::default::Default for ConnectionErrorType {
18102 fn default() -> Self {
18103 use std::convert::From;
18104 Self::from(0)
18105 }
18106}
18107
18108impl std::fmt::Display for ConnectionErrorType {
18109 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18110 wkt::internal::display_enum(f, self.name(), self.value())
18111 }
18112}
18113
18114impl std::convert::From<i32> for ConnectionErrorType {
18115 fn from(value: i32) -> Self {
18116 match value {
18117 0 => Self::Unspecified,
18118 1 => Self::ErrorInternal,
18119 2 => Self::ErrorConsumerSide,
18120 3 => Self::ErrorProducerSide,
18121 _ => Self::UnknownValue(connection_error_type::UnknownValue(
18122 wkt::internal::UnknownEnumValue::Integer(value),
18123 )),
18124 }
18125 }
18126}
18127
18128impl std::convert::From<&str> for ConnectionErrorType {
18129 fn from(value: &str) -> Self {
18130 use std::string::ToString;
18131 match value {
18132 "CONNECTION_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
18133 "ERROR_INTERNAL" => Self::ErrorInternal,
18134 "ERROR_CONSUMER_SIDE" => Self::ErrorConsumerSide,
18135 "ERROR_PRODUCER_SIDE" => Self::ErrorProducerSide,
18136 _ => Self::UnknownValue(connection_error_type::UnknownValue(
18137 wkt::internal::UnknownEnumValue::String(value.to_string()),
18138 )),
18139 }
18140 }
18141}
18142
18143impl serde::ser::Serialize for ConnectionErrorType {
18144 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18145 where
18146 S: serde::Serializer,
18147 {
18148 match self {
18149 Self::Unspecified => serializer.serialize_i32(0),
18150 Self::ErrorInternal => serializer.serialize_i32(1),
18151 Self::ErrorConsumerSide => serializer.serialize_i32(2),
18152 Self::ErrorProducerSide => serializer.serialize_i32(3),
18153 Self::UnknownValue(u) => u.0.serialize(serializer),
18154 }
18155 }
18156}
18157
18158impl<'de> serde::de::Deserialize<'de> for ConnectionErrorType {
18159 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18160 where
18161 D: serde::Deserializer<'de>,
18162 {
18163 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionErrorType>::new(
18164 ".google.cloud.networkconnectivity.v1.ConnectionErrorType",
18165 ))
18166 }
18167}
18168
18169/// The requested IP version for the PSC connection.
18170///
18171/// # Working with unknown values
18172///
18173/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18174/// additional enum variants at any time. Adding new variants is not considered
18175/// a breaking change. Applications should write their code in anticipation of:
18176///
18177/// - New values appearing in future releases of the client library, **and**
18178/// - New values received dynamically, without application changes.
18179///
18180/// Please consult the [Working with enums] section in the user guide for some
18181/// guidelines.
18182///
18183/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18184#[derive(Clone, Debug, PartialEq)]
18185#[non_exhaustive]
18186pub enum IPVersion {
18187 /// Default value. We will use IPv4 or IPv6 depending on the IP version of
18188 /// first available subnetwork.
18189 Unspecified,
18190 /// Will use IPv4 only.
18191 Ipv4,
18192 /// Will use IPv6 only.
18193 Ipv6,
18194 /// If set, the enum was initialized with an unknown value.
18195 ///
18196 /// Applications can examine the value using [IPVersion::value] or
18197 /// [IPVersion::name].
18198 UnknownValue(ip_version::UnknownValue),
18199}
18200
18201#[doc(hidden)]
18202pub mod ip_version {
18203 #[allow(unused_imports)]
18204 use super::*;
18205 #[derive(Clone, Debug, PartialEq)]
18206 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18207}
18208
18209impl IPVersion {
18210 /// Gets the enum value.
18211 ///
18212 /// Returns `None` if the enum contains an unknown value deserialized from
18213 /// the string representation of enums.
18214 pub fn value(&self) -> std::option::Option<i32> {
18215 match self {
18216 Self::Unspecified => std::option::Option::Some(0),
18217 Self::Ipv4 => std::option::Option::Some(1),
18218 Self::Ipv6 => std::option::Option::Some(2),
18219 Self::UnknownValue(u) => u.0.value(),
18220 }
18221 }
18222
18223 /// Gets the enum value as a string.
18224 ///
18225 /// Returns `None` if the enum contains an unknown value deserialized from
18226 /// the integer representation of enums.
18227 pub fn name(&self) -> std::option::Option<&str> {
18228 match self {
18229 Self::Unspecified => std::option::Option::Some("IP_VERSION_UNSPECIFIED"),
18230 Self::Ipv4 => std::option::Option::Some("IPV4"),
18231 Self::Ipv6 => std::option::Option::Some("IPV6"),
18232 Self::UnknownValue(u) => u.0.name(),
18233 }
18234 }
18235}
18236
18237impl std::default::Default for IPVersion {
18238 fn default() -> Self {
18239 use std::convert::From;
18240 Self::from(0)
18241 }
18242}
18243
18244impl std::fmt::Display for IPVersion {
18245 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18246 wkt::internal::display_enum(f, self.name(), self.value())
18247 }
18248}
18249
18250impl std::convert::From<i32> for IPVersion {
18251 fn from(value: i32) -> Self {
18252 match value {
18253 0 => Self::Unspecified,
18254 1 => Self::Ipv4,
18255 2 => Self::Ipv6,
18256 _ => Self::UnknownValue(ip_version::UnknownValue(
18257 wkt::internal::UnknownEnumValue::Integer(value),
18258 )),
18259 }
18260 }
18261}
18262
18263impl std::convert::From<&str> for IPVersion {
18264 fn from(value: &str) -> Self {
18265 use std::string::ToString;
18266 match value {
18267 "IP_VERSION_UNSPECIFIED" => Self::Unspecified,
18268 "IPV4" => Self::Ipv4,
18269 "IPV6" => Self::Ipv6,
18270 _ => Self::UnknownValue(ip_version::UnknownValue(
18271 wkt::internal::UnknownEnumValue::String(value.to_string()),
18272 )),
18273 }
18274 }
18275}
18276
18277impl serde::ser::Serialize for IPVersion {
18278 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18279 where
18280 S: serde::Serializer,
18281 {
18282 match self {
18283 Self::Unspecified => serializer.serialize_i32(0),
18284 Self::Ipv4 => serializer.serialize_i32(1),
18285 Self::Ipv6 => serializer.serialize_i32(2),
18286 Self::UnknownValue(u) => u.0.serialize(serializer),
18287 }
18288 }
18289}
18290
18291impl<'de> serde::de::Deserialize<'de> for IPVersion {
18292 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18293 where
18294 D: serde::Deserializer<'de>,
18295 {
18296 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IPVersion>::new(
18297 ".google.cloud.networkconnectivity.v1.IPVersion",
18298 ))
18299 }
18300}
18301
18302/// Supported features for a location
18303///
18304/// # Working with unknown values
18305///
18306/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18307/// additional enum variants at any time. Adding new variants is not considered
18308/// a breaking change. Applications should write their code in anticipation of:
18309///
18310/// - New values appearing in future releases of the client library, **and**
18311/// - New values received dynamically, without application changes.
18312///
18313/// Please consult the [Working with enums] section in the user guide for some
18314/// guidelines.
18315///
18316/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18317#[derive(Clone, Debug, PartialEq)]
18318#[non_exhaustive]
18319pub enum LocationFeature {
18320 /// No publicly supported feature in this location
18321 Unspecified,
18322 /// Site-to-cloud spokes are supported in this location
18323 SiteToCloudSpokes,
18324 /// Site-to-site spokes are supported in this location
18325 SiteToSiteSpokes,
18326 /// If set, the enum was initialized with an unknown value.
18327 ///
18328 /// Applications can examine the value using [LocationFeature::value] or
18329 /// [LocationFeature::name].
18330 UnknownValue(location_feature::UnknownValue),
18331}
18332
18333#[doc(hidden)]
18334pub mod location_feature {
18335 #[allow(unused_imports)]
18336 use super::*;
18337 #[derive(Clone, Debug, PartialEq)]
18338 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18339}
18340
18341impl LocationFeature {
18342 /// Gets the enum value.
18343 ///
18344 /// Returns `None` if the enum contains an unknown value deserialized from
18345 /// the string representation of enums.
18346 pub fn value(&self) -> std::option::Option<i32> {
18347 match self {
18348 Self::Unspecified => std::option::Option::Some(0),
18349 Self::SiteToCloudSpokes => std::option::Option::Some(1),
18350 Self::SiteToSiteSpokes => std::option::Option::Some(2),
18351 Self::UnknownValue(u) => u.0.value(),
18352 }
18353 }
18354
18355 /// Gets the enum value as a string.
18356 ///
18357 /// Returns `None` if the enum contains an unknown value deserialized from
18358 /// the integer representation of enums.
18359 pub fn name(&self) -> std::option::Option<&str> {
18360 match self {
18361 Self::Unspecified => std::option::Option::Some("LOCATION_FEATURE_UNSPECIFIED"),
18362 Self::SiteToCloudSpokes => std::option::Option::Some("SITE_TO_CLOUD_SPOKES"),
18363 Self::SiteToSiteSpokes => std::option::Option::Some("SITE_TO_SITE_SPOKES"),
18364 Self::UnknownValue(u) => u.0.name(),
18365 }
18366 }
18367}
18368
18369impl std::default::Default for LocationFeature {
18370 fn default() -> Self {
18371 use std::convert::From;
18372 Self::from(0)
18373 }
18374}
18375
18376impl std::fmt::Display for LocationFeature {
18377 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18378 wkt::internal::display_enum(f, self.name(), self.value())
18379 }
18380}
18381
18382impl std::convert::From<i32> for LocationFeature {
18383 fn from(value: i32) -> Self {
18384 match value {
18385 0 => Self::Unspecified,
18386 1 => Self::SiteToCloudSpokes,
18387 2 => Self::SiteToSiteSpokes,
18388 _ => Self::UnknownValue(location_feature::UnknownValue(
18389 wkt::internal::UnknownEnumValue::Integer(value),
18390 )),
18391 }
18392 }
18393}
18394
18395impl std::convert::From<&str> for LocationFeature {
18396 fn from(value: &str) -> Self {
18397 use std::string::ToString;
18398 match value {
18399 "LOCATION_FEATURE_UNSPECIFIED" => Self::Unspecified,
18400 "SITE_TO_CLOUD_SPOKES" => Self::SiteToCloudSpokes,
18401 "SITE_TO_SITE_SPOKES" => Self::SiteToSiteSpokes,
18402 _ => Self::UnknownValue(location_feature::UnknownValue(
18403 wkt::internal::UnknownEnumValue::String(value.to_string()),
18404 )),
18405 }
18406 }
18407}
18408
18409impl serde::ser::Serialize for LocationFeature {
18410 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18411 where
18412 S: serde::Serializer,
18413 {
18414 match self {
18415 Self::Unspecified => serializer.serialize_i32(0),
18416 Self::SiteToCloudSpokes => serializer.serialize_i32(1),
18417 Self::SiteToSiteSpokes => serializer.serialize_i32(2),
18418 Self::UnknownValue(u) => u.0.serialize(serializer),
18419 }
18420 }
18421}
18422
18423impl<'de> serde::de::Deserialize<'de> for LocationFeature {
18424 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18425 where
18426 D: serde::Deserializer<'de>,
18427 {
18428 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationFeature>::new(
18429 ".google.cloud.networkconnectivity.v1.LocationFeature",
18430 ))
18431 }
18432}
18433
18434/// The route's type
18435///
18436/// # Working with unknown values
18437///
18438/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18439/// additional enum variants at any time. Adding new variants is not considered
18440/// a breaking change. Applications should write their code in anticipation of:
18441///
18442/// - New values appearing in future releases of the client library, **and**
18443/// - New values received dynamically, without application changes.
18444///
18445/// Please consult the [Working with enums] section in the user guide for some
18446/// guidelines.
18447///
18448/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18449#[derive(Clone, Debug, PartialEq)]
18450#[non_exhaustive]
18451pub enum RouteType {
18452 /// No route type information specified
18453 Unspecified,
18454 /// The route leads to a destination within the primary address range of the
18455 /// VPC network's subnet.
18456 VpcPrimarySubnet,
18457 /// The route leads to a destination within the secondary address range of the
18458 /// VPC network's subnet.
18459 VpcSecondarySubnet,
18460 /// The route leads to a destination in a dynamic route. Dynamic routes are
18461 /// derived from Border Gateway Protocol (BGP) advertisements received from an
18462 /// NCC hybrid spoke.
18463 DynamicRoute,
18464 /// If set, the enum was initialized with an unknown value.
18465 ///
18466 /// Applications can examine the value using [RouteType::value] or
18467 /// [RouteType::name].
18468 UnknownValue(route_type::UnknownValue),
18469}
18470
18471#[doc(hidden)]
18472pub mod route_type {
18473 #[allow(unused_imports)]
18474 use super::*;
18475 #[derive(Clone, Debug, PartialEq)]
18476 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18477}
18478
18479impl RouteType {
18480 /// Gets the enum value.
18481 ///
18482 /// Returns `None` if the enum contains an unknown value deserialized from
18483 /// the string representation of enums.
18484 pub fn value(&self) -> std::option::Option<i32> {
18485 match self {
18486 Self::Unspecified => std::option::Option::Some(0),
18487 Self::VpcPrimarySubnet => std::option::Option::Some(1),
18488 Self::VpcSecondarySubnet => std::option::Option::Some(2),
18489 Self::DynamicRoute => std::option::Option::Some(3),
18490 Self::UnknownValue(u) => u.0.value(),
18491 }
18492 }
18493
18494 /// Gets the enum value as a string.
18495 ///
18496 /// Returns `None` if the enum contains an unknown value deserialized from
18497 /// the integer representation of enums.
18498 pub fn name(&self) -> std::option::Option<&str> {
18499 match self {
18500 Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
18501 Self::VpcPrimarySubnet => std::option::Option::Some("VPC_PRIMARY_SUBNET"),
18502 Self::VpcSecondarySubnet => std::option::Option::Some("VPC_SECONDARY_SUBNET"),
18503 Self::DynamicRoute => std::option::Option::Some("DYNAMIC_ROUTE"),
18504 Self::UnknownValue(u) => u.0.name(),
18505 }
18506 }
18507}
18508
18509impl std::default::Default for RouteType {
18510 fn default() -> Self {
18511 use std::convert::From;
18512 Self::from(0)
18513 }
18514}
18515
18516impl std::fmt::Display for RouteType {
18517 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18518 wkt::internal::display_enum(f, self.name(), self.value())
18519 }
18520}
18521
18522impl std::convert::From<i32> for RouteType {
18523 fn from(value: i32) -> Self {
18524 match value {
18525 0 => Self::Unspecified,
18526 1 => Self::VpcPrimarySubnet,
18527 2 => Self::VpcSecondarySubnet,
18528 3 => Self::DynamicRoute,
18529 _ => Self::UnknownValue(route_type::UnknownValue(
18530 wkt::internal::UnknownEnumValue::Integer(value),
18531 )),
18532 }
18533 }
18534}
18535
18536impl std::convert::From<&str> for RouteType {
18537 fn from(value: &str) -> Self {
18538 use std::string::ToString;
18539 match value {
18540 "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
18541 "VPC_PRIMARY_SUBNET" => Self::VpcPrimarySubnet,
18542 "VPC_SECONDARY_SUBNET" => Self::VpcSecondarySubnet,
18543 "DYNAMIC_ROUTE" => Self::DynamicRoute,
18544 _ => Self::UnknownValue(route_type::UnknownValue(
18545 wkt::internal::UnknownEnumValue::String(value.to_string()),
18546 )),
18547 }
18548 }
18549}
18550
18551impl serde::ser::Serialize for RouteType {
18552 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18553 where
18554 S: serde::Serializer,
18555 {
18556 match self {
18557 Self::Unspecified => serializer.serialize_i32(0),
18558 Self::VpcPrimarySubnet => serializer.serialize_i32(1),
18559 Self::VpcSecondarySubnet => serializer.serialize_i32(2),
18560 Self::DynamicRoute => serializer.serialize_i32(3),
18561 Self::UnknownValue(u) => u.0.serialize(serializer),
18562 }
18563 }
18564}
18565
18566impl<'de> serde::de::Deserialize<'de> for RouteType {
18567 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18568 where
18569 D: serde::Deserializer<'de>,
18570 {
18571 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
18572 ".google.cloud.networkconnectivity.v1.RouteType",
18573 ))
18574 }
18575}
18576
18577/// The State enum represents the lifecycle stage of a Network Connectivity
18578/// Center resource.
18579///
18580/// # Working with unknown values
18581///
18582/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18583/// additional enum variants at any time. Adding new variants is not considered
18584/// a breaking change. Applications should write their code in anticipation of:
18585///
18586/// - New values appearing in future releases of the client library, **and**
18587/// - New values received dynamically, without application changes.
18588///
18589/// Please consult the [Working with enums] section in the user guide for some
18590/// guidelines.
18591///
18592/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18593#[derive(Clone, Debug, PartialEq)]
18594#[non_exhaustive]
18595pub enum State {
18596 /// No state information available
18597 Unspecified,
18598 /// The resource's create operation is in progress.
18599 Creating,
18600 /// The resource is active
18601 Active,
18602 /// The resource's delete operation is in progress.
18603 Deleting,
18604 /// The resource's accept operation is in progress.
18605 Accepting,
18606 /// The resource's reject operation is in progress.
18607 Rejecting,
18608 /// The resource's update operation is in progress.
18609 Updating,
18610 /// The resource is inactive.
18611 Inactive,
18612 /// The hub associated with this spoke resource has been deleted.
18613 /// This state applies to spoke resources only.
18614 Obsolete,
18615 /// The resource is in an undefined state due to resource creation or deletion
18616 /// failure. You can try to delete the resource later or contact support for
18617 /// help.
18618 Failed,
18619 /// If set, the enum was initialized with an unknown value.
18620 ///
18621 /// Applications can examine the value using [State::value] or
18622 /// [State::name].
18623 UnknownValue(state::UnknownValue),
18624}
18625
18626#[doc(hidden)]
18627pub mod state {
18628 #[allow(unused_imports)]
18629 use super::*;
18630 #[derive(Clone, Debug, PartialEq)]
18631 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18632}
18633
18634impl State {
18635 /// Gets the enum value.
18636 ///
18637 /// Returns `None` if the enum contains an unknown value deserialized from
18638 /// the string representation of enums.
18639 pub fn value(&self) -> std::option::Option<i32> {
18640 match self {
18641 Self::Unspecified => std::option::Option::Some(0),
18642 Self::Creating => std::option::Option::Some(1),
18643 Self::Active => std::option::Option::Some(2),
18644 Self::Deleting => std::option::Option::Some(3),
18645 Self::Accepting => std::option::Option::Some(8),
18646 Self::Rejecting => std::option::Option::Some(9),
18647 Self::Updating => std::option::Option::Some(6),
18648 Self::Inactive => std::option::Option::Some(7),
18649 Self::Obsolete => std::option::Option::Some(10),
18650 Self::Failed => std::option::Option::Some(11),
18651 Self::UnknownValue(u) => u.0.value(),
18652 }
18653 }
18654
18655 /// Gets the enum value as a string.
18656 ///
18657 /// Returns `None` if the enum contains an unknown value deserialized from
18658 /// the integer representation of enums.
18659 pub fn name(&self) -> std::option::Option<&str> {
18660 match self {
18661 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18662 Self::Creating => std::option::Option::Some("CREATING"),
18663 Self::Active => std::option::Option::Some("ACTIVE"),
18664 Self::Deleting => std::option::Option::Some("DELETING"),
18665 Self::Accepting => std::option::Option::Some("ACCEPTING"),
18666 Self::Rejecting => std::option::Option::Some("REJECTING"),
18667 Self::Updating => std::option::Option::Some("UPDATING"),
18668 Self::Inactive => std::option::Option::Some("INACTIVE"),
18669 Self::Obsolete => std::option::Option::Some("OBSOLETE"),
18670 Self::Failed => std::option::Option::Some("FAILED"),
18671 Self::UnknownValue(u) => u.0.name(),
18672 }
18673 }
18674}
18675
18676impl std::default::Default for State {
18677 fn default() -> Self {
18678 use std::convert::From;
18679 Self::from(0)
18680 }
18681}
18682
18683impl std::fmt::Display for State {
18684 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18685 wkt::internal::display_enum(f, self.name(), self.value())
18686 }
18687}
18688
18689impl std::convert::From<i32> for State {
18690 fn from(value: i32) -> Self {
18691 match value {
18692 0 => Self::Unspecified,
18693 1 => Self::Creating,
18694 2 => Self::Active,
18695 3 => Self::Deleting,
18696 6 => Self::Updating,
18697 7 => Self::Inactive,
18698 8 => Self::Accepting,
18699 9 => Self::Rejecting,
18700 10 => Self::Obsolete,
18701 11 => Self::Failed,
18702 _ => Self::UnknownValue(state::UnknownValue(
18703 wkt::internal::UnknownEnumValue::Integer(value),
18704 )),
18705 }
18706 }
18707}
18708
18709impl std::convert::From<&str> for State {
18710 fn from(value: &str) -> Self {
18711 use std::string::ToString;
18712 match value {
18713 "STATE_UNSPECIFIED" => Self::Unspecified,
18714 "CREATING" => Self::Creating,
18715 "ACTIVE" => Self::Active,
18716 "DELETING" => Self::Deleting,
18717 "ACCEPTING" => Self::Accepting,
18718 "REJECTING" => Self::Rejecting,
18719 "UPDATING" => Self::Updating,
18720 "INACTIVE" => Self::Inactive,
18721 "OBSOLETE" => Self::Obsolete,
18722 "FAILED" => Self::Failed,
18723 _ => Self::UnknownValue(state::UnknownValue(
18724 wkt::internal::UnknownEnumValue::String(value.to_string()),
18725 )),
18726 }
18727 }
18728}
18729
18730impl serde::ser::Serialize for State {
18731 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18732 where
18733 S: serde::Serializer,
18734 {
18735 match self {
18736 Self::Unspecified => serializer.serialize_i32(0),
18737 Self::Creating => serializer.serialize_i32(1),
18738 Self::Active => serializer.serialize_i32(2),
18739 Self::Deleting => serializer.serialize_i32(3),
18740 Self::Accepting => serializer.serialize_i32(8),
18741 Self::Rejecting => serializer.serialize_i32(9),
18742 Self::Updating => serializer.serialize_i32(6),
18743 Self::Inactive => serializer.serialize_i32(7),
18744 Self::Obsolete => serializer.serialize_i32(10),
18745 Self::Failed => serializer.serialize_i32(11),
18746 Self::UnknownValue(u) => u.0.serialize(serializer),
18747 }
18748 }
18749}
18750
18751impl<'de> serde::de::Deserialize<'de> for State {
18752 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18753 where
18754 D: serde::Deserializer<'de>,
18755 {
18756 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18757 ".google.cloud.networkconnectivity.v1.State",
18758 ))
18759 }
18760}
18761
18762/// The SpokeType enum represents the type of spoke. The type
18763/// reflects the kind of resource that a spoke is associated with.
18764///
18765/// # Working with unknown values
18766///
18767/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18768/// additional enum variants at any time. Adding new variants is not considered
18769/// a breaking change. Applications should write their code in anticipation of:
18770///
18771/// - New values appearing in future releases of the client library, **and**
18772/// - New values received dynamically, without application changes.
18773///
18774/// Please consult the [Working with enums] section in the user guide for some
18775/// guidelines.
18776///
18777/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18778#[derive(Clone, Debug, PartialEq)]
18779#[non_exhaustive]
18780pub enum SpokeType {
18781 /// Unspecified spoke type.
18782 Unspecified,
18783 /// Spokes associated with VPN tunnels.
18784 VpnTunnel,
18785 /// Spokes associated with VLAN attachments.
18786 InterconnectAttachment,
18787 /// Spokes associated with router appliance instances.
18788 RouterAppliance,
18789 /// Spokes associated with VPC networks.
18790 VpcNetwork,
18791 /// Spokes that are backed by a producer VPC network.
18792 ProducerVpcNetwork,
18793 /// If set, the enum was initialized with an unknown value.
18794 ///
18795 /// Applications can examine the value using [SpokeType::value] or
18796 /// [SpokeType::name].
18797 UnknownValue(spoke_type::UnknownValue),
18798}
18799
18800#[doc(hidden)]
18801pub mod spoke_type {
18802 #[allow(unused_imports)]
18803 use super::*;
18804 #[derive(Clone, Debug, PartialEq)]
18805 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18806}
18807
18808impl SpokeType {
18809 /// Gets the enum value.
18810 ///
18811 /// Returns `None` if the enum contains an unknown value deserialized from
18812 /// the string representation of enums.
18813 pub fn value(&self) -> std::option::Option<i32> {
18814 match self {
18815 Self::Unspecified => std::option::Option::Some(0),
18816 Self::VpnTunnel => std::option::Option::Some(1),
18817 Self::InterconnectAttachment => std::option::Option::Some(2),
18818 Self::RouterAppliance => std::option::Option::Some(3),
18819 Self::VpcNetwork => std::option::Option::Some(4),
18820 Self::ProducerVpcNetwork => std::option::Option::Some(7),
18821 Self::UnknownValue(u) => u.0.value(),
18822 }
18823 }
18824
18825 /// Gets the enum value as a string.
18826 ///
18827 /// Returns `None` if the enum contains an unknown value deserialized from
18828 /// the integer representation of enums.
18829 pub fn name(&self) -> std::option::Option<&str> {
18830 match self {
18831 Self::Unspecified => std::option::Option::Some("SPOKE_TYPE_UNSPECIFIED"),
18832 Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
18833 Self::InterconnectAttachment => std::option::Option::Some("INTERCONNECT_ATTACHMENT"),
18834 Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
18835 Self::VpcNetwork => std::option::Option::Some("VPC_NETWORK"),
18836 Self::ProducerVpcNetwork => std::option::Option::Some("PRODUCER_VPC_NETWORK"),
18837 Self::UnknownValue(u) => u.0.name(),
18838 }
18839 }
18840}
18841
18842impl std::default::Default for SpokeType {
18843 fn default() -> Self {
18844 use std::convert::From;
18845 Self::from(0)
18846 }
18847}
18848
18849impl std::fmt::Display for SpokeType {
18850 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18851 wkt::internal::display_enum(f, self.name(), self.value())
18852 }
18853}
18854
18855impl std::convert::From<i32> for SpokeType {
18856 fn from(value: i32) -> Self {
18857 match value {
18858 0 => Self::Unspecified,
18859 1 => Self::VpnTunnel,
18860 2 => Self::InterconnectAttachment,
18861 3 => Self::RouterAppliance,
18862 4 => Self::VpcNetwork,
18863 7 => Self::ProducerVpcNetwork,
18864 _ => Self::UnknownValue(spoke_type::UnknownValue(
18865 wkt::internal::UnknownEnumValue::Integer(value),
18866 )),
18867 }
18868 }
18869}
18870
18871impl std::convert::From<&str> for SpokeType {
18872 fn from(value: &str) -> Self {
18873 use std::string::ToString;
18874 match value {
18875 "SPOKE_TYPE_UNSPECIFIED" => Self::Unspecified,
18876 "VPN_TUNNEL" => Self::VpnTunnel,
18877 "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
18878 "ROUTER_APPLIANCE" => Self::RouterAppliance,
18879 "VPC_NETWORK" => Self::VpcNetwork,
18880 "PRODUCER_VPC_NETWORK" => Self::ProducerVpcNetwork,
18881 _ => Self::UnknownValue(spoke_type::UnknownValue(
18882 wkt::internal::UnknownEnumValue::String(value.to_string()),
18883 )),
18884 }
18885 }
18886}
18887
18888impl serde::ser::Serialize for SpokeType {
18889 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18890 where
18891 S: serde::Serializer,
18892 {
18893 match self {
18894 Self::Unspecified => serializer.serialize_i32(0),
18895 Self::VpnTunnel => serializer.serialize_i32(1),
18896 Self::InterconnectAttachment => serializer.serialize_i32(2),
18897 Self::RouterAppliance => serializer.serialize_i32(3),
18898 Self::VpcNetwork => serializer.serialize_i32(4),
18899 Self::ProducerVpcNetwork => serializer.serialize_i32(7),
18900 Self::UnknownValue(u) => u.0.serialize(serializer),
18901 }
18902 }
18903}
18904
18905impl<'de> serde::de::Deserialize<'de> for SpokeType {
18906 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18907 where
18908 D: serde::Deserializer<'de>,
18909 {
18910 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeType>::new(
18911 ".google.cloud.networkconnectivity.v1.SpokeType",
18912 ))
18913 }
18914}
18915
18916/// This enum controls the policy mode used in a hub.
18917///
18918/// # Working with unknown values
18919///
18920/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18921/// additional enum variants at any time. Adding new variants is not considered
18922/// a breaking change. Applications should write their code in anticipation of:
18923///
18924/// - New values appearing in future releases of the client library, **and**
18925/// - New values received dynamically, without application changes.
18926///
18927/// Please consult the [Working with enums] section in the user guide for some
18928/// guidelines.
18929///
18930/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18931#[derive(Clone, Debug, PartialEq)]
18932#[non_exhaustive]
18933pub enum PolicyMode {
18934 /// Policy mode is unspecified. It defaults to PRESET
18935 /// with preset_topology = MESH.
18936 Unspecified,
18937 /// Hub uses one of the preset topologies.
18938 Preset,
18939 /// If set, the enum was initialized with an unknown value.
18940 ///
18941 /// Applications can examine the value using [PolicyMode::value] or
18942 /// [PolicyMode::name].
18943 UnknownValue(policy_mode::UnknownValue),
18944}
18945
18946#[doc(hidden)]
18947pub mod policy_mode {
18948 #[allow(unused_imports)]
18949 use super::*;
18950 #[derive(Clone, Debug, PartialEq)]
18951 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18952}
18953
18954impl PolicyMode {
18955 /// Gets the enum value.
18956 ///
18957 /// Returns `None` if the enum contains an unknown value deserialized from
18958 /// the string representation of enums.
18959 pub fn value(&self) -> std::option::Option<i32> {
18960 match self {
18961 Self::Unspecified => std::option::Option::Some(0),
18962 Self::Preset => std::option::Option::Some(1),
18963 Self::UnknownValue(u) => u.0.value(),
18964 }
18965 }
18966
18967 /// Gets the enum value as a string.
18968 ///
18969 /// Returns `None` if the enum contains an unknown value deserialized from
18970 /// the integer representation of enums.
18971 pub fn name(&self) -> std::option::Option<&str> {
18972 match self {
18973 Self::Unspecified => std::option::Option::Some("POLICY_MODE_UNSPECIFIED"),
18974 Self::Preset => std::option::Option::Some("PRESET"),
18975 Self::UnknownValue(u) => u.0.name(),
18976 }
18977 }
18978}
18979
18980impl std::default::Default for PolicyMode {
18981 fn default() -> Self {
18982 use std::convert::From;
18983 Self::from(0)
18984 }
18985}
18986
18987impl std::fmt::Display for PolicyMode {
18988 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18989 wkt::internal::display_enum(f, self.name(), self.value())
18990 }
18991}
18992
18993impl std::convert::From<i32> for PolicyMode {
18994 fn from(value: i32) -> Self {
18995 match value {
18996 0 => Self::Unspecified,
18997 1 => Self::Preset,
18998 _ => Self::UnknownValue(policy_mode::UnknownValue(
18999 wkt::internal::UnknownEnumValue::Integer(value),
19000 )),
19001 }
19002 }
19003}
19004
19005impl std::convert::From<&str> for PolicyMode {
19006 fn from(value: &str) -> Self {
19007 use std::string::ToString;
19008 match value {
19009 "POLICY_MODE_UNSPECIFIED" => Self::Unspecified,
19010 "PRESET" => Self::Preset,
19011 _ => Self::UnknownValue(policy_mode::UnknownValue(
19012 wkt::internal::UnknownEnumValue::String(value.to_string()),
19013 )),
19014 }
19015 }
19016}
19017
19018impl serde::ser::Serialize for PolicyMode {
19019 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19020 where
19021 S: serde::Serializer,
19022 {
19023 match self {
19024 Self::Unspecified => serializer.serialize_i32(0),
19025 Self::Preset => serializer.serialize_i32(1),
19026 Self::UnknownValue(u) => u.0.serialize(serializer),
19027 }
19028 }
19029}
19030
19031impl<'de> serde::de::Deserialize<'de> for PolicyMode {
19032 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19033 where
19034 D: serde::Deserializer<'de>,
19035 {
19036 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyMode>::new(
19037 ".google.cloud.networkconnectivity.v1.PolicyMode",
19038 ))
19039 }
19040}
19041
19042/// The list of available preset topologies.
19043///
19044/// # Working with unknown values
19045///
19046/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19047/// additional enum variants at any time. Adding new variants is not considered
19048/// a breaking change. Applications should write their code in anticipation of:
19049///
19050/// - New values appearing in future releases of the client library, **and**
19051/// - New values received dynamically, without application changes.
19052///
19053/// Please consult the [Working with enums] section in the user guide for some
19054/// guidelines.
19055///
19056/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19057#[derive(Clone, Debug, PartialEq)]
19058#[non_exhaustive]
19059pub enum PresetTopology {
19060 /// Preset topology is unspecified. When policy_mode = PRESET,
19061 /// it defaults to MESH.
19062 Unspecified,
19063 /// Mesh topology is implemented. Group `default` is automatically created.
19064 /// All spokes in the hub are added to group `default`.
19065 Mesh,
19066 /// Star topology is implemented. Two groups, `center` and `edge`, are
19067 /// automatically created along with hub creation. Spokes have to join one of
19068 /// the groups during creation.
19069 Star,
19070 /// If set, the enum was initialized with an unknown value.
19071 ///
19072 /// Applications can examine the value using [PresetTopology::value] or
19073 /// [PresetTopology::name].
19074 UnknownValue(preset_topology::UnknownValue),
19075}
19076
19077#[doc(hidden)]
19078pub mod preset_topology {
19079 #[allow(unused_imports)]
19080 use super::*;
19081 #[derive(Clone, Debug, PartialEq)]
19082 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19083}
19084
19085impl PresetTopology {
19086 /// Gets the enum value.
19087 ///
19088 /// Returns `None` if the enum contains an unknown value deserialized from
19089 /// the string representation of enums.
19090 pub fn value(&self) -> std::option::Option<i32> {
19091 match self {
19092 Self::Unspecified => std::option::Option::Some(0),
19093 Self::Mesh => std::option::Option::Some(2),
19094 Self::Star => std::option::Option::Some(3),
19095 Self::UnknownValue(u) => u.0.value(),
19096 }
19097 }
19098
19099 /// Gets the enum value as a string.
19100 ///
19101 /// Returns `None` if the enum contains an unknown value deserialized from
19102 /// the integer representation of enums.
19103 pub fn name(&self) -> std::option::Option<&str> {
19104 match self {
19105 Self::Unspecified => std::option::Option::Some("PRESET_TOPOLOGY_UNSPECIFIED"),
19106 Self::Mesh => std::option::Option::Some("MESH"),
19107 Self::Star => std::option::Option::Some("STAR"),
19108 Self::UnknownValue(u) => u.0.name(),
19109 }
19110 }
19111}
19112
19113impl std::default::Default for PresetTopology {
19114 fn default() -> Self {
19115 use std::convert::From;
19116 Self::from(0)
19117 }
19118}
19119
19120impl std::fmt::Display for PresetTopology {
19121 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19122 wkt::internal::display_enum(f, self.name(), self.value())
19123 }
19124}
19125
19126impl std::convert::From<i32> for PresetTopology {
19127 fn from(value: i32) -> Self {
19128 match value {
19129 0 => Self::Unspecified,
19130 2 => Self::Mesh,
19131 3 => Self::Star,
19132 _ => Self::UnknownValue(preset_topology::UnknownValue(
19133 wkt::internal::UnknownEnumValue::Integer(value),
19134 )),
19135 }
19136 }
19137}
19138
19139impl std::convert::From<&str> for PresetTopology {
19140 fn from(value: &str) -> Self {
19141 use std::string::ToString;
19142 match value {
19143 "PRESET_TOPOLOGY_UNSPECIFIED" => Self::Unspecified,
19144 "MESH" => Self::Mesh,
19145 "STAR" => Self::Star,
19146 _ => Self::UnknownValue(preset_topology::UnknownValue(
19147 wkt::internal::UnknownEnumValue::String(value.to_string()),
19148 )),
19149 }
19150 }
19151}
19152
19153impl serde::ser::Serialize for PresetTopology {
19154 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19155 where
19156 S: serde::Serializer,
19157 {
19158 match self {
19159 Self::Unspecified => serializer.serialize_i32(0),
19160 Self::Mesh => serializer.serialize_i32(2),
19161 Self::Star => serializer.serialize_i32(3),
19162 Self::UnknownValue(u) => u.0.serialize(serializer),
19163 }
19164 }
19165}
19166
19167impl<'de> serde::de::Deserialize<'de> for PresetTopology {
19168 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19169 where
19170 D: serde::Deserializer<'de>,
19171 {
19172 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PresetTopology>::new(
19173 ".google.cloud.networkconnectivity.v1.PresetTopology",
19174 ))
19175 }
19176}