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 lazy_static;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// Represents the metadata of the long-running operation.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct OperationMetadata {
45 /// Output only. The time the operation was created.
46 pub create_time: std::option::Option<wkt::Timestamp>,
47
48 /// Output only. The time the operation finished running.
49 pub end_time: std::option::Option<wkt::Timestamp>,
50
51 /// Output only. Server-defined resource path for the target of the operation.
52 pub target: std::string::String,
53
54 /// Output only. Name of the verb executed by the operation.
55 pub verb: std::string::String,
56
57 /// Output only. Human-readable status of the operation, if any.
58 pub status_message: std::string::String,
59
60 /// Output only. Identifies whether the user has requested cancellation
61 /// of the operation. Operations that have been cancelled successfully
62 /// have
63 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
64 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
65 /// corresponding to `Code.CANCELLED`.
66 ///
67 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
68 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
69 pub requested_cancellation: bool,
70
71 /// Output only. API version used to start the operation.
72 pub api_version: std::string::String,
73
74 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
75}
76
77impl OperationMetadata {
78 pub fn new() -> Self {
79 std::default::Default::default()
80 }
81
82 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
83 ///
84 /// # Example
85 /// ```ignore,no_run
86 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
87 /// use wkt::Timestamp;
88 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
89 /// ```
90 pub fn set_create_time<T>(mut self, v: T) -> Self
91 where
92 T: std::convert::Into<wkt::Timestamp>,
93 {
94 self.create_time = std::option::Option::Some(v.into());
95 self
96 }
97
98 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
99 ///
100 /// # Example
101 /// ```ignore,no_run
102 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
103 /// use wkt::Timestamp;
104 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
105 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
106 /// ```
107 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
108 where
109 T: std::convert::Into<wkt::Timestamp>,
110 {
111 self.create_time = v.map(|x| x.into());
112 self
113 }
114
115 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
116 ///
117 /// # Example
118 /// ```ignore,no_run
119 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
120 /// use wkt::Timestamp;
121 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
122 /// ```
123 pub fn set_end_time<T>(mut self, v: T) -> Self
124 where
125 T: std::convert::Into<wkt::Timestamp>,
126 {
127 self.end_time = std::option::Option::Some(v.into());
128 self
129 }
130
131 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
132 ///
133 /// # Example
134 /// ```ignore,no_run
135 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
136 /// use wkt::Timestamp;
137 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
138 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
139 /// ```
140 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
141 where
142 T: std::convert::Into<wkt::Timestamp>,
143 {
144 self.end_time = v.map(|x| x.into());
145 self
146 }
147
148 /// Sets the value of [target][crate::model::OperationMetadata::target].
149 ///
150 /// # Example
151 /// ```ignore,no_run
152 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
153 /// let x = OperationMetadata::new().set_target("example");
154 /// ```
155 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
156 self.target = v.into();
157 self
158 }
159
160 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
161 ///
162 /// # Example
163 /// ```ignore,no_run
164 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
165 /// let x = OperationMetadata::new().set_verb("example");
166 /// ```
167 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
168 self.verb = v.into();
169 self
170 }
171
172 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
173 ///
174 /// # Example
175 /// ```ignore,no_run
176 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
177 /// let x = OperationMetadata::new().set_status_message("example");
178 /// ```
179 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
180 self.status_message = v.into();
181 self
182 }
183
184 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
185 ///
186 /// # Example
187 /// ```ignore,no_run
188 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
189 /// let x = OperationMetadata::new().set_requested_cancellation(true);
190 /// ```
191 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
192 self.requested_cancellation = v.into();
193 self
194 }
195
196 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
197 ///
198 /// # Example
199 /// ```ignore,no_run
200 /// # use google_cloud_networkconnectivity_v1::model::OperationMetadata;
201 /// let x = OperationMetadata::new().set_api_version("example");
202 /// ```
203 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
204 self.api_version = v.into();
205 self
206 }
207}
208
209impl wkt::message::Message for OperationMetadata {
210 fn typename() -> &'static str {
211 "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata"
212 }
213}
214
215/// The ServiceConnectionMap resource.
216#[derive(Clone, Default, PartialEq)]
217#[non_exhaustive]
218pub struct ServiceConnectionMap {
219 /// Immutable. The name of a ServiceConnectionMap.
220 /// Format:
221 /// projects/{project}/locations/{location}/serviceConnectionMaps/{service_connection_map}
222 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
223 pub name: std::string::String,
224
225 /// Output only. Time when the ServiceConnectionMap was created.
226 pub create_time: std::option::Option<wkt::Timestamp>,
227
228 /// Output only. Time when the ServiceConnectionMap was updated.
229 pub update_time: std::option::Option<wkt::Timestamp>,
230
231 /// User-defined labels.
232 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
233
234 /// A description of this resource.
235 pub description: std::string::String,
236
237 /// The service class identifier this ServiceConnectionMap is for.
238 /// The user of ServiceConnectionMap create API needs to have
239 /// networkconnecitivty.serviceclasses.use iam permission for the service
240 /// class.
241 pub service_class: std::string::String,
242
243 /// Output only. The service class uri this ServiceConnectionMap is for.
244 pub service_class_uri: std::string::String,
245
246 /// Output only. The infrastructure used for connections between
247 /// consumers/producers.
248 pub infrastructure: crate::model::Infrastructure,
249
250 /// The PSC configurations on producer side.
251 pub producer_psc_configs:
252 std::vec::Vec<crate::model::service_connection_map::ProducerPscConfig>,
253
254 /// The PSC configurations on consumer side.
255 pub consumer_psc_configs:
256 std::vec::Vec<crate::model::service_connection_map::ConsumerPscConfig>,
257
258 /// Output only. PSC connection details on consumer side.
259 pub consumer_psc_connections:
260 std::vec::Vec<crate::model::service_connection_map::ConsumerPscConnection>,
261
262 /// The token provided by the consumer. This token authenticates that the
263 /// consumer can create a connection within the specified project and network.
264 pub token: std::string::String,
265
266 /// Optional. The etag is computed by the server, and may be sent on update and
267 /// delete requests to ensure the client has an up-to-date value before
268 /// proceeding.
269 pub etag: std::option::Option<std::string::String>,
270
271 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
272}
273
274impl ServiceConnectionMap {
275 pub fn new() -> Self {
276 std::default::Default::default()
277 }
278
279 /// Sets the value of [name][crate::model::ServiceConnectionMap::name].
280 ///
281 /// # Example
282 /// ```ignore,no_run
283 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
284 /// let x = ServiceConnectionMap::new().set_name("example");
285 /// ```
286 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
287 self.name = v.into();
288 self
289 }
290
291 /// Sets the value of [create_time][crate::model::ServiceConnectionMap::create_time].
292 ///
293 /// # Example
294 /// ```ignore,no_run
295 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
296 /// use wkt::Timestamp;
297 /// let x = ServiceConnectionMap::new().set_create_time(Timestamp::default()/* use setters */);
298 /// ```
299 pub fn set_create_time<T>(mut self, v: T) -> Self
300 where
301 T: std::convert::Into<wkt::Timestamp>,
302 {
303 self.create_time = std::option::Option::Some(v.into());
304 self
305 }
306
307 /// Sets or clears the value of [create_time][crate::model::ServiceConnectionMap::create_time].
308 ///
309 /// # Example
310 /// ```ignore,no_run
311 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
312 /// use wkt::Timestamp;
313 /// let x = ServiceConnectionMap::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
314 /// let x = ServiceConnectionMap::new().set_or_clear_create_time(None::<Timestamp>);
315 /// ```
316 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
317 where
318 T: std::convert::Into<wkt::Timestamp>,
319 {
320 self.create_time = v.map(|x| x.into());
321 self
322 }
323
324 /// Sets the value of [update_time][crate::model::ServiceConnectionMap::update_time].
325 ///
326 /// # Example
327 /// ```ignore,no_run
328 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
329 /// use wkt::Timestamp;
330 /// let x = ServiceConnectionMap::new().set_update_time(Timestamp::default()/* use setters */);
331 /// ```
332 pub fn set_update_time<T>(mut self, v: T) -> Self
333 where
334 T: std::convert::Into<wkt::Timestamp>,
335 {
336 self.update_time = std::option::Option::Some(v.into());
337 self
338 }
339
340 /// Sets or clears the value of [update_time][crate::model::ServiceConnectionMap::update_time].
341 ///
342 /// # Example
343 /// ```ignore,no_run
344 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
345 /// use wkt::Timestamp;
346 /// let x = ServiceConnectionMap::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
347 /// let x = ServiceConnectionMap::new().set_or_clear_update_time(None::<Timestamp>);
348 /// ```
349 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
350 where
351 T: std::convert::Into<wkt::Timestamp>,
352 {
353 self.update_time = v.map(|x| x.into());
354 self
355 }
356
357 /// Sets the value of [labels][crate::model::ServiceConnectionMap::labels].
358 ///
359 /// # Example
360 /// ```ignore,no_run
361 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
362 /// let x = ServiceConnectionMap::new().set_labels([
363 /// ("key0", "abc"),
364 /// ("key1", "xyz"),
365 /// ]);
366 /// ```
367 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
368 where
369 T: std::iter::IntoIterator<Item = (K, V)>,
370 K: std::convert::Into<std::string::String>,
371 V: std::convert::Into<std::string::String>,
372 {
373 use std::iter::Iterator;
374 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
375 self
376 }
377
378 /// Sets the value of [description][crate::model::ServiceConnectionMap::description].
379 ///
380 /// # Example
381 /// ```ignore,no_run
382 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
383 /// let x = ServiceConnectionMap::new().set_description("example");
384 /// ```
385 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
386 self.description = v.into();
387 self
388 }
389
390 /// Sets the value of [service_class][crate::model::ServiceConnectionMap::service_class].
391 ///
392 /// # Example
393 /// ```ignore,no_run
394 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
395 /// let x = ServiceConnectionMap::new().set_service_class("example");
396 /// ```
397 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
398 self.service_class = v.into();
399 self
400 }
401
402 /// Sets the value of [service_class_uri][crate::model::ServiceConnectionMap::service_class_uri].
403 ///
404 /// # Example
405 /// ```ignore,no_run
406 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
407 /// let x = ServiceConnectionMap::new().set_service_class_uri("example");
408 /// ```
409 pub fn set_service_class_uri<T: std::convert::Into<std::string::String>>(
410 mut self,
411 v: T,
412 ) -> Self {
413 self.service_class_uri = v.into();
414 self
415 }
416
417 /// Sets the value of [infrastructure][crate::model::ServiceConnectionMap::infrastructure].
418 ///
419 /// # Example
420 /// ```ignore,no_run
421 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
422 /// use google_cloud_networkconnectivity_v1::model::Infrastructure;
423 /// let x0 = ServiceConnectionMap::new().set_infrastructure(Infrastructure::Psc);
424 /// ```
425 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
426 mut self,
427 v: T,
428 ) -> Self {
429 self.infrastructure = v.into();
430 self
431 }
432
433 /// Sets the value of [producer_psc_configs][crate::model::ServiceConnectionMap::producer_psc_configs].
434 ///
435 /// # Example
436 /// ```ignore,no_run
437 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
438 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ProducerPscConfig;
439 /// let x = ServiceConnectionMap::new()
440 /// .set_producer_psc_configs([
441 /// ProducerPscConfig::default()/* use setters */,
442 /// ProducerPscConfig::default()/* use (different) setters */,
443 /// ]);
444 /// ```
445 pub fn set_producer_psc_configs<T, V>(mut self, v: T) -> Self
446 where
447 T: std::iter::IntoIterator<Item = V>,
448 V: std::convert::Into<crate::model::service_connection_map::ProducerPscConfig>,
449 {
450 use std::iter::Iterator;
451 self.producer_psc_configs = v.into_iter().map(|i| i.into()).collect();
452 self
453 }
454
455 /// Sets the value of [consumer_psc_configs][crate::model::ServiceConnectionMap::consumer_psc_configs].
456 ///
457 /// # Example
458 /// ```ignore,no_run
459 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
460 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
461 /// let x = ServiceConnectionMap::new()
462 /// .set_consumer_psc_configs([
463 /// ConsumerPscConfig::default()/* use setters */,
464 /// ConsumerPscConfig::default()/* use (different) setters */,
465 /// ]);
466 /// ```
467 pub fn set_consumer_psc_configs<T, V>(mut self, v: T) -> Self
468 where
469 T: std::iter::IntoIterator<Item = V>,
470 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConfig>,
471 {
472 use std::iter::Iterator;
473 self.consumer_psc_configs = v.into_iter().map(|i| i.into()).collect();
474 self
475 }
476
477 /// Sets the value of [consumer_psc_connections][crate::model::ServiceConnectionMap::consumer_psc_connections].
478 ///
479 /// # Example
480 /// ```ignore,no_run
481 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
482 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
483 /// let x = ServiceConnectionMap::new()
484 /// .set_consumer_psc_connections([
485 /// ConsumerPscConnection::default()/* use setters */,
486 /// ConsumerPscConnection::default()/* use (different) setters */,
487 /// ]);
488 /// ```
489 pub fn set_consumer_psc_connections<T, V>(mut self, v: T) -> Self
490 where
491 T: std::iter::IntoIterator<Item = V>,
492 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConnection>,
493 {
494 use std::iter::Iterator;
495 self.consumer_psc_connections = v.into_iter().map(|i| i.into()).collect();
496 self
497 }
498
499 /// Sets the value of [token][crate::model::ServiceConnectionMap::token].
500 ///
501 /// # Example
502 /// ```ignore,no_run
503 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
504 /// let x = ServiceConnectionMap::new().set_token("example");
505 /// ```
506 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
507 self.token = v.into();
508 self
509 }
510
511 /// Sets the value of [etag][crate::model::ServiceConnectionMap::etag].
512 ///
513 /// # Example
514 /// ```ignore,no_run
515 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
516 /// let x = ServiceConnectionMap::new().set_etag("example");
517 /// ```
518 pub fn set_etag<T>(mut self, v: T) -> Self
519 where
520 T: std::convert::Into<std::string::String>,
521 {
522 self.etag = std::option::Option::Some(v.into());
523 self
524 }
525
526 /// Sets or clears the value of [etag][crate::model::ServiceConnectionMap::etag].
527 ///
528 /// # Example
529 /// ```ignore,no_run
530 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
531 /// let x = ServiceConnectionMap::new().set_or_clear_etag(Some("example"));
532 /// let x = ServiceConnectionMap::new().set_or_clear_etag(None::<String>);
533 /// ```
534 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
535 where
536 T: std::convert::Into<std::string::String>,
537 {
538 self.etag = v.map(|x| x.into());
539 self
540 }
541}
542
543impl wkt::message::Message for ServiceConnectionMap {
544 fn typename() -> &'static str {
545 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap"
546 }
547}
548
549/// Defines additional types related to [ServiceConnectionMap].
550pub mod service_connection_map {
551 #[allow(unused_imports)]
552 use super::*;
553
554 /// The PSC configurations on producer side.
555 #[derive(Clone, Default, PartialEq)]
556 #[non_exhaustive]
557 pub struct ProducerPscConfig {
558 /// The resource path of a service attachment.
559 /// Example:
560 /// projects/{projectNumOrId}/regions/{region}/serviceAttachments/{resourceId}.
561 pub service_attachment_uri: std::string::String,
562
563 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
564 }
565
566 impl ProducerPscConfig {
567 pub fn new() -> Self {
568 std::default::Default::default()
569 }
570
571 /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ProducerPscConfig::service_attachment_uri].
572 ///
573 /// # Example
574 /// ```ignore,no_run
575 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ProducerPscConfig;
576 /// let x = ProducerPscConfig::new().set_service_attachment_uri("example");
577 /// ```
578 pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
579 mut self,
580 v: T,
581 ) -> Self {
582 self.service_attachment_uri = v.into();
583 self
584 }
585 }
586
587 impl wkt::message::Message for ProducerPscConfig {
588 fn typename() -> &'static str {
589 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ProducerPscConfig"
590 }
591 }
592
593 /// Allow the producer to specify which consumers can connect to it.
594 #[derive(Clone, Default, PartialEq)]
595 #[non_exhaustive]
596 pub struct ConsumerPscConfig {
597 /// The consumer project where PSC connections are allowed to be created in.
598 pub project: std::string::String,
599
600 /// The resource path of the consumer network where PSC connections are
601 /// allowed to be created in. Note, this network does not need be in the
602 /// ConsumerPscConfig.project in the case of SharedVPC.
603 /// Example:
604 /// projects/{projectNumOrId}/global/networks/{networkId}.
605 pub network: std::string::String,
606
607 /// This is used in PSC consumer ForwardingRule to control whether the PSC
608 /// endpoint can be accessed from another region.
609 pub disable_global_access: bool,
610
611 /// Output only. Overall state of PSC Connections management for this
612 /// consumer psc config.
613 pub state: crate::model::service_connection_map::consumer_psc_config::State,
614
615 /// Immutable. Deprecated. Use producer_instance_metadata instead.
616 /// An immutable identifier for the producer instance.
617 #[deprecated]
618 pub producer_instance_id: std::string::String,
619
620 /// Output only. A map to store mapping between customer vip and target
621 /// service attachment. Only service attachment with producer specified ip
622 /// addresses are stored here.
623 pub service_attachment_ip_address_map:
624 std::collections::HashMap<std::string::String, std::string::String>,
625
626 /// Required. The project ID or project number of the consumer project. This
627 /// project is the one that the consumer uses to interact with the producer
628 /// instance. From the perspective of a consumer who's created a producer
629 /// instance, this is the project of the producer instance. Format:
630 /// 'projects/<project_id_or_number>' Eg. 'projects/consumer-project' or
631 /// 'projects/1234'
632 pub consumer_instance_project: std::string::String,
633
634 /// Immutable. An immutable map for the producer instance metadata.
635 pub producer_instance_metadata:
636 std::collections::HashMap<std::string::String, std::string::String>,
637
638 /// The requested IP version for the PSC connection.
639 pub ip_version: std::option::Option<crate::model::IPVersion>,
640
641 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
642 }
643
644 impl ConsumerPscConfig {
645 pub fn new() -> Self {
646 std::default::Default::default()
647 }
648
649 /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConfig::project].
650 ///
651 /// # Example
652 /// ```ignore,no_run
653 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
654 /// let x = ConsumerPscConfig::new().set_project("example");
655 /// ```
656 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
657 self.project = v.into();
658 self
659 }
660
661 /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConfig::network].
662 ///
663 /// # Example
664 /// ```ignore,no_run
665 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
666 /// let x = ConsumerPscConfig::new().set_network("example");
667 /// ```
668 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
669 self.network = v.into();
670 self
671 }
672
673 /// Sets the value of [disable_global_access][crate::model::service_connection_map::ConsumerPscConfig::disable_global_access].
674 ///
675 /// # Example
676 /// ```ignore,no_run
677 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
678 /// let x = ConsumerPscConfig::new().set_disable_global_access(true);
679 /// ```
680 pub fn set_disable_global_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
681 self.disable_global_access = v.into();
682 self
683 }
684
685 /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConfig::state].
686 ///
687 /// # Example
688 /// ```ignore,no_run
689 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
690 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::consumer_psc_config::State;
691 /// let x0 = ConsumerPscConfig::new().set_state(State::Valid);
692 /// let x1 = ConsumerPscConfig::new().set_state(State::ConnectionPolicyMissing);
693 /// let x2 = ConsumerPscConfig::new().set_state(State::PolicyLimitReached);
694 /// ```
695 pub fn set_state<
696 T: std::convert::Into<crate::model::service_connection_map::consumer_psc_config::State>,
697 >(
698 mut self,
699 v: T,
700 ) -> Self {
701 self.state = v.into();
702 self
703 }
704
705 /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_id].
706 ///
707 /// # Example
708 /// ```ignore,no_run
709 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
710 /// let x = ConsumerPscConfig::new().set_producer_instance_id("example");
711 /// ```
712 #[deprecated]
713 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
714 mut self,
715 v: T,
716 ) -> Self {
717 self.producer_instance_id = v.into();
718 self
719 }
720
721 /// Sets the value of [service_attachment_ip_address_map][crate::model::service_connection_map::ConsumerPscConfig::service_attachment_ip_address_map].
722 ///
723 /// # Example
724 /// ```ignore,no_run
725 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
726 /// let x = ConsumerPscConfig::new().set_service_attachment_ip_address_map([
727 /// ("key0", "abc"),
728 /// ("key1", "xyz"),
729 /// ]);
730 /// ```
731 pub fn set_service_attachment_ip_address_map<T, K, V>(mut self, v: T) -> Self
732 where
733 T: std::iter::IntoIterator<Item = (K, V)>,
734 K: std::convert::Into<std::string::String>,
735 V: std::convert::Into<std::string::String>,
736 {
737 use std::iter::Iterator;
738 self.service_attachment_ip_address_map =
739 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
740 self
741 }
742
743 /// Sets the value of [consumer_instance_project][crate::model::service_connection_map::ConsumerPscConfig::consumer_instance_project].
744 ///
745 /// # Example
746 /// ```ignore,no_run
747 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
748 /// let x = ConsumerPscConfig::new().set_consumer_instance_project("example");
749 /// ```
750 pub fn set_consumer_instance_project<T: std::convert::Into<std::string::String>>(
751 mut self,
752 v: T,
753 ) -> Self {
754 self.consumer_instance_project = v.into();
755 self
756 }
757
758 /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_metadata].
759 ///
760 /// # Example
761 /// ```ignore,no_run
762 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
763 /// let x = ConsumerPscConfig::new().set_producer_instance_metadata([
764 /// ("key0", "abc"),
765 /// ("key1", "xyz"),
766 /// ]);
767 /// ```
768 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
769 where
770 T: std::iter::IntoIterator<Item = (K, V)>,
771 K: std::convert::Into<std::string::String>,
772 V: std::convert::Into<std::string::String>,
773 {
774 use std::iter::Iterator;
775 self.producer_instance_metadata =
776 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
777 self
778 }
779
780 /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
781 ///
782 /// # Example
783 /// ```ignore,no_run
784 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
785 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
786 /// let x0 = ConsumerPscConfig::new().set_ip_version(IPVersion::Ipv4);
787 /// let x1 = ConsumerPscConfig::new().set_ip_version(IPVersion::Ipv6);
788 /// ```
789 pub fn set_ip_version<T>(mut self, v: T) -> Self
790 where
791 T: std::convert::Into<crate::model::IPVersion>,
792 {
793 self.ip_version = std::option::Option::Some(v.into());
794 self
795 }
796
797 /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
798 ///
799 /// # Example
800 /// ```ignore,no_run
801 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
802 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
803 /// let x0 = ConsumerPscConfig::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
804 /// let x1 = ConsumerPscConfig::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
805 /// let x_none = ConsumerPscConfig::new().set_or_clear_ip_version(None::<IPVersion>);
806 /// ```
807 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
808 where
809 T: std::convert::Into<crate::model::IPVersion>,
810 {
811 self.ip_version = v.map(|x| x.into());
812 self
813 }
814 }
815
816 impl wkt::message::Message for ConsumerPscConfig {
817 fn typename() -> &'static str {
818 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig"
819 }
820 }
821
822 /// Defines additional types related to [ConsumerPscConfig].
823 pub mod consumer_psc_config {
824 #[allow(unused_imports)]
825 use super::*;
826
827 /// PSC Consumer Config State.
828 ///
829 /// # Working with unknown values
830 ///
831 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
832 /// additional enum variants at any time. Adding new variants is not considered
833 /// a breaking change. Applications should write their code in anticipation of:
834 ///
835 /// - New values appearing in future releases of the client library, **and**
836 /// - New values received dynamically, without application changes.
837 ///
838 /// Please consult the [Working with enums] section in the user guide for some
839 /// guidelines.
840 ///
841 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
842 #[derive(Clone, Debug, PartialEq)]
843 #[non_exhaustive]
844 pub enum State {
845 /// Default state, when Connection Map is created initially.
846 Unspecified,
847 /// Set when policy and map configuration is valid,
848 /// and their matching can lead to allowing creation of PSC Connections
849 /// subject to other constraints like connections limit.
850 Valid,
851 /// No Service Connection Policy found for this network and Service
852 /// Class
853 ConnectionPolicyMissing,
854 /// Service Connection Policy limit reached for this network and Service
855 /// Class
856 PolicyLimitReached,
857 /// The consumer instance project is not in
858 /// AllowedGoogleProducersResourceHierarchyLevels of the matching
859 /// ServiceConnectionPolicy.
860 ConsumerInstanceProjectNotAllowlisted,
861 /// If set, the enum was initialized with an unknown value.
862 ///
863 /// Applications can examine the value using [State::value] or
864 /// [State::name].
865 UnknownValue(state::UnknownValue),
866 }
867
868 #[doc(hidden)]
869 pub mod state {
870 #[allow(unused_imports)]
871 use super::*;
872 #[derive(Clone, Debug, PartialEq)]
873 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
874 }
875
876 impl State {
877 /// Gets the enum value.
878 ///
879 /// Returns `None` if the enum contains an unknown value deserialized from
880 /// the string representation of enums.
881 pub fn value(&self) -> std::option::Option<i32> {
882 match self {
883 Self::Unspecified => std::option::Option::Some(0),
884 Self::Valid => std::option::Option::Some(1),
885 Self::ConnectionPolicyMissing => std::option::Option::Some(2),
886 Self::PolicyLimitReached => std::option::Option::Some(3),
887 Self::ConsumerInstanceProjectNotAllowlisted => std::option::Option::Some(4),
888 Self::UnknownValue(u) => u.0.value(),
889 }
890 }
891
892 /// Gets the enum value as a string.
893 ///
894 /// Returns `None` if the enum contains an unknown value deserialized from
895 /// the integer representation of enums.
896 pub fn name(&self) -> std::option::Option<&str> {
897 match self {
898 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
899 Self::Valid => std::option::Option::Some("VALID"),
900 Self::ConnectionPolicyMissing => {
901 std::option::Option::Some("CONNECTION_POLICY_MISSING")
902 }
903 Self::PolicyLimitReached => std::option::Option::Some("POLICY_LIMIT_REACHED"),
904 Self::ConsumerInstanceProjectNotAllowlisted => {
905 std::option::Option::Some("CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED")
906 }
907 Self::UnknownValue(u) => u.0.name(),
908 }
909 }
910 }
911
912 impl std::default::Default for State {
913 fn default() -> Self {
914 use std::convert::From;
915 Self::from(0)
916 }
917 }
918
919 impl std::fmt::Display for State {
920 fn fmt(
921 &self,
922 f: &mut std::fmt::Formatter<'_>,
923 ) -> std::result::Result<(), std::fmt::Error> {
924 wkt::internal::display_enum(f, self.name(), self.value())
925 }
926 }
927
928 impl std::convert::From<i32> for State {
929 fn from(value: i32) -> Self {
930 match value {
931 0 => Self::Unspecified,
932 1 => Self::Valid,
933 2 => Self::ConnectionPolicyMissing,
934 3 => Self::PolicyLimitReached,
935 4 => Self::ConsumerInstanceProjectNotAllowlisted,
936 _ => Self::UnknownValue(state::UnknownValue(
937 wkt::internal::UnknownEnumValue::Integer(value),
938 )),
939 }
940 }
941 }
942
943 impl std::convert::From<&str> for State {
944 fn from(value: &str) -> Self {
945 use std::string::ToString;
946 match value {
947 "STATE_UNSPECIFIED" => Self::Unspecified,
948 "VALID" => Self::Valid,
949 "CONNECTION_POLICY_MISSING" => Self::ConnectionPolicyMissing,
950 "POLICY_LIMIT_REACHED" => Self::PolicyLimitReached,
951 "CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" => {
952 Self::ConsumerInstanceProjectNotAllowlisted
953 }
954 _ => Self::UnknownValue(state::UnknownValue(
955 wkt::internal::UnknownEnumValue::String(value.to_string()),
956 )),
957 }
958 }
959 }
960
961 impl serde::ser::Serialize for State {
962 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
963 where
964 S: serde::Serializer,
965 {
966 match self {
967 Self::Unspecified => serializer.serialize_i32(0),
968 Self::Valid => serializer.serialize_i32(1),
969 Self::ConnectionPolicyMissing => serializer.serialize_i32(2),
970 Self::PolicyLimitReached => serializer.serialize_i32(3),
971 Self::ConsumerInstanceProjectNotAllowlisted => serializer.serialize_i32(4),
972 Self::UnknownValue(u) => u.0.serialize(serializer),
973 }
974 }
975 }
976
977 impl<'de> serde::de::Deserialize<'de> for State {
978 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
979 where
980 D: serde::Deserializer<'de>,
981 {
982 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
983 ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig.State"))
984 }
985 }
986 }
987
988 /// PSC connection details on consumer side.
989 #[derive(Clone, Default, PartialEq)]
990 #[non_exhaustive]
991 pub struct ConsumerPscConnection {
992 /// The URI of a service attachment which is the target of the PSC
993 /// connection.
994 pub service_attachment_uri: std::string::String,
995
996 /// The state of the PSC connection.
997 pub state: crate::model::service_connection_map::consumer_psc_connection::State,
998
999 /// The consumer project whose PSC forwarding rule is connected to the
1000 /// service attachments in this service connection map.
1001 pub project: std::string::String,
1002
1003 /// The consumer network whose PSC forwarding rule is connected to the
1004 /// service attachments in this service connection map.
1005 /// Note that the network could be on a different project (shared VPC).
1006 pub network: std::string::String,
1007
1008 /// The PSC connection id of the PSC forwarding rule connected
1009 /// to the service attachments in this service connection map.
1010 pub psc_connection_id: std::string::String,
1011
1012 /// The IP literal allocated on the consumer network for the PSC forwarding
1013 /// rule that is created to connect to the producer service attachment in
1014 /// this service connection map.
1015 pub ip: std::string::String,
1016
1017 /// The error type indicates whether the error is consumer facing, producer
1018 /// facing or system internal.
1019 #[deprecated]
1020 pub error_type: crate::model::ConnectionErrorType,
1021
1022 /// The most recent error during operating this connection.
1023 #[deprecated]
1024 pub error: std::option::Option<google_cloud_rpc::model::Status>,
1025
1026 /// The last Compute Engine operation to setup PSC connection.
1027 pub gce_operation: std::string::String,
1028
1029 /// The URI of the consumer forwarding rule created.
1030 /// Example:
1031 /// projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.
1032 pub forwarding_rule: std::string::String,
1033
1034 /// Output only. The error info for the latest error during operating this
1035 /// connection.
1036 pub error_info: std::option::Option<google_cloud_rpc::model::ErrorInfo>,
1037
1038 /// Output only. The URI of the selected subnetwork selected to allocate IP
1039 /// address for this connection.
1040 pub selected_subnetwork: std::string::String,
1041
1042 /// Immutable. Deprecated. Use producer_instance_metadata instead.
1043 /// An immutable identifier for the producer instance.
1044 #[deprecated]
1045 pub producer_instance_id: std::string::String,
1046
1047 /// Immutable. An immutable map for the producer instance metadata.
1048 pub producer_instance_metadata:
1049 std::collections::HashMap<std::string::String, std::string::String>,
1050
1051 /// The requested IP version for the PSC connection.
1052 pub ip_version: std::option::Option<crate::model::IPVersion>,
1053
1054 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1055 }
1056
1057 impl ConsumerPscConnection {
1058 pub fn new() -> Self {
1059 std::default::Default::default()
1060 }
1061
1062 /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ConsumerPscConnection::service_attachment_uri].
1063 ///
1064 /// # Example
1065 /// ```ignore,no_run
1066 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1067 /// let x = ConsumerPscConnection::new().set_service_attachment_uri("example");
1068 /// ```
1069 pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
1070 mut self,
1071 v: T,
1072 ) -> Self {
1073 self.service_attachment_uri = v.into();
1074 self
1075 }
1076
1077 /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConnection::state].
1078 ///
1079 /// # Example
1080 /// ```ignore,no_run
1081 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1082 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::consumer_psc_connection::State;
1083 /// let x0 = ConsumerPscConnection::new().set_state(State::Active);
1084 /// let x1 = ConsumerPscConnection::new().set_state(State::Failed);
1085 /// let x2 = ConsumerPscConnection::new().set_state(State::Creating);
1086 /// ```
1087 pub fn set_state<
1088 T: std::convert::Into<
1089 crate::model::service_connection_map::consumer_psc_connection::State,
1090 >,
1091 >(
1092 mut self,
1093 v: T,
1094 ) -> Self {
1095 self.state = v.into();
1096 self
1097 }
1098
1099 /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConnection::project].
1100 ///
1101 /// # Example
1102 /// ```ignore,no_run
1103 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1104 /// let x = ConsumerPscConnection::new().set_project("example");
1105 /// ```
1106 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1107 self.project = v.into();
1108 self
1109 }
1110
1111 /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConnection::network].
1112 ///
1113 /// # Example
1114 /// ```ignore,no_run
1115 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1116 /// let x = ConsumerPscConnection::new().set_network("example");
1117 /// ```
1118 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1119 self.network = v.into();
1120 self
1121 }
1122
1123 /// Sets the value of [psc_connection_id][crate::model::service_connection_map::ConsumerPscConnection::psc_connection_id].
1124 ///
1125 /// # Example
1126 /// ```ignore,no_run
1127 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1128 /// let x = ConsumerPscConnection::new().set_psc_connection_id("example");
1129 /// ```
1130 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
1131 mut self,
1132 v: T,
1133 ) -> Self {
1134 self.psc_connection_id = v.into();
1135 self
1136 }
1137
1138 /// Sets the value of [ip][crate::model::service_connection_map::ConsumerPscConnection::ip].
1139 ///
1140 /// # Example
1141 /// ```ignore,no_run
1142 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1143 /// let x = ConsumerPscConnection::new().set_ip("example");
1144 /// ```
1145 pub fn set_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1146 self.ip = v.into();
1147 self
1148 }
1149
1150 /// Sets the value of [error_type][crate::model::service_connection_map::ConsumerPscConnection::error_type].
1151 ///
1152 /// # Example
1153 /// ```ignore,no_run
1154 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1155 /// use google_cloud_networkconnectivity_v1::model::ConnectionErrorType;
1156 /// let x0 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorInternal);
1157 /// let x1 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorConsumerSide);
1158 /// let x2 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorProducerSide);
1159 /// ```
1160 #[deprecated]
1161 pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
1162 mut self,
1163 v: T,
1164 ) -> Self {
1165 self.error_type = v.into();
1166 self
1167 }
1168
1169 /// Sets the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
1170 ///
1171 /// # Example
1172 /// ```ignore,no_run
1173 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1174 /// use google_cloud_rpc::model::Status;
1175 /// let x = ConsumerPscConnection::new().set_error(Status::default()/* use setters */);
1176 /// ```
1177 #[deprecated]
1178 pub fn set_error<T>(mut self, v: T) -> Self
1179 where
1180 T: std::convert::Into<google_cloud_rpc::model::Status>,
1181 {
1182 self.error = std::option::Option::Some(v.into());
1183 self
1184 }
1185
1186 /// Sets or clears the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
1187 ///
1188 /// # Example
1189 /// ```ignore,no_run
1190 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1191 /// use google_cloud_rpc::model::Status;
1192 /// let x = ConsumerPscConnection::new().set_or_clear_error(Some(Status::default()/* use setters */));
1193 /// let x = ConsumerPscConnection::new().set_or_clear_error(None::<Status>);
1194 /// ```
1195 #[deprecated]
1196 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1197 where
1198 T: std::convert::Into<google_cloud_rpc::model::Status>,
1199 {
1200 self.error = v.map(|x| x.into());
1201 self
1202 }
1203
1204 /// Sets the value of [gce_operation][crate::model::service_connection_map::ConsumerPscConnection::gce_operation].
1205 ///
1206 /// # Example
1207 /// ```ignore,no_run
1208 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1209 /// let x = ConsumerPscConnection::new().set_gce_operation("example");
1210 /// ```
1211 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
1212 mut self,
1213 v: T,
1214 ) -> Self {
1215 self.gce_operation = v.into();
1216 self
1217 }
1218
1219 /// Sets the value of [forwarding_rule][crate::model::service_connection_map::ConsumerPscConnection::forwarding_rule].
1220 ///
1221 /// # Example
1222 /// ```ignore,no_run
1223 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1224 /// let x = ConsumerPscConnection::new().set_forwarding_rule("example");
1225 /// ```
1226 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(
1227 mut self,
1228 v: T,
1229 ) -> Self {
1230 self.forwarding_rule = v.into();
1231 self
1232 }
1233
1234 /// Sets the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
1235 ///
1236 /// # Example
1237 /// ```ignore,no_run
1238 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1239 /// use google_cloud_rpc::model::ErrorInfo;
1240 /// let x = ConsumerPscConnection::new().set_error_info(ErrorInfo::default()/* use setters */);
1241 /// ```
1242 pub fn set_error_info<T>(mut self, v: T) -> Self
1243 where
1244 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
1245 {
1246 self.error_info = std::option::Option::Some(v.into());
1247 self
1248 }
1249
1250 /// Sets or clears the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
1251 ///
1252 /// # Example
1253 /// ```ignore,no_run
1254 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1255 /// use google_cloud_rpc::model::ErrorInfo;
1256 /// let x = ConsumerPscConnection::new().set_or_clear_error_info(Some(ErrorInfo::default()/* use setters */));
1257 /// let x = ConsumerPscConnection::new().set_or_clear_error_info(None::<ErrorInfo>);
1258 /// ```
1259 pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
1260 where
1261 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
1262 {
1263 self.error_info = v.map(|x| x.into());
1264 self
1265 }
1266
1267 /// Sets the value of [selected_subnetwork][crate::model::service_connection_map::ConsumerPscConnection::selected_subnetwork].
1268 ///
1269 /// # Example
1270 /// ```ignore,no_run
1271 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1272 /// let x = ConsumerPscConnection::new().set_selected_subnetwork("example");
1273 /// ```
1274 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
1275 mut self,
1276 v: T,
1277 ) -> Self {
1278 self.selected_subnetwork = v.into();
1279 self
1280 }
1281
1282 /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_id].
1283 ///
1284 /// # Example
1285 /// ```ignore,no_run
1286 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1287 /// let x = ConsumerPscConnection::new().set_producer_instance_id("example");
1288 /// ```
1289 #[deprecated]
1290 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
1291 mut self,
1292 v: T,
1293 ) -> Self {
1294 self.producer_instance_id = v.into();
1295 self
1296 }
1297
1298 /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_metadata].
1299 ///
1300 /// # Example
1301 /// ```ignore,no_run
1302 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1303 /// let x = ConsumerPscConnection::new().set_producer_instance_metadata([
1304 /// ("key0", "abc"),
1305 /// ("key1", "xyz"),
1306 /// ]);
1307 /// ```
1308 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
1309 where
1310 T: std::iter::IntoIterator<Item = (K, V)>,
1311 K: std::convert::Into<std::string::String>,
1312 V: std::convert::Into<std::string::String>,
1313 {
1314 use std::iter::Iterator;
1315 self.producer_instance_metadata =
1316 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1317 self
1318 }
1319
1320 /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
1321 ///
1322 /// # Example
1323 /// ```ignore,no_run
1324 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1325 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
1326 /// let x0 = ConsumerPscConnection::new().set_ip_version(IPVersion::Ipv4);
1327 /// let x1 = ConsumerPscConnection::new().set_ip_version(IPVersion::Ipv6);
1328 /// ```
1329 pub fn set_ip_version<T>(mut self, v: T) -> Self
1330 where
1331 T: std::convert::Into<crate::model::IPVersion>,
1332 {
1333 self.ip_version = std::option::Option::Some(v.into());
1334 self
1335 }
1336
1337 /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
1338 ///
1339 /// # Example
1340 /// ```ignore,no_run
1341 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1342 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
1343 /// let x0 = ConsumerPscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
1344 /// let x1 = ConsumerPscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
1345 /// let x_none = ConsumerPscConnection::new().set_or_clear_ip_version(None::<IPVersion>);
1346 /// ```
1347 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
1348 where
1349 T: std::convert::Into<crate::model::IPVersion>,
1350 {
1351 self.ip_version = v.map(|x| x.into());
1352 self
1353 }
1354 }
1355
1356 impl wkt::message::Message for ConsumerPscConnection {
1357 fn typename() -> &'static str {
1358 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection"
1359 }
1360 }
1361
1362 /// Defines additional types related to [ConsumerPscConnection].
1363 pub mod consumer_psc_connection {
1364 #[allow(unused_imports)]
1365 use super::*;
1366
1367 /// The state of the PSC connection.
1368 /// We reserve the right to add more states without notice in the future.
1369 /// Users should not use exhaustive switch statements on this enum.
1370 /// See <https://google.aip.dev/216>.
1371 ///
1372 /// # Working with unknown values
1373 ///
1374 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1375 /// additional enum variants at any time. Adding new variants is not considered
1376 /// a breaking change. Applications should write their code in anticipation of:
1377 ///
1378 /// - New values appearing in future releases of the client library, **and**
1379 /// - New values received dynamically, without application changes.
1380 ///
1381 /// Please consult the [Working with enums] section in the user guide for some
1382 /// guidelines.
1383 ///
1384 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1385 #[derive(Clone, Debug, PartialEq)]
1386 #[non_exhaustive]
1387 pub enum State {
1388 /// An invalid state as the default case.
1389 Unspecified,
1390 /// The connection has been created successfully. However, for the
1391 /// up-to-date connection status, please use the service attachment's
1392 /// "ConnectedEndpoint.status" as the source of truth.
1393 Active,
1394 /// The connection is not functional since some resources on the connection
1395 /// fail to be created.
1396 Failed,
1397 /// The connection is being created.
1398 Creating,
1399 /// The connection is being deleted.
1400 Deleting,
1401 /// The connection is being repaired to complete creation.
1402 CreateRepairing,
1403 /// The connection is being repaired to complete deletion.
1404 DeleteRepairing,
1405 /// If set, the enum was initialized with an unknown value.
1406 ///
1407 /// Applications can examine the value using [State::value] or
1408 /// [State::name].
1409 UnknownValue(state::UnknownValue),
1410 }
1411
1412 #[doc(hidden)]
1413 pub mod state {
1414 #[allow(unused_imports)]
1415 use super::*;
1416 #[derive(Clone, Debug, PartialEq)]
1417 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1418 }
1419
1420 impl State {
1421 /// Gets the enum value.
1422 ///
1423 /// Returns `None` if the enum contains an unknown value deserialized from
1424 /// the string representation of enums.
1425 pub fn value(&self) -> std::option::Option<i32> {
1426 match self {
1427 Self::Unspecified => std::option::Option::Some(0),
1428 Self::Active => std::option::Option::Some(1),
1429 Self::Failed => std::option::Option::Some(2),
1430 Self::Creating => std::option::Option::Some(3),
1431 Self::Deleting => std::option::Option::Some(4),
1432 Self::CreateRepairing => std::option::Option::Some(5),
1433 Self::DeleteRepairing => std::option::Option::Some(6),
1434 Self::UnknownValue(u) => u.0.value(),
1435 }
1436 }
1437
1438 /// Gets the enum value as a string.
1439 ///
1440 /// Returns `None` if the enum contains an unknown value deserialized from
1441 /// the integer representation of enums.
1442 pub fn name(&self) -> std::option::Option<&str> {
1443 match self {
1444 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1445 Self::Active => std::option::Option::Some("ACTIVE"),
1446 Self::Failed => std::option::Option::Some("FAILED"),
1447 Self::Creating => std::option::Option::Some("CREATING"),
1448 Self::Deleting => std::option::Option::Some("DELETING"),
1449 Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
1450 Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
1451 Self::UnknownValue(u) => u.0.name(),
1452 }
1453 }
1454 }
1455
1456 impl std::default::Default for State {
1457 fn default() -> Self {
1458 use std::convert::From;
1459 Self::from(0)
1460 }
1461 }
1462
1463 impl std::fmt::Display for State {
1464 fn fmt(
1465 &self,
1466 f: &mut std::fmt::Formatter<'_>,
1467 ) -> std::result::Result<(), std::fmt::Error> {
1468 wkt::internal::display_enum(f, self.name(), self.value())
1469 }
1470 }
1471
1472 impl std::convert::From<i32> for State {
1473 fn from(value: i32) -> Self {
1474 match value {
1475 0 => Self::Unspecified,
1476 1 => Self::Active,
1477 2 => Self::Failed,
1478 3 => Self::Creating,
1479 4 => Self::Deleting,
1480 5 => Self::CreateRepairing,
1481 6 => Self::DeleteRepairing,
1482 _ => Self::UnknownValue(state::UnknownValue(
1483 wkt::internal::UnknownEnumValue::Integer(value),
1484 )),
1485 }
1486 }
1487 }
1488
1489 impl std::convert::From<&str> for State {
1490 fn from(value: &str) -> Self {
1491 use std::string::ToString;
1492 match value {
1493 "STATE_UNSPECIFIED" => Self::Unspecified,
1494 "ACTIVE" => Self::Active,
1495 "FAILED" => Self::Failed,
1496 "CREATING" => Self::Creating,
1497 "DELETING" => Self::Deleting,
1498 "CREATE_REPAIRING" => Self::CreateRepairing,
1499 "DELETE_REPAIRING" => Self::DeleteRepairing,
1500 _ => Self::UnknownValue(state::UnknownValue(
1501 wkt::internal::UnknownEnumValue::String(value.to_string()),
1502 )),
1503 }
1504 }
1505 }
1506
1507 impl serde::ser::Serialize for State {
1508 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1509 where
1510 S: serde::Serializer,
1511 {
1512 match self {
1513 Self::Unspecified => serializer.serialize_i32(0),
1514 Self::Active => serializer.serialize_i32(1),
1515 Self::Failed => serializer.serialize_i32(2),
1516 Self::Creating => serializer.serialize_i32(3),
1517 Self::Deleting => serializer.serialize_i32(4),
1518 Self::CreateRepairing => serializer.serialize_i32(5),
1519 Self::DeleteRepairing => serializer.serialize_i32(6),
1520 Self::UnknownValue(u) => u.0.serialize(serializer),
1521 }
1522 }
1523 }
1524
1525 impl<'de> serde::de::Deserialize<'de> for State {
1526 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1527 where
1528 D: serde::Deserializer<'de>,
1529 {
1530 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1531 ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection.State"))
1532 }
1533 }
1534 }
1535}
1536
1537/// Request for ListServiceConnectionMaps.
1538#[derive(Clone, Default, PartialEq)]
1539#[non_exhaustive]
1540pub struct ListServiceConnectionMapsRequest {
1541 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
1542 pub parent: std::string::String,
1543
1544 /// The maximum number of results per page that should be returned.
1545 pub page_size: i32,
1546
1547 /// The page token.
1548 pub page_token: std::string::String,
1549
1550 /// A filter expression that filters the results listed in the response.
1551 pub filter: std::string::String,
1552
1553 /// Sort the results by a certain order.
1554 pub order_by: std::string::String,
1555
1556 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1557}
1558
1559impl ListServiceConnectionMapsRequest {
1560 pub fn new() -> Self {
1561 std::default::Default::default()
1562 }
1563
1564 /// Sets the value of [parent][crate::model::ListServiceConnectionMapsRequest::parent].
1565 ///
1566 /// # Example
1567 /// ```ignore,no_run
1568 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1569 /// let x = ListServiceConnectionMapsRequest::new().set_parent("example");
1570 /// ```
1571 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1572 self.parent = v.into();
1573 self
1574 }
1575
1576 /// Sets the value of [page_size][crate::model::ListServiceConnectionMapsRequest::page_size].
1577 ///
1578 /// # Example
1579 /// ```ignore,no_run
1580 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1581 /// let x = ListServiceConnectionMapsRequest::new().set_page_size(42);
1582 /// ```
1583 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1584 self.page_size = v.into();
1585 self
1586 }
1587
1588 /// Sets the value of [page_token][crate::model::ListServiceConnectionMapsRequest::page_token].
1589 ///
1590 /// # Example
1591 /// ```ignore,no_run
1592 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1593 /// let x = ListServiceConnectionMapsRequest::new().set_page_token("example");
1594 /// ```
1595 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1596 self.page_token = v.into();
1597 self
1598 }
1599
1600 /// Sets the value of [filter][crate::model::ListServiceConnectionMapsRequest::filter].
1601 ///
1602 /// # Example
1603 /// ```ignore,no_run
1604 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1605 /// let x = ListServiceConnectionMapsRequest::new().set_filter("example");
1606 /// ```
1607 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1608 self.filter = v.into();
1609 self
1610 }
1611
1612 /// Sets the value of [order_by][crate::model::ListServiceConnectionMapsRequest::order_by].
1613 ///
1614 /// # Example
1615 /// ```ignore,no_run
1616 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1617 /// let x = ListServiceConnectionMapsRequest::new().set_order_by("example");
1618 /// ```
1619 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1620 self.order_by = v.into();
1621 self
1622 }
1623}
1624
1625impl wkt::message::Message for ListServiceConnectionMapsRequest {
1626 fn typename() -> &'static str {
1627 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsRequest"
1628 }
1629}
1630
1631/// Response for ListServiceConnectionMaps.
1632#[derive(Clone, Default, PartialEq)]
1633#[non_exhaustive]
1634pub struct ListServiceConnectionMapsResponse {
1635 /// ServiceConnectionMaps to be returned.
1636 pub service_connection_maps: std::vec::Vec<crate::model::ServiceConnectionMap>,
1637
1638 /// The next pagination token in the List response. It should be used as
1639 /// page_token for the following request. An empty value means no more result.
1640 pub next_page_token: std::string::String,
1641
1642 /// Locations that could not be reached.
1643 pub unreachable: std::vec::Vec<std::string::String>,
1644
1645 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1646}
1647
1648impl ListServiceConnectionMapsResponse {
1649 pub fn new() -> Self {
1650 std::default::Default::default()
1651 }
1652
1653 /// Sets the value of [service_connection_maps][crate::model::ListServiceConnectionMapsResponse::service_connection_maps].
1654 ///
1655 /// # Example
1656 /// ```ignore,no_run
1657 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1658 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1659 /// let x = ListServiceConnectionMapsResponse::new()
1660 /// .set_service_connection_maps([
1661 /// ServiceConnectionMap::default()/* use setters */,
1662 /// ServiceConnectionMap::default()/* use (different) setters */,
1663 /// ]);
1664 /// ```
1665 pub fn set_service_connection_maps<T, V>(mut self, v: T) -> Self
1666 where
1667 T: std::iter::IntoIterator<Item = V>,
1668 V: std::convert::Into<crate::model::ServiceConnectionMap>,
1669 {
1670 use std::iter::Iterator;
1671 self.service_connection_maps = v.into_iter().map(|i| i.into()).collect();
1672 self
1673 }
1674
1675 /// Sets the value of [next_page_token][crate::model::ListServiceConnectionMapsResponse::next_page_token].
1676 ///
1677 /// # Example
1678 /// ```ignore,no_run
1679 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1680 /// let x = ListServiceConnectionMapsResponse::new().set_next_page_token("example");
1681 /// ```
1682 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1683 self.next_page_token = v.into();
1684 self
1685 }
1686
1687 /// Sets the value of [unreachable][crate::model::ListServiceConnectionMapsResponse::unreachable].
1688 ///
1689 /// # Example
1690 /// ```ignore,no_run
1691 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1692 /// let x = ListServiceConnectionMapsResponse::new().set_unreachable(["a", "b", "c"]);
1693 /// ```
1694 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1695 where
1696 T: std::iter::IntoIterator<Item = V>,
1697 V: std::convert::Into<std::string::String>,
1698 {
1699 use std::iter::Iterator;
1700 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1701 self
1702 }
1703}
1704
1705impl wkt::message::Message for ListServiceConnectionMapsResponse {
1706 fn typename() -> &'static str {
1707 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsResponse"
1708 }
1709}
1710
1711#[doc(hidden)]
1712impl google_cloud_gax::paginator::internal::PageableResponse for ListServiceConnectionMapsResponse {
1713 type PageItem = crate::model::ServiceConnectionMap;
1714
1715 fn items(self) -> std::vec::Vec<Self::PageItem> {
1716 self.service_connection_maps
1717 }
1718
1719 fn next_page_token(&self) -> std::string::String {
1720 use std::clone::Clone;
1721 self.next_page_token.clone()
1722 }
1723}
1724
1725/// Request for GetServiceConnectionMap.
1726#[derive(Clone, Default, PartialEq)]
1727#[non_exhaustive]
1728pub struct GetServiceConnectionMapRequest {
1729 /// Required. Name of the ServiceConnectionMap to get.
1730 pub name: std::string::String,
1731
1732 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1733}
1734
1735impl GetServiceConnectionMapRequest {
1736 pub fn new() -> Self {
1737 std::default::Default::default()
1738 }
1739
1740 /// Sets the value of [name][crate::model::GetServiceConnectionMapRequest::name].
1741 ///
1742 /// # Example
1743 /// ```ignore,no_run
1744 /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionMapRequest;
1745 /// let x = GetServiceConnectionMapRequest::new().set_name("example");
1746 /// ```
1747 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1748 self.name = v.into();
1749 self
1750 }
1751}
1752
1753impl wkt::message::Message for GetServiceConnectionMapRequest {
1754 fn typename() -> &'static str {
1755 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionMapRequest"
1756 }
1757}
1758
1759/// Request for CreateServiceConnectionMap.
1760#[derive(Clone, Default, PartialEq)]
1761#[non_exhaustive]
1762pub struct CreateServiceConnectionMapRequest {
1763 /// Required. The parent resource's name of the ServiceConnectionMap. ex.
1764 /// projects/123/locations/us-east1
1765 pub parent: std::string::String,
1766
1767 /// Optional. Resource ID
1768 /// (i.e. 'foo' in '[...]/projects/p/locations/l/serviceConnectionMaps/foo')
1769 /// See <https://google.aip.dev/122#resource-id-segments>
1770 /// Unique per location.
1771 /// If one is not provided, one will be generated.
1772 pub service_connection_map_id: std::string::String,
1773
1774 /// Required. Initial values for a new ServiceConnectionMaps
1775 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1776
1777 /// Optional. An optional request ID to identify requests. Specify a unique
1778 /// request ID so that if you must retry your request, the server will know to
1779 /// ignore the request if it has already been completed. The server will
1780 /// guarantee that for at least 60 minutes since the first request.
1781 ///
1782 /// For example, consider a situation where you make an initial request and
1783 /// the request times out. If you make the request again with the same request
1784 /// ID, the server can check if original operation with the same request ID
1785 /// was received, and if so, will ignore the second request. This prevents
1786 /// clients from accidentally creating duplicate commitments.
1787 ///
1788 /// The request ID must be a valid UUID with the exception that zero UUID is
1789 /// not supported (00000000-0000-0000-0000-000000000000).
1790 pub request_id: std::string::String,
1791
1792 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1793}
1794
1795impl CreateServiceConnectionMapRequest {
1796 pub fn new() -> Self {
1797 std::default::Default::default()
1798 }
1799
1800 /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
1801 ///
1802 /// # Example
1803 /// ```ignore,no_run
1804 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1805 /// let x = CreateServiceConnectionMapRequest::new().set_parent("example");
1806 /// ```
1807 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1808 self.parent = v.into();
1809 self
1810 }
1811
1812 /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
1813 ///
1814 /// # Example
1815 /// ```ignore,no_run
1816 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1817 /// let x = CreateServiceConnectionMapRequest::new().set_service_connection_map_id("example");
1818 /// ```
1819 pub fn set_service_connection_map_id<T: std::convert::Into<std::string::String>>(
1820 mut self,
1821 v: T,
1822 ) -> Self {
1823 self.service_connection_map_id = v.into();
1824 self
1825 }
1826
1827 /// Sets the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
1828 ///
1829 /// # Example
1830 /// ```ignore,no_run
1831 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1832 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1833 /// let x = CreateServiceConnectionMapRequest::new().set_service_connection_map(ServiceConnectionMap::default()/* use setters */);
1834 /// ```
1835 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1836 where
1837 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1838 {
1839 self.service_connection_map = std::option::Option::Some(v.into());
1840 self
1841 }
1842
1843 /// Sets or clears the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
1844 ///
1845 /// # Example
1846 /// ```ignore,no_run
1847 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1848 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1849 /// let x = CreateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(Some(ServiceConnectionMap::default()/* use setters */));
1850 /// let x = CreateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(None::<ServiceConnectionMap>);
1851 /// ```
1852 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1853 where
1854 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1855 {
1856 self.service_connection_map = v.map(|x| x.into());
1857 self
1858 }
1859
1860 /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
1861 ///
1862 /// # Example
1863 /// ```ignore,no_run
1864 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1865 /// let x = CreateServiceConnectionMapRequest::new().set_request_id("example");
1866 /// ```
1867 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1868 self.request_id = v.into();
1869 self
1870 }
1871}
1872
1873impl wkt::message::Message for CreateServiceConnectionMapRequest {
1874 fn typename() -> &'static str {
1875 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionMapRequest"
1876 }
1877}
1878
1879/// Request for UpdateServiceConnectionMap.
1880#[derive(Clone, Default, PartialEq)]
1881#[non_exhaustive]
1882pub struct UpdateServiceConnectionMapRequest {
1883 /// Optional. Field mask is used to specify the fields to be overwritten in the
1884 /// ServiceConnectionMap resource by the update.
1885 /// The fields specified in the update_mask are relative to the resource, not
1886 /// the full request. A field will be overwritten if it is in the mask. If the
1887 /// user does not provide a mask then all fields will be overwritten.
1888 pub update_mask: std::option::Option<wkt::FieldMask>,
1889
1890 /// Required. New values to be patched into the resource.
1891 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1892
1893 /// Optional. An optional request ID to identify requests. Specify a unique
1894 /// request ID so that if you must retry your request, the server will know to
1895 /// ignore the request if it has already been completed. The server will
1896 /// guarantee that for at least 60 minutes since the first request.
1897 ///
1898 /// For example, consider a situation where you make an initial request and
1899 /// the request times out. If you make the request again with the same request
1900 /// ID, the server can check if original operation with the same request ID
1901 /// was received, and if so, will ignore the second request. This prevents
1902 /// clients from accidentally creating duplicate commitments.
1903 ///
1904 /// The request ID must be a valid UUID with the exception that zero UUID is
1905 /// not supported (00000000-0000-0000-0000-000000000000).
1906 pub request_id: std::string::String,
1907
1908 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1909}
1910
1911impl UpdateServiceConnectionMapRequest {
1912 pub fn new() -> Self {
1913 std::default::Default::default()
1914 }
1915
1916 /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1917 ///
1918 /// # Example
1919 /// ```ignore,no_run
1920 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1921 /// use wkt::FieldMask;
1922 /// let x = UpdateServiceConnectionMapRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1923 /// ```
1924 pub fn set_update_mask<T>(mut self, v: T) -> Self
1925 where
1926 T: std::convert::Into<wkt::FieldMask>,
1927 {
1928 self.update_mask = std::option::Option::Some(v.into());
1929 self
1930 }
1931
1932 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1933 ///
1934 /// # Example
1935 /// ```ignore,no_run
1936 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1937 /// use wkt::FieldMask;
1938 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1939 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1940 /// ```
1941 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1942 where
1943 T: std::convert::Into<wkt::FieldMask>,
1944 {
1945 self.update_mask = v.map(|x| x.into());
1946 self
1947 }
1948
1949 /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1950 ///
1951 /// # Example
1952 /// ```ignore,no_run
1953 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1954 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1955 /// let x = UpdateServiceConnectionMapRequest::new().set_service_connection_map(ServiceConnectionMap::default()/* use setters */);
1956 /// ```
1957 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1958 where
1959 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1960 {
1961 self.service_connection_map = std::option::Option::Some(v.into());
1962 self
1963 }
1964
1965 /// Sets or clears the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1966 ///
1967 /// # Example
1968 /// ```ignore,no_run
1969 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1970 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1971 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(Some(ServiceConnectionMap::default()/* use setters */));
1972 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(None::<ServiceConnectionMap>);
1973 /// ```
1974 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1975 where
1976 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1977 {
1978 self.service_connection_map = v.map(|x| x.into());
1979 self
1980 }
1981
1982 /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
1983 ///
1984 /// # Example
1985 /// ```ignore,no_run
1986 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1987 /// let x = UpdateServiceConnectionMapRequest::new().set_request_id("example");
1988 /// ```
1989 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1990 self.request_id = v.into();
1991 self
1992 }
1993}
1994
1995impl wkt::message::Message for UpdateServiceConnectionMapRequest {
1996 fn typename() -> &'static str {
1997 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionMapRequest"
1998 }
1999}
2000
2001/// Request for DeleteServiceConnectionMap.
2002#[derive(Clone, Default, PartialEq)]
2003#[non_exhaustive]
2004pub struct DeleteServiceConnectionMapRequest {
2005 /// Required. The name of the ServiceConnectionMap to delete.
2006 pub name: std::string::String,
2007
2008 /// Optional. An optional request ID to identify requests. Specify a unique
2009 /// request ID so that if you must retry your request, the server will know to
2010 /// ignore the request if it has already been completed. The server will
2011 /// guarantee that for at least 60 minutes after the first request.
2012 ///
2013 /// For example, consider a situation where you make an initial request and
2014 /// the request times out. If you make the request again with the same request
2015 /// ID, the server can check if original operation with the same request ID
2016 /// was received, and if so, will ignore the second request. This prevents
2017 /// clients from accidentally creating duplicate commitments.
2018 ///
2019 /// The request ID must be a valid UUID with the exception that zero UUID is
2020 /// not supported (00000000-0000-0000-0000-000000000000).
2021 pub request_id: std::string::String,
2022
2023 /// Optional. The etag is computed by the server, and may be sent on update and
2024 /// delete requests to ensure the client has an up-to-date value before
2025 /// proceeding.
2026 pub etag: std::option::Option<std::string::String>,
2027
2028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2029}
2030
2031impl DeleteServiceConnectionMapRequest {
2032 pub fn new() -> Self {
2033 std::default::Default::default()
2034 }
2035
2036 /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
2037 ///
2038 /// # Example
2039 /// ```ignore,no_run
2040 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2041 /// let x = DeleteServiceConnectionMapRequest::new().set_name("example");
2042 /// ```
2043 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2044 self.name = v.into();
2045 self
2046 }
2047
2048 /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
2049 ///
2050 /// # Example
2051 /// ```ignore,no_run
2052 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2053 /// let x = DeleteServiceConnectionMapRequest::new().set_request_id("example");
2054 /// ```
2055 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2056 self.request_id = v.into();
2057 self
2058 }
2059
2060 /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
2061 ///
2062 /// # Example
2063 /// ```ignore,no_run
2064 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2065 /// let x = DeleteServiceConnectionMapRequest::new().set_etag("example");
2066 /// ```
2067 pub fn set_etag<T>(mut self, v: T) -> Self
2068 where
2069 T: std::convert::Into<std::string::String>,
2070 {
2071 self.etag = std::option::Option::Some(v.into());
2072 self
2073 }
2074
2075 /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
2076 ///
2077 /// # Example
2078 /// ```ignore,no_run
2079 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2080 /// let x = DeleteServiceConnectionMapRequest::new().set_or_clear_etag(Some("example"));
2081 /// let x = DeleteServiceConnectionMapRequest::new().set_or_clear_etag(None::<String>);
2082 /// ```
2083 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2084 where
2085 T: std::convert::Into<std::string::String>,
2086 {
2087 self.etag = v.map(|x| x.into());
2088 self
2089 }
2090}
2091
2092impl wkt::message::Message for DeleteServiceConnectionMapRequest {
2093 fn typename() -> &'static str {
2094 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionMapRequest"
2095 }
2096}
2097
2098/// The ServiceConnectionPolicy resource.
2099#[derive(Clone, Default, PartialEq)]
2100#[non_exhaustive]
2101pub struct ServiceConnectionPolicy {
2102 /// Immutable. The name of a ServiceConnectionPolicy.
2103 /// Format:
2104 /// projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy}
2105 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
2106 pub name: std::string::String,
2107
2108 /// Output only. Time when the ServiceConnectionPolicy was created.
2109 pub create_time: std::option::Option<wkt::Timestamp>,
2110
2111 /// Output only. Time when the ServiceConnectionPolicy was updated.
2112 pub update_time: std::option::Option<wkt::Timestamp>,
2113
2114 /// User-defined labels.
2115 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2116
2117 /// A description of this resource.
2118 pub description: std::string::String,
2119
2120 /// The resource path of the consumer network.
2121 /// Example:
2122 ///
2123 /// - projects/{projectNumOrId}/global/networks/{resourceId}.
2124 pub network: std::string::String,
2125
2126 /// The service class identifier for which this ServiceConnectionPolicy is for.
2127 /// The service class identifier is a unique, symbolic representation of a
2128 /// ServiceClass. It is provided by the Service Producer. Google services have
2129 /// a prefix of gcp or google-cloud. For example, gcp-memorystore-redis or
2130 /// google-cloud-sql. 3rd party services do not. For example,
2131 /// test-service-a3dfcx.
2132 pub service_class: std::string::String,
2133
2134 /// Output only. The type of underlying resources used to create the
2135 /// connection.
2136 pub infrastructure: crate::model::Infrastructure,
2137
2138 /// Configuration used for Private Service Connect connections. Used when
2139 /// Infrastructure is PSC.
2140 pub psc_config: std::option::Option<crate::model::service_connection_policy::PscConfig>,
2141
2142 /// Output only. [Output only] Information about each Private Service Connect
2143 /// connection.
2144 pub psc_connections: std::vec::Vec<crate::model::service_connection_policy::PscConnection>,
2145
2146 /// Optional. The etag is computed by the server, and may be sent on update and
2147 /// delete requests to ensure the client has an up-to-date value before
2148 /// proceeding.
2149 pub etag: std::option::Option<std::string::String>,
2150
2151 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2152}
2153
2154impl ServiceConnectionPolicy {
2155 pub fn new() -> Self {
2156 std::default::Default::default()
2157 }
2158
2159 /// Sets the value of [name][crate::model::ServiceConnectionPolicy::name].
2160 ///
2161 /// # Example
2162 /// ```ignore,no_run
2163 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2164 /// let x = ServiceConnectionPolicy::new().set_name("example");
2165 /// ```
2166 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2167 self.name = v.into();
2168 self
2169 }
2170
2171 /// Sets the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
2172 ///
2173 /// # Example
2174 /// ```ignore,no_run
2175 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2176 /// use wkt::Timestamp;
2177 /// let x = ServiceConnectionPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2178 /// ```
2179 pub fn set_create_time<T>(mut self, v: T) -> Self
2180 where
2181 T: std::convert::Into<wkt::Timestamp>,
2182 {
2183 self.create_time = std::option::Option::Some(v.into());
2184 self
2185 }
2186
2187 /// Sets or clears the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
2188 ///
2189 /// # Example
2190 /// ```ignore,no_run
2191 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2192 /// use wkt::Timestamp;
2193 /// let x = ServiceConnectionPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2194 /// let x = ServiceConnectionPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2195 /// ```
2196 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2197 where
2198 T: std::convert::Into<wkt::Timestamp>,
2199 {
2200 self.create_time = v.map(|x| x.into());
2201 self
2202 }
2203
2204 /// Sets the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
2205 ///
2206 /// # Example
2207 /// ```ignore,no_run
2208 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2209 /// use wkt::Timestamp;
2210 /// let x = ServiceConnectionPolicy::new().set_update_time(Timestamp::default()/* use setters */);
2211 /// ```
2212 pub fn set_update_time<T>(mut self, v: T) -> Self
2213 where
2214 T: std::convert::Into<wkt::Timestamp>,
2215 {
2216 self.update_time = std::option::Option::Some(v.into());
2217 self
2218 }
2219
2220 /// Sets or clears the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
2221 ///
2222 /// # Example
2223 /// ```ignore,no_run
2224 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2225 /// use wkt::Timestamp;
2226 /// let x = ServiceConnectionPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2227 /// let x = ServiceConnectionPolicy::new().set_or_clear_update_time(None::<Timestamp>);
2228 /// ```
2229 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2230 where
2231 T: std::convert::Into<wkt::Timestamp>,
2232 {
2233 self.update_time = v.map(|x| x.into());
2234 self
2235 }
2236
2237 /// Sets the value of [labels][crate::model::ServiceConnectionPolicy::labels].
2238 ///
2239 /// # Example
2240 /// ```ignore,no_run
2241 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2242 /// let x = ServiceConnectionPolicy::new().set_labels([
2243 /// ("key0", "abc"),
2244 /// ("key1", "xyz"),
2245 /// ]);
2246 /// ```
2247 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2248 where
2249 T: std::iter::IntoIterator<Item = (K, V)>,
2250 K: std::convert::Into<std::string::String>,
2251 V: std::convert::Into<std::string::String>,
2252 {
2253 use std::iter::Iterator;
2254 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2255 self
2256 }
2257
2258 /// Sets the value of [description][crate::model::ServiceConnectionPolicy::description].
2259 ///
2260 /// # Example
2261 /// ```ignore,no_run
2262 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2263 /// let x = ServiceConnectionPolicy::new().set_description("example");
2264 /// ```
2265 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2266 self.description = v.into();
2267 self
2268 }
2269
2270 /// Sets the value of [network][crate::model::ServiceConnectionPolicy::network].
2271 ///
2272 /// # Example
2273 /// ```ignore,no_run
2274 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2275 /// let x = ServiceConnectionPolicy::new().set_network("example");
2276 /// ```
2277 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2278 self.network = v.into();
2279 self
2280 }
2281
2282 /// Sets the value of [service_class][crate::model::ServiceConnectionPolicy::service_class].
2283 ///
2284 /// # Example
2285 /// ```ignore,no_run
2286 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2287 /// let x = ServiceConnectionPolicy::new().set_service_class("example");
2288 /// ```
2289 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2290 self.service_class = v.into();
2291 self
2292 }
2293
2294 /// Sets the value of [infrastructure][crate::model::ServiceConnectionPolicy::infrastructure].
2295 ///
2296 /// # Example
2297 /// ```ignore,no_run
2298 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2299 /// use google_cloud_networkconnectivity_v1::model::Infrastructure;
2300 /// let x0 = ServiceConnectionPolicy::new().set_infrastructure(Infrastructure::Psc);
2301 /// ```
2302 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
2303 mut self,
2304 v: T,
2305 ) -> Self {
2306 self.infrastructure = v.into();
2307 self
2308 }
2309
2310 /// Sets the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
2311 ///
2312 /// # Example
2313 /// ```ignore,no_run
2314 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2315 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2316 /// let x = ServiceConnectionPolicy::new().set_psc_config(PscConfig::default()/* use setters */);
2317 /// ```
2318 pub fn set_psc_config<T>(mut self, v: T) -> Self
2319 where
2320 T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
2321 {
2322 self.psc_config = std::option::Option::Some(v.into());
2323 self
2324 }
2325
2326 /// Sets or clears the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
2327 ///
2328 /// # Example
2329 /// ```ignore,no_run
2330 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2331 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2332 /// let x = ServiceConnectionPolicy::new().set_or_clear_psc_config(Some(PscConfig::default()/* use setters */));
2333 /// let x = ServiceConnectionPolicy::new().set_or_clear_psc_config(None::<PscConfig>);
2334 /// ```
2335 pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
2336 where
2337 T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
2338 {
2339 self.psc_config = v.map(|x| x.into());
2340 self
2341 }
2342
2343 /// Sets the value of [psc_connections][crate::model::ServiceConnectionPolicy::psc_connections].
2344 ///
2345 /// # Example
2346 /// ```ignore,no_run
2347 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2348 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2349 /// let x = ServiceConnectionPolicy::new()
2350 /// .set_psc_connections([
2351 /// PscConnection::default()/* use setters */,
2352 /// PscConnection::default()/* use (different) setters */,
2353 /// ]);
2354 /// ```
2355 pub fn set_psc_connections<T, V>(mut self, v: T) -> Self
2356 where
2357 T: std::iter::IntoIterator<Item = V>,
2358 V: std::convert::Into<crate::model::service_connection_policy::PscConnection>,
2359 {
2360 use std::iter::Iterator;
2361 self.psc_connections = v.into_iter().map(|i| i.into()).collect();
2362 self
2363 }
2364
2365 /// Sets the value of [etag][crate::model::ServiceConnectionPolicy::etag].
2366 ///
2367 /// # Example
2368 /// ```ignore,no_run
2369 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2370 /// let x = ServiceConnectionPolicy::new().set_etag("example");
2371 /// ```
2372 pub fn set_etag<T>(mut self, v: T) -> Self
2373 where
2374 T: std::convert::Into<std::string::String>,
2375 {
2376 self.etag = std::option::Option::Some(v.into());
2377 self
2378 }
2379
2380 /// Sets or clears the value of [etag][crate::model::ServiceConnectionPolicy::etag].
2381 ///
2382 /// # Example
2383 /// ```ignore,no_run
2384 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2385 /// let x = ServiceConnectionPolicy::new().set_or_clear_etag(Some("example"));
2386 /// let x = ServiceConnectionPolicy::new().set_or_clear_etag(None::<String>);
2387 /// ```
2388 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2389 where
2390 T: std::convert::Into<std::string::String>,
2391 {
2392 self.etag = v.map(|x| x.into());
2393 self
2394 }
2395}
2396
2397impl wkt::message::Message for ServiceConnectionPolicy {
2398 fn typename() -> &'static str {
2399 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy"
2400 }
2401}
2402
2403/// Defines additional types related to [ServiceConnectionPolicy].
2404pub mod service_connection_policy {
2405 #[allow(unused_imports)]
2406 use super::*;
2407
2408 /// Configuration used for Private Service Connect connections. Used when
2409 /// Infrastructure is PSC.
2410 #[derive(Clone, Default, PartialEq)]
2411 #[non_exhaustive]
2412 pub struct PscConfig {
2413 /// The resource paths of subnetworks to use for IP address management.
2414 /// Example:
2415 /// projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}.
2416 pub subnetworks: std::vec::Vec<std::string::String>,
2417
2418 /// Optional. Max number of PSC connections for this policy.
2419 pub limit: std::option::Option<i64>,
2420
2421 /// Required. ProducerInstanceLocation is used to specify which authorization
2422 /// mechanism to use to determine which projects the Producer instance can be
2423 /// within.
2424 pub producer_instance_location:
2425 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
2426
2427 /// Optional. List of Projects, Folders, or Organizations from where the
2428 /// Producer instance can be within. For example, a network administrator can
2429 /// provide both 'organizations/foo' and 'projects/bar' as
2430 /// allowed_google_producers_resource_hierarchy_levels. This allowlists this
2431 /// network to connect with any Producer instance within the 'foo'
2432 /// organization or the 'bar' project. By default,
2433 /// allowed_google_producers_resource_hierarchy_level is empty. The format
2434 /// for each allowed_google_producers_resource_hierarchy_level is \<resource
2435 /// type\>/\<id\> where <resource type\> is one of 'projects', 'folders', or
2436 /// 'organizations' and \<id\> is either the ID or the number of the resource
2437 /// type. Format for each allowed_google_producers_resource_hierarchy_level
2438 /// value: 'projects/<project_id_or_number>' or 'folders/<folder_id>' or
2439 /// 'organizations/<organization_id>'
2440 /// Eg. [projects/my-project-id, projects/567, folders/891,
2441 /// organizations/123]
2442 pub allowed_google_producers_resource_hierarchy_level: std::vec::Vec<std::string::String>,
2443
2444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2445 }
2446
2447 impl PscConfig {
2448 pub fn new() -> Self {
2449 std::default::Default::default()
2450 }
2451
2452 /// Sets the value of [subnetworks][crate::model::service_connection_policy::PscConfig::subnetworks].
2453 ///
2454 /// # Example
2455 /// ```ignore,no_run
2456 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2457 /// let x = PscConfig::new().set_subnetworks(["a", "b", "c"]);
2458 /// ```
2459 pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
2460 where
2461 T: std::iter::IntoIterator<Item = V>,
2462 V: std::convert::Into<std::string::String>,
2463 {
2464 use std::iter::Iterator;
2465 self.subnetworks = v.into_iter().map(|i| i.into()).collect();
2466 self
2467 }
2468
2469 /// Sets the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
2470 ///
2471 /// # Example
2472 /// ```ignore,no_run
2473 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2474 /// let x = PscConfig::new().set_limit(42);
2475 /// ```
2476 pub fn set_limit<T>(mut self, v: T) -> Self
2477 where
2478 T: std::convert::Into<i64>,
2479 {
2480 self.limit = std::option::Option::Some(v.into());
2481 self
2482 }
2483
2484 /// Sets or clears the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
2485 ///
2486 /// # Example
2487 /// ```ignore,no_run
2488 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2489 /// let x = PscConfig::new().set_or_clear_limit(Some(42));
2490 /// let x = PscConfig::new().set_or_clear_limit(None::<i32>);
2491 /// ```
2492 pub fn set_or_clear_limit<T>(mut self, v: std::option::Option<T>) -> Self
2493 where
2494 T: std::convert::Into<i64>,
2495 {
2496 self.limit = v.map(|x| x.into());
2497 self
2498 }
2499
2500 /// Sets the value of [producer_instance_location][crate::model::service_connection_policy::PscConfig::producer_instance_location].
2501 ///
2502 /// # Example
2503 /// ```ignore,no_run
2504 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2505 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::psc_config::ProducerInstanceLocation;
2506 /// let x0 = PscConfig::new().set_producer_instance_location(ProducerInstanceLocation::CustomResourceHierarchyLevels);
2507 /// ```
2508 pub fn set_producer_instance_location<
2509 T: std::convert::Into<
2510 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
2511 >,
2512 >(
2513 mut self,
2514 v: T,
2515 ) -> Self {
2516 self.producer_instance_location = v.into();
2517 self
2518 }
2519
2520 /// Sets the value of [allowed_google_producers_resource_hierarchy_level][crate::model::service_connection_policy::PscConfig::allowed_google_producers_resource_hierarchy_level].
2521 ///
2522 /// # Example
2523 /// ```ignore,no_run
2524 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2525 /// let x = PscConfig::new().set_allowed_google_producers_resource_hierarchy_level(["a", "b", "c"]);
2526 /// ```
2527 pub fn set_allowed_google_producers_resource_hierarchy_level<T, V>(mut self, v: T) -> Self
2528 where
2529 T: std::iter::IntoIterator<Item = V>,
2530 V: std::convert::Into<std::string::String>,
2531 {
2532 use std::iter::Iterator;
2533 self.allowed_google_producers_resource_hierarchy_level =
2534 v.into_iter().map(|i| i.into()).collect();
2535 self
2536 }
2537 }
2538
2539 impl wkt::message::Message for PscConfig {
2540 fn typename() -> &'static str {
2541 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig"
2542 }
2543 }
2544
2545 /// Defines additional types related to [PscConfig].
2546 pub mod psc_config {
2547 #[allow(unused_imports)]
2548 use super::*;
2549
2550 /// ProducerInstanceLocation is used to specify which authorization mechanism
2551 /// to use to determine which projects the Producer instance can be within.
2552 ///
2553 /// # Working with unknown values
2554 ///
2555 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2556 /// additional enum variants at any time. Adding new variants is not considered
2557 /// a breaking change. Applications should write their code in anticipation of:
2558 ///
2559 /// - New values appearing in future releases of the client library, **and**
2560 /// - New values received dynamically, without application changes.
2561 ///
2562 /// Please consult the [Working with enums] section in the user guide for some
2563 /// guidelines.
2564 ///
2565 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2566 #[derive(Clone, Debug, PartialEq)]
2567 #[non_exhaustive]
2568 pub enum ProducerInstanceLocation {
2569 /// Producer instance location is not specified. When this option is
2570 /// chosen, then the PSC connections created by this
2571 /// ServiceConnectionPolicy must be within the same project as the Producer
2572 /// instance. This is the default ProducerInstanceLocation value.
2573 /// To allow for PSC connections from this network to other networks, use
2574 /// the CUSTOM_RESOURCE_HIERARCHY_LEVELS option.
2575 Unspecified,
2576 /// Producer instance must be within one of the values provided in
2577 /// allowed_google_producers_resource_hierarchy_level.
2578 CustomResourceHierarchyLevels,
2579 /// If set, the enum was initialized with an unknown value.
2580 ///
2581 /// Applications can examine the value using [ProducerInstanceLocation::value] or
2582 /// [ProducerInstanceLocation::name].
2583 UnknownValue(producer_instance_location::UnknownValue),
2584 }
2585
2586 #[doc(hidden)]
2587 pub mod producer_instance_location {
2588 #[allow(unused_imports)]
2589 use super::*;
2590 #[derive(Clone, Debug, PartialEq)]
2591 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2592 }
2593
2594 impl ProducerInstanceLocation {
2595 /// Gets the enum value.
2596 ///
2597 /// Returns `None` if the enum contains an unknown value deserialized from
2598 /// the string representation of enums.
2599 pub fn value(&self) -> std::option::Option<i32> {
2600 match self {
2601 Self::Unspecified => std::option::Option::Some(0),
2602 Self::CustomResourceHierarchyLevels => std::option::Option::Some(1),
2603 Self::UnknownValue(u) => u.0.value(),
2604 }
2605 }
2606
2607 /// Gets the enum value as a string.
2608 ///
2609 /// Returns `None` if the enum contains an unknown value deserialized from
2610 /// the integer representation of enums.
2611 pub fn name(&self) -> std::option::Option<&str> {
2612 match self {
2613 Self::Unspecified => {
2614 std::option::Option::Some("PRODUCER_INSTANCE_LOCATION_UNSPECIFIED")
2615 }
2616 Self::CustomResourceHierarchyLevels => {
2617 std::option::Option::Some("CUSTOM_RESOURCE_HIERARCHY_LEVELS")
2618 }
2619 Self::UnknownValue(u) => u.0.name(),
2620 }
2621 }
2622 }
2623
2624 impl std::default::Default for ProducerInstanceLocation {
2625 fn default() -> Self {
2626 use std::convert::From;
2627 Self::from(0)
2628 }
2629 }
2630
2631 impl std::fmt::Display for ProducerInstanceLocation {
2632 fn fmt(
2633 &self,
2634 f: &mut std::fmt::Formatter<'_>,
2635 ) -> std::result::Result<(), std::fmt::Error> {
2636 wkt::internal::display_enum(f, self.name(), self.value())
2637 }
2638 }
2639
2640 impl std::convert::From<i32> for ProducerInstanceLocation {
2641 fn from(value: i32) -> Self {
2642 match value {
2643 0 => Self::Unspecified,
2644 1 => Self::CustomResourceHierarchyLevels,
2645 _ => Self::UnknownValue(producer_instance_location::UnknownValue(
2646 wkt::internal::UnknownEnumValue::Integer(value),
2647 )),
2648 }
2649 }
2650 }
2651
2652 impl std::convert::From<&str> for ProducerInstanceLocation {
2653 fn from(value: &str) -> Self {
2654 use std::string::ToString;
2655 match value {
2656 "PRODUCER_INSTANCE_LOCATION_UNSPECIFIED" => Self::Unspecified,
2657 "CUSTOM_RESOURCE_HIERARCHY_LEVELS" => Self::CustomResourceHierarchyLevels,
2658 _ => Self::UnknownValue(producer_instance_location::UnknownValue(
2659 wkt::internal::UnknownEnumValue::String(value.to_string()),
2660 )),
2661 }
2662 }
2663 }
2664
2665 impl serde::ser::Serialize for ProducerInstanceLocation {
2666 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2667 where
2668 S: serde::Serializer,
2669 {
2670 match self {
2671 Self::Unspecified => serializer.serialize_i32(0),
2672 Self::CustomResourceHierarchyLevels => serializer.serialize_i32(1),
2673 Self::UnknownValue(u) => u.0.serialize(serializer),
2674 }
2675 }
2676 }
2677
2678 impl<'de> serde::de::Deserialize<'de> for ProducerInstanceLocation {
2679 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2680 where
2681 D: serde::Deserializer<'de>,
2682 {
2683 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProducerInstanceLocation>::new(
2684 ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig.ProducerInstanceLocation"))
2685 }
2686 }
2687 }
2688
2689 /// Information about a specific Private Service Connect connection.
2690 #[derive(Clone, Default, PartialEq)]
2691 #[non_exhaustive]
2692 pub struct PscConnection {
2693 /// State of the PSC Connection
2694 pub state: crate::model::service_connection_policy::State,
2695
2696 /// The resource reference of the PSC Forwarding Rule within the consumer
2697 /// VPC.
2698 pub consumer_forwarding_rule: std::string::String,
2699
2700 /// The resource reference of the consumer address.
2701 pub consumer_address: std::string::String,
2702
2703 /// The error type indicates whether the error is consumer facing, producer
2704 /// facing or system internal.
2705 #[deprecated]
2706 pub error_type: crate::model::ConnectionErrorType,
2707
2708 /// The most recent error during operating this connection.
2709 /// Deprecated, please use error_info instead.
2710 #[deprecated]
2711 pub error: std::option::Option<google_cloud_rpc::model::Status>,
2712
2713 /// The last Compute Engine operation to setup PSC connection.
2714 pub gce_operation: std::string::String,
2715
2716 /// The project where the PSC connection is created.
2717 pub consumer_target_project: std::string::String,
2718
2719 /// The PSC connection id of the PSC forwarding rule.
2720 pub psc_connection_id: std::string::String,
2721
2722 /// Output only. The error info for the latest error during operating this
2723 /// connection.
2724 pub error_info: std::option::Option<google_cloud_rpc::model::ErrorInfo>,
2725
2726 /// Output only. The URI of the subnetwork selected to allocate IP address
2727 /// for this connection.
2728 pub selected_subnetwork: std::string::String,
2729
2730 /// Immutable. Deprecated. Use producer_instance_metadata instead.
2731 /// An immutable identifier for the producer instance.
2732 #[deprecated]
2733 pub producer_instance_id: std::string::String,
2734
2735 /// Immutable. An immutable map for the producer instance metadata.
2736 pub producer_instance_metadata:
2737 std::collections::HashMap<std::string::String, std::string::String>,
2738
2739 /// Output only. [Output only] The service class associated with this PSC
2740 /// Connection. The value is derived from the SCPolicy and matches the
2741 /// service class name provided by the customer.
2742 pub service_class: std::string::String,
2743
2744 /// The requested IP version for the PSC connection.
2745 pub ip_version: std::option::Option<crate::model::IPVersion>,
2746
2747 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2748 }
2749
2750 impl PscConnection {
2751 pub fn new() -> Self {
2752 std::default::Default::default()
2753 }
2754
2755 /// Sets the value of [state][crate::model::service_connection_policy::PscConnection::state].
2756 ///
2757 /// # Example
2758 /// ```ignore,no_run
2759 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2760 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::State;
2761 /// let x0 = PscConnection::new().set_state(State::Active);
2762 /// let x1 = PscConnection::new().set_state(State::Failed);
2763 /// let x2 = PscConnection::new().set_state(State::Creating);
2764 /// ```
2765 pub fn set_state<T: std::convert::Into<crate::model::service_connection_policy::State>>(
2766 mut self,
2767 v: T,
2768 ) -> Self {
2769 self.state = v.into();
2770 self
2771 }
2772
2773 /// Sets the value of [consumer_forwarding_rule][crate::model::service_connection_policy::PscConnection::consumer_forwarding_rule].
2774 ///
2775 /// # Example
2776 /// ```ignore,no_run
2777 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2778 /// let x = PscConnection::new().set_consumer_forwarding_rule("example");
2779 /// ```
2780 pub fn set_consumer_forwarding_rule<T: std::convert::Into<std::string::String>>(
2781 mut self,
2782 v: T,
2783 ) -> Self {
2784 self.consumer_forwarding_rule = v.into();
2785 self
2786 }
2787
2788 /// Sets the value of [consumer_address][crate::model::service_connection_policy::PscConnection::consumer_address].
2789 ///
2790 /// # Example
2791 /// ```ignore,no_run
2792 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2793 /// let x = PscConnection::new().set_consumer_address("example");
2794 /// ```
2795 pub fn set_consumer_address<T: std::convert::Into<std::string::String>>(
2796 mut self,
2797 v: T,
2798 ) -> Self {
2799 self.consumer_address = v.into();
2800 self
2801 }
2802
2803 /// Sets the value of [error_type][crate::model::service_connection_policy::PscConnection::error_type].
2804 ///
2805 /// # Example
2806 /// ```ignore,no_run
2807 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2808 /// use google_cloud_networkconnectivity_v1::model::ConnectionErrorType;
2809 /// let x0 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorInternal);
2810 /// let x1 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorConsumerSide);
2811 /// let x2 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorProducerSide);
2812 /// ```
2813 #[deprecated]
2814 pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
2815 mut self,
2816 v: T,
2817 ) -> Self {
2818 self.error_type = v.into();
2819 self
2820 }
2821
2822 /// Sets the value of [error][crate::model::service_connection_policy::PscConnection::error].
2823 ///
2824 /// # Example
2825 /// ```ignore,no_run
2826 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2827 /// use google_cloud_rpc::model::Status;
2828 /// let x = PscConnection::new().set_error(Status::default()/* use setters */);
2829 /// ```
2830 #[deprecated]
2831 pub fn set_error<T>(mut self, v: T) -> Self
2832 where
2833 T: std::convert::Into<google_cloud_rpc::model::Status>,
2834 {
2835 self.error = std::option::Option::Some(v.into());
2836 self
2837 }
2838
2839 /// Sets or clears the value of [error][crate::model::service_connection_policy::PscConnection::error].
2840 ///
2841 /// # Example
2842 /// ```ignore,no_run
2843 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2844 /// use google_cloud_rpc::model::Status;
2845 /// let x = PscConnection::new().set_or_clear_error(Some(Status::default()/* use setters */));
2846 /// let x = PscConnection::new().set_or_clear_error(None::<Status>);
2847 /// ```
2848 #[deprecated]
2849 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
2850 where
2851 T: std::convert::Into<google_cloud_rpc::model::Status>,
2852 {
2853 self.error = v.map(|x| x.into());
2854 self
2855 }
2856
2857 /// Sets the value of [gce_operation][crate::model::service_connection_policy::PscConnection::gce_operation].
2858 ///
2859 /// # Example
2860 /// ```ignore,no_run
2861 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2862 /// let x = PscConnection::new().set_gce_operation("example");
2863 /// ```
2864 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
2865 mut self,
2866 v: T,
2867 ) -> Self {
2868 self.gce_operation = v.into();
2869 self
2870 }
2871
2872 /// Sets the value of [consumer_target_project][crate::model::service_connection_policy::PscConnection::consumer_target_project].
2873 ///
2874 /// # Example
2875 /// ```ignore,no_run
2876 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2877 /// let x = PscConnection::new().set_consumer_target_project("example");
2878 /// ```
2879 pub fn set_consumer_target_project<T: std::convert::Into<std::string::String>>(
2880 mut self,
2881 v: T,
2882 ) -> Self {
2883 self.consumer_target_project = v.into();
2884 self
2885 }
2886
2887 /// Sets the value of [psc_connection_id][crate::model::service_connection_policy::PscConnection::psc_connection_id].
2888 ///
2889 /// # Example
2890 /// ```ignore,no_run
2891 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2892 /// let x = PscConnection::new().set_psc_connection_id("example");
2893 /// ```
2894 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
2895 mut self,
2896 v: T,
2897 ) -> Self {
2898 self.psc_connection_id = v.into();
2899 self
2900 }
2901
2902 /// Sets the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
2903 ///
2904 /// # Example
2905 /// ```ignore,no_run
2906 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2907 /// use google_cloud_rpc::model::ErrorInfo;
2908 /// let x = PscConnection::new().set_error_info(ErrorInfo::default()/* use setters */);
2909 /// ```
2910 pub fn set_error_info<T>(mut self, v: T) -> Self
2911 where
2912 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
2913 {
2914 self.error_info = std::option::Option::Some(v.into());
2915 self
2916 }
2917
2918 /// Sets or clears the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
2919 ///
2920 /// # Example
2921 /// ```ignore,no_run
2922 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2923 /// use google_cloud_rpc::model::ErrorInfo;
2924 /// let x = PscConnection::new().set_or_clear_error_info(Some(ErrorInfo::default()/* use setters */));
2925 /// let x = PscConnection::new().set_or_clear_error_info(None::<ErrorInfo>);
2926 /// ```
2927 pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
2928 where
2929 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
2930 {
2931 self.error_info = v.map(|x| x.into());
2932 self
2933 }
2934
2935 /// Sets the value of [selected_subnetwork][crate::model::service_connection_policy::PscConnection::selected_subnetwork].
2936 ///
2937 /// # Example
2938 /// ```ignore,no_run
2939 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2940 /// let x = PscConnection::new().set_selected_subnetwork("example");
2941 /// ```
2942 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
2943 mut self,
2944 v: T,
2945 ) -> Self {
2946 self.selected_subnetwork = v.into();
2947 self
2948 }
2949
2950 /// Sets the value of [producer_instance_id][crate::model::service_connection_policy::PscConnection::producer_instance_id].
2951 ///
2952 /// # Example
2953 /// ```ignore,no_run
2954 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2955 /// let x = PscConnection::new().set_producer_instance_id("example");
2956 /// ```
2957 #[deprecated]
2958 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
2959 mut self,
2960 v: T,
2961 ) -> Self {
2962 self.producer_instance_id = v.into();
2963 self
2964 }
2965
2966 /// Sets the value of [producer_instance_metadata][crate::model::service_connection_policy::PscConnection::producer_instance_metadata].
2967 ///
2968 /// # Example
2969 /// ```ignore,no_run
2970 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2971 /// let x = PscConnection::new().set_producer_instance_metadata([
2972 /// ("key0", "abc"),
2973 /// ("key1", "xyz"),
2974 /// ]);
2975 /// ```
2976 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
2977 where
2978 T: std::iter::IntoIterator<Item = (K, V)>,
2979 K: std::convert::Into<std::string::String>,
2980 V: std::convert::Into<std::string::String>,
2981 {
2982 use std::iter::Iterator;
2983 self.producer_instance_metadata =
2984 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2985 self
2986 }
2987
2988 /// Sets the value of [service_class][crate::model::service_connection_policy::PscConnection::service_class].
2989 ///
2990 /// # Example
2991 /// ```ignore,no_run
2992 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2993 /// let x = PscConnection::new().set_service_class("example");
2994 /// ```
2995 pub fn set_service_class<T: std::convert::Into<std::string::String>>(
2996 mut self,
2997 v: T,
2998 ) -> Self {
2999 self.service_class = v.into();
3000 self
3001 }
3002
3003 /// Sets the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
3004 ///
3005 /// # Example
3006 /// ```ignore,no_run
3007 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3008 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
3009 /// let x0 = PscConnection::new().set_ip_version(IPVersion::Ipv4);
3010 /// let x1 = PscConnection::new().set_ip_version(IPVersion::Ipv6);
3011 /// ```
3012 pub fn set_ip_version<T>(mut self, v: T) -> Self
3013 where
3014 T: std::convert::Into<crate::model::IPVersion>,
3015 {
3016 self.ip_version = std::option::Option::Some(v.into());
3017 self
3018 }
3019
3020 /// Sets or clears the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
3021 ///
3022 /// # Example
3023 /// ```ignore,no_run
3024 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3025 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
3026 /// let x0 = PscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
3027 /// let x1 = PscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
3028 /// let x_none = PscConnection::new().set_or_clear_ip_version(None::<IPVersion>);
3029 /// ```
3030 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
3031 where
3032 T: std::convert::Into<crate::model::IPVersion>,
3033 {
3034 self.ip_version = v.map(|x| x.into());
3035 self
3036 }
3037 }
3038
3039 impl wkt::message::Message for PscConnection {
3040 fn typename() -> &'static str {
3041 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection"
3042 }
3043 }
3044
3045 /// The state of the PSC connection.
3046 /// We reserve the right to add more states without notice in the future.
3047 /// Users should not use exhaustive switch statements on this enum.
3048 /// See <https://google.aip.dev/216>.
3049 ///
3050 /// # Working with unknown values
3051 ///
3052 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3053 /// additional enum variants at any time. Adding new variants is not considered
3054 /// a breaking change. Applications should write their code in anticipation of:
3055 ///
3056 /// - New values appearing in future releases of the client library, **and**
3057 /// - New values received dynamically, without application changes.
3058 ///
3059 /// Please consult the [Working with enums] section in the user guide for some
3060 /// guidelines.
3061 ///
3062 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3063 #[derive(Clone, Debug, PartialEq)]
3064 #[non_exhaustive]
3065 pub enum State {
3066 /// An invalid state as the default case.
3067 Unspecified,
3068 /// The connection has been created successfully. However, for the
3069 /// up-to-date connection status, please use the created forwarding rule's
3070 /// "PscConnectionStatus" as the source of truth.
3071 Active,
3072 /// The connection is not functional since some resources on the connection
3073 /// fail to be created.
3074 Failed,
3075 /// The connection is being created.
3076 Creating,
3077 /// The connection is being deleted.
3078 Deleting,
3079 /// The connection is being repaired to complete creation.
3080 CreateRepairing,
3081 /// The connection is being repaired to complete deletion.
3082 DeleteRepairing,
3083 /// If set, the enum was initialized with an unknown value.
3084 ///
3085 /// Applications can examine the value using [State::value] or
3086 /// [State::name].
3087 UnknownValue(state::UnknownValue),
3088 }
3089
3090 #[doc(hidden)]
3091 pub mod state {
3092 #[allow(unused_imports)]
3093 use super::*;
3094 #[derive(Clone, Debug, PartialEq)]
3095 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3096 }
3097
3098 impl State {
3099 /// Gets the enum value.
3100 ///
3101 /// Returns `None` if the enum contains an unknown value deserialized from
3102 /// the string representation of enums.
3103 pub fn value(&self) -> std::option::Option<i32> {
3104 match self {
3105 Self::Unspecified => std::option::Option::Some(0),
3106 Self::Active => std::option::Option::Some(1),
3107 Self::Failed => std::option::Option::Some(2),
3108 Self::Creating => std::option::Option::Some(3),
3109 Self::Deleting => std::option::Option::Some(4),
3110 Self::CreateRepairing => std::option::Option::Some(5),
3111 Self::DeleteRepairing => std::option::Option::Some(6),
3112 Self::UnknownValue(u) => u.0.value(),
3113 }
3114 }
3115
3116 /// Gets the enum value as a string.
3117 ///
3118 /// Returns `None` if the enum contains an unknown value deserialized from
3119 /// the integer representation of enums.
3120 pub fn name(&self) -> std::option::Option<&str> {
3121 match self {
3122 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3123 Self::Active => std::option::Option::Some("ACTIVE"),
3124 Self::Failed => std::option::Option::Some("FAILED"),
3125 Self::Creating => std::option::Option::Some("CREATING"),
3126 Self::Deleting => std::option::Option::Some("DELETING"),
3127 Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
3128 Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
3129 Self::UnknownValue(u) => u.0.name(),
3130 }
3131 }
3132 }
3133
3134 impl std::default::Default for State {
3135 fn default() -> Self {
3136 use std::convert::From;
3137 Self::from(0)
3138 }
3139 }
3140
3141 impl std::fmt::Display for State {
3142 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3143 wkt::internal::display_enum(f, self.name(), self.value())
3144 }
3145 }
3146
3147 impl std::convert::From<i32> for State {
3148 fn from(value: i32) -> Self {
3149 match value {
3150 0 => Self::Unspecified,
3151 1 => Self::Active,
3152 2 => Self::Failed,
3153 3 => Self::Creating,
3154 4 => Self::Deleting,
3155 5 => Self::CreateRepairing,
3156 6 => Self::DeleteRepairing,
3157 _ => Self::UnknownValue(state::UnknownValue(
3158 wkt::internal::UnknownEnumValue::Integer(value),
3159 )),
3160 }
3161 }
3162 }
3163
3164 impl std::convert::From<&str> for State {
3165 fn from(value: &str) -> Self {
3166 use std::string::ToString;
3167 match value {
3168 "STATE_UNSPECIFIED" => Self::Unspecified,
3169 "ACTIVE" => Self::Active,
3170 "FAILED" => Self::Failed,
3171 "CREATING" => Self::Creating,
3172 "DELETING" => Self::Deleting,
3173 "CREATE_REPAIRING" => Self::CreateRepairing,
3174 "DELETE_REPAIRING" => Self::DeleteRepairing,
3175 _ => Self::UnknownValue(state::UnknownValue(
3176 wkt::internal::UnknownEnumValue::String(value.to_string()),
3177 )),
3178 }
3179 }
3180 }
3181
3182 impl serde::ser::Serialize for State {
3183 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3184 where
3185 S: serde::Serializer,
3186 {
3187 match self {
3188 Self::Unspecified => serializer.serialize_i32(0),
3189 Self::Active => serializer.serialize_i32(1),
3190 Self::Failed => serializer.serialize_i32(2),
3191 Self::Creating => serializer.serialize_i32(3),
3192 Self::Deleting => serializer.serialize_i32(4),
3193 Self::CreateRepairing => serializer.serialize_i32(5),
3194 Self::DeleteRepairing => serializer.serialize_i32(6),
3195 Self::UnknownValue(u) => u.0.serialize(serializer),
3196 }
3197 }
3198 }
3199
3200 impl<'de> serde::de::Deserialize<'de> for State {
3201 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3202 where
3203 D: serde::Deserializer<'de>,
3204 {
3205 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3206 ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.State",
3207 ))
3208 }
3209 }
3210}
3211
3212/// Request for ListServiceConnectionPolicies.
3213#[derive(Clone, Default, PartialEq)]
3214#[non_exhaustive]
3215pub struct ListServiceConnectionPoliciesRequest {
3216 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
3217 pub parent: std::string::String,
3218
3219 /// The maximum number of results per page that should be returned.
3220 pub page_size: i32,
3221
3222 /// The page token.
3223 pub page_token: std::string::String,
3224
3225 /// A filter expression that filters the results listed in the response.
3226 pub filter: std::string::String,
3227
3228 /// Sort the results by a certain order.
3229 pub order_by: std::string::String,
3230
3231 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3232}
3233
3234impl ListServiceConnectionPoliciesRequest {
3235 pub fn new() -> Self {
3236 std::default::Default::default()
3237 }
3238
3239 /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
3240 ///
3241 /// # Example
3242 /// ```ignore,no_run
3243 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3244 /// let x = ListServiceConnectionPoliciesRequest::new().set_parent("example");
3245 /// ```
3246 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3247 self.parent = v.into();
3248 self
3249 }
3250
3251 /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
3252 ///
3253 /// # Example
3254 /// ```ignore,no_run
3255 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3256 /// let x = ListServiceConnectionPoliciesRequest::new().set_page_size(42);
3257 /// ```
3258 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3259 self.page_size = v.into();
3260 self
3261 }
3262
3263 /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
3264 ///
3265 /// # Example
3266 /// ```ignore,no_run
3267 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3268 /// let x = ListServiceConnectionPoliciesRequest::new().set_page_token("example");
3269 /// ```
3270 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3271 self.page_token = v.into();
3272 self
3273 }
3274
3275 /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
3276 ///
3277 /// # Example
3278 /// ```ignore,no_run
3279 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3280 /// let x = ListServiceConnectionPoliciesRequest::new().set_filter("example");
3281 /// ```
3282 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3283 self.filter = v.into();
3284 self
3285 }
3286
3287 /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
3288 ///
3289 /// # Example
3290 /// ```ignore,no_run
3291 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3292 /// let x = ListServiceConnectionPoliciesRequest::new().set_order_by("example");
3293 /// ```
3294 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3295 self.order_by = v.into();
3296 self
3297 }
3298}
3299
3300impl wkt::message::Message for ListServiceConnectionPoliciesRequest {
3301 fn typename() -> &'static str {
3302 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesRequest"
3303 }
3304}
3305
3306/// Response for ListServiceConnectionPolicies.
3307#[derive(Clone, Default, PartialEq)]
3308#[non_exhaustive]
3309pub struct ListServiceConnectionPoliciesResponse {
3310 /// ServiceConnectionPolicies to be returned.
3311 pub service_connection_policies: std::vec::Vec<crate::model::ServiceConnectionPolicy>,
3312
3313 /// The next pagination token in the List response. It should be used as
3314 /// page_token for the following request. An empty value means no more result.
3315 pub next_page_token: std::string::String,
3316
3317 /// Locations that could not be reached.
3318 pub unreachable: std::vec::Vec<std::string::String>,
3319
3320 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3321}
3322
3323impl ListServiceConnectionPoliciesResponse {
3324 pub fn new() -> Self {
3325 std::default::Default::default()
3326 }
3327
3328 /// Sets the value of [service_connection_policies][crate::model::ListServiceConnectionPoliciesResponse::service_connection_policies].
3329 ///
3330 /// # Example
3331 /// ```ignore,no_run
3332 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3333 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3334 /// let x = ListServiceConnectionPoliciesResponse::new()
3335 /// .set_service_connection_policies([
3336 /// ServiceConnectionPolicy::default()/* use setters */,
3337 /// ServiceConnectionPolicy::default()/* use (different) setters */,
3338 /// ]);
3339 /// ```
3340 pub fn set_service_connection_policies<T, V>(mut self, v: T) -> Self
3341 where
3342 T: std::iter::IntoIterator<Item = V>,
3343 V: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3344 {
3345 use std::iter::Iterator;
3346 self.service_connection_policies = v.into_iter().map(|i| i.into()).collect();
3347 self
3348 }
3349
3350 /// Sets the value of [next_page_token][crate::model::ListServiceConnectionPoliciesResponse::next_page_token].
3351 ///
3352 /// # Example
3353 /// ```ignore,no_run
3354 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3355 /// let x = ListServiceConnectionPoliciesResponse::new().set_next_page_token("example");
3356 /// ```
3357 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3358 self.next_page_token = v.into();
3359 self
3360 }
3361
3362 /// Sets the value of [unreachable][crate::model::ListServiceConnectionPoliciesResponse::unreachable].
3363 ///
3364 /// # Example
3365 /// ```ignore,no_run
3366 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3367 /// let x = ListServiceConnectionPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
3368 /// ```
3369 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3370 where
3371 T: std::iter::IntoIterator<Item = V>,
3372 V: std::convert::Into<std::string::String>,
3373 {
3374 use std::iter::Iterator;
3375 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3376 self
3377 }
3378}
3379
3380impl wkt::message::Message for ListServiceConnectionPoliciesResponse {
3381 fn typename() -> &'static str {
3382 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesResponse"
3383 }
3384}
3385
3386#[doc(hidden)]
3387impl google_cloud_gax::paginator::internal::PageableResponse
3388 for ListServiceConnectionPoliciesResponse
3389{
3390 type PageItem = crate::model::ServiceConnectionPolicy;
3391
3392 fn items(self) -> std::vec::Vec<Self::PageItem> {
3393 self.service_connection_policies
3394 }
3395
3396 fn next_page_token(&self) -> std::string::String {
3397 use std::clone::Clone;
3398 self.next_page_token.clone()
3399 }
3400}
3401
3402/// Request for GetServiceConnectionPolicy.
3403#[derive(Clone, Default, PartialEq)]
3404#[non_exhaustive]
3405pub struct GetServiceConnectionPolicyRequest {
3406 /// Required. Name of the ServiceConnectionPolicy to get.
3407 pub name: std::string::String,
3408
3409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3410}
3411
3412impl GetServiceConnectionPolicyRequest {
3413 pub fn new() -> Self {
3414 std::default::Default::default()
3415 }
3416
3417 /// Sets the value of [name][crate::model::GetServiceConnectionPolicyRequest::name].
3418 ///
3419 /// # Example
3420 /// ```ignore,no_run
3421 /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionPolicyRequest;
3422 /// let x = GetServiceConnectionPolicyRequest::new().set_name("example");
3423 /// ```
3424 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3425 self.name = v.into();
3426 self
3427 }
3428}
3429
3430impl wkt::message::Message for GetServiceConnectionPolicyRequest {
3431 fn typename() -> &'static str {
3432 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionPolicyRequest"
3433 }
3434}
3435
3436/// Request for CreateServiceConnectionPolicy.
3437#[derive(Clone, Default, PartialEq)]
3438#[non_exhaustive]
3439pub struct CreateServiceConnectionPolicyRequest {
3440 /// Required. The parent resource's name of the ServiceConnectionPolicy. ex.
3441 /// projects/123/locations/us-east1
3442 pub parent: std::string::String,
3443
3444 /// Optional. Resource ID
3445 /// (i.e. 'foo' in
3446 /// '[...]/projects/p/locations/l/serviceConnectionPolicies/foo') See
3447 /// <https://google.aip.dev/122#resource-id-segments> Unique per location.
3448 pub service_connection_policy_id: std::string::String,
3449
3450 /// Required. Initial values for a new ServiceConnectionPolicies
3451 pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
3452
3453 /// Optional. An optional request ID to identify requests. Specify a unique
3454 /// request ID so that if you must retry your request, the server will know to
3455 /// ignore the request if it has already been completed. The server will
3456 /// guarantee that for at least 60 minutes since the first request.
3457 ///
3458 /// For example, consider a situation where you make an initial request and
3459 /// the request times out. If you make the request again with the same request
3460 /// ID, the server can check if original operation with the same request ID
3461 /// was received, and if so, will ignore the second request. This prevents
3462 /// clients from accidentally creating duplicate commitments.
3463 ///
3464 /// The request ID must be a valid UUID with the exception that zero UUID is
3465 /// not supported (00000000-0000-0000-0000-000000000000).
3466 pub request_id: std::string::String,
3467
3468 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3469}
3470
3471impl CreateServiceConnectionPolicyRequest {
3472 pub fn new() -> Self {
3473 std::default::Default::default()
3474 }
3475
3476 /// Sets the value of [parent][crate::model::CreateServiceConnectionPolicyRequest::parent].
3477 ///
3478 /// # Example
3479 /// ```ignore,no_run
3480 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3481 /// let x = CreateServiceConnectionPolicyRequest::new().set_parent("example");
3482 /// ```
3483 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3484 self.parent = v.into();
3485 self
3486 }
3487
3488 /// Sets the value of [service_connection_policy_id][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy_id].
3489 ///
3490 /// # Example
3491 /// ```ignore,no_run
3492 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3493 /// let x = CreateServiceConnectionPolicyRequest::new().set_service_connection_policy_id("example");
3494 /// ```
3495 pub fn set_service_connection_policy_id<T: std::convert::Into<std::string::String>>(
3496 mut self,
3497 v: T,
3498 ) -> Self {
3499 self.service_connection_policy_id = v.into();
3500 self
3501 }
3502
3503 /// Sets the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
3504 ///
3505 /// # Example
3506 /// ```ignore,no_run
3507 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3508 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3509 /// let x = CreateServiceConnectionPolicyRequest::new().set_service_connection_policy(ServiceConnectionPolicy::default()/* use setters */);
3510 /// ```
3511 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
3512 where
3513 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3514 {
3515 self.service_connection_policy = std::option::Option::Some(v.into());
3516 self
3517 }
3518
3519 /// Sets or clears the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
3520 ///
3521 /// # Example
3522 /// ```ignore,no_run
3523 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3524 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3525 /// let x = CreateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(Some(ServiceConnectionPolicy::default()/* use setters */));
3526 /// let x = CreateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(None::<ServiceConnectionPolicy>);
3527 /// ```
3528 pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
3529 where
3530 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3531 {
3532 self.service_connection_policy = v.map(|x| x.into());
3533 self
3534 }
3535
3536 /// Sets the value of [request_id][crate::model::CreateServiceConnectionPolicyRequest::request_id].
3537 ///
3538 /// # Example
3539 /// ```ignore,no_run
3540 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3541 /// let x = CreateServiceConnectionPolicyRequest::new().set_request_id("example");
3542 /// ```
3543 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3544 self.request_id = v.into();
3545 self
3546 }
3547}
3548
3549impl wkt::message::Message for CreateServiceConnectionPolicyRequest {
3550 fn typename() -> &'static str {
3551 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionPolicyRequest"
3552 }
3553}
3554
3555/// Request for UpdateServiceConnectionPolicy.
3556#[derive(Clone, Default, PartialEq)]
3557#[non_exhaustive]
3558pub struct UpdateServiceConnectionPolicyRequest {
3559 /// Optional. Field mask is used to specify the fields to be overwritten in the
3560 /// ServiceConnectionPolicy resource by the update.
3561 /// The fields specified in the update_mask are relative to the resource, not
3562 /// the full request. A field will be overwritten if it is in the mask. If the
3563 /// user does not provide a mask then all fields will be overwritten.
3564 pub update_mask: std::option::Option<wkt::FieldMask>,
3565
3566 /// Required. New values to be patched into the resource.
3567 pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
3568
3569 /// Optional. An optional request ID to identify requests. Specify a unique
3570 /// request ID so that if you must retry your request, the server will know to
3571 /// ignore the request if it has already been completed. The server will
3572 /// guarantee that for at least 60 minutes since the first request.
3573 ///
3574 /// For example, consider a situation where you make an initial request and
3575 /// the request times out. If you make the request again with the same request
3576 /// ID, the server can check if original operation with the same request ID
3577 /// was received, and if so, will ignore the second request. This prevents
3578 /// clients from accidentally creating duplicate commitments.
3579 ///
3580 /// The request ID must be a valid UUID with the exception that zero UUID is
3581 /// not supported (00000000-0000-0000-0000-000000000000).
3582 pub request_id: std::string::String,
3583
3584 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3585}
3586
3587impl UpdateServiceConnectionPolicyRequest {
3588 pub fn new() -> Self {
3589 std::default::Default::default()
3590 }
3591
3592 /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
3593 ///
3594 /// # Example
3595 /// ```ignore,no_run
3596 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3597 /// use wkt::FieldMask;
3598 /// let x = UpdateServiceConnectionPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3599 /// ```
3600 pub fn set_update_mask<T>(mut self, v: T) -> Self
3601 where
3602 T: std::convert::Into<wkt::FieldMask>,
3603 {
3604 self.update_mask = std::option::Option::Some(v.into());
3605 self
3606 }
3607
3608 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
3609 ///
3610 /// # Example
3611 /// ```ignore,no_run
3612 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3613 /// use wkt::FieldMask;
3614 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3615 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3616 /// ```
3617 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3618 where
3619 T: std::convert::Into<wkt::FieldMask>,
3620 {
3621 self.update_mask = v.map(|x| x.into());
3622 self
3623 }
3624
3625 /// Sets the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
3626 ///
3627 /// # Example
3628 /// ```ignore,no_run
3629 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3630 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3631 /// let x = UpdateServiceConnectionPolicyRequest::new().set_service_connection_policy(ServiceConnectionPolicy::default()/* use setters */);
3632 /// ```
3633 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
3634 where
3635 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3636 {
3637 self.service_connection_policy = std::option::Option::Some(v.into());
3638 self
3639 }
3640
3641 /// Sets or clears the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
3642 ///
3643 /// # Example
3644 /// ```ignore,no_run
3645 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3646 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3647 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(Some(ServiceConnectionPolicy::default()/* use setters */));
3648 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(None::<ServiceConnectionPolicy>);
3649 /// ```
3650 pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
3651 where
3652 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3653 {
3654 self.service_connection_policy = v.map(|x| x.into());
3655 self
3656 }
3657
3658 /// Sets the value of [request_id][crate::model::UpdateServiceConnectionPolicyRequest::request_id].
3659 ///
3660 /// # Example
3661 /// ```ignore,no_run
3662 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3663 /// let x = UpdateServiceConnectionPolicyRequest::new().set_request_id("example");
3664 /// ```
3665 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3666 self.request_id = v.into();
3667 self
3668 }
3669}
3670
3671impl wkt::message::Message for UpdateServiceConnectionPolicyRequest {
3672 fn typename() -> &'static str {
3673 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionPolicyRequest"
3674 }
3675}
3676
3677/// Request for DeleteServiceConnectionPolicy.
3678#[derive(Clone, Default, PartialEq)]
3679#[non_exhaustive]
3680pub struct DeleteServiceConnectionPolicyRequest {
3681 /// Required. The name of the ServiceConnectionPolicy to delete.
3682 pub name: std::string::String,
3683
3684 /// Optional. An optional request ID to identify requests. Specify a unique
3685 /// request ID so that if you must retry your request, the server will know to
3686 /// ignore the request if it has already been completed. The server will
3687 /// guarantee that for at least 60 minutes after the first request.
3688 ///
3689 /// For example, consider a situation where you make an initial request and
3690 /// the request times out. If you make the request again with the same request
3691 /// ID, the server can check if original operation with the same request ID
3692 /// was received, and if so, will ignore the second request. This prevents
3693 /// clients from accidentally creating duplicate commitments.
3694 ///
3695 /// The request ID must be a valid UUID with the exception that zero UUID is
3696 /// not supported (00000000-0000-0000-0000-000000000000).
3697 pub request_id: std::string::String,
3698
3699 /// Optional. The etag is computed by the server, and may be sent on update and
3700 /// delete requests to ensure the client has an up-to-date value before
3701 /// proceeding.
3702 pub etag: std::option::Option<std::string::String>,
3703
3704 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3705}
3706
3707impl DeleteServiceConnectionPolicyRequest {
3708 pub fn new() -> Self {
3709 std::default::Default::default()
3710 }
3711
3712 /// Sets the value of [name][crate::model::DeleteServiceConnectionPolicyRequest::name].
3713 ///
3714 /// # Example
3715 /// ```ignore,no_run
3716 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3717 /// let x = DeleteServiceConnectionPolicyRequest::new().set_name("example");
3718 /// ```
3719 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3720 self.name = v.into();
3721 self
3722 }
3723
3724 /// Sets the value of [request_id][crate::model::DeleteServiceConnectionPolicyRequest::request_id].
3725 ///
3726 /// # Example
3727 /// ```ignore,no_run
3728 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3729 /// let x = DeleteServiceConnectionPolicyRequest::new().set_request_id("example");
3730 /// ```
3731 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3732 self.request_id = v.into();
3733 self
3734 }
3735
3736 /// Sets the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
3737 ///
3738 /// # Example
3739 /// ```ignore,no_run
3740 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3741 /// let x = DeleteServiceConnectionPolicyRequest::new().set_etag("example");
3742 /// ```
3743 pub fn set_etag<T>(mut self, v: T) -> Self
3744 where
3745 T: std::convert::Into<std::string::String>,
3746 {
3747 self.etag = std::option::Option::Some(v.into());
3748 self
3749 }
3750
3751 /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
3752 ///
3753 /// # Example
3754 /// ```ignore,no_run
3755 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3756 /// let x = DeleteServiceConnectionPolicyRequest::new().set_or_clear_etag(Some("example"));
3757 /// let x = DeleteServiceConnectionPolicyRequest::new().set_or_clear_etag(None::<String>);
3758 /// ```
3759 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
3760 where
3761 T: std::convert::Into<std::string::String>,
3762 {
3763 self.etag = v.map(|x| x.into());
3764 self
3765 }
3766}
3767
3768impl wkt::message::Message for DeleteServiceConnectionPolicyRequest {
3769 fn typename() -> &'static str {
3770 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionPolicyRequest"
3771 }
3772}
3773
3774/// The ServiceClass resource.
3775#[derive(Clone, Default, PartialEq)]
3776#[non_exhaustive]
3777pub struct ServiceClass {
3778 /// Immutable. The name of a ServiceClass resource.
3779 /// Format:
3780 /// projects/{project}/locations/{location}/serviceClasses/{service_class}
3781 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
3782 pub name: std::string::String,
3783
3784 /// Output only. The generated service class name. Use this name to refer to
3785 /// the Service class in Service Connection Maps and Service Connection
3786 /// Policies.
3787 pub service_class: std::string::String,
3788
3789 /// Output only. Time when the ServiceClass was created.
3790 pub create_time: std::option::Option<wkt::Timestamp>,
3791
3792 /// Output only. Time when the ServiceClass was updated.
3793 pub update_time: std::option::Option<wkt::Timestamp>,
3794
3795 /// User-defined labels.
3796 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3797
3798 /// A description of this resource.
3799 pub description: std::string::String,
3800
3801 /// Optional. The etag is computed by the server, and may be sent on update and
3802 /// delete requests to ensure the client has an up-to-date value before
3803 /// proceeding.
3804 pub etag: std::option::Option<std::string::String>,
3805
3806 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3807}
3808
3809impl ServiceClass {
3810 pub fn new() -> Self {
3811 std::default::Default::default()
3812 }
3813
3814 /// Sets the value of [name][crate::model::ServiceClass::name].
3815 ///
3816 /// # Example
3817 /// ```ignore,no_run
3818 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3819 /// let x = ServiceClass::new().set_name("example");
3820 /// ```
3821 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3822 self.name = v.into();
3823 self
3824 }
3825
3826 /// Sets the value of [service_class][crate::model::ServiceClass::service_class].
3827 ///
3828 /// # Example
3829 /// ```ignore,no_run
3830 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3831 /// let x = ServiceClass::new().set_service_class("example");
3832 /// ```
3833 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3834 self.service_class = v.into();
3835 self
3836 }
3837
3838 /// Sets the value of [create_time][crate::model::ServiceClass::create_time].
3839 ///
3840 /// # Example
3841 /// ```ignore,no_run
3842 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3843 /// use wkt::Timestamp;
3844 /// let x = ServiceClass::new().set_create_time(Timestamp::default()/* use setters */);
3845 /// ```
3846 pub fn set_create_time<T>(mut self, v: T) -> Self
3847 where
3848 T: std::convert::Into<wkt::Timestamp>,
3849 {
3850 self.create_time = std::option::Option::Some(v.into());
3851 self
3852 }
3853
3854 /// Sets or clears the value of [create_time][crate::model::ServiceClass::create_time].
3855 ///
3856 /// # Example
3857 /// ```ignore,no_run
3858 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3859 /// use wkt::Timestamp;
3860 /// let x = ServiceClass::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3861 /// let x = ServiceClass::new().set_or_clear_create_time(None::<Timestamp>);
3862 /// ```
3863 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3864 where
3865 T: std::convert::Into<wkt::Timestamp>,
3866 {
3867 self.create_time = v.map(|x| x.into());
3868 self
3869 }
3870
3871 /// Sets the value of [update_time][crate::model::ServiceClass::update_time].
3872 ///
3873 /// # Example
3874 /// ```ignore,no_run
3875 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3876 /// use wkt::Timestamp;
3877 /// let x = ServiceClass::new().set_update_time(Timestamp::default()/* use setters */);
3878 /// ```
3879 pub fn set_update_time<T>(mut self, v: T) -> Self
3880 where
3881 T: std::convert::Into<wkt::Timestamp>,
3882 {
3883 self.update_time = std::option::Option::Some(v.into());
3884 self
3885 }
3886
3887 /// Sets or clears the value of [update_time][crate::model::ServiceClass::update_time].
3888 ///
3889 /// # Example
3890 /// ```ignore,no_run
3891 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3892 /// use wkt::Timestamp;
3893 /// let x = ServiceClass::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3894 /// let x = ServiceClass::new().set_or_clear_update_time(None::<Timestamp>);
3895 /// ```
3896 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3897 where
3898 T: std::convert::Into<wkt::Timestamp>,
3899 {
3900 self.update_time = v.map(|x| x.into());
3901 self
3902 }
3903
3904 /// Sets the value of [labels][crate::model::ServiceClass::labels].
3905 ///
3906 /// # Example
3907 /// ```ignore,no_run
3908 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3909 /// let x = ServiceClass::new().set_labels([
3910 /// ("key0", "abc"),
3911 /// ("key1", "xyz"),
3912 /// ]);
3913 /// ```
3914 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3915 where
3916 T: std::iter::IntoIterator<Item = (K, V)>,
3917 K: std::convert::Into<std::string::String>,
3918 V: std::convert::Into<std::string::String>,
3919 {
3920 use std::iter::Iterator;
3921 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3922 self
3923 }
3924
3925 /// Sets the value of [description][crate::model::ServiceClass::description].
3926 ///
3927 /// # Example
3928 /// ```ignore,no_run
3929 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3930 /// let x = ServiceClass::new().set_description("example");
3931 /// ```
3932 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3933 self.description = v.into();
3934 self
3935 }
3936
3937 /// Sets the value of [etag][crate::model::ServiceClass::etag].
3938 ///
3939 /// # Example
3940 /// ```ignore,no_run
3941 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3942 /// let x = ServiceClass::new().set_etag("example");
3943 /// ```
3944 pub fn set_etag<T>(mut self, v: T) -> Self
3945 where
3946 T: std::convert::Into<std::string::String>,
3947 {
3948 self.etag = std::option::Option::Some(v.into());
3949 self
3950 }
3951
3952 /// Sets or clears the value of [etag][crate::model::ServiceClass::etag].
3953 ///
3954 /// # Example
3955 /// ```ignore,no_run
3956 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3957 /// let x = ServiceClass::new().set_or_clear_etag(Some("example"));
3958 /// let x = ServiceClass::new().set_or_clear_etag(None::<String>);
3959 /// ```
3960 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
3961 where
3962 T: std::convert::Into<std::string::String>,
3963 {
3964 self.etag = v.map(|x| x.into());
3965 self
3966 }
3967}
3968
3969impl wkt::message::Message for ServiceClass {
3970 fn typename() -> &'static str {
3971 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceClass"
3972 }
3973}
3974
3975/// Request for ListServiceClasses.
3976#[derive(Clone, Default, PartialEq)]
3977#[non_exhaustive]
3978pub struct ListServiceClassesRequest {
3979 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
3980 pub parent: std::string::String,
3981
3982 /// The maximum number of results per page that should be returned.
3983 pub page_size: i32,
3984
3985 /// The page token.
3986 pub page_token: std::string::String,
3987
3988 /// A filter expression that filters the results listed in the response.
3989 pub filter: std::string::String,
3990
3991 /// Sort the results by a certain order.
3992 pub order_by: std::string::String,
3993
3994 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3995}
3996
3997impl ListServiceClassesRequest {
3998 pub fn new() -> Self {
3999 std::default::Default::default()
4000 }
4001
4002 /// Sets the value of [parent][crate::model::ListServiceClassesRequest::parent].
4003 ///
4004 /// # Example
4005 /// ```ignore,no_run
4006 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4007 /// let x = ListServiceClassesRequest::new().set_parent("example");
4008 /// ```
4009 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4010 self.parent = v.into();
4011 self
4012 }
4013
4014 /// Sets the value of [page_size][crate::model::ListServiceClassesRequest::page_size].
4015 ///
4016 /// # Example
4017 /// ```ignore,no_run
4018 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4019 /// let x = ListServiceClassesRequest::new().set_page_size(42);
4020 /// ```
4021 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4022 self.page_size = v.into();
4023 self
4024 }
4025
4026 /// Sets the value of [page_token][crate::model::ListServiceClassesRequest::page_token].
4027 ///
4028 /// # Example
4029 /// ```ignore,no_run
4030 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4031 /// let x = ListServiceClassesRequest::new().set_page_token("example");
4032 /// ```
4033 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4034 self.page_token = v.into();
4035 self
4036 }
4037
4038 /// Sets the value of [filter][crate::model::ListServiceClassesRequest::filter].
4039 ///
4040 /// # Example
4041 /// ```ignore,no_run
4042 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4043 /// let x = ListServiceClassesRequest::new().set_filter("example");
4044 /// ```
4045 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4046 self.filter = v.into();
4047 self
4048 }
4049
4050 /// Sets the value of [order_by][crate::model::ListServiceClassesRequest::order_by].
4051 ///
4052 /// # Example
4053 /// ```ignore,no_run
4054 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4055 /// let x = ListServiceClassesRequest::new().set_order_by("example");
4056 /// ```
4057 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4058 self.order_by = v.into();
4059 self
4060 }
4061}
4062
4063impl wkt::message::Message for ListServiceClassesRequest {
4064 fn typename() -> &'static str {
4065 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesRequest"
4066 }
4067}
4068
4069/// Response for ListServiceClasses.
4070#[derive(Clone, Default, PartialEq)]
4071#[non_exhaustive]
4072pub struct ListServiceClassesResponse {
4073 /// ServiceClasses to be returned.
4074 pub service_classes: std::vec::Vec<crate::model::ServiceClass>,
4075
4076 /// The next pagination token in the List response. It should be used as
4077 /// page_token for the following request. An empty value means no more result.
4078 pub next_page_token: std::string::String,
4079
4080 /// Locations that could not be reached.
4081 pub unreachable: std::vec::Vec<std::string::String>,
4082
4083 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4084}
4085
4086impl ListServiceClassesResponse {
4087 pub fn new() -> Self {
4088 std::default::Default::default()
4089 }
4090
4091 /// Sets the value of [service_classes][crate::model::ListServiceClassesResponse::service_classes].
4092 ///
4093 /// # Example
4094 /// ```ignore,no_run
4095 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesResponse;
4096 /// use google_cloud_networkconnectivity_v1::model::ServiceClass;
4097 /// let x = ListServiceClassesResponse::new()
4098 /// .set_service_classes([
4099 /// ServiceClass::default()/* use setters */,
4100 /// ServiceClass::default()/* use (different) setters */,
4101 /// ]);
4102 /// ```
4103 pub fn set_service_classes<T, V>(mut self, v: T) -> Self
4104 where
4105 T: std::iter::IntoIterator<Item = V>,
4106 V: std::convert::Into<crate::model::ServiceClass>,
4107 {
4108 use std::iter::Iterator;
4109 self.service_classes = v.into_iter().map(|i| i.into()).collect();
4110 self
4111 }
4112
4113 /// Sets the value of [next_page_token][crate::model::ListServiceClassesResponse::next_page_token].
4114 ///
4115 /// # Example
4116 /// ```ignore,no_run
4117 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesResponse;
4118 /// let x = ListServiceClassesResponse::new().set_next_page_token("example");
4119 /// ```
4120 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4121 self.next_page_token = v.into();
4122 self
4123 }
4124
4125 /// Sets the value of [unreachable][crate::model::ListServiceClassesResponse::unreachable].
4126 ///
4127 /// # Example
4128 /// ```ignore,no_run
4129 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesResponse;
4130 /// let x = ListServiceClassesResponse::new().set_unreachable(["a", "b", "c"]);
4131 /// ```
4132 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4133 where
4134 T: std::iter::IntoIterator<Item = V>,
4135 V: std::convert::Into<std::string::String>,
4136 {
4137 use std::iter::Iterator;
4138 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4139 self
4140 }
4141}
4142
4143impl wkt::message::Message for ListServiceClassesResponse {
4144 fn typename() -> &'static str {
4145 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesResponse"
4146 }
4147}
4148
4149#[doc(hidden)]
4150impl google_cloud_gax::paginator::internal::PageableResponse for ListServiceClassesResponse {
4151 type PageItem = crate::model::ServiceClass;
4152
4153 fn items(self) -> std::vec::Vec<Self::PageItem> {
4154 self.service_classes
4155 }
4156
4157 fn next_page_token(&self) -> std::string::String {
4158 use std::clone::Clone;
4159 self.next_page_token.clone()
4160 }
4161}
4162
4163/// Request for GetServiceClass.
4164#[derive(Clone, Default, PartialEq)]
4165#[non_exhaustive]
4166pub struct GetServiceClassRequest {
4167 /// Required. Name of the ServiceClass to get.
4168 pub name: std::string::String,
4169
4170 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4171}
4172
4173impl GetServiceClassRequest {
4174 pub fn new() -> Self {
4175 std::default::Default::default()
4176 }
4177
4178 /// Sets the value of [name][crate::model::GetServiceClassRequest::name].
4179 ///
4180 /// # Example
4181 /// ```ignore,no_run
4182 /// # use google_cloud_networkconnectivity_v1::model::GetServiceClassRequest;
4183 /// let x = GetServiceClassRequest::new().set_name("example");
4184 /// ```
4185 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4186 self.name = v.into();
4187 self
4188 }
4189}
4190
4191impl wkt::message::Message for GetServiceClassRequest {
4192 fn typename() -> &'static str {
4193 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceClassRequest"
4194 }
4195}
4196
4197/// Request for UpdateServiceClass.
4198#[derive(Clone, Default, PartialEq)]
4199#[non_exhaustive]
4200pub struct UpdateServiceClassRequest {
4201 /// Optional. Field mask is used to specify the fields to be overwritten in the
4202 /// ServiceClass resource by the update.
4203 /// The fields specified in the update_mask are relative to the resource, not
4204 /// the full request. A field will be overwritten if it is in the mask. If the
4205 /// user does not provide a mask then all fields will be overwritten.
4206 pub update_mask: std::option::Option<wkt::FieldMask>,
4207
4208 /// Required. New values to be patched into the resource.
4209 pub service_class: std::option::Option<crate::model::ServiceClass>,
4210
4211 /// Optional. An optional request ID to identify requests. Specify a unique
4212 /// request ID so that if you must retry your request, the server will know to
4213 /// ignore the request if it has already been completed. The server will
4214 /// guarantee that for at least 60 minutes since the first request.
4215 ///
4216 /// For example, consider a situation where you make an initial request and
4217 /// the request times out. If you make the request again with the same request
4218 /// ID, the server can check if original operation with the same request ID
4219 /// was received, and if so, will ignore the second request. This prevents
4220 /// clients from accidentally creating duplicate commitments.
4221 ///
4222 /// The request ID must be a valid UUID with the exception that zero UUID is
4223 /// not supported (00000000-0000-0000-0000-000000000000).
4224 pub request_id: std::string::String,
4225
4226 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4227}
4228
4229impl UpdateServiceClassRequest {
4230 pub fn new() -> Self {
4231 std::default::Default::default()
4232 }
4233
4234 /// Sets the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
4235 ///
4236 /// # Example
4237 /// ```ignore,no_run
4238 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4239 /// use wkt::FieldMask;
4240 /// let x = UpdateServiceClassRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4241 /// ```
4242 pub fn set_update_mask<T>(mut self, v: T) -> Self
4243 where
4244 T: std::convert::Into<wkt::FieldMask>,
4245 {
4246 self.update_mask = std::option::Option::Some(v.into());
4247 self
4248 }
4249
4250 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
4251 ///
4252 /// # Example
4253 /// ```ignore,no_run
4254 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4255 /// use wkt::FieldMask;
4256 /// let x = UpdateServiceClassRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4257 /// let x = UpdateServiceClassRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4258 /// ```
4259 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4260 where
4261 T: std::convert::Into<wkt::FieldMask>,
4262 {
4263 self.update_mask = v.map(|x| x.into());
4264 self
4265 }
4266
4267 /// Sets the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
4268 ///
4269 /// # Example
4270 /// ```ignore,no_run
4271 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4272 /// use google_cloud_networkconnectivity_v1::model::ServiceClass;
4273 /// let x = UpdateServiceClassRequest::new().set_service_class(ServiceClass::default()/* use setters */);
4274 /// ```
4275 pub fn set_service_class<T>(mut self, v: T) -> Self
4276 where
4277 T: std::convert::Into<crate::model::ServiceClass>,
4278 {
4279 self.service_class = std::option::Option::Some(v.into());
4280 self
4281 }
4282
4283 /// Sets or clears the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
4284 ///
4285 /// # Example
4286 /// ```ignore,no_run
4287 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4288 /// use google_cloud_networkconnectivity_v1::model::ServiceClass;
4289 /// let x = UpdateServiceClassRequest::new().set_or_clear_service_class(Some(ServiceClass::default()/* use setters */));
4290 /// let x = UpdateServiceClassRequest::new().set_or_clear_service_class(None::<ServiceClass>);
4291 /// ```
4292 pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
4293 where
4294 T: std::convert::Into<crate::model::ServiceClass>,
4295 {
4296 self.service_class = v.map(|x| x.into());
4297 self
4298 }
4299
4300 /// Sets the value of [request_id][crate::model::UpdateServiceClassRequest::request_id].
4301 ///
4302 /// # Example
4303 /// ```ignore,no_run
4304 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4305 /// let x = UpdateServiceClassRequest::new().set_request_id("example");
4306 /// ```
4307 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4308 self.request_id = v.into();
4309 self
4310 }
4311}
4312
4313impl wkt::message::Message for UpdateServiceClassRequest {
4314 fn typename() -> &'static str {
4315 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceClassRequest"
4316 }
4317}
4318
4319/// Request for DeleteServiceClass.
4320#[derive(Clone, Default, PartialEq)]
4321#[non_exhaustive]
4322pub struct DeleteServiceClassRequest {
4323 /// Required. The name of the ServiceClass to delete.
4324 pub name: std::string::String,
4325
4326 /// Optional. An optional request ID to identify requests. Specify a unique
4327 /// request ID so that if you must retry your request, the server will know to
4328 /// ignore the request if it has already been completed. The server will
4329 /// guarantee that for at least 60 minutes after the first request.
4330 ///
4331 /// For example, consider a situation where you make an initial request and
4332 /// the request times out. If you make the request again with the same request
4333 /// ID, the server can check if original operation with the same request ID
4334 /// was received, and if so, will ignore the second request. This prevents
4335 /// clients from accidentally creating duplicate commitments.
4336 ///
4337 /// The request ID must be a valid UUID with the exception that zero UUID is
4338 /// not supported (00000000-0000-0000-0000-000000000000).
4339 pub request_id: std::string::String,
4340
4341 /// Optional. The etag is computed by the server, and may be sent on update and
4342 /// delete requests to ensure the client has an up-to-date value before
4343 /// proceeding.
4344 pub etag: std::option::Option<std::string::String>,
4345
4346 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4347}
4348
4349impl DeleteServiceClassRequest {
4350 pub fn new() -> Self {
4351 std::default::Default::default()
4352 }
4353
4354 /// Sets the value of [name][crate::model::DeleteServiceClassRequest::name].
4355 ///
4356 /// # Example
4357 /// ```ignore,no_run
4358 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4359 /// let x = DeleteServiceClassRequest::new().set_name("example");
4360 /// ```
4361 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4362 self.name = v.into();
4363 self
4364 }
4365
4366 /// Sets the value of [request_id][crate::model::DeleteServiceClassRequest::request_id].
4367 ///
4368 /// # Example
4369 /// ```ignore,no_run
4370 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4371 /// let x = DeleteServiceClassRequest::new().set_request_id("example");
4372 /// ```
4373 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4374 self.request_id = v.into();
4375 self
4376 }
4377
4378 /// Sets the value of [etag][crate::model::DeleteServiceClassRequest::etag].
4379 ///
4380 /// # Example
4381 /// ```ignore,no_run
4382 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4383 /// let x = DeleteServiceClassRequest::new().set_etag("example");
4384 /// ```
4385 pub fn set_etag<T>(mut self, v: T) -> Self
4386 where
4387 T: std::convert::Into<std::string::String>,
4388 {
4389 self.etag = std::option::Option::Some(v.into());
4390 self
4391 }
4392
4393 /// Sets or clears the value of [etag][crate::model::DeleteServiceClassRequest::etag].
4394 ///
4395 /// # Example
4396 /// ```ignore,no_run
4397 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4398 /// let x = DeleteServiceClassRequest::new().set_or_clear_etag(Some("example"));
4399 /// let x = DeleteServiceClassRequest::new().set_or_clear_etag(None::<String>);
4400 /// ```
4401 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
4402 where
4403 T: std::convert::Into<std::string::String>,
4404 {
4405 self.etag = v.map(|x| x.into());
4406 self
4407 }
4408}
4409
4410impl wkt::message::Message for DeleteServiceClassRequest {
4411 fn typename() -> &'static str {
4412 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceClassRequest"
4413 }
4414}
4415
4416/// The ServiceConnectionToken resource.
4417#[derive(Clone, Default, PartialEq)]
4418#[non_exhaustive]
4419pub struct ServiceConnectionToken {
4420 /// Immutable. The name of a ServiceConnectionToken.
4421 /// Format:
4422 /// projects/{project}/locations/{location}/ServiceConnectionTokens/{service_connection_token}
4423 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
4424 pub name: std::string::String,
4425
4426 /// Output only. Time when the ServiceConnectionToken was created.
4427 pub create_time: std::option::Option<wkt::Timestamp>,
4428
4429 /// Output only. Time when the ServiceConnectionToken was updated.
4430 pub update_time: std::option::Option<wkt::Timestamp>,
4431
4432 /// User-defined labels.
4433 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4434
4435 /// A description of this resource.
4436 pub description: std::string::String,
4437
4438 /// The resource path of the network associated with this token.
4439 /// Example:
4440 /// projects/{projectNumOrId}/global/networks/{resourceId}.
4441 pub network: std::string::String,
4442
4443 /// Output only. The token generated by Automation.
4444 pub token: std::string::String,
4445
4446 /// Output only. The time to which this token is valid.
4447 pub expire_time: std::option::Option<wkt::Timestamp>,
4448
4449 /// Optional. The etag is computed by the server, and may be sent on update and
4450 /// delete requests to ensure the client has an up-to-date value before
4451 /// proceeding.
4452 pub etag: std::option::Option<std::string::String>,
4453
4454 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4455}
4456
4457impl ServiceConnectionToken {
4458 pub fn new() -> Self {
4459 std::default::Default::default()
4460 }
4461
4462 /// Sets the value of [name][crate::model::ServiceConnectionToken::name].
4463 ///
4464 /// # Example
4465 /// ```ignore,no_run
4466 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4467 /// let x = ServiceConnectionToken::new().set_name("example");
4468 /// ```
4469 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4470 self.name = v.into();
4471 self
4472 }
4473
4474 /// Sets the value of [create_time][crate::model::ServiceConnectionToken::create_time].
4475 ///
4476 /// # Example
4477 /// ```ignore,no_run
4478 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4479 /// use wkt::Timestamp;
4480 /// let x = ServiceConnectionToken::new().set_create_time(Timestamp::default()/* use setters */);
4481 /// ```
4482 pub fn set_create_time<T>(mut self, v: T) -> Self
4483 where
4484 T: std::convert::Into<wkt::Timestamp>,
4485 {
4486 self.create_time = std::option::Option::Some(v.into());
4487 self
4488 }
4489
4490 /// Sets or clears the value of [create_time][crate::model::ServiceConnectionToken::create_time].
4491 ///
4492 /// # Example
4493 /// ```ignore,no_run
4494 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4495 /// use wkt::Timestamp;
4496 /// let x = ServiceConnectionToken::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4497 /// let x = ServiceConnectionToken::new().set_or_clear_create_time(None::<Timestamp>);
4498 /// ```
4499 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4500 where
4501 T: std::convert::Into<wkt::Timestamp>,
4502 {
4503 self.create_time = v.map(|x| x.into());
4504 self
4505 }
4506
4507 /// Sets the value of [update_time][crate::model::ServiceConnectionToken::update_time].
4508 ///
4509 /// # Example
4510 /// ```ignore,no_run
4511 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4512 /// use wkt::Timestamp;
4513 /// let x = ServiceConnectionToken::new().set_update_time(Timestamp::default()/* use setters */);
4514 /// ```
4515 pub fn set_update_time<T>(mut self, v: T) -> Self
4516 where
4517 T: std::convert::Into<wkt::Timestamp>,
4518 {
4519 self.update_time = std::option::Option::Some(v.into());
4520 self
4521 }
4522
4523 /// Sets or clears the value of [update_time][crate::model::ServiceConnectionToken::update_time].
4524 ///
4525 /// # Example
4526 /// ```ignore,no_run
4527 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4528 /// use wkt::Timestamp;
4529 /// let x = ServiceConnectionToken::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4530 /// let x = ServiceConnectionToken::new().set_or_clear_update_time(None::<Timestamp>);
4531 /// ```
4532 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4533 where
4534 T: std::convert::Into<wkt::Timestamp>,
4535 {
4536 self.update_time = v.map(|x| x.into());
4537 self
4538 }
4539
4540 /// Sets the value of [labels][crate::model::ServiceConnectionToken::labels].
4541 ///
4542 /// # Example
4543 /// ```ignore,no_run
4544 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4545 /// let x = ServiceConnectionToken::new().set_labels([
4546 /// ("key0", "abc"),
4547 /// ("key1", "xyz"),
4548 /// ]);
4549 /// ```
4550 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4551 where
4552 T: std::iter::IntoIterator<Item = (K, V)>,
4553 K: std::convert::Into<std::string::String>,
4554 V: std::convert::Into<std::string::String>,
4555 {
4556 use std::iter::Iterator;
4557 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4558 self
4559 }
4560
4561 /// Sets the value of [description][crate::model::ServiceConnectionToken::description].
4562 ///
4563 /// # Example
4564 /// ```ignore,no_run
4565 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4566 /// let x = ServiceConnectionToken::new().set_description("example");
4567 /// ```
4568 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4569 self.description = v.into();
4570 self
4571 }
4572
4573 /// Sets the value of [network][crate::model::ServiceConnectionToken::network].
4574 ///
4575 /// # Example
4576 /// ```ignore,no_run
4577 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4578 /// let x = ServiceConnectionToken::new().set_network("example");
4579 /// ```
4580 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4581 self.network = v.into();
4582 self
4583 }
4584
4585 /// Sets the value of [token][crate::model::ServiceConnectionToken::token].
4586 ///
4587 /// # Example
4588 /// ```ignore,no_run
4589 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4590 /// let x = ServiceConnectionToken::new().set_token("example");
4591 /// ```
4592 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4593 self.token = v.into();
4594 self
4595 }
4596
4597 /// Sets the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
4598 ///
4599 /// # Example
4600 /// ```ignore,no_run
4601 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4602 /// use wkt::Timestamp;
4603 /// let x = ServiceConnectionToken::new().set_expire_time(Timestamp::default()/* use setters */);
4604 /// ```
4605 pub fn set_expire_time<T>(mut self, v: T) -> Self
4606 where
4607 T: std::convert::Into<wkt::Timestamp>,
4608 {
4609 self.expire_time = std::option::Option::Some(v.into());
4610 self
4611 }
4612
4613 /// Sets or clears the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
4614 ///
4615 /// # Example
4616 /// ```ignore,no_run
4617 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4618 /// use wkt::Timestamp;
4619 /// let x = ServiceConnectionToken::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
4620 /// let x = ServiceConnectionToken::new().set_or_clear_expire_time(None::<Timestamp>);
4621 /// ```
4622 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
4623 where
4624 T: std::convert::Into<wkt::Timestamp>,
4625 {
4626 self.expire_time = v.map(|x| x.into());
4627 self
4628 }
4629
4630 /// Sets the value of [etag][crate::model::ServiceConnectionToken::etag].
4631 ///
4632 /// # Example
4633 /// ```ignore,no_run
4634 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4635 /// let x = ServiceConnectionToken::new().set_etag("example");
4636 /// ```
4637 pub fn set_etag<T>(mut self, v: T) -> Self
4638 where
4639 T: std::convert::Into<std::string::String>,
4640 {
4641 self.etag = std::option::Option::Some(v.into());
4642 self
4643 }
4644
4645 /// Sets or clears the value of [etag][crate::model::ServiceConnectionToken::etag].
4646 ///
4647 /// # Example
4648 /// ```ignore,no_run
4649 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4650 /// let x = ServiceConnectionToken::new().set_or_clear_etag(Some("example"));
4651 /// let x = ServiceConnectionToken::new().set_or_clear_etag(None::<String>);
4652 /// ```
4653 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
4654 where
4655 T: std::convert::Into<std::string::String>,
4656 {
4657 self.etag = v.map(|x| x.into());
4658 self
4659 }
4660}
4661
4662impl wkt::message::Message for ServiceConnectionToken {
4663 fn typename() -> &'static str {
4664 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionToken"
4665 }
4666}
4667
4668/// Request for ListServiceConnectionTokens.
4669#[derive(Clone, Default, PartialEq)]
4670#[non_exhaustive]
4671pub struct ListServiceConnectionTokensRequest {
4672 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
4673 pub parent: std::string::String,
4674
4675 /// The maximum number of results per page that should be returned.
4676 pub page_size: i32,
4677
4678 /// The page token.
4679 pub page_token: std::string::String,
4680
4681 /// A filter expression that filters the results listed in the response.
4682 pub filter: std::string::String,
4683
4684 /// Sort the results by a certain order.
4685 pub order_by: std::string::String,
4686
4687 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4688}
4689
4690impl ListServiceConnectionTokensRequest {
4691 pub fn new() -> Self {
4692 std::default::Default::default()
4693 }
4694
4695 /// Sets the value of [parent][crate::model::ListServiceConnectionTokensRequest::parent].
4696 ///
4697 /// # Example
4698 /// ```ignore,no_run
4699 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4700 /// let x = ListServiceConnectionTokensRequest::new().set_parent("example");
4701 /// ```
4702 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4703 self.parent = v.into();
4704 self
4705 }
4706
4707 /// Sets the value of [page_size][crate::model::ListServiceConnectionTokensRequest::page_size].
4708 ///
4709 /// # Example
4710 /// ```ignore,no_run
4711 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4712 /// let x = ListServiceConnectionTokensRequest::new().set_page_size(42);
4713 /// ```
4714 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4715 self.page_size = v.into();
4716 self
4717 }
4718
4719 /// Sets the value of [page_token][crate::model::ListServiceConnectionTokensRequest::page_token].
4720 ///
4721 /// # Example
4722 /// ```ignore,no_run
4723 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4724 /// let x = ListServiceConnectionTokensRequest::new().set_page_token("example");
4725 /// ```
4726 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4727 self.page_token = v.into();
4728 self
4729 }
4730
4731 /// Sets the value of [filter][crate::model::ListServiceConnectionTokensRequest::filter].
4732 ///
4733 /// # Example
4734 /// ```ignore,no_run
4735 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4736 /// let x = ListServiceConnectionTokensRequest::new().set_filter("example");
4737 /// ```
4738 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4739 self.filter = v.into();
4740 self
4741 }
4742
4743 /// Sets the value of [order_by][crate::model::ListServiceConnectionTokensRequest::order_by].
4744 ///
4745 /// # Example
4746 /// ```ignore,no_run
4747 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4748 /// let x = ListServiceConnectionTokensRequest::new().set_order_by("example");
4749 /// ```
4750 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4751 self.order_by = v.into();
4752 self
4753 }
4754}
4755
4756impl wkt::message::Message for ListServiceConnectionTokensRequest {
4757 fn typename() -> &'static str {
4758 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensRequest"
4759 }
4760}
4761
4762/// Response for ListServiceConnectionTokens.
4763#[derive(Clone, Default, PartialEq)]
4764#[non_exhaustive]
4765pub struct ListServiceConnectionTokensResponse {
4766 /// ServiceConnectionTokens to be returned.
4767 pub service_connection_tokens: std::vec::Vec<crate::model::ServiceConnectionToken>,
4768
4769 /// The next pagination token in the List response. It should be used as
4770 /// page_token for the following request. An empty value means no more result.
4771 pub next_page_token: std::string::String,
4772
4773 /// Locations that could not be reached.
4774 pub unreachable: std::vec::Vec<std::string::String>,
4775
4776 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4777}
4778
4779impl ListServiceConnectionTokensResponse {
4780 pub fn new() -> Self {
4781 std::default::Default::default()
4782 }
4783
4784 /// Sets the value of [service_connection_tokens][crate::model::ListServiceConnectionTokensResponse::service_connection_tokens].
4785 ///
4786 /// # Example
4787 /// ```ignore,no_run
4788 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensResponse;
4789 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4790 /// let x = ListServiceConnectionTokensResponse::new()
4791 /// .set_service_connection_tokens([
4792 /// ServiceConnectionToken::default()/* use setters */,
4793 /// ServiceConnectionToken::default()/* use (different) setters */,
4794 /// ]);
4795 /// ```
4796 pub fn set_service_connection_tokens<T, V>(mut self, v: T) -> Self
4797 where
4798 T: std::iter::IntoIterator<Item = V>,
4799 V: std::convert::Into<crate::model::ServiceConnectionToken>,
4800 {
4801 use std::iter::Iterator;
4802 self.service_connection_tokens = v.into_iter().map(|i| i.into()).collect();
4803 self
4804 }
4805
4806 /// Sets the value of [next_page_token][crate::model::ListServiceConnectionTokensResponse::next_page_token].
4807 ///
4808 /// # Example
4809 /// ```ignore,no_run
4810 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensResponse;
4811 /// let x = ListServiceConnectionTokensResponse::new().set_next_page_token("example");
4812 /// ```
4813 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4814 self.next_page_token = v.into();
4815 self
4816 }
4817
4818 /// Sets the value of [unreachable][crate::model::ListServiceConnectionTokensResponse::unreachable].
4819 ///
4820 /// # Example
4821 /// ```ignore,no_run
4822 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensResponse;
4823 /// let x = ListServiceConnectionTokensResponse::new().set_unreachable(["a", "b", "c"]);
4824 /// ```
4825 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4826 where
4827 T: std::iter::IntoIterator<Item = V>,
4828 V: std::convert::Into<std::string::String>,
4829 {
4830 use std::iter::Iterator;
4831 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4832 self
4833 }
4834}
4835
4836impl wkt::message::Message for ListServiceConnectionTokensResponse {
4837 fn typename() -> &'static str {
4838 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensResponse"
4839 }
4840}
4841
4842#[doc(hidden)]
4843impl google_cloud_gax::paginator::internal::PageableResponse
4844 for ListServiceConnectionTokensResponse
4845{
4846 type PageItem = crate::model::ServiceConnectionToken;
4847
4848 fn items(self) -> std::vec::Vec<Self::PageItem> {
4849 self.service_connection_tokens
4850 }
4851
4852 fn next_page_token(&self) -> std::string::String {
4853 use std::clone::Clone;
4854 self.next_page_token.clone()
4855 }
4856}
4857
4858/// Request for GetServiceConnectionToken.
4859#[derive(Clone, Default, PartialEq)]
4860#[non_exhaustive]
4861pub struct GetServiceConnectionTokenRequest {
4862 /// Required. Name of the ServiceConnectionToken to get.
4863 pub name: std::string::String,
4864
4865 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4866}
4867
4868impl GetServiceConnectionTokenRequest {
4869 pub fn new() -> Self {
4870 std::default::Default::default()
4871 }
4872
4873 /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
4874 ///
4875 /// # Example
4876 /// ```ignore,no_run
4877 /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionTokenRequest;
4878 /// let x = GetServiceConnectionTokenRequest::new().set_name("example");
4879 /// ```
4880 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4881 self.name = v.into();
4882 self
4883 }
4884}
4885
4886impl wkt::message::Message for GetServiceConnectionTokenRequest {
4887 fn typename() -> &'static str {
4888 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionTokenRequest"
4889 }
4890}
4891
4892/// Request for CreateServiceConnectionToken.
4893#[derive(Clone, Default, PartialEq)]
4894#[non_exhaustive]
4895pub struct CreateServiceConnectionTokenRequest {
4896 /// Required. The parent resource's name of the ServiceConnectionToken. ex.
4897 /// projects/123/locations/us-east1
4898 pub parent: std::string::String,
4899
4900 /// Optional. Resource ID
4901 /// (i.e. 'foo' in '[...]/projects/p/locations/l/ServiceConnectionTokens/foo')
4902 /// See <https://google.aip.dev/122#resource-id-segments>
4903 /// Unique per location.
4904 /// If one is not provided, one will be generated.
4905 pub service_connection_token_id: std::string::String,
4906
4907 /// Required. Initial values for a new ServiceConnectionTokens
4908 pub service_connection_token: std::option::Option<crate::model::ServiceConnectionToken>,
4909
4910 /// Optional. An optional request ID to identify requests. Specify a unique
4911 /// request ID so that if you must retry your request, the server will know to
4912 /// ignore the request if it has already been completed. The server will
4913 /// guarantee that for at least 60 minutes since the first request.
4914 ///
4915 /// For example, consider a situation where you make an initial request and
4916 /// the request times out. If you make the request again with the same request
4917 /// ID, the server can check if original operation with the same request ID
4918 /// was received, and if so, will ignore the second request. This prevents
4919 /// clients from accidentally creating duplicate commitments.
4920 ///
4921 /// The request ID must be a valid UUID with the exception that zero UUID is
4922 /// not supported (00000000-0000-0000-0000-000000000000).
4923 pub request_id: std::string::String,
4924
4925 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4926}
4927
4928impl CreateServiceConnectionTokenRequest {
4929 pub fn new() -> Self {
4930 std::default::Default::default()
4931 }
4932
4933 /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
4934 ///
4935 /// # Example
4936 /// ```ignore,no_run
4937 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4938 /// let x = CreateServiceConnectionTokenRequest::new().set_parent("example");
4939 /// ```
4940 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4941 self.parent = v.into();
4942 self
4943 }
4944
4945 /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
4946 ///
4947 /// # Example
4948 /// ```ignore,no_run
4949 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4950 /// let x = CreateServiceConnectionTokenRequest::new().set_service_connection_token_id("example");
4951 /// ```
4952 pub fn set_service_connection_token_id<T: std::convert::Into<std::string::String>>(
4953 mut self,
4954 v: T,
4955 ) -> Self {
4956 self.service_connection_token_id = v.into();
4957 self
4958 }
4959
4960 /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
4961 ///
4962 /// # Example
4963 /// ```ignore,no_run
4964 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4965 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4966 /// let x = CreateServiceConnectionTokenRequest::new().set_service_connection_token(ServiceConnectionToken::default()/* use setters */);
4967 /// ```
4968 pub fn set_service_connection_token<T>(mut self, v: T) -> Self
4969 where
4970 T: std::convert::Into<crate::model::ServiceConnectionToken>,
4971 {
4972 self.service_connection_token = std::option::Option::Some(v.into());
4973 self
4974 }
4975
4976 /// Sets or clears the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
4977 ///
4978 /// # Example
4979 /// ```ignore,no_run
4980 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4981 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4982 /// let x = CreateServiceConnectionTokenRequest::new().set_or_clear_service_connection_token(Some(ServiceConnectionToken::default()/* use setters */));
4983 /// let x = CreateServiceConnectionTokenRequest::new().set_or_clear_service_connection_token(None::<ServiceConnectionToken>);
4984 /// ```
4985 pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
4986 where
4987 T: std::convert::Into<crate::model::ServiceConnectionToken>,
4988 {
4989 self.service_connection_token = v.map(|x| x.into());
4990 self
4991 }
4992
4993 /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
4994 ///
4995 /// # Example
4996 /// ```ignore,no_run
4997 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
4998 /// let x = CreateServiceConnectionTokenRequest::new().set_request_id("example");
4999 /// ```
5000 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5001 self.request_id = v.into();
5002 self
5003 }
5004}
5005
5006impl wkt::message::Message for CreateServiceConnectionTokenRequest {
5007 fn typename() -> &'static str {
5008 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionTokenRequest"
5009 }
5010}
5011
5012/// Request for DeleteServiceConnectionToken.
5013#[derive(Clone, Default, PartialEq)]
5014#[non_exhaustive]
5015pub struct DeleteServiceConnectionTokenRequest {
5016 /// Required. The name of the ServiceConnectionToken to delete.
5017 pub name: std::string::String,
5018
5019 /// Optional. An optional request ID to identify requests. Specify a unique
5020 /// request ID so that if you must retry your request, the server will know to
5021 /// ignore the request if it has already been completed. The server will
5022 /// guarantee that for at least 60 minutes after the first request.
5023 ///
5024 /// For example, consider a situation where you make an initial request and
5025 /// the request times out. If you make the request again with the same request
5026 /// ID, the server can check if original operation with the same request ID
5027 /// was received, and if so, will ignore the second request. This prevents
5028 /// clients from accidentally creating duplicate commitments.
5029 ///
5030 /// The request ID must be a valid UUID with the exception that zero UUID is
5031 /// not supported (00000000-0000-0000-0000-000000000000).
5032 pub request_id: std::string::String,
5033
5034 /// Optional. The etag is computed by the server, and may be sent on update and
5035 /// delete requests to ensure the client has an up-to-date value before
5036 /// proceeding.
5037 pub etag: std::option::Option<std::string::String>,
5038
5039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5040}
5041
5042impl DeleteServiceConnectionTokenRequest {
5043 pub fn new() -> Self {
5044 std::default::Default::default()
5045 }
5046
5047 /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
5048 ///
5049 /// # Example
5050 /// ```ignore,no_run
5051 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5052 /// let x = DeleteServiceConnectionTokenRequest::new().set_name("example");
5053 /// ```
5054 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5055 self.name = v.into();
5056 self
5057 }
5058
5059 /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
5060 ///
5061 /// # Example
5062 /// ```ignore,no_run
5063 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5064 /// let x = DeleteServiceConnectionTokenRequest::new().set_request_id("example");
5065 /// ```
5066 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5067 self.request_id = v.into();
5068 self
5069 }
5070
5071 /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
5072 ///
5073 /// # Example
5074 /// ```ignore,no_run
5075 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5076 /// let x = DeleteServiceConnectionTokenRequest::new().set_etag("example");
5077 /// ```
5078 pub fn set_etag<T>(mut self, v: T) -> Self
5079 where
5080 T: std::convert::Into<std::string::String>,
5081 {
5082 self.etag = std::option::Option::Some(v.into());
5083 self
5084 }
5085
5086 /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
5087 ///
5088 /// # Example
5089 /// ```ignore,no_run
5090 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5091 /// let x = DeleteServiceConnectionTokenRequest::new().set_or_clear_etag(Some("example"));
5092 /// let x = DeleteServiceConnectionTokenRequest::new().set_or_clear_etag(None::<String>);
5093 /// ```
5094 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
5095 where
5096 T: std::convert::Into<std::string::String>,
5097 {
5098 self.etag = v.map(|x| x.into());
5099 self
5100 }
5101}
5102
5103impl wkt::message::Message for DeleteServiceConnectionTokenRequest {
5104 fn typename() -> &'static str {
5105 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionTokenRequest"
5106 }
5107}
5108
5109/// The `MulticloudDataTransferConfig` resource. It lists the services that you
5110/// configure for Data Transfer Essentials billing and metering.
5111#[derive(Clone, Default, PartialEq)]
5112#[non_exhaustive]
5113pub struct MulticloudDataTransferConfig {
5114 /// Identifier. The name of the `MulticloudDataTransferConfig` resource.
5115 /// Format:
5116 /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}`.
5117 pub name: std::string::String,
5118
5119 /// Output only. Time when the `MulticloudDataTransferConfig` resource was
5120 /// created.
5121 pub create_time: std::option::Option<wkt::Timestamp>,
5122
5123 /// Output only. Time when the `MulticloudDataTransferConfig` resource was
5124 /// updated.
5125 pub update_time: std::option::Option<wkt::Timestamp>,
5126
5127 /// Optional. User-defined labels.
5128 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5129
5130 /// The etag is computed by the server, and might be sent with update and
5131 /// delete requests so that the client has an up-to-date value before
5132 /// proceeding.
5133 pub etag: std::string::String,
5134
5135 /// Optional. A description of this resource.
5136 pub description: std::string::String,
5137
5138 /// Output only. The number of `Destination` resources configured for the
5139 /// `MulticloudDataTransferConfig` resource.
5140 pub destinations_count: i32,
5141
5142 /// Output only. The number of `Destination` resources in use with the
5143 /// `MulticloudDataTransferConfig` resource.
5144 pub destinations_active_count: i32,
5145
5146 /// Optional. Maps services to their current or planned states. Service names
5147 /// are keys, and the associated values describe the state of the service. If a
5148 /// state change is expected, the value is either `ADDING` or `DELETING`,
5149 /// depending on the actions taken.
5150 ///
5151 /// Sample output:
5152 /// "services": {
5153 /// "big-query": {
5154 /// "states": [
5155 /// {
5156 /// "effectiveTime": "2024-12-12T08:00:00Z"
5157 /// "state": "ADDING",
5158 /// },
5159 /// ]
5160 /// },
5161 /// "cloud-storage": {
5162 /// "states": [
5163 /// {
5164 /// "state": "ACTIVE",
5165 /// }
5166 /// ]
5167 /// }
5168 /// }
5169 pub services: std::collections::HashMap<std::string::String, crate::model::StateTimeline>,
5170
5171 /// Output only. The Google-generated unique ID for the
5172 /// `MulticloudDataTransferConfig` resource. This value is unique across all
5173 /// `MulticloudDataTransferConfig` resources. If a resource is deleted and
5174 /// another with the same name is created, the new resource is assigned a
5175 /// different and unique ID.
5176 pub uid: std::string::String,
5177
5178 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5179}
5180
5181impl MulticloudDataTransferConfig {
5182 pub fn new() -> Self {
5183 std::default::Default::default()
5184 }
5185
5186 /// Sets the value of [name][crate::model::MulticloudDataTransferConfig::name].
5187 ///
5188 /// # Example
5189 /// ```ignore,no_run
5190 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5191 /// let x = MulticloudDataTransferConfig::new().set_name("example");
5192 /// ```
5193 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5194 self.name = v.into();
5195 self
5196 }
5197
5198 /// Sets the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
5199 ///
5200 /// # Example
5201 /// ```ignore,no_run
5202 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5203 /// use wkt::Timestamp;
5204 /// let x = MulticloudDataTransferConfig::new().set_create_time(Timestamp::default()/* use setters */);
5205 /// ```
5206 pub fn set_create_time<T>(mut self, v: T) -> Self
5207 where
5208 T: std::convert::Into<wkt::Timestamp>,
5209 {
5210 self.create_time = std::option::Option::Some(v.into());
5211 self
5212 }
5213
5214 /// Sets or clears the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
5215 ///
5216 /// # Example
5217 /// ```ignore,no_run
5218 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5219 /// use wkt::Timestamp;
5220 /// let x = MulticloudDataTransferConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5221 /// let x = MulticloudDataTransferConfig::new().set_or_clear_create_time(None::<Timestamp>);
5222 /// ```
5223 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5224 where
5225 T: std::convert::Into<wkt::Timestamp>,
5226 {
5227 self.create_time = v.map(|x| x.into());
5228 self
5229 }
5230
5231 /// Sets the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
5232 ///
5233 /// # Example
5234 /// ```ignore,no_run
5235 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5236 /// use wkt::Timestamp;
5237 /// let x = MulticloudDataTransferConfig::new().set_update_time(Timestamp::default()/* use setters */);
5238 /// ```
5239 pub fn set_update_time<T>(mut self, v: T) -> Self
5240 where
5241 T: std::convert::Into<wkt::Timestamp>,
5242 {
5243 self.update_time = std::option::Option::Some(v.into());
5244 self
5245 }
5246
5247 /// Sets or clears the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
5248 ///
5249 /// # Example
5250 /// ```ignore,no_run
5251 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5252 /// use wkt::Timestamp;
5253 /// let x = MulticloudDataTransferConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5254 /// let x = MulticloudDataTransferConfig::new().set_or_clear_update_time(None::<Timestamp>);
5255 /// ```
5256 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5257 where
5258 T: std::convert::Into<wkt::Timestamp>,
5259 {
5260 self.update_time = v.map(|x| x.into());
5261 self
5262 }
5263
5264 /// Sets the value of [labels][crate::model::MulticloudDataTransferConfig::labels].
5265 ///
5266 /// # Example
5267 /// ```ignore,no_run
5268 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5269 /// let x = MulticloudDataTransferConfig::new().set_labels([
5270 /// ("key0", "abc"),
5271 /// ("key1", "xyz"),
5272 /// ]);
5273 /// ```
5274 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5275 where
5276 T: std::iter::IntoIterator<Item = (K, V)>,
5277 K: std::convert::Into<std::string::String>,
5278 V: std::convert::Into<std::string::String>,
5279 {
5280 use std::iter::Iterator;
5281 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5282 self
5283 }
5284
5285 /// Sets the value of [etag][crate::model::MulticloudDataTransferConfig::etag].
5286 ///
5287 /// # Example
5288 /// ```ignore,no_run
5289 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5290 /// let x = MulticloudDataTransferConfig::new().set_etag("example");
5291 /// ```
5292 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5293 self.etag = v.into();
5294 self
5295 }
5296
5297 /// Sets the value of [description][crate::model::MulticloudDataTransferConfig::description].
5298 ///
5299 /// # Example
5300 /// ```ignore,no_run
5301 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5302 /// let x = MulticloudDataTransferConfig::new().set_description("example");
5303 /// ```
5304 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5305 self.description = v.into();
5306 self
5307 }
5308
5309 /// Sets the value of [destinations_count][crate::model::MulticloudDataTransferConfig::destinations_count].
5310 ///
5311 /// # Example
5312 /// ```ignore,no_run
5313 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5314 /// let x = MulticloudDataTransferConfig::new().set_destinations_count(42);
5315 /// ```
5316 pub fn set_destinations_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5317 self.destinations_count = v.into();
5318 self
5319 }
5320
5321 /// Sets the value of [destinations_active_count][crate::model::MulticloudDataTransferConfig::destinations_active_count].
5322 ///
5323 /// # Example
5324 /// ```ignore,no_run
5325 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5326 /// let x = MulticloudDataTransferConfig::new().set_destinations_active_count(42);
5327 /// ```
5328 pub fn set_destinations_active_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5329 self.destinations_active_count = v.into();
5330 self
5331 }
5332
5333 /// Sets the value of [services][crate::model::MulticloudDataTransferConfig::services].
5334 ///
5335 /// # Example
5336 /// ```ignore,no_run
5337 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5338 /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
5339 /// let x = MulticloudDataTransferConfig::new().set_services([
5340 /// ("key0", StateTimeline::default()/* use setters */),
5341 /// ("key1", StateTimeline::default()/* use (different) setters */),
5342 /// ]);
5343 /// ```
5344 pub fn set_services<T, K, V>(mut self, v: T) -> Self
5345 where
5346 T: std::iter::IntoIterator<Item = (K, V)>,
5347 K: std::convert::Into<std::string::String>,
5348 V: std::convert::Into<crate::model::StateTimeline>,
5349 {
5350 use std::iter::Iterator;
5351 self.services = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5352 self
5353 }
5354
5355 /// Sets the value of [uid][crate::model::MulticloudDataTransferConfig::uid].
5356 ///
5357 /// # Example
5358 /// ```ignore,no_run
5359 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5360 /// let x = MulticloudDataTransferConfig::new().set_uid("example");
5361 /// ```
5362 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5363 self.uid = v.into();
5364 self
5365 }
5366}
5367
5368impl wkt::message::Message for MulticloudDataTransferConfig {
5369 fn typename() -> &'static str {
5370 "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferConfig"
5371 }
5372}
5373
5374/// Request message to list `MulticloudDataTransferConfig` resources.
5375#[derive(Clone, Default, PartialEq)]
5376#[non_exhaustive]
5377pub struct ListMulticloudDataTransferConfigsRequest {
5378 /// Required. The name of the parent resource.
5379 pub parent: std::string::String,
5380
5381 /// Optional. The maximum number of results listed per page.
5382 pub page_size: i32,
5383
5384 /// Optional. The page token.
5385 pub page_token: std::string::String,
5386
5387 /// Optional. An expression that filters the results listed in the response.
5388 pub filter: std::string::String,
5389
5390 /// Optional. The sort order of the results.
5391 pub order_by: std::string::String,
5392
5393 /// Optional. If `true`, allows partial responses for multi-regional aggregated
5394 /// list requests.
5395 pub return_partial_success: bool,
5396
5397 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5398}
5399
5400impl ListMulticloudDataTransferConfigsRequest {
5401 pub fn new() -> Self {
5402 std::default::Default::default()
5403 }
5404
5405 /// Sets the value of [parent][crate::model::ListMulticloudDataTransferConfigsRequest::parent].
5406 ///
5407 /// # Example
5408 /// ```ignore,no_run
5409 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5410 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_parent("example");
5411 /// ```
5412 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5413 self.parent = v.into();
5414 self
5415 }
5416
5417 /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferConfigsRequest::page_size].
5418 ///
5419 /// # Example
5420 /// ```ignore,no_run
5421 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5422 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_page_size(42);
5423 /// ```
5424 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5425 self.page_size = v.into();
5426 self
5427 }
5428
5429 /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferConfigsRequest::page_token].
5430 ///
5431 /// # Example
5432 /// ```ignore,no_run
5433 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5434 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_page_token("example");
5435 /// ```
5436 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5437 self.page_token = v.into();
5438 self
5439 }
5440
5441 /// Sets the value of [filter][crate::model::ListMulticloudDataTransferConfigsRequest::filter].
5442 ///
5443 /// # Example
5444 /// ```ignore,no_run
5445 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5446 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_filter("example");
5447 /// ```
5448 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5449 self.filter = v.into();
5450 self
5451 }
5452
5453 /// Sets the value of [order_by][crate::model::ListMulticloudDataTransferConfigsRequest::order_by].
5454 ///
5455 /// # Example
5456 /// ```ignore,no_run
5457 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5458 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_order_by("example");
5459 /// ```
5460 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5461 self.order_by = v.into();
5462 self
5463 }
5464
5465 /// Sets the value of [return_partial_success][crate::model::ListMulticloudDataTransferConfigsRequest::return_partial_success].
5466 ///
5467 /// # Example
5468 /// ```ignore,no_run
5469 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5470 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_return_partial_success(true);
5471 /// ```
5472 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5473 self.return_partial_success = v.into();
5474 self
5475 }
5476}
5477
5478impl wkt::message::Message for ListMulticloudDataTransferConfigsRequest {
5479 fn typename() -> &'static str {
5480 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsRequest"
5481 }
5482}
5483
5484/// Response message to list `MulticloudDataTransferConfig` resources.
5485#[derive(Clone, Default, PartialEq)]
5486#[non_exhaustive]
5487pub struct ListMulticloudDataTransferConfigsResponse {
5488 /// The list of `MulticloudDataTransferConfig` resources to be listed.
5489 pub multicloud_data_transfer_configs: std::vec::Vec<crate::model::MulticloudDataTransferConfig>,
5490
5491 /// The next page token.
5492 pub next_page_token: std::string::String,
5493
5494 /// Locations that could not be reached.
5495 pub unreachable: std::vec::Vec<std::string::String>,
5496
5497 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5498}
5499
5500impl ListMulticloudDataTransferConfigsResponse {
5501 pub fn new() -> Self {
5502 std::default::Default::default()
5503 }
5504
5505 /// Sets the value of [multicloud_data_transfer_configs][crate::model::ListMulticloudDataTransferConfigsResponse::multicloud_data_transfer_configs].
5506 ///
5507 /// # Example
5508 /// ```ignore,no_run
5509 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5510 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5511 /// let x = ListMulticloudDataTransferConfigsResponse::new()
5512 /// .set_multicloud_data_transfer_configs([
5513 /// MulticloudDataTransferConfig::default()/* use setters */,
5514 /// MulticloudDataTransferConfig::default()/* use (different) setters */,
5515 /// ]);
5516 /// ```
5517 pub fn set_multicloud_data_transfer_configs<T, V>(mut self, v: T) -> Self
5518 where
5519 T: std::iter::IntoIterator<Item = V>,
5520 V: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5521 {
5522 use std::iter::Iterator;
5523 self.multicloud_data_transfer_configs = v.into_iter().map(|i| i.into()).collect();
5524 self
5525 }
5526
5527 /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferConfigsResponse::next_page_token].
5528 ///
5529 /// # Example
5530 /// ```ignore,no_run
5531 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5532 /// let x = ListMulticloudDataTransferConfigsResponse::new().set_next_page_token("example");
5533 /// ```
5534 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5535 self.next_page_token = v.into();
5536 self
5537 }
5538
5539 /// Sets the value of [unreachable][crate::model::ListMulticloudDataTransferConfigsResponse::unreachable].
5540 ///
5541 /// # Example
5542 /// ```ignore,no_run
5543 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5544 /// let x = ListMulticloudDataTransferConfigsResponse::new().set_unreachable(["a", "b", "c"]);
5545 /// ```
5546 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5547 where
5548 T: std::iter::IntoIterator<Item = V>,
5549 V: std::convert::Into<std::string::String>,
5550 {
5551 use std::iter::Iterator;
5552 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5553 self
5554 }
5555}
5556
5557impl wkt::message::Message for ListMulticloudDataTransferConfigsResponse {
5558 fn typename() -> &'static str {
5559 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsResponse"
5560 }
5561}
5562
5563#[doc(hidden)]
5564impl google_cloud_gax::paginator::internal::PageableResponse
5565 for ListMulticloudDataTransferConfigsResponse
5566{
5567 type PageItem = crate::model::MulticloudDataTransferConfig;
5568
5569 fn items(self) -> std::vec::Vec<Self::PageItem> {
5570 self.multicloud_data_transfer_configs
5571 }
5572
5573 fn next_page_token(&self) -> std::string::String {
5574 use std::clone::Clone;
5575 self.next_page_token.clone()
5576 }
5577}
5578
5579/// Request message to get the details of a `MulticloudDataTransferConfig`
5580/// resource.
5581#[derive(Clone, Default, PartialEq)]
5582#[non_exhaustive]
5583pub struct GetMulticloudDataTransferConfigRequest {
5584 /// Required. The name of the `MulticloudDataTransferConfig` resource to get.
5585 pub name: std::string::String,
5586
5587 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5588}
5589
5590impl GetMulticloudDataTransferConfigRequest {
5591 pub fn new() -> Self {
5592 std::default::Default::default()
5593 }
5594
5595 /// Sets the value of [name][crate::model::GetMulticloudDataTransferConfigRequest::name].
5596 ///
5597 /// # Example
5598 /// ```ignore,no_run
5599 /// # use google_cloud_networkconnectivity_v1::model::GetMulticloudDataTransferConfigRequest;
5600 /// let x = GetMulticloudDataTransferConfigRequest::new().set_name("example");
5601 /// ```
5602 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5603 self.name = v.into();
5604 self
5605 }
5606}
5607
5608impl wkt::message::Message for GetMulticloudDataTransferConfigRequest {
5609 fn typename() -> &'static str {
5610 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferConfigRequest"
5611 }
5612}
5613
5614/// Request message to create a `MulticloudDataTransferConfig` resource.
5615#[derive(Clone, Default, PartialEq)]
5616#[non_exhaustive]
5617pub struct CreateMulticloudDataTransferConfigRequest {
5618 /// Required. The name of the parent resource.
5619 pub parent: std::string::String,
5620
5621 /// Required. The ID to use for the `MulticloudDataTransferConfig` resource,
5622 /// which becomes the final component of the `MulticloudDataTransferConfig`
5623 /// resource name.
5624 pub multicloud_data_transfer_config_id: std::string::String,
5625
5626 /// Required. The `MulticloudDataTransferConfig` resource to create.
5627 pub multicloud_data_transfer_config:
5628 std::option::Option<crate::model::MulticloudDataTransferConfig>,
5629
5630 /// Optional. A request ID to identify requests. Specify a unique request ID
5631 /// so that if you must retry your request, the server can ignore
5632 /// the request if it has already been completed. The server waits
5633 /// for at least 60 minutes since the first request.
5634 ///
5635 /// For example, consider a situation where you make an initial request and
5636 /// the request times out. If you make the request again with the same request
5637 /// ID, the server can check if original operation with the same request ID
5638 /// was received, and if so, can ignore the second request. This prevents
5639 /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5640 /// resources.
5641 ///
5642 /// The request ID must be a valid UUID with the exception that zero UUID
5643 /// (00000000-0000-0000-0000-000000000000) isn't supported.
5644 pub request_id: std::string::String,
5645
5646 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5647}
5648
5649impl CreateMulticloudDataTransferConfigRequest {
5650 pub fn new() -> Self {
5651 std::default::Default::default()
5652 }
5653
5654 /// Sets the value of [parent][crate::model::CreateMulticloudDataTransferConfigRequest::parent].
5655 ///
5656 /// # Example
5657 /// ```ignore,no_run
5658 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5659 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_parent("example");
5660 /// ```
5661 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5662 self.parent = v.into();
5663 self
5664 }
5665
5666 /// Sets the value of [multicloud_data_transfer_config_id][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config_id].
5667 ///
5668 /// # Example
5669 /// ```ignore,no_run
5670 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5671 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config_id("example");
5672 /// ```
5673 pub fn set_multicloud_data_transfer_config_id<T: std::convert::Into<std::string::String>>(
5674 mut self,
5675 v: T,
5676 ) -> Self {
5677 self.multicloud_data_transfer_config_id = v.into();
5678 self
5679 }
5680
5681 /// Sets the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5682 ///
5683 /// # Example
5684 /// ```ignore,no_run
5685 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5686 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5687 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config(MulticloudDataTransferConfig::default()/* use setters */);
5688 /// ```
5689 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
5690 where
5691 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5692 {
5693 self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
5694 self
5695 }
5696
5697 /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5698 ///
5699 /// # Example
5700 /// ```ignore,no_run
5701 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5702 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5703 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(Some(MulticloudDataTransferConfig::default()/* use setters */));
5704 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(None::<MulticloudDataTransferConfig>);
5705 /// ```
5706 pub fn set_or_clear_multicloud_data_transfer_config<T>(
5707 mut self,
5708 v: std::option::Option<T>,
5709 ) -> Self
5710 where
5711 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5712 {
5713 self.multicloud_data_transfer_config = v.map(|x| x.into());
5714 self
5715 }
5716
5717 /// Sets the value of [request_id][crate::model::CreateMulticloudDataTransferConfigRequest::request_id].
5718 ///
5719 /// # Example
5720 /// ```ignore,no_run
5721 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5722 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_request_id("example");
5723 /// ```
5724 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5725 self.request_id = v.into();
5726 self
5727 }
5728}
5729
5730impl wkt::message::Message for CreateMulticloudDataTransferConfigRequest {
5731 fn typename() -> &'static str {
5732 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateMulticloudDataTransferConfigRequest"
5733 }
5734}
5735
5736/// Request message to update a `MulticloudDataTransferConfig` resource.
5737#[derive(Clone, Default, PartialEq)]
5738#[non_exhaustive]
5739pub struct UpdateMulticloudDataTransferConfigRequest {
5740 /// Optional. `FieldMask` is used to specify the fields in the
5741 /// `MulticloudDataTransferConfig` resource to be overwritten by the update.
5742 /// The fields specified in `update_mask` are relative to the resource, not
5743 /// the full request. A field is overwritten if it is in the mask. If you
5744 /// don't specify a mask, all fields are overwritten.
5745 pub update_mask: std::option::Option<wkt::FieldMask>,
5746
5747 /// Required. The `MulticloudDataTransferConfig` resource to update.
5748 pub multicloud_data_transfer_config:
5749 std::option::Option<crate::model::MulticloudDataTransferConfig>,
5750
5751 /// Optional. A request ID to identify requests. Specify a unique request ID
5752 /// so that if you must retry your request, the server can ignore
5753 /// the request if it has already been completed. The server waits
5754 /// for at least 60 minutes since the first request.
5755 ///
5756 /// For example, consider a situation where you make an initial request and
5757 /// the request times out. If you make the request again with the same request
5758 /// ID, the server can check if original operation with the same request ID
5759 /// was received, and if so, can ignore the second request. This prevents
5760 /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5761 /// resources.
5762 ///
5763 /// The request ID must be a valid UUID with the exception that zero UUID
5764 /// (00000000-0000-0000-0000-000000000000) isn't supported.
5765 pub request_id: std::string::String,
5766
5767 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5768}
5769
5770impl UpdateMulticloudDataTransferConfigRequest {
5771 pub fn new() -> Self {
5772 std::default::Default::default()
5773 }
5774
5775 /// Sets the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
5776 ///
5777 /// # Example
5778 /// ```ignore,no_run
5779 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5780 /// use wkt::FieldMask;
5781 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5782 /// ```
5783 pub fn set_update_mask<T>(mut self, v: T) -> Self
5784 where
5785 T: std::convert::Into<wkt::FieldMask>,
5786 {
5787 self.update_mask = std::option::Option::Some(v.into());
5788 self
5789 }
5790
5791 /// Sets or clears the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
5792 ///
5793 /// # Example
5794 /// ```ignore,no_run
5795 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5796 /// use wkt::FieldMask;
5797 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5798 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5799 /// ```
5800 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5801 where
5802 T: std::convert::Into<wkt::FieldMask>,
5803 {
5804 self.update_mask = v.map(|x| x.into());
5805 self
5806 }
5807
5808 /// Sets the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5809 ///
5810 /// # Example
5811 /// ```ignore,no_run
5812 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5813 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5814 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config(MulticloudDataTransferConfig::default()/* use setters */);
5815 /// ```
5816 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
5817 where
5818 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5819 {
5820 self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
5821 self
5822 }
5823
5824 /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5825 ///
5826 /// # Example
5827 /// ```ignore,no_run
5828 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5829 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5830 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(Some(MulticloudDataTransferConfig::default()/* use setters */));
5831 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(None::<MulticloudDataTransferConfig>);
5832 /// ```
5833 pub fn set_or_clear_multicloud_data_transfer_config<T>(
5834 mut self,
5835 v: std::option::Option<T>,
5836 ) -> Self
5837 where
5838 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5839 {
5840 self.multicloud_data_transfer_config = v.map(|x| x.into());
5841 self
5842 }
5843
5844 /// Sets the value of [request_id][crate::model::UpdateMulticloudDataTransferConfigRequest::request_id].
5845 ///
5846 /// # Example
5847 /// ```ignore,no_run
5848 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5849 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_request_id("example");
5850 /// ```
5851 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5852 self.request_id = v.into();
5853 self
5854 }
5855}
5856
5857impl wkt::message::Message for UpdateMulticloudDataTransferConfigRequest {
5858 fn typename() -> &'static str {
5859 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateMulticloudDataTransferConfigRequest"
5860 }
5861}
5862
5863/// Request message to delete a `MulticloudDataTransferConfig` resource.
5864#[derive(Clone, Default, PartialEq)]
5865#[non_exhaustive]
5866pub struct DeleteMulticloudDataTransferConfigRequest {
5867 /// Required. The name of the `MulticloudDataTransferConfig` resource to
5868 /// delete.
5869 pub name: std::string::String,
5870
5871 /// Optional. A request ID to identify requests. Specify a unique request ID
5872 /// so that if you must retry your request, the server can ignore
5873 /// the request if it has already been completed. The server waits
5874 /// for at least 60 minutes since the first request.
5875 ///
5876 /// For example, consider a situation where you make an initial request and
5877 /// the request times out. If you make the request again with the same request
5878 /// ID, the server can check if original operation with the same request ID
5879 /// was received, and if so, can ignore the second request. This prevents
5880 /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5881 /// resources.
5882 ///
5883 /// The request ID must be a valid UUID with the exception that zero UUID
5884 /// (00000000-0000-0000-0000-000000000000) isn't supported.
5885 pub request_id: std::string::String,
5886
5887 /// Optional. The etag is computed by the server, and might be sent with update
5888 /// and delete requests so that the client has an up-to-date value before
5889 /// proceeding.
5890 pub etag: std::string::String,
5891
5892 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5893}
5894
5895impl DeleteMulticloudDataTransferConfigRequest {
5896 pub fn new() -> Self {
5897 std::default::Default::default()
5898 }
5899
5900 /// Sets the value of [name][crate::model::DeleteMulticloudDataTransferConfigRequest::name].
5901 ///
5902 /// # Example
5903 /// ```ignore,no_run
5904 /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
5905 /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_name("example");
5906 /// ```
5907 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5908 self.name = v.into();
5909 self
5910 }
5911
5912 /// Sets the value of [request_id][crate::model::DeleteMulticloudDataTransferConfigRequest::request_id].
5913 ///
5914 /// # Example
5915 /// ```ignore,no_run
5916 /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
5917 /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_request_id("example");
5918 /// ```
5919 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5920 self.request_id = v.into();
5921 self
5922 }
5923
5924 /// Sets the value of [etag][crate::model::DeleteMulticloudDataTransferConfigRequest::etag].
5925 ///
5926 /// # Example
5927 /// ```ignore,no_run
5928 /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
5929 /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_etag("example");
5930 /// ```
5931 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5932 self.etag = v.into();
5933 self
5934 }
5935}
5936
5937impl wkt::message::Message for DeleteMulticloudDataTransferConfigRequest {
5938 fn typename() -> &'static str {
5939 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteMulticloudDataTransferConfigRequest"
5940 }
5941}
5942
5943/// The `Destination` resource. It specifies the IP prefix and the associated
5944/// autonomous system numbers (ASN) that you want to include in a
5945/// `MulticloudDataTransferConfig` resource.
5946#[derive(Clone, Default, PartialEq)]
5947#[non_exhaustive]
5948pub struct Destination {
5949 /// Identifier. The name of the `Destination` resource.
5950 /// Format:
5951 /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}/destinations/{destination}`.
5952 pub name: std::string::String,
5953
5954 /// Output only. Time when the `Destination` resource was created.
5955 pub create_time: std::option::Option<wkt::Timestamp>,
5956
5957 /// Output only. Time when the `Destination` resource was updated.
5958 pub update_time: std::option::Option<wkt::Timestamp>,
5959
5960 /// Optional. User-defined labels.
5961 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5962
5963 /// The etag is computed by the server, and might be sent with update and
5964 /// delete requests so that the client has an up-to-date value before
5965 /// proceeding.
5966 pub etag: std::string::String,
5967
5968 /// Optional. A description of this resource.
5969 pub description: std::string::String,
5970
5971 /// Required. Immutable. The IP prefix that represents your workload on another
5972 /// CSP.
5973 pub ip_prefix: std::string::String,
5974
5975 /// Required. Unordered list. The list of `DestinationEndpoint` resources
5976 /// configured for the IP prefix.
5977 pub endpoints: std::vec::Vec<crate::model::destination::DestinationEndpoint>,
5978
5979 /// Output only. The timeline of the expected `Destination` states or the
5980 /// current rest state. If a state change is expected, the value is `ADDING`,
5981 /// `DELETING` or `SUSPENDING`, depending on the action specified.
5982 ///
5983 /// Example:
5984 /// "state_timeline": {
5985 /// "states": [
5986 /// {
5987 /// // The time when the `Destination` resource will be activated.
5988 /// "effectiveTime": "2024-12-01T08:00:00Z",
5989 /// "state": "ADDING"
5990 /// },
5991 /// {
5992 /// // The time when the `Destination` resource will be suspended.
5993 /// "effectiveTime": "2024-12-01T20:00:00Z",
5994 /// "state": "SUSPENDING"
5995 /// }
5996 /// ]
5997 /// }
5998 pub state_timeline: std::option::Option<crate::model::StateTimeline>,
5999
6000 /// Output only. The Google-generated unique ID for the `Destination` resource.
6001 /// This value is unique across all `Destination` resources.
6002 /// If a resource is deleted and another with the same name is
6003 /// created, the new resource is assigned a different and unique ID.
6004 pub uid: std::string::String,
6005
6006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6007}
6008
6009impl Destination {
6010 pub fn new() -> Self {
6011 std::default::Default::default()
6012 }
6013
6014 /// Sets the value of [name][crate::model::Destination::name].
6015 ///
6016 /// # Example
6017 /// ```ignore,no_run
6018 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6019 /// let x = Destination::new().set_name("example");
6020 /// ```
6021 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6022 self.name = v.into();
6023 self
6024 }
6025
6026 /// Sets the value of [create_time][crate::model::Destination::create_time].
6027 ///
6028 /// # Example
6029 /// ```ignore,no_run
6030 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6031 /// use wkt::Timestamp;
6032 /// let x = Destination::new().set_create_time(Timestamp::default()/* use setters */);
6033 /// ```
6034 pub fn set_create_time<T>(mut self, v: T) -> Self
6035 where
6036 T: std::convert::Into<wkt::Timestamp>,
6037 {
6038 self.create_time = std::option::Option::Some(v.into());
6039 self
6040 }
6041
6042 /// Sets or clears the value of [create_time][crate::model::Destination::create_time].
6043 ///
6044 /// # Example
6045 /// ```ignore,no_run
6046 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6047 /// use wkt::Timestamp;
6048 /// let x = Destination::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6049 /// let x = Destination::new().set_or_clear_create_time(None::<Timestamp>);
6050 /// ```
6051 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6052 where
6053 T: std::convert::Into<wkt::Timestamp>,
6054 {
6055 self.create_time = v.map(|x| x.into());
6056 self
6057 }
6058
6059 /// Sets the value of [update_time][crate::model::Destination::update_time].
6060 ///
6061 /// # Example
6062 /// ```ignore,no_run
6063 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6064 /// use wkt::Timestamp;
6065 /// let x = Destination::new().set_update_time(Timestamp::default()/* use setters */);
6066 /// ```
6067 pub fn set_update_time<T>(mut self, v: T) -> Self
6068 where
6069 T: std::convert::Into<wkt::Timestamp>,
6070 {
6071 self.update_time = std::option::Option::Some(v.into());
6072 self
6073 }
6074
6075 /// Sets or clears the value of [update_time][crate::model::Destination::update_time].
6076 ///
6077 /// # Example
6078 /// ```ignore,no_run
6079 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6080 /// use wkt::Timestamp;
6081 /// let x = Destination::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6082 /// let x = Destination::new().set_or_clear_update_time(None::<Timestamp>);
6083 /// ```
6084 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6085 where
6086 T: std::convert::Into<wkt::Timestamp>,
6087 {
6088 self.update_time = v.map(|x| x.into());
6089 self
6090 }
6091
6092 /// Sets the value of [labels][crate::model::Destination::labels].
6093 ///
6094 /// # Example
6095 /// ```ignore,no_run
6096 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6097 /// let x = Destination::new().set_labels([
6098 /// ("key0", "abc"),
6099 /// ("key1", "xyz"),
6100 /// ]);
6101 /// ```
6102 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6103 where
6104 T: std::iter::IntoIterator<Item = (K, V)>,
6105 K: std::convert::Into<std::string::String>,
6106 V: std::convert::Into<std::string::String>,
6107 {
6108 use std::iter::Iterator;
6109 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6110 self
6111 }
6112
6113 /// Sets the value of [etag][crate::model::Destination::etag].
6114 ///
6115 /// # Example
6116 /// ```ignore,no_run
6117 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6118 /// let x = Destination::new().set_etag("example");
6119 /// ```
6120 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6121 self.etag = v.into();
6122 self
6123 }
6124
6125 /// Sets the value of [description][crate::model::Destination::description].
6126 ///
6127 /// # Example
6128 /// ```ignore,no_run
6129 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6130 /// let x = Destination::new().set_description("example");
6131 /// ```
6132 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6133 self.description = v.into();
6134 self
6135 }
6136
6137 /// Sets the value of [ip_prefix][crate::model::Destination::ip_prefix].
6138 ///
6139 /// # Example
6140 /// ```ignore,no_run
6141 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6142 /// let x = Destination::new().set_ip_prefix("example");
6143 /// ```
6144 pub fn set_ip_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6145 self.ip_prefix = v.into();
6146 self
6147 }
6148
6149 /// Sets the value of [endpoints][crate::model::Destination::endpoints].
6150 ///
6151 /// # Example
6152 /// ```ignore,no_run
6153 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6154 /// use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6155 /// let x = Destination::new()
6156 /// .set_endpoints([
6157 /// DestinationEndpoint::default()/* use setters */,
6158 /// DestinationEndpoint::default()/* use (different) setters */,
6159 /// ]);
6160 /// ```
6161 pub fn set_endpoints<T, V>(mut self, v: T) -> Self
6162 where
6163 T: std::iter::IntoIterator<Item = V>,
6164 V: std::convert::Into<crate::model::destination::DestinationEndpoint>,
6165 {
6166 use std::iter::Iterator;
6167 self.endpoints = v.into_iter().map(|i| i.into()).collect();
6168 self
6169 }
6170
6171 /// Sets the value of [state_timeline][crate::model::Destination::state_timeline].
6172 ///
6173 /// # Example
6174 /// ```ignore,no_run
6175 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6176 /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
6177 /// let x = Destination::new().set_state_timeline(StateTimeline::default()/* use setters */);
6178 /// ```
6179 pub fn set_state_timeline<T>(mut self, v: T) -> Self
6180 where
6181 T: std::convert::Into<crate::model::StateTimeline>,
6182 {
6183 self.state_timeline = std::option::Option::Some(v.into());
6184 self
6185 }
6186
6187 /// Sets or clears the value of [state_timeline][crate::model::Destination::state_timeline].
6188 ///
6189 /// # Example
6190 /// ```ignore,no_run
6191 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6192 /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
6193 /// let x = Destination::new().set_or_clear_state_timeline(Some(StateTimeline::default()/* use setters */));
6194 /// let x = Destination::new().set_or_clear_state_timeline(None::<StateTimeline>);
6195 /// ```
6196 pub fn set_or_clear_state_timeline<T>(mut self, v: std::option::Option<T>) -> Self
6197 where
6198 T: std::convert::Into<crate::model::StateTimeline>,
6199 {
6200 self.state_timeline = v.map(|x| x.into());
6201 self
6202 }
6203
6204 /// Sets the value of [uid][crate::model::Destination::uid].
6205 ///
6206 /// # Example
6207 /// ```ignore,no_run
6208 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6209 /// let x = Destination::new().set_uid("example");
6210 /// ```
6211 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6212 self.uid = v.into();
6213 self
6214 }
6215}
6216
6217impl wkt::message::Message for Destination {
6218 fn typename() -> &'static str {
6219 "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination"
6220 }
6221}
6222
6223/// Defines additional types related to [Destination].
6224pub mod destination {
6225 #[allow(unused_imports)]
6226 use super::*;
6227
6228 /// The metadata for a `DestinationEndpoint` resource.
6229 #[derive(Clone, Default, PartialEq)]
6230 #[non_exhaustive]
6231 pub struct DestinationEndpoint {
6232 /// Required. The ASN of the remote IP prefix.
6233 pub asn: i64,
6234
6235 /// Required. The CSP of the remote IP prefix.
6236 pub csp: std::string::String,
6237
6238 /// Output only. The state of the `DestinationEndpoint` resource.
6239 pub state: crate::model::destination::destination_endpoint::State,
6240
6241 /// Output only. Time when the `DestinationEndpoint` resource was updated.
6242 pub update_time: std::option::Option<wkt::Timestamp>,
6243
6244 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6245 }
6246
6247 impl DestinationEndpoint {
6248 pub fn new() -> Self {
6249 std::default::Default::default()
6250 }
6251
6252 /// Sets the value of [asn][crate::model::destination::DestinationEndpoint::asn].
6253 ///
6254 /// # Example
6255 /// ```ignore,no_run
6256 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6257 /// let x = DestinationEndpoint::new().set_asn(42);
6258 /// ```
6259 pub fn set_asn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6260 self.asn = v.into();
6261 self
6262 }
6263
6264 /// Sets the value of [csp][crate::model::destination::DestinationEndpoint::csp].
6265 ///
6266 /// # Example
6267 /// ```ignore,no_run
6268 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6269 /// let x = DestinationEndpoint::new().set_csp("example");
6270 /// ```
6271 pub fn set_csp<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6272 self.csp = v.into();
6273 self
6274 }
6275
6276 /// Sets the value of [state][crate::model::destination::DestinationEndpoint::state].
6277 ///
6278 /// # Example
6279 /// ```ignore,no_run
6280 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6281 /// use google_cloud_networkconnectivity_v1::model::destination::destination_endpoint::State;
6282 /// let x0 = DestinationEndpoint::new().set_state(State::Valid);
6283 /// let x1 = DestinationEndpoint::new().set_state(State::Invalid);
6284 /// ```
6285 pub fn set_state<
6286 T: std::convert::Into<crate::model::destination::destination_endpoint::State>,
6287 >(
6288 mut self,
6289 v: T,
6290 ) -> Self {
6291 self.state = v.into();
6292 self
6293 }
6294
6295 /// Sets the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
6296 ///
6297 /// # Example
6298 /// ```ignore,no_run
6299 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6300 /// use wkt::Timestamp;
6301 /// let x = DestinationEndpoint::new().set_update_time(Timestamp::default()/* use setters */);
6302 /// ```
6303 pub fn set_update_time<T>(mut self, v: T) -> Self
6304 where
6305 T: std::convert::Into<wkt::Timestamp>,
6306 {
6307 self.update_time = std::option::Option::Some(v.into());
6308 self
6309 }
6310
6311 /// Sets or clears the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
6312 ///
6313 /// # Example
6314 /// ```ignore,no_run
6315 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6316 /// use wkt::Timestamp;
6317 /// let x = DestinationEndpoint::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6318 /// let x = DestinationEndpoint::new().set_or_clear_update_time(None::<Timestamp>);
6319 /// ```
6320 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6321 where
6322 T: std::convert::Into<wkt::Timestamp>,
6323 {
6324 self.update_time = v.map(|x| x.into());
6325 self
6326 }
6327 }
6328
6329 impl wkt::message::Message for DestinationEndpoint {
6330 fn typename() -> &'static str {
6331 "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint"
6332 }
6333 }
6334
6335 /// Defines additional types related to [DestinationEndpoint].
6336 pub mod destination_endpoint {
6337 #[allow(unused_imports)]
6338 use super::*;
6339
6340 /// The state of the `DestinationEndpoint` resource.
6341 ///
6342 /// # Working with unknown values
6343 ///
6344 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6345 /// additional enum variants at any time. Adding new variants is not considered
6346 /// a breaking change. Applications should write their code in anticipation of:
6347 ///
6348 /// - New values appearing in future releases of the client library, **and**
6349 /// - New values received dynamically, without application changes.
6350 ///
6351 /// Please consult the [Working with enums] section in the user guide for some
6352 /// guidelines.
6353 ///
6354 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6355 #[derive(Clone, Debug, PartialEq)]
6356 #[non_exhaustive]
6357 pub enum State {
6358 /// An invalid state, which is the default case.
6359 Unspecified,
6360 /// The `DestinationEndpoint` resource is valid.
6361 Valid,
6362 /// The `DestinationEndpoint` resource is invalid.
6363 Invalid,
6364 /// If set, the enum was initialized with an unknown value.
6365 ///
6366 /// Applications can examine the value using [State::value] or
6367 /// [State::name].
6368 UnknownValue(state::UnknownValue),
6369 }
6370
6371 #[doc(hidden)]
6372 pub mod state {
6373 #[allow(unused_imports)]
6374 use super::*;
6375 #[derive(Clone, Debug, PartialEq)]
6376 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6377 }
6378
6379 impl State {
6380 /// Gets the enum value.
6381 ///
6382 /// Returns `None` if the enum contains an unknown value deserialized from
6383 /// the string representation of enums.
6384 pub fn value(&self) -> std::option::Option<i32> {
6385 match self {
6386 Self::Unspecified => std::option::Option::Some(0),
6387 Self::Valid => std::option::Option::Some(1),
6388 Self::Invalid => std::option::Option::Some(2),
6389 Self::UnknownValue(u) => u.0.value(),
6390 }
6391 }
6392
6393 /// Gets the enum value as a string.
6394 ///
6395 /// Returns `None` if the enum contains an unknown value deserialized from
6396 /// the integer representation of enums.
6397 pub fn name(&self) -> std::option::Option<&str> {
6398 match self {
6399 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6400 Self::Valid => std::option::Option::Some("VALID"),
6401 Self::Invalid => std::option::Option::Some("INVALID"),
6402 Self::UnknownValue(u) => u.0.name(),
6403 }
6404 }
6405 }
6406
6407 impl std::default::Default for State {
6408 fn default() -> Self {
6409 use std::convert::From;
6410 Self::from(0)
6411 }
6412 }
6413
6414 impl std::fmt::Display for State {
6415 fn fmt(
6416 &self,
6417 f: &mut std::fmt::Formatter<'_>,
6418 ) -> std::result::Result<(), std::fmt::Error> {
6419 wkt::internal::display_enum(f, self.name(), self.value())
6420 }
6421 }
6422
6423 impl std::convert::From<i32> for State {
6424 fn from(value: i32) -> Self {
6425 match value {
6426 0 => Self::Unspecified,
6427 1 => Self::Valid,
6428 2 => Self::Invalid,
6429 _ => Self::UnknownValue(state::UnknownValue(
6430 wkt::internal::UnknownEnumValue::Integer(value),
6431 )),
6432 }
6433 }
6434 }
6435
6436 impl std::convert::From<&str> for State {
6437 fn from(value: &str) -> Self {
6438 use std::string::ToString;
6439 match value {
6440 "STATE_UNSPECIFIED" => Self::Unspecified,
6441 "VALID" => Self::Valid,
6442 "INVALID" => Self::Invalid,
6443 _ => Self::UnknownValue(state::UnknownValue(
6444 wkt::internal::UnknownEnumValue::String(value.to_string()),
6445 )),
6446 }
6447 }
6448 }
6449
6450 impl serde::ser::Serialize for State {
6451 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6452 where
6453 S: serde::Serializer,
6454 {
6455 match self {
6456 Self::Unspecified => serializer.serialize_i32(0),
6457 Self::Valid => serializer.serialize_i32(1),
6458 Self::Invalid => serializer.serialize_i32(2),
6459 Self::UnknownValue(u) => u.0.serialize(serializer),
6460 }
6461 }
6462 }
6463
6464 impl<'de> serde::de::Deserialize<'de> for State {
6465 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6466 where
6467 D: serde::Deserializer<'de>,
6468 {
6469 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6470 ".google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint.State",
6471 ))
6472 }
6473 }
6474 }
6475}
6476
6477/// Request message to list `Destination` resources.
6478#[derive(Clone, Default, PartialEq)]
6479#[non_exhaustive]
6480pub struct ListDestinationsRequest {
6481 /// Required. The name of the parent resource.
6482 pub parent: std::string::String,
6483
6484 /// Optional. The maximum number of results listed per page.
6485 pub page_size: i32,
6486
6487 /// Optional. The page token.
6488 pub page_token: std::string::String,
6489
6490 /// Optional. An expression that filters the results listed in the response.
6491 pub filter: std::string::String,
6492
6493 /// Optional. The sort order of the results.
6494 pub order_by: std::string::String,
6495
6496 /// Optional. If `true`, allow partial responses for multi-regional aggregated
6497 /// list requests.
6498 pub return_partial_success: bool,
6499
6500 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6501}
6502
6503impl ListDestinationsRequest {
6504 pub fn new() -> Self {
6505 std::default::Default::default()
6506 }
6507
6508 /// Sets the value of [parent][crate::model::ListDestinationsRequest::parent].
6509 ///
6510 /// # Example
6511 /// ```ignore,no_run
6512 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6513 /// let x = ListDestinationsRequest::new().set_parent("example");
6514 /// ```
6515 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6516 self.parent = v.into();
6517 self
6518 }
6519
6520 /// Sets the value of [page_size][crate::model::ListDestinationsRequest::page_size].
6521 ///
6522 /// # Example
6523 /// ```ignore,no_run
6524 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6525 /// let x = ListDestinationsRequest::new().set_page_size(42);
6526 /// ```
6527 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6528 self.page_size = v.into();
6529 self
6530 }
6531
6532 /// Sets the value of [page_token][crate::model::ListDestinationsRequest::page_token].
6533 ///
6534 /// # Example
6535 /// ```ignore,no_run
6536 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6537 /// let x = ListDestinationsRequest::new().set_page_token("example");
6538 /// ```
6539 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6540 self.page_token = v.into();
6541 self
6542 }
6543
6544 /// Sets the value of [filter][crate::model::ListDestinationsRequest::filter].
6545 ///
6546 /// # Example
6547 /// ```ignore,no_run
6548 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6549 /// let x = ListDestinationsRequest::new().set_filter("example");
6550 /// ```
6551 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6552 self.filter = v.into();
6553 self
6554 }
6555
6556 /// Sets the value of [order_by][crate::model::ListDestinationsRequest::order_by].
6557 ///
6558 /// # Example
6559 /// ```ignore,no_run
6560 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6561 /// let x = ListDestinationsRequest::new().set_order_by("example");
6562 /// ```
6563 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6564 self.order_by = v.into();
6565 self
6566 }
6567
6568 /// Sets the value of [return_partial_success][crate::model::ListDestinationsRequest::return_partial_success].
6569 ///
6570 /// # Example
6571 /// ```ignore,no_run
6572 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6573 /// let x = ListDestinationsRequest::new().set_return_partial_success(true);
6574 /// ```
6575 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6576 self.return_partial_success = v.into();
6577 self
6578 }
6579}
6580
6581impl wkt::message::Message for ListDestinationsRequest {
6582 fn typename() -> &'static str {
6583 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsRequest"
6584 }
6585}
6586
6587/// Response message to list `Destination` resources.
6588#[derive(Clone, Default, PartialEq)]
6589#[non_exhaustive]
6590pub struct ListDestinationsResponse {
6591 /// The list of `Destination` resources to be listed.
6592 pub destinations: std::vec::Vec<crate::model::Destination>,
6593
6594 /// The next page token.
6595 pub next_page_token: std::string::String,
6596
6597 /// Locations that could not be reached.
6598 pub unreachable: std::vec::Vec<std::string::String>,
6599
6600 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6601}
6602
6603impl ListDestinationsResponse {
6604 pub fn new() -> Self {
6605 std::default::Default::default()
6606 }
6607
6608 /// Sets the value of [destinations][crate::model::ListDestinationsResponse::destinations].
6609 ///
6610 /// # Example
6611 /// ```ignore,no_run
6612 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6613 /// use google_cloud_networkconnectivity_v1::model::Destination;
6614 /// let x = ListDestinationsResponse::new()
6615 /// .set_destinations([
6616 /// Destination::default()/* use setters */,
6617 /// Destination::default()/* use (different) setters */,
6618 /// ]);
6619 /// ```
6620 pub fn set_destinations<T, V>(mut self, v: T) -> Self
6621 where
6622 T: std::iter::IntoIterator<Item = V>,
6623 V: std::convert::Into<crate::model::Destination>,
6624 {
6625 use std::iter::Iterator;
6626 self.destinations = v.into_iter().map(|i| i.into()).collect();
6627 self
6628 }
6629
6630 /// Sets the value of [next_page_token][crate::model::ListDestinationsResponse::next_page_token].
6631 ///
6632 /// # Example
6633 /// ```ignore,no_run
6634 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6635 /// let x = ListDestinationsResponse::new().set_next_page_token("example");
6636 /// ```
6637 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6638 self.next_page_token = v.into();
6639 self
6640 }
6641
6642 /// Sets the value of [unreachable][crate::model::ListDestinationsResponse::unreachable].
6643 ///
6644 /// # Example
6645 /// ```ignore,no_run
6646 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6647 /// let x = ListDestinationsResponse::new().set_unreachable(["a", "b", "c"]);
6648 /// ```
6649 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6650 where
6651 T: std::iter::IntoIterator<Item = V>,
6652 V: std::convert::Into<std::string::String>,
6653 {
6654 use std::iter::Iterator;
6655 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6656 self
6657 }
6658}
6659
6660impl wkt::message::Message for ListDestinationsResponse {
6661 fn typename() -> &'static str {
6662 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsResponse"
6663 }
6664}
6665
6666#[doc(hidden)]
6667impl google_cloud_gax::paginator::internal::PageableResponse for ListDestinationsResponse {
6668 type PageItem = crate::model::Destination;
6669
6670 fn items(self) -> std::vec::Vec<Self::PageItem> {
6671 self.destinations
6672 }
6673
6674 fn next_page_token(&self) -> std::string::String {
6675 use std::clone::Clone;
6676 self.next_page_token.clone()
6677 }
6678}
6679
6680/// Request message to get the details of a `Destination` resource.
6681#[derive(Clone, Default, PartialEq)]
6682#[non_exhaustive]
6683pub struct GetDestinationRequest {
6684 /// Required. The name of the `Destination` resource to get.
6685 pub name: std::string::String,
6686
6687 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6688}
6689
6690impl GetDestinationRequest {
6691 pub fn new() -> Self {
6692 std::default::Default::default()
6693 }
6694
6695 /// Sets the value of [name][crate::model::GetDestinationRequest::name].
6696 ///
6697 /// # Example
6698 /// ```ignore,no_run
6699 /// # use google_cloud_networkconnectivity_v1::model::GetDestinationRequest;
6700 /// let x = GetDestinationRequest::new().set_name("example");
6701 /// ```
6702 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6703 self.name = v.into();
6704 self
6705 }
6706}
6707
6708impl wkt::message::Message for GetDestinationRequest {
6709 fn typename() -> &'static str {
6710 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetDestinationRequest"
6711 }
6712}
6713
6714/// Request message to create a `Destination` resource.
6715#[derive(Clone, Default, PartialEq)]
6716#[non_exhaustive]
6717pub struct CreateDestinationRequest {
6718 /// Required. The name of the parent resource.
6719 pub parent: std::string::String,
6720
6721 /// Required. The ID to use for the `Destination` resource, which becomes the
6722 /// final component of the `Destination` resource name.
6723 pub destination_id: std::string::String,
6724
6725 /// Required. The `Destination` resource to create.
6726 pub destination: std::option::Option<crate::model::Destination>,
6727
6728 /// Optional. A request ID to identify requests. Specify a unique request ID
6729 /// so that if you must retry your request, the server can ignore
6730 /// the request if it has already been completed. The server waits
6731 /// for at least 60 minutes since the first request.
6732 ///
6733 /// For example, consider a situation where you make an initial request and
6734 /// the request times out. If you make the request again with the same request
6735 /// ID, the server can check if original operation with the same request ID
6736 /// was received, and if so, can ignore the second request. This prevents
6737 /// clients from accidentally creating duplicate `Destination`
6738 /// resources.
6739 ///
6740 /// The request ID must be a valid UUID with the exception that zero UUID
6741 /// (00000000-0000-0000-0000-000000000000) isn't supported.
6742 pub request_id: std::string::String,
6743
6744 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6745}
6746
6747impl CreateDestinationRequest {
6748 pub fn new() -> Self {
6749 std::default::Default::default()
6750 }
6751
6752 /// Sets the value of [parent][crate::model::CreateDestinationRequest::parent].
6753 ///
6754 /// # Example
6755 /// ```ignore,no_run
6756 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6757 /// let x = CreateDestinationRequest::new().set_parent("example");
6758 /// ```
6759 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6760 self.parent = v.into();
6761 self
6762 }
6763
6764 /// Sets the value of [destination_id][crate::model::CreateDestinationRequest::destination_id].
6765 ///
6766 /// # Example
6767 /// ```ignore,no_run
6768 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6769 /// let x = CreateDestinationRequest::new().set_destination_id("example");
6770 /// ```
6771 pub fn set_destination_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6772 self.destination_id = v.into();
6773 self
6774 }
6775
6776 /// Sets the value of [destination][crate::model::CreateDestinationRequest::destination].
6777 ///
6778 /// # Example
6779 /// ```ignore,no_run
6780 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6781 /// use google_cloud_networkconnectivity_v1::model::Destination;
6782 /// let x = CreateDestinationRequest::new().set_destination(Destination::default()/* use setters */);
6783 /// ```
6784 pub fn set_destination<T>(mut self, v: T) -> Self
6785 where
6786 T: std::convert::Into<crate::model::Destination>,
6787 {
6788 self.destination = std::option::Option::Some(v.into());
6789 self
6790 }
6791
6792 /// Sets or clears the value of [destination][crate::model::CreateDestinationRequest::destination].
6793 ///
6794 /// # Example
6795 /// ```ignore,no_run
6796 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6797 /// use google_cloud_networkconnectivity_v1::model::Destination;
6798 /// let x = CreateDestinationRequest::new().set_or_clear_destination(Some(Destination::default()/* use setters */));
6799 /// let x = CreateDestinationRequest::new().set_or_clear_destination(None::<Destination>);
6800 /// ```
6801 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
6802 where
6803 T: std::convert::Into<crate::model::Destination>,
6804 {
6805 self.destination = v.map(|x| x.into());
6806 self
6807 }
6808
6809 /// Sets the value of [request_id][crate::model::CreateDestinationRequest::request_id].
6810 ///
6811 /// # Example
6812 /// ```ignore,no_run
6813 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6814 /// let x = CreateDestinationRequest::new().set_request_id("example");
6815 /// ```
6816 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6817 self.request_id = v.into();
6818 self
6819 }
6820}
6821
6822impl wkt::message::Message for CreateDestinationRequest {
6823 fn typename() -> &'static str {
6824 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateDestinationRequest"
6825 }
6826}
6827
6828/// Request message to update a `Destination` resource.
6829#[derive(Clone, Default, PartialEq)]
6830#[non_exhaustive]
6831pub struct UpdateDestinationRequest {
6832 /// Optional. `FieldMask is used to specify the fields to be overwritten in the
6833 /// `Destination` resource by the update.
6834 /// The fields specified in `update_mask` are relative to the resource, not
6835 /// the full request. A field is overwritten if it is in the mask. If you
6836 /// don't specify a mask, all fields are overwritten.
6837 pub update_mask: std::option::Option<wkt::FieldMask>,
6838
6839 /// Required. The `Destination` resource to update.
6840 pub destination: std::option::Option<crate::model::Destination>,
6841
6842 /// Optional. A request ID to identify requests. Specify a unique request ID
6843 /// so that if you must retry your request, the server can ignore
6844 /// the request if it has already been completed. The server waits
6845 /// for at least 60 minutes since the first request.
6846 ///
6847 /// For example, consider a situation where you make an initial request and
6848 /// the request times out. If you make the request again with the same request
6849 /// ID, the server can check if original operation with the same request ID
6850 /// was received, and if so, can ignore the second request.
6851 ///
6852 /// The request ID must be a valid UUID with the exception that zero UUID
6853 /// (00000000-0000-0000-0000-000000000000) isn't supported.
6854 pub request_id: std::string::String,
6855
6856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6857}
6858
6859impl UpdateDestinationRequest {
6860 pub fn new() -> Self {
6861 std::default::Default::default()
6862 }
6863
6864 /// Sets the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
6865 ///
6866 /// # Example
6867 /// ```ignore,no_run
6868 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6869 /// use wkt::FieldMask;
6870 /// let x = UpdateDestinationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6871 /// ```
6872 pub fn set_update_mask<T>(mut self, v: T) -> Self
6873 where
6874 T: std::convert::Into<wkt::FieldMask>,
6875 {
6876 self.update_mask = std::option::Option::Some(v.into());
6877 self
6878 }
6879
6880 /// Sets or clears the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
6881 ///
6882 /// # Example
6883 /// ```ignore,no_run
6884 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6885 /// use wkt::FieldMask;
6886 /// let x = UpdateDestinationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6887 /// let x = UpdateDestinationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6888 /// ```
6889 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6890 where
6891 T: std::convert::Into<wkt::FieldMask>,
6892 {
6893 self.update_mask = v.map(|x| x.into());
6894 self
6895 }
6896
6897 /// Sets the value of [destination][crate::model::UpdateDestinationRequest::destination].
6898 ///
6899 /// # Example
6900 /// ```ignore,no_run
6901 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6902 /// use google_cloud_networkconnectivity_v1::model::Destination;
6903 /// let x = UpdateDestinationRequest::new().set_destination(Destination::default()/* use setters */);
6904 /// ```
6905 pub fn set_destination<T>(mut self, v: T) -> Self
6906 where
6907 T: std::convert::Into<crate::model::Destination>,
6908 {
6909 self.destination = std::option::Option::Some(v.into());
6910 self
6911 }
6912
6913 /// Sets or clears the value of [destination][crate::model::UpdateDestinationRequest::destination].
6914 ///
6915 /// # Example
6916 /// ```ignore,no_run
6917 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6918 /// use google_cloud_networkconnectivity_v1::model::Destination;
6919 /// let x = UpdateDestinationRequest::new().set_or_clear_destination(Some(Destination::default()/* use setters */));
6920 /// let x = UpdateDestinationRequest::new().set_or_clear_destination(None::<Destination>);
6921 /// ```
6922 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
6923 where
6924 T: std::convert::Into<crate::model::Destination>,
6925 {
6926 self.destination = v.map(|x| x.into());
6927 self
6928 }
6929
6930 /// Sets the value of [request_id][crate::model::UpdateDestinationRequest::request_id].
6931 ///
6932 /// # Example
6933 /// ```ignore,no_run
6934 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6935 /// let x = UpdateDestinationRequest::new().set_request_id("example");
6936 /// ```
6937 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6938 self.request_id = v.into();
6939 self
6940 }
6941}
6942
6943impl wkt::message::Message for UpdateDestinationRequest {
6944 fn typename() -> &'static str {
6945 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateDestinationRequest"
6946 }
6947}
6948
6949/// Request message to delete a `Destination` resource.
6950#[derive(Clone, Default, PartialEq)]
6951#[non_exhaustive]
6952pub struct DeleteDestinationRequest {
6953 /// Required. The name of the `Destination` resource to delete.
6954 pub name: std::string::String,
6955
6956 /// Optional. A request ID to identify requests. Specify a unique request ID
6957 /// so that if you must retry your request, the server can ignore
6958 /// the request if it has already been completed. The server waits
6959 /// for at least 60 minutes since the first request.
6960 ///
6961 /// For example, consider a situation where you make an initial request and
6962 /// the request times out. If you make the request again with the same request
6963 /// ID, the server can check if original operation with the same request ID
6964 /// was received, and if so, can ignore the second request.
6965 ///
6966 /// The request ID must be a valid UUID with the exception that zero UUID
6967 /// (00000000-0000-0000-0000-000000000000) isn't supported.
6968 pub request_id: std::string::String,
6969
6970 /// Optional. The etag is computed by the server, and might be sent with update
6971 /// and delete requests so that the client has an up-to-date value before
6972 /// proceeding.
6973 pub etag: std::string::String,
6974
6975 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6976}
6977
6978impl DeleteDestinationRequest {
6979 pub fn new() -> Self {
6980 std::default::Default::default()
6981 }
6982
6983 /// Sets the value of [name][crate::model::DeleteDestinationRequest::name].
6984 ///
6985 /// # Example
6986 /// ```ignore,no_run
6987 /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
6988 /// let x = DeleteDestinationRequest::new().set_name("example");
6989 /// ```
6990 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6991 self.name = v.into();
6992 self
6993 }
6994
6995 /// Sets the value of [request_id][crate::model::DeleteDestinationRequest::request_id].
6996 ///
6997 /// # Example
6998 /// ```ignore,no_run
6999 /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
7000 /// let x = DeleteDestinationRequest::new().set_request_id("example");
7001 /// ```
7002 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7003 self.request_id = v.into();
7004 self
7005 }
7006
7007 /// Sets the value of [etag][crate::model::DeleteDestinationRequest::etag].
7008 ///
7009 /// # Example
7010 /// ```ignore,no_run
7011 /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
7012 /// let x = DeleteDestinationRequest::new().set_etag("example");
7013 /// ```
7014 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7015 self.etag = v.into();
7016 self
7017 }
7018}
7019
7020impl wkt::message::Message for DeleteDestinationRequest {
7021 fn typename() -> &'static str {
7022 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteDestinationRequest"
7023 }
7024}
7025
7026/// The timeline of the pending states for a resource.
7027#[derive(Clone, Default, PartialEq)]
7028#[non_exhaustive]
7029pub struct StateTimeline {
7030 /// Output only. The state and activation time details of the resource state.
7031 pub states: std::vec::Vec<crate::model::state_timeline::StateMetadata>,
7032
7033 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7034}
7035
7036impl StateTimeline {
7037 pub fn new() -> Self {
7038 std::default::Default::default()
7039 }
7040
7041 /// Sets the value of [states][crate::model::StateTimeline::states].
7042 ///
7043 /// # Example
7044 /// ```ignore,no_run
7045 /// # use google_cloud_networkconnectivity_v1::model::StateTimeline;
7046 /// use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7047 /// let x = StateTimeline::new()
7048 /// .set_states([
7049 /// StateMetadata::default()/* use setters */,
7050 /// StateMetadata::default()/* use (different) setters */,
7051 /// ]);
7052 /// ```
7053 pub fn set_states<T, V>(mut self, v: T) -> Self
7054 where
7055 T: std::iter::IntoIterator<Item = V>,
7056 V: std::convert::Into<crate::model::state_timeline::StateMetadata>,
7057 {
7058 use std::iter::Iterator;
7059 self.states = v.into_iter().map(|i| i.into()).collect();
7060 self
7061 }
7062}
7063
7064impl wkt::message::Message for StateTimeline {
7065 fn typename() -> &'static str {
7066 "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline"
7067 }
7068}
7069
7070/// Defines additional types related to [StateTimeline].
7071pub mod state_timeline {
7072 #[allow(unused_imports)]
7073 use super::*;
7074
7075 /// The state and activation time details of the resource state.
7076 #[derive(Clone, Default, PartialEq)]
7077 #[non_exhaustive]
7078 pub struct StateMetadata {
7079 /// Output only. The state of the resource.
7080 pub state: crate::model::state_timeline::state_metadata::State,
7081
7082 /// Output only. Accompanies only the transient states, which include
7083 /// `ADDING`, `DELETING`, and `SUSPENDING`, to denote the time until which
7084 /// the transient state of the resource will be effective. For instance, if
7085 /// the state is `ADDING`, this field shows the time when the resource state
7086 /// transitions to `ACTIVE`.
7087 pub effective_time: std::option::Option<wkt::Timestamp>,
7088
7089 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7090 }
7091
7092 impl StateMetadata {
7093 pub fn new() -> Self {
7094 std::default::Default::default()
7095 }
7096
7097 /// Sets the value of [state][crate::model::state_timeline::StateMetadata::state].
7098 ///
7099 /// # Example
7100 /// ```ignore,no_run
7101 /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7102 /// use google_cloud_networkconnectivity_v1::model::state_timeline::state_metadata::State;
7103 /// let x0 = StateMetadata::new().set_state(State::Adding);
7104 /// let x1 = StateMetadata::new().set_state(State::Active);
7105 /// let x2 = StateMetadata::new().set_state(State::Deleting);
7106 /// ```
7107 pub fn set_state<
7108 T: std::convert::Into<crate::model::state_timeline::state_metadata::State>,
7109 >(
7110 mut self,
7111 v: T,
7112 ) -> Self {
7113 self.state = v.into();
7114 self
7115 }
7116
7117 /// Sets the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
7118 ///
7119 /// # Example
7120 /// ```ignore,no_run
7121 /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7122 /// use wkt::Timestamp;
7123 /// let x = StateMetadata::new().set_effective_time(Timestamp::default()/* use setters */);
7124 /// ```
7125 pub fn set_effective_time<T>(mut self, v: T) -> Self
7126 where
7127 T: std::convert::Into<wkt::Timestamp>,
7128 {
7129 self.effective_time = std::option::Option::Some(v.into());
7130 self
7131 }
7132
7133 /// Sets or clears the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
7134 ///
7135 /// # Example
7136 /// ```ignore,no_run
7137 /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7138 /// use wkt::Timestamp;
7139 /// let x = StateMetadata::new().set_or_clear_effective_time(Some(Timestamp::default()/* use setters */));
7140 /// let x = StateMetadata::new().set_or_clear_effective_time(None::<Timestamp>);
7141 /// ```
7142 pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
7143 where
7144 T: std::convert::Into<wkt::Timestamp>,
7145 {
7146 self.effective_time = v.map(|x| x.into());
7147 self
7148 }
7149 }
7150
7151 impl wkt::message::Message for StateMetadata {
7152 fn typename() -> &'static str {
7153 "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata"
7154 }
7155 }
7156
7157 /// Defines additional types related to [StateMetadata].
7158 pub mod state_metadata {
7159 #[allow(unused_imports)]
7160 use super::*;
7161
7162 /// The state of the resource.
7163 ///
7164 /// # Working with unknown values
7165 ///
7166 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7167 /// additional enum variants at any time. Adding new variants is not considered
7168 /// a breaking change. Applications should write their code in anticipation of:
7169 ///
7170 /// - New values appearing in future releases of the client library, **and**
7171 /// - New values received dynamically, without application changes.
7172 ///
7173 /// Please consult the [Working with enums] section in the user guide for some
7174 /// guidelines.
7175 ///
7176 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7177 #[derive(Clone, Debug, PartialEq)]
7178 #[non_exhaustive]
7179 pub enum State {
7180 /// An invalid state, which is the default case.
7181 Unspecified,
7182 /// The resource is being added.
7183 Adding,
7184 /// The resource is in use.
7185 Active,
7186 /// The resource is being deleted.
7187 Deleting,
7188 /// The resource is being suspended.
7189 Suspending,
7190 /// The resource is suspended and not in use.
7191 Suspended,
7192 /// If set, the enum was initialized with an unknown value.
7193 ///
7194 /// Applications can examine the value using [State::value] or
7195 /// [State::name].
7196 UnknownValue(state::UnknownValue),
7197 }
7198
7199 #[doc(hidden)]
7200 pub mod state {
7201 #[allow(unused_imports)]
7202 use super::*;
7203 #[derive(Clone, Debug, PartialEq)]
7204 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7205 }
7206
7207 impl State {
7208 /// Gets the enum value.
7209 ///
7210 /// Returns `None` if the enum contains an unknown value deserialized from
7211 /// the string representation of enums.
7212 pub fn value(&self) -> std::option::Option<i32> {
7213 match self {
7214 Self::Unspecified => std::option::Option::Some(0),
7215 Self::Adding => std::option::Option::Some(1),
7216 Self::Active => std::option::Option::Some(2),
7217 Self::Deleting => std::option::Option::Some(3),
7218 Self::Suspending => std::option::Option::Some(4),
7219 Self::Suspended => std::option::Option::Some(5),
7220 Self::UnknownValue(u) => u.0.value(),
7221 }
7222 }
7223
7224 /// Gets the enum value as a string.
7225 ///
7226 /// Returns `None` if the enum contains an unknown value deserialized from
7227 /// the integer representation of enums.
7228 pub fn name(&self) -> std::option::Option<&str> {
7229 match self {
7230 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7231 Self::Adding => std::option::Option::Some("ADDING"),
7232 Self::Active => std::option::Option::Some("ACTIVE"),
7233 Self::Deleting => std::option::Option::Some("DELETING"),
7234 Self::Suspending => std::option::Option::Some("SUSPENDING"),
7235 Self::Suspended => std::option::Option::Some("SUSPENDED"),
7236 Self::UnknownValue(u) => u.0.name(),
7237 }
7238 }
7239 }
7240
7241 impl std::default::Default for State {
7242 fn default() -> Self {
7243 use std::convert::From;
7244 Self::from(0)
7245 }
7246 }
7247
7248 impl std::fmt::Display for State {
7249 fn fmt(
7250 &self,
7251 f: &mut std::fmt::Formatter<'_>,
7252 ) -> std::result::Result<(), std::fmt::Error> {
7253 wkt::internal::display_enum(f, self.name(), self.value())
7254 }
7255 }
7256
7257 impl std::convert::From<i32> for State {
7258 fn from(value: i32) -> Self {
7259 match value {
7260 0 => Self::Unspecified,
7261 1 => Self::Adding,
7262 2 => Self::Active,
7263 3 => Self::Deleting,
7264 4 => Self::Suspending,
7265 5 => Self::Suspended,
7266 _ => Self::UnknownValue(state::UnknownValue(
7267 wkt::internal::UnknownEnumValue::Integer(value),
7268 )),
7269 }
7270 }
7271 }
7272
7273 impl std::convert::From<&str> for State {
7274 fn from(value: &str) -> Self {
7275 use std::string::ToString;
7276 match value {
7277 "STATE_UNSPECIFIED" => Self::Unspecified,
7278 "ADDING" => Self::Adding,
7279 "ACTIVE" => Self::Active,
7280 "DELETING" => Self::Deleting,
7281 "SUSPENDING" => Self::Suspending,
7282 "SUSPENDED" => Self::Suspended,
7283 _ => Self::UnknownValue(state::UnknownValue(
7284 wkt::internal::UnknownEnumValue::String(value.to_string()),
7285 )),
7286 }
7287 }
7288 }
7289
7290 impl serde::ser::Serialize for State {
7291 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7292 where
7293 S: serde::Serializer,
7294 {
7295 match self {
7296 Self::Unspecified => serializer.serialize_i32(0),
7297 Self::Adding => serializer.serialize_i32(1),
7298 Self::Active => serializer.serialize_i32(2),
7299 Self::Deleting => serializer.serialize_i32(3),
7300 Self::Suspending => serializer.serialize_i32(4),
7301 Self::Suspended => serializer.serialize_i32(5),
7302 Self::UnknownValue(u) => u.0.serialize(serializer),
7303 }
7304 }
7305 }
7306
7307 impl<'de> serde::de::Deserialize<'de> for State {
7308 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7309 where
7310 D: serde::Deserializer<'de>,
7311 {
7312 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7313 ".google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata.State",
7314 ))
7315 }
7316 }
7317 }
7318}
7319
7320/// A service in your project in a region that is eligible for Data Transfer
7321/// Essentials configuration.
7322#[derive(Clone, Default, PartialEq)]
7323#[non_exhaustive]
7324pub struct MulticloudDataTransferSupportedService {
7325 /// Identifier. The name of the service.
7326 pub name: std::string::String,
7327
7328 /// Output only. The network service tier or regional endpoint supported for
7329 /// the service.
7330 pub service_configs: std::vec::Vec<crate::model::ServiceConfig>,
7331
7332 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7333}
7334
7335impl MulticloudDataTransferSupportedService {
7336 pub fn new() -> Self {
7337 std::default::Default::default()
7338 }
7339
7340 /// Sets the value of [name][crate::model::MulticloudDataTransferSupportedService::name].
7341 ///
7342 /// # Example
7343 /// ```ignore,no_run
7344 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7345 /// let x = MulticloudDataTransferSupportedService::new().set_name("example");
7346 /// ```
7347 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7348 self.name = v.into();
7349 self
7350 }
7351
7352 /// Sets the value of [service_configs][crate::model::MulticloudDataTransferSupportedService::service_configs].
7353 ///
7354 /// # Example
7355 /// ```ignore,no_run
7356 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7357 /// use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7358 /// let x = MulticloudDataTransferSupportedService::new()
7359 /// .set_service_configs([
7360 /// ServiceConfig::default()/* use setters */,
7361 /// ServiceConfig::default()/* use (different) setters */,
7362 /// ]);
7363 /// ```
7364 pub fn set_service_configs<T, V>(mut self, v: T) -> Self
7365 where
7366 T: std::iter::IntoIterator<Item = V>,
7367 V: std::convert::Into<crate::model::ServiceConfig>,
7368 {
7369 use std::iter::Iterator;
7370 self.service_configs = v.into_iter().map(|i| i.into()).collect();
7371 self
7372 }
7373}
7374
7375impl wkt::message::Message for MulticloudDataTransferSupportedService {
7376 fn typename() -> &'static str {
7377 "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferSupportedService"
7378 }
7379}
7380
7381/// Specifies eligibility information for the service.
7382#[derive(Clone, Default, PartialEq)]
7383#[non_exhaustive]
7384pub struct ServiceConfig {
7385 /// Output only. The eligibility criteria for the service.
7386 pub eligibility_criteria: crate::model::service_config::EligibilityCriteria,
7387
7388 /// Output only. The end time for eligibility criteria support. If not
7389 /// specified, no planned end time is set.
7390 pub support_end_time: std::option::Option<wkt::Timestamp>,
7391
7392 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7393}
7394
7395impl ServiceConfig {
7396 pub fn new() -> Self {
7397 std::default::Default::default()
7398 }
7399
7400 /// Sets the value of [eligibility_criteria][crate::model::ServiceConfig::eligibility_criteria].
7401 ///
7402 /// # Example
7403 /// ```ignore,no_run
7404 /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7405 /// use google_cloud_networkconnectivity_v1::model::service_config::EligibilityCriteria;
7406 /// let x0 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::NetworkServiceTierPremiumOnly);
7407 /// let x1 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::NetworkServiceTierStandardOnly);
7408 /// let x2 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::RequestEndpointRegionalEndpointOnly);
7409 /// ```
7410 pub fn set_eligibility_criteria<
7411 T: std::convert::Into<crate::model::service_config::EligibilityCriteria>,
7412 >(
7413 mut self,
7414 v: T,
7415 ) -> Self {
7416 self.eligibility_criteria = v.into();
7417 self
7418 }
7419
7420 /// Sets the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
7421 ///
7422 /// # Example
7423 /// ```ignore,no_run
7424 /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7425 /// use wkt::Timestamp;
7426 /// let x = ServiceConfig::new().set_support_end_time(Timestamp::default()/* use setters */);
7427 /// ```
7428 pub fn set_support_end_time<T>(mut self, v: T) -> Self
7429 where
7430 T: std::convert::Into<wkt::Timestamp>,
7431 {
7432 self.support_end_time = std::option::Option::Some(v.into());
7433 self
7434 }
7435
7436 /// Sets or clears the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
7437 ///
7438 /// # Example
7439 /// ```ignore,no_run
7440 /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7441 /// use wkt::Timestamp;
7442 /// let x = ServiceConfig::new().set_or_clear_support_end_time(Some(Timestamp::default()/* use setters */));
7443 /// let x = ServiceConfig::new().set_or_clear_support_end_time(None::<Timestamp>);
7444 /// ```
7445 pub fn set_or_clear_support_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7446 where
7447 T: std::convert::Into<wkt::Timestamp>,
7448 {
7449 self.support_end_time = v.map(|x| x.into());
7450 self
7451 }
7452}
7453
7454impl wkt::message::Message for ServiceConfig {
7455 fn typename() -> &'static str {
7456 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConfig"
7457 }
7458}
7459
7460/// Defines additional types related to [ServiceConfig].
7461pub mod service_config {
7462 #[allow(unused_imports)]
7463 use super::*;
7464
7465 /// The eligibility information for the service.
7466 ///
7467 /// # Working with unknown values
7468 ///
7469 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7470 /// additional enum variants at any time. Adding new variants is not considered
7471 /// a breaking change. Applications should write their code in anticipation of:
7472 ///
7473 /// - New values appearing in future releases of the client library, **and**
7474 /// - New values received dynamically, without application changes.
7475 ///
7476 /// Please consult the [Working with enums] section in the user guide for some
7477 /// guidelines.
7478 ///
7479 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7480 #[derive(Clone, Debug, PartialEq)]
7481 #[non_exhaustive]
7482 pub enum EligibilityCriteria {
7483 /// The service is not eligible for Data Transfer Essentials configuration.
7484 /// This is the default case.
7485 Unspecified,
7486 /// The service is eligible for Data Transfer Essentials configuration only
7487 /// for Premium Tier.
7488 NetworkServiceTierPremiumOnly,
7489 /// The service is eligible for Data Transfer Essentials configuration only
7490 /// for Standard Tier.
7491 NetworkServiceTierStandardOnly,
7492 /// The service is eligible for Data Transfer Essentials configuration only
7493 /// for the regional endpoint.
7494 RequestEndpointRegionalEndpointOnly,
7495 /// If set, the enum was initialized with an unknown value.
7496 ///
7497 /// Applications can examine the value using [EligibilityCriteria::value] or
7498 /// [EligibilityCriteria::name].
7499 UnknownValue(eligibility_criteria::UnknownValue),
7500 }
7501
7502 #[doc(hidden)]
7503 pub mod eligibility_criteria {
7504 #[allow(unused_imports)]
7505 use super::*;
7506 #[derive(Clone, Debug, PartialEq)]
7507 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7508 }
7509
7510 impl EligibilityCriteria {
7511 /// Gets the enum value.
7512 ///
7513 /// Returns `None` if the enum contains an unknown value deserialized from
7514 /// the string representation of enums.
7515 pub fn value(&self) -> std::option::Option<i32> {
7516 match self {
7517 Self::Unspecified => std::option::Option::Some(0),
7518 Self::NetworkServiceTierPremiumOnly => std::option::Option::Some(1),
7519 Self::NetworkServiceTierStandardOnly => std::option::Option::Some(2),
7520 Self::RequestEndpointRegionalEndpointOnly => std::option::Option::Some(3),
7521 Self::UnknownValue(u) => u.0.value(),
7522 }
7523 }
7524
7525 /// Gets the enum value as a string.
7526 ///
7527 /// Returns `None` if the enum contains an unknown value deserialized from
7528 /// the integer representation of enums.
7529 pub fn name(&self) -> std::option::Option<&str> {
7530 match self {
7531 Self::Unspecified => std::option::Option::Some("ELIGIBILITY_CRITERIA_UNSPECIFIED"),
7532 Self::NetworkServiceTierPremiumOnly => {
7533 std::option::Option::Some("NETWORK_SERVICE_TIER_PREMIUM_ONLY")
7534 }
7535 Self::NetworkServiceTierStandardOnly => {
7536 std::option::Option::Some("NETWORK_SERVICE_TIER_STANDARD_ONLY")
7537 }
7538 Self::RequestEndpointRegionalEndpointOnly => {
7539 std::option::Option::Some("REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY")
7540 }
7541 Self::UnknownValue(u) => u.0.name(),
7542 }
7543 }
7544 }
7545
7546 impl std::default::Default for EligibilityCriteria {
7547 fn default() -> Self {
7548 use std::convert::From;
7549 Self::from(0)
7550 }
7551 }
7552
7553 impl std::fmt::Display for EligibilityCriteria {
7554 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7555 wkt::internal::display_enum(f, self.name(), self.value())
7556 }
7557 }
7558
7559 impl std::convert::From<i32> for EligibilityCriteria {
7560 fn from(value: i32) -> Self {
7561 match value {
7562 0 => Self::Unspecified,
7563 1 => Self::NetworkServiceTierPremiumOnly,
7564 2 => Self::NetworkServiceTierStandardOnly,
7565 3 => Self::RequestEndpointRegionalEndpointOnly,
7566 _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
7567 wkt::internal::UnknownEnumValue::Integer(value),
7568 )),
7569 }
7570 }
7571 }
7572
7573 impl std::convert::From<&str> for EligibilityCriteria {
7574 fn from(value: &str) -> Self {
7575 use std::string::ToString;
7576 match value {
7577 "ELIGIBILITY_CRITERIA_UNSPECIFIED" => Self::Unspecified,
7578 "NETWORK_SERVICE_TIER_PREMIUM_ONLY" => Self::NetworkServiceTierPremiumOnly,
7579 "NETWORK_SERVICE_TIER_STANDARD_ONLY" => Self::NetworkServiceTierStandardOnly,
7580 "REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY" => {
7581 Self::RequestEndpointRegionalEndpointOnly
7582 }
7583 _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
7584 wkt::internal::UnknownEnumValue::String(value.to_string()),
7585 )),
7586 }
7587 }
7588 }
7589
7590 impl serde::ser::Serialize for EligibilityCriteria {
7591 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7592 where
7593 S: serde::Serializer,
7594 {
7595 match self {
7596 Self::Unspecified => serializer.serialize_i32(0),
7597 Self::NetworkServiceTierPremiumOnly => serializer.serialize_i32(1),
7598 Self::NetworkServiceTierStandardOnly => serializer.serialize_i32(2),
7599 Self::RequestEndpointRegionalEndpointOnly => serializer.serialize_i32(3),
7600 Self::UnknownValue(u) => u.0.serialize(serializer),
7601 }
7602 }
7603 }
7604
7605 impl<'de> serde::de::Deserialize<'de> for EligibilityCriteria {
7606 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7607 where
7608 D: serde::Deserializer<'de>,
7609 {
7610 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EligibilityCriteria>::new(
7611 ".google.cloud.networkconnectivity.v1.ServiceConfig.EligibilityCriteria",
7612 ))
7613 }
7614 }
7615}
7616
7617/// Request message to check if a service in your project in a region is
7618/// eligible for Data Transfer Essentials configuration.
7619#[derive(Clone, Default, PartialEq)]
7620#[non_exhaustive]
7621pub struct GetMulticloudDataTransferSupportedServiceRequest {
7622 /// Required. The name of the service.
7623 pub name: std::string::String,
7624
7625 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7626}
7627
7628impl GetMulticloudDataTransferSupportedServiceRequest {
7629 pub fn new() -> Self {
7630 std::default::Default::default()
7631 }
7632
7633 /// Sets the value of [name][crate::model::GetMulticloudDataTransferSupportedServiceRequest::name].
7634 ///
7635 /// # Example
7636 /// ```ignore,no_run
7637 /// # use google_cloud_networkconnectivity_v1::model::GetMulticloudDataTransferSupportedServiceRequest;
7638 /// let x = GetMulticloudDataTransferSupportedServiceRequest::new().set_name("example");
7639 /// ```
7640 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7641 self.name = v.into();
7642 self
7643 }
7644}
7645
7646impl wkt::message::Message for GetMulticloudDataTransferSupportedServiceRequest {
7647 fn typename() -> &'static str {
7648 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferSupportedServiceRequest"
7649 }
7650}
7651
7652/// Request message to list the services in your project that are eligible for
7653/// Data Transfer Essentials configuration.
7654#[derive(Clone, Default, PartialEq)]
7655#[non_exhaustive]
7656pub struct ListMulticloudDataTransferSupportedServicesRequest {
7657 /// Required. The name of the parent resource.
7658 pub parent: std::string::String,
7659
7660 /// Optional. The maximum number of results listed per page.
7661 pub page_size: i32,
7662
7663 /// Optional. The page token.
7664 pub page_token: std::string::String,
7665
7666 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7667}
7668
7669impl ListMulticloudDataTransferSupportedServicesRequest {
7670 pub fn new() -> Self {
7671 std::default::Default::default()
7672 }
7673
7674 /// Sets the value of [parent][crate::model::ListMulticloudDataTransferSupportedServicesRequest::parent].
7675 ///
7676 /// # Example
7677 /// ```ignore,no_run
7678 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7679 /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_parent("example");
7680 /// ```
7681 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7682 self.parent = v.into();
7683 self
7684 }
7685
7686 /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_size].
7687 ///
7688 /// # Example
7689 /// ```ignore,no_run
7690 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7691 /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_page_size(42);
7692 /// ```
7693 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7694 self.page_size = v.into();
7695 self
7696 }
7697
7698 /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_token].
7699 ///
7700 /// # Example
7701 /// ```ignore,no_run
7702 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7703 /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_page_token("example");
7704 /// ```
7705 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7706 self.page_token = v.into();
7707 self
7708 }
7709}
7710
7711impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesRequest {
7712 fn typename() -> &'static str {
7713 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesRequest"
7714 }
7715}
7716
7717/// Response message to list the services in your project in regions that are
7718/// eligible for Data Transfer Essentials configuration.
7719#[derive(Clone, Default, PartialEq)]
7720#[non_exhaustive]
7721pub struct ListMulticloudDataTransferSupportedServicesResponse {
7722 /// The list of supported services.
7723 pub multicloud_data_transfer_supported_services:
7724 std::vec::Vec<crate::model::MulticloudDataTransferSupportedService>,
7725
7726 /// The next page token.
7727 pub next_page_token: std::string::String,
7728
7729 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7730}
7731
7732impl ListMulticloudDataTransferSupportedServicesResponse {
7733 pub fn new() -> Self {
7734 std::default::Default::default()
7735 }
7736
7737 /// Sets the value of [multicloud_data_transfer_supported_services][crate::model::ListMulticloudDataTransferSupportedServicesResponse::multicloud_data_transfer_supported_services].
7738 ///
7739 /// # Example
7740 /// ```ignore,no_run
7741 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesResponse;
7742 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7743 /// let x = ListMulticloudDataTransferSupportedServicesResponse::new()
7744 /// .set_multicloud_data_transfer_supported_services([
7745 /// MulticloudDataTransferSupportedService::default()/* use setters */,
7746 /// MulticloudDataTransferSupportedService::default()/* use (different) setters */,
7747 /// ]);
7748 /// ```
7749 pub fn set_multicloud_data_transfer_supported_services<T, V>(mut self, v: T) -> Self
7750 where
7751 T: std::iter::IntoIterator<Item = V>,
7752 V: std::convert::Into<crate::model::MulticloudDataTransferSupportedService>,
7753 {
7754 use std::iter::Iterator;
7755 self.multicloud_data_transfer_supported_services =
7756 v.into_iter().map(|i| i.into()).collect();
7757 self
7758 }
7759
7760 /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferSupportedServicesResponse::next_page_token].
7761 ///
7762 /// # Example
7763 /// ```ignore,no_run
7764 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesResponse;
7765 /// let x = ListMulticloudDataTransferSupportedServicesResponse::new().set_next_page_token("example");
7766 /// ```
7767 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7768 self.next_page_token = v.into();
7769 self
7770 }
7771}
7772
7773impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesResponse {
7774 fn typename() -> &'static str {
7775 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesResponse"
7776 }
7777}
7778
7779#[doc(hidden)]
7780impl google_cloud_gax::paginator::internal::PageableResponse
7781 for ListMulticloudDataTransferSupportedServicesResponse
7782{
7783 type PageItem = crate::model::MulticloudDataTransferSupportedService;
7784
7785 fn items(self) -> std::vec::Vec<Self::PageItem> {
7786 self.multicloud_data_transfer_supported_services
7787 }
7788
7789 fn next_page_token(&self) -> std::string::String {
7790 use std::clone::Clone;
7791 self.next_page_token.clone()
7792 }
7793}
7794
7795/// A Network Connectivity Center hub is a global management resource to which
7796/// you attach spokes. A single hub can contain spokes from multiple regions.
7797/// However, if any of a hub's spokes use the site-to-site data transfer feature,
7798/// the resources associated with those spokes must all be in the same VPC
7799/// network. Spokes that do not use site-to-site data transfer can be associated
7800/// with any VPC network in your project.
7801#[derive(Clone, Default, PartialEq)]
7802#[non_exhaustive]
7803pub struct Hub {
7804 /// Immutable. The name of the hub. Hub names must be unique. They use the
7805 /// following form:
7806 /// `projects/{project_number}/locations/global/hubs/{hub_id}`
7807 pub name: std::string::String,
7808
7809 /// Output only. The time the hub was created.
7810 pub create_time: std::option::Option<wkt::Timestamp>,
7811
7812 /// Output only. The time the hub was last updated.
7813 pub update_time: std::option::Option<wkt::Timestamp>,
7814
7815 /// Optional labels in key-value pair format. For more information about
7816 /// labels, see [Requirements for
7817 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
7818 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7819
7820 /// Optional. An optional description of the hub.
7821 pub description: std::string::String,
7822
7823 /// Output only. The Google-generated UUID for the hub. This value is unique
7824 /// across all hub resources. If a hub is deleted and another with the same
7825 /// name is created, the new hub is assigned a different unique_id.
7826 pub unique_id: std::string::String,
7827
7828 /// Output only. The current lifecycle state of this hub.
7829 pub state: crate::model::State,
7830
7831 /// The VPC networks associated with this hub's spokes.
7832 ///
7833 /// This field is read-only. Network Connectivity Center automatically
7834 /// populates it based on the set of spokes attached to the hub.
7835 pub routing_vpcs: std::vec::Vec<crate::model::RoutingVPC>,
7836
7837 /// Output only. The route tables that belong to this hub. They use the
7838 /// following form:
7839 /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
7840 ///
7841 /// This field is read-only. Network Connectivity Center automatically
7842 /// populates it based on the route tables nested under the hub.
7843 pub route_tables: std::vec::Vec<std::string::String>,
7844
7845 /// Output only. A summary of the spokes associated with a hub. The
7846 /// summary includes a count of spokes according to type
7847 /// and according to state. If any spokes are inactive,
7848 /// the summary also lists the reasons they are inactive,
7849 /// including a count for each reason.
7850 pub spoke_summary: std::option::Option<crate::model::SpokeSummary>,
7851
7852 /// Optional. The policy mode of this hub. This field can be either
7853 /// PRESET or CUSTOM. If unspecified, the
7854 /// policy_mode defaults to PRESET.
7855 pub policy_mode: crate::model::PolicyMode,
7856
7857 /// Optional. The topology implemented in this hub. Currently, this field is
7858 /// only used when policy_mode = PRESET. The available preset topologies are
7859 /// MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET,
7860 /// the preset_topology defaults to MESH. When policy_mode = CUSTOM,
7861 /// the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED.
7862 pub preset_topology: crate::model::PresetTopology,
7863
7864 /// Optional. Whether Private Service Connect connection propagation is enabled
7865 /// for the hub. If true, Private Service Connect endpoints in VPC spokes
7866 /// attached to the hub are made accessible to other VPC spokes attached to the
7867 /// hub. The default value is false.
7868 pub export_psc: std::option::Option<bool>,
7869
7870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7871}
7872
7873impl Hub {
7874 pub fn new() -> Self {
7875 std::default::Default::default()
7876 }
7877
7878 /// Sets the value of [name][crate::model::Hub::name].
7879 ///
7880 /// # Example
7881 /// ```ignore,no_run
7882 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7883 /// let x = Hub::new().set_name("example");
7884 /// ```
7885 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7886 self.name = v.into();
7887 self
7888 }
7889
7890 /// Sets the value of [create_time][crate::model::Hub::create_time].
7891 ///
7892 /// # Example
7893 /// ```ignore,no_run
7894 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7895 /// use wkt::Timestamp;
7896 /// let x = Hub::new().set_create_time(Timestamp::default()/* use setters */);
7897 /// ```
7898 pub fn set_create_time<T>(mut self, v: T) -> Self
7899 where
7900 T: std::convert::Into<wkt::Timestamp>,
7901 {
7902 self.create_time = std::option::Option::Some(v.into());
7903 self
7904 }
7905
7906 /// Sets or clears the value of [create_time][crate::model::Hub::create_time].
7907 ///
7908 /// # Example
7909 /// ```ignore,no_run
7910 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7911 /// use wkt::Timestamp;
7912 /// let x = Hub::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7913 /// let x = Hub::new().set_or_clear_create_time(None::<Timestamp>);
7914 /// ```
7915 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7916 where
7917 T: std::convert::Into<wkt::Timestamp>,
7918 {
7919 self.create_time = v.map(|x| x.into());
7920 self
7921 }
7922
7923 /// Sets the value of [update_time][crate::model::Hub::update_time].
7924 ///
7925 /// # Example
7926 /// ```ignore,no_run
7927 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7928 /// use wkt::Timestamp;
7929 /// let x = Hub::new().set_update_time(Timestamp::default()/* use setters */);
7930 /// ```
7931 pub fn set_update_time<T>(mut self, v: T) -> Self
7932 where
7933 T: std::convert::Into<wkt::Timestamp>,
7934 {
7935 self.update_time = std::option::Option::Some(v.into());
7936 self
7937 }
7938
7939 /// Sets or clears the value of [update_time][crate::model::Hub::update_time].
7940 ///
7941 /// # Example
7942 /// ```ignore,no_run
7943 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7944 /// use wkt::Timestamp;
7945 /// let x = Hub::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7946 /// let x = Hub::new().set_or_clear_update_time(None::<Timestamp>);
7947 /// ```
7948 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7949 where
7950 T: std::convert::Into<wkt::Timestamp>,
7951 {
7952 self.update_time = v.map(|x| x.into());
7953 self
7954 }
7955
7956 /// Sets the value of [labels][crate::model::Hub::labels].
7957 ///
7958 /// # Example
7959 /// ```ignore,no_run
7960 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7961 /// let x = Hub::new().set_labels([
7962 /// ("key0", "abc"),
7963 /// ("key1", "xyz"),
7964 /// ]);
7965 /// ```
7966 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7967 where
7968 T: std::iter::IntoIterator<Item = (K, V)>,
7969 K: std::convert::Into<std::string::String>,
7970 V: std::convert::Into<std::string::String>,
7971 {
7972 use std::iter::Iterator;
7973 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7974 self
7975 }
7976
7977 /// Sets the value of [description][crate::model::Hub::description].
7978 ///
7979 /// # Example
7980 /// ```ignore,no_run
7981 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7982 /// let x = Hub::new().set_description("example");
7983 /// ```
7984 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7985 self.description = v.into();
7986 self
7987 }
7988
7989 /// Sets the value of [unique_id][crate::model::Hub::unique_id].
7990 ///
7991 /// # Example
7992 /// ```ignore,no_run
7993 /// # use google_cloud_networkconnectivity_v1::model::Hub;
7994 /// let x = Hub::new().set_unique_id("example");
7995 /// ```
7996 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7997 self.unique_id = v.into();
7998 self
7999 }
8000
8001 /// Sets the value of [state][crate::model::Hub::state].
8002 ///
8003 /// # Example
8004 /// ```ignore,no_run
8005 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8006 /// use google_cloud_networkconnectivity_v1::model::State;
8007 /// let x0 = Hub::new().set_state(State::Creating);
8008 /// let x1 = Hub::new().set_state(State::Active);
8009 /// let x2 = Hub::new().set_state(State::Deleting);
8010 /// ```
8011 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
8012 self.state = v.into();
8013 self
8014 }
8015
8016 /// Sets the value of [routing_vpcs][crate::model::Hub::routing_vpcs].
8017 ///
8018 /// # Example
8019 /// ```ignore,no_run
8020 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8021 /// use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8022 /// let x = Hub::new()
8023 /// .set_routing_vpcs([
8024 /// RoutingVPC::default()/* use setters */,
8025 /// RoutingVPC::default()/* use (different) setters */,
8026 /// ]);
8027 /// ```
8028 pub fn set_routing_vpcs<T, V>(mut self, v: T) -> Self
8029 where
8030 T: std::iter::IntoIterator<Item = V>,
8031 V: std::convert::Into<crate::model::RoutingVPC>,
8032 {
8033 use std::iter::Iterator;
8034 self.routing_vpcs = v.into_iter().map(|i| i.into()).collect();
8035 self
8036 }
8037
8038 /// Sets the value of [route_tables][crate::model::Hub::route_tables].
8039 ///
8040 /// # Example
8041 /// ```ignore,no_run
8042 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8043 /// let x = Hub::new().set_route_tables(["a", "b", "c"]);
8044 /// ```
8045 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
8046 where
8047 T: std::iter::IntoIterator<Item = V>,
8048 V: std::convert::Into<std::string::String>,
8049 {
8050 use std::iter::Iterator;
8051 self.route_tables = v.into_iter().map(|i| i.into()).collect();
8052 self
8053 }
8054
8055 /// Sets the value of [spoke_summary][crate::model::Hub::spoke_summary].
8056 ///
8057 /// # Example
8058 /// ```ignore,no_run
8059 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8060 /// use google_cloud_networkconnectivity_v1::model::SpokeSummary;
8061 /// let x = Hub::new().set_spoke_summary(SpokeSummary::default()/* use setters */);
8062 /// ```
8063 pub fn set_spoke_summary<T>(mut self, v: T) -> Self
8064 where
8065 T: std::convert::Into<crate::model::SpokeSummary>,
8066 {
8067 self.spoke_summary = std::option::Option::Some(v.into());
8068 self
8069 }
8070
8071 /// Sets or clears the value of [spoke_summary][crate::model::Hub::spoke_summary].
8072 ///
8073 /// # Example
8074 /// ```ignore,no_run
8075 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8076 /// use google_cloud_networkconnectivity_v1::model::SpokeSummary;
8077 /// let x = Hub::new().set_or_clear_spoke_summary(Some(SpokeSummary::default()/* use setters */));
8078 /// let x = Hub::new().set_or_clear_spoke_summary(None::<SpokeSummary>);
8079 /// ```
8080 pub fn set_or_clear_spoke_summary<T>(mut self, v: std::option::Option<T>) -> Self
8081 where
8082 T: std::convert::Into<crate::model::SpokeSummary>,
8083 {
8084 self.spoke_summary = v.map(|x| x.into());
8085 self
8086 }
8087
8088 /// Sets the value of [policy_mode][crate::model::Hub::policy_mode].
8089 ///
8090 /// # Example
8091 /// ```ignore,no_run
8092 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8093 /// use google_cloud_networkconnectivity_v1::model::PolicyMode;
8094 /// let x0 = Hub::new().set_policy_mode(PolicyMode::Preset);
8095 /// ```
8096 pub fn set_policy_mode<T: std::convert::Into<crate::model::PolicyMode>>(
8097 mut self,
8098 v: T,
8099 ) -> Self {
8100 self.policy_mode = v.into();
8101 self
8102 }
8103
8104 /// Sets the value of [preset_topology][crate::model::Hub::preset_topology].
8105 ///
8106 /// # Example
8107 /// ```ignore,no_run
8108 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8109 /// use google_cloud_networkconnectivity_v1::model::PresetTopology;
8110 /// let x0 = Hub::new().set_preset_topology(PresetTopology::Mesh);
8111 /// let x1 = Hub::new().set_preset_topology(PresetTopology::Star);
8112 /// ```
8113 pub fn set_preset_topology<T: std::convert::Into<crate::model::PresetTopology>>(
8114 mut self,
8115 v: T,
8116 ) -> Self {
8117 self.preset_topology = v.into();
8118 self
8119 }
8120
8121 /// Sets the value of [export_psc][crate::model::Hub::export_psc].
8122 ///
8123 /// # Example
8124 /// ```ignore,no_run
8125 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8126 /// let x = Hub::new().set_export_psc(true);
8127 /// ```
8128 pub fn set_export_psc<T>(mut self, v: T) -> Self
8129 where
8130 T: std::convert::Into<bool>,
8131 {
8132 self.export_psc = std::option::Option::Some(v.into());
8133 self
8134 }
8135
8136 /// Sets or clears the value of [export_psc][crate::model::Hub::export_psc].
8137 ///
8138 /// # Example
8139 /// ```ignore,no_run
8140 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8141 /// let x = Hub::new().set_or_clear_export_psc(Some(false));
8142 /// let x = Hub::new().set_or_clear_export_psc(None::<bool>);
8143 /// ```
8144 pub fn set_or_clear_export_psc<T>(mut self, v: std::option::Option<T>) -> Self
8145 where
8146 T: std::convert::Into<bool>,
8147 {
8148 self.export_psc = v.map(|x| x.into());
8149 self
8150 }
8151}
8152
8153impl wkt::message::Message for Hub {
8154 fn typename() -> &'static str {
8155 "type.googleapis.com/google.cloud.networkconnectivity.v1.Hub"
8156 }
8157}
8158
8159/// RoutingVPC contains information about the VPC networks associated
8160/// with the spokes of a Network Connectivity Center hub.
8161#[derive(Clone, Default, PartialEq)]
8162#[non_exhaustive]
8163pub struct RoutingVPC {
8164 /// The URI of the VPC network.
8165 pub uri: std::string::String,
8166
8167 /// Output only. If true, indicates that this VPC network is currently
8168 /// associated with spokes that use the data transfer feature (spokes where the
8169 /// site_to_site_data_transfer field is set to true). If you create new spokes
8170 /// that use data transfer, they must be associated with this VPC network. At
8171 /// most, one VPC network will have this field set to true.
8172 pub required_for_new_site_to_site_data_transfer_spokes: bool,
8173
8174 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8175}
8176
8177impl RoutingVPC {
8178 pub fn new() -> Self {
8179 std::default::Default::default()
8180 }
8181
8182 /// Sets the value of [uri][crate::model::RoutingVPC::uri].
8183 ///
8184 /// # Example
8185 /// ```ignore,no_run
8186 /// # use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8187 /// let x = RoutingVPC::new().set_uri("example");
8188 /// ```
8189 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8190 self.uri = v.into();
8191 self
8192 }
8193
8194 /// 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].
8195 ///
8196 /// # Example
8197 /// ```ignore,no_run
8198 /// # use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8199 /// let x = RoutingVPC::new().set_required_for_new_site_to_site_data_transfer_spokes(true);
8200 /// ```
8201 pub fn set_required_for_new_site_to_site_data_transfer_spokes<T: std::convert::Into<bool>>(
8202 mut self,
8203 v: T,
8204 ) -> Self {
8205 self.required_for_new_site_to_site_data_transfer_spokes = v.into();
8206 self
8207 }
8208}
8209
8210impl wkt::message::Message for RoutingVPC {
8211 fn typename() -> &'static str {
8212 "type.googleapis.com/google.cloud.networkconnectivity.v1.RoutingVPC"
8213 }
8214}
8215
8216/// A Network Connectivity Center spoke represents one or more network
8217/// connectivity resources.
8218///
8219/// When you create a spoke, you associate it with a hub. You must also
8220/// identify a value for exactly one of the following fields:
8221///
8222/// * linked_vpn_tunnels
8223/// * linked_interconnect_attachments
8224/// * linked_router_appliance_instances
8225/// * linked_vpc_network
8226#[derive(Clone, Default, PartialEq)]
8227#[non_exhaustive]
8228pub struct Spoke {
8229 /// Immutable. The name of the spoke. Spoke names must be unique. They use the
8230 /// following form:
8231 /// `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
8232 pub name: std::string::String,
8233
8234 /// Output only. The time the spoke was created.
8235 pub create_time: std::option::Option<wkt::Timestamp>,
8236
8237 /// Output only. The time the spoke was last updated.
8238 pub update_time: std::option::Option<wkt::Timestamp>,
8239
8240 /// Optional labels in key-value pair format. For more information about
8241 /// labels, see [Requirements for
8242 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
8243 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8244
8245 /// Optional. An optional description of the spoke.
8246 pub description: std::string::String,
8247
8248 /// Immutable. The name of the hub that this spoke is attached to.
8249 pub hub: std::string::String,
8250
8251 /// Optional. The name of the group that this spoke is associated with.
8252 pub group: std::string::String,
8253
8254 /// Optional. VPN tunnels that are associated with the spoke.
8255 pub linked_vpn_tunnels: std::option::Option<crate::model::LinkedVpnTunnels>,
8256
8257 /// Optional. VLAN attachments that are associated with the spoke.
8258 pub linked_interconnect_attachments:
8259 std::option::Option<crate::model::LinkedInterconnectAttachments>,
8260
8261 /// Optional. Router appliance instances that are associated with the spoke.
8262 pub linked_router_appliance_instances:
8263 std::option::Option<crate::model::LinkedRouterApplianceInstances>,
8264
8265 /// Optional. VPC network that is associated with the spoke.
8266 pub linked_vpc_network: std::option::Option<crate::model::LinkedVpcNetwork>,
8267
8268 /// Optional. The linked producer VPC that is associated with the spoke.
8269 pub linked_producer_vpc_network: std::option::Option<crate::model::LinkedProducerVpcNetwork>,
8270
8271 /// Output only. The Google-generated UUID for the spoke. This value is unique
8272 /// across all spoke resources. If a spoke is deleted and another with the same
8273 /// name is created, the new spoke is assigned a different `unique_id`.
8274 pub unique_id: std::string::String,
8275
8276 /// Output only. The current lifecycle state of this spoke.
8277 pub state: crate::model::State,
8278
8279 /// Output only. The reasons for current state of the spoke.
8280 pub reasons: std::vec::Vec<crate::model::spoke::StateReason>,
8281
8282 /// Output only. The type of resource associated with the spoke.
8283 pub spoke_type: crate::model::SpokeType,
8284
8285 /// Optional. This checksum is computed by the server based on the value of
8286 /// other fields, and may be sent on update and delete requests to ensure the
8287 /// client has an up-to-date value before proceeding.
8288 pub etag: std::string::String,
8289
8290 /// Optional. The list of fields waiting for hub administration's approval.
8291 pub field_paths_pending_update: std::vec::Vec<std::string::String>,
8292
8293 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8294}
8295
8296impl Spoke {
8297 pub fn new() -> Self {
8298 std::default::Default::default()
8299 }
8300
8301 /// Sets the value of [name][crate::model::Spoke::name].
8302 ///
8303 /// # Example
8304 /// ```ignore,no_run
8305 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8306 /// let x = Spoke::new().set_name("example");
8307 /// ```
8308 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8309 self.name = v.into();
8310 self
8311 }
8312
8313 /// Sets the value of [create_time][crate::model::Spoke::create_time].
8314 ///
8315 /// # Example
8316 /// ```ignore,no_run
8317 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8318 /// use wkt::Timestamp;
8319 /// let x = Spoke::new().set_create_time(Timestamp::default()/* use setters */);
8320 /// ```
8321 pub fn set_create_time<T>(mut self, v: T) -> Self
8322 where
8323 T: std::convert::Into<wkt::Timestamp>,
8324 {
8325 self.create_time = std::option::Option::Some(v.into());
8326 self
8327 }
8328
8329 /// Sets or clears the value of [create_time][crate::model::Spoke::create_time].
8330 ///
8331 /// # Example
8332 /// ```ignore,no_run
8333 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8334 /// use wkt::Timestamp;
8335 /// let x = Spoke::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8336 /// let x = Spoke::new().set_or_clear_create_time(None::<Timestamp>);
8337 /// ```
8338 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8339 where
8340 T: std::convert::Into<wkt::Timestamp>,
8341 {
8342 self.create_time = v.map(|x| x.into());
8343 self
8344 }
8345
8346 /// Sets the value of [update_time][crate::model::Spoke::update_time].
8347 ///
8348 /// # Example
8349 /// ```ignore,no_run
8350 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8351 /// use wkt::Timestamp;
8352 /// let x = Spoke::new().set_update_time(Timestamp::default()/* use setters */);
8353 /// ```
8354 pub fn set_update_time<T>(mut self, v: T) -> Self
8355 where
8356 T: std::convert::Into<wkt::Timestamp>,
8357 {
8358 self.update_time = std::option::Option::Some(v.into());
8359 self
8360 }
8361
8362 /// Sets or clears the value of [update_time][crate::model::Spoke::update_time].
8363 ///
8364 /// # Example
8365 /// ```ignore,no_run
8366 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8367 /// use wkt::Timestamp;
8368 /// let x = Spoke::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8369 /// let x = Spoke::new().set_or_clear_update_time(None::<Timestamp>);
8370 /// ```
8371 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8372 where
8373 T: std::convert::Into<wkt::Timestamp>,
8374 {
8375 self.update_time = v.map(|x| x.into());
8376 self
8377 }
8378
8379 /// Sets the value of [labels][crate::model::Spoke::labels].
8380 ///
8381 /// # Example
8382 /// ```ignore,no_run
8383 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8384 /// let x = Spoke::new().set_labels([
8385 /// ("key0", "abc"),
8386 /// ("key1", "xyz"),
8387 /// ]);
8388 /// ```
8389 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8390 where
8391 T: std::iter::IntoIterator<Item = (K, V)>,
8392 K: std::convert::Into<std::string::String>,
8393 V: std::convert::Into<std::string::String>,
8394 {
8395 use std::iter::Iterator;
8396 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8397 self
8398 }
8399
8400 /// Sets the value of [description][crate::model::Spoke::description].
8401 ///
8402 /// # Example
8403 /// ```ignore,no_run
8404 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8405 /// let x = Spoke::new().set_description("example");
8406 /// ```
8407 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8408 self.description = v.into();
8409 self
8410 }
8411
8412 /// Sets the value of [hub][crate::model::Spoke::hub].
8413 ///
8414 /// # Example
8415 /// ```ignore,no_run
8416 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8417 /// let x = Spoke::new().set_hub("example");
8418 /// ```
8419 pub fn set_hub<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8420 self.hub = v.into();
8421 self
8422 }
8423
8424 /// Sets the value of [group][crate::model::Spoke::group].
8425 ///
8426 /// # Example
8427 /// ```ignore,no_run
8428 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8429 /// let x = Spoke::new().set_group("example");
8430 /// ```
8431 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8432 self.group = v.into();
8433 self
8434 }
8435
8436 /// Sets the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
8437 ///
8438 /// # Example
8439 /// ```ignore,no_run
8440 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8441 /// use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
8442 /// let x = Spoke::new().set_linked_vpn_tunnels(LinkedVpnTunnels::default()/* use setters */);
8443 /// ```
8444 pub fn set_linked_vpn_tunnels<T>(mut self, v: T) -> Self
8445 where
8446 T: std::convert::Into<crate::model::LinkedVpnTunnels>,
8447 {
8448 self.linked_vpn_tunnels = std::option::Option::Some(v.into());
8449 self
8450 }
8451
8452 /// Sets or clears the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
8453 ///
8454 /// # Example
8455 /// ```ignore,no_run
8456 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8457 /// use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
8458 /// let x = Spoke::new().set_or_clear_linked_vpn_tunnels(Some(LinkedVpnTunnels::default()/* use setters */));
8459 /// let x = Spoke::new().set_or_clear_linked_vpn_tunnels(None::<LinkedVpnTunnels>);
8460 /// ```
8461 pub fn set_or_clear_linked_vpn_tunnels<T>(mut self, v: std::option::Option<T>) -> Self
8462 where
8463 T: std::convert::Into<crate::model::LinkedVpnTunnels>,
8464 {
8465 self.linked_vpn_tunnels = v.map(|x| x.into());
8466 self
8467 }
8468
8469 /// Sets the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
8470 ///
8471 /// # Example
8472 /// ```ignore,no_run
8473 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8474 /// use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
8475 /// let x = Spoke::new().set_linked_interconnect_attachments(LinkedInterconnectAttachments::default()/* use setters */);
8476 /// ```
8477 pub fn set_linked_interconnect_attachments<T>(mut self, v: T) -> Self
8478 where
8479 T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
8480 {
8481 self.linked_interconnect_attachments = std::option::Option::Some(v.into());
8482 self
8483 }
8484
8485 /// Sets or clears the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
8486 ///
8487 /// # Example
8488 /// ```ignore,no_run
8489 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8490 /// use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
8491 /// let x = Spoke::new().set_or_clear_linked_interconnect_attachments(Some(LinkedInterconnectAttachments::default()/* use setters */));
8492 /// let x = Spoke::new().set_or_clear_linked_interconnect_attachments(None::<LinkedInterconnectAttachments>);
8493 /// ```
8494 pub fn set_or_clear_linked_interconnect_attachments<T>(
8495 mut self,
8496 v: std::option::Option<T>,
8497 ) -> Self
8498 where
8499 T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
8500 {
8501 self.linked_interconnect_attachments = v.map(|x| x.into());
8502 self
8503 }
8504
8505 /// Sets the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
8506 ///
8507 /// # Example
8508 /// ```ignore,no_run
8509 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8510 /// use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
8511 /// let x = Spoke::new().set_linked_router_appliance_instances(LinkedRouterApplianceInstances::default()/* use setters */);
8512 /// ```
8513 pub fn set_linked_router_appliance_instances<T>(mut self, v: T) -> Self
8514 where
8515 T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
8516 {
8517 self.linked_router_appliance_instances = std::option::Option::Some(v.into());
8518 self
8519 }
8520
8521 /// Sets or clears the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
8522 ///
8523 /// # Example
8524 /// ```ignore,no_run
8525 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8526 /// use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
8527 /// let x = Spoke::new().set_or_clear_linked_router_appliance_instances(Some(LinkedRouterApplianceInstances::default()/* use setters */));
8528 /// let x = Spoke::new().set_or_clear_linked_router_appliance_instances(None::<LinkedRouterApplianceInstances>);
8529 /// ```
8530 pub fn set_or_clear_linked_router_appliance_instances<T>(
8531 mut self,
8532 v: std::option::Option<T>,
8533 ) -> Self
8534 where
8535 T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
8536 {
8537 self.linked_router_appliance_instances = v.map(|x| x.into());
8538 self
8539 }
8540
8541 /// Sets the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
8542 ///
8543 /// # Example
8544 /// ```ignore,no_run
8545 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8546 /// use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
8547 /// let x = Spoke::new().set_linked_vpc_network(LinkedVpcNetwork::default()/* use setters */);
8548 /// ```
8549 pub fn set_linked_vpc_network<T>(mut self, v: T) -> Self
8550 where
8551 T: std::convert::Into<crate::model::LinkedVpcNetwork>,
8552 {
8553 self.linked_vpc_network = std::option::Option::Some(v.into());
8554 self
8555 }
8556
8557 /// Sets or clears the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
8558 ///
8559 /// # Example
8560 /// ```ignore,no_run
8561 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8562 /// use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
8563 /// let x = Spoke::new().set_or_clear_linked_vpc_network(Some(LinkedVpcNetwork::default()/* use setters */));
8564 /// let x = Spoke::new().set_or_clear_linked_vpc_network(None::<LinkedVpcNetwork>);
8565 /// ```
8566 pub fn set_or_clear_linked_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
8567 where
8568 T: std::convert::Into<crate::model::LinkedVpcNetwork>,
8569 {
8570 self.linked_vpc_network = v.map(|x| x.into());
8571 self
8572 }
8573
8574 /// Sets the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
8575 ///
8576 /// # Example
8577 /// ```ignore,no_run
8578 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8579 /// use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
8580 /// let x = Spoke::new().set_linked_producer_vpc_network(LinkedProducerVpcNetwork::default()/* use setters */);
8581 /// ```
8582 pub fn set_linked_producer_vpc_network<T>(mut self, v: T) -> Self
8583 where
8584 T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
8585 {
8586 self.linked_producer_vpc_network = std::option::Option::Some(v.into());
8587 self
8588 }
8589
8590 /// Sets or clears the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
8591 ///
8592 /// # Example
8593 /// ```ignore,no_run
8594 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8595 /// use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
8596 /// let x = Spoke::new().set_or_clear_linked_producer_vpc_network(Some(LinkedProducerVpcNetwork::default()/* use setters */));
8597 /// let x = Spoke::new().set_or_clear_linked_producer_vpc_network(None::<LinkedProducerVpcNetwork>);
8598 /// ```
8599 pub fn set_or_clear_linked_producer_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
8600 where
8601 T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
8602 {
8603 self.linked_producer_vpc_network = v.map(|x| x.into());
8604 self
8605 }
8606
8607 /// Sets the value of [unique_id][crate::model::Spoke::unique_id].
8608 ///
8609 /// # Example
8610 /// ```ignore,no_run
8611 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8612 /// let x = Spoke::new().set_unique_id("example");
8613 /// ```
8614 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8615 self.unique_id = v.into();
8616 self
8617 }
8618
8619 /// Sets the value of [state][crate::model::Spoke::state].
8620 ///
8621 /// # Example
8622 /// ```ignore,no_run
8623 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8624 /// use google_cloud_networkconnectivity_v1::model::State;
8625 /// let x0 = Spoke::new().set_state(State::Creating);
8626 /// let x1 = Spoke::new().set_state(State::Active);
8627 /// let x2 = Spoke::new().set_state(State::Deleting);
8628 /// ```
8629 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
8630 self.state = v.into();
8631 self
8632 }
8633
8634 /// Sets the value of [reasons][crate::model::Spoke::reasons].
8635 ///
8636 /// # Example
8637 /// ```ignore,no_run
8638 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8639 /// use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8640 /// let x = Spoke::new()
8641 /// .set_reasons([
8642 /// StateReason::default()/* use setters */,
8643 /// StateReason::default()/* use (different) setters */,
8644 /// ]);
8645 /// ```
8646 pub fn set_reasons<T, V>(mut self, v: T) -> Self
8647 where
8648 T: std::iter::IntoIterator<Item = V>,
8649 V: std::convert::Into<crate::model::spoke::StateReason>,
8650 {
8651 use std::iter::Iterator;
8652 self.reasons = v.into_iter().map(|i| i.into()).collect();
8653 self
8654 }
8655
8656 /// Sets the value of [spoke_type][crate::model::Spoke::spoke_type].
8657 ///
8658 /// # Example
8659 /// ```ignore,no_run
8660 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8661 /// use google_cloud_networkconnectivity_v1::model::SpokeType;
8662 /// let x0 = Spoke::new().set_spoke_type(SpokeType::VpnTunnel);
8663 /// let x1 = Spoke::new().set_spoke_type(SpokeType::InterconnectAttachment);
8664 /// let x2 = Spoke::new().set_spoke_type(SpokeType::RouterAppliance);
8665 /// ```
8666 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(mut self, v: T) -> Self {
8667 self.spoke_type = v.into();
8668 self
8669 }
8670
8671 /// Sets the value of [etag][crate::model::Spoke::etag].
8672 ///
8673 /// # Example
8674 /// ```ignore,no_run
8675 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8676 /// let x = Spoke::new().set_etag("example");
8677 /// ```
8678 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8679 self.etag = v.into();
8680 self
8681 }
8682
8683 /// Sets the value of [field_paths_pending_update][crate::model::Spoke::field_paths_pending_update].
8684 ///
8685 /// # Example
8686 /// ```ignore,no_run
8687 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8688 /// let x = Spoke::new().set_field_paths_pending_update(["a", "b", "c"]);
8689 /// ```
8690 pub fn set_field_paths_pending_update<T, V>(mut self, v: T) -> Self
8691 where
8692 T: std::iter::IntoIterator<Item = V>,
8693 V: std::convert::Into<std::string::String>,
8694 {
8695 use std::iter::Iterator;
8696 self.field_paths_pending_update = v.into_iter().map(|i| i.into()).collect();
8697 self
8698 }
8699}
8700
8701impl wkt::message::Message for Spoke {
8702 fn typename() -> &'static str {
8703 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke"
8704 }
8705}
8706
8707/// Defines additional types related to [Spoke].
8708pub mod spoke {
8709 #[allow(unused_imports)]
8710 use super::*;
8711
8712 /// The reason a spoke is inactive.
8713 #[derive(Clone, Default, PartialEq)]
8714 #[non_exhaustive]
8715 pub struct StateReason {
8716 /// The code associated with this reason.
8717 pub code: crate::model::spoke::state_reason::Code,
8718
8719 /// Human-readable details about this reason.
8720 pub message: std::string::String,
8721
8722 /// Additional information provided by the user in the RejectSpoke call.
8723 pub user_details: std::string::String,
8724
8725 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8726 }
8727
8728 impl StateReason {
8729 pub fn new() -> Self {
8730 std::default::Default::default()
8731 }
8732
8733 /// Sets the value of [code][crate::model::spoke::StateReason::code].
8734 ///
8735 /// # Example
8736 /// ```ignore,no_run
8737 /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8738 /// use google_cloud_networkconnectivity_v1::model::spoke::state_reason::Code;
8739 /// let x0 = StateReason::new().set_code(Code::PendingReview);
8740 /// let x1 = StateReason::new().set_code(Code::Rejected);
8741 /// let x2 = StateReason::new().set_code(Code::Paused);
8742 /// ```
8743 pub fn set_code<T: std::convert::Into<crate::model::spoke::state_reason::Code>>(
8744 mut self,
8745 v: T,
8746 ) -> Self {
8747 self.code = v.into();
8748 self
8749 }
8750
8751 /// Sets the value of [message][crate::model::spoke::StateReason::message].
8752 ///
8753 /// # Example
8754 /// ```ignore,no_run
8755 /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8756 /// let x = StateReason::new().set_message("example");
8757 /// ```
8758 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8759 self.message = v.into();
8760 self
8761 }
8762
8763 /// Sets the value of [user_details][crate::model::spoke::StateReason::user_details].
8764 ///
8765 /// # Example
8766 /// ```ignore,no_run
8767 /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8768 /// let x = StateReason::new().set_user_details("example");
8769 /// ```
8770 pub fn set_user_details<T: std::convert::Into<std::string::String>>(
8771 mut self,
8772 v: T,
8773 ) -> Self {
8774 self.user_details = v.into();
8775 self
8776 }
8777 }
8778
8779 impl wkt::message::Message for StateReason {
8780 fn typename() -> &'static str {
8781 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke.StateReason"
8782 }
8783 }
8784
8785 /// Defines additional types related to [StateReason].
8786 pub mod state_reason {
8787 #[allow(unused_imports)]
8788 use super::*;
8789
8790 /// The Code enum represents the various reasons a state can be `INACTIVE`.
8791 ///
8792 /// # Working with unknown values
8793 ///
8794 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8795 /// additional enum variants at any time. Adding new variants is not considered
8796 /// a breaking change. Applications should write their code in anticipation of:
8797 ///
8798 /// - New values appearing in future releases of the client library, **and**
8799 /// - New values received dynamically, without application changes.
8800 ///
8801 /// Please consult the [Working with enums] section in the user guide for some
8802 /// guidelines.
8803 ///
8804 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8805 #[derive(Clone, Debug, PartialEq)]
8806 #[non_exhaustive]
8807 pub enum Code {
8808 /// No information available.
8809 Unspecified,
8810 /// The proposed spoke is pending review.
8811 PendingReview,
8812 /// The proposed spoke has been rejected by the hub administrator.
8813 Rejected,
8814 /// The spoke has been deactivated internally.
8815 Paused,
8816 /// Network Connectivity Center encountered errors while accepting
8817 /// the spoke.
8818 Failed,
8819 /// The proposed spoke update is pending review.
8820 UpdatePendingReview,
8821 /// The proposed spoke update has been rejected by the hub administrator.
8822 UpdateRejected,
8823 /// Network Connectivity Center encountered errors while accepting
8824 /// the spoke update.
8825 UpdateFailed,
8826 /// If set, the enum was initialized with an unknown value.
8827 ///
8828 /// Applications can examine the value using [Code::value] or
8829 /// [Code::name].
8830 UnknownValue(code::UnknownValue),
8831 }
8832
8833 #[doc(hidden)]
8834 pub mod code {
8835 #[allow(unused_imports)]
8836 use super::*;
8837 #[derive(Clone, Debug, PartialEq)]
8838 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8839 }
8840
8841 impl Code {
8842 /// Gets the enum value.
8843 ///
8844 /// Returns `None` if the enum contains an unknown value deserialized from
8845 /// the string representation of enums.
8846 pub fn value(&self) -> std::option::Option<i32> {
8847 match self {
8848 Self::Unspecified => std::option::Option::Some(0),
8849 Self::PendingReview => std::option::Option::Some(1),
8850 Self::Rejected => std::option::Option::Some(2),
8851 Self::Paused => std::option::Option::Some(3),
8852 Self::Failed => std::option::Option::Some(4),
8853 Self::UpdatePendingReview => std::option::Option::Some(5),
8854 Self::UpdateRejected => std::option::Option::Some(6),
8855 Self::UpdateFailed => std::option::Option::Some(7),
8856 Self::UnknownValue(u) => u.0.value(),
8857 }
8858 }
8859
8860 /// Gets the enum value as a string.
8861 ///
8862 /// Returns `None` if the enum contains an unknown value deserialized from
8863 /// the integer representation of enums.
8864 pub fn name(&self) -> std::option::Option<&str> {
8865 match self {
8866 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
8867 Self::PendingReview => std::option::Option::Some("PENDING_REVIEW"),
8868 Self::Rejected => std::option::Option::Some("REJECTED"),
8869 Self::Paused => std::option::Option::Some("PAUSED"),
8870 Self::Failed => std::option::Option::Some("FAILED"),
8871 Self::UpdatePendingReview => std::option::Option::Some("UPDATE_PENDING_REVIEW"),
8872 Self::UpdateRejected => std::option::Option::Some("UPDATE_REJECTED"),
8873 Self::UpdateFailed => std::option::Option::Some("UPDATE_FAILED"),
8874 Self::UnknownValue(u) => u.0.name(),
8875 }
8876 }
8877 }
8878
8879 impl std::default::Default for Code {
8880 fn default() -> Self {
8881 use std::convert::From;
8882 Self::from(0)
8883 }
8884 }
8885
8886 impl std::fmt::Display for Code {
8887 fn fmt(
8888 &self,
8889 f: &mut std::fmt::Formatter<'_>,
8890 ) -> std::result::Result<(), std::fmt::Error> {
8891 wkt::internal::display_enum(f, self.name(), self.value())
8892 }
8893 }
8894
8895 impl std::convert::From<i32> for Code {
8896 fn from(value: i32) -> Self {
8897 match value {
8898 0 => Self::Unspecified,
8899 1 => Self::PendingReview,
8900 2 => Self::Rejected,
8901 3 => Self::Paused,
8902 4 => Self::Failed,
8903 5 => Self::UpdatePendingReview,
8904 6 => Self::UpdateRejected,
8905 7 => Self::UpdateFailed,
8906 _ => Self::UnknownValue(code::UnknownValue(
8907 wkt::internal::UnknownEnumValue::Integer(value),
8908 )),
8909 }
8910 }
8911 }
8912
8913 impl std::convert::From<&str> for Code {
8914 fn from(value: &str) -> Self {
8915 use std::string::ToString;
8916 match value {
8917 "CODE_UNSPECIFIED" => Self::Unspecified,
8918 "PENDING_REVIEW" => Self::PendingReview,
8919 "REJECTED" => Self::Rejected,
8920 "PAUSED" => Self::Paused,
8921 "FAILED" => Self::Failed,
8922 "UPDATE_PENDING_REVIEW" => Self::UpdatePendingReview,
8923 "UPDATE_REJECTED" => Self::UpdateRejected,
8924 "UPDATE_FAILED" => Self::UpdateFailed,
8925 _ => Self::UnknownValue(code::UnknownValue(
8926 wkt::internal::UnknownEnumValue::String(value.to_string()),
8927 )),
8928 }
8929 }
8930 }
8931
8932 impl serde::ser::Serialize for Code {
8933 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8934 where
8935 S: serde::Serializer,
8936 {
8937 match self {
8938 Self::Unspecified => serializer.serialize_i32(0),
8939 Self::PendingReview => serializer.serialize_i32(1),
8940 Self::Rejected => serializer.serialize_i32(2),
8941 Self::Paused => serializer.serialize_i32(3),
8942 Self::Failed => serializer.serialize_i32(4),
8943 Self::UpdatePendingReview => serializer.serialize_i32(5),
8944 Self::UpdateRejected => serializer.serialize_i32(6),
8945 Self::UpdateFailed => serializer.serialize_i32(7),
8946 Self::UnknownValue(u) => u.0.serialize(serializer),
8947 }
8948 }
8949 }
8950
8951 impl<'de> serde::de::Deserialize<'de> for Code {
8952 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8953 where
8954 D: serde::Deserializer<'de>,
8955 {
8956 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
8957 ".google.cloud.networkconnectivity.v1.Spoke.StateReason.Code",
8958 ))
8959 }
8960 }
8961 }
8962}
8963
8964#[derive(Clone, Default, PartialEq)]
8965#[non_exhaustive]
8966pub struct RouteTable {
8967 /// Immutable. The name of the route table. Route table names must be unique.
8968 /// They use the following form:
8969 /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}`
8970 pub name: std::string::String,
8971
8972 /// Output only. The time the route table was created.
8973 pub create_time: std::option::Option<wkt::Timestamp>,
8974
8975 /// Output only. The time the route table was last updated.
8976 pub update_time: std::option::Option<wkt::Timestamp>,
8977
8978 /// Optional labels in key-value pair format. For more information about
8979 /// labels, see [Requirements for
8980 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
8981 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8982
8983 /// An optional description of the route table.
8984 pub description: std::string::String,
8985
8986 /// Output only. The Google-generated UUID for the route table. This value is
8987 /// unique across all route table resources. If a route table is deleted and
8988 /// another with the same name is created, the new route table is assigned
8989 /// a different `uid`.
8990 pub uid: std::string::String,
8991
8992 /// Output only. The current lifecycle state of this route table.
8993 pub state: crate::model::State,
8994
8995 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8996}
8997
8998impl RouteTable {
8999 pub fn new() -> Self {
9000 std::default::Default::default()
9001 }
9002
9003 /// Sets the value of [name][crate::model::RouteTable::name].
9004 ///
9005 /// # Example
9006 /// ```ignore,no_run
9007 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9008 /// let x = RouteTable::new().set_name("example");
9009 /// ```
9010 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9011 self.name = v.into();
9012 self
9013 }
9014
9015 /// Sets the value of [create_time][crate::model::RouteTable::create_time].
9016 ///
9017 /// # Example
9018 /// ```ignore,no_run
9019 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9020 /// use wkt::Timestamp;
9021 /// let x = RouteTable::new().set_create_time(Timestamp::default()/* use setters */);
9022 /// ```
9023 pub fn set_create_time<T>(mut self, v: T) -> Self
9024 where
9025 T: std::convert::Into<wkt::Timestamp>,
9026 {
9027 self.create_time = std::option::Option::Some(v.into());
9028 self
9029 }
9030
9031 /// Sets or clears the value of [create_time][crate::model::RouteTable::create_time].
9032 ///
9033 /// # Example
9034 /// ```ignore,no_run
9035 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9036 /// use wkt::Timestamp;
9037 /// let x = RouteTable::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9038 /// let x = RouteTable::new().set_or_clear_create_time(None::<Timestamp>);
9039 /// ```
9040 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9041 where
9042 T: std::convert::Into<wkt::Timestamp>,
9043 {
9044 self.create_time = v.map(|x| x.into());
9045 self
9046 }
9047
9048 /// Sets the value of [update_time][crate::model::RouteTable::update_time].
9049 ///
9050 /// # Example
9051 /// ```ignore,no_run
9052 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9053 /// use wkt::Timestamp;
9054 /// let x = RouteTable::new().set_update_time(Timestamp::default()/* use setters */);
9055 /// ```
9056 pub fn set_update_time<T>(mut self, v: T) -> Self
9057 where
9058 T: std::convert::Into<wkt::Timestamp>,
9059 {
9060 self.update_time = std::option::Option::Some(v.into());
9061 self
9062 }
9063
9064 /// Sets or clears the value of [update_time][crate::model::RouteTable::update_time].
9065 ///
9066 /// # Example
9067 /// ```ignore,no_run
9068 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9069 /// use wkt::Timestamp;
9070 /// let x = RouteTable::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9071 /// let x = RouteTable::new().set_or_clear_update_time(None::<Timestamp>);
9072 /// ```
9073 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9074 where
9075 T: std::convert::Into<wkt::Timestamp>,
9076 {
9077 self.update_time = v.map(|x| x.into());
9078 self
9079 }
9080
9081 /// Sets the value of [labels][crate::model::RouteTable::labels].
9082 ///
9083 /// # Example
9084 /// ```ignore,no_run
9085 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9086 /// let x = RouteTable::new().set_labels([
9087 /// ("key0", "abc"),
9088 /// ("key1", "xyz"),
9089 /// ]);
9090 /// ```
9091 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9092 where
9093 T: std::iter::IntoIterator<Item = (K, V)>,
9094 K: std::convert::Into<std::string::String>,
9095 V: std::convert::Into<std::string::String>,
9096 {
9097 use std::iter::Iterator;
9098 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9099 self
9100 }
9101
9102 /// Sets the value of [description][crate::model::RouteTable::description].
9103 ///
9104 /// # Example
9105 /// ```ignore,no_run
9106 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9107 /// let x = RouteTable::new().set_description("example");
9108 /// ```
9109 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9110 self.description = v.into();
9111 self
9112 }
9113
9114 /// Sets the value of [uid][crate::model::RouteTable::uid].
9115 ///
9116 /// # Example
9117 /// ```ignore,no_run
9118 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9119 /// let x = RouteTable::new().set_uid("example");
9120 /// ```
9121 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9122 self.uid = v.into();
9123 self
9124 }
9125
9126 /// Sets the value of [state][crate::model::RouteTable::state].
9127 ///
9128 /// # Example
9129 /// ```ignore,no_run
9130 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9131 /// use google_cloud_networkconnectivity_v1::model::State;
9132 /// let x0 = RouteTable::new().set_state(State::Creating);
9133 /// let x1 = RouteTable::new().set_state(State::Active);
9134 /// let x2 = RouteTable::new().set_state(State::Deleting);
9135 /// ```
9136 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9137 self.state = v.into();
9138 self
9139 }
9140}
9141
9142impl wkt::message::Message for RouteTable {
9143 fn typename() -> &'static str {
9144 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouteTable"
9145 }
9146}
9147
9148/// A route defines a path from VM instances within a spoke to a specific
9149/// destination resource. Only VPC spokes have routes.
9150#[derive(Clone, Default, PartialEq)]
9151#[non_exhaustive]
9152pub struct Route {
9153 /// Immutable. The name of the route. Route names must be unique. Route names
9154 /// use the following form:
9155 /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}/routes/{route_id}`
9156 pub name: std::string::String,
9157
9158 /// Output only. The time the route was created.
9159 pub create_time: std::option::Option<wkt::Timestamp>,
9160
9161 /// Output only. The time the route was last updated.
9162 pub update_time: std::option::Option<wkt::Timestamp>,
9163
9164 /// The destination IP address range.
9165 pub ip_cidr_range: std::string::String,
9166
9167 /// Output only. The route's type. Its type is determined by the properties of
9168 /// its IP address range.
9169 pub r#type: crate::model::RouteType,
9170
9171 /// Immutable. The destination VPC network for packets on this route.
9172 pub next_hop_vpc_network: std::option::Option<crate::model::NextHopVpcNetwork>,
9173
9174 /// Optional labels in key-value pair format. For more information about
9175 /// labels, see [Requirements for
9176 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
9177 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9178
9179 /// An optional description of the route.
9180 pub description: std::string::String,
9181
9182 /// Output only. The Google-generated UUID for the route. This value is unique
9183 /// across all Network Connectivity Center route resources. If a
9184 /// route is deleted and another with the same name is created,
9185 /// the new route is assigned a different `uid`.
9186 pub uid: std::string::String,
9187
9188 /// Output only. The current lifecycle state of the route.
9189 pub state: crate::model::State,
9190
9191 /// Immutable. The spoke that this route leads to.
9192 /// Example: projects/12345/locations/global/spokes/SPOKE
9193 pub spoke: std::string::String,
9194
9195 /// Output only. The origin location of the route.
9196 /// Uses the following form: "projects/{project}/locations/{location}"
9197 /// Example: projects/1234/locations/us-central1
9198 pub location: std::string::String,
9199
9200 /// Output only. The priority of this route. Priority is used to break ties in
9201 /// cases where a destination matches more than one route. In these cases the
9202 /// route with the lowest-numbered priority value wins.
9203 pub priority: i64,
9204
9205 /// Immutable. The next-hop VPN tunnel for packets on this route.
9206 pub next_hop_vpn_tunnel: std::option::Option<crate::model::NextHopVPNTunnel>,
9207
9208 /// Immutable. The next-hop Router appliance instance for packets on this
9209 /// route.
9210 pub next_hop_router_appliance_instance:
9211 std::option::Option<crate::model::NextHopRouterApplianceInstance>,
9212
9213 /// Immutable. The next-hop VLAN attachment for packets on this route.
9214 pub next_hop_interconnect_attachment:
9215 std::option::Option<crate::model::NextHopInterconnectAttachment>,
9216
9217 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9218}
9219
9220impl Route {
9221 pub fn new() -> Self {
9222 std::default::Default::default()
9223 }
9224
9225 /// Sets the value of [name][crate::model::Route::name].
9226 ///
9227 /// # Example
9228 /// ```ignore,no_run
9229 /// # use google_cloud_networkconnectivity_v1::model::Route;
9230 /// let x = Route::new().set_name("example");
9231 /// ```
9232 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9233 self.name = v.into();
9234 self
9235 }
9236
9237 /// Sets the value of [create_time][crate::model::Route::create_time].
9238 ///
9239 /// # Example
9240 /// ```ignore,no_run
9241 /// # use google_cloud_networkconnectivity_v1::model::Route;
9242 /// use wkt::Timestamp;
9243 /// let x = Route::new().set_create_time(Timestamp::default()/* use setters */);
9244 /// ```
9245 pub fn set_create_time<T>(mut self, v: T) -> Self
9246 where
9247 T: std::convert::Into<wkt::Timestamp>,
9248 {
9249 self.create_time = std::option::Option::Some(v.into());
9250 self
9251 }
9252
9253 /// Sets or clears the value of [create_time][crate::model::Route::create_time].
9254 ///
9255 /// # Example
9256 /// ```ignore,no_run
9257 /// # use google_cloud_networkconnectivity_v1::model::Route;
9258 /// use wkt::Timestamp;
9259 /// let x = Route::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9260 /// let x = Route::new().set_or_clear_create_time(None::<Timestamp>);
9261 /// ```
9262 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9263 where
9264 T: std::convert::Into<wkt::Timestamp>,
9265 {
9266 self.create_time = v.map(|x| x.into());
9267 self
9268 }
9269
9270 /// Sets the value of [update_time][crate::model::Route::update_time].
9271 ///
9272 /// # Example
9273 /// ```ignore,no_run
9274 /// # use google_cloud_networkconnectivity_v1::model::Route;
9275 /// use wkt::Timestamp;
9276 /// let x = Route::new().set_update_time(Timestamp::default()/* use setters */);
9277 /// ```
9278 pub fn set_update_time<T>(mut self, v: T) -> Self
9279 where
9280 T: std::convert::Into<wkt::Timestamp>,
9281 {
9282 self.update_time = std::option::Option::Some(v.into());
9283 self
9284 }
9285
9286 /// Sets or clears the value of [update_time][crate::model::Route::update_time].
9287 ///
9288 /// # Example
9289 /// ```ignore,no_run
9290 /// # use google_cloud_networkconnectivity_v1::model::Route;
9291 /// use wkt::Timestamp;
9292 /// let x = Route::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9293 /// let x = Route::new().set_or_clear_update_time(None::<Timestamp>);
9294 /// ```
9295 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9296 where
9297 T: std::convert::Into<wkt::Timestamp>,
9298 {
9299 self.update_time = v.map(|x| x.into());
9300 self
9301 }
9302
9303 /// Sets the value of [ip_cidr_range][crate::model::Route::ip_cidr_range].
9304 ///
9305 /// # Example
9306 /// ```ignore,no_run
9307 /// # use google_cloud_networkconnectivity_v1::model::Route;
9308 /// let x = Route::new().set_ip_cidr_range("example");
9309 /// ```
9310 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9311 self.ip_cidr_range = v.into();
9312 self
9313 }
9314
9315 /// Sets the value of [r#type][crate::model::Route::type].
9316 ///
9317 /// # Example
9318 /// ```ignore,no_run
9319 /// # use google_cloud_networkconnectivity_v1::model::Route;
9320 /// use google_cloud_networkconnectivity_v1::model::RouteType;
9321 /// let x0 = Route::new().set_type(RouteType::VpcPrimarySubnet);
9322 /// let x1 = Route::new().set_type(RouteType::VpcSecondarySubnet);
9323 /// let x2 = Route::new().set_type(RouteType::DynamicRoute);
9324 /// ```
9325 pub fn set_type<T: std::convert::Into<crate::model::RouteType>>(mut self, v: T) -> Self {
9326 self.r#type = v.into();
9327 self
9328 }
9329
9330 /// Sets the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
9331 ///
9332 /// # Example
9333 /// ```ignore,no_run
9334 /// # use google_cloud_networkconnectivity_v1::model::Route;
9335 /// use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
9336 /// let x = Route::new().set_next_hop_vpc_network(NextHopVpcNetwork::default()/* use setters */);
9337 /// ```
9338 pub fn set_next_hop_vpc_network<T>(mut self, v: T) -> Self
9339 where
9340 T: std::convert::Into<crate::model::NextHopVpcNetwork>,
9341 {
9342 self.next_hop_vpc_network = std::option::Option::Some(v.into());
9343 self
9344 }
9345
9346 /// Sets or clears the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
9347 ///
9348 /// # Example
9349 /// ```ignore,no_run
9350 /// # use google_cloud_networkconnectivity_v1::model::Route;
9351 /// use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
9352 /// let x = Route::new().set_or_clear_next_hop_vpc_network(Some(NextHopVpcNetwork::default()/* use setters */));
9353 /// let x = Route::new().set_or_clear_next_hop_vpc_network(None::<NextHopVpcNetwork>);
9354 /// ```
9355 pub fn set_or_clear_next_hop_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
9356 where
9357 T: std::convert::Into<crate::model::NextHopVpcNetwork>,
9358 {
9359 self.next_hop_vpc_network = v.map(|x| x.into());
9360 self
9361 }
9362
9363 /// Sets the value of [labels][crate::model::Route::labels].
9364 ///
9365 /// # Example
9366 /// ```ignore,no_run
9367 /// # use google_cloud_networkconnectivity_v1::model::Route;
9368 /// let x = Route::new().set_labels([
9369 /// ("key0", "abc"),
9370 /// ("key1", "xyz"),
9371 /// ]);
9372 /// ```
9373 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9374 where
9375 T: std::iter::IntoIterator<Item = (K, V)>,
9376 K: std::convert::Into<std::string::String>,
9377 V: std::convert::Into<std::string::String>,
9378 {
9379 use std::iter::Iterator;
9380 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9381 self
9382 }
9383
9384 /// Sets the value of [description][crate::model::Route::description].
9385 ///
9386 /// # Example
9387 /// ```ignore,no_run
9388 /// # use google_cloud_networkconnectivity_v1::model::Route;
9389 /// let x = Route::new().set_description("example");
9390 /// ```
9391 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9392 self.description = v.into();
9393 self
9394 }
9395
9396 /// Sets the value of [uid][crate::model::Route::uid].
9397 ///
9398 /// # Example
9399 /// ```ignore,no_run
9400 /// # use google_cloud_networkconnectivity_v1::model::Route;
9401 /// let x = Route::new().set_uid("example");
9402 /// ```
9403 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9404 self.uid = v.into();
9405 self
9406 }
9407
9408 /// Sets the value of [state][crate::model::Route::state].
9409 ///
9410 /// # Example
9411 /// ```ignore,no_run
9412 /// # use google_cloud_networkconnectivity_v1::model::Route;
9413 /// use google_cloud_networkconnectivity_v1::model::State;
9414 /// let x0 = Route::new().set_state(State::Creating);
9415 /// let x1 = Route::new().set_state(State::Active);
9416 /// let x2 = Route::new().set_state(State::Deleting);
9417 /// ```
9418 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9419 self.state = v.into();
9420 self
9421 }
9422
9423 /// Sets the value of [spoke][crate::model::Route::spoke].
9424 ///
9425 /// # Example
9426 /// ```ignore,no_run
9427 /// # use google_cloud_networkconnectivity_v1::model::Route;
9428 /// let x = Route::new().set_spoke("example");
9429 /// ```
9430 pub fn set_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9431 self.spoke = v.into();
9432 self
9433 }
9434
9435 /// Sets the value of [location][crate::model::Route::location].
9436 ///
9437 /// # Example
9438 /// ```ignore,no_run
9439 /// # use google_cloud_networkconnectivity_v1::model::Route;
9440 /// let x = Route::new().set_location("example");
9441 /// ```
9442 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9443 self.location = v.into();
9444 self
9445 }
9446
9447 /// Sets the value of [priority][crate::model::Route::priority].
9448 ///
9449 /// # Example
9450 /// ```ignore,no_run
9451 /// # use google_cloud_networkconnectivity_v1::model::Route;
9452 /// let x = Route::new().set_priority(42);
9453 /// ```
9454 pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9455 self.priority = v.into();
9456 self
9457 }
9458
9459 /// Sets the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
9460 ///
9461 /// # Example
9462 /// ```ignore,no_run
9463 /// # use google_cloud_networkconnectivity_v1::model::Route;
9464 /// use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
9465 /// let x = Route::new().set_next_hop_vpn_tunnel(NextHopVPNTunnel::default()/* use setters */);
9466 /// ```
9467 pub fn set_next_hop_vpn_tunnel<T>(mut self, v: T) -> Self
9468 where
9469 T: std::convert::Into<crate::model::NextHopVPNTunnel>,
9470 {
9471 self.next_hop_vpn_tunnel = std::option::Option::Some(v.into());
9472 self
9473 }
9474
9475 /// Sets or clears the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
9476 ///
9477 /// # Example
9478 /// ```ignore,no_run
9479 /// # use google_cloud_networkconnectivity_v1::model::Route;
9480 /// use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
9481 /// let x = Route::new().set_or_clear_next_hop_vpn_tunnel(Some(NextHopVPNTunnel::default()/* use setters */));
9482 /// let x = Route::new().set_or_clear_next_hop_vpn_tunnel(None::<NextHopVPNTunnel>);
9483 /// ```
9484 pub fn set_or_clear_next_hop_vpn_tunnel<T>(mut self, v: std::option::Option<T>) -> Self
9485 where
9486 T: std::convert::Into<crate::model::NextHopVPNTunnel>,
9487 {
9488 self.next_hop_vpn_tunnel = v.map(|x| x.into());
9489 self
9490 }
9491
9492 /// Sets the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
9493 ///
9494 /// # Example
9495 /// ```ignore,no_run
9496 /// # use google_cloud_networkconnectivity_v1::model::Route;
9497 /// use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
9498 /// let x = Route::new().set_next_hop_router_appliance_instance(NextHopRouterApplianceInstance::default()/* use setters */);
9499 /// ```
9500 pub fn set_next_hop_router_appliance_instance<T>(mut self, v: T) -> Self
9501 where
9502 T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
9503 {
9504 self.next_hop_router_appliance_instance = std::option::Option::Some(v.into());
9505 self
9506 }
9507
9508 /// Sets or clears the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
9509 ///
9510 /// # Example
9511 /// ```ignore,no_run
9512 /// # use google_cloud_networkconnectivity_v1::model::Route;
9513 /// use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
9514 /// let x = Route::new().set_or_clear_next_hop_router_appliance_instance(Some(NextHopRouterApplianceInstance::default()/* use setters */));
9515 /// let x = Route::new().set_or_clear_next_hop_router_appliance_instance(None::<NextHopRouterApplianceInstance>);
9516 /// ```
9517 pub fn set_or_clear_next_hop_router_appliance_instance<T>(
9518 mut self,
9519 v: std::option::Option<T>,
9520 ) -> Self
9521 where
9522 T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
9523 {
9524 self.next_hop_router_appliance_instance = v.map(|x| x.into());
9525 self
9526 }
9527
9528 /// Sets the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
9529 ///
9530 /// # Example
9531 /// ```ignore,no_run
9532 /// # use google_cloud_networkconnectivity_v1::model::Route;
9533 /// use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
9534 /// let x = Route::new().set_next_hop_interconnect_attachment(NextHopInterconnectAttachment::default()/* use setters */);
9535 /// ```
9536 pub fn set_next_hop_interconnect_attachment<T>(mut self, v: T) -> Self
9537 where
9538 T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
9539 {
9540 self.next_hop_interconnect_attachment = std::option::Option::Some(v.into());
9541 self
9542 }
9543
9544 /// Sets or clears the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
9545 ///
9546 /// # Example
9547 /// ```ignore,no_run
9548 /// # use google_cloud_networkconnectivity_v1::model::Route;
9549 /// use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
9550 /// let x = Route::new().set_or_clear_next_hop_interconnect_attachment(Some(NextHopInterconnectAttachment::default()/* use setters */));
9551 /// let x = Route::new().set_or_clear_next_hop_interconnect_attachment(None::<NextHopInterconnectAttachment>);
9552 /// ```
9553 pub fn set_or_clear_next_hop_interconnect_attachment<T>(
9554 mut self,
9555 v: std::option::Option<T>,
9556 ) -> Self
9557 where
9558 T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
9559 {
9560 self.next_hop_interconnect_attachment = v.map(|x| x.into());
9561 self
9562 }
9563}
9564
9565impl wkt::message::Message for Route {
9566 fn typename() -> &'static str {
9567 "type.googleapis.com/google.cloud.networkconnectivity.v1.Route"
9568 }
9569}
9570
9571/// A group represents a subset of spokes attached to a hub.
9572#[derive(Clone, Default, PartialEq)]
9573#[non_exhaustive]
9574pub struct Group {
9575 /// Immutable. The name of the group. Group names must be unique. They
9576 /// use the following form:
9577 /// `projects/{project_number}/locations/global/hubs/{hub}/groups/{group_id}`
9578 pub name: std::string::String,
9579
9580 /// Output only. The time the group was created.
9581 pub create_time: std::option::Option<wkt::Timestamp>,
9582
9583 /// Output only. The time the group was last updated.
9584 pub update_time: std::option::Option<wkt::Timestamp>,
9585
9586 /// Optional. Labels in key-value pair format. For more information about
9587 /// labels, see [Requirements for
9588 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
9589 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9590
9591 /// Optional. The description of the group.
9592 pub description: std::string::String,
9593
9594 /// Output only. The Google-generated UUID for the group. This value is unique
9595 /// across all group resources. If a group is deleted and
9596 /// another with the same name is created, the new route table is assigned
9597 /// a different unique_id.
9598 pub uid: std::string::String,
9599
9600 /// Output only. The current lifecycle state of this group.
9601 pub state: crate::model::State,
9602
9603 /// Optional. The auto-accept setting for this group.
9604 pub auto_accept: std::option::Option<crate::model::AutoAccept>,
9605
9606 /// Output only. The name of the route table that corresponds to this group.
9607 /// They use the following form:
9608 /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
9609 pub route_table: std::string::String,
9610
9611 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9612}
9613
9614impl Group {
9615 pub fn new() -> Self {
9616 std::default::Default::default()
9617 }
9618
9619 /// Sets the value of [name][crate::model::Group::name].
9620 ///
9621 /// # Example
9622 /// ```ignore,no_run
9623 /// # use google_cloud_networkconnectivity_v1::model::Group;
9624 /// let x = Group::new().set_name("example");
9625 /// ```
9626 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9627 self.name = v.into();
9628 self
9629 }
9630
9631 /// Sets the value of [create_time][crate::model::Group::create_time].
9632 ///
9633 /// # Example
9634 /// ```ignore,no_run
9635 /// # use google_cloud_networkconnectivity_v1::model::Group;
9636 /// use wkt::Timestamp;
9637 /// let x = Group::new().set_create_time(Timestamp::default()/* use setters */);
9638 /// ```
9639 pub fn set_create_time<T>(mut self, v: T) -> Self
9640 where
9641 T: std::convert::Into<wkt::Timestamp>,
9642 {
9643 self.create_time = std::option::Option::Some(v.into());
9644 self
9645 }
9646
9647 /// Sets or clears the value of [create_time][crate::model::Group::create_time].
9648 ///
9649 /// # Example
9650 /// ```ignore,no_run
9651 /// # use google_cloud_networkconnectivity_v1::model::Group;
9652 /// use wkt::Timestamp;
9653 /// let x = Group::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9654 /// let x = Group::new().set_or_clear_create_time(None::<Timestamp>);
9655 /// ```
9656 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9657 where
9658 T: std::convert::Into<wkt::Timestamp>,
9659 {
9660 self.create_time = v.map(|x| x.into());
9661 self
9662 }
9663
9664 /// Sets the value of [update_time][crate::model::Group::update_time].
9665 ///
9666 /// # Example
9667 /// ```ignore,no_run
9668 /// # use google_cloud_networkconnectivity_v1::model::Group;
9669 /// use wkt::Timestamp;
9670 /// let x = Group::new().set_update_time(Timestamp::default()/* use setters */);
9671 /// ```
9672 pub fn set_update_time<T>(mut self, v: T) -> Self
9673 where
9674 T: std::convert::Into<wkt::Timestamp>,
9675 {
9676 self.update_time = std::option::Option::Some(v.into());
9677 self
9678 }
9679
9680 /// Sets or clears the value of [update_time][crate::model::Group::update_time].
9681 ///
9682 /// # Example
9683 /// ```ignore,no_run
9684 /// # use google_cloud_networkconnectivity_v1::model::Group;
9685 /// use wkt::Timestamp;
9686 /// let x = Group::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9687 /// let x = Group::new().set_or_clear_update_time(None::<Timestamp>);
9688 /// ```
9689 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9690 where
9691 T: std::convert::Into<wkt::Timestamp>,
9692 {
9693 self.update_time = v.map(|x| x.into());
9694 self
9695 }
9696
9697 /// Sets the value of [labels][crate::model::Group::labels].
9698 ///
9699 /// # Example
9700 /// ```ignore,no_run
9701 /// # use google_cloud_networkconnectivity_v1::model::Group;
9702 /// let x = Group::new().set_labels([
9703 /// ("key0", "abc"),
9704 /// ("key1", "xyz"),
9705 /// ]);
9706 /// ```
9707 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9708 where
9709 T: std::iter::IntoIterator<Item = (K, V)>,
9710 K: std::convert::Into<std::string::String>,
9711 V: std::convert::Into<std::string::String>,
9712 {
9713 use std::iter::Iterator;
9714 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9715 self
9716 }
9717
9718 /// Sets the value of [description][crate::model::Group::description].
9719 ///
9720 /// # Example
9721 /// ```ignore,no_run
9722 /// # use google_cloud_networkconnectivity_v1::model::Group;
9723 /// let x = Group::new().set_description("example");
9724 /// ```
9725 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9726 self.description = v.into();
9727 self
9728 }
9729
9730 /// Sets the value of [uid][crate::model::Group::uid].
9731 ///
9732 /// # Example
9733 /// ```ignore,no_run
9734 /// # use google_cloud_networkconnectivity_v1::model::Group;
9735 /// let x = Group::new().set_uid("example");
9736 /// ```
9737 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9738 self.uid = v.into();
9739 self
9740 }
9741
9742 /// Sets the value of [state][crate::model::Group::state].
9743 ///
9744 /// # Example
9745 /// ```ignore,no_run
9746 /// # use google_cloud_networkconnectivity_v1::model::Group;
9747 /// use google_cloud_networkconnectivity_v1::model::State;
9748 /// let x0 = Group::new().set_state(State::Creating);
9749 /// let x1 = Group::new().set_state(State::Active);
9750 /// let x2 = Group::new().set_state(State::Deleting);
9751 /// ```
9752 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9753 self.state = v.into();
9754 self
9755 }
9756
9757 /// Sets the value of [auto_accept][crate::model::Group::auto_accept].
9758 ///
9759 /// # Example
9760 /// ```ignore,no_run
9761 /// # use google_cloud_networkconnectivity_v1::model::Group;
9762 /// use google_cloud_networkconnectivity_v1::model::AutoAccept;
9763 /// let x = Group::new().set_auto_accept(AutoAccept::default()/* use setters */);
9764 /// ```
9765 pub fn set_auto_accept<T>(mut self, v: T) -> Self
9766 where
9767 T: std::convert::Into<crate::model::AutoAccept>,
9768 {
9769 self.auto_accept = std::option::Option::Some(v.into());
9770 self
9771 }
9772
9773 /// Sets or clears the value of [auto_accept][crate::model::Group::auto_accept].
9774 ///
9775 /// # Example
9776 /// ```ignore,no_run
9777 /// # use google_cloud_networkconnectivity_v1::model::Group;
9778 /// use google_cloud_networkconnectivity_v1::model::AutoAccept;
9779 /// let x = Group::new().set_or_clear_auto_accept(Some(AutoAccept::default()/* use setters */));
9780 /// let x = Group::new().set_or_clear_auto_accept(None::<AutoAccept>);
9781 /// ```
9782 pub fn set_or_clear_auto_accept<T>(mut self, v: std::option::Option<T>) -> Self
9783 where
9784 T: std::convert::Into<crate::model::AutoAccept>,
9785 {
9786 self.auto_accept = v.map(|x| x.into());
9787 self
9788 }
9789
9790 /// Sets the value of [route_table][crate::model::Group::route_table].
9791 ///
9792 /// # Example
9793 /// ```ignore,no_run
9794 /// # use google_cloud_networkconnectivity_v1::model::Group;
9795 /// let x = Group::new().set_route_table("example");
9796 /// ```
9797 pub fn set_route_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9798 self.route_table = v.into();
9799 self
9800 }
9801}
9802
9803impl wkt::message::Message for Group {
9804 fn typename() -> &'static str {
9805 "type.googleapis.com/google.cloud.networkconnectivity.v1.Group"
9806 }
9807}
9808
9809/// The auto-accept setting for a group controls whether
9810/// proposed spokes are automatically attached to the hub. If auto-accept is
9811/// enabled, the spoke immediately is attached to the hub and becomes part of the
9812/// group. In this case, the new spoke is in the ACTIVE state.
9813/// If auto-accept is disabled, the spoke goes to the INACTIVE
9814/// state, and it must be reviewed and accepted by a hub
9815/// administrator.
9816#[derive(Clone, Default, PartialEq)]
9817#[non_exhaustive]
9818pub struct AutoAccept {
9819 /// Optional. A list of project ids or project numbers for which you want
9820 /// to enable auto-accept. The auto-accept setting is applied to
9821 /// spokes being created or updated in these projects.
9822 pub auto_accept_projects: std::vec::Vec<std::string::String>,
9823
9824 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9825}
9826
9827impl AutoAccept {
9828 pub fn new() -> Self {
9829 std::default::Default::default()
9830 }
9831
9832 /// Sets the value of [auto_accept_projects][crate::model::AutoAccept::auto_accept_projects].
9833 ///
9834 /// # Example
9835 /// ```ignore,no_run
9836 /// # use google_cloud_networkconnectivity_v1::model::AutoAccept;
9837 /// let x = AutoAccept::new().set_auto_accept_projects(["a", "b", "c"]);
9838 /// ```
9839 pub fn set_auto_accept_projects<T, V>(mut self, v: T) -> Self
9840 where
9841 T: std::iter::IntoIterator<Item = V>,
9842 V: std::convert::Into<std::string::String>,
9843 {
9844 use std::iter::Iterator;
9845 self.auto_accept_projects = v.into_iter().map(|i| i.into()).collect();
9846 self
9847 }
9848}
9849
9850impl wkt::message::Message for AutoAccept {
9851 fn typename() -> &'static str {
9852 "type.googleapis.com/google.cloud.networkconnectivity.v1.AutoAccept"
9853 }
9854}
9855
9856/// Request for
9857/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
9858/// method.
9859///
9860/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
9861#[derive(Clone, Default, PartialEq)]
9862#[non_exhaustive]
9863pub struct ListHubsRequest {
9864 /// Required. The parent resource's name.
9865 pub parent: std::string::String,
9866
9867 /// The maximum number of results per page to return.
9868 pub page_size: i32,
9869
9870 /// The page token.
9871 pub page_token: std::string::String,
9872
9873 /// An expression that filters the list of results.
9874 pub filter: std::string::String,
9875
9876 /// Sort the results by a certain order.
9877 pub order_by: std::string::String,
9878
9879 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9880}
9881
9882impl ListHubsRequest {
9883 pub fn new() -> Self {
9884 std::default::Default::default()
9885 }
9886
9887 /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
9888 ///
9889 /// # Example
9890 /// ```ignore,no_run
9891 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9892 /// let x = ListHubsRequest::new().set_parent("example");
9893 /// ```
9894 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9895 self.parent = v.into();
9896 self
9897 }
9898
9899 /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
9900 ///
9901 /// # Example
9902 /// ```ignore,no_run
9903 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9904 /// let x = ListHubsRequest::new().set_page_size(42);
9905 /// ```
9906 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9907 self.page_size = v.into();
9908 self
9909 }
9910
9911 /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
9912 ///
9913 /// # Example
9914 /// ```ignore,no_run
9915 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9916 /// let x = ListHubsRequest::new().set_page_token("example");
9917 /// ```
9918 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9919 self.page_token = v.into();
9920 self
9921 }
9922
9923 /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
9924 ///
9925 /// # Example
9926 /// ```ignore,no_run
9927 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9928 /// let x = ListHubsRequest::new().set_filter("example");
9929 /// ```
9930 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9931 self.filter = v.into();
9932 self
9933 }
9934
9935 /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
9936 ///
9937 /// # Example
9938 /// ```ignore,no_run
9939 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
9940 /// let x = ListHubsRequest::new().set_order_by("example");
9941 /// ```
9942 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9943 self.order_by = v.into();
9944 self
9945 }
9946}
9947
9948impl wkt::message::Message for ListHubsRequest {
9949 fn typename() -> &'static str {
9950 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsRequest"
9951 }
9952}
9953
9954/// Response for
9955/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
9956/// method.
9957///
9958/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
9959#[derive(Clone, Default, PartialEq)]
9960#[non_exhaustive]
9961pub struct ListHubsResponse {
9962 /// The requested hubs.
9963 pub hubs: std::vec::Vec<crate::model::Hub>,
9964
9965 /// The token for the next page of the response. To see more results,
9966 /// use this value as the page_token for your next request. If this value
9967 /// is empty, there are no more results.
9968 pub next_page_token: std::string::String,
9969
9970 /// Locations that could not be reached.
9971 pub unreachable: std::vec::Vec<std::string::String>,
9972
9973 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9974}
9975
9976impl ListHubsResponse {
9977 pub fn new() -> Self {
9978 std::default::Default::default()
9979 }
9980
9981 /// Sets the value of [hubs][crate::model::ListHubsResponse::hubs].
9982 ///
9983 /// # Example
9984 /// ```ignore,no_run
9985 /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
9986 /// use google_cloud_networkconnectivity_v1::model::Hub;
9987 /// let x = ListHubsResponse::new()
9988 /// .set_hubs([
9989 /// Hub::default()/* use setters */,
9990 /// Hub::default()/* use (different) setters */,
9991 /// ]);
9992 /// ```
9993 pub fn set_hubs<T, V>(mut self, v: T) -> Self
9994 where
9995 T: std::iter::IntoIterator<Item = V>,
9996 V: std::convert::Into<crate::model::Hub>,
9997 {
9998 use std::iter::Iterator;
9999 self.hubs = v.into_iter().map(|i| i.into()).collect();
10000 self
10001 }
10002
10003 /// Sets the value of [next_page_token][crate::model::ListHubsResponse::next_page_token].
10004 ///
10005 /// # Example
10006 /// ```ignore,no_run
10007 /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
10008 /// let x = ListHubsResponse::new().set_next_page_token("example");
10009 /// ```
10010 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10011 self.next_page_token = v.into();
10012 self
10013 }
10014
10015 /// Sets the value of [unreachable][crate::model::ListHubsResponse::unreachable].
10016 ///
10017 /// # Example
10018 /// ```ignore,no_run
10019 /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
10020 /// let x = ListHubsResponse::new().set_unreachable(["a", "b", "c"]);
10021 /// ```
10022 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10023 where
10024 T: std::iter::IntoIterator<Item = V>,
10025 V: std::convert::Into<std::string::String>,
10026 {
10027 use std::iter::Iterator;
10028 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10029 self
10030 }
10031}
10032
10033impl wkt::message::Message for ListHubsResponse {
10034 fn typename() -> &'static str {
10035 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsResponse"
10036 }
10037}
10038
10039#[doc(hidden)]
10040impl google_cloud_gax::paginator::internal::PageableResponse for ListHubsResponse {
10041 type PageItem = crate::model::Hub;
10042
10043 fn items(self) -> std::vec::Vec<Self::PageItem> {
10044 self.hubs
10045 }
10046
10047 fn next_page_token(&self) -> std::string::String {
10048 use std::clone::Clone;
10049 self.next_page_token.clone()
10050 }
10051}
10052
10053/// Request for
10054/// [HubService.GetHub][google.cloud.networkconnectivity.v1.HubService.GetHub]
10055/// method.
10056///
10057/// [google.cloud.networkconnectivity.v1.HubService.GetHub]: crate::client::HubService::get_hub
10058#[derive(Clone, Default, PartialEq)]
10059#[non_exhaustive]
10060pub struct GetHubRequest {
10061 /// Required. The name of the hub resource to get.
10062 pub name: std::string::String,
10063
10064 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10065}
10066
10067impl GetHubRequest {
10068 pub fn new() -> Self {
10069 std::default::Default::default()
10070 }
10071
10072 /// Sets the value of [name][crate::model::GetHubRequest::name].
10073 ///
10074 /// # Example
10075 /// ```ignore,no_run
10076 /// # use google_cloud_networkconnectivity_v1::model::GetHubRequest;
10077 /// let x = GetHubRequest::new().set_name("example");
10078 /// ```
10079 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10080 self.name = v.into();
10081 self
10082 }
10083}
10084
10085impl wkt::message::Message for GetHubRequest {
10086 fn typename() -> &'static str {
10087 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetHubRequest"
10088 }
10089}
10090
10091/// Request for
10092/// [HubService.CreateHub][google.cloud.networkconnectivity.v1.HubService.CreateHub]
10093/// method.
10094///
10095/// [google.cloud.networkconnectivity.v1.HubService.CreateHub]: crate::client::HubService::create_hub
10096#[derive(Clone, Default, PartialEq)]
10097#[non_exhaustive]
10098pub struct CreateHubRequest {
10099 /// Required. The parent resource.
10100 pub parent: std::string::String,
10101
10102 /// Required. A unique identifier for the hub.
10103 pub hub_id: std::string::String,
10104
10105 /// Required. The initial values for a new hub.
10106 pub hub: std::option::Option<crate::model::Hub>,
10107
10108 /// Optional. A request ID to identify requests. Specify a unique request ID so
10109 /// that if you must retry your request, the server knows to ignore the request
10110 /// if it has already been completed. The server guarantees that a request
10111 /// doesn't result in creation of duplicate commitments for at least 60
10112 /// minutes.
10113 ///
10114 /// For example, consider a situation where you make an initial request and
10115 /// the request times out. If you make the request again with the same request
10116 /// ID, the server can check to see whether the original operation
10117 /// was received. If it was, the server ignores the second request. This
10118 /// behavior prevents clients from mistakenly creating duplicate commitments.
10119 ///
10120 /// The request ID must be a valid UUID, with the exception that zero UUID is
10121 /// not supported (00000000-0000-0000-0000-000000000000).
10122 pub request_id: std::string::String,
10123
10124 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10125}
10126
10127impl CreateHubRequest {
10128 pub fn new() -> Self {
10129 std::default::Default::default()
10130 }
10131
10132 /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
10133 ///
10134 /// # Example
10135 /// ```ignore,no_run
10136 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10137 /// let x = CreateHubRequest::new().set_parent("example");
10138 /// ```
10139 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10140 self.parent = v.into();
10141 self
10142 }
10143
10144 /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
10145 ///
10146 /// # Example
10147 /// ```ignore,no_run
10148 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10149 /// let x = CreateHubRequest::new().set_hub_id("example");
10150 /// ```
10151 pub fn set_hub_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10152 self.hub_id = v.into();
10153 self
10154 }
10155
10156 /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
10157 ///
10158 /// # Example
10159 /// ```ignore,no_run
10160 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10161 /// use google_cloud_networkconnectivity_v1::model::Hub;
10162 /// let x = CreateHubRequest::new().set_hub(Hub::default()/* use setters */);
10163 /// ```
10164 pub fn set_hub<T>(mut self, v: T) -> Self
10165 where
10166 T: std::convert::Into<crate::model::Hub>,
10167 {
10168 self.hub = std::option::Option::Some(v.into());
10169 self
10170 }
10171
10172 /// Sets or clears the value of [hub][crate::model::CreateHubRequest::hub].
10173 ///
10174 /// # Example
10175 /// ```ignore,no_run
10176 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10177 /// use google_cloud_networkconnectivity_v1::model::Hub;
10178 /// let x = CreateHubRequest::new().set_or_clear_hub(Some(Hub::default()/* use setters */));
10179 /// let x = CreateHubRequest::new().set_or_clear_hub(None::<Hub>);
10180 /// ```
10181 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
10182 where
10183 T: std::convert::Into<crate::model::Hub>,
10184 {
10185 self.hub = v.map(|x| x.into());
10186 self
10187 }
10188
10189 /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
10190 ///
10191 /// # Example
10192 /// ```ignore,no_run
10193 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10194 /// let x = CreateHubRequest::new().set_request_id("example");
10195 /// ```
10196 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10197 self.request_id = v.into();
10198 self
10199 }
10200}
10201
10202impl wkt::message::Message for CreateHubRequest {
10203 fn typename() -> &'static str {
10204 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateHubRequest"
10205 }
10206}
10207
10208/// Request for
10209/// [HubService.UpdateHub][google.cloud.networkconnectivity.v1.HubService.UpdateHub]
10210/// method.
10211///
10212/// [google.cloud.networkconnectivity.v1.HubService.UpdateHub]: crate::client::HubService::update_hub
10213#[derive(Clone, Default, PartialEq)]
10214#[non_exhaustive]
10215pub struct UpdateHubRequest {
10216 /// Optional. In the case of an update to an existing hub, field mask is used
10217 /// to specify the fields to be overwritten. The fields specified in the
10218 /// update_mask are relative to the resource, not the full request. A field is
10219 /// overwritten if it is in the mask. If the user does not provide a mask, then
10220 /// all fields are overwritten.
10221 pub update_mask: std::option::Option<wkt::FieldMask>,
10222
10223 /// Required. The state that the hub should be in after the update.
10224 pub hub: std::option::Option<crate::model::Hub>,
10225
10226 /// Optional. A request ID to identify requests. Specify a unique request ID so
10227 /// that if you must retry your request, the server knows to ignore the request
10228 /// if it has already been completed. The server guarantees that a request
10229 /// doesn't result in creation of duplicate commitments for at least 60
10230 /// minutes.
10231 ///
10232 /// For example, consider a situation where you make an initial request and
10233 /// the request times out. If you make the request again with the same request
10234 /// ID, the server can check to see whether the original operation
10235 /// was received. If it was, the server ignores the second request. This
10236 /// behavior prevents clients from mistakenly creating duplicate commitments.
10237 ///
10238 /// The request ID must be a valid UUID, with the exception that zero UUID is
10239 /// not supported (00000000-0000-0000-0000-000000000000).
10240 pub request_id: std::string::String,
10241
10242 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10243}
10244
10245impl UpdateHubRequest {
10246 pub fn new() -> Self {
10247 std::default::Default::default()
10248 }
10249
10250 /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
10251 ///
10252 /// # Example
10253 /// ```ignore,no_run
10254 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10255 /// use wkt::FieldMask;
10256 /// let x = UpdateHubRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10257 /// ```
10258 pub fn set_update_mask<T>(mut self, v: T) -> Self
10259 where
10260 T: std::convert::Into<wkt::FieldMask>,
10261 {
10262 self.update_mask = std::option::Option::Some(v.into());
10263 self
10264 }
10265
10266 /// Sets or clears the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
10267 ///
10268 /// # Example
10269 /// ```ignore,no_run
10270 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10271 /// use wkt::FieldMask;
10272 /// let x = UpdateHubRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10273 /// let x = UpdateHubRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10274 /// ```
10275 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10276 where
10277 T: std::convert::Into<wkt::FieldMask>,
10278 {
10279 self.update_mask = v.map(|x| x.into());
10280 self
10281 }
10282
10283 /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
10284 ///
10285 /// # Example
10286 /// ```ignore,no_run
10287 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10288 /// use google_cloud_networkconnectivity_v1::model::Hub;
10289 /// let x = UpdateHubRequest::new().set_hub(Hub::default()/* use setters */);
10290 /// ```
10291 pub fn set_hub<T>(mut self, v: T) -> Self
10292 where
10293 T: std::convert::Into<crate::model::Hub>,
10294 {
10295 self.hub = std::option::Option::Some(v.into());
10296 self
10297 }
10298
10299 /// Sets or clears the value of [hub][crate::model::UpdateHubRequest::hub].
10300 ///
10301 /// # Example
10302 /// ```ignore,no_run
10303 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10304 /// use google_cloud_networkconnectivity_v1::model::Hub;
10305 /// let x = UpdateHubRequest::new().set_or_clear_hub(Some(Hub::default()/* use setters */));
10306 /// let x = UpdateHubRequest::new().set_or_clear_hub(None::<Hub>);
10307 /// ```
10308 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
10309 where
10310 T: std::convert::Into<crate::model::Hub>,
10311 {
10312 self.hub = v.map(|x| x.into());
10313 self
10314 }
10315
10316 /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
10317 ///
10318 /// # Example
10319 /// ```ignore,no_run
10320 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10321 /// let x = UpdateHubRequest::new().set_request_id("example");
10322 /// ```
10323 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10324 self.request_id = v.into();
10325 self
10326 }
10327}
10328
10329impl wkt::message::Message for UpdateHubRequest {
10330 fn typename() -> &'static str {
10331 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateHubRequest"
10332 }
10333}
10334
10335/// The request for
10336/// [HubService.DeleteHub][google.cloud.networkconnectivity.v1.HubService.DeleteHub].
10337///
10338/// [google.cloud.networkconnectivity.v1.HubService.DeleteHub]: crate::client::HubService::delete_hub
10339#[derive(Clone, Default, PartialEq)]
10340#[non_exhaustive]
10341pub struct DeleteHubRequest {
10342 /// Required. The name of the hub to delete.
10343 pub name: std::string::String,
10344
10345 /// Optional. A request ID to identify requests. Specify a unique request ID so
10346 /// that if you must retry your request, the server knows to ignore the request
10347 /// if it has already been completed. The server guarantees that a request
10348 /// doesn't result in creation of duplicate commitments for at least 60
10349 /// minutes.
10350 ///
10351 /// For example, consider a situation where you make an initial request and
10352 /// the request times out. If you make the request again with the same request
10353 /// ID, the server can check to see whether the original operation
10354 /// was received. If it was, the server ignores the second request. This
10355 /// behavior prevents clients from mistakenly creating duplicate commitments.
10356 ///
10357 /// The request ID must be a valid UUID, with the exception that zero UUID is
10358 /// not supported (00000000-0000-0000-0000-000000000000).
10359 pub request_id: std::string::String,
10360
10361 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10362}
10363
10364impl DeleteHubRequest {
10365 pub fn new() -> Self {
10366 std::default::Default::default()
10367 }
10368
10369 /// Sets the value of [name][crate::model::DeleteHubRequest::name].
10370 ///
10371 /// # Example
10372 /// ```ignore,no_run
10373 /// # use google_cloud_networkconnectivity_v1::model::DeleteHubRequest;
10374 /// let x = DeleteHubRequest::new().set_name("example");
10375 /// ```
10376 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10377 self.name = v.into();
10378 self
10379 }
10380
10381 /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
10382 ///
10383 /// # Example
10384 /// ```ignore,no_run
10385 /// # use google_cloud_networkconnectivity_v1::model::DeleteHubRequest;
10386 /// let x = DeleteHubRequest::new().set_request_id("example");
10387 /// ```
10388 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10389 self.request_id = v.into();
10390 self
10391 }
10392}
10393
10394impl wkt::message::Message for DeleteHubRequest {
10395 fn typename() -> &'static str {
10396 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteHubRequest"
10397 }
10398}
10399
10400/// The request for
10401/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
10402///
10403/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
10404#[derive(Clone, Default, PartialEq)]
10405#[non_exhaustive]
10406pub struct ListHubSpokesRequest {
10407 /// Required. The name of the hub.
10408 pub name: std::string::String,
10409
10410 /// A list of locations.
10411 /// Specify one of the following: `[global]`, a single region (for
10412 /// example, `[us-central1]`), or a combination of
10413 /// values (for example, `[global, us-central1, us-west1]`).
10414 /// If the spoke_locations field is populated, the list of results
10415 /// includes only spokes in the specified location.
10416 /// If the spoke_locations field is not populated, the list of results
10417 /// includes spokes in all locations.
10418 pub spoke_locations: std::vec::Vec<std::string::String>,
10419
10420 /// The maximum number of results to return per page.
10421 pub page_size: i32,
10422
10423 /// The page token.
10424 pub page_token: std::string::String,
10425
10426 /// An expression that filters the list of results.
10427 pub filter: std::string::String,
10428
10429 /// Sort the results by name or create_time.
10430 pub order_by: std::string::String,
10431
10432 /// The view of the spoke to return.
10433 /// The view that you use determines which spoke fields are included in the
10434 /// response.
10435 pub view: crate::model::list_hub_spokes_request::SpokeView,
10436
10437 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10438}
10439
10440impl ListHubSpokesRequest {
10441 pub fn new() -> Self {
10442 std::default::Default::default()
10443 }
10444
10445 /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
10446 ///
10447 /// # Example
10448 /// ```ignore,no_run
10449 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10450 /// let x = ListHubSpokesRequest::new().set_name("example");
10451 /// ```
10452 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10453 self.name = v.into();
10454 self
10455 }
10456
10457 /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
10458 ///
10459 /// # Example
10460 /// ```ignore,no_run
10461 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10462 /// let x = ListHubSpokesRequest::new().set_spoke_locations(["a", "b", "c"]);
10463 /// ```
10464 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
10465 where
10466 T: std::iter::IntoIterator<Item = V>,
10467 V: std::convert::Into<std::string::String>,
10468 {
10469 use std::iter::Iterator;
10470 self.spoke_locations = v.into_iter().map(|i| i.into()).collect();
10471 self
10472 }
10473
10474 /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
10475 ///
10476 /// # Example
10477 /// ```ignore,no_run
10478 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10479 /// let x = ListHubSpokesRequest::new().set_page_size(42);
10480 /// ```
10481 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10482 self.page_size = v.into();
10483 self
10484 }
10485
10486 /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
10487 ///
10488 /// # Example
10489 /// ```ignore,no_run
10490 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10491 /// let x = ListHubSpokesRequest::new().set_page_token("example");
10492 /// ```
10493 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10494 self.page_token = v.into();
10495 self
10496 }
10497
10498 /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
10499 ///
10500 /// # Example
10501 /// ```ignore,no_run
10502 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10503 /// let x = ListHubSpokesRequest::new().set_filter("example");
10504 /// ```
10505 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10506 self.filter = v.into();
10507 self
10508 }
10509
10510 /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
10511 ///
10512 /// # Example
10513 /// ```ignore,no_run
10514 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10515 /// let x = ListHubSpokesRequest::new().set_order_by("example");
10516 /// ```
10517 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10518 self.order_by = v.into();
10519 self
10520 }
10521
10522 /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
10523 ///
10524 /// # Example
10525 /// ```ignore,no_run
10526 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10527 /// use google_cloud_networkconnectivity_v1::model::list_hub_spokes_request::SpokeView;
10528 /// let x0 = ListHubSpokesRequest::new().set_view(SpokeView::Basic);
10529 /// let x1 = ListHubSpokesRequest::new().set_view(SpokeView::Detailed);
10530 /// ```
10531 pub fn set_view<T: std::convert::Into<crate::model::list_hub_spokes_request::SpokeView>>(
10532 mut self,
10533 v: T,
10534 ) -> Self {
10535 self.view = v.into();
10536 self
10537 }
10538}
10539
10540impl wkt::message::Message for ListHubSpokesRequest {
10541 fn typename() -> &'static str {
10542 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"
10543 }
10544}
10545
10546/// Defines additional types related to [ListHubSpokesRequest].
10547pub mod list_hub_spokes_request {
10548 #[allow(unused_imports)]
10549 use super::*;
10550
10551 /// Enum that controls which spoke fields are included in the response.
10552 ///
10553 /// # Working with unknown values
10554 ///
10555 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10556 /// additional enum variants at any time. Adding new variants is not considered
10557 /// a breaking change. Applications should write their code in anticipation of:
10558 ///
10559 /// - New values appearing in future releases of the client library, **and**
10560 /// - New values received dynamically, without application changes.
10561 ///
10562 /// Please consult the [Working with enums] section in the user guide for some
10563 /// guidelines.
10564 ///
10565 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10566 #[derive(Clone, Debug, PartialEq)]
10567 #[non_exhaustive]
10568 pub enum SpokeView {
10569 /// The spoke view is unspecified. When the spoke view is unspecified, the
10570 /// API returns the same fields as the `BASIC` view.
10571 Unspecified,
10572 /// Includes `name`, `create_time`, `hub`, `unique_id`, `state`, `reasons`,
10573 /// and `spoke_type`. This is the default value.
10574 Basic,
10575 /// Includes all spoke fields except `labels`.
10576 /// You can use the `DETAILED` view only when you set the `spoke_locations`
10577 /// field to `[global]`.
10578 Detailed,
10579 /// If set, the enum was initialized with an unknown value.
10580 ///
10581 /// Applications can examine the value using [SpokeView::value] or
10582 /// [SpokeView::name].
10583 UnknownValue(spoke_view::UnknownValue),
10584 }
10585
10586 #[doc(hidden)]
10587 pub mod spoke_view {
10588 #[allow(unused_imports)]
10589 use super::*;
10590 #[derive(Clone, Debug, PartialEq)]
10591 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10592 }
10593
10594 impl SpokeView {
10595 /// Gets the enum value.
10596 ///
10597 /// Returns `None` if the enum contains an unknown value deserialized from
10598 /// the string representation of enums.
10599 pub fn value(&self) -> std::option::Option<i32> {
10600 match self {
10601 Self::Unspecified => std::option::Option::Some(0),
10602 Self::Basic => std::option::Option::Some(1),
10603 Self::Detailed => std::option::Option::Some(2),
10604 Self::UnknownValue(u) => u.0.value(),
10605 }
10606 }
10607
10608 /// Gets the enum value as a string.
10609 ///
10610 /// Returns `None` if the enum contains an unknown value deserialized from
10611 /// the integer representation of enums.
10612 pub fn name(&self) -> std::option::Option<&str> {
10613 match self {
10614 Self::Unspecified => std::option::Option::Some("SPOKE_VIEW_UNSPECIFIED"),
10615 Self::Basic => std::option::Option::Some("BASIC"),
10616 Self::Detailed => std::option::Option::Some("DETAILED"),
10617 Self::UnknownValue(u) => u.0.name(),
10618 }
10619 }
10620 }
10621
10622 impl std::default::Default for SpokeView {
10623 fn default() -> Self {
10624 use std::convert::From;
10625 Self::from(0)
10626 }
10627 }
10628
10629 impl std::fmt::Display for SpokeView {
10630 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10631 wkt::internal::display_enum(f, self.name(), self.value())
10632 }
10633 }
10634
10635 impl std::convert::From<i32> for SpokeView {
10636 fn from(value: i32) -> Self {
10637 match value {
10638 0 => Self::Unspecified,
10639 1 => Self::Basic,
10640 2 => Self::Detailed,
10641 _ => Self::UnknownValue(spoke_view::UnknownValue(
10642 wkt::internal::UnknownEnumValue::Integer(value),
10643 )),
10644 }
10645 }
10646 }
10647
10648 impl std::convert::From<&str> for SpokeView {
10649 fn from(value: &str) -> Self {
10650 use std::string::ToString;
10651 match value {
10652 "SPOKE_VIEW_UNSPECIFIED" => Self::Unspecified,
10653 "BASIC" => Self::Basic,
10654 "DETAILED" => Self::Detailed,
10655 _ => Self::UnknownValue(spoke_view::UnknownValue(
10656 wkt::internal::UnknownEnumValue::String(value.to_string()),
10657 )),
10658 }
10659 }
10660 }
10661
10662 impl serde::ser::Serialize for SpokeView {
10663 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10664 where
10665 S: serde::Serializer,
10666 {
10667 match self {
10668 Self::Unspecified => serializer.serialize_i32(0),
10669 Self::Basic => serializer.serialize_i32(1),
10670 Self::Detailed => serializer.serialize_i32(2),
10671 Self::UnknownValue(u) => u.0.serialize(serializer),
10672 }
10673 }
10674 }
10675
10676 impl<'de> serde::de::Deserialize<'de> for SpokeView {
10677 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10678 where
10679 D: serde::Deserializer<'de>,
10680 {
10681 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeView>::new(
10682 ".google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView",
10683 ))
10684 }
10685 }
10686}
10687
10688/// The response for
10689/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
10690///
10691/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
10692#[derive(Clone, Default, PartialEq)]
10693#[non_exhaustive]
10694pub struct ListHubSpokesResponse {
10695 /// The requested spokes.
10696 /// The spoke fields can be partially populated based on the `view` field in
10697 /// the request message.
10698 pub spokes: std::vec::Vec<crate::model::Spoke>,
10699
10700 /// The token for the next page of the response. To see more results,
10701 /// use this value as the page_token for your next request. If this value
10702 /// is empty, there are no more results.
10703 pub next_page_token: std::string::String,
10704
10705 /// Locations that could not be reached.
10706 pub unreachable: std::vec::Vec<std::string::String>,
10707
10708 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10709}
10710
10711impl ListHubSpokesResponse {
10712 pub fn new() -> Self {
10713 std::default::Default::default()
10714 }
10715
10716 /// Sets the value of [spokes][crate::model::ListHubSpokesResponse::spokes].
10717 ///
10718 /// # Example
10719 /// ```ignore,no_run
10720 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10721 /// use google_cloud_networkconnectivity_v1::model::Spoke;
10722 /// let x = ListHubSpokesResponse::new()
10723 /// .set_spokes([
10724 /// Spoke::default()/* use setters */,
10725 /// Spoke::default()/* use (different) setters */,
10726 /// ]);
10727 /// ```
10728 pub fn set_spokes<T, V>(mut self, v: T) -> Self
10729 where
10730 T: std::iter::IntoIterator<Item = V>,
10731 V: std::convert::Into<crate::model::Spoke>,
10732 {
10733 use std::iter::Iterator;
10734 self.spokes = v.into_iter().map(|i| i.into()).collect();
10735 self
10736 }
10737
10738 /// Sets the value of [next_page_token][crate::model::ListHubSpokesResponse::next_page_token].
10739 ///
10740 /// # Example
10741 /// ```ignore,no_run
10742 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10743 /// let x = ListHubSpokesResponse::new().set_next_page_token("example");
10744 /// ```
10745 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10746 self.next_page_token = v.into();
10747 self
10748 }
10749
10750 /// Sets the value of [unreachable][crate::model::ListHubSpokesResponse::unreachable].
10751 ///
10752 /// # Example
10753 /// ```ignore,no_run
10754 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10755 /// let x = ListHubSpokesResponse::new().set_unreachable(["a", "b", "c"]);
10756 /// ```
10757 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10758 where
10759 T: std::iter::IntoIterator<Item = V>,
10760 V: std::convert::Into<std::string::String>,
10761 {
10762 use std::iter::Iterator;
10763 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10764 self
10765 }
10766}
10767
10768impl wkt::message::Message for ListHubSpokesResponse {
10769 fn typename() -> &'static str {
10770 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"
10771 }
10772}
10773
10774#[doc(hidden)]
10775impl google_cloud_gax::paginator::internal::PageableResponse for ListHubSpokesResponse {
10776 type PageItem = crate::model::Spoke;
10777
10778 fn items(self) -> std::vec::Vec<Self::PageItem> {
10779 self.spokes
10780 }
10781
10782 fn next_page_token(&self) -> std::string::String {
10783 use std::clone::Clone;
10784 self.next_page_token.clone()
10785 }
10786}
10787
10788/// The request for
10789/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
10790///
10791/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
10792#[derive(Clone, Default, PartialEq)]
10793#[non_exhaustive]
10794pub struct QueryHubStatusRequest {
10795 /// Required. The name of the hub.
10796 pub name: std::string::String,
10797
10798 /// Optional. The maximum number of results to return per page.
10799 pub page_size: i32,
10800
10801 /// Optional. The page token.
10802 pub page_token: std::string::String,
10803
10804 /// Optional. An expression that filters the list of results.
10805 /// The filter can be used to filter the results by the following fields:
10806 ///
10807 /// * `psc_propagation_status.source_spoke`
10808 /// * `psc_propagation_status.source_group`
10809 /// * `psc_propagation_status.source_forwarding_rule`
10810 /// * `psc_propagation_status.target_spoke`
10811 /// * `psc_propagation_status.target_group`
10812 /// * `psc_propagation_status.code`
10813 /// * `psc_propagation_status.message`
10814 pub filter: std::string::String,
10815
10816 /// Optional. Sort the results in ascending order by the specified fields.
10817 /// A comma-separated list of any of these fields:
10818 ///
10819 /// * `psc_propagation_status.source_spoke`
10820 /// * `psc_propagation_status.source_group`
10821 /// * `psc_propagation_status.source_forwarding_rule`
10822 /// * `psc_propagation_status.target_spoke`
10823 /// * `psc_propagation_status.target_group`
10824 /// * `psc_propagation_status.code`
10825 /// If `group_by` is set, the value of the `order_by` field must be the
10826 /// same as or a subset of the `group_by` field.
10827 pub order_by: std::string::String,
10828
10829 /// Optional. Aggregate the results by the specified fields.
10830 /// A comma-separated list of any of these fields:
10831 ///
10832 /// * `psc_propagation_status.source_spoke`
10833 /// * `psc_propagation_status.source_group`
10834 /// * `psc_propagation_status.source_forwarding_rule`
10835 /// * `psc_propagation_status.target_spoke`
10836 /// * `psc_propagation_status.target_group`
10837 /// * `psc_propagation_status.code`
10838 pub group_by: std::string::String,
10839
10840 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10841}
10842
10843impl QueryHubStatusRequest {
10844 pub fn new() -> Self {
10845 std::default::Default::default()
10846 }
10847
10848 /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
10849 ///
10850 /// # Example
10851 /// ```ignore,no_run
10852 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10853 /// let x = QueryHubStatusRequest::new().set_name("example");
10854 /// ```
10855 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10856 self.name = v.into();
10857 self
10858 }
10859
10860 /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
10861 ///
10862 /// # Example
10863 /// ```ignore,no_run
10864 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10865 /// let x = QueryHubStatusRequest::new().set_page_size(42);
10866 /// ```
10867 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10868 self.page_size = v.into();
10869 self
10870 }
10871
10872 /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
10873 ///
10874 /// # Example
10875 /// ```ignore,no_run
10876 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10877 /// let x = QueryHubStatusRequest::new().set_page_token("example");
10878 /// ```
10879 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10880 self.page_token = v.into();
10881 self
10882 }
10883
10884 /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
10885 ///
10886 /// # Example
10887 /// ```ignore,no_run
10888 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10889 /// let x = QueryHubStatusRequest::new().set_filter("example");
10890 /// ```
10891 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10892 self.filter = v.into();
10893 self
10894 }
10895
10896 /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
10897 ///
10898 /// # Example
10899 /// ```ignore,no_run
10900 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10901 /// let x = QueryHubStatusRequest::new().set_order_by("example");
10902 /// ```
10903 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10904 self.order_by = v.into();
10905 self
10906 }
10907
10908 /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
10909 ///
10910 /// # Example
10911 /// ```ignore,no_run
10912 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
10913 /// let x = QueryHubStatusRequest::new().set_group_by("example");
10914 /// ```
10915 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10916 self.group_by = v.into();
10917 self
10918 }
10919}
10920
10921impl wkt::message::Message for QueryHubStatusRequest {
10922 fn typename() -> &'static str {
10923 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusRequest"
10924 }
10925}
10926
10927/// The response for
10928/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
10929///
10930/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
10931#[derive(Clone, Default, PartialEq)]
10932#[non_exhaustive]
10933pub struct QueryHubStatusResponse {
10934 /// The list of hub status.
10935 pub hub_status_entries: std::vec::Vec<crate::model::HubStatusEntry>,
10936
10937 /// The token for the next page of the response. To see more results,
10938 /// use this value as the page_token for your next request. If this value
10939 /// is empty, there are no more results.
10940 pub next_page_token: std::string::String,
10941
10942 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10943}
10944
10945impl QueryHubStatusResponse {
10946 pub fn new() -> Self {
10947 std::default::Default::default()
10948 }
10949
10950 /// Sets the value of [hub_status_entries][crate::model::QueryHubStatusResponse::hub_status_entries].
10951 ///
10952 /// # Example
10953 /// ```ignore,no_run
10954 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusResponse;
10955 /// use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
10956 /// let x = QueryHubStatusResponse::new()
10957 /// .set_hub_status_entries([
10958 /// HubStatusEntry::default()/* use setters */,
10959 /// HubStatusEntry::default()/* use (different) setters */,
10960 /// ]);
10961 /// ```
10962 pub fn set_hub_status_entries<T, V>(mut self, v: T) -> Self
10963 where
10964 T: std::iter::IntoIterator<Item = V>,
10965 V: std::convert::Into<crate::model::HubStatusEntry>,
10966 {
10967 use std::iter::Iterator;
10968 self.hub_status_entries = v.into_iter().map(|i| i.into()).collect();
10969 self
10970 }
10971
10972 /// Sets the value of [next_page_token][crate::model::QueryHubStatusResponse::next_page_token].
10973 ///
10974 /// # Example
10975 /// ```ignore,no_run
10976 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusResponse;
10977 /// let x = QueryHubStatusResponse::new().set_next_page_token("example");
10978 /// ```
10979 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10980 self.next_page_token = v.into();
10981 self
10982 }
10983}
10984
10985impl wkt::message::Message for QueryHubStatusResponse {
10986 fn typename() -> &'static str {
10987 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusResponse"
10988 }
10989}
10990
10991#[doc(hidden)]
10992impl google_cloud_gax::paginator::internal::PageableResponse for QueryHubStatusResponse {
10993 type PageItem = crate::model::HubStatusEntry;
10994
10995 fn items(self) -> std::vec::Vec<Self::PageItem> {
10996 self.hub_status_entries
10997 }
10998
10999 fn next_page_token(&self) -> std::string::String {
11000 use std::clone::Clone;
11001 self.next_page_token.clone()
11002 }
11003}
11004
11005/// A hub status entry represents the status of a set of propagated Private
11006/// Service Connect connections grouped by certain fields.
11007#[derive(Clone, Default, PartialEq)]
11008#[non_exhaustive]
11009pub struct HubStatusEntry {
11010 /// The number of propagated Private Service Connect connections with this
11011 /// status. If the `group_by` field was not set in the request message, the
11012 /// value of this field is 1.
11013 pub count: i32,
11014
11015 /// The fields that this entry is grouped by. This has the same value as the
11016 /// `group_by` field in the request message.
11017 pub group_by: std::string::String,
11018
11019 /// The Private Service Connect propagation status.
11020 pub psc_propagation_status: std::option::Option<crate::model::PscPropagationStatus>,
11021
11022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11023}
11024
11025impl HubStatusEntry {
11026 pub fn new() -> Self {
11027 std::default::Default::default()
11028 }
11029
11030 /// Sets the value of [count][crate::model::HubStatusEntry::count].
11031 ///
11032 /// # Example
11033 /// ```ignore,no_run
11034 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11035 /// let x = HubStatusEntry::new().set_count(42);
11036 /// ```
11037 pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11038 self.count = v.into();
11039 self
11040 }
11041
11042 /// Sets the value of [group_by][crate::model::HubStatusEntry::group_by].
11043 ///
11044 /// # Example
11045 /// ```ignore,no_run
11046 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11047 /// let x = HubStatusEntry::new().set_group_by("example");
11048 /// ```
11049 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11050 self.group_by = v.into();
11051 self
11052 }
11053
11054 /// Sets the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
11055 ///
11056 /// # Example
11057 /// ```ignore,no_run
11058 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11059 /// use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11060 /// let x = HubStatusEntry::new().set_psc_propagation_status(PscPropagationStatus::default()/* use setters */);
11061 /// ```
11062 pub fn set_psc_propagation_status<T>(mut self, v: T) -> Self
11063 where
11064 T: std::convert::Into<crate::model::PscPropagationStatus>,
11065 {
11066 self.psc_propagation_status = std::option::Option::Some(v.into());
11067 self
11068 }
11069
11070 /// Sets or clears the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
11071 ///
11072 /// # Example
11073 /// ```ignore,no_run
11074 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11075 /// use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11076 /// let x = HubStatusEntry::new().set_or_clear_psc_propagation_status(Some(PscPropagationStatus::default()/* use setters */));
11077 /// let x = HubStatusEntry::new().set_or_clear_psc_propagation_status(None::<PscPropagationStatus>);
11078 /// ```
11079 pub fn set_or_clear_psc_propagation_status<T>(mut self, v: std::option::Option<T>) -> Self
11080 where
11081 T: std::convert::Into<crate::model::PscPropagationStatus>,
11082 {
11083 self.psc_propagation_status = v.map(|x| x.into());
11084 self
11085 }
11086}
11087
11088impl wkt::message::Message for HubStatusEntry {
11089 fn typename() -> &'static str {
11090 "type.googleapis.com/google.cloud.networkconnectivity.v1.HubStatusEntry"
11091 }
11092}
11093
11094/// The status of one or more propagated Private Service Connect connections in a
11095/// hub.
11096#[derive(Clone, Default, PartialEq)]
11097#[non_exhaustive]
11098pub struct PscPropagationStatus {
11099 /// The name of the spoke that the source forwarding rule belongs to.
11100 pub source_spoke: std::string::String,
11101
11102 /// The name of the group that the source spoke belongs to.
11103 pub source_group: std::string::String,
11104
11105 /// The name of the forwarding rule exported to the hub.
11106 pub source_forwarding_rule: std::string::String,
11107
11108 /// The name of the spoke that the source forwarding rule propagates to.
11109 pub target_spoke: std::string::String,
11110
11111 /// The name of the group that the target spoke belongs to.
11112 pub target_group: std::string::String,
11113
11114 /// The propagation status.
11115 pub code: crate::model::psc_propagation_status::Code,
11116
11117 /// The human-readable summary of the Private Service Connect connection
11118 /// propagation status.
11119 pub message: std::string::String,
11120
11121 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11122}
11123
11124impl PscPropagationStatus {
11125 pub fn new() -> Self {
11126 std::default::Default::default()
11127 }
11128
11129 /// Sets the value of [source_spoke][crate::model::PscPropagationStatus::source_spoke].
11130 ///
11131 /// # Example
11132 /// ```ignore,no_run
11133 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11134 /// let x = PscPropagationStatus::new().set_source_spoke("example");
11135 /// ```
11136 pub fn set_source_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11137 self.source_spoke = v.into();
11138 self
11139 }
11140
11141 /// Sets the value of [source_group][crate::model::PscPropagationStatus::source_group].
11142 ///
11143 /// # Example
11144 /// ```ignore,no_run
11145 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11146 /// let x = PscPropagationStatus::new().set_source_group("example");
11147 /// ```
11148 pub fn set_source_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11149 self.source_group = v.into();
11150 self
11151 }
11152
11153 /// Sets the value of [source_forwarding_rule][crate::model::PscPropagationStatus::source_forwarding_rule].
11154 ///
11155 /// # Example
11156 /// ```ignore,no_run
11157 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11158 /// let x = PscPropagationStatus::new().set_source_forwarding_rule("example");
11159 /// ```
11160 pub fn set_source_forwarding_rule<T: std::convert::Into<std::string::String>>(
11161 mut self,
11162 v: T,
11163 ) -> Self {
11164 self.source_forwarding_rule = v.into();
11165 self
11166 }
11167
11168 /// Sets the value of [target_spoke][crate::model::PscPropagationStatus::target_spoke].
11169 ///
11170 /// # Example
11171 /// ```ignore,no_run
11172 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11173 /// let x = PscPropagationStatus::new().set_target_spoke("example");
11174 /// ```
11175 pub fn set_target_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11176 self.target_spoke = v.into();
11177 self
11178 }
11179
11180 /// Sets the value of [target_group][crate::model::PscPropagationStatus::target_group].
11181 ///
11182 /// # Example
11183 /// ```ignore,no_run
11184 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11185 /// let x = PscPropagationStatus::new().set_target_group("example");
11186 /// ```
11187 pub fn set_target_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11188 self.target_group = v.into();
11189 self
11190 }
11191
11192 /// Sets the value of [code][crate::model::PscPropagationStatus::code].
11193 ///
11194 /// # Example
11195 /// ```ignore,no_run
11196 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11197 /// use google_cloud_networkconnectivity_v1::model::psc_propagation_status::Code;
11198 /// let x0 = PscPropagationStatus::new().set_code(Code::Ready);
11199 /// let x1 = PscPropagationStatus::new().set_code(Code::Propagating);
11200 /// let x2 = PscPropagationStatus::new().set_code(Code::ErrorProducerPropagatedConnectionLimitExceeded);
11201 /// ```
11202 pub fn set_code<T: std::convert::Into<crate::model::psc_propagation_status::Code>>(
11203 mut self,
11204 v: T,
11205 ) -> Self {
11206 self.code = v.into();
11207 self
11208 }
11209
11210 /// Sets the value of [message][crate::model::PscPropagationStatus::message].
11211 ///
11212 /// # Example
11213 /// ```ignore,no_run
11214 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11215 /// let x = PscPropagationStatus::new().set_message("example");
11216 /// ```
11217 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11218 self.message = v.into();
11219 self
11220 }
11221}
11222
11223impl wkt::message::Message for PscPropagationStatus {
11224 fn typename() -> &'static str {
11225 "type.googleapis.com/google.cloud.networkconnectivity.v1.PscPropagationStatus"
11226 }
11227}
11228
11229/// Defines additional types related to [PscPropagationStatus].
11230pub mod psc_propagation_status {
11231 #[allow(unused_imports)]
11232 use super::*;
11233
11234 /// The Code enum represents the state of the Private Service Connect
11235 /// propagation.
11236 ///
11237 /// # Working with unknown values
11238 ///
11239 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11240 /// additional enum variants at any time. Adding new variants is not considered
11241 /// a breaking change. Applications should write their code in anticipation of:
11242 ///
11243 /// - New values appearing in future releases of the client library, **and**
11244 /// - New values received dynamically, without application changes.
11245 ///
11246 /// Please consult the [Working with enums] section in the user guide for some
11247 /// guidelines.
11248 ///
11249 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11250 #[derive(Clone, Debug, PartialEq)]
11251 #[non_exhaustive]
11252 pub enum Code {
11253 /// The code is unspecified.
11254 Unspecified,
11255 /// The propagated Private Service Connect connection is ready.
11256 Ready,
11257 /// The Private Service Connect connection is propagating. This is a
11258 /// transient state.
11259 Propagating,
11260 /// The Private Service Connect connection propagation failed because the VPC
11261 /// network or the project of the target spoke has exceeded the connection
11262 /// limit set by the producer.
11263 ErrorProducerPropagatedConnectionLimitExceeded,
11264 /// The Private Service Connect connection propagation failed because the NAT
11265 /// IP subnet space has been exhausted. It is equivalent to the `Needs
11266 /// attention` status of the Private Service Connect connection. See
11267 /// <https://cloud.google.com/vpc/docs/about-accessing-vpc-hosted-services-endpoints#connection-statuses>.
11268 ErrorProducerNatIpSpaceExhausted,
11269 /// The Private Service Connect connection propagation failed because the
11270 /// `PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK` quota in the
11271 /// producer VPC network has been exceeded.
11272 ErrorProducerQuotaExceeded,
11273 /// The Private Service Connect connection propagation failed because the
11274 /// `PSC_PROPAGATED_CONNECTIONS_PER_VPC_NETWORK` quota in the consumer
11275 /// VPC network has been exceeded.
11276 ErrorConsumerQuotaExceeded,
11277 /// If set, the enum was initialized with an unknown value.
11278 ///
11279 /// Applications can examine the value using [Code::value] or
11280 /// [Code::name].
11281 UnknownValue(code::UnknownValue),
11282 }
11283
11284 #[doc(hidden)]
11285 pub mod code {
11286 #[allow(unused_imports)]
11287 use super::*;
11288 #[derive(Clone, Debug, PartialEq)]
11289 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11290 }
11291
11292 impl Code {
11293 /// Gets the enum value.
11294 ///
11295 /// Returns `None` if the enum contains an unknown value deserialized from
11296 /// the string representation of enums.
11297 pub fn value(&self) -> std::option::Option<i32> {
11298 match self {
11299 Self::Unspecified => std::option::Option::Some(0),
11300 Self::Ready => std::option::Option::Some(1),
11301 Self::Propagating => std::option::Option::Some(2),
11302 Self::ErrorProducerPropagatedConnectionLimitExceeded => {
11303 std::option::Option::Some(3)
11304 }
11305 Self::ErrorProducerNatIpSpaceExhausted => std::option::Option::Some(4),
11306 Self::ErrorProducerQuotaExceeded => std::option::Option::Some(5),
11307 Self::ErrorConsumerQuotaExceeded => std::option::Option::Some(6),
11308 Self::UnknownValue(u) => u.0.value(),
11309 }
11310 }
11311
11312 /// Gets the enum value as a string.
11313 ///
11314 /// Returns `None` if the enum contains an unknown value deserialized from
11315 /// the integer representation of enums.
11316 pub fn name(&self) -> std::option::Option<&str> {
11317 match self {
11318 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
11319 Self::Ready => std::option::Option::Some("READY"),
11320 Self::Propagating => std::option::Option::Some("PROPAGATING"),
11321 Self::ErrorProducerPropagatedConnectionLimitExceeded => {
11322 std::option::Option::Some("ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED")
11323 }
11324 Self::ErrorProducerNatIpSpaceExhausted => {
11325 std::option::Option::Some("ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED")
11326 }
11327 Self::ErrorProducerQuotaExceeded => {
11328 std::option::Option::Some("ERROR_PRODUCER_QUOTA_EXCEEDED")
11329 }
11330 Self::ErrorConsumerQuotaExceeded => {
11331 std::option::Option::Some("ERROR_CONSUMER_QUOTA_EXCEEDED")
11332 }
11333 Self::UnknownValue(u) => u.0.name(),
11334 }
11335 }
11336 }
11337
11338 impl std::default::Default for Code {
11339 fn default() -> Self {
11340 use std::convert::From;
11341 Self::from(0)
11342 }
11343 }
11344
11345 impl std::fmt::Display for Code {
11346 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11347 wkt::internal::display_enum(f, self.name(), self.value())
11348 }
11349 }
11350
11351 impl std::convert::From<i32> for Code {
11352 fn from(value: i32) -> Self {
11353 match value {
11354 0 => Self::Unspecified,
11355 1 => Self::Ready,
11356 2 => Self::Propagating,
11357 3 => Self::ErrorProducerPropagatedConnectionLimitExceeded,
11358 4 => Self::ErrorProducerNatIpSpaceExhausted,
11359 5 => Self::ErrorProducerQuotaExceeded,
11360 6 => Self::ErrorConsumerQuotaExceeded,
11361 _ => Self::UnknownValue(code::UnknownValue(
11362 wkt::internal::UnknownEnumValue::Integer(value),
11363 )),
11364 }
11365 }
11366 }
11367
11368 impl std::convert::From<&str> for Code {
11369 fn from(value: &str) -> Self {
11370 use std::string::ToString;
11371 match value {
11372 "CODE_UNSPECIFIED" => Self::Unspecified,
11373 "READY" => Self::Ready,
11374 "PROPAGATING" => Self::Propagating,
11375 "ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED" => {
11376 Self::ErrorProducerPropagatedConnectionLimitExceeded
11377 }
11378 "ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED" => Self::ErrorProducerNatIpSpaceExhausted,
11379 "ERROR_PRODUCER_QUOTA_EXCEEDED" => Self::ErrorProducerQuotaExceeded,
11380 "ERROR_CONSUMER_QUOTA_EXCEEDED" => Self::ErrorConsumerQuotaExceeded,
11381 _ => Self::UnknownValue(code::UnknownValue(
11382 wkt::internal::UnknownEnumValue::String(value.to_string()),
11383 )),
11384 }
11385 }
11386 }
11387
11388 impl serde::ser::Serialize for Code {
11389 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11390 where
11391 S: serde::Serializer,
11392 {
11393 match self {
11394 Self::Unspecified => serializer.serialize_i32(0),
11395 Self::Ready => serializer.serialize_i32(1),
11396 Self::Propagating => serializer.serialize_i32(2),
11397 Self::ErrorProducerPropagatedConnectionLimitExceeded => serializer.serialize_i32(3),
11398 Self::ErrorProducerNatIpSpaceExhausted => serializer.serialize_i32(4),
11399 Self::ErrorProducerQuotaExceeded => serializer.serialize_i32(5),
11400 Self::ErrorConsumerQuotaExceeded => serializer.serialize_i32(6),
11401 Self::UnknownValue(u) => u.0.serialize(serializer),
11402 }
11403 }
11404 }
11405
11406 impl<'de> serde::de::Deserialize<'de> for Code {
11407 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11408 where
11409 D: serde::Deserializer<'de>,
11410 {
11411 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
11412 ".google.cloud.networkconnectivity.v1.PscPropagationStatus.Code",
11413 ))
11414 }
11415 }
11416}
11417
11418/// The request for
11419/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
11420///
11421/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
11422#[derive(Clone, Default, PartialEq)]
11423#[non_exhaustive]
11424pub struct ListSpokesRequest {
11425 /// Required. The parent resource.
11426 pub parent: std::string::String,
11427
11428 /// The maximum number of results to return per page.
11429 pub page_size: i32,
11430
11431 /// The page token.
11432 pub page_token: std::string::String,
11433
11434 /// An expression that filters the list of results.
11435 pub filter: std::string::String,
11436
11437 /// Sort the results by a certain order.
11438 pub order_by: std::string::String,
11439
11440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11441}
11442
11443impl ListSpokesRequest {
11444 pub fn new() -> Self {
11445 std::default::Default::default()
11446 }
11447
11448 /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
11449 ///
11450 /// # Example
11451 /// ```ignore,no_run
11452 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11453 /// let x = ListSpokesRequest::new().set_parent("example");
11454 /// ```
11455 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11456 self.parent = v.into();
11457 self
11458 }
11459
11460 /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
11461 ///
11462 /// # Example
11463 /// ```ignore,no_run
11464 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11465 /// let x = ListSpokesRequest::new().set_page_size(42);
11466 /// ```
11467 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11468 self.page_size = v.into();
11469 self
11470 }
11471
11472 /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
11473 ///
11474 /// # Example
11475 /// ```ignore,no_run
11476 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11477 /// let x = ListSpokesRequest::new().set_page_token("example");
11478 /// ```
11479 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11480 self.page_token = v.into();
11481 self
11482 }
11483
11484 /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
11485 ///
11486 /// # Example
11487 /// ```ignore,no_run
11488 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11489 /// let x = ListSpokesRequest::new().set_filter("example");
11490 /// ```
11491 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11492 self.filter = v.into();
11493 self
11494 }
11495
11496 /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
11497 ///
11498 /// # Example
11499 /// ```ignore,no_run
11500 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11501 /// let x = ListSpokesRequest::new().set_order_by("example");
11502 /// ```
11503 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11504 self.order_by = v.into();
11505 self
11506 }
11507}
11508
11509impl wkt::message::Message for ListSpokesRequest {
11510 fn typename() -> &'static str {
11511 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesRequest"
11512 }
11513}
11514
11515/// The response for
11516/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
11517///
11518/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
11519#[derive(Clone, Default, PartialEq)]
11520#[non_exhaustive]
11521pub struct ListSpokesResponse {
11522 /// The requested spokes.
11523 pub spokes: std::vec::Vec<crate::model::Spoke>,
11524
11525 /// The token for the next page of the response. To see more results,
11526 /// use this value as the page_token for your next request. If this value
11527 /// is empty, there are no more results.
11528 pub next_page_token: std::string::String,
11529
11530 /// Locations that could not be reached.
11531 pub unreachable: std::vec::Vec<std::string::String>,
11532
11533 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11534}
11535
11536impl ListSpokesResponse {
11537 pub fn new() -> Self {
11538 std::default::Default::default()
11539 }
11540
11541 /// Sets the value of [spokes][crate::model::ListSpokesResponse::spokes].
11542 ///
11543 /// # Example
11544 /// ```ignore,no_run
11545 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11546 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11547 /// let x = ListSpokesResponse::new()
11548 /// .set_spokes([
11549 /// Spoke::default()/* use setters */,
11550 /// Spoke::default()/* use (different) setters */,
11551 /// ]);
11552 /// ```
11553 pub fn set_spokes<T, V>(mut self, v: T) -> Self
11554 where
11555 T: std::iter::IntoIterator<Item = V>,
11556 V: std::convert::Into<crate::model::Spoke>,
11557 {
11558 use std::iter::Iterator;
11559 self.spokes = v.into_iter().map(|i| i.into()).collect();
11560 self
11561 }
11562
11563 /// Sets the value of [next_page_token][crate::model::ListSpokesResponse::next_page_token].
11564 ///
11565 /// # Example
11566 /// ```ignore,no_run
11567 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11568 /// let x = ListSpokesResponse::new().set_next_page_token("example");
11569 /// ```
11570 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11571 self.next_page_token = v.into();
11572 self
11573 }
11574
11575 /// Sets the value of [unreachable][crate::model::ListSpokesResponse::unreachable].
11576 ///
11577 /// # Example
11578 /// ```ignore,no_run
11579 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11580 /// let x = ListSpokesResponse::new().set_unreachable(["a", "b", "c"]);
11581 /// ```
11582 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11583 where
11584 T: std::iter::IntoIterator<Item = V>,
11585 V: std::convert::Into<std::string::String>,
11586 {
11587 use std::iter::Iterator;
11588 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11589 self
11590 }
11591}
11592
11593impl wkt::message::Message for ListSpokesResponse {
11594 fn typename() -> &'static str {
11595 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesResponse"
11596 }
11597}
11598
11599#[doc(hidden)]
11600impl google_cloud_gax::paginator::internal::PageableResponse for ListSpokesResponse {
11601 type PageItem = crate::model::Spoke;
11602
11603 fn items(self) -> std::vec::Vec<Self::PageItem> {
11604 self.spokes
11605 }
11606
11607 fn next_page_token(&self) -> std::string::String {
11608 use std::clone::Clone;
11609 self.next_page_token.clone()
11610 }
11611}
11612
11613/// The request for
11614/// [HubService.GetSpoke][google.cloud.networkconnectivity.v1.HubService.GetSpoke].
11615///
11616/// [google.cloud.networkconnectivity.v1.HubService.GetSpoke]: crate::client::HubService::get_spoke
11617#[derive(Clone, Default, PartialEq)]
11618#[non_exhaustive]
11619pub struct GetSpokeRequest {
11620 /// Required. The name of the spoke resource.
11621 pub name: std::string::String,
11622
11623 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11624}
11625
11626impl GetSpokeRequest {
11627 pub fn new() -> Self {
11628 std::default::Default::default()
11629 }
11630
11631 /// Sets the value of [name][crate::model::GetSpokeRequest::name].
11632 ///
11633 /// # Example
11634 /// ```ignore,no_run
11635 /// # use google_cloud_networkconnectivity_v1::model::GetSpokeRequest;
11636 /// let x = GetSpokeRequest::new().set_name("example");
11637 /// ```
11638 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11639 self.name = v.into();
11640 self
11641 }
11642}
11643
11644impl wkt::message::Message for GetSpokeRequest {
11645 fn typename() -> &'static str {
11646 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetSpokeRequest"
11647 }
11648}
11649
11650/// The request for
11651/// [HubService.CreateSpoke][google.cloud.networkconnectivity.v1.HubService.CreateSpoke].
11652///
11653/// [google.cloud.networkconnectivity.v1.HubService.CreateSpoke]: crate::client::HubService::create_spoke
11654#[derive(Clone, Default, PartialEq)]
11655#[non_exhaustive]
11656pub struct CreateSpokeRequest {
11657 /// Required. The parent resource.
11658 pub parent: std::string::String,
11659
11660 /// Required. Unique id for the spoke to create.
11661 pub spoke_id: std::string::String,
11662
11663 /// Required. The initial values for a new spoke.
11664 pub spoke: std::option::Option<crate::model::Spoke>,
11665
11666 /// Optional. A request ID to identify requests. Specify a unique request ID so
11667 /// that if you must retry your request, the server knows to ignore the request
11668 /// if it has already been completed. The server guarantees that a request
11669 /// doesn't result in creation of duplicate commitments for at least 60
11670 /// minutes.
11671 ///
11672 /// For example, consider a situation where you make an initial request and
11673 /// the request times out. If you make the request again with the same request
11674 /// ID, the server can check to see whether the original operation
11675 /// was received. If it was, the server ignores the second request. This
11676 /// behavior prevents clients from mistakenly creating duplicate commitments.
11677 ///
11678 /// The request ID must be a valid UUID, with the exception that zero UUID is
11679 /// not supported (00000000-0000-0000-0000-000000000000).
11680 pub request_id: std::string::String,
11681
11682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11683}
11684
11685impl CreateSpokeRequest {
11686 pub fn new() -> Self {
11687 std::default::Default::default()
11688 }
11689
11690 /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
11691 ///
11692 /// # Example
11693 /// ```ignore,no_run
11694 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11695 /// let x = CreateSpokeRequest::new().set_parent("example");
11696 /// ```
11697 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11698 self.parent = v.into();
11699 self
11700 }
11701
11702 /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
11703 ///
11704 /// # Example
11705 /// ```ignore,no_run
11706 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11707 /// let x = CreateSpokeRequest::new().set_spoke_id("example");
11708 /// ```
11709 pub fn set_spoke_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11710 self.spoke_id = v.into();
11711 self
11712 }
11713
11714 /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
11715 ///
11716 /// # Example
11717 /// ```ignore,no_run
11718 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11719 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11720 /// let x = CreateSpokeRequest::new().set_spoke(Spoke::default()/* use setters */);
11721 /// ```
11722 pub fn set_spoke<T>(mut self, v: T) -> Self
11723 where
11724 T: std::convert::Into<crate::model::Spoke>,
11725 {
11726 self.spoke = std::option::Option::Some(v.into());
11727 self
11728 }
11729
11730 /// Sets or clears the value of [spoke][crate::model::CreateSpokeRequest::spoke].
11731 ///
11732 /// # Example
11733 /// ```ignore,no_run
11734 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11735 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11736 /// let x = CreateSpokeRequest::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
11737 /// let x = CreateSpokeRequest::new().set_or_clear_spoke(None::<Spoke>);
11738 /// ```
11739 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
11740 where
11741 T: std::convert::Into<crate::model::Spoke>,
11742 {
11743 self.spoke = v.map(|x| x.into());
11744 self
11745 }
11746
11747 /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
11748 ///
11749 /// # Example
11750 /// ```ignore,no_run
11751 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11752 /// let x = CreateSpokeRequest::new().set_request_id("example");
11753 /// ```
11754 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11755 self.request_id = v.into();
11756 self
11757 }
11758}
11759
11760impl wkt::message::Message for CreateSpokeRequest {
11761 fn typename() -> &'static str {
11762 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateSpokeRequest"
11763 }
11764}
11765
11766/// Request for
11767/// [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]
11768/// method.
11769///
11770/// [google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]: crate::client::HubService::update_spoke
11771#[derive(Clone, Default, PartialEq)]
11772#[non_exhaustive]
11773pub struct UpdateSpokeRequest {
11774 /// Optional. In the case of an update to an existing spoke, field mask is used
11775 /// to specify the fields to be overwritten. The fields specified in the
11776 /// update_mask are relative to the resource, not the full request. A field is
11777 /// overwritten if it is in the mask. If the user does not provide a mask, then
11778 /// all fields are overwritten.
11779 pub update_mask: std::option::Option<wkt::FieldMask>,
11780
11781 /// Required. The state that the spoke should be in after the update.
11782 pub spoke: std::option::Option<crate::model::Spoke>,
11783
11784 /// Optional. A request ID to identify requests. Specify a unique request ID so
11785 /// that if you must retry your request, the server knows to ignore the request
11786 /// if it has already been completed. The server guarantees that a request
11787 /// doesn't result in creation of duplicate commitments for at least 60
11788 /// minutes.
11789 ///
11790 /// For example, consider a situation where you make an initial request and
11791 /// the request times out. If you make the request again with the same request
11792 /// ID, the server can check to see whether the original operation
11793 /// was received. If it was, the server ignores the second request. This
11794 /// behavior prevents clients from mistakenly creating duplicate commitments.
11795 ///
11796 /// The request ID must be a valid UUID, with the exception that zero UUID is
11797 /// not supported (00000000-0000-0000-0000-000000000000).
11798 pub request_id: std::string::String,
11799
11800 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11801}
11802
11803impl UpdateSpokeRequest {
11804 pub fn new() -> Self {
11805 std::default::Default::default()
11806 }
11807
11808 /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
11809 ///
11810 /// # Example
11811 /// ```ignore,no_run
11812 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11813 /// use wkt::FieldMask;
11814 /// let x = UpdateSpokeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11815 /// ```
11816 pub fn set_update_mask<T>(mut self, v: T) -> Self
11817 where
11818 T: std::convert::Into<wkt::FieldMask>,
11819 {
11820 self.update_mask = std::option::Option::Some(v.into());
11821 self
11822 }
11823
11824 /// Sets or clears the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
11825 ///
11826 /// # Example
11827 /// ```ignore,no_run
11828 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11829 /// use wkt::FieldMask;
11830 /// let x = UpdateSpokeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11831 /// let x = UpdateSpokeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11832 /// ```
11833 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11834 where
11835 T: std::convert::Into<wkt::FieldMask>,
11836 {
11837 self.update_mask = v.map(|x| x.into());
11838 self
11839 }
11840
11841 /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
11842 ///
11843 /// # Example
11844 /// ```ignore,no_run
11845 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11846 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11847 /// let x = UpdateSpokeRequest::new().set_spoke(Spoke::default()/* use setters */);
11848 /// ```
11849 pub fn set_spoke<T>(mut self, v: T) -> Self
11850 where
11851 T: std::convert::Into<crate::model::Spoke>,
11852 {
11853 self.spoke = std::option::Option::Some(v.into());
11854 self
11855 }
11856
11857 /// Sets or clears the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
11858 ///
11859 /// # Example
11860 /// ```ignore,no_run
11861 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11862 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11863 /// let x = UpdateSpokeRequest::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
11864 /// let x = UpdateSpokeRequest::new().set_or_clear_spoke(None::<Spoke>);
11865 /// ```
11866 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
11867 where
11868 T: std::convert::Into<crate::model::Spoke>,
11869 {
11870 self.spoke = v.map(|x| x.into());
11871 self
11872 }
11873
11874 /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
11875 ///
11876 /// # Example
11877 /// ```ignore,no_run
11878 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
11879 /// let x = UpdateSpokeRequest::new().set_request_id("example");
11880 /// ```
11881 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11882 self.request_id = v.into();
11883 self
11884 }
11885}
11886
11887impl wkt::message::Message for UpdateSpokeRequest {
11888 fn typename() -> &'static str {
11889 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"
11890 }
11891}
11892
11893/// The request for
11894/// [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1.HubService.DeleteSpoke].
11895///
11896/// [google.cloud.networkconnectivity.v1.HubService.DeleteSpoke]: crate::client::HubService::delete_spoke
11897#[derive(Clone, Default, PartialEq)]
11898#[non_exhaustive]
11899pub struct DeleteSpokeRequest {
11900 /// Required. The name of the spoke to delete.
11901 pub name: std::string::String,
11902
11903 /// Optional. A request ID to identify requests. Specify a unique request ID so
11904 /// that if you must retry your request, the server knows to ignore the request
11905 /// if it has already been completed. The server guarantees that a request
11906 /// doesn't result in creation of duplicate commitments for at least 60
11907 /// minutes.
11908 ///
11909 /// For example, consider a situation where you make an initial request and
11910 /// the request times out. If you make the request again with the same request
11911 /// ID, the server can check to see whether the original operation
11912 /// was received. If it was, the server ignores the second request. This
11913 /// behavior prevents clients from mistakenly creating duplicate commitments.
11914 ///
11915 /// The request ID must be a valid UUID, with the exception that zero UUID is
11916 /// not supported (00000000-0000-0000-0000-000000000000).
11917 pub request_id: std::string::String,
11918
11919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11920}
11921
11922impl DeleteSpokeRequest {
11923 pub fn new() -> Self {
11924 std::default::Default::default()
11925 }
11926
11927 /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
11928 ///
11929 /// # Example
11930 /// ```ignore,no_run
11931 /// # use google_cloud_networkconnectivity_v1::model::DeleteSpokeRequest;
11932 /// let x = DeleteSpokeRequest::new().set_name("example");
11933 /// ```
11934 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11935 self.name = v.into();
11936 self
11937 }
11938
11939 /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
11940 ///
11941 /// # Example
11942 /// ```ignore,no_run
11943 /// # use google_cloud_networkconnectivity_v1::model::DeleteSpokeRequest;
11944 /// let x = DeleteSpokeRequest::new().set_request_id("example");
11945 /// ```
11946 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11947 self.request_id = v.into();
11948 self
11949 }
11950}
11951
11952impl wkt::message::Message for DeleteSpokeRequest {
11953 fn typename() -> &'static str {
11954 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"
11955 }
11956}
11957
11958/// The request for
11959/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
11960///
11961/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
11962#[derive(Clone, Default, PartialEq)]
11963#[non_exhaustive]
11964pub struct AcceptHubSpokeRequest {
11965 /// Required. The name of the hub into which to accept the spoke.
11966 pub name: std::string::String,
11967
11968 /// Required. The URI of the spoke to accept into the hub.
11969 pub spoke_uri: std::string::String,
11970
11971 /// Optional. A request ID to identify requests. Specify a unique request ID so
11972 /// that if you must retry your request, the server knows to ignore the request
11973 /// if it has already been completed. The server guarantees that a request
11974 /// doesn't result in creation of duplicate commitments for at least 60
11975 /// minutes.
11976 ///
11977 /// For example, consider a situation where you make an initial request and
11978 /// the request times out. If you make the request again with the same request
11979 /// ID, the server can check to see whether the original operation
11980 /// was received. If it was, the server ignores the second request. This
11981 /// behavior prevents clients from mistakenly creating duplicate commitments.
11982 ///
11983 /// The request ID must be a valid UUID, with the exception that zero UUID is
11984 /// not supported (00000000-0000-0000-0000-000000000000).
11985 pub request_id: std::string::String,
11986
11987 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11988}
11989
11990impl AcceptHubSpokeRequest {
11991 pub fn new() -> Self {
11992 std::default::Default::default()
11993 }
11994
11995 /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
11996 ///
11997 /// # Example
11998 /// ```ignore,no_run
11999 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12000 /// let x = AcceptHubSpokeRequest::new().set_name("example");
12001 /// ```
12002 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12003 self.name = v.into();
12004 self
12005 }
12006
12007 /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
12008 ///
12009 /// # Example
12010 /// ```ignore,no_run
12011 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12012 /// let x = AcceptHubSpokeRequest::new().set_spoke_uri("example");
12013 /// ```
12014 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12015 self.spoke_uri = v.into();
12016 self
12017 }
12018
12019 /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
12020 ///
12021 /// # Example
12022 /// ```ignore,no_run
12023 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12024 /// let x = AcceptHubSpokeRequest::new().set_request_id("example");
12025 /// ```
12026 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12027 self.request_id = v.into();
12028 self
12029 }
12030}
12031
12032impl wkt::message::Message for AcceptHubSpokeRequest {
12033 fn typename() -> &'static str {
12034 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"
12035 }
12036}
12037
12038/// The response for
12039/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
12040///
12041/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
12042#[derive(Clone, Default, PartialEq)]
12043#[non_exhaustive]
12044pub struct AcceptHubSpokeResponse {
12045 /// The spoke that was operated on.
12046 pub spoke: std::option::Option<crate::model::Spoke>,
12047
12048 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12049}
12050
12051impl AcceptHubSpokeResponse {
12052 pub fn new() -> Self {
12053 std::default::Default::default()
12054 }
12055
12056 /// Sets the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
12057 ///
12058 /// # Example
12059 /// ```ignore,no_run
12060 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeResponse;
12061 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12062 /// let x = AcceptHubSpokeResponse::new().set_spoke(Spoke::default()/* use setters */);
12063 /// ```
12064 pub fn set_spoke<T>(mut self, v: T) -> Self
12065 where
12066 T: std::convert::Into<crate::model::Spoke>,
12067 {
12068 self.spoke = std::option::Option::Some(v.into());
12069 self
12070 }
12071
12072 /// Sets or clears the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
12073 ///
12074 /// # Example
12075 /// ```ignore,no_run
12076 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeResponse;
12077 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12078 /// let x = AcceptHubSpokeResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12079 /// let x = AcceptHubSpokeResponse::new().set_or_clear_spoke(None::<Spoke>);
12080 /// ```
12081 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12082 where
12083 T: std::convert::Into<crate::model::Spoke>,
12084 {
12085 self.spoke = v.map(|x| x.into());
12086 self
12087 }
12088}
12089
12090impl wkt::message::Message for AcceptHubSpokeResponse {
12091 fn typename() -> &'static str {
12092 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"
12093 }
12094}
12095
12096/// The request for
12097/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
12098///
12099/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
12100#[derive(Clone, Default, PartialEq)]
12101#[non_exhaustive]
12102pub struct RejectHubSpokeRequest {
12103 /// Required. The name of the hub from which to reject the spoke.
12104 pub name: std::string::String,
12105
12106 /// Required. The URI of the spoke to reject from the hub.
12107 pub spoke_uri: std::string::String,
12108
12109 /// Optional. A request ID to identify requests. Specify a unique request ID so
12110 /// that if you must retry your request, the server knows to ignore the request
12111 /// if it has already been completed. The server guarantees that a request
12112 /// doesn't result in creation of duplicate commitments for at least 60
12113 /// minutes.
12114 ///
12115 /// For example, consider a situation where you make an initial request and
12116 /// the request times out. If you make the request again with the same request
12117 /// ID, the server can check to see whether the original operation
12118 /// was received. If it was, the server ignores the second request. This
12119 /// behavior prevents clients from mistakenly creating duplicate commitments.
12120 ///
12121 /// The request ID must be a valid UUID, with the exception that zero UUID is
12122 /// not supported (00000000-0000-0000-0000-000000000000).
12123 pub request_id: std::string::String,
12124
12125 /// Optional. Additional information provided by the hub administrator.
12126 pub details: std::string::String,
12127
12128 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12129}
12130
12131impl RejectHubSpokeRequest {
12132 pub fn new() -> Self {
12133 std::default::Default::default()
12134 }
12135
12136 /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
12137 ///
12138 /// # Example
12139 /// ```ignore,no_run
12140 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12141 /// let x = RejectHubSpokeRequest::new().set_name("example");
12142 /// ```
12143 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12144 self.name = v.into();
12145 self
12146 }
12147
12148 /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
12149 ///
12150 /// # Example
12151 /// ```ignore,no_run
12152 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12153 /// let x = RejectHubSpokeRequest::new().set_spoke_uri("example");
12154 /// ```
12155 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12156 self.spoke_uri = v.into();
12157 self
12158 }
12159
12160 /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
12161 ///
12162 /// # Example
12163 /// ```ignore,no_run
12164 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12165 /// let x = RejectHubSpokeRequest::new().set_request_id("example");
12166 /// ```
12167 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12168 self.request_id = v.into();
12169 self
12170 }
12171
12172 /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
12173 ///
12174 /// # Example
12175 /// ```ignore,no_run
12176 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12177 /// let x = RejectHubSpokeRequest::new().set_details("example");
12178 /// ```
12179 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12180 self.details = v.into();
12181 self
12182 }
12183}
12184
12185impl wkt::message::Message for RejectHubSpokeRequest {
12186 fn typename() -> &'static str {
12187 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"
12188 }
12189}
12190
12191/// The response for
12192/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
12193///
12194/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
12195#[derive(Clone, Default, PartialEq)]
12196#[non_exhaustive]
12197pub struct RejectHubSpokeResponse {
12198 /// The spoke that was operated on.
12199 pub spoke: std::option::Option<crate::model::Spoke>,
12200
12201 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12202}
12203
12204impl RejectHubSpokeResponse {
12205 pub fn new() -> Self {
12206 std::default::Default::default()
12207 }
12208
12209 /// Sets the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
12210 ///
12211 /// # Example
12212 /// ```ignore,no_run
12213 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeResponse;
12214 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12215 /// let x = RejectHubSpokeResponse::new().set_spoke(Spoke::default()/* use setters */);
12216 /// ```
12217 pub fn set_spoke<T>(mut self, v: T) -> Self
12218 where
12219 T: std::convert::Into<crate::model::Spoke>,
12220 {
12221 self.spoke = std::option::Option::Some(v.into());
12222 self
12223 }
12224
12225 /// Sets or clears the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
12226 ///
12227 /// # Example
12228 /// ```ignore,no_run
12229 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeResponse;
12230 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12231 /// let x = RejectHubSpokeResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12232 /// let x = RejectHubSpokeResponse::new().set_or_clear_spoke(None::<Spoke>);
12233 /// ```
12234 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12235 where
12236 T: std::convert::Into<crate::model::Spoke>,
12237 {
12238 self.spoke = v.map(|x| x.into());
12239 self
12240 }
12241}
12242
12243impl wkt::message::Message for RejectHubSpokeResponse {
12244 fn typename() -> &'static str {
12245 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"
12246 }
12247}
12248
12249/// The request for
12250/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
12251///
12252/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
12253#[derive(Clone, Default, PartialEq)]
12254#[non_exhaustive]
12255pub struct AcceptSpokeUpdateRequest {
12256 /// Required. The name of the hub to accept spoke update.
12257 pub name: std::string::String,
12258
12259 /// Required. The URI of the spoke to accept update.
12260 pub spoke_uri: std::string::String,
12261
12262 /// Required. The etag of the spoke to accept update.
12263 pub spoke_etag: std::string::String,
12264
12265 /// Optional. A request ID to identify requests. Specify a unique request ID so
12266 /// that if you must retry your request, the server knows to ignore the request
12267 /// if it has already been completed. The server guarantees that a request
12268 /// doesn't result in creation of duplicate commitments for at least 60
12269 /// minutes.
12270 ///
12271 /// For example, consider a situation where you make an initial request and
12272 /// the request times out. If you make the request again with the same request
12273 /// ID, the server can check to see whether the original operation
12274 /// was received. If it was, the server ignores the second request. This
12275 /// behavior prevents clients from mistakenly creating duplicate commitments.
12276 ///
12277 /// The request ID must be a valid UUID, with the exception that zero UUID is
12278 /// not supported (00000000-0000-0000-0000-000000000000).
12279 pub request_id: std::string::String,
12280
12281 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12282}
12283
12284impl AcceptSpokeUpdateRequest {
12285 pub fn new() -> Self {
12286 std::default::Default::default()
12287 }
12288
12289 /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
12290 ///
12291 /// # Example
12292 /// ```ignore,no_run
12293 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12294 /// let x = AcceptSpokeUpdateRequest::new().set_name("example");
12295 /// ```
12296 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12297 self.name = v.into();
12298 self
12299 }
12300
12301 /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
12302 ///
12303 /// # Example
12304 /// ```ignore,no_run
12305 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12306 /// let x = AcceptSpokeUpdateRequest::new().set_spoke_uri("example");
12307 /// ```
12308 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12309 self.spoke_uri = v.into();
12310 self
12311 }
12312
12313 /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
12314 ///
12315 /// # Example
12316 /// ```ignore,no_run
12317 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12318 /// let x = AcceptSpokeUpdateRequest::new().set_spoke_etag("example");
12319 /// ```
12320 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12321 self.spoke_etag = v.into();
12322 self
12323 }
12324
12325 /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
12326 ///
12327 /// # Example
12328 /// ```ignore,no_run
12329 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12330 /// let x = AcceptSpokeUpdateRequest::new().set_request_id("example");
12331 /// ```
12332 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12333 self.request_id = v.into();
12334 self
12335 }
12336}
12337
12338impl wkt::message::Message for AcceptSpokeUpdateRequest {
12339 fn typename() -> &'static str {
12340 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateRequest"
12341 }
12342}
12343
12344/// The response for
12345/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
12346///
12347/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
12348#[derive(Clone, Default, PartialEq)]
12349#[non_exhaustive]
12350pub struct AcceptSpokeUpdateResponse {
12351 /// The spoke that was operated on.
12352 pub spoke: std::option::Option<crate::model::Spoke>,
12353
12354 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12355}
12356
12357impl AcceptSpokeUpdateResponse {
12358 pub fn new() -> Self {
12359 std::default::Default::default()
12360 }
12361
12362 /// Sets the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
12363 ///
12364 /// # Example
12365 /// ```ignore,no_run
12366 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateResponse;
12367 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12368 /// let x = AcceptSpokeUpdateResponse::new().set_spoke(Spoke::default()/* use setters */);
12369 /// ```
12370 pub fn set_spoke<T>(mut self, v: T) -> Self
12371 where
12372 T: std::convert::Into<crate::model::Spoke>,
12373 {
12374 self.spoke = std::option::Option::Some(v.into());
12375 self
12376 }
12377
12378 /// Sets or clears the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
12379 ///
12380 /// # Example
12381 /// ```ignore,no_run
12382 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateResponse;
12383 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12384 /// let x = AcceptSpokeUpdateResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12385 /// let x = AcceptSpokeUpdateResponse::new().set_or_clear_spoke(None::<Spoke>);
12386 /// ```
12387 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12388 where
12389 T: std::convert::Into<crate::model::Spoke>,
12390 {
12391 self.spoke = v.map(|x| x.into());
12392 self
12393 }
12394}
12395
12396impl wkt::message::Message for AcceptSpokeUpdateResponse {
12397 fn typename() -> &'static str {
12398 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateResponse"
12399 }
12400}
12401
12402/// The request for
12403/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
12404///
12405/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
12406#[derive(Clone, Default, PartialEq)]
12407#[non_exhaustive]
12408pub struct RejectSpokeUpdateRequest {
12409 /// Required. The name of the hub to reject spoke update.
12410 pub name: std::string::String,
12411
12412 /// Required. The URI of the spoke to reject update.
12413 pub spoke_uri: std::string::String,
12414
12415 /// Required. The etag of the spoke to reject update.
12416 pub spoke_etag: std::string::String,
12417
12418 /// Optional. Additional information provided by the hub administrator.
12419 pub details: std::string::String,
12420
12421 /// Optional. A request ID to identify requests. Specify a unique request ID so
12422 /// that if you must retry your request, the server knows to ignore the request
12423 /// if it has already been completed. The server guarantees that a request
12424 /// doesn't result in creation of duplicate commitments for at least 60
12425 /// minutes.
12426 ///
12427 /// For example, consider a situation where you make an initial request and
12428 /// the request times out. If you make the request again with the same request
12429 /// ID, the server can check to see whether the original operation
12430 /// was received. If it was, the server ignores the second request. This
12431 /// behavior prevents clients from mistakenly creating duplicate commitments.
12432 ///
12433 /// The request ID must be a valid UUID, with the exception that zero UUID is
12434 /// not supported (00000000-0000-0000-0000-000000000000).
12435 pub request_id: std::string::String,
12436
12437 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12438}
12439
12440impl RejectSpokeUpdateRequest {
12441 pub fn new() -> Self {
12442 std::default::Default::default()
12443 }
12444
12445 /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
12446 ///
12447 /// # Example
12448 /// ```ignore,no_run
12449 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12450 /// let x = RejectSpokeUpdateRequest::new().set_name("example");
12451 /// ```
12452 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12453 self.name = v.into();
12454 self
12455 }
12456
12457 /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
12458 ///
12459 /// # Example
12460 /// ```ignore,no_run
12461 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12462 /// let x = RejectSpokeUpdateRequest::new().set_spoke_uri("example");
12463 /// ```
12464 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12465 self.spoke_uri = v.into();
12466 self
12467 }
12468
12469 /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
12470 ///
12471 /// # Example
12472 /// ```ignore,no_run
12473 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12474 /// let x = RejectSpokeUpdateRequest::new().set_spoke_etag("example");
12475 /// ```
12476 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12477 self.spoke_etag = v.into();
12478 self
12479 }
12480
12481 /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
12482 ///
12483 /// # Example
12484 /// ```ignore,no_run
12485 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12486 /// let x = RejectSpokeUpdateRequest::new().set_details("example");
12487 /// ```
12488 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12489 self.details = v.into();
12490 self
12491 }
12492
12493 /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
12494 ///
12495 /// # Example
12496 /// ```ignore,no_run
12497 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12498 /// let x = RejectSpokeUpdateRequest::new().set_request_id("example");
12499 /// ```
12500 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12501 self.request_id = v.into();
12502 self
12503 }
12504}
12505
12506impl wkt::message::Message for RejectSpokeUpdateRequest {
12507 fn typename() -> &'static str {
12508 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateRequest"
12509 }
12510}
12511
12512/// The response for
12513/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
12514///
12515/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
12516#[derive(Clone, Default, PartialEq)]
12517#[non_exhaustive]
12518pub struct RejectSpokeUpdateResponse {
12519 /// The spoke that was operated on.
12520 pub spoke: std::option::Option<crate::model::Spoke>,
12521
12522 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12523}
12524
12525impl RejectSpokeUpdateResponse {
12526 pub fn new() -> Self {
12527 std::default::Default::default()
12528 }
12529
12530 /// Sets the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
12531 ///
12532 /// # Example
12533 /// ```ignore,no_run
12534 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateResponse;
12535 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12536 /// let x = RejectSpokeUpdateResponse::new().set_spoke(Spoke::default()/* use setters */);
12537 /// ```
12538 pub fn set_spoke<T>(mut self, v: T) -> Self
12539 where
12540 T: std::convert::Into<crate::model::Spoke>,
12541 {
12542 self.spoke = std::option::Option::Some(v.into());
12543 self
12544 }
12545
12546 /// Sets or clears the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
12547 ///
12548 /// # Example
12549 /// ```ignore,no_run
12550 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateResponse;
12551 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12552 /// let x = RejectSpokeUpdateResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12553 /// let x = RejectSpokeUpdateResponse::new().set_or_clear_spoke(None::<Spoke>);
12554 /// ```
12555 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12556 where
12557 T: std::convert::Into<crate::model::Spoke>,
12558 {
12559 self.spoke = v.map(|x| x.into());
12560 self
12561 }
12562}
12563
12564impl wkt::message::Message for RejectSpokeUpdateResponse {
12565 fn typename() -> &'static str {
12566 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateResponse"
12567 }
12568}
12569
12570/// The request for
12571/// [HubService.GetRouteTable][google.cloud.networkconnectivity.v1.HubService.GetRouteTable].
12572///
12573/// [google.cloud.networkconnectivity.v1.HubService.GetRouteTable]: crate::client::HubService::get_route_table
12574#[derive(Clone, Default, PartialEq)]
12575#[non_exhaustive]
12576pub struct GetRouteTableRequest {
12577 /// Required. The name of the route table resource.
12578 pub name: std::string::String,
12579
12580 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12581}
12582
12583impl GetRouteTableRequest {
12584 pub fn new() -> Self {
12585 std::default::Default::default()
12586 }
12587
12588 /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
12589 ///
12590 /// # Example
12591 /// ```ignore,no_run
12592 /// # use google_cloud_networkconnectivity_v1::model::GetRouteTableRequest;
12593 /// let x = GetRouteTableRequest::new().set_name("example");
12594 /// ```
12595 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12596 self.name = v.into();
12597 self
12598 }
12599}
12600
12601impl wkt::message::Message for GetRouteTableRequest {
12602 fn typename() -> &'static str {
12603 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteTableRequest"
12604 }
12605}
12606
12607/// The request for
12608/// [HubService.GetRoute][google.cloud.networkconnectivity.v1.HubService.GetRoute].
12609///
12610/// [google.cloud.networkconnectivity.v1.HubService.GetRoute]: crate::client::HubService::get_route
12611#[derive(Clone, Default, PartialEq)]
12612#[non_exhaustive]
12613pub struct GetRouteRequest {
12614 /// Required. The name of the route resource.
12615 pub name: std::string::String,
12616
12617 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12618}
12619
12620impl GetRouteRequest {
12621 pub fn new() -> Self {
12622 std::default::Default::default()
12623 }
12624
12625 /// Sets the value of [name][crate::model::GetRouteRequest::name].
12626 ///
12627 /// # Example
12628 /// ```ignore,no_run
12629 /// # use google_cloud_networkconnectivity_v1::model::GetRouteRequest;
12630 /// let x = GetRouteRequest::new().set_name("example");
12631 /// ```
12632 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12633 self.name = v.into();
12634 self
12635 }
12636}
12637
12638impl wkt::message::Message for GetRouteRequest {
12639 fn typename() -> &'static str {
12640 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteRequest"
12641 }
12642}
12643
12644/// Request for
12645/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
12646/// method.
12647///
12648/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
12649#[derive(Clone, Default, PartialEq)]
12650#[non_exhaustive]
12651pub struct ListRoutesRequest {
12652 /// Required. The parent resource's name.
12653 pub parent: std::string::String,
12654
12655 /// The maximum number of results to return per page.
12656 pub page_size: i32,
12657
12658 /// The page token.
12659 pub page_token: std::string::String,
12660
12661 /// An expression that filters the list of results.
12662 pub filter: std::string::String,
12663
12664 /// Sort the results by a certain order.
12665 pub order_by: std::string::String,
12666
12667 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12668}
12669
12670impl ListRoutesRequest {
12671 pub fn new() -> Self {
12672 std::default::Default::default()
12673 }
12674
12675 /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
12676 ///
12677 /// # Example
12678 /// ```ignore,no_run
12679 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12680 /// let x = ListRoutesRequest::new().set_parent("example");
12681 /// ```
12682 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12683 self.parent = v.into();
12684 self
12685 }
12686
12687 /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
12688 ///
12689 /// # Example
12690 /// ```ignore,no_run
12691 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12692 /// let x = ListRoutesRequest::new().set_page_size(42);
12693 /// ```
12694 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12695 self.page_size = v.into();
12696 self
12697 }
12698
12699 /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
12700 ///
12701 /// # Example
12702 /// ```ignore,no_run
12703 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12704 /// let x = ListRoutesRequest::new().set_page_token("example");
12705 /// ```
12706 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12707 self.page_token = v.into();
12708 self
12709 }
12710
12711 /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
12712 ///
12713 /// # Example
12714 /// ```ignore,no_run
12715 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12716 /// let x = ListRoutesRequest::new().set_filter("example");
12717 /// ```
12718 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12719 self.filter = v.into();
12720 self
12721 }
12722
12723 /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
12724 ///
12725 /// # Example
12726 /// ```ignore,no_run
12727 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12728 /// let x = ListRoutesRequest::new().set_order_by("example");
12729 /// ```
12730 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12731 self.order_by = v.into();
12732 self
12733 }
12734}
12735
12736impl wkt::message::Message for ListRoutesRequest {
12737 fn typename() -> &'static str {
12738 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesRequest"
12739 }
12740}
12741
12742/// Response for
12743/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
12744/// method.
12745///
12746/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
12747#[derive(Clone, Default, PartialEq)]
12748#[non_exhaustive]
12749pub struct ListRoutesResponse {
12750 /// The requested routes.
12751 pub routes: std::vec::Vec<crate::model::Route>,
12752
12753 /// The token for the next page of the response. To see more results,
12754 /// use this value as the page_token for your next request. If this value
12755 /// is empty, there are no more results.
12756 pub next_page_token: std::string::String,
12757
12758 /// RouteTables that could not be reached.
12759 pub unreachable: std::vec::Vec<std::string::String>,
12760
12761 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12762}
12763
12764impl ListRoutesResponse {
12765 pub fn new() -> Self {
12766 std::default::Default::default()
12767 }
12768
12769 /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
12770 ///
12771 /// # Example
12772 /// ```ignore,no_run
12773 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
12774 /// use google_cloud_networkconnectivity_v1::model::Route;
12775 /// let x = ListRoutesResponse::new()
12776 /// .set_routes([
12777 /// Route::default()/* use setters */,
12778 /// Route::default()/* use (different) setters */,
12779 /// ]);
12780 /// ```
12781 pub fn set_routes<T, V>(mut self, v: T) -> Self
12782 where
12783 T: std::iter::IntoIterator<Item = V>,
12784 V: std::convert::Into<crate::model::Route>,
12785 {
12786 use std::iter::Iterator;
12787 self.routes = v.into_iter().map(|i| i.into()).collect();
12788 self
12789 }
12790
12791 /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
12792 ///
12793 /// # Example
12794 /// ```ignore,no_run
12795 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
12796 /// let x = ListRoutesResponse::new().set_next_page_token("example");
12797 /// ```
12798 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12799 self.next_page_token = v.into();
12800 self
12801 }
12802
12803 /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
12804 ///
12805 /// # Example
12806 /// ```ignore,no_run
12807 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
12808 /// let x = ListRoutesResponse::new().set_unreachable(["a", "b", "c"]);
12809 /// ```
12810 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12811 where
12812 T: std::iter::IntoIterator<Item = V>,
12813 V: std::convert::Into<std::string::String>,
12814 {
12815 use std::iter::Iterator;
12816 self.unreachable = v.into_iter().map(|i| i.into()).collect();
12817 self
12818 }
12819}
12820
12821impl wkt::message::Message for ListRoutesResponse {
12822 fn typename() -> &'static str {
12823 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesResponse"
12824 }
12825}
12826
12827#[doc(hidden)]
12828impl google_cloud_gax::paginator::internal::PageableResponse for ListRoutesResponse {
12829 type PageItem = crate::model::Route;
12830
12831 fn items(self) -> std::vec::Vec<Self::PageItem> {
12832 self.routes
12833 }
12834
12835 fn next_page_token(&self) -> std::string::String {
12836 use std::clone::Clone;
12837 self.next_page_token.clone()
12838 }
12839}
12840
12841/// Request for
12842/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
12843/// method.
12844///
12845/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
12846#[derive(Clone, Default, PartialEq)]
12847#[non_exhaustive]
12848pub struct ListRouteTablesRequest {
12849 /// Required. The parent resource's name.
12850 pub parent: std::string::String,
12851
12852 /// The maximum number of results to return per page.
12853 pub page_size: i32,
12854
12855 /// The page token.
12856 pub page_token: std::string::String,
12857
12858 /// An expression that filters the list of results.
12859 pub filter: std::string::String,
12860
12861 /// Sort the results by a certain order.
12862 pub order_by: std::string::String,
12863
12864 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12865}
12866
12867impl ListRouteTablesRequest {
12868 pub fn new() -> Self {
12869 std::default::Default::default()
12870 }
12871
12872 /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
12873 ///
12874 /// # Example
12875 /// ```ignore,no_run
12876 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12877 /// let x = ListRouteTablesRequest::new().set_parent("example");
12878 /// ```
12879 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12880 self.parent = v.into();
12881 self
12882 }
12883
12884 /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
12885 ///
12886 /// # Example
12887 /// ```ignore,no_run
12888 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12889 /// let x = ListRouteTablesRequest::new().set_page_size(42);
12890 /// ```
12891 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12892 self.page_size = v.into();
12893 self
12894 }
12895
12896 /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
12897 ///
12898 /// # Example
12899 /// ```ignore,no_run
12900 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12901 /// let x = ListRouteTablesRequest::new().set_page_token("example");
12902 /// ```
12903 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12904 self.page_token = v.into();
12905 self
12906 }
12907
12908 /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
12909 ///
12910 /// # Example
12911 /// ```ignore,no_run
12912 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12913 /// let x = ListRouteTablesRequest::new().set_filter("example");
12914 /// ```
12915 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12916 self.filter = v.into();
12917 self
12918 }
12919
12920 /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
12921 ///
12922 /// # Example
12923 /// ```ignore,no_run
12924 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
12925 /// let x = ListRouteTablesRequest::new().set_order_by("example");
12926 /// ```
12927 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12928 self.order_by = v.into();
12929 self
12930 }
12931}
12932
12933impl wkt::message::Message for ListRouteTablesRequest {
12934 fn typename() -> &'static str {
12935 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"
12936 }
12937}
12938
12939/// Response for
12940/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
12941/// method.
12942///
12943/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
12944#[derive(Clone, Default, PartialEq)]
12945#[non_exhaustive]
12946pub struct ListRouteTablesResponse {
12947 /// The requested route tables.
12948 pub route_tables: std::vec::Vec<crate::model::RouteTable>,
12949
12950 /// The token for the next page of the response. To see more results,
12951 /// use this value as the page_token for your next request. If this value
12952 /// is empty, there are no more results.
12953 pub next_page_token: std::string::String,
12954
12955 /// Hubs that could not be reached.
12956 pub unreachable: std::vec::Vec<std::string::String>,
12957
12958 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12959}
12960
12961impl ListRouteTablesResponse {
12962 pub fn new() -> Self {
12963 std::default::Default::default()
12964 }
12965
12966 /// Sets the value of [route_tables][crate::model::ListRouteTablesResponse::route_tables].
12967 ///
12968 /// # Example
12969 /// ```ignore,no_run
12970 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
12971 /// use google_cloud_networkconnectivity_v1::model::RouteTable;
12972 /// let x = ListRouteTablesResponse::new()
12973 /// .set_route_tables([
12974 /// RouteTable::default()/* use setters */,
12975 /// RouteTable::default()/* use (different) setters */,
12976 /// ]);
12977 /// ```
12978 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
12979 where
12980 T: std::iter::IntoIterator<Item = V>,
12981 V: std::convert::Into<crate::model::RouteTable>,
12982 {
12983 use std::iter::Iterator;
12984 self.route_tables = v.into_iter().map(|i| i.into()).collect();
12985 self
12986 }
12987
12988 /// Sets the value of [next_page_token][crate::model::ListRouteTablesResponse::next_page_token].
12989 ///
12990 /// # Example
12991 /// ```ignore,no_run
12992 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
12993 /// let x = ListRouteTablesResponse::new().set_next_page_token("example");
12994 /// ```
12995 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12996 self.next_page_token = v.into();
12997 self
12998 }
12999
13000 /// Sets the value of [unreachable][crate::model::ListRouteTablesResponse::unreachable].
13001 ///
13002 /// # Example
13003 /// ```ignore,no_run
13004 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
13005 /// let x = ListRouteTablesResponse::new().set_unreachable(["a", "b", "c"]);
13006 /// ```
13007 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13008 where
13009 T: std::iter::IntoIterator<Item = V>,
13010 V: std::convert::Into<std::string::String>,
13011 {
13012 use std::iter::Iterator;
13013 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13014 self
13015 }
13016}
13017
13018impl wkt::message::Message for ListRouteTablesResponse {
13019 fn typename() -> &'static str {
13020 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"
13021 }
13022}
13023
13024#[doc(hidden)]
13025impl google_cloud_gax::paginator::internal::PageableResponse for ListRouteTablesResponse {
13026 type PageItem = crate::model::RouteTable;
13027
13028 fn items(self) -> std::vec::Vec<Self::PageItem> {
13029 self.route_tables
13030 }
13031
13032 fn next_page_token(&self) -> std::string::String {
13033 use std::clone::Clone;
13034 self.next_page_token.clone()
13035 }
13036}
13037
13038/// Request for
13039/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
13040/// method.
13041///
13042/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
13043#[derive(Clone, Default, PartialEq)]
13044#[non_exhaustive]
13045pub struct ListGroupsRequest {
13046 /// Required. The parent resource's name.
13047 pub parent: std::string::String,
13048
13049 /// The maximum number of results to return per page.
13050 pub page_size: i32,
13051
13052 /// The page token.
13053 pub page_token: std::string::String,
13054
13055 /// An expression that filters the list of results.
13056 pub filter: std::string::String,
13057
13058 /// Sort the results by a certain order.
13059 pub order_by: std::string::String,
13060
13061 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13062}
13063
13064impl ListGroupsRequest {
13065 pub fn new() -> Self {
13066 std::default::Default::default()
13067 }
13068
13069 /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
13070 ///
13071 /// # Example
13072 /// ```ignore,no_run
13073 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13074 /// let x = ListGroupsRequest::new().set_parent("example");
13075 /// ```
13076 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13077 self.parent = v.into();
13078 self
13079 }
13080
13081 /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
13082 ///
13083 /// # Example
13084 /// ```ignore,no_run
13085 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13086 /// let x = ListGroupsRequest::new().set_page_size(42);
13087 /// ```
13088 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13089 self.page_size = v.into();
13090 self
13091 }
13092
13093 /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
13094 ///
13095 /// # Example
13096 /// ```ignore,no_run
13097 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13098 /// let x = ListGroupsRequest::new().set_page_token("example");
13099 /// ```
13100 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13101 self.page_token = v.into();
13102 self
13103 }
13104
13105 /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
13106 ///
13107 /// # Example
13108 /// ```ignore,no_run
13109 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13110 /// let x = ListGroupsRequest::new().set_filter("example");
13111 /// ```
13112 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13113 self.filter = v.into();
13114 self
13115 }
13116
13117 /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
13118 ///
13119 /// # Example
13120 /// ```ignore,no_run
13121 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13122 /// let x = ListGroupsRequest::new().set_order_by("example");
13123 /// ```
13124 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13125 self.order_by = v.into();
13126 self
13127 }
13128}
13129
13130impl wkt::message::Message for ListGroupsRequest {
13131 fn typename() -> &'static str {
13132 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsRequest"
13133 }
13134}
13135
13136/// Response for
13137/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
13138/// method.
13139///
13140/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
13141#[derive(Clone, Default, PartialEq)]
13142#[non_exhaustive]
13143pub struct ListGroupsResponse {
13144 /// The requested groups.
13145 pub groups: std::vec::Vec<crate::model::Group>,
13146
13147 /// The token for the next page of the response. To see more results,
13148 /// use this value as the page_token for your next request. If this value
13149 /// is empty, there are no more results.
13150 pub next_page_token: std::string::String,
13151
13152 /// Hubs that could not be reached.
13153 pub unreachable: std::vec::Vec<std::string::String>,
13154
13155 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13156}
13157
13158impl ListGroupsResponse {
13159 pub fn new() -> Self {
13160 std::default::Default::default()
13161 }
13162
13163 /// Sets the value of [groups][crate::model::ListGroupsResponse::groups].
13164 ///
13165 /// # Example
13166 /// ```ignore,no_run
13167 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13168 /// use google_cloud_networkconnectivity_v1::model::Group;
13169 /// let x = ListGroupsResponse::new()
13170 /// .set_groups([
13171 /// Group::default()/* use setters */,
13172 /// Group::default()/* use (different) setters */,
13173 /// ]);
13174 /// ```
13175 pub fn set_groups<T, V>(mut self, v: T) -> Self
13176 where
13177 T: std::iter::IntoIterator<Item = V>,
13178 V: std::convert::Into<crate::model::Group>,
13179 {
13180 use std::iter::Iterator;
13181 self.groups = v.into_iter().map(|i| i.into()).collect();
13182 self
13183 }
13184
13185 /// Sets the value of [next_page_token][crate::model::ListGroupsResponse::next_page_token].
13186 ///
13187 /// # Example
13188 /// ```ignore,no_run
13189 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13190 /// let x = ListGroupsResponse::new().set_next_page_token("example");
13191 /// ```
13192 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13193 self.next_page_token = v.into();
13194 self
13195 }
13196
13197 /// Sets the value of [unreachable][crate::model::ListGroupsResponse::unreachable].
13198 ///
13199 /// # Example
13200 /// ```ignore,no_run
13201 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13202 /// let x = ListGroupsResponse::new().set_unreachable(["a", "b", "c"]);
13203 /// ```
13204 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13205 where
13206 T: std::iter::IntoIterator<Item = V>,
13207 V: std::convert::Into<std::string::String>,
13208 {
13209 use std::iter::Iterator;
13210 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13211 self
13212 }
13213}
13214
13215impl wkt::message::Message for ListGroupsResponse {
13216 fn typename() -> &'static str {
13217 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsResponse"
13218 }
13219}
13220
13221#[doc(hidden)]
13222impl google_cloud_gax::paginator::internal::PageableResponse for ListGroupsResponse {
13223 type PageItem = crate::model::Group;
13224
13225 fn items(self) -> std::vec::Vec<Self::PageItem> {
13226 self.groups
13227 }
13228
13229 fn next_page_token(&self) -> std::string::String {
13230 use std::clone::Clone;
13231 self.next_page_token.clone()
13232 }
13233}
13234
13235/// A collection of Cloud VPN tunnel resources. These resources should be
13236/// redundant HA VPN tunnels that all advertise the same prefixes to Google
13237/// Cloud. Alternatively, in a passive/active configuration, all tunnels
13238/// should be capable of advertising the same prefixes.
13239#[derive(Clone, Default, PartialEq)]
13240#[non_exhaustive]
13241pub struct LinkedVpnTunnels {
13242 /// The URIs of linked VPN tunnel resources.
13243 pub uris: std::vec::Vec<std::string::String>,
13244
13245 /// A value that controls whether site-to-site data transfer is enabled for
13246 /// these resources. Data transfer is available only in [supported
13247 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13248 pub site_to_site_data_transfer: bool,
13249
13250 /// Output only. The VPC network where these VPN tunnels are located.
13251 pub vpc_network: std::string::String,
13252
13253 /// Optional. IP ranges allowed to be included during import from hub (does not
13254 /// control transit connectivity). The only allowed value for now is
13255 /// "ALL_IPV4_RANGES".
13256 pub include_import_ranges: std::vec::Vec<std::string::String>,
13257
13258 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13259}
13260
13261impl LinkedVpnTunnels {
13262 pub fn new() -> Self {
13263 std::default::Default::default()
13264 }
13265
13266 /// Sets the value of [uris][crate::model::LinkedVpnTunnels::uris].
13267 ///
13268 /// # Example
13269 /// ```ignore,no_run
13270 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13271 /// let x = LinkedVpnTunnels::new().set_uris(["a", "b", "c"]);
13272 /// ```
13273 pub fn set_uris<T, V>(mut self, v: T) -> Self
13274 where
13275 T: std::iter::IntoIterator<Item = V>,
13276 V: std::convert::Into<std::string::String>,
13277 {
13278 use std::iter::Iterator;
13279 self.uris = v.into_iter().map(|i| i.into()).collect();
13280 self
13281 }
13282
13283 /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedVpnTunnels::site_to_site_data_transfer].
13284 ///
13285 /// # Example
13286 /// ```ignore,no_run
13287 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13288 /// let x = LinkedVpnTunnels::new().set_site_to_site_data_transfer(true);
13289 /// ```
13290 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13291 self.site_to_site_data_transfer = v.into();
13292 self
13293 }
13294
13295 /// Sets the value of [vpc_network][crate::model::LinkedVpnTunnels::vpc_network].
13296 ///
13297 /// # Example
13298 /// ```ignore,no_run
13299 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13300 /// let x = LinkedVpnTunnels::new().set_vpc_network("example");
13301 /// ```
13302 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13303 self.vpc_network = v.into();
13304 self
13305 }
13306
13307 /// Sets the value of [include_import_ranges][crate::model::LinkedVpnTunnels::include_import_ranges].
13308 ///
13309 /// # Example
13310 /// ```ignore,no_run
13311 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13312 /// let x = LinkedVpnTunnels::new().set_include_import_ranges(["a", "b", "c"]);
13313 /// ```
13314 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13315 where
13316 T: std::iter::IntoIterator<Item = V>,
13317 V: std::convert::Into<std::string::String>,
13318 {
13319 use std::iter::Iterator;
13320 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13321 self
13322 }
13323}
13324
13325impl wkt::message::Message for LinkedVpnTunnels {
13326 fn typename() -> &'static str {
13327 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"
13328 }
13329}
13330
13331/// A collection of VLAN attachment resources. These resources should
13332/// be redundant attachments that all advertise the same prefixes to Google
13333/// Cloud. Alternatively, in active/passive configurations, all attachments
13334/// should be capable of advertising the same prefixes.
13335#[derive(Clone, Default, PartialEq)]
13336#[non_exhaustive]
13337pub struct LinkedInterconnectAttachments {
13338 /// The URIs of linked interconnect attachment resources
13339 pub uris: std::vec::Vec<std::string::String>,
13340
13341 /// A value that controls whether site-to-site data transfer is enabled for
13342 /// these resources. Data transfer is available only in [supported
13343 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13344 pub site_to_site_data_transfer: bool,
13345
13346 /// Output only. The VPC network where these VLAN attachments are located.
13347 pub vpc_network: std::string::String,
13348
13349 /// Optional. IP ranges allowed to be included during import from hub (does not
13350 /// control transit connectivity). The only allowed value for now is
13351 /// "ALL_IPV4_RANGES".
13352 pub include_import_ranges: std::vec::Vec<std::string::String>,
13353
13354 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13355}
13356
13357impl LinkedInterconnectAttachments {
13358 pub fn new() -> Self {
13359 std::default::Default::default()
13360 }
13361
13362 /// Sets the value of [uris][crate::model::LinkedInterconnectAttachments::uris].
13363 ///
13364 /// # Example
13365 /// ```ignore,no_run
13366 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13367 /// let x = LinkedInterconnectAttachments::new().set_uris(["a", "b", "c"]);
13368 /// ```
13369 pub fn set_uris<T, V>(mut self, v: T) -> Self
13370 where
13371 T: std::iter::IntoIterator<Item = V>,
13372 V: std::convert::Into<std::string::String>,
13373 {
13374 use std::iter::Iterator;
13375 self.uris = v.into_iter().map(|i| i.into()).collect();
13376 self
13377 }
13378
13379 /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedInterconnectAttachments::site_to_site_data_transfer].
13380 ///
13381 /// # Example
13382 /// ```ignore,no_run
13383 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13384 /// let x = LinkedInterconnectAttachments::new().set_site_to_site_data_transfer(true);
13385 /// ```
13386 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13387 self.site_to_site_data_transfer = v.into();
13388 self
13389 }
13390
13391 /// Sets the value of [vpc_network][crate::model::LinkedInterconnectAttachments::vpc_network].
13392 ///
13393 /// # Example
13394 /// ```ignore,no_run
13395 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13396 /// let x = LinkedInterconnectAttachments::new().set_vpc_network("example");
13397 /// ```
13398 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13399 self.vpc_network = v.into();
13400 self
13401 }
13402
13403 /// Sets the value of [include_import_ranges][crate::model::LinkedInterconnectAttachments::include_import_ranges].
13404 ///
13405 /// # Example
13406 /// ```ignore,no_run
13407 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13408 /// let x = LinkedInterconnectAttachments::new().set_include_import_ranges(["a", "b", "c"]);
13409 /// ```
13410 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13411 where
13412 T: std::iter::IntoIterator<Item = V>,
13413 V: std::convert::Into<std::string::String>,
13414 {
13415 use std::iter::Iterator;
13416 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13417 self
13418 }
13419}
13420
13421impl wkt::message::Message for LinkedInterconnectAttachments {
13422 fn typename() -> &'static str {
13423 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"
13424 }
13425}
13426
13427/// A collection of router appliance instances. If you configure multiple router
13428/// appliance instances to receive data from the same set of sites outside of
13429/// Google Cloud, we recommend that you associate those instances with the same
13430/// spoke.
13431#[derive(Clone, Default, PartialEq)]
13432#[non_exhaustive]
13433pub struct LinkedRouterApplianceInstances {
13434 /// The list of router appliance instances.
13435 pub instances: std::vec::Vec<crate::model::RouterApplianceInstance>,
13436
13437 /// A value that controls whether site-to-site data transfer is enabled for
13438 /// these resources. Data transfer is available only in [supported
13439 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13440 pub site_to_site_data_transfer: bool,
13441
13442 /// Output only. The VPC network where these router appliance instances are
13443 /// located.
13444 pub vpc_network: std::string::String,
13445
13446 /// Optional. IP ranges allowed to be included during import from hub (does not
13447 /// control transit connectivity). The only allowed value for now is
13448 /// "ALL_IPV4_RANGES".
13449 pub include_import_ranges: std::vec::Vec<std::string::String>,
13450
13451 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13452}
13453
13454impl LinkedRouterApplianceInstances {
13455 pub fn new() -> Self {
13456 std::default::Default::default()
13457 }
13458
13459 /// Sets the value of [instances][crate::model::LinkedRouterApplianceInstances::instances].
13460 ///
13461 /// # Example
13462 /// ```ignore,no_run
13463 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13464 /// use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
13465 /// let x = LinkedRouterApplianceInstances::new()
13466 /// .set_instances([
13467 /// RouterApplianceInstance::default()/* use setters */,
13468 /// RouterApplianceInstance::default()/* use (different) setters */,
13469 /// ]);
13470 /// ```
13471 pub fn set_instances<T, V>(mut self, v: T) -> Self
13472 where
13473 T: std::iter::IntoIterator<Item = V>,
13474 V: std::convert::Into<crate::model::RouterApplianceInstance>,
13475 {
13476 use std::iter::Iterator;
13477 self.instances = v.into_iter().map(|i| i.into()).collect();
13478 self
13479 }
13480
13481 /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedRouterApplianceInstances::site_to_site_data_transfer].
13482 ///
13483 /// # Example
13484 /// ```ignore,no_run
13485 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13486 /// let x = LinkedRouterApplianceInstances::new().set_site_to_site_data_transfer(true);
13487 /// ```
13488 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13489 self.site_to_site_data_transfer = v.into();
13490 self
13491 }
13492
13493 /// Sets the value of [vpc_network][crate::model::LinkedRouterApplianceInstances::vpc_network].
13494 ///
13495 /// # Example
13496 /// ```ignore,no_run
13497 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13498 /// let x = LinkedRouterApplianceInstances::new().set_vpc_network("example");
13499 /// ```
13500 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13501 self.vpc_network = v.into();
13502 self
13503 }
13504
13505 /// Sets the value of [include_import_ranges][crate::model::LinkedRouterApplianceInstances::include_import_ranges].
13506 ///
13507 /// # Example
13508 /// ```ignore,no_run
13509 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13510 /// let x = LinkedRouterApplianceInstances::new().set_include_import_ranges(["a", "b", "c"]);
13511 /// ```
13512 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13513 where
13514 T: std::iter::IntoIterator<Item = V>,
13515 V: std::convert::Into<std::string::String>,
13516 {
13517 use std::iter::Iterator;
13518 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13519 self
13520 }
13521}
13522
13523impl wkt::message::Message for LinkedRouterApplianceInstances {
13524 fn typename() -> &'static str {
13525 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"
13526 }
13527}
13528
13529/// An existing VPC network.
13530#[derive(Clone, Default, PartialEq)]
13531#[non_exhaustive]
13532pub struct LinkedVpcNetwork {
13533 /// Required. The URI of the VPC network resource.
13534 pub uri: std::string::String,
13535
13536 /// Optional. IP ranges encompassing the subnets to be excluded from peering.
13537 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
13538
13539 /// Optional. IP ranges allowed to be included from peering.
13540 pub include_export_ranges: std::vec::Vec<std::string::String>,
13541
13542 /// Optional. The proposed include export IP ranges waiting for hub
13543 /// administration's approval.
13544 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
13545
13546 /// Output only. The proposed exclude export IP ranges waiting for hub
13547 /// administration's approval.
13548 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
13549
13550 /// Output only. The list of Producer VPC spokes that this VPC spoke is a
13551 /// service consumer VPC spoke for. These producer VPCs are connected through
13552 /// VPC peering to this spoke's backing VPC network. Because they are directly
13553 /// connected throuh VPC peering, NCC export filters do not apply between the
13554 /// service consumer VPC spoke and any of its producer VPC spokes. This VPC
13555 /// spoke cannot be deleted as long as any of these producer VPC spokes are
13556 /// connected to the NCC Hub.
13557 pub producer_vpc_spokes: std::vec::Vec<std::string::String>,
13558
13559 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13560}
13561
13562impl LinkedVpcNetwork {
13563 pub fn new() -> Self {
13564 std::default::Default::default()
13565 }
13566
13567 /// Sets the value of [uri][crate::model::LinkedVpcNetwork::uri].
13568 ///
13569 /// # Example
13570 /// ```ignore,no_run
13571 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13572 /// let x = LinkedVpcNetwork::new().set_uri("example");
13573 /// ```
13574 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13575 self.uri = v.into();
13576 self
13577 }
13578
13579 /// Sets the value of [exclude_export_ranges][crate::model::LinkedVpcNetwork::exclude_export_ranges].
13580 ///
13581 /// # Example
13582 /// ```ignore,no_run
13583 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13584 /// let x = LinkedVpcNetwork::new().set_exclude_export_ranges(["a", "b", "c"]);
13585 /// ```
13586 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13587 where
13588 T: std::iter::IntoIterator<Item = V>,
13589 V: std::convert::Into<std::string::String>,
13590 {
13591 use std::iter::Iterator;
13592 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13593 self
13594 }
13595
13596 /// Sets the value of [include_export_ranges][crate::model::LinkedVpcNetwork::include_export_ranges].
13597 ///
13598 /// # Example
13599 /// ```ignore,no_run
13600 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13601 /// let x = LinkedVpcNetwork::new().set_include_export_ranges(["a", "b", "c"]);
13602 /// ```
13603 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
13604 where
13605 T: std::iter::IntoIterator<Item = V>,
13606 V: std::convert::Into<std::string::String>,
13607 {
13608 use std::iter::Iterator;
13609 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13610 self
13611 }
13612
13613 /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedVpcNetwork::proposed_include_export_ranges].
13614 ///
13615 /// # Example
13616 /// ```ignore,no_run
13617 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13618 /// let x = LinkedVpcNetwork::new().set_proposed_include_export_ranges(["a", "b", "c"]);
13619 /// ```
13620 pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
13621 where
13622 T: std::iter::IntoIterator<Item = V>,
13623 V: std::convert::Into<std::string::String>,
13624 {
13625 use std::iter::Iterator;
13626 self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13627 self
13628 }
13629
13630 /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedVpcNetwork::proposed_exclude_export_ranges].
13631 ///
13632 /// # Example
13633 /// ```ignore,no_run
13634 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13635 /// let x = LinkedVpcNetwork::new().set_proposed_exclude_export_ranges(["a", "b", "c"]);
13636 /// ```
13637 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13638 where
13639 T: std::iter::IntoIterator<Item = V>,
13640 V: std::convert::Into<std::string::String>,
13641 {
13642 use std::iter::Iterator;
13643 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13644 self
13645 }
13646
13647 /// Sets the value of [producer_vpc_spokes][crate::model::LinkedVpcNetwork::producer_vpc_spokes].
13648 ///
13649 /// # Example
13650 /// ```ignore,no_run
13651 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13652 /// let x = LinkedVpcNetwork::new().set_producer_vpc_spokes(["a", "b", "c"]);
13653 /// ```
13654 pub fn set_producer_vpc_spokes<T, V>(mut self, v: T) -> Self
13655 where
13656 T: std::iter::IntoIterator<Item = V>,
13657 V: std::convert::Into<std::string::String>,
13658 {
13659 use std::iter::Iterator;
13660 self.producer_vpc_spokes = v.into_iter().map(|i| i.into()).collect();
13661 self
13662 }
13663}
13664
13665impl wkt::message::Message for LinkedVpcNetwork {
13666 fn typename() -> &'static str {
13667 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"
13668 }
13669}
13670
13671#[derive(Clone, Default, PartialEq)]
13672#[non_exhaustive]
13673pub struct LinkedProducerVpcNetwork {
13674 /// Immutable. The URI of the Service Consumer VPC that the Producer VPC is
13675 /// peered with.
13676 pub network: std::string::String,
13677
13678 /// Output only. The Service Consumer Network spoke.
13679 pub service_consumer_vpc_spoke: std::string::String,
13680
13681 /// Immutable. The name of the VPC peering between the Service Consumer VPC and
13682 /// the Producer VPC (defined in the Tenant project) which is added to the NCC
13683 /// hub. This peering must be in ACTIVE state.
13684 pub peering: std::string::String,
13685
13686 /// Output only. The URI of the Producer VPC.
13687 pub producer_network: std::string::String,
13688
13689 /// Optional. IP ranges encompassing the subnets to be excluded from peering.
13690 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
13691
13692 /// Optional. IP ranges allowed to be included from peering.
13693 pub include_export_ranges: std::vec::Vec<std::string::String>,
13694
13695 /// Optional. The proposed include export IP ranges waiting for hub
13696 /// administration's approval.
13697 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
13698
13699 /// Output only. The proposed exclude export IP ranges waiting for hub
13700 /// administration's approval.
13701 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
13702
13703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13704}
13705
13706impl LinkedProducerVpcNetwork {
13707 pub fn new() -> Self {
13708 std::default::Default::default()
13709 }
13710
13711 /// Sets the value of [network][crate::model::LinkedProducerVpcNetwork::network].
13712 ///
13713 /// # Example
13714 /// ```ignore,no_run
13715 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13716 /// let x = LinkedProducerVpcNetwork::new().set_network("example");
13717 /// ```
13718 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13719 self.network = v.into();
13720 self
13721 }
13722
13723 /// Sets the value of [service_consumer_vpc_spoke][crate::model::LinkedProducerVpcNetwork::service_consumer_vpc_spoke].
13724 ///
13725 /// # Example
13726 /// ```ignore,no_run
13727 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13728 /// let x = LinkedProducerVpcNetwork::new().set_service_consumer_vpc_spoke("example");
13729 /// ```
13730 pub fn set_service_consumer_vpc_spoke<T: std::convert::Into<std::string::String>>(
13731 mut self,
13732 v: T,
13733 ) -> Self {
13734 self.service_consumer_vpc_spoke = v.into();
13735 self
13736 }
13737
13738 /// Sets the value of [peering][crate::model::LinkedProducerVpcNetwork::peering].
13739 ///
13740 /// # Example
13741 /// ```ignore,no_run
13742 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13743 /// let x = LinkedProducerVpcNetwork::new().set_peering("example");
13744 /// ```
13745 pub fn set_peering<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13746 self.peering = v.into();
13747 self
13748 }
13749
13750 /// Sets the value of [producer_network][crate::model::LinkedProducerVpcNetwork::producer_network].
13751 ///
13752 /// # Example
13753 /// ```ignore,no_run
13754 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13755 /// let x = LinkedProducerVpcNetwork::new().set_producer_network("example");
13756 /// ```
13757 pub fn set_producer_network<T: std::convert::Into<std::string::String>>(
13758 mut self,
13759 v: T,
13760 ) -> Self {
13761 self.producer_network = v.into();
13762 self
13763 }
13764
13765 /// Sets the value of [exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::exclude_export_ranges].
13766 ///
13767 /// # Example
13768 /// ```ignore,no_run
13769 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13770 /// let x = LinkedProducerVpcNetwork::new().set_exclude_export_ranges(["a", "b", "c"]);
13771 /// ```
13772 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13773 where
13774 T: std::iter::IntoIterator<Item = V>,
13775 V: std::convert::Into<std::string::String>,
13776 {
13777 use std::iter::Iterator;
13778 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13779 self
13780 }
13781
13782 /// Sets the value of [include_export_ranges][crate::model::LinkedProducerVpcNetwork::include_export_ranges].
13783 ///
13784 /// # Example
13785 /// ```ignore,no_run
13786 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13787 /// let x = LinkedProducerVpcNetwork::new().set_include_export_ranges(["a", "b", "c"]);
13788 /// ```
13789 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
13790 where
13791 T: std::iter::IntoIterator<Item = V>,
13792 V: std::convert::Into<std::string::String>,
13793 {
13794 use std::iter::Iterator;
13795 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13796 self
13797 }
13798
13799 /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_include_export_ranges].
13800 ///
13801 /// # Example
13802 /// ```ignore,no_run
13803 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13804 /// let x = LinkedProducerVpcNetwork::new().set_proposed_include_export_ranges(["a", "b", "c"]);
13805 /// ```
13806 pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
13807 where
13808 T: std::iter::IntoIterator<Item = V>,
13809 V: std::convert::Into<std::string::String>,
13810 {
13811 use std::iter::Iterator;
13812 self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13813 self
13814 }
13815
13816 /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_exclude_export_ranges].
13817 ///
13818 /// # Example
13819 /// ```ignore,no_run
13820 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13821 /// let x = LinkedProducerVpcNetwork::new().set_proposed_exclude_export_ranges(["a", "b", "c"]);
13822 /// ```
13823 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13824 where
13825 T: std::iter::IntoIterator<Item = V>,
13826 V: std::convert::Into<std::string::String>,
13827 {
13828 use std::iter::Iterator;
13829 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13830 self
13831 }
13832}
13833
13834impl wkt::message::Message for LinkedProducerVpcNetwork {
13835 fn typename() -> &'static str {
13836 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedProducerVpcNetwork"
13837 }
13838}
13839
13840/// A router appliance instance is a Compute Engine virtual machine (VM) instance
13841/// that acts as a BGP speaker. A router appliance instance is specified by the
13842/// URI of the VM and the internal IP address of one of the VM's network
13843/// interfaces.
13844#[derive(Clone, Default, PartialEq)]
13845#[non_exhaustive]
13846pub struct RouterApplianceInstance {
13847 /// The URI of the VM.
13848 pub virtual_machine: std::string::String,
13849
13850 /// The IP address on the VM to use for peering.
13851 pub ip_address: std::string::String,
13852
13853 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13854}
13855
13856impl RouterApplianceInstance {
13857 pub fn new() -> Self {
13858 std::default::Default::default()
13859 }
13860
13861 /// Sets the value of [virtual_machine][crate::model::RouterApplianceInstance::virtual_machine].
13862 ///
13863 /// # Example
13864 /// ```ignore,no_run
13865 /// # use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
13866 /// let x = RouterApplianceInstance::new().set_virtual_machine("example");
13867 /// ```
13868 pub fn set_virtual_machine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13869 self.virtual_machine = v.into();
13870 self
13871 }
13872
13873 /// Sets the value of [ip_address][crate::model::RouterApplianceInstance::ip_address].
13874 ///
13875 /// # Example
13876 /// ```ignore,no_run
13877 /// # use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
13878 /// let x = RouterApplianceInstance::new().set_ip_address("example");
13879 /// ```
13880 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13881 self.ip_address = v.into();
13882 self
13883 }
13884}
13885
13886impl wkt::message::Message for RouterApplianceInstance {
13887 fn typename() -> &'static str {
13888 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouterApplianceInstance"
13889 }
13890}
13891
13892/// Metadata about locations
13893#[derive(Clone, Default, PartialEq)]
13894#[non_exhaustive]
13895pub struct LocationMetadata {
13896 /// List of supported features
13897 pub location_features: std::vec::Vec<crate::model::LocationFeature>,
13898
13899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13900}
13901
13902impl LocationMetadata {
13903 pub fn new() -> Self {
13904 std::default::Default::default()
13905 }
13906
13907 /// Sets the value of [location_features][crate::model::LocationMetadata::location_features].
13908 ///
13909 /// # Example
13910 /// ```ignore,no_run
13911 /// # use google_cloud_networkconnectivity_v1::model::LocationMetadata;
13912 /// use google_cloud_networkconnectivity_v1::model::LocationFeature;
13913 /// let x = LocationMetadata::new().set_location_features([
13914 /// LocationFeature::SiteToCloudSpokes,
13915 /// LocationFeature::SiteToSiteSpokes,
13916 /// ]);
13917 /// ```
13918 pub fn set_location_features<T, V>(mut self, v: T) -> Self
13919 where
13920 T: std::iter::IntoIterator<Item = V>,
13921 V: std::convert::Into<crate::model::LocationFeature>,
13922 {
13923 use std::iter::Iterator;
13924 self.location_features = v.into_iter().map(|i| i.into()).collect();
13925 self
13926 }
13927}
13928
13929impl wkt::message::Message for LocationMetadata {
13930 fn typename() -> &'static str {
13931 "type.googleapis.com/google.cloud.networkconnectivity.v1.LocationMetadata"
13932 }
13933}
13934
13935#[derive(Clone, Default, PartialEq)]
13936#[non_exhaustive]
13937pub struct NextHopVpcNetwork {
13938 /// The URI of the VPC network resource
13939 pub uri: std::string::String,
13940
13941 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13942}
13943
13944impl NextHopVpcNetwork {
13945 pub fn new() -> Self {
13946 std::default::Default::default()
13947 }
13948
13949 /// Sets the value of [uri][crate::model::NextHopVpcNetwork::uri].
13950 ///
13951 /// # Example
13952 /// ```ignore,no_run
13953 /// # use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
13954 /// let x = NextHopVpcNetwork::new().set_uri("example");
13955 /// ```
13956 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13957 self.uri = v.into();
13958 self
13959 }
13960}
13961
13962impl wkt::message::Message for NextHopVpcNetwork {
13963 fn typename() -> &'static str {
13964 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"
13965 }
13966}
13967
13968/// A route next hop that leads to a VPN tunnel resource.
13969#[derive(Clone, Default, PartialEq)]
13970#[non_exhaustive]
13971pub struct NextHopVPNTunnel {
13972 /// The URI of the VPN tunnel resource.
13973 pub uri: std::string::String,
13974
13975 /// The VPC network where this VPN tunnel is located.
13976 pub vpc_network: std::string::String,
13977
13978 /// Indicates whether site-to-site data transfer is allowed for this VPN tunnel
13979 /// resource. Data transfer is available only in [supported
13980 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13981 pub site_to_site_data_transfer: bool,
13982
13983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13984}
13985
13986impl NextHopVPNTunnel {
13987 pub fn new() -> Self {
13988 std::default::Default::default()
13989 }
13990
13991 /// Sets the value of [uri][crate::model::NextHopVPNTunnel::uri].
13992 ///
13993 /// # Example
13994 /// ```ignore,no_run
13995 /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
13996 /// let x = NextHopVPNTunnel::new().set_uri("example");
13997 /// ```
13998 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13999 self.uri = v.into();
14000 self
14001 }
14002
14003 /// Sets the value of [vpc_network][crate::model::NextHopVPNTunnel::vpc_network].
14004 ///
14005 /// # Example
14006 /// ```ignore,no_run
14007 /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
14008 /// let x = NextHopVPNTunnel::new().set_vpc_network("example");
14009 /// ```
14010 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14011 self.vpc_network = v.into();
14012 self
14013 }
14014
14015 /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopVPNTunnel::site_to_site_data_transfer].
14016 ///
14017 /// # Example
14018 /// ```ignore,no_run
14019 /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
14020 /// let x = NextHopVPNTunnel::new().set_site_to_site_data_transfer(true);
14021 /// ```
14022 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14023 self.site_to_site_data_transfer = v.into();
14024 self
14025 }
14026}
14027
14028impl wkt::message::Message for NextHopVPNTunnel {
14029 fn typename() -> &'static str {
14030 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVPNTunnel"
14031 }
14032}
14033
14034/// A route next hop that leads to a Router appliance instance.
14035#[derive(Clone, Default, PartialEq)]
14036#[non_exhaustive]
14037pub struct NextHopRouterApplianceInstance {
14038 /// The URI of the Router appliance instance.
14039 pub uri: std::string::String,
14040
14041 /// The VPC network where this VM is located.
14042 pub vpc_network: std::string::String,
14043
14044 /// Indicates whether site-to-site data transfer is allowed for this Router
14045 /// appliance instance resource. Data transfer is available only in [supported
14046 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
14047 pub site_to_site_data_transfer: bool,
14048
14049 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14050}
14051
14052impl NextHopRouterApplianceInstance {
14053 pub fn new() -> Self {
14054 std::default::Default::default()
14055 }
14056
14057 /// Sets the value of [uri][crate::model::NextHopRouterApplianceInstance::uri].
14058 ///
14059 /// # Example
14060 /// ```ignore,no_run
14061 /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14062 /// let x = NextHopRouterApplianceInstance::new().set_uri("example");
14063 /// ```
14064 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14065 self.uri = v.into();
14066 self
14067 }
14068
14069 /// Sets the value of [vpc_network][crate::model::NextHopRouterApplianceInstance::vpc_network].
14070 ///
14071 /// # Example
14072 /// ```ignore,no_run
14073 /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14074 /// let x = NextHopRouterApplianceInstance::new().set_vpc_network("example");
14075 /// ```
14076 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14077 self.vpc_network = v.into();
14078 self
14079 }
14080
14081 /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopRouterApplianceInstance::site_to_site_data_transfer].
14082 ///
14083 /// # Example
14084 /// ```ignore,no_run
14085 /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14086 /// let x = NextHopRouterApplianceInstance::new().set_site_to_site_data_transfer(true);
14087 /// ```
14088 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14089 self.site_to_site_data_transfer = v.into();
14090 self
14091 }
14092}
14093
14094impl wkt::message::Message for NextHopRouterApplianceInstance {
14095 fn typename() -> &'static str {
14096 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance"
14097 }
14098}
14099
14100/// A route next hop that leads to an interconnect attachment resource.
14101#[derive(Clone, Default, PartialEq)]
14102#[non_exhaustive]
14103pub struct NextHopInterconnectAttachment {
14104 /// The URI of the interconnect attachment resource.
14105 pub uri: std::string::String,
14106
14107 /// The VPC network where this interconnect attachment is located.
14108 pub vpc_network: std::string::String,
14109
14110 /// Indicates whether site-to-site data transfer is allowed for this
14111 /// interconnect attachment resource. Data transfer is available only in
14112 /// [supported
14113 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
14114 pub site_to_site_data_transfer: bool,
14115
14116 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14117}
14118
14119impl NextHopInterconnectAttachment {
14120 pub fn new() -> Self {
14121 std::default::Default::default()
14122 }
14123
14124 /// Sets the value of [uri][crate::model::NextHopInterconnectAttachment::uri].
14125 ///
14126 /// # Example
14127 /// ```ignore,no_run
14128 /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14129 /// let x = NextHopInterconnectAttachment::new().set_uri("example");
14130 /// ```
14131 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14132 self.uri = v.into();
14133 self
14134 }
14135
14136 /// Sets the value of [vpc_network][crate::model::NextHopInterconnectAttachment::vpc_network].
14137 ///
14138 /// # Example
14139 /// ```ignore,no_run
14140 /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14141 /// let x = NextHopInterconnectAttachment::new().set_vpc_network("example");
14142 /// ```
14143 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14144 self.vpc_network = v.into();
14145 self
14146 }
14147
14148 /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopInterconnectAttachment::site_to_site_data_transfer].
14149 ///
14150 /// # Example
14151 /// ```ignore,no_run
14152 /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14153 /// let x = NextHopInterconnectAttachment::new().set_site_to_site_data_transfer(true);
14154 /// ```
14155 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14156 self.site_to_site_data_transfer = v.into();
14157 self
14158 }
14159}
14160
14161impl wkt::message::Message for NextHopInterconnectAttachment {
14162 fn typename() -> &'static str {
14163 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopInterconnectAttachment"
14164 }
14165}
14166
14167/// Summarizes information about the spokes associated with a hub.
14168/// The summary includes a count of spokes according to type
14169/// and according to state. If any spokes are inactive,
14170/// the summary also lists the reasons they are inactive,
14171/// including a count for each reason.
14172#[derive(Clone, Default, PartialEq)]
14173#[non_exhaustive]
14174pub struct SpokeSummary {
14175 /// Output only. Counts the number of spokes of each type that are
14176 /// associated with a specific hub.
14177 pub spoke_type_counts: std::vec::Vec<crate::model::spoke_summary::SpokeTypeCount>,
14178
14179 /// Output only. Counts the number of spokes that are in each state
14180 /// and associated with a given hub.
14181 pub spoke_state_counts: std::vec::Vec<crate::model::spoke_summary::SpokeStateCount>,
14182
14183 /// Output only. Counts the number of spokes that are inactive for each
14184 /// possible reason and associated with a given hub.
14185 pub spoke_state_reason_counts:
14186 std::vec::Vec<crate::model::spoke_summary::SpokeStateReasonCount>,
14187
14188 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14189}
14190
14191impl SpokeSummary {
14192 pub fn new() -> Self {
14193 std::default::Default::default()
14194 }
14195
14196 /// Sets the value of [spoke_type_counts][crate::model::SpokeSummary::spoke_type_counts].
14197 ///
14198 /// # Example
14199 /// ```ignore,no_run
14200 /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14201 /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14202 /// let x = SpokeSummary::new()
14203 /// .set_spoke_type_counts([
14204 /// SpokeTypeCount::default()/* use setters */,
14205 /// SpokeTypeCount::default()/* use (different) setters */,
14206 /// ]);
14207 /// ```
14208 pub fn set_spoke_type_counts<T, V>(mut self, v: T) -> Self
14209 where
14210 T: std::iter::IntoIterator<Item = V>,
14211 V: std::convert::Into<crate::model::spoke_summary::SpokeTypeCount>,
14212 {
14213 use std::iter::Iterator;
14214 self.spoke_type_counts = v.into_iter().map(|i| i.into()).collect();
14215 self
14216 }
14217
14218 /// Sets the value of [spoke_state_counts][crate::model::SpokeSummary::spoke_state_counts].
14219 ///
14220 /// # Example
14221 /// ```ignore,no_run
14222 /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14223 /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14224 /// let x = SpokeSummary::new()
14225 /// .set_spoke_state_counts([
14226 /// SpokeStateCount::default()/* use setters */,
14227 /// SpokeStateCount::default()/* use (different) setters */,
14228 /// ]);
14229 /// ```
14230 pub fn set_spoke_state_counts<T, V>(mut self, v: T) -> Self
14231 where
14232 T: std::iter::IntoIterator<Item = V>,
14233 V: std::convert::Into<crate::model::spoke_summary::SpokeStateCount>,
14234 {
14235 use std::iter::Iterator;
14236 self.spoke_state_counts = v.into_iter().map(|i| i.into()).collect();
14237 self
14238 }
14239
14240 /// Sets the value of [spoke_state_reason_counts][crate::model::SpokeSummary::spoke_state_reason_counts].
14241 ///
14242 /// # Example
14243 /// ```ignore,no_run
14244 /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14245 /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14246 /// let x = SpokeSummary::new()
14247 /// .set_spoke_state_reason_counts([
14248 /// SpokeStateReasonCount::default()/* use setters */,
14249 /// SpokeStateReasonCount::default()/* use (different) setters */,
14250 /// ]);
14251 /// ```
14252 pub fn set_spoke_state_reason_counts<T, V>(mut self, v: T) -> Self
14253 where
14254 T: std::iter::IntoIterator<Item = V>,
14255 V: std::convert::Into<crate::model::spoke_summary::SpokeStateReasonCount>,
14256 {
14257 use std::iter::Iterator;
14258 self.spoke_state_reason_counts = v.into_iter().map(|i| i.into()).collect();
14259 self
14260 }
14261}
14262
14263impl wkt::message::Message for SpokeSummary {
14264 fn typename() -> &'static str {
14265 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary"
14266 }
14267}
14268
14269/// Defines additional types related to [SpokeSummary].
14270pub mod spoke_summary {
14271 #[allow(unused_imports)]
14272 use super::*;
14273
14274 /// The number of spokes of a given type that are associated
14275 /// with a specific hub. The type indicates what kind of
14276 /// resource is associated with the spoke.
14277 #[derive(Clone, Default, PartialEq)]
14278 #[non_exhaustive]
14279 pub struct SpokeTypeCount {
14280 /// Output only. The type of the spokes.
14281 pub spoke_type: crate::model::SpokeType,
14282
14283 /// Output only. The total number of spokes of this type that are
14284 /// associated with the hub.
14285 pub count: i64,
14286
14287 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14288 }
14289
14290 impl SpokeTypeCount {
14291 pub fn new() -> Self {
14292 std::default::Default::default()
14293 }
14294
14295 /// Sets the value of [spoke_type][crate::model::spoke_summary::SpokeTypeCount::spoke_type].
14296 ///
14297 /// # Example
14298 /// ```ignore,no_run
14299 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14300 /// use google_cloud_networkconnectivity_v1::model::SpokeType;
14301 /// let x0 = SpokeTypeCount::new().set_spoke_type(SpokeType::VpnTunnel);
14302 /// let x1 = SpokeTypeCount::new().set_spoke_type(SpokeType::InterconnectAttachment);
14303 /// let x2 = SpokeTypeCount::new().set_spoke_type(SpokeType::RouterAppliance);
14304 /// ```
14305 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(
14306 mut self,
14307 v: T,
14308 ) -> Self {
14309 self.spoke_type = v.into();
14310 self
14311 }
14312
14313 /// Sets the value of [count][crate::model::spoke_summary::SpokeTypeCount::count].
14314 ///
14315 /// # Example
14316 /// ```ignore,no_run
14317 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14318 /// let x = SpokeTypeCount::new().set_count(42);
14319 /// ```
14320 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14321 self.count = v.into();
14322 self
14323 }
14324 }
14325
14326 impl wkt::message::Message for SpokeTypeCount {
14327 fn typename() -> &'static str {
14328 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"
14329 }
14330 }
14331
14332 /// The number of spokes that are in a particular state
14333 /// and associated with a given hub.
14334 #[derive(Clone, Default, PartialEq)]
14335 #[non_exhaustive]
14336 pub struct SpokeStateCount {
14337 /// Output only. The state of the spokes.
14338 pub state: crate::model::State,
14339
14340 /// Output only. The total number of spokes that are in this state
14341 /// and associated with a given hub.
14342 pub count: i64,
14343
14344 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14345 }
14346
14347 impl SpokeStateCount {
14348 pub fn new() -> Self {
14349 std::default::Default::default()
14350 }
14351
14352 /// Sets the value of [state][crate::model::spoke_summary::SpokeStateCount::state].
14353 ///
14354 /// # Example
14355 /// ```ignore,no_run
14356 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14357 /// use google_cloud_networkconnectivity_v1::model::State;
14358 /// let x0 = SpokeStateCount::new().set_state(State::Creating);
14359 /// let x1 = SpokeStateCount::new().set_state(State::Active);
14360 /// let x2 = SpokeStateCount::new().set_state(State::Deleting);
14361 /// ```
14362 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
14363 self.state = v.into();
14364 self
14365 }
14366
14367 /// Sets the value of [count][crate::model::spoke_summary::SpokeStateCount::count].
14368 ///
14369 /// # Example
14370 /// ```ignore,no_run
14371 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14372 /// let x = SpokeStateCount::new().set_count(42);
14373 /// ```
14374 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14375 self.count = v.into();
14376 self
14377 }
14378 }
14379
14380 impl wkt::message::Message for SpokeStateCount {
14381 fn typename() -> &'static str {
14382 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"
14383 }
14384 }
14385
14386 /// The number of spokes in the hub that are inactive for this reason.
14387 #[derive(Clone, Default, PartialEq)]
14388 #[non_exhaustive]
14389 pub struct SpokeStateReasonCount {
14390 /// Output only. The reason that a spoke is inactive.
14391 pub state_reason_code: crate::model::spoke::state_reason::Code,
14392
14393 /// Output only. The total number of spokes that are inactive for a
14394 /// particular reason and associated with a given hub.
14395 pub count: i64,
14396
14397 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14398 }
14399
14400 impl SpokeStateReasonCount {
14401 pub fn new() -> Self {
14402 std::default::Default::default()
14403 }
14404
14405 /// Sets the value of [state_reason_code][crate::model::spoke_summary::SpokeStateReasonCount::state_reason_code].
14406 ///
14407 /// # Example
14408 /// ```ignore,no_run
14409 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14410 /// use google_cloud_networkconnectivity_v1::model::spoke::state_reason::Code;
14411 /// let x0 = SpokeStateReasonCount::new().set_state_reason_code(Code::PendingReview);
14412 /// let x1 = SpokeStateReasonCount::new().set_state_reason_code(Code::Rejected);
14413 /// let x2 = SpokeStateReasonCount::new().set_state_reason_code(Code::Paused);
14414 /// ```
14415 pub fn set_state_reason_code<
14416 T: std::convert::Into<crate::model::spoke::state_reason::Code>,
14417 >(
14418 mut self,
14419 v: T,
14420 ) -> Self {
14421 self.state_reason_code = v.into();
14422 self
14423 }
14424
14425 /// Sets the value of [count][crate::model::spoke_summary::SpokeStateReasonCount::count].
14426 ///
14427 /// # Example
14428 /// ```ignore,no_run
14429 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14430 /// let x = SpokeStateReasonCount::new().set_count(42);
14431 /// ```
14432 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14433 self.count = v.into();
14434 self
14435 }
14436 }
14437
14438 impl wkt::message::Message for SpokeStateReasonCount {
14439 fn typename() -> &'static str {
14440 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"
14441 }
14442 }
14443}
14444
14445/// The request for
14446/// [HubService.GetGroup][google.cloud.networkconnectivity.v1.HubService.GetGroup].
14447///
14448/// [google.cloud.networkconnectivity.v1.HubService.GetGroup]: crate::client::HubService::get_group
14449#[derive(Clone, Default, PartialEq)]
14450#[non_exhaustive]
14451pub struct GetGroupRequest {
14452 /// Required. The name of the route table resource.
14453 pub name: std::string::String,
14454
14455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14456}
14457
14458impl GetGroupRequest {
14459 pub fn new() -> Self {
14460 std::default::Default::default()
14461 }
14462
14463 /// Sets the value of [name][crate::model::GetGroupRequest::name].
14464 ///
14465 /// # Example
14466 /// ```ignore,no_run
14467 /// # use google_cloud_networkconnectivity_v1::model::GetGroupRequest;
14468 /// let x = GetGroupRequest::new().set_name("example");
14469 /// ```
14470 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14471 self.name = v.into();
14472 self
14473 }
14474}
14475
14476impl wkt::message::Message for GetGroupRequest {
14477 fn typename() -> &'static str {
14478 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetGroupRequest"
14479 }
14480}
14481
14482/// Request for
14483/// [HubService.UpdateGroup][google.cloud.networkconnectivity.v1.HubService.UpdateGroup]
14484/// method.
14485///
14486/// [google.cloud.networkconnectivity.v1.HubService.UpdateGroup]: crate::client::HubService::update_group
14487#[derive(Clone, Default, PartialEq)]
14488#[non_exhaustive]
14489pub struct UpdateGroupRequest {
14490 /// Optional. In the case of an update to an existing group, field mask is used
14491 /// to specify the fields to be overwritten. The fields specified in the
14492 /// update_mask are relative to the resource, not the full request. A field is
14493 /// overwritten if it is in the mask. If the user does not provide a mask, then
14494 /// all fields are overwritten.
14495 pub update_mask: std::option::Option<wkt::FieldMask>,
14496
14497 /// Required. The state that the group should be in after the update.
14498 pub group: std::option::Option<crate::model::Group>,
14499
14500 /// Optional. A request ID to identify requests. Specify a unique request ID so
14501 /// that if you must retry your request, the server knows to ignore the request
14502 /// if it has already been completed. The server guarantees that a request
14503 /// doesn't result in creation of duplicate commitments for at least 60
14504 /// minutes.
14505 ///
14506 /// For example, consider a situation where you make an initial request and
14507 /// the request times out. If you make the request again with the same request
14508 /// ID, the server can check to see whether the original operation
14509 /// was received. If it was, the server ignores the second request. This
14510 /// behavior prevents clients from mistakenly creating duplicate commitments.
14511 ///
14512 /// The request ID must be a valid UUID, with the exception that zero UUID is
14513 /// not supported (00000000-0000-0000-0000-000000000000).
14514 pub request_id: std::string::String,
14515
14516 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14517}
14518
14519impl UpdateGroupRequest {
14520 pub fn new() -> Self {
14521 std::default::Default::default()
14522 }
14523
14524 /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
14525 ///
14526 /// # Example
14527 /// ```ignore,no_run
14528 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14529 /// use wkt::FieldMask;
14530 /// let x = UpdateGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
14531 /// ```
14532 pub fn set_update_mask<T>(mut self, v: T) -> Self
14533 where
14534 T: std::convert::Into<wkt::FieldMask>,
14535 {
14536 self.update_mask = std::option::Option::Some(v.into());
14537 self
14538 }
14539
14540 /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
14541 ///
14542 /// # Example
14543 /// ```ignore,no_run
14544 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14545 /// use wkt::FieldMask;
14546 /// let x = UpdateGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
14547 /// let x = UpdateGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
14548 /// ```
14549 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14550 where
14551 T: std::convert::Into<wkt::FieldMask>,
14552 {
14553 self.update_mask = v.map(|x| x.into());
14554 self
14555 }
14556
14557 /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
14558 ///
14559 /// # Example
14560 /// ```ignore,no_run
14561 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14562 /// use google_cloud_networkconnectivity_v1::model::Group;
14563 /// let x = UpdateGroupRequest::new().set_group(Group::default()/* use setters */);
14564 /// ```
14565 pub fn set_group<T>(mut self, v: T) -> Self
14566 where
14567 T: std::convert::Into<crate::model::Group>,
14568 {
14569 self.group = std::option::Option::Some(v.into());
14570 self
14571 }
14572
14573 /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
14574 ///
14575 /// # Example
14576 /// ```ignore,no_run
14577 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14578 /// use google_cloud_networkconnectivity_v1::model::Group;
14579 /// let x = UpdateGroupRequest::new().set_or_clear_group(Some(Group::default()/* use setters */));
14580 /// let x = UpdateGroupRequest::new().set_or_clear_group(None::<Group>);
14581 /// ```
14582 pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
14583 where
14584 T: std::convert::Into<crate::model::Group>,
14585 {
14586 self.group = v.map(|x| x.into());
14587 self
14588 }
14589
14590 /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
14591 ///
14592 /// # Example
14593 /// ```ignore,no_run
14594 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14595 /// let x = UpdateGroupRequest::new().set_request_id("example");
14596 /// ```
14597 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14598 self.request_id = v.into();
14599 self
14600 }
14601}
14602
14603impl wkt::message::Message for UpdateGroupRequest {
14604 fn typename() -> &'static str {
14605 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateGroupRequest"
14606 }
14607}
14608
14609/// The internal range resource for IPAM operations within a VPC network.
14610/// Used to represent a private address range along with behavioral
14611/// characteristics of that range (its usage and peering behavior).
14612/// Networking resources can link to this range if they are created
14613/// as belonging to it.
14614#[derive(Clone, Default, PartialEq)]
14615#[non_exhaustive]
14616pub struct InternalRange {
14617 /// Identifier. The name of an internal range.
14618 /// Format:
14619 /// projects/{project}/locations/{location}/internalRanges/{internal_range}
14620 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
14621 pub name: std::string::String,
14622
14623 /// Output only. Time when the internal range was created.
14624 pub create_time: std::option::Option<wkt::Timestamp>,
14625
14626 /// Output only. Time when the internal range was updated.
14627 pub update_time: std::option::Option<wkt::Timestamp>,
14628
14629 /// User-defined labels.
14630 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14631
14632 /// Optional. A description of this resource.
14633 pub description: std::string::String,
14634
14635 /// Optional. The IP range that this internal range defines.
14636 /// NOTE: IPv6 ranges are limited to usage=EXTERNAL_TO_VPC and
14637 /// peering=FOR_SELF.
14638 /// NOTE: For IPv6 Ranges this field is compulsory, i.e. the address range must
14639 /// be specified explicitly.
14640 pub ip_cidr_range: std::string::String,
14641
14642 /// Immutable. The URL or resource ID of the network in which to reserve the
14643 /// internal range. The network cannot be deleted if there are any reserved
14644 /// internal ranges referring to it. Legacy networks are not supported. For
14645 /// example:
14646 /// <https://www.googleapis.com/compute/v1/projects/{project}/locations/global/networks/{network}>
14647 /// projects/{project}/locations/global/networks/{network}
14648 /// {network}
14649 pub network: std::string::String,
14650
14651 /// Optional. The type of usage set for this InternalRange.
14652 pub usage: crate::model::internal_range::Usage,
14653
14654 /// Optional. The type of peering set for this internal range.
14655 pub peering: crate::model::internal_range::Peering,
14656
14657 /// Optional. An alternate to ip_cidr_range. Can be set when trying to create
14658 /// an IPv4 reservation that automatically finds a free range of the given
14659 /// size. If both ip_cidr_range and prefix_length are set, there is an error if
14660 /// the range sizes do not match. Can also be used during updates to change the
14661 /// range size.
14662 /// NOTE: For IPv6 this field only works if ip_cidr_range is set as well, and
14663 /// both fields must match. In other words, with IPv6 this field only works as
14664 /// a redundant parameter.
14665 pub prefix_length: i32,
14666
14667 /// Optional. Can be set to narrow down or pick a different address space while
14668 /// searching for a free range. If not set, defaults to the ["10.0.0.0/8",
14669 /// "172.16.0.0/12", "192.168.0.0/16"] address space (for auto-mode networks,
14670 /// the "10.0.0.0/9" range is used instead of "10.0.0.0/8"). This can be used
14671 /// to target the search in other rfc-1918 address spaces like "172.16.0.0/12"
14672 /// and "192.168.0.0/16" or non-rfc-1918 address spaces used in the VPC.
14673 pub target_cidr_range: std::vec::Vec<std::string::String>,
14674
14675 /// Output only. The list of resources that refer to this internal range.
14676 /// Resources that use the internal range for their range allocation
14677 /// are referred to as users of the range. Other resources mark themselves
14678 /// as users while doing so by creating a reference to this internal range.
14679 /// Having a user, based on this reference, prevents deletion of the
14680 /// internal range referred to. Can be empty.
14681 pub users: std::vec::Vec<std::string::String>,
14682
14683 /// Optional. Types of resources that are allowed to overlap with the current
14684 /// internal range.
14685 pub overlaps: std::vec::Vec<crate::model::internal_range::Overlap>,
14686
14687 /// Optional. Must be present if usage is set to FOR_MIGRATION.
14688 pub migration: std::option::Option<crate::model::internal_range::Migration>,
14689
14690 /// Optional. Immutable ranges cannot have their fields modified, except for
14691 /// labels and description.
14692 pub immutable: bool,
14693
14694 /// Optional. Range auto-allocation options, may be set only when
14695 /// auto-allocation is selected by not setting ip_cidr_range (and setting
14696 /// prefix_length).
14697 pub allocation_options: std::option::Option<crate::model::internal_range::AllocationOptions>,
14698
14699 /// Optional. ExcludeCidrRanges flag. Specifies a set of CIDR blocks that
14700 /// allows exclusion of particular CIDR ranges from the auto-allocation
14701 /// process, without having to reserve these blocks
14702 pub exclude_cidr_ranges: std::vec::Vec<std::string::String>,
14703
14704 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14705}
14706
14707impl InternalRange {
14708 pub fn new() -> Self {
14709 std::default::Default::default()
14710 }
14711
14712 /// Sets the value of [name][crate::model::InternalRange::name].
14713 ///
14714 /// # Example
14715 /// ```ignore,no_run
14716 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14717 /// let x = InternalRange::new().set_name("example");
14718 /// ```
14719 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14720 self.name = v.into();
14721 self
14722 }
14723
14724 /// Sets the value of [create_time][crate::model::InternalRange::create_time].
14725 ///
14726 /// # Example
14727 /// ```ignore,no_run
14728 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14729 /// use wkt::Timestamp;
14730 /// let x = InternalRange::new().set_create_time(Timestamp::default()/* use setters */);
14731 /// ```
14732 pub fn set_create_time<T>(mut self, v: T) -> Self
14733 where
14734 T: std::convert::Into<wkt::Timestamp>,
14735 {
14736 self.create_time = std::option::Option::Some(v.into());
14737 self
14738 }
14739
14740 /// Sets or clears the value of [create_time][crate::model::InternalRange::create_time].
14741 ///
14742 /// # Example
14743 /// ```ignore,no_run
14744 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14745 /// use wkt::Timestamp;
14746 /// let x = InternalRange::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14747 /// let x = InternalRange::new().set_or_clear_create_time(None::<Timestamp>);
14748 /// ```
14749 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14750 where
14751 T: std::convert::Into<wkt::Timestamp>,
14752 {
14753 self.create_time = v.map(|x| x.into());
14754 self
14755 }
14756
14757 /// Sets the value of [update_time][crate::model::InternalRange::update_time].
14758 ///
14759 /// # Example
14760 /// ```ignore,no_run
14761 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14762 /// use wkt::Timestamp;
14763 /// let x = InternalRange::new().set_update_time(Timestamp::default()/* use setters */);
14764 /// ```
14765 pub fn set_update_time<T>(mut self, v: T) -> Self
14766 where
14767 T: std::convert::Into<wkt::Timestamp>,
14768 {
14769 self.update_time = std::option::Option::Some(v.into());
14770 self
14771 }
14772
14773 /// Sets or clears the value of [update_time][crate::model::InternalRange::update_time].
14774 ///
14775 /// # Example
14776 /// ```ignore,no_run
14777 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14778 /// use wkt::Timestamp;
14779 /// let x = InternalRange::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14780 /// let x = InternalRange::new().set_or_clear_update_time(None::<Timestamp>);
14781 /// ```
14782 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14783 where
14784 T: std::convert::Into<wkt::Timestamp>,
14785 {
14786 self.update_time = v.map(|x| x.into());
14787 self
14788 }
14789
14790 /// Sets the value of [labels][crate::model::InternalRange::labels].
14791 ///
14792 /// # Example
14793 /// ```ignore,no_run
14794 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14795 /// let x = InternalRange::new().set_labels([
14796 /// ("key0", "abc"),
14797 /// ("key1", "xyz"),
14798 /// ]);
14799 /// ```
14800 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14801 where
14802 T: std::iter::IntoIterator<Item = (K, V)>,
14803 K: std::convert::Into<std::string::String>,
14804 V: std::convert::Into<std::string::String>,
14805 {
14806 use std::iter::Iterator;
14807 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14808 self
14809 }
14810
14811 /// Sets the value of [description][crate::model::InternalRange::description].
14812 ///
14813 /// # Example
14814 /// ```ignore,no_run
14815 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14816 /// let x = InternalRange::new().set_description("example");
14817 /// ```
14818 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14819 self.description = v.into();
14820 self
14821 }
14822
14823 /// Sets the value of [ip_cidr_range][crate::model::InternalRange::ip_cidr_range].
14824 ///
14825 /// # Example
14826 /// ```ignore,no_run
14827 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14828 /// let x = InternalRange::new().set_ip_cidr_range("example");
14829 /// ```
14830 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14831 self.ip_cidr_range = v.into();
14832 self
14833 }
14834
14835 /// Sets the value of [network][crate::model::InternalRange::network].
14836 ///
14837 /// # Example
14838 /// ```ignore,no_run
14839 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14840 /// let x = InternalRange::new().set_network("example");
14841 /// ```
14842 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14843 self.network = v.into();
14844 self
14845 }
14846
14847 /// Sets the value of [usage][crate::model::InternalRange::usage].
14848 ///
14849 /// # Example
14850 /// ```ignore,no_run
14851 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14852 /// use google_cloud_networkconnectivity_v1::model::internal_range::Usage;
14853 /// let x0 = InternalRange::new().set_usage(Usage::ForVpc);
14854 /// let x1 = InternalRange::new().set_usage(Usage::ExternalToVpc);
14855 /// let x2 = InternalRange::new().set_usage(Usage::ForMigration);
14856 /// ```
14857 pub fn set_usage<T: std::convert::Into<crate::model::internal_range::Usage>>(
14858 mut self,
14859 v: T,
14860 ) -> Self {
14861 self.usage = v.into();
14862 self
14863 }
14864
14865 /// Sets the value of [peering][crate::model::InternalRange::peering].
14866 ///
14867 /// # Example
14868 /// ```ignore,no_run
14869 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14870 /// use google_cloud_networkconnectivity_v1::model::internal_range::Peering;
14871 /// let x0 = InternalRange::new().set_peering(Peering::ForSelf);
14872 /// let x1 = InternalRange::new().set_peering(Peering::ForPeer);
14873 /// let x2 = InternalRange::new().set_peering(Peering::NotShared);
14874 /// ```
14875 pub fn set_peering<T: std::convert::Into<crate::model::internal_range::Peering>>(
14876 mut self,
14877 v: T,
14878 ) -> Self {
14879 self.peering = v.into();
14880 self
14881 }
14882
14883 /// Sets the value of [prefix_length][crate::model::InternalRange::prefix_length].
14884 ///
14885 /// # Example
14886 /// ```ignore,no_run
14887 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14888 /// let x = InternalRange::new().set_prefix_length(42);
14889 /// ```
14890 pub fn set_prefix_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14891 self.prefix_length = v.into();
14892 self
14893 }
14894
14895 /// Sets the value of [target_cidr_range][crate::model::InternalRange::target_cidr_range].
14896 ///
14897 /// # Example
14898 /// ```ignore,no_run
14899 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14900 /// let x = InternalRange::new().set_target_cidr_range(["a", "b", "c"]);
14901 /// ```
14902 pub fn set_target_cidr_range<T, V>(mut self, v: T) -> Self
14903 where
14904 T: std::iter::IntoIterator<Item = V>,
14905 V: std::convert::Into<std::string::String>,
14906 {
14907 use std::iter::Iterator;
14908 self.target_cidr_range = v.into_iter().map(|i| i.into()).collect();
14909 self
14910 }
14911
14912 /// Sets the value of [users][crate::model::InternalRange::users].
14913 ///
14914 /// # Example
14915 /// ```ignore,no_run
14916 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14917 /// let x = InternalRange::new().set_users(["a", "b", "c"]);
14918 /// ```
14919 pub fn set_users<T, V>(mut self, v: T) -> Self
14920 where
14921 T: std::iter::IntoIterator<Item = V>,
14922 V: std::convert::Into<std::string::String>,
14923 {
14924 use std::iter::Iterator;
14925 self.users = v.into_iter().map(|i| i.into()).collect();
14926 self
14927 }
14928
14929 /// Sets the value of [overlaps][crate::model::InternalRange::overlaps].
14930 ///
14931 /// # Example
14932 /// ```ignore,no_run
14933 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14934 /// use google_cloud_networkconnectivity_v1::model::internal_range::Overlap;
14935 /// let x = InternalRange::new().set_overlaps([
14936 /// Overlap::RouteRange,
14937 /// Overlap::ExistingSubnetRange,
14938 /// ]);
14939 /// ```
14940 pub fn set_overlaps<T, V>(mut self, v: T) -> Self
14941 where
14942 T: std::iter::IntoIterator<Item = V>,
14943 V: std::convert::Into<crate::model::internal_range::Overlap>,
14944 {
14945 use std::iter::Iterator;
14946 self.overlaps = v.into_iter().map(|i| i.into()).collect();
14947 self
14948 }
14949
14950 /// Sets the value of [migration][crate::model::InternalRange::migration].
14951 ///
14952 /// # Example
14953 /// ```ignore,no_run
14954 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14955 /// use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
14956 /// let x = InternalRange::new().set_migration(Migration::default()/* use setters */);
14957 /// ```
14958 pub fn set_migration<T>(mut self, v: T) -> Self
14959 where
14960 T: std::convert::Into<crate::model::internal_range::Migration>,
14961 {
14962 self.migration = std::option::Option::Some(v.into());
14963 self
14964 }
14965
14966 /// Sets or clears the value of [migration][crate::model::InternalRange::migration].
14967 ///
14968 /// # Example
14969 /// ```ignore,no_run
14970 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14971 /// use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
14972 /// let x = InternalRange::new().set_or_clear_migration(Some(Migration::default()/* use setters */));
14973 /// let x = InternalRange::new().set_or_clear_migration(None::<Migration>);
14974 /// ```
14975 pub fn set_or_clear_migration<T>(mut self, v: std::option::Option<T>) -> Self
14976 where
14977 T: std::convert::Into<crate::model::internal_range::Migration>,
14978 {
14979 self.migration = v.map(|x| x.into());
14980 self
14981 }
14982
14983 /// Sets the value of [immutable][crate::model::InternalRange::immutable].
14984 ///
14985 /// # Example
14986 /// ```ignore,no_run
14987 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14988 /// let x = InternalRange::new().set_immutable(true);
14989 /// ```
14990 pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14991 self.immutable = v.into();
14992 self
14993 }
14994
14995 /// Sets the value of [allocation_options][crate::model::InternalRange::allocation_options].
14996 ///
14997 /// # Example
14998 /// ```ignore,no_run
14999 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15000 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15001 /// let x = InternalRange::new().set_allocation_options(AllocationOptions::default()/* use setters */);
15002 /// ```
15003 pub fn set_allocation_options<T>(mut self, v: T) -> Self
15004 where
15005 T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
15006 {
15007 self.allocation_options = std::option::Option::Some(v.into());
15008 self
15009 }
15010
15011 /// Sets or clears the value of [allocation_options][crate::model::InternalRange::allocation_options].
15012 ///
15013 /// # Example
15014 /// ```ignore,no_run
15015 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15016 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15017 /// let x = InternalRange::new().set_or_clear_allocation_options(Some(AllocationOptions::default()/* use setters */));
15018 /// let x = InternalRange::new().set_or_clear_allocation_options(None::<AllocationOptions>);
15019 /// ```
15020 pub fn set_or_clear_allocation_options<T>(mut self, v: std::option::Option<T>) -> Self
15021 where
15022 T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
15023 {
15024 self.allocation_options = v.map(|x| x.into());
15025 self
15026 }
15027
15028 /// Sets the value of [exclude_cidr_ranges][crate::model::InternalRange::exclude_cidr_ranges].
15029 ///
15030 /// # Example
15031 /// ```ignore,no_run
15032 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15033 /// let x = InternalRange::new().set_exclude_cidr_ranges(["a", "b", "c"]);
15034 /// ```
15035 pub fn set_exclude_cidr_ranges<T, V>(mut self, v: T) -> Self
15036 where
15037 T: std::iter::IntoIterator<Item = V>,
15038 V: std::convert::Into<std::string::String>,
15039 {
15040 use std::iter::Iterator;
15041 self.exclude_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
15042 self
15043 }
15044}
15045
15046impl wkt::message::Message for InternalRange {
15047 fn typename() -> &'static str {
15048 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange"
15049 }
15050}
15051
15052/// Defines additional types related to [InternalRange].
15053pub mod internal_range {
15054 #[allow(unused_imports)]
15055 use super::*;
15056
15057 /// Specification for migration with source and target resource names.
15058 #[derive(Clone, Default, PartialEq)]
15059 #[non_exhaustive]
15060 pub struct Migration {
15061 /// Immutable. Resource path as an URI of the source resource, for example a
15062 /// subnet. The project for the source resource should match the project for
15063 /// the InternalRange. An example:
15064 /// /projects/{project}/regions/{region}/subnetworks/{subnet}
15065 pub source: std::string::String,
15066
15067 /// Immutable. Resource path of the target resource. The target project can
15068 /// be different, as in the cases when migrating to peer networks. For
15069 /// example:
15070 /// /projects/{project}/regions/{region}/subnetworks/{subnet}
15071 pub target: std::string::String,
15072
15073 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15074 }
15075
15076 impl Migration {
15077 pub fn new() -> Self {
15078 std::default::Default::default()
15079 }
15080
15081 /// Sets the value of [source][crate::model::internal_range::Migration::source].
15082 ///
15083 /// # Example
15084 /// ```ignore,no_run
15085 /// # use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15086 /// let x = Migration::new().set_source("example");
15087 /// ```
15088 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15089 self.source = v.into();
15090 self
15091 }
15092
15093 /// Sets the value of [target][crate::model::internal_range::Migration::target].
15094 ///
15095 /// # Example
15096 /// ```ignore,no_run
15097 /// # use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15098 /// let x = Migration::new().set_target("example");
15099 /// ```
15100 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15101 self.target = v.into();
15102 self
15103 }
15104 }
15105
15106 impl wkt::message::Message for Migration {
15107 fn typename() -> &'static str {
15108 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.Migration"
15109 }
15110 }
15111
15112 /// Range auto-allocation options, to be optionally used when CIDR block is not
15113 /// explicitly set.
15114 #[derive(Clone, Default, PartialEq)]
15115 #[non_exhaustive]
15116 pub struct AllocationOptions {
15117 /// Optional. Allocation strategy Not setting this field when the allocation
15118 /// is requested means an implementation defined strategy is used.
15119 pub allocation_strategy: crate::model::internal_range::AllocationStrategy,
15120
15121 /// Optional. This field must be set only when allocation_strategy is set to
15122 /// RANDOM_FIRST_N_AVAILABLE.
15123 /// The value should be the maximum expected parallelism of range creation
15124 /// requests issued to the same space of peered netwroks.
15125 pub first_available_ranges_lookup_size: i32,
15126
15127 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15128 }
15129
15130 impl AllocationOptions {
15131 pub fn new() -> Self {
15132 std::default::Default::default()
15133 }
15134
15135 /// Sets the value of [allocation_strategy][crate::model::internal_range::AllocationOptions::allocation_strategy].
15136 ///
15137 /// # Example
15138 /// ```ignore,no_run
15139 /// # use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15140 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationStrategy;
15141 /// let x0 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::Random);
15142 /// let x1 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::FirstAvailable);
15143 /// let x2 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::RandomFirstNAvailable);
15144 /// ```
15145 pub fn set_allocation_strategy<
15146 T: std::convert::Into<crate::model::internal_range::AllocationStrategy>,
15147 >(
15148 mut self,
15149 v: T,
15150 ) -> Self {
15151 self.allocation_strategy = v.into();
15152 self
15153 }
15154
15155 /// Sets the value of [first_available_ranges_lookup_size][crate::model::internal_range::AllocationOptions::first_available_ranges_lookup_size].
15156 ///
15157 /// # Example
15158 /// ```ignore,no_run
15159 /// # use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15160 /// let x = AllocationOptions::new().set_first_available_ranges_lookup_size(42);
15161 /// ```
15162 pub fn set_first_available_ranges_lookup_size<T: std::convert::Into<i32>>(
15163 mut self,
15164 v: T,
15165 ) -> Self {
15166 self.first_available_ranges_lookup_size = v.into();
15167 self
15168 }
15169 }
15170
15171 impl wkt::message::Message for AllocationOptions {
15172 fn typename() -> &'static str {
15173 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.AllocationOptions"
15174 }
15175 }
15176
15177 /// Possible usage of an internal range.
15178 ///
15179 /// # Working with unknown values
15180 ///
15181 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15182 /// additional enum variants at any time. Adding new variants is not considered
15183 /// a breaking change. Applications should write their code in anticipation of:
15184 ///
15185 /// - New values appearing in future releases of the client library, **and**
15186 /// - New values received dynamically, without application changes.
15187 ///
15188 /// Please consult the [Working with enums] section in the user guide for some
15189 /// guidelines.
15190 ///
15191 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15192 #[derive(Clone, Debug, PartialEq)]
15193 #[non_exhaustive]
15194 pub enum Usage {
15195 /// Unspecified usage is allowed in calls which identify the resource by
15196 /// other fields and do not need Usage set to complete. These are, i.e.:
15197 /// GetInternalRange and DeleteInternalRange.
15198 /// Usage needs to be specified explicitly in CreateInternalRange
15199 /// or UpdateInternalRange calls.
15200 Unspecified,
15201 /// A VPC resource can use the reserved CIDR block by associating it with the
15202 /// internal range resource if usage is set to FOR_VPC.
15203 ForVpc,
15204 /// Ranges created with EXTERNAL_TO_VPC cannot be associated with VPC
15205 /// resources and are meant to block out address ranges for various use
15206 /// cases, like for example, usage on-prem, with dynamic route announcements
15207 /// via interconnect.
15208 ExternalToVpc,
15209 /// Ranges created FOR_MIGRATION can be used to lock a CIDR range between a
15210 /// source and target subnet. If usage is set to FOR_MIGRATION, the peering
15211 /// value has to be set to FOR_SELF or default to FOR_SELF when unset.
15212 ForMigration,
15213 /// If set, the enum was initialized with an unknown value.
15214 ///
15215 /// Applications can examine the value using [Usage::value] or
15216 /// [Usage::name].
15217 UnknownValue(usage::UnknownValue),
15218 }
15219
15220 #[doc(hidden)]
15221 pub mod usage {
15222 #[allow(unused_imports)]
15223 use super::*;
15224 #[derive(Clone, Debug, PartialEq)]
15225 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15226 }
15227
15228 impl Usage {
15229 /// Gets the enum value.
15230 ///
15231 /// Returns `None` if the enum contains an unknown value deserialized from
15232 /// the string representation of enums.
15233 pub fn value(&self) -> std::option::Option<i32> {
15234 match self {
15235 Self::Unspecified => std::option::Option::Some(0),
15236 Self::ForVpc => std::option::Option::Some(1),
15237 Self::ExternalToVpc => std::option::Option::Some(2),
15238 Self::ForMigration => std::option::Option::Some(3),
15239 Self::UnknownValue(u) => u.0.value(),
15240 }
15241 }
15242
15243 /// Gets the enum value as a string.
15244 ///
15245 /// Returns `None` if the enum contains an unknown value deserialized from
15246 /// the integer representation of enums.
15247 pub fn name(&self) -> std::option::Option<&str> {
15248 match self {
15249 Self::Unspecified => std::option::Option::Some("USAGE_UNSPECIFIED"),
15250 Self::ForVpc => std::option::Option::Some("FOR_VPC"),
15251 Self::ExternalToVpc => std::option::Option::Some("EXTERNAL_TO_VPC"),
15252 Self::ForMigration => std::option::Option::Some("FOR_MIGRATION"),
15253 Self::UnknownValue(u) => u.0.name(),
15254 }
15255 }
15256 }
15257
15258 impl std::default::Default for Usage {
15259 fn default() -> Self {
15260 use std::convert::From;
15261 Self::from(0)
15262 }
15263 }
15264
15265 impl std::fmt::Display for Usage {
15266 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15267 wkt::internal::display_enum(f, self.name(), self.value())
15268 }
15269 }
15270
15271 impl std::convert::From<i32> for Usage {
15272 fn from(value: i32) -> Self {
15273 match value {
15274 0 => Self::Unspecified,
15275 1 => Self::ForVpc,
15276 2 => Self::ExternalToVpc,
15277 3 => Self::ForMigration,
15278 _ => Self::UnknownValue(usage::UnknownValue(
15279 wkt::internal::UnknownEnumValue::Integer(value),
15280 )),
15281 }
15282 }
15283 }
15284
15285 impl std::convert::From<&str> for Usage {
15286 fn from(value: &str) -> Self {
15287 use std::string::ToString;
15288 match value {
15289 "USAGE_UNSPECIFIED" => Self::Unspecified,
15290 "FOR_VPC" => Self::ForVpc,
15291 "EXTERNAL_TO_VPC" => Self::ExternalToVpc,
15292 "FOR_MIGRATION" => Self::ForMigration,
15293 _ => Self::UnknownValue(usage::UnknownValue(
15294 wkt::internal::UnknownEnumValue::String(value.to_string()),
15295 )),
15296 }
15297 }
15298 }
15299
15300 impl serde::ser::Serialize for Usage {
15301 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15302 where
15303 S: serde::Serializer,
15304 {
15305 match self {
15306 Self::Unspecified => serializer.serialize_i32(0),
15307 Self::ForVpc => serializer.serialize_i32(1),
15308 Self::ExternalToVpc => serializer.serialize_i32(2),
15309 Self::ForMigration => serializer.serialize_i32(3),
15310 Self::UnknownValue(u) => u.0.serialize(serializer),
15311 }
15312 }
15313 }
15314
15315 impl<'de> serde::de::Deserialize<'de> for Usage {
15316 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15317 where
15318 D: serde::Deserializer<'de>,
15319 {
15320 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Usage>::new(
15321 ".google.cloud.networkconnectivity.v1.InternalRange.Usage",
15322 ))
15323 }
15324 }
15325
15326 /// Peering type.
15327 ///
15328 /// # Working with unknown values
15329 ///
15330 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15331 /// additional enum variants at any time. Adding new variants is not considered
15332 /// a breaking change. Applications should write their code in anticipation of:
15333 ///
15334 /// - New values appearing in future releases of the client library, **and**
15335 /// - New values received dynamically, without application changes.
15336 ///
15337 /// Please consult the [Working with enums] section in the user guide for some
15338 /// guidelines.
15339 ///
15340 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15341 #[derive(Clone, Debug, PartialEq)]
15342 #[non_exhaustive]
15343 pub enum Peering {
15344 /// If Peering is left unspecified in CreateInternalRange or
15345 /// UpdateInternalRange, it will be defaulted to FOR_SELF.
15346 Unspecified,
15347 /// This is the default behavior and represents the case that this
15348 /// internal range is intended to be used in the VPC in which it is created
15349 /// and is accessible from its peers. This implies that peers or
15350 /// peers-of-peers cannot use this range.
15351 ForSelf,
15352 /// This behavior can be set when the internal range is being reserved for
15353 /// usage by peers. This means that no resource within the VPC in which
15354 /// it is being created can use this to associate with a VPC resource, but
15355 /// one of the peers can. This represents donating a range for peers to
15356 /// use.
15357 ForPeer,
15358 /// This behavior can be set when the internal range is being reserved for
15359 /// usage by the VPC in which it is created, but not shared with peers.
15360 /// In a sense, it is local to the VPC. This can be used to create internal
15361 /// ranges for various purposes like HTTP_INTERNAL_LOAD_BALANCER or for
15362 /// Interconnect routes that are not shared with peers. This also implies
15363 /// that peers cannot use this range in a way that is visible to this VPC,
15364 /// but can re-use this range as long as it is NOT_SHARED from the peer VPC,
15365 /// too.
15366 NotShared,
15367 /// If set, the enum was initialized with an unknown value.
15368 ///
15369 /// Applications can examine the value using [Peering::value] or
15370 /// [Peering::name].
15371 UnknownValue(peering::UnknownValue),
15372 }
15373
15374 #[doc(hidden)]
15375 pub mod peering {
15376 #[allow(unused_imports)]
15377 use super::*;
15378 #[derive(Clone, Debug, PartialEq)]
15379 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15380 }
15381
15382 impl Peering {
15383 /// Gets the enum value.
15384 ///
15385 /// Returns `None` if the enum contains an unknown value deserialized from
15386 /// the string representation of enums.
15387 pub fn value(&self) -> std::option::Option<i32> {
15388 match self {
15389 Self::Unspecified => std::option::Option::Some(0),
15390 Self::ForSelf => std::option::Option::Some(1),
15391 Self::ForPeer => std::option::Option::Some(2),
15392 Self::NotShared => std::option::Option::Some(3),
15393 Self::UnknownValue(u) => u.0.value(),
15394 }
15395 }
15396
15397 /// Gets the enum value as a string.
15398 ///
15399 /// Returns `None` if the enum contains an unknown value deserialized from
15400 /// the integer representation of enums.
15401 pub fn name(&self) -> std::option::Option<&str> {
15402 match self {
15403 Self::Unspecified => std::option::Option::Some("PEERING_UNSPECIFIED"),
15404 Self::ForSelf => std::option::Option::Some("FOR_SELF"),
15405 Self::ForPeer => std::option::Option::Some("FOR_PEER"),
15406 Self::NotShared => std::option::Option::Some("NOT_SHARED"),
15407 Self::UnknownValue(u) => u.0.name(),
15408 }
15409 }
15410 }
15411
15412 impl std::default::Default for Peering {
15413 fn default() -> Self {
15414 use std::convert::From;
15415 Self::from(0)
15416 }
15417 }
15418
15419 impl std::fmt::Display for Peering {
15420 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15421 wkt::internal::display_enum(f, self.name(), self.value())
15422 }
15423 }
15424
15425 impl std::convert::From<i32> for Peering {
15426 fn from(value: i32) -> Self {
15427 match value {
15428 0 => Self::Unspecified,
15429 1 => Self::ForSelf,
15430 2 => Self::ForPeer,
15431 3 => Self::NotShared,
15432 _ => Self::UnknownValue(peering::UnknownValue(
15433 wkt::internal::UnknownEnumValue::Integer(value),
15434 )),
15435 }
15436 }
15437 }
15438
15439 impl std::convert::From<&str> for Peering {
15440 fn from(value: &str) -> Self {
15441 use std::string::ToString;
15442 match value {
15443 "PEERING_UNSPECIFIED" => Self::Unspecified,
15444 "FOR_SELF" => Self::ForSelf,
15445 "FOR_PEER" => Self::ForPeer,
15446 "NOT_SHARED" => Self::NotShared,
15447 _ => Self::UnknownValue(peering::UnknownValue(
15448 wkt::internal::UnknownEnumValue::String(value.to_string()),
15449 )),
15450 }
15451 }
15452 }
15453
15454 impl serde::ser::Serialize for Peering {
15455 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15456 where
15457 S: serde::Serializer,
15458 {
15459 match self {
15460 Self::Unspecified => serializer.serialize_i32(0),
15461 Self::ForSelf => serializer.serialize_i32(1),
15462 Self::ForPeer => serializer.serialize_i32(2),
15463 Self::NotShared => serializer.serialize_i32(3),
15464 Self::UnknownValue(u) => u.0.serialize(serializer),
15465 }
15466 }
15467 }
15468
15469 impl<'de> serde::de::Deserialize<'de> for Peering {
15470 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15471 where
15472 D: serde::Deserializer<'de>,
15473 {
15474 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Peering>::new(
15475 ".google.cloud.networkconnectivity.v1.InternalRange.Peering",
15476 ))
15477 }
15478 }
15479
15480 /// Overlap specifications.
15481 ///
15482 /// # Working with unknown values
15483 ///
15484 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15485 /// additional enum variants at any time. Adding new variants is not considered
15486 /// a breaking change. Applications should write their code in anticipation of:
15487 ///
15488 /// - New values appearing in future releases of the client library, **and**
15489 /// - New values received dynamically, without application changes.
15490 ///
15491 /// Please consult the [Working with enums] section in the user guide for some
15492 /// guidelines.
15493 ///
15494 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15495 #[derive(Clone, Debug, PartialEq)]
15496 #[non_exhaustive]
15497 pub enum Overlap {
15498 /// No overlap overrides.
15499 Unspecified,
15500 /// Allow creation of static routes more specific that the current
15501 /// internal range.
15502 RouteRange,
15503 /// Allow creation of internal ranges that overlap with existing subnets.
15504 ExistingSubnetRange,
15505 /// If set, the enum was initialized with an unknown value.
15506 ///
15507 /// Applications can examine the value using [Overlap::value] or
15508 /// [Overlap::name].
15509 UnknownValue(overlap::UnknownValue),
15510 }
15511
15512 #[doc(hidden)]
15513 pub mod overlap {
15514 #[allow(unused_imports)]
15515 use super::*;
15516 #[derive(Clone, Debug, PartialEq)]
15517 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15518 }
15519
15520 impl Overlap {
15521 /// Gets the enum value.
15522 ///
15523 /// Returns `None` if the enum contains an unknown value deserialized from
15524 /// the string representation of enums.
15525 pub fn value(&self) -> std::option::Option<i32> {
15526 match self {
15527 Self::Unspecified => std::option::Option::Some(0),
15528 Self::RouteRange => std::option::Option::Some(1),
15529 Self::ExistingSubnetRange => std::option::Option::Some(2),
15530 Self::UnknownValue(u) => u.0.value(),
15531 }
15532 }
15533
15534 /// Gets the enum value as a string.
15535 ///
15536 /// Returns `None` if the enum contains an unknown value deserialized from
15537 /// the integer representation of enums.
15538 pub fn name(&self) -> std::option::Option<&str> {
15539 match self {
15540 Self::Unspecified => std::option::Option::Some("OVERLAP_UNSPECIFIED"),
15541 Self::RouteRange => std::option::Option::Some("OVERLAP_ROUTE_RANGE"),
15542 Self::ExistingSubnetRange => {
15543 std::option::Option::Some("OVERLAP_EXISTING_SUBNET_RANGE")
15544 }
15545 Self::UnknownValue(u) => u.0.name(),
15546 }
15547 }
15548 }
15549
15550 impl std::default::Default for Overlap {
15551 fn default() -> Self {
15552 use std::convert::From;
15553 Self::from(0)
15554 }
15555 }
15556
15557 impl std::fmt::Display for Overlap {
15558 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15559 wkt::internal::display_enum(f, self.name(), self.value())
15560 }
15561 }
15562
15563 impl std::convert::From<i32> for Overlap {
15564 fn from(value: i32) -> Self {
15565 match value {
15566 0 => Self::Unspecified,
15567 1 => Self::RouteRange,
15568 2 => Self::ExistingSubnetRange,
15569 _ => Self::UnknownValue(overlap::UnknownValue(
15570 wkt::internal::UnknownEnumValue::Integer(value),
15571 )),
15572 }
15573 }
15574 }
15575
15576 impl std::convert::From<&str> for Overlap {
15577 fn from(value: &str) -> Self {
15578 use std::string::ToString;
15579 match value {
15580 "OVERLAP_UNSPECIFIED" => Self::Unspecified,
15581 "OVERLAP_ROUTE_RANGE" => Self::RouteRange,
15582 "OVERLAP_EXISTING_SUBNET_RANGE" => Self::ExistingSubnetRange,
15583 _ => Self::UnknownValue(overlap::UnknownValue(
15584 wkt::internal::UnknownEnumValue::String(value.to_string()),
15585 )),
15586 }
15587 }
15588 }
15589
15590 impl serde::ser::Serialize for Overlap {
15591 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15592 where
15593 S: serde::Serializer,
15594 {
15595 match self {
15596 Self::Unspecified => serializer.serialize_i32(0),
15597 Self::RouteRange => serializer.serialize_i32(1),
15598 Self::ExistingSubnetRange => serializer.serialize_i32(2),
15599 Self::UnknownValue(u) => u.0.serialize(serializer),
15600 }
15601 }
15602 }
15603
15604 impl<'de> serde::de::Deserialize<'de> for Overlap {
15605 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15606 where
15607 D: serde::Deserializer<'de>,
15608 {
15609 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Overlap>::new(
15610 ".google.cloud.networkconnectivity.v1.InternalRange.Overlap",
15611 ))
15612 }
15613 }
15614
15615 /// Enumeration of range auto-allocation strategies
15616 ///
15617 /// # Working with unknown values
15618 ///
15619 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15620 /// additional enum variants at any time. Adding new variants is not considered
15621 /// a breaking change. Applications should write their code in anticipation of:
15622 ///
15623 /// - New values appearing in future releases of the client library, **and**
15624 /// - New values received dynamically, without application changes.
15625 ///
15626 /// Please consult the [Working with enums] section in the user guide for some
15627 /// guidelines.
15628 ///
15629 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15630 #[derive(Clone, Debug, PartialEq)]
15631 #[non_exhaustive]
15632 pub enum AllocationStrategy {
15633 /// Unspecified is the only valid option when the range is specified
15634 /// explicitly by ip_cidr_range field. Otherwise unspefified means using the
15635 /// default strategy.
15636 Unspecified,
15637 /// Random strategy, the legacy algorithm, used for backwards compatibility.
15638 /// This allocation strategy remains efficient in the case of concurrent
15639 /// allocation requests in the same peered network space and doesn't require
15640 /// providing the level of concurrency in an explicit parameter, but it is
15641 /// prone to fragmenting available address space.
15642 Random,
15643 /// Pick the first available address range. This strategy is deterministic
15644 /// and the result is easy to predict.
15645 FirstAvailable,
15646 /// Pick an arbitrary range out of the first N available ones. The N will be
15647 /// set in the first_available_ranges_lookup_size field. This strategy should
15648 /// be used when concurrent allocation requests are made in the same space of
15649 /// peered networks while the fragmentation of the addrress space is reduced.
15650 RandomFirstNAvailable,
15651 /// Pick the smallest but fitting available range. This deterministic
15652 /// strategy minimizes fragmentation of the address space.
15653 FirstSmallestFitting,
15654 /// If set, the enum was initialized with an unknown value.
15655 ///
15656 /// Applications can examine the value using [AllocationStrategy::value] or
15657 /// [AllocationStrategy::name].
15658 UnknownValue(allocation_strategy::UnknownValue),
15659 }
15660
15661 #[doc(hidden)]
15662 pub mod allocation_strategy {
15663 #[allow(unused_imports)]
15664 use super::*;
15665 #[derive(Clone, Debug, PartialEq)]
15666 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15667 }
15668
15669 impl AllocationStrategy {
15670 /// Gets the enum value.
15671 ///
15672 /// Returns `None` if the enum contains an unknown value deserialized from
15673 /// the string representation of enums.
15674 pub fn value(&self) -> std::option::Option<i32> {
15675 match self {
15676 Self::Unspecified => std::option::Option::Some(0),
15677 Self::Random => std::option::Option::Some(1),
15678 Self::FirstAvailable => std::option::Option::Some(2),
15679 Self::RandomFirstNAvailable => std::option::Option::Some(3),
15680 Self::FirstSmallestFitting => std::option::Option::Some(4),
15681 Self::UnknownValue(u) => u.0.value(),
15682 }
15683 }
15684
15685 /// Gets the enum value as a string.
15686 ///
15687 /// Returns `None` if the enum contains an unknown value deserialized from
15688 /// the integer representation of enums.
15689 pub fn name(&self) -> std::option::Option<&str> {
15690 match self {
15691 Self::Unspecified => std::option::Option::Some("ALLOCATION_STRATEGY_UNSPECIFIED"),
15692 Self::Random => std::option::Option::Some("RANDOM"),
15693 Self::FirstAvailable => std::option::Option::Some("FIRST_AVAILABLE"),
15694 Self::RandomFirstNAvailable => {
15695 std::option::Option::Some("RANDOM_FIRST_N_AVAILABLE")
15696 }
15697 Self::FirstSmallestFitting => std::option::Option::Some("FIRST_SMALLEST_FITTING"),
15698 Self::UnknownValue(u) => u.0.name(),
15699 }
15700 }
15701 }
15702
15703 impl std::default::Default for AllocationStrategy {
15704 fn default() -> Self {
15705 use std::convert::From;
15706 Self::from(0)
15707 }
15708 }
15709
15710 impl std::fmt::Display for AllocationStrategy {
15711 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15712 wkt::internal::display_enum(f, self.name(), self.value())
15713 }
15714 }
15715
15716 impl std::convert::From<i32> for AllocationStrategy {
15717 fn from(value: i32) -> Self {
15718 match value {
15719 0 => Self::Unspecified,
15720 1 => Self::Random,
15721 2 => Self::FirstAvailable,
15722 3 => Self::RandomFirstNAvailable,
15723 4 => Self::FirstSmallestFitting,
15724 _ => Self::UnknownValue(allocation_strategy::UnknownValue(
15725 wkt::internal::UnknownEnumValue::Integer(value),
15726 )),
15727 }
15728 }
15729 }
15730
15731 impl std::convert::From<&str> for AllocationStrategy {
15732 fn from(value: &str) -> Self {
15733 use std::string::ToString;
15734 match value {
15735 "ALLOCATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
15736 "RANDOM" => Self::Random,
15737 "FIRST_AVAILABLE" => Self::FirstAvailable,
15738 "RANDOM_FIRST_N_AVAILABLE" => Self::RandomFirstNAvailable,
15739 "FIRST_SMALLEST_FITTING" => Self::FirstSmallestFitting,
15740 _ => Self::UnknownValue(allocation_strategy::UnknownValue(
15741 wkt::internal::UnknownEnumValue::String(value.to_string()),
15742 )),
15743 }
15744 }
15745 }
15746
15747 impl serde::ser::Serialize for AllocationStrategy {
15748 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15749 where
15750 S: serde::Serializer,
15751 {
15752 match self {
15753 Self::Unspecified => serializer.serialize_i32(0),
15754 Self::Random => serializer.serialize_i32(1),
15755 Self::FirstAvailable => serializer.serialize_i32(2),
15756 Self::RandomFirstNAvailable => serializer.serialize_i32(3),
15757 Self::FirstSmallestFitting => serializer.serialize_i32(4),
15758 Self::UnknownValue(u) => u.0.serialize(serializer),
15759 }
15760 }
15761 }
15762
15763 impl<'de> serde::de::Deserialize<'de> for AllocationStrategy {
15764 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15765 where
15766 D: serde::Deserializer<'de>,
15767 {
15768 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AllocationStrategy>::new(
15769 ".google.cloud.networkconnectivity.v1.InternalRange.AllocationStrategy",
15770 ))
15771 }
15772 }
15773}
15774
15775/// Request for InternalRangeService.ListInternalRanges
15776#[derive(Clone, Default, PartialEq)]
15777#[non_exhaustive]
15778pub struct ListInternalRangesRequest {
15779 /// Required. The parent resource's name.
15780 pub parent: std::string::String,
15781
15782 /// The maximum number of results per page that should be returned.
15783 pub page_size: i32,
15784
15785 /// The page token.
15786 pub page_token: std::string::String,
15787
15788 /// A filter expression that filters the results listed in the response.
15789 pub filter: std::string::String,
15790
15791 /// Sort the results by a certain order.
15792 pub order_by: std::string::String,
15793
15794 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15795}
15796
15797impl ListInternalRangesRequest {
15798 pub fn new() -> Self {
15799 std::default::Default::default()
15800 }
15801
15802 /// Sets the value of [parent][crate::model::ListInternalRangesRequest::parent].
15803 ///
15804 /// # Example
15805 /// ```ignore,no_run
15806 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15807 /// let x = ListInternalRangesRequest::new().set_parent("example");
15808 /// ```
15809 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15810 self.parent = v.into();
15811 self
15812 }
15813
15814 /// Sets the value of [page_size][crate::model::ListInternalRangesRequest::page_size].
15815 ///
15816 /// # Example
15817 /// ```ignore,no_run
15818 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15819 /// let x = ListInternalRangesRequest::new().set_page_size(42);
15820 /// ```
15821 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15822 self.page_size = v.into();
15823 self
15824 }
15825
15826 /// Sets the value of [page_token][crate::model::ListInternalRangesRequest::page_token].
15827 ///
15828 /// # Example
15829 /// ```ignore,no_run
15830 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15831 /// let x = ListInternalRangesRequest::new().set_page_token("example");
15832 /// ```
15833 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15834 self.page_token = v.into();
15835 self
15836 }
15837
15838 /// Sets the value of [filter][crate::model::ListInternalRangesRequest::filter].
15839 ///
15840 /// # Example
15841 /// ```ignore,no_run
15842 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15843 /// let x = ListInternalRangesRequest::new().set_filter("example");
15844 /// ```
15845 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15846 self.filter = v.into();
15847 self
15848 }
15849
15850 /// Sets the value of [order_by][crate::model::ListInternalRangesRequest::order_by].
15851 ///
15852 /// # Example
15853 /// ```ignore,no_run
15854 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
15855 /// let x = ListInternalRangesRequest::new().set_order_by("example");
15856 /// ```
15857 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15858 self.order_by = v.into();
15859 self
15860 }
15861}
15862
15863impl wkt::message::Message for ListInternalRangesRequest {
15864 fn typename() -> &'static str {
15865 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesRequest"
15866 }
15867}
15868
15869/// Response for InternalRange.ListInternalRanges
15870#[derive(Clone, Default, PartialEq)]
15871#[non_exhaustive]
15872pub struct ListInternalRangesResponse {
15873 /// Internal ranges to be returned.
15874 pub internal_ranges: std::vec::Vec<crate::model::InternalRange>,
15875
15876 /// The next pagination token in the List response. It should be used as
15877 /// page_token for the following request. An empty value means no more result.
15878 pub next_page_token: std::string::String,
15879
15880 /// Locations that could not be reached.
15881 pub unreachable: std::vec::Vec<std::string::String>,
15882
15883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15884}
15885
15886impl ListInternalRangesResponse {
15887 pub fn new() -> Self {
15888 std::default::Default::default()
15889 }
15890
15891 /// Sets the value of [internal_ranges][crate::model::ListInternalRangesResponse::internal_ranges].
15892 ///
15893 /// # Example
15894 /// ```ignore,no_run
15895 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
15896 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
15897 /// let x = ListInternalRangesResponse::new()
15898 /// .set_internal_ranges([
15899 /// InternalRange::default()/* use setters */,
15900 /// InternalRange::default()/* use (different) setters */,
15901 /// ]);
15902 /// ```
15903 pub fn set_internal_ranges<T, V>(mut self, v: T) -> Self
15904 where
15905 T: std::iter::IntoIterator<Item = V>,
15906 V: std::convert::Into<crate::model::InternalRange>,
15907 {
15908 use std::iter::Iterator;
15909 self.internal_ranges = v.into_iter().map(|i| i.into()).collect();
15910 self
15911 }
15912
15913 /// Sets the value of [next_page_token][crate::model::ListInternalRangesResponse::next_page_token].
15914 ///
15915 /// # Example
15916 /// ```ignore,no_run
15917 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
15918 /// let x = ListInternalRangesResponse::new().set_next_page_token("example");
15919 /// ```
15920 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15921 self.next_page_token = v.into();
15922 self
15923 }
15924
15925 /// Sets the value of [unreachable][crate::model::ListInternalRangesResponse::unreachable].
15926 ///
15927 /// # Example
15928 /// ```ignore,no_run
15929 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
15930 /// let x = ListInternalRangesResponse::new().set_unreachable(["a", "b", "c"]);
15931 /// ```
15932 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
15933 where
15934 T: std::iter::IntoIterator<Item = V>,
15935 V: std::convert::Into<std::string::String>,
15936 {
15937 use std::iter::Iterator;
15938 self.unreachable = v.into_iter().map(|i| i.into()).collect();
15939 self
15940 }
15941}
15942
15943impl wkt::message::Message for ListInternalRangesResponse {
15944 fn typename() -> &'static str {
15945 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesResponse"
15946 }
15947}
15948
15949#[doc(hidden)]
15950impl google_cloud_gax::paginator::internal::PageableResponse for ListInternalRangesResponse {
15951 type PageItem = crate::model::InternalRange;
15952
15953 fn items(self) -> std::vec::Vec<Self::PageItem> {
15954 self.internal_ranges
15955 }
15956
15957 fn next_page_token(&self) -> std::string::String {
15958 use std::clone::Clone;
15959 self.next_page_token.clone()
15960 }
15961}
15962
15963/// Request for InternalRangeService.GetInternalRange
15964#[derive(Clone, Default, PartialEq)]
15965#[non_exhaustive]
15966pub struct GetInternalRangeRequest {
15967 /// Required. Name of the InternalRange to get.
15968 pub name: std::string::String,
15969
15970 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15971}
15972
15973impl GetInternalRangeRequest {
15974 pub fn new() -> Self {
15975 std::default::Default::default()
15976 }
15977
15978 /// Sets the value of [name][crate::model::GetInternalRangeRequest::name].
15979 ///
15980 /// # Example
15981 /// ```ignore,no_run
15982 /// # use google_cloud_networkconnectivity_v1::model::GetInternalRangeRequest;
15983 /// let x = GetInternalRangeRequest::new().set_name("example");
15984 /// ```
15985 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15986 self.name = v.into();
15987 self
15988 }
15989}
15990
15991impl wkt::message::Message for GetInternalRangeRequest {
15992 fn typename() -> &'static str {
15993 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetInternalRangeRequest"
15994 }
15995}
15996
15997/// Request for InternalRangeService.CreateInternalRange
15998#[derive(Clone, Default, PartialEq)]
15999#[non_exhaustive]
16000pub struct CreateInternalRangeRequest {
16001 /// Required. The parent resource's name of the internal range.
16002 pub parent: std::string::String,
16003
16004 /// Optional. Resource ID
16005 /// (i.e. 'foo' in '[...]/projects/p/locations/l/internalRanges/foo')
16006 /// See <https://google.aip.dev/122#resource-id-segments>
16007 /// Unique per location.
16008 pub internal_range_id: std::string::String,
16009
16010 /// Required. Initial values for a new internal range
16011 pub internal_range: std::option::Option<crate::model::InternalRange>,
16012
16013 /// Optional. An optional request ID to identify requests. Specify a unique
16014 /// request ID so that if you must retry your request, the server will know to
16015 /// ignore the request if it has already been completed. The server will
16016 /// guarantee that for at least 60 minutes since the first request.
16017 ///
16018 /// For example, consider a situation where you make an initial request and
16019 /// the request times out. If you make the request again with the same request
16020 /// ID, the server can check if original operation with the same request ID
16021 /// was received, and if so, will ignore the second request. This prevents
16022 /// clients from accidentally creating duplicate commitments.
16023 ///
16024 /// The request ID must be a valid UUID with the exception that zero UUID is
16025 /// not supported (00000000-0000-0000-0000-000000000000).
16026 pub request_id: std::string::String,
16027
16028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16029}
16030
16031impl CreateInternalRangeRequest {
16032 pub fn new() -> Self {
16033 std::default::Default::default()
16034 }
16035
16036 /// Sets the value of [parent][crate::model::CreateInternalRangeRequest::parent].
16037 ///
16038 /// # Example
16039 /// ```ignore,no_run
16040 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16041 /// let x = CreateInternalRangeRequest::new().set_parent("example");
16042 /// ```
16043 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16044 self.parent = v.into();
16045 self
16046 }
16047
16048 /// Sets the value of [internal_range_id][crate::model::CreateInternalRangeRequest::internal_range_id].
16049 ///
16050 /// # Example
16051 /// ```ignore,no_run
16052 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16053 /// let x = CreateInternalRangeRequest::new().set_internal_range_id("example");
16054 /// ```
16055 pub fn set_internal_range_id<T: std::convert::Into<std::string::String>>(
16056 mut self,
16057 v: T,
16058 ) -> Self {
16059 self.internal_range_id = v.into();
16060 self
16061 }
16062
16063 /// Sets the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
16064 ///
16065 /// # Example
16066 /// ```ignore,no_run
16067 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16068 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16069 /// let x = CreateInternalRangeRequest::new().set_internal_range(InternalRange::default()/* use setters */);
16070 /// ```
16071 pub fn set_internal_range<T>(mut self, v: T) -> Self
16072 where
16073 T: std::convert::Into<crate::model::InternalRange>,
16074 {
16075 self.internal_range = std::option::Option::Some(v.into());
16076 self
16077 }
16078
16079 /// Sets or clears the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
16080 ///
16081 /// # Example
16082 /// ```ignore,no_run
16083 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16084 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16085 /// let x = CreateInternalRangeRequest::new().set_or_clear_internal_range(Some(InternalRange::default()/* use setters */));
16086 /// let x = CreateInternalRangeRequest::new().set_or_clear_internal_range(None::<InternalRange>);
16087 /// ```
16088 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
16089 where
16090 T: std::convert::Into<crate::model::InternalRange>,
16091 {
16092 self.internal_range = v.map(|x| x.into());
16093 self
16094 }
16095
16096 /// Sets the value of [request_id][crate::model::CreateInternalRangeRequest::request_id].
16097 ///
16098 /// # Example
16099 /// ```ignore,no_run
16100 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16101 /// let x = CreateInternalRangeRequest::new().set_request_id("example");
16102 /// ```
16103 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16104 self.request_id = v.into();
16105 self
16106 }
16107}
16108
16109impl wkt::message::Message for CreateInternalRangeRequest {
16110 fn typename() -> &'static str {
16111 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateInternalRangeRequest"
16112 }
16113}
16114
16115/// Request for InternalRangeService.UpdateInternalRange
16116#[derive(Clone, Default, PartialEq)]
16117#[non_exhaustive]
16118pub struct UpdateInternalRangeRequest {
16119 /// Optional. Field mask is used to specify the fields to be overwritten in the
16120 /// InternalRange resource by the update.
16121 /// The fields specified in the update_mask are relative to the resource, not
16122 /// the full request. A field will be overwritten if it is in the mask. If the
16123 /// user does not provide a mask then all fields will be overwritten.
16124 pub update_mask: std::option::Option<wkt::FieldMask>,
16125
16126 /// Required. New values to be patched into the resource.
16127 pub internal_range: std::option::Option<crate::model::InternalRange>,
16128
16129 /// Optional. An optional request ID to identify requests. Specify a unique
16130 /// request ID so that if you must retry your request, the server will know to
16131 /// ignore the request if it has already been completed. The server will
16132 /// guarantee that for at least 60 minutes since the first request.
16133 ///
16134 /// For example, consider a situation where you make an initial request and
16135 /// the request times out. If you make the request again with the same request
16136 /// ID, the server can check if original operation with the same request ID
16137 /// was received, and if so, will ignore the second request. This prevents
16138 /// clients from accidentally creating duplicate commitments.
16139 ///
16140 /// The request ID must be a valid UUID with the exception that zero UUID is
16141 /// not supported (00000000-0000-0000-0000-000000000000).
16142 pub request_id: std::string::String,
16143
16144 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16145}
16146
16147impl UpdateInternalRangeRequest {
16148 pub fn new() -> Self {
16149 std::default::Default::default()
16150 }
16151
16152 /// Sets the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
16153 ///
16154 /// # Example
16155 /// ```ignore,no_run
16156 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16157 /// use wkt::FieldMask;
16158 /// let x = UpdateInternalRangeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16159 /// ```
16160 pub fn set_update_mask<T>(mut self, v: T) -> Self
16161 where
16162 T: std::convert::Into<wkt::FieldMask>,
16163 {
16164 self.update_mask = std::option::Option::Some(v.into());
16165 self
16166 }
16167
16168 /// Sets or clears the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
16169 ///
16170 /// # Example
16171 /// ```ignore,no_run
16172 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16173 /// use wkt::FieldMask;
16174 /// let x = UpdateInternalRangeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16175 /// let x = UpdateInternalRangeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16176 /// ```
16177 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16178 where
16179 T: std::convert::Into<wkt::FieldMask>,
16180 {
16181 self.update_mask = v.map(|x| x.into());
16182 self
16183 }
16184
16185 /// Sets the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
16186 ///
16187 /// # Example
16188 /// ```ignore,no_run
16189 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16190 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16191 /// let x = UpdateInternalRangeRequest::new().set_internal_range(InternalRange::default()/* use setters */);
16192 /// ```
16193 pub fn set_internal_range<T>(mut self, v: T) -> Self
16194 where
16195 T: std::convert::Into<crate::model::InternalRange>,
16196 {
16197 self.internal_range = std::option::Option::Some(v.into());
16198 self
16199 }
16200
16201 /// Sets or clears the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
16202 ///
16203 /// # Example
16204 /// ```ignore,no_run
16205 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16206 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16207 /// let x = UpdateInternalRangeRequest::new().set_or_clear_internal_range(Some(InternalRange::default()/* use setters */));
16208 /// let x = UpdateInternalRangeRequest::new().set_or_clear_internal_range(None::<InternalRange>);
16209 /// ```
16210 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
16211 where
16212 T: std::convert::Into<crate::model::InternalRange>,
16213 {
16214 self.internal_range = v.map(|x| x.into());
16215 self
16216 }
16217
16218 /// Sets the value of [request_id][crate::model::UpdateInternalRangeRequest::request_id].
16219 ///
16220 /// # Example
16221 /// ```ignore,no_run
16222 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16223 /// let x = UpdateInternalRangeRequest::new().set_request_id("example");
16224 /// ```
16225 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16226 self.request_id = v.into();
16227 self
16228 }
16229}
16230
16231impl wkt::message::Message for UpdateInternalRangeRequest {
16232 fn typename() -> &'static str {
16233 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateInternalRangeRequest"
16234 }
16235}
16236
16237/// Request for InternalRangeService.DeleteInternalRange
16238#[derive(Clone, Default, PartialEq)]
16239#[non_exhaustive]
16240pub struct DeleteInternalRangeRequest {
16241 /// Required. The name of the internal range to delete.
16242 pub name: std::string::String,
16243
16244 /// Optional. An optional request ID to identify requests. Specify a unique
16245 /// request ID so that if you must retry your request, the server will know to
16246 /// ignore the request if it has already been completed. The server will
16247 /// guarantee that for at least 60 minutes after the first request.
16248 ///
16249 /// For example, consider a situation where you make an initial request and
16250 /// the request times out. If you make the request again with the same request
16251 /// ID, the server can check if original operation with the same request ID
16252 /// was received, and if so, will ignore the second request. This prevents
16253 /// clients from accidentally creating duplicate commitments.
16254 ///
16255 /// The request ID must be a valid UUID with the exception that zero UUID is
16256 /// not supported (00000000-0000-0000-0000-000000000000).
16257 pub request_id: std::string::String,
16258
16259 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16260}
16261
16262impl DeleteInternalRangeRequest {
16263 pub fn new() -> Self {
16264 std::default::Default::default()
16265 }
16266
16267 /// Sets the value of [name][crate::model::DeleteInternalRangeRequest::name].
16268 ///
16269 /// # Example
16270 /// ```ignore,no_run
16271 /// # use google_cloud_networkconnectivity_v1::model::DeleteInternalRangeRequest;
16272 /// let x = DeleteInternalRangeRequest::new().set_name("example");
16273 /// ```
16274 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16275 self.name = v.into();
16276 self
16277 }
16278
16279 /// Sets the value of [request_id][crate::model::DeleteInternalRangeRequest::request_id].
16280 ///
16281 /// # Example
16282 /// ```ignore,no_run
16283 /// # use google_cloud_networkconnectivity_v1::model::DeleteInternalRangeRequest;
16284 /// let x = DeleteInternalRangeRequest::new().set_request_id("example");
16285 /// ```
16286 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16287 self.request_id = v.into();
16288 self
16289 }
16290}
16291
16292impl wkt::message::Message for DeleteInternalRangeRequest {
16293 fn typename() -> &'static str {
16294 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteInternalRangeRequest"
16295 }
16296}
16297
16298/// Policy-based routes route L4 network traffic based on not just destination IP
16299/// address, but also source IP address, protocol, and more. If a policy-based
16300/// route conflicts with other types of routes, the policy-based route always
16301/// takes precedence.
16302#[derive(Clone, Default, PartialEq)]
16303#[non_exhaustive]
16304pub struct PolicyBasedRoute {
16305 /// Immutable. A unique name of the resource in the form of
16306 /// `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
16307 pub name: std::string::String,
16308
16309 /// Output only. Time when the policy-based route was created.
16310 pub create_time: std::option::Option<wkt::Timestamp>,
16311
16312 /// Output only. Time when the policy-based route was updated.
16313 pub update_time: std::option::Option<wkt::Timestamp>,
16314
16315 /// User-defined labels.
16316 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16317
16318 /// Optional. An optional description of this resource. Provide this field when
16319 /// you create the resource.
16320 pub description: std::string::String,
16321
16322 /// Required. Fully-qualified URL of the network that this route applies to,
16323 /// for example: projects/my-project/global/networks/my-network.
16324 pub network: std::string::String,
16325
16326 /// Required. The filter to match L4 traffic.
16327 pub filter: std::option::Option<crate::model::policy_based_route::Filter>,
16328
16329 /// Optional. The priority of this policy-based route. Priority is used to
16330 /// break ties in cases where there are more than one matching policy-based
16331 /// routes found. In cases where multiple policy-based routes are matched, the
16332 /// one with the lowest-numbered priority value wins. The default value is
16333 /// 1000. The priority value must be from 1 to 65535, inclusive.
16334 pub priority: i32,
16335
16336 /// Output only. If potential misconfigurations are detected for this route,
16337 /// this field will be populated with warning messages.
16338 pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,
16339
16340 /// Output only. Server-defined fully-qualified URL for this resource.
16341 pub self_link: std::string::String,
16342
16343 /// Output only. Type of this resource. Always
16344 /// networkconnectivity#policyBasedRoute for policy-based Route resources.
16345 pub kind: std::string::String,
16346
16347 /// Target specifies network endpoints that this policy-based route applies to.
16348 /// If no target is specified, the PBR will be installed on all network
16349 /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
16350 pub target: std::option::Option<crate::model::policy_based_route::Target>,
16351
16352 pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,
16353
16354 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16355}
16356
16357impl PolicyBasedRoute {
16358 pub fn new() -> Self {
16359 std::default::Default::default()
16360 }
16361
16362 /// Sets the value of [name][crate::model::PolicyBasedRoute::name].
16363 ///
16364 /// # Example
16365 /// ```ignore,no_run
16366 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16367 /// let x = PolicyBasedRoute::new().set_name("example");
16368 /// ```
16369 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16370 self.name = v.into();
16371 self
16372 }
16373
16374 /// Sets the value of [create_time][crate::model::PolicyBasedRoute::create_time].
16375 ///
16376 /// # Example
16377 /// ```ignore,no_run
16378 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16379 /// use wkt::Timestamp;
16380 /// let x = PolicyBasedRoute::new().set_create_time(Timestamp::default()/* use setters */);
16381 /// ```
16382 pub fn set_create_time<T>(mut self, v: T) -> Self
16383 where
16384 T: std::convert::Into<wkt::Timestamp>,
16385 {
16386 self.create_time = std::option::Option::Some(v.into());
16387 self
16388 }
16389
16390 /// Sets or clears the value of [create_time][crate::model::PolicyBasedRoute::create_time].
16391 ///
16392 /// # Example
16393 /// ```ignore,no_run
16394 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16395 /// use wkt::Timestamp;
16396 /// let x = PolicyBasedRoute::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16397 /// let x = PolicyBasedRoute::new().set_or_clear_create_time(None::<Timestamp>);
16398 /// ```
16399 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16400 where
16401 T: std::convert::Into<wkt::Timestamp>,
16402 {
16403 self.create_time = v.map(|x| x.into());
16404 self
16405 }
16406
16407 /// Sets the value of [update_time][crate::model::PolicyBasedRoute::update_time].
16408 ///
16409 /// # Example
16410 /// ```ignore,no_run
16411 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16412 /// use wkt::Timestamp;
16413 /// let x = PolicyBasedRoute::new().set_update_time(Timestamp::default()/* use setters */);
16414 /// ```
16415 pub fn set_update_time<T>(mut self, v: T) -> Self
16416 where
16417 T: std::convert::Into<wkt::Timestamp>,
16418 {
16419 self.update_time = std::option::Option::Some(v.into());
16420 self
16421 }
16422
16423 /// Sets or clears the value of [update_time][crate::model::PolicyBasedRoute::update_time].
16424 ///
16425 /// # Example
16426 /// ```ignore,no_run
16427 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16428 /// use wkt::Timestamp;
16429 /// let x = PolicyBasedRoute::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16430 /// let x = PolicyBasedRoute::new().set_or_clear_update_time(None::<Timestamp>);
16431 /// ```
16432 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16433 where
16434 T: std::convert::Into<wkt::Timestamp>,
16435 {
16436 self.update_time = v.map(|x| x.into());
16437 self
16438 }
16439
16440 /// Sets the value of [labels][crate::model::PolicyBasedRoute::labels].
16441 ///
16442 /// # Example
16443 /// ```ignore,no_run
16444 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16445 /// let x = PolicyBasedRoute::new().set_labels([
16446 /// ("key0", "abc"),
16447 /// ("key1", "xyz"),
16448 /// ]);
16449 /// ```
16450 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16451 where
16452 T: std::iter::IntoIterator<Item = (K, V)>,
16453 K: std::convert::Into<std::string::String>,
16454 V: std::convert::Into<std::string::String>,
16455 {
16456 use std::iter::Iterator;
16457 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16458 self
16459 }
16460
16461 /// Sets the value of [description][crate::model::PolicyBasedRoute::description].
16462 ///
16463 /// # Example
16464 /// ```ignore,no_run
16465 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16466 /// let x = PolicyBasedRoute::new().set_description("example");
16467 /// ```
16468 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16469 self.description = v.into();
16470 self
16471 }
16472
16473 /// Sets the value of [network][crate::model::PolicyBasedRoute::network].
16474 ///
16475 /// # Example
16476 /// ```ignore,no_run
16477 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16478 /// let x = PolicyBasedRoute::new().set_network("example");
16479 /// ```
16480 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16481 self.network = v.into();
16482 self
16483 }
16484
16485 /// Sets the value of [filter][crate::model::PolicyBasedRoute::filter].
16486 ///
16487 /// # Example
16488 /// ```ignore,no_run
16489 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16490 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16491 /// let x = PolicyBasedRoute::new().set_filter(Filter::default()/* use setters */);
16492 /// ```
16493 pub fn set_filter<T>(mut self, v: T) -> Self
16494 where
16495 T: std::convert::Into<crate::model::policy_based_route::Filter>,
16496 {
16497 self.filter = std::option::Option::Some(v.into());
16498 self
16499 }
16500
16501 /// Sets or clears the value of [filter][crate::model::PolicyBasedRoute::filter].
16502 ///
16503 /// # Example
16504 /// ```ignore,no_run
16505 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16506 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16507 /// let x = PolicyBasedRoute::new().set_or_clear_filter(Some(Filter::default()/* use setters */));
16508 /// let x = PolicyBasedRoute::new().set_or_clear_filter(None::<Filter>);
16509 /// ```
16510 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
16511 where
16512 T: std::convert::Into<crate::model::policy_based_route::Filter>,
16513 {
16514 self.filter = v.map(|x| x.into());
16515 self
16516 }
16517
16518 /// Sets the value of [priority][crate::model::PolicyBasedRoute::priority].
16519 ///
16520 /// # Example
16521 /// ```ignore,no_run
16522 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16523 /// let x = PolicyBasedRoute::new().set_priority(42);
16524 /// ```
16525 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16526 self.priority = v.into();
16527 self
16528 }
16529
16530 /// Sets the value of [warnings][crate::model::PolicyBasedRoute::warnings].
16531 ///
16532 /// # Example
16533 /// ```ignore,no_run
16534 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16535 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
16536 /// let x = PolicyBasedRoute::new()
16537 /// .set_warnings([
16538 /// Warnings::default()/* use setters */,
16539 /// Warnings::default()/* use (different) setters */,
16540 /// ]);
16541 /// ```
16542 pub fn set_warnings<T, V>(mut self, v: T) -> Self
16543 where
16544 T: std::iter::IntoIterator<Item = V>,
16545 V: std::convert::Into<crate::model::policy_based_route::Warnings>,
16546 {
16547 use std::iter::Iterator;
16548 self.warnings = v.into_iter().map(|i| i.into()).collect();
16549 self
16550 }
16551
16552 /// Sets the value of [self_link][crate::model::PolicyBasedRoute::self_link].
16553 ///
16554 /// # Example
16555 /// ```ignore,no_run
16556 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16557 /// let x = PolicyBasedRoute::new().set_self_link("example");
16558 /// ```
16559 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16560 self.self_link = v.into();
16561 self
16562 }
16563
16564 /// Sets the value of [kind][crate::model::PolicyBasedRoute::kind].
16565 ///
16566 /// # Example
16567 /// ```ignore,no_run
16568 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16569 /// let x = PolicyBasedRoute::new().set_kind("example");
16570 /// ```
16571 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16572 self.kind = v.into();
16573 self
16574 }
16575
16576 /// Sets the value of [target][crate::model::PolicyBasedRoute::target].
16577 ///
16578 /// Note that all the setters affecting `target` are mutually
16579 /// exclusive.
16580 ///
16581 /// # Example
16582 /// ```ignore,no_run
16583 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16584 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16585 /// let x = PolicyBasedRoute::new().set_target(Some(
16586 /// google_cloud_networkconnectivity_v1::model::policy_based_route::Target::VirtualMachine(VirtualMachine::default().into())));
16587 /// ```
16588 pub fn set_target<
16589 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
16590 >(
16591 mut self,
16592 v: T,
16593 ) -> Self {
16594 self.target = v.into();
16595 self
16596 }
16597
16598 /// The value of [target][crate::model::PolicyBasedRoute::target]
16599 /// if it holds a `VirtualMachine`, `None` if the field is not set or
16600 /// holds a different branch.
16601 pub fn virtual_machine(
16602 &self,
16603 ) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
16604 {
16605 #[allow(unreachable_patterns)]
16606 self.target.as_ref().and_then(|v| match v {
16607 crate::model::policy_based_route::Target::VirtualMachine(v) => {
16608 std::option::Option::Some(v)
16609 }
16610 _ => std::option::Option::None,
16611 })
16612 }
16613
16614 /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
16615 /// to hold a `VirtualMachine`.
16616 ///
16617 /// Note that all the setters affecting `target` are
16618 /// mutually exclusive.
16619 ///
16620 /// # Example
16621 /// ```ignore,no_run
16622 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16623 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16624 /// let x = PolicyBasedRoute::new().set_virtual_machine(VirtualMachine::default()/* use setters */);
16625 /// assert!(x.virtual_machine().is_some());
16626 /// assert!(x.interconnect_attachment().is_none());
16627 /// ```
16628 pub fn set_virtual_machine<
16629 T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
16630 >(
16631 mut self,
16632 v: T,
16633 ) -> Self {
16634 self.target = std::option::Option::Some(
16635 crate::model::policy_based_route::Target::VirtualMachine(v.into()),
16636 );
16637 self
16638 }
16639
16640 /// The value of [target][crate::model::PolicyBasedRoute::target]
16641 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
16642 /// holds a different branch.
16643 pub fn interconnect_attachment(
16644 &self,
16645 ) -> std::option::Option<
16646 &std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
16647 > {
16648 #[allow(unreachable_patterns)]
16649 self.target.as_ref().and_then(|v| match v {
16650 crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
16651 std::option::Option::Some(v)
16652 }
16653 _ => std::option::Option::None,
16654 })
16655 }
16656
16657 /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
16658 /// to hold a `InterconnectAttachment`.
16659 ///
16660 /// Note that all the setters affecting `target` are
16661 /// mutually exclusive.
16662 ///
16663 /// # Example
16664 /// ```ignore,no_run
16665 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16666 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::InterconnectAttachment;
16667 /// let x = PolicyBasedRoute::new().set_interconnect_attachment(InterconnectAttachment::default()/* use setters */);
16668 /// assert!(x.interconnect_attachment().is_some());
16669 /// assert!(x.virtual_machine().is_none());
16670 /// ```
16671 pub fn set_interconnect_attachment<
16672 T: std::convert::Into<
16673 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
16674 >,
16675 >(
16676 mut self,
16677 v: T,
16678 ) -> Self {
16679 self.target = std::option::Option::Some(
16680 crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
16681 );
16682 self
16683 }
16684
16685 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop].
16686 ///
16687 /// Note that all the setters affecting `next_hop` are mutually
16688 /// exclusive.
16689 ///
16690 /// # Example
16691 /// ```ignore,no_run
16692 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16693 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::NextHop;
16694 /// let x = PolicyBasedRoute::new().set_next_hop(Some(NextHop::NextHopIlbIp("example".to_string())));
16695 /// ```
16696 pub fn set_next_hop<
16697 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
16698 >(
16699 mut self,
16700 v: T,
16701 ) -> Self {
16702 self.next_hop = v.into();
16703 self
16704 }
16705
16706 /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16707 /// if it holds a `NextHopIlbIp`, `None` if the field is not set or
16708 /// holds a different branch.
16709 pub fn next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
16710 #[allow(unreachable_patterns)]
16711 self.next_hop.as_ref().and_then(|v| match v {
16712 crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
16713 std::option::Option::Some(v)
16714 }
16715 _ => std::option::Option::None,
16716 })
16717 }
16718
16719 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16720 /// to hold a `NextHopIlbIp`.
16721 ///
16722 /// Note that all the setters affecting `next_hop` are
16723 /// mutually exclusive.
16724 ///
16725 /// # Example
16726 /// ```ignore,no_run
16727 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16728 /// let x = PolicyBasedRoute::new().set_next_hop_ilb_ip("example");
16729 /// assert!(x.next_hop_ilb_ip().is_some());
16730 /// assert!(x.next_hop_other_routes().is_none());
16731 /// ```
16732 pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16733 self.next_hop = std::option::Option::Some(
16734 crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
16735 );
16736 self
16737 }
16738
16739 /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16740 /// if it holds a `NextHopOtherRoutes`, `None` if the field is not set or
16741 /// holds a different branch.
16742 pub fn next_hop_other_routes(
16743 &self,
16744 ) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
16745 #[allow(unreachable_patterns)]
16746 self.next_hop.as_ref().and_then(|v| match v {
16747 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
16748 std::option::Option::Some(v)
16749 }
16750 _ => std::option::Option::None,
16751 })
16752 }
16753
16754 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16755 /// to hold a `NextHopOtherRoutes`.
16756 ///
16757 /// Note that all the setters affecting `next_hop` are
16758 /// mutually exclusive.
16759 ///
16760 /// # Example
16761 /// ```ignore,no_run
16762 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16763 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::OtherRoutes;
16764 /// let x0 = PolicyBasedRoute::new().set_next_hop_other_routes(OtherRoutes::DefaultRouting);
16765 /// assert!(x0.next_hop_other_routes().is_some());
16766 /// assert!(x0.next_hop_ilb_ip().is_none());
16767 /// ```
16768 pub fn set_next_hop_other_routes<
16769 T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
16770 >(
16771 mut self,
16772 v: T,
16773 ) -> Self {
16774 self.next_hop = std::option::Option::Some(
16775 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
16776 );
16777 self
16778 }
16779}
16780
16781impl wkt::message::Message for PolicyBasedRoute {
16782 fn typename() -> &'static str {
16783 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
16784 }
16785}
16786
16787/// Defines additional types related to [PolicyBasedRoute].
16788pub mod policy_based_route {
16789 #[allow(unused_imports)]
16790 use super::*;
16791
16792 /// VM instances that this policy-based route applies to.
16793 #[derive(Clone, Default, PartialEq)]
16794 #[non_exhaustive]
16795 pub struct VirtualMachine {
16796 /// Optional. A list of VM instance tags that this policy-based route applies
16797 /// to. VM instances that have ANY of tags specified here installs this PBR.
16798 pub tags: std::vec::Vec<std::string::String>,
16799
16800 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16801 }
16802
16803 impl VirtualMachine {
16804 pub fn new() -> Self {
16805 std::default::Default::default()
16806 }
16807
16808 /// Sets the value of [tags][crate::model::policy_based_route::VirtualMachine::tags].
16809 ///
16810 /// # Example
16811 /// ```ignore,no_run
16812 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16813 /// let x = VirtualMachine::new().set_tags(["a", "b", "c"]);
16814 /// ```
16815 pub fn set_tags<T, V>(mut self, v: T) -> Self
16816 where
16817 T: std::iter::IntoIterator<Item = V>,
16818 V: std::convert::Into<std::string::String>,
16819 {
16820 use std::iter::Iterator;
16821 self.tags = v.into_iter().map(|i| i.into()).collect();
16822 self
16823 }
16824 }
16825
16826 impl wkt::message::Message for VirtualMachine {
16827 fn typename() -> &'static str {
16828 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
16829 }
16830 }
16831
16832 /// InterconnectAttachment that this route applies to.
16833 #[derive(Clone, Default, PartialEq)]
16834 #[non_exhaustive]
16835 pub struct InterconnectAttachment {
16836 /// Optional. Cloud region to install this policy-based route on interconnect
16837 /// attachment. Use `all` to install it on all interconnect attachments.
16838 pub region: std::string::String,
16839
16840 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16841 }
16842
16843 impl InterconnectAttachment {
16844 pub fn new() -> Self {
16845 std::default::Default::default()
16846 }
16847
16848 /// Sets the value of [region][crate::model::policy_based_route::InterconnectAttachment::region].
16849 ///
16850 /// # Example
16851 /// ```ignore,no_run
16852 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::InterconnectAttachment;
16853 /// let x = InterconnectAttachment::new().set_region("example");
16854 /// ```
16855 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16856 self.region = v.into();
16857 self
16858 }
16859 }
16860
16861 impl wkt::message::Message for InterconnectAttachment {
16862 fn typename() -> &'static str {
16863 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
16864 }
16865 }
16866
16867 /// Filter matches L4 traffic.
16868 #[derive(Clone, Default, PartialEq)]
16869 #[non_exhaustive]
16870 pub struct Filter {
16871 /// Optional. The IP protocol that this policy-based route applies to. Valid
16872 /// values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
16873 pub ip_protocol: std::string::String,
16874
16875 /// Optional. The source IP range of outgoing packets that this policy-based
16876 /// route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
16877 pub src_range: std::string::String,
16878
16879 /// Optional. The destination IP range of outgoing packets that this
16880 /// policy-based route applies to. Default is "0.0.0.0/0" if protocol version
16881 /// is IPv4.
16882 pub dest_range: std::string::String,
16883
16884 /// Required. Internet protocol versions this policy-based route applies to.
16885 /// For this version, only IPV4 is supported. IPV6 is supported in preview.
16886 pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,
16887
16888 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16889 }
16890
16891 impl Filter {
16892 pub fn new() -> Self {
16893 std::default::Default::default()
16894 }
16895
16896 /// Sets the value of [ip_protocol][crate::model::policy_based_route::Filter::ip_protocol].
16897 ///
16898 /// # Example
16899 /// ```ignore,no_run
16900 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16901 /// let x = Filter::new().set_ip_protocol("example");
16902 /// ```
16903 pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16904 self.ip_protocol = v.into();
16905 self
16906 }
16907
16908 /// Sets the value of [src_range][crate::model::policy_based_route::Filter::src_range].
16909 ///
16910 /// # Example
16911 /// ```ignore,no_run
16912 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16913 /// let x = Filter::new().set_src_range("example");
16914 /// ```
16915 pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16916 self.src_range = v.into();
16917 self
16918 }
16919
16920 /// Sets the value of [dest_range][crate::model::policy_based_route::Filter::dest_range].
16921 ///
16922 /// # Example
16923 /// ```ignore,no_run
16924 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16925 /// let x = Filter::new().set_dest_range("example");
16926 /// ```
16927 pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16928 self.dest_range = v.into();
16929 self
16930 }
16931
16932 /// Sets the value of [protocol_version][crate::model::policy_based_route::Filter::protocol_version].
16933 ///
16934 /// # Example
16935 /// ```ignore,no_run
16936 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16937 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::filter::ProtocolVersion;
16938 /// let x0 = Filter::new().set_protocol_version(ProtocolVersion::Ipv4);
16939 /// ```
16940 pub fn set_protocol_version<
16941 T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
16942 >(
16943 mut self,
16944 v: T,
16945 ) -> Self {
16946 self.protocol_version = v.into();
16947 self
16948 }
16949 }
16950
16951 impl wkt::message::Message for Filter {
16952 fn typename() -> &'static str {
16953 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
16954 }
16955 }
16956
16957 /// Defines additional types related to [Filter].
16958 pub mod filter {
16959 #[allow(unused_imports)]
16960 use super::*;
16961
16962 /// The internet protocol version.
16963 ///
16964 /// # Working with unknown values
16965 ///
16966 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16967 /// additional enum variants at any time. Adding new variants is not considered
16968 /// a breaking change. Applications should write their code in anticipation of:
16969 ///
16970 /// - New values appearing in future releases of the client library, **and**
16971 /// - New values received dynamically, without application changes.
16972 ///
16973 /// Please consult the [Working with enums] section in the user guide for some
16974 /// guidelines.
16975 ///
16976 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16977 #[derive(Clone, Debug, PartialEq)]
16978 #[non_exhaustive]
16979 pub enum ProtocolVersion {
16980 /// Default value.
16981 Unspecified,
16982 /// The PBR is for IPv4 internet protocol traffic.
16983 Ipv4,
16984 /// If set, the enum was initialized with an unknown value.
16985 ///
16986 /// Applications can examine the value using [ProtocolVersion::value] or
16987 /// [ProtocolVersion::name].
16988 UnknownValue(protocol_version::UnknownValue),
16989 }
16990
16991 #[doc(hidden)]
16992 pub mod protocol_version {
16993 #[allow(unused_imports)]
16994 use super::*;
16995 #[derive(Clone, Debug, PartialEq)]
16996 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16997 }
16998
16999 impl ProtocolVersion {
17000 /// Gets the enum value.
17001 ///
17002 /// Returns `None` if the enum contains an unknown value deserialized from
17003 /// the string representation of enums.
17004 pub fn value(&self) -> std::option::Option<i32> {
17005 match self {
17006 Self::Unspecified => std::option::Option::Some(0),
17007 Self::Ipv4 => std::option::Option::Some(1),
17008 Self::UnknownValue(u) => u.0.value(),
17009 }
17010 }
17011
17012 /// Gets the enum value as a string.
17013 ///
17014 /// Returns `None` if the enum contains an unknown value deserialized from
17015 /// the integer representation of enums.
17016 pub fn name(&self) -> std::option::Option<&str> {
17017 match self {
17018 Self::Unspecified => std::option::Option::Some("PROTOCOL_VERSION_UNSPECIFIED"),
17019 Self::Ipv4 => std::option::Option::Some("IPV4"),
17020 Self::UnknownValue(u) => u.0.name(),
17021 }
17022 }
17023 }
17024
17025 impl std::default::Default for ProtocolVersion {
17026 fn default() -> Self {
17027 use std::convert::From;
17028 Self::from(0)
17029 }
17030 }
17031
17032 impl std::fmt::Display for ProtocolVersion {
17033 fn fmt(
17034 &self,
17035 f: &mut std::fmt::Formatter<'_>,
17036 ) -> std::result::Result<(), std::fmt::Error> {
17037 wkt::internal::display_enum(f, self.name(), self.value())
17038 }
17039 }
17040
17041 impl std::convert::From<i32> for ProtocolVersion {
17042 fn from(value: i32) -> Self {
17043 match value {
17044 0 => Self::Unspecified,
17045 1 => Self::Ipv4,
17046 _ => Self::UnknownValue(protocol_version::UnknownValue(
17047 wkt::internal::UnknownEnumValue::Integer(value),
17048 )),
17049 }
17050 }
17051 }
17052
17053 impl std::convert::From<&str> for ProtocolVersion {
17054 fn from(value: &str) -> Self {
17055 use std::string::ToString;
17056 match value {
17057 "PROTOCOL_VERSION_UNSPECIFIED" => Self::Unspecified,
17058 "IPV4" => Self::Ipv4,
17059 _ => Self::UnknownValue(protocol_version::UnknownValue(
17060 wkt::internal::UnknownEnumValue::String(value.to_string()),
17061 )),
17062 }
17063 }
17064 }
17065
17066 impl serde::ser::Serialize for ProtocolVersion {
17067 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17068 where
17069 S: serde::Serializer,
17070 {
17071 match self {
17072 Self::Unspecified => serializer.serialize_i32(0),
17073 Self::Ipv4 => serializer.serialize_i32(1),
17074 Self::UnknownValue(u) => u.0.serialize(serializer),
17075 }
17076 }
17077 }
17078
17079 impl<'de> serde::de::Deserialize<'de> for ProtocolVersion {
17080 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17081 where
17082 D: serde::Deserializer<'de>,
17083 {
17084 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProtocolVersion>::new(
17085 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion",
17086 ))
17087 }
17088 }
17089 }
17090
17091 /// Informational warning message.
17092 #[derive(Clone, Default, PartialEq)]
17093 #[non_exhaustive]
17094 pub struct Warnings {
17095 /// Output only. A warning code, if applicable.
17096 pub code: crate::model::policy_based_route::warnings::Code,
17097
17098 /// Output only. Metadata about this warning in key: value format. The key
17099 /// should provides more detail on the warning being returned. For example,
17100 /// for warnings where there are no results in a list request for a
17101 /// particular zone, this key might be scope and the key value might be the
17102 /// zone name. Other examples might be a key indicating a deprecated resource
17103 /// and a suggested replacement.
17104 pub data: std::collections::HashMap<std::string::String, std::string::String>,
17105
17106 /// Output only. A human-readable description of the warning code.
17107 pub warning_message: std::string::String,
17108
17109 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17110 }
17111
17112 impl Warnings {
17113 pub fn new() -> Self {
17114 std::default::Default::default()
17115 }
17116
17117 /// Sets the value of [code][crate::model::policy_based_route::Warnings::code].
17118 ///
17119 /// # Example
17120 /// ```ignore,no_run
17121 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17122 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::warnings::Code;
17123 /// let x0 = Warnings::new().set_code(Code::ResourceNotActive);
17124 /// let x1 = Warnings::new().set_code(Code::ResourceBeingModified);
17125 /// ```
17126 pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
17127 mut self,
17128 v: T,
17129 ) -> Self {
17130 self.code = v.into();
17131 self
17132 }
17133
17134 /// Sets the value of [data][crate::model::policy_based_route::Warnings::data].
17135 ///
17136 /// # Example
17137 /// ```ignore,no_run
17138 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17139 /// let x = Warnings::new().set_data([
17140 /// ("key0", "abc"),
17141 /// ("key1", "xyz"),
17142 /// ]);
17143 /// ```
17144 pub fn set_data<T, K, V>(mut self, v: T) -> Self
17145 where
17146 T: std::iter::IntoIterator<Item = (K, V)>,
17147 K: std::convert::Into<std::string::String>,
17148 V: std::convert::Into<std::string::String>,
17149 {
17150 use std::iter::Iterator;
17151 self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17152 self
17153 }
17154
17155 /// Sets the value of [warning_message][crate::model::policy_based_route::Warnings::warning_message].
17156 ///
17157 /// # Example
17158 /// ```ignore,no_run
17159 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17160 /// let x = Warnings::new().set_warning_message("example");
17161 /// ```
17162 pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
17163 mut self,
17164 v: T,
17165 ) -> Self {
17166 self.warning_message = v.into();
17167 self
17168 }
17169 }
17170
17171 impl wkt::message::Message for Warnings {
17172 fn typename() -> &'static str {
17173 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
17174 }
17175 }
17176
17177 /// Defines additional types related to [Warnings].
17178 pub mod warnings {
17179 #[allow(unused_imports)]
17180 use super::*;
17181
17182 /// Warning code for policy-based routing. Expect to add values in the
17183 /// future.
17184 ///
17185 /// # Working with unknown values
17186 ///
17187 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17188 /// additional enum variants at any time. Adding new variants is not considered
17189 /// a breaking change. Applications should write their code in anticipation of:
17190 ///
17191 /// - New values appearing in future releases of the client library, **and**
17192 /// - New values received dynamically, without application changes.
17193 ///
17194 /// Please consult the [Working with enums] section in the user guide for some
17195 /// guidelines.
17196 ///
17197 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17198 #[derive(Clone, Debug, PartialEq)]
17199 #[non_exhaustive]
17200 pub enum Code {
17201 /// Default value.
17202 WarningUnspecified,
17203 /// The policy-based route is not active and functioning. Common causes are
17204 /// that the dependent network was deleted or the resource project was
17205 /// turned off.
17206 ResourceNotActive,
17207 /// The policy-based route is being modified (e.g. created/deleted) at this
17208 /// time.
17209 ResourceBeingModified,
17210 /// If set, the enum was initialized with an unknown value.
17211 ///
17212 /// Applications can examine the value using [Code::value] or
17213 /// [Code::name].
17214 UnknownValue(code::UnknownValue),
17215 }
17216
17217 #[doc(hidden)]
17218 pub mod code {
17219 #[allow(unused_imports)]
17220 use super::*;
17221 #[derive(Clone, Debug, PartialEq)]
17222 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17223 }
17224
17225 impl Code {
17226 /// Gets the enum value.
17227 ///
17228 /// Returns `None` if the enum contains an unknown value deserialized from
17229 /// the string representation of enums.
17230 pub fn value(&self) -> std::option::Option<i32> {
17231 match self {
17232 Self::WarningUnspecified => std::option::Option::Some(0),
17233 Self::ResourceNotActive => std::option::Option::Some(1),
17234 Self::ResourceBeingModified => std::option::Option::Some(2),
17235 Self::UnknownValue(u) => u.0.value(),
17236 }
17237 }
17238
17239 /// Gets the enum value as a string.
17240 ///
17241 /// Returns `None` if the enum contains an unknown value deserialized from
17242 /// the integer representation of enums.
17243 pub fn name(&self) -> std::option::Option<&str> {
17244 match self {
17245 Self::WarningUnspecified => std::option::Option::Some("WARNING_UNSPECIFIED"),
17246 Self::ResourceNotActive => std::option::Option::Some("RESOURCE_NOT_ACTIVE"),
17247 Self::ResourceBeingModified => {
17248 std::option::Option::Some("RESOURCE_BEING_MODIFIED")
17249 }
17250 Self::UnknownValue(u) => u.0.name(),
17251 }
17252 }
17253 }
17254
17255 impl std::default::Default for Code {
17256 fn default() -> Self {
17257 use std::convert::From;
17258 Self::from(0)
17259 }
17260 }
17261
17262 impl std::fmt::Display for Code {
17263 fn fmt(
17264 &self,
17265 f: &mut std::fmt::Formatter<'_>,
17266 ) -> std::result::Result<(), std::fmt::Error> {
17267 wkt::internal::display_enum(f, self.name(), self.value())
17268 }
17269 }
17270
17271 impl std::convert::From<i32> for Code {
17272 fn from(value: i32) -> Self {
17273 match value {
17274 0 => Self::WarningUnspecified,
17275 1 => Self::ResourceNotActive,
17276 2 => Self::ResourceBeingModified,
17277 _ => Self::UnknownValue(code::UnknownValue(
17278 wkt::internal::UnknownEnumValue::Integer(value),
17279 )),
17280 }
17281 }
17282 }
17283
17284 impl std::convert::From<&str> for Code {
17285 fn from(value: &str) -> Self {
17286 use std::string::ToString;
17287 match value {
17288 "WARNING_UNSPECIFIED" => Self::WarningUnspecified,
17289 "RESOURCE_NOT_ACTIVE" => Self::ResourceNotActive,
17290 "RESOURCE_BEING_MODIFIED" => Self::ResourceBeingModified,
17291 _ => Self::UnknownValue(code::UnknownValue(
17292 wkt::internal::UnknownEnumValue::String(value.to_string()),
17293 )),
17294 }
17295 }
17296 }
17297
17298 impl serde::ser::Serialize for Code {
17299 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17300 where
17301 S: serde::Serializer,
17302 {
17303 match self {
17304 Self::WarningUnspecified => serializer.serialize_i32(0),
17305 Self::ResourceNotActive => serializer.serialize_i32(1),
17306 Self::ResourceBeingModified => serializer.serialize_i32(2),
17307 Self::UnknownValue(u) => u.0.serialize(serializer),
17308 }
17309 }
17310 }
17311
17312 impl<'de> serde::de::Deserialize<'de> for Code {
17313 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17314 where
17315 D: serde::Deserializer<'de>,
17316 {
17317 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
17318 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code",
17319 ))
17320 }
17321 }
17322 }
17323
17324 /// The other routing cases.
17325 ///
17326 /// # Working with unknown values
17327 ///
17328 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17329 /// additional enum variants at any time. Adding new variants is not considered
17330 /// a breaking change. Applications should write their code in anticipation of:
17331 ///
17332 /// - New values appearing in future releases of the client library, **and**
17333 /// - New values received dynamically, without application changes.
17334 ///
17335 /// Please consult the [Working with enums] section in the user guide for some
17336 /// guidelines.
17337 ///
17338 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17339 #[derive(Clone, Debug, PartialEq)]
17340 #[non_exhaustive]
17341 pub enum OtherRoutes {
17342 /// Default value.
17343 Unspecified,
17344 /// Use the routes from the default routing tables (system-generated routes,
17345 /// custom routes, peering route) to determine the next hop. This effectively
17346 /// excludes matching packets being applied on other PBRs with a lower
17347 /// priority.
17348 DefaultRouting,
17349 /// If set, the enum was initialized with an unknown value.
17350 ///
17351 /// Applications can examine the value using [OtherRoutes::value] or
17352 /// [OtherRoutes::name].
17353 UnknownValue(other_routes::UnknownValue),
17354 }
17355
17356 #[doc(hidden)]
17357 pub mod other_routes {
17358 #[allow(unused_imports)]
17359 use super::*;
17360 #[derive(Clone, Debug, PartialEq)]
17361 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17362 }
17363
17364 impl OtherRoutes {
17365 /// Gets the enum value.
17366 ///
17367 /// Returns `None` if the enum contains an unknown value deserialized from
17368 /// the string representation of enums.
17369 pub fn value(&self) -> std::option::Option<i32> {
17370 match self {
17371 Self::Unspecified => std::option::Option::Some(0),
17372 Self::DefaultRouting => std::option::Option::Some(1),
17373 Self::UnknownValue(u) => u.0.value(),
17374 }
17375 }
17376
17377 /// Gets the enum value as a string.
17378 ///
17379 /// Returns `None` if the enum contains an unknown value deserialized from
17380 /// the integer representation of enums.
17381 pub fn name(&self) -> std::option::Option<&str> {
17382 match self {
17383 Self::Unspecified => std::option::Option::Some("OTHER_ROUTES_UNSPECIFIED"),
17384 Self::DefaultRouting => std::option::Option::Some("DEFAULT_ROUTING"),
17385 Self::UnknownValue(u) => u.0.name(),
17386 }
17387 }
17388 }
17389
17390 impl std::default::Default for OtherRoutes {
17391 fn default() -> Self {
17392 use std::convert::From;
17393 Self::from(0)
17394 }
17395 }
17396
17397 impl std::fmt::Display for OtherRoutes {
17398 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17399 wkt::internal::display_enum(f, self.name(), self.value())
17400 }
17401 }
17402
17403 impl std::convert::From<i32> for OtherRoutes {
17404 fn from(value: i32) -> Self {
17405 match value {
17406 0 => Self::Unspecified,
17407 1 => Self::DefaultRouting,
17408 _ => Self::UnknownValue(other_routes::UnknownValue(
17409 wkt::internal::UnknownEnumValue::Integer(value),
17410 )),
17411 }
17412 }
17413 }
17414
17415 impl std::convert::From<&str> for OtherRoutes {
17416 fn from(value: &str) -> Self {
17417 use std::string::ToString;
17418 match value {
17419 "OTHER_ROUTES_UNSPECIFIED" => Self::Unspecified,
17420 "DEFAULT_ROUTING" => Self::DefaultRouting,
17421 _ => Self::UnknownValue(other_routes::UnknownValue(
17422 wkt::internal::UnknownEnumValue::String(value.to_string()),
17423 )),
17424 }
17425 }
17426 }
17427
17428 impl serde::ser::Serialize for OtherRoutes {
17429 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17430 where
17431 S: serde::Serializer,
17432 {
17433 match self {
17434 Self::Unspecified => serializer.serialize_i32(0),
17435 Self::DefaultRouting => serializer.serialize_i32(1),
17436 Self::UnknownValue(u) => u.0.serialize(serializer),
17437 }
17438 }
17439 }
17440
17441 impl<'de> serde::de::Deserialize<'de> for OtherRoutes {
17442 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17443 where
17444 D: serde::Deserializer<'de>,
17445 {
17446 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OtherRoutes>::new(
17447 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes",
17448 ))
17449 }
17450 }
17451
17452 /// Target specifies network endpoints that this policy-based route applies to.
17453 /// If no target is specified, the PBR will be installed on all network
17454 /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
17455 #[derive(Clone, Debug, PartialEq)]
17456 #[non_exhaustive]
17457 pub enum Target {
17458 /// Optional. VM instances that this policy-based route applies to.
17459 VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
17460 /// Optional. The interconnect attachments that this policy-based route
17461 /// applies to.
17462 InterconnectAttachment(
17463 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
17464 ),
17465 }
17466
17467 #[derive(Clone, Debug, PartialEq)]
17468 #[non_exhaustive]
17469 pub enum NextHop {
17470 /// Optional. The IP address of a global-access-enabled L4 ILB that is the
17471 /// next hop for matching packets. For this version, only nextHopIlbIp is
17472 /// supported.
17473 NextHopIlbIp(std::string::String),
17474 /// Optional. Other routes that will be referenced to determine the next hop
17475 /// of the packet.
17476 NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
17477 }
17478}
17479
17480/// Request for
17481/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
17482/// method.
17483///
17484/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
17485#[derive(Clone, Default, PartialEq)]
17486#[non_exhaustive]
17487pub struct ListPolicyBasedRoutesRequest {
17488 /// Required. The parent resource's name.
17489 pub parent: std::string::String,
17490
17491 /// The maximum number of results per page that should be returned.
17492 pub page_size: i32,
17493
17494 /// The page token.
17495 pub page_token: std::string::String,
17496
17497 /// A filter expression that filters the results listed in the response.
17498 pub filter: std::string::String,
17499
17500 /// Sort the results by a certain order.
17501 pub order_by: std::string::String,
17502
17503 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17504}
17505
17506impl ListPolicyBasedRoutesRequest {
17507 pub fn new() -> Self {
17508 std::default::Default::default()
17509 }
17510
17511 /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
17512 ///
17513 /// # Example
17514 /// ```ignore,no_run
17515 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17516 /// let x = ListPolicyBasedRoutesRequest::new().set_parent("example");
17517 /// ```
17518 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17519 self.parent = v.into();
17520 self
17521 }
17522
17523 /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
17524 ///
17525 /// # Example
17526 /// ```ignore,no_run
17527 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17528 /// let x = ListPolicyBasedRoutesRequest::new().set_page_size(42);
17529 /// ```
17530 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17531 self.page_size = v.into();
17532 self
17533 }
17534
17535 /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
17536 ///
17537 /// # Example
17538 /// ```ignore,no_run
17539 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17540 /// let x = ListPolicyBasedRoutesRequest::new().set_page_token("example");
17541 /// ```
17542 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17543 self.page_token = v.into();
17544 self
17545 }
17546
17547 /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
17548 ///
17549 /// # Example
17550 /// ```ignore,no_run
17551 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17552 /// let x = ListPolicyBasedRoutesRequest::new().set_filter("example");
17553 /// ```
17554 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17555 self.filter = v.into();
17556 self
17557 }
17558
17559 /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
17560 ///
17561 /// # Example
17562 /// ```ignore,no_run
17563 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17564 /// let x = ListPolicyBasedRoutesRequest::new().set_order_by("example");
17565 /// ```
17566 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17567 self.order_by = v.into();
17568 self
17569 }
17570}
17571
17572impl wkt::message::Message for ListPolicyBasedRoutesRequest {
17573 fn typename() -> &'static str {
17574 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
17575 }
17576}
17577
17578/// Response for
17579/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
17580/// method.
17581///
17582/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
17583#[derive(Clone, Default, PartialEq)]
17584#[non_exhaustive]
17585pub struct ListPolicyBasedRoutesResponse {
17586 /// Policy-based routes to be returned.
17587 pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,
17588
17589 /// The next pagination token in the List response. It should be used as
17590 /// page_token for the following request. An empty value means no more result.
17591 pub next_page_token: std::string::String,
17592
17593 /// Locations that could not be reached.
17594 pub unreachable: std::vec::Vec<std::string::String>,
17595
17596 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17597}
17598
17599impl ListPolicyBasedRoutesResponse {
17600 pub fn new() -> Self {
17601 std::default::Default::default()
17602 }
17603
17604 /// Sets the value of [policy_based_routes][crate::model::ListPolicyBasedRoutesResponse::policy_based_routes].
17605 ///
17606 /// # Example
17607 /// ```ignore,no_run
17608 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17609 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17610 /// let x = ListPolicyBasedRoutesResponse::new()
17611 /// .set_policy_based_routes([
17612 /// PolicyBasedRoute::default()/* use setters */,
17613 /// PolicyBasedRoute::default()/* use (different) setters */,
17614 /// ]);
17615 /// ```
17616 pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
17617 where
17618 T: std::iter::IntoIterator<Item = V>,
17619 V: std::convert::Into<crate::model::PolicyBasedRoute>,
17620 {
17621 use std::iter::Iterator;
17622 self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
17623 self
17624 }
17625
17626 /// Sets the value of [next_page_token][crate::model::ListPolicyBasedRoutesResponse::next_page_token].
17627 ///
17628 /// # Example
17629 /// ```ignore,no_run
17630 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17631 /// let x = ListPolicyBasedRoutesResponse::new().set_next_page_token("example");
17632 /// ```
17633 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17634 self.next_page_token = v.into();
17635 self
17636 }
17637
17638 /// Sets the value of [unreachable][crate::model::ListPolicyBasedRoutesResponse::unreachable].
17639 ///
17640 /// # Example
17641 /// ```ignore,no_run
17642 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17643 /// let x = ListPolicyBasedRoutesResponse::new().set_unreachable(["a", "b", "c"]);
17644 /// ```
17645 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17646 where
17647 T: std::iter::IntoIterator<Item = V>,
17648 V: std::convert::Into<std::string::String>,
17649 {
17650 use std::iter::Iterator;
17651 self.unreachable = v.into_iter().map(|i| i.into()).collect();
17652 self
17653 }
17654}
17655
17656impl wkt::message::Message for ListPolicyBasedRoutesResponse {
17657 fn typename() -> &'static str {
17658 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
17659 }
17660}
17661
17662#[doc(hidden)]
17663impl google_cloud_gax::paginator::internal::PageableResponse for ListPolicyBasedRoutesResponse {
17664 type PageItem = crate::model::PolicyBasedRoute;
17665
17666 fn items(self) -> std::vec::Vec<Self::PageItem> {
17667 self.policy_based_routes
17668 }
17669
17670 fn next_page_token(&self) -> std::string::String {
17671 use std::clone::Clone;
17672 self.next_page_token.clone()
17673 }
17674}
17675
17676/// Request for
17677/// [PolicyBasedRoutingService.GetPolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]
17678/// method.
17679///
17680/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]: crate::client::PolicyBasedRoutingService::get_policy_based_route
17681#[derive(Clone, Default, PartialEq)]
17682#[non_exhaustive]
17683pub struct GetPolicyBasedRouteRequest {
17684 /// Required. Name of the PolicyBasedRoute resource to get.
17685 pub name: std::string::String,
17686
17687 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17688}
17689
17690impl GetPolicyBasedRouteRequest {
17691 pub fn new() -> Self {
17692 std::default::Default::default()
17693 }
17694
17695 /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
17696 ///
17697 /// # Example
17698 /// ```ignore,no_run
17699 /// # use google_cloud_networkconnectivity_v1::model::GetPolicyBasedRouteRequest;
17700 /// let x = GetPolicyBasedRouteRequest::new().set_name("example");
17701 /// ```
17702 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17703 self.name = v.into();
17704 self
17705 }
17706}
17707
17708impl wkt::message::Message for GetPolicyBasedRouteRequest {
17709 fn typename() -> &'static str {
17710 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
17711 }
17712}
17713
17714/// Request for
17715/// [PolicyBasedRoutingService.CreatePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]
17716/// method.
17717///
17718/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::create_policy_based_route
17719#[derive(Clone, Default, PartialEq)]
17720#[non_exhaustive]
17721pub struct CreatePolicyBasedRouteRequest {
17722 /// Required. The parent resource's name of the PolicyBasedRoute.
17723 pub parent: std::string::String,
17724
17725 /// Required. Unique id for the policy-based route to create. Provided by the
17726 /// client when the resource is created. The name must comply with
17727 /// <https://google.aip.dev/122#resource-id-segments>. Specifically, the name
17728 /// must be 1-63 characters long and match the regular expression
17729 /// [a-z]([a-z0-9-]*[a-z0-9])?. The first character must be a lowercase letter,
17730 /// and all following characters (except for the last character) must be a
17731 /// dash, lowercase letter, or digit. The last character must be a lowercase
17732 /// letter or digit.
17733 pub policy_based_route_id: std::string::String,
17734
17735 /// Required. Initial values for a new policy-based route.
17736 pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,
17737
17738 /// Optional. An optional request ID to identify requests. Specify a unique
17739 /// request ID so that if you must retry your request, the server knows to
17740 /// ignore the request if it has already been completed. The server guarantees
17741 /// that for at least 60 minutes since the first request.
17742 ///
17743 /// For example, consider a situation where you make an initial request and
17744 /// the request times out. If you make the request again with the same request
17745 /// ID, the server can check if original operation with the same request ID
17746 /// was received, and if so, ignores the second request. This prevents clients
17747 /// from accidentally creating duplicate commitments.
17748 ///
17749 /// The request ID must be a valid UUID with the exception that zero UUID is
17750 /// not supported (00000000-0000-0000-0000-000000000000).
17751 pub request_id: std::string::String,
17752
17753 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17754}
17755
17756impl CreatePolicyBasedRouteRequest {
17757 pub fn new() -> Self {
17758 std::default::Default::default()
17759 }
17760
17761 /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
17762 ///
17763 /// # Example
17764 /// ```ignore,no_run
17765 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17766 /// let x = CreatePolicyBasedRouteRequest::new().set_parent("example");
17767 /// ```
17768 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17769 self.parent = v.into();
17770 self
17771 }
17772
17773 /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
17774 ///
17775 /// # Example
17776 /// ```ignore,no_run
17777 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17778 /// let x = CreatePolicyBasedRouteRequest::new().set_policy_based_route_id("example");
17779 /// ```
17780 pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
17781 mut self,
17782 v: T,
17783 ) -> Self {
17784 self.policy_based_route_id = v.into();
17785 self
17786 }
17787
17788 /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
17789 ///
17790 /// # Example
17791 /// ```ignore,no_run
17792 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17793 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17794 /// let x = CreatePolicyBasedRouteRequest::new().set_policy_based_route(PolicyBasedRoute::default()/* use setters */);
17795 /// ```
17796 pub fn set_policy_based_route<T>(mut self, v: T) -> Self
17797 where
17798 T: std::convert::Into<crate::model::PolicyBasedRoute>,
17799 {
17800 self.policy_based_route = std::option::Option::Some(v.into());
17801 self
17802 }
17803
17804 /// Sets or clears the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
17805 ///
17806 /// # Example
17807 /// ```ignore,no_run
17808 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17809 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17810 /// let x = CreatePolicyBasedRouteRequest::new().set_or_clear_policy_based_route(Some(PolicyBasedRoute::default()/* use setters */));
17811 /// let x = CreatePolicyBasedRouteRequest::new().set_or_clear_policy_based_route(None::<PolicyBasedRoute>);
17812 /// ```
17813 pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
17814 where
17815 T: std::convert::Into<crate::model::PolicyBasedRoute>,
17816 {
17817 self.policy_based_route = v.map(|x| x.into());
17818 self
17819 }
17820
17821 /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
17822 ///
17823 /// # Example
17824 /// ```ignore,no_run
17825 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
17826 /// let x = CreatePolicyBasedRouteRequest::new().set_request_id("example");
17827 /// ```
17828 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17829 self.request_id = v.into();
17830 self
17831 }
17832}
17833
17834impl wkt::message::Message for CreatePolicyBasedRouteRequest {
17835 fn typename() -> &'static str {
17836 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
17837 }
17838}
17839
17840/// Request for
17841/// [PolicyBasedRoutingService.DeletePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]
17842/// method.
17843///
17844/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::delete_policy_based_route
17845#[derive(Clone, Default, PartialEq)]
17846#[non_exhaustive]
17847pub struct DeletePolicyBasedRouteRequest {
17848 /// Required. Name of the policy-based route resource to delete.
17849 pub name: std::string::String,
17850
17851 /// Optional. An optional request ID to identify requests. Specify a unique
17852 /// request ID so that if you must retry your request, the server knows to
17853 /// ignore the request if it has already been completed. The server guarantees
17854 /// that for at least 60 minutes after the first request.
17855 ///
17856 /// For example, consider a situation where you make an initial request and
17857 /// the request times out. If you make the request again with the same request
17858 /// ID, the server can check if original operation with the same request ID
17859 /// was received, and if so, ignores the second request. This prevents clients
17860 /// from accidentally creating duplicate commitments.
17861 ///
17862 /// The request ID must be a valid UUID with the exception that zero UUID is
17863 /// not supported (00000000-0000-0000-0000-000000000000).
17864 pub request_id: std::string::String,
17865
17866 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17867}
17868
17869impl DeletePolicyBasedRouteRequest {
17870 pub fn new() -> Self {
17871 std::default::Default::default()
17872 }
17873
17874 /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
17875 ///
17876 /// # Example
17877 /// ```ignore,no_run
17878 /// # use google_cloud_networkconnectivity_v1::model::DeletePolicyBasedRouteRequest;
17879 /// let x = DeletePolicyBasedRouteRequest::new().set_name("example");
17880 /// ```
17881 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17882 self.name = v.into();
17883 self
17884 }
17885
17886 /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
17887 ///
17888 /// # Example
17889 /// ```ignore,no_run
17890 /// # use google_cloud_networkconnectivity_v1::model::DeletePolicyBasedRouteRequest;
17891 /// let x = DeletePolicyBasedRouteRequest::new().set_request_id("example");
17892 /// ```
17893 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17894 self.request_id = v.into();
17895 self
17896 }
17897}
17898
17899impl wkt::message::Message for DeletePolicyBasedRouteRequest {
17900 fn typename() -> &'static str {
17901 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
17902 }
17903}
17904
17905/// The infrastructure used for connections between consumers/producers.
17906///
17907/// # Working with unknown values
17908///
17909/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17910/// additional enum variants at any time. Adding new variants is not considered
17911/// a breaking change. Applications should write their code in anticipation of:
17912///
17913/// - New values appearing in future releases of the client library, **and**
17914/// - New values received dynamically, without application changes.
17915///
17916/// Please consult the [Working with enums] section in the user guide for some
17917/// guidelines.
17918///
17919/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17920#[derive(Clone, Debug, PartialEq)]
17921#[non_exhaustive]
17922pub enum Infrastructure {
17923 /// An invalid infrastructure as the default case.
17924 Unspecified,
17925 /// Private Service Connect is used for connections.
17926 Psc,
17927 /// If set, the enum was initialized with an unknown value.
17928 ///
17929 /// Applications can examine the value using [Infrastructure::value] or
17930 /// [Infrastructure::name].
17931 UnknownValue(infrastructure::UnknownValue),
17932}
17933
17934#[doc(hidden)]
17935pub mod infrastructure {
17936 #[allow(unused_imports)]
17937 use super::*;
17938 #[derive(Clone, Debug, PartialEq)]
17939 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17940}
17941
17942impl Infrastructure {
17943 /// Gets the enum value.
17944 ///
17945 /// Returns `None` if the enum contains an unknown value deserialized from
17946 /// the string representation of enums.
17947 pub fn value(&self) -> std::option::Option<i32> {
17948 match self {
17949 Self::Unspecified => std::option::Option::Some(0),
17950 Self::Psc => std::option::Option::Some(1),
17951 Self::UnknownValue(u) => u.0.value(),
17952 }
17953 }
17954
17955 /// Gets the enum value as a string.
17956 ///
17957 /// Returns `None` if the enum contains an unknown value deserialized from
17958 /// the integer representation of enums.
17959 pub fn name(&self) -> std::option::Option<&str> {
17960 match self {
17961 Self::Unspecified => std::option::Option::Some("INFRASTRUCTURE_UNSPECIFIED"),
17962 Self::Psc => std::option::Option::Some("PSC"),
17963 Self::UnknownValue(u) => u.0.name(),
17964 }
17965 }
17966}
17967
17968impl std::default::Default for Infrastructure {
17969 fn default() -> Self {
17970 use std::convert::From;
17971 Self::from(0)
17972 }
17973}
17974
17975impl std::fmt::Display for Infrastructure {
17976 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17977 wkt::internal::display_enum(f, self.name(), self.value())
17978 }
17979}
17980
17981impl std::convert::From<i32> for Infrastructure {
17982 fn from(value: i32) -> Self {
17983 match value {
17984 0 => Self::Unspecified,
17985 1 => Self::Psc,
17986 _ => Self::UnknownValue(infrastructure::UnknownValue(
17987 wkt::internal::UnknownEnumValue::Integer(value),
17988 )),
17989 }
17990 }
17991}
17992
17993impl std::convert::From<&str> for Infrastructure {
17994 fn from(value: &str) -> Self {
17995 use std::string::ToString;
17996 match value {
17997 "INFRASTRUCTURE_UNSPECIFIED" => Self::Unspecified,
17998 "PSC" => Self::Psc,
17999 _ => Self::UnknownValue(infrastructure::UnknownValue(
18000 wkt::internal::UnknownEnumValue::String(value.to_string()),
18001 )),
18002 }
18003 }
18004}
18005
18006impl serde::ser::Serialize for Infrastructure {
18007 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18008 where
18009 S: serde::Serializer,
18010 {
18011 match self {
18012 Self::Unspecified => serializer.serialize_i32(0),
18013 Self::Psc => serializer.serialize_i32(1),
18014 Self::UnknownValue(u) => u.0.serialize(serializer),
18015 }
18016 }
18017}
18018
18019impl<'de> serde::de::Deserialize<'de> for Infrastructure {
18020 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18021 where
18022 D: serde::Deserializer<'de>,
18023 {
18024 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Infrastructure>::new(
18025 ".google.cloud.networkconnectivity.v1.Infrastructure",
18026 ))
18027 }
18028}
18029
18030/// The error type indicates whether a connection error is consumer facing,
18031/// producer facing or system internal.
18032///
18033/// # Working with unknown values
18034///
18035/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18036/// additional enum variants at any time. Adding new variants is not considered
18037/// a breaking change. Applications should write their code in anticipation of:
18038///
18039/// - New values appearing in future releases of the client library, **and**
18040/// - New values received dynamically, without application changes.
18041///
18042/// Please consult the [Working with enums] section in the user guide for some
18043/// guidelines.
18044///
18045/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18046#[derive(Clone, Debug, PartialEq)]
18047#[non_exhaustive]
18048pub enum ConnectionErrorType {
18049 /// An invalid error type as the default case.
18050 Unspecified,
18051 /// The error is due to Service Automation system internal.
18052 ErrorInternal,
18053 /// The error is due to the setup on consumer side.
18054 ErrorConsumerSide,
18055 /// The error is due to the setup on producer side.
18056 ErrorProducerSide,
18057 /// If set, the enum was initialized with an unknown value.
18058 ///
18059 /// Applications can examine the value using [ConnectionErrorType::value] or
18060 /// [ConnectionErrorType::name].
18061 UnknownValue(connection_error_type::UnknownValue),
18062}
18063
18064#[doc(hidden)]
18065pub mod connection_error_type {
18066 #[allow(unused_imports)]
18067 use super::*;
18068 #[derive(Clone, Debug, PartialEq)]
18069 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18070}
18071
18072impl ConnectionErrorType {
18073 /// Gets the enum value.
18074 ///
18075 /// Returns `None` if the enum contains an unknown value deserialized from
18076 /// the string representation of enums.
18077 pub fn value(&self) -> std::option::Option<i32> {
18078 match self {
18079 Self::Unspecified => std::option::Option::Some(0),
18080 Self::ErrorInternal => std::option::Option::Some(1),
18081 Self::ErrorConsumerSide => std::option::Option::Some(2),
18082 Self::ErrorProducerSide => std::option::Option::Some(3),
18083 Self::UnknownValue(u) => u.0.value(),
18084 }
18085 }
18086
18087 /// Gets the enum value as a string.
18088 ///
18089 /// Returns `None` if the enum contains an unknown value deserialized from
18090 /// the integer representation of enums.
18091 pub fn name(&self) -> std::option::Option<&str> {
18092 match self {
18093 Self::Unspecified => std::option::Option::Some("CONNECTION_ERROR_TYPE_UNSPECIFIED"),
18094 Self::ErrorInternal => std::option::Option::Some("ERROR_INTERNAL"),
18095 Self::ErrorConsumerSide => std::option::Option::Some("ERROR_CONSUMER_SIDE"),
18096 Self::ErrorProducerSide => std::option::Option::Some("ERROR_PRODUCER_SIDE"),
18097 Self::UnknownValue(u) => u.0.name(),
18098 }
18099 }
18100}
18101
18102impl std::default::Default for ConnectionErrorType {
18103 fn default() -> Self {
18104 use std::convert::From;
18105 Self::from(0)
18106 }
18107}
18108
18109impl std::fmt::Display for ConnectionErrorType {
18110 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18111 wkt::internal::display_enum(f, self.name(), self.value())
18112 }
18113}
18114
18115impl std::convert::From<i32> for ConnectionErrorType {
18116 fn from(value: i32) -> Self {
18117 match value {
18118 0 => Self::Unspecified,
18119 1 => Self::ErrorInternal,
18120 2 => Self::ErrorConsumerSide,
18121 3 => Self::ErrorProducerSide,
18122 _ => Self::UnknownValue(connection_error_type::UnknownValue(
18123 wkt::internal::UnknownEnumValue::Integer(value),
18124 )),
18125 }
18126 }
18127}
18128
18129impl std::convert::From<&str> for ConnectionErrorType {
18130 fn from(value: &str) -> Self {
18131 use std::string::ToString;
18132 match value {
18133 "CONNECTION_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
18134 "ERROR_INTERNAL" => Self::ErrorInternal,
18135 "ERROR_CONSUMER_SIDE" => Self::ErrorConsumerSide,
18136 "ERROR_PRODUCER_SIDE" => Self::ErrorProducerSide,
18137 _ => Self::UnknownValue(connection_error_type::UnknownValue(
18138 wkt::internal::UnknownEnumValue::String(value.to_string()),
18139 )),
18140 }
18141 }
18142}
18143
18144impl serde::ser::Serialize for ConnectionErrorType {
18145 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18146 where
18147 S: serde::Serializer,
18148 {
18149 match self {
18150 Self::Unspecified => serializer.serialize_i32(0),
18151 Self::ErrorInternal => serializer.serialize_i32(1),
18152 Self::ErrorConsumerSide => serializer.serialize_i32(2),
18153 Self::ErrorProducerSide => serializer.serialize_i32(3),
18154 Self::UnknownValue(u) => u.0.serialize(serializer),
18155 }
18156 }
18157}
18158
18159impl<'de> serde::de::Deserialize<'de> for ConnectionErrorType {
18160 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18161 where
18162 D: serde::Deserializer<'de>,
18163 {
18164 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionErrorType>::new(
18165 ".google.cloud.networkconnectivity.v1.ConnectionErrorType",
18166 ))
18167 }
18168}
18169
18170/// The requested IP version for the PSC connection.
18171///
18172/// # Working with unknown values
18173///
18174/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18175/// additional enum variants at any time. Adding new variants is not considered
18176/// a breaking change. Applications should write their code in anticipation of:
18177///
18178/// - New values appearing in future releases of the client library, **and**
18179/// - New values received dynamically, without application changes.
18180///
18181/// Please consult the [Working with enums] section in the user guide for some
18182/// guidelines.
18183///
18184/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18185#[derive(Clone, Debug, PartialEq)]
18186#[non_exhaustive]
18187pub enum IPVersion {
18188 /// Default value. We will use IPv4 or IPv6 depending on the IP version of
18189 /// first available subnetwork.
18190 Unspecified,
18191 /// Will use IPv4 only.
18192 Ipv4,
18193 /// Will use IPv6 only.
18194 Ipv6,
18195 /// If set, the enum was initialized with an unknown value.
18196 ///
18197 /// Applications can examine the value using [IPVersion::value] or
18198 /// [IPVersion::name].
18199 UnknownValue(ip_version::UnknownValue),
18200}
18201
18202#[doc(hidden)]
18203pub mod ip_version {
18204 #[allow(unused_imports)]
18205 use super::*;
18206 #[derive(Clone, Debug, PartialEq)]
18207 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18208}
18209
18210impl IPVersion {
18211 /// Gets the enum value.
18212 ///
18213 /// Returns `None` if the enum contains an unknown value deserialized from
18214 /// the string representation of enums.
18215 pub fn value(&self) -> std::option::Option<i32> {
18216 match self {
18217 Self::Unspecified => std::option::Option::Some(0),
18218 Self::Ipv4 => std::option::Option::Some(1),
18219 Self::Ipv6 => std::option::Option::Some(2),
18220 Self::UnknownValue(u) => u.0.value(),
18221 }
18222 }
18223
18224 /// Gets the enum value as a string.
18225 ///
18226 /// Returns `None` if the enum contains an unknown value deserialized from
18227 /// the integer representation of enums.
18228 pub fn name(&self) -> std::option::Option<&str> {
18229 match self {
18230 Self::Unspecified => std::option::Option::Some("IP_VERSION_UNSPECIFIED"),
18231 Self::Ipv4 => std::option::Option::Some("IPV4"),
18232 Self::Ipv6 => std::option::Option::Some("IPV6"),
18233 Self::UnknownValue(u) => u.0.name(),
18234 }
18235 }
18236}
18237
18238impl std::default::Default for IPVersion {
18239 fn default() -> Self {
18240 use std::convert::From;
18241 Self::from(0)
18242 }
18243}
18244
18245impl std::fmt::Display for IPVersion {
18246 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18247 wkt::internal::display_enum(f, self.name(), self.value())
18248 }
18249}
18250
18251impl std::convert::From<i32> for IPVersion {
18252 fn from(value: i32) -> Self {
18253 match value {
18254 0 => Self::Unspecified,
18255 1 => Self::Ipv4,
18256 2 => Self::Ipv6,
18257 _ => Self::UnknownValue(ip_version::UnknownValue(
18258 wkt::internal::UnknownEnumValue::Integer(value),
18259 )),
18260 }
18261 }
18262}
18263
18264impl std::convert::From<&str> for IPVersion {
18265 fn from(value: &str) -> Self {
18266 use std::string::ToString;
18267 match value {
18268 "IP_VERSION_UNSPECIFIED" => Self::Unspecified,
18269 "IPV4" => Self::Ipv4,
18270 "IPV6" => Self::Ipv6,
18271 _ => Self::UnknownValue(ip_version::UnknownValue(
18272 wkt::internal::UnknownEnumValue::String(value.to_string()),
18273 )),
18274 }
18275 }
18276}
18277
18278impl serde::ser::Serialize for IPVersion {
18279 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18280 where
18281 S: serde::Serializer,
18282 {
18283 match self {
18284 Self::Unspecified => serializer.serialize_i32(0),
18285 Self::Ipv4 => serializer.serialize_i32(1),
18286 Self::Ipv6 => serializer.serialize_i32(2),
18287 Self::UnknownValue(u) => u.0.serialize(serializer),
18288 }
18289 }
18290}
18291
18292impl<'de> serde::de::Deserialize<'de> for IPVersion {
18293 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18294 where
18295 D: serde::Deserializer<'de>,
18296 {
18297 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IPVersion>::new(
18298 ".google.cloud.networkconnectivity.v1.IPVersion",
18299 ))
18300 }
18301}
18302
18303/// Supported features for a location
18304///
18305/// # Working with unknown values
18306///
18307/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18308/// additional enum variants at any time. Adding new variants is not considered
18309/// a breaking change. Applications should write their code in anticipation of:
18310///
18311/// - New values appearing in future releases of the client library, **and**
18312/// - New values received dynamically, without application changes.
18313///
18314/// Please consult the [Working with enums] section in the user guide for some
18315/// guidelines.
18316///
18317/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18318#[derive(Clone, Debug, PartialEq)]
18319#[non_exhaustive]
18320pub enum LocationFeature {
18321 /// No publicly supported feature in this location
18322 Unspecified,
18323 /// Site-to-cloud spokes are supported in this location
18324 SiteToCloudSpokes,
18325 /// Site-to-site spokes are supported in this location
18326 SiteToSiteSpokes,
18327 /// If set, the enum was initialized with an unknown value.
18328 ///
18329 /// Applications can examine the value using [LocationFeature::value] or
18330 /// [LocationFeature::name].
18331 UnknownValue(location_feature::UnknownValue),
18332}
18333
18334#[doc(hidden)]
18335pub mod location_feature {
18336 #[allow(unused_imports)]
18337 use super::*;
18338 #[derive(Clone, Debug, PartialEq)]
18339 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18340}
18341
18342impl LocationFeature {
18343 /// Gets the enum value.
18344 ///
18345 /// Returns `None` if the enum contains an unknown value deserialized from
18346 /// the string representation of enums.
18347 pub fn value(&self) -> std::option::Option<i32> {
18348 match self {
18349 Self::Unspecified => std::option::Option::Some(0),
18350 Self::SiteToCloudSpokes => std::option::Option::Some(1),
18351 Self::SiteToSiteSpokes => std::option::Option::Some(2),
18352 Self::UnknownValue(u) => u.0.value(),
18353 }
18354 }
18355
18356 /// Gets the enum value as a string.
18357 ///
18358 /// Returns `None` if the enum contains an unknown value deserialized from
18359 /// the integer representation of enums.
18360 pub fn name(&self) -> std::option::Option<&str> {
18361 match self {
18362 Self::Unspecified => std::option::Option::Some("LOCATION_FEATURE_UNSPECIFIED"),
18363 Self::SiteToCloudSpokes => std::option::Option::Some("SITE_TO_CLOUD_SPOKES"),
18364 Self::SiteToSiteSpokes => std::option::Option::Some("SITE_TO_SITE_SPOKES"),
18365 Self::UnknownValue(u) => u.0.name(),
18366 }
18367 }
18368}
18369
18370impl std::default::Default for LocationFeature {
18371 fn default() -> Self {
18372 use std::convert::From;
18373 Self::from(0)
18374 }
18375}
18376
18377impl std::fmt::Display for LocationFeature {
18378 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18379 wkt::internal::display_enum(f, self.name(), self.value())
18380 }
18381}
18382
18383impl std::convert::From<i32> for LocationFeature {
18384 fn from(value: i32) -> Self {
18385 match value {
18386 0 => Self::Unspecified,
18387 1 => Self::SiteToCloudSpokes,
18388 2 => Self::SiteToSiteSpokes,
18389 _ => Self::UnknownValue(location_feature::UnknownValue(
18390 wkt::internal::UnknownEnumValue::Integer(value),
18391 )),
18392 }
18393 }
18394}
18395
18396impl std::convert::From<&str> for LocationFeature {
18397 fn from(value: &str) -> Self {
18398 use std::string::ToString;
18399 match value {
18400 "LOCATION_FEATURE_UNSPECIFIED" => Self::Unspecified,
18401 "SITE_TO_CLOUD_SPOKES" => Self::SiteToCloudSpokes,
18402 "SITE_TO_SITE_SPOKES" => Self::SiteToSiteSpokes,
18403 _ => Self::UnknownValue(location_feature::UnknownValue(
18404 wkt::internal::UnknownEnumValue::String(value.to_string()),
18405 )),
18406 }
18407 }
18408}
18409
18410impl serde::ser::Serialize for LocationFeature {
18411 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18412 where
18413 S: serde::Serializer,
18414 {
18415 match self {
18416 Self::Unspecified => serializer.serialize_i32(0),
18417 Self::SiteToCloudSpokes => serializer.serialize_i32(1),
18418 Self::SiteToSiteSpokes => serializer.serialize_i32(2),
18419 Self::UnknownValue(u) => u.0.serialize(serializer),
18420 }
18421 }
18422}
18423
18424impl<'de> serde::de::Deserialize<'de> for LocationFeature {
18425 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18426 where
18427 D: serde::Deserializer<'de>,
18428 {
18429 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationFeature>::new(
18430 ".google.cloud.networkconnectivity.v1.LocationFeature",
18431 ))
18432 }
18433}
18434
18435/// The route's type
18436///
18437/// # Working with unknown values
18438///
18439/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18440/// additional enum variants at any time. Adding new variants is not considered
18441/// a breaking change. Applications should write their code in anticipation of:
18442///
18443/// - New values appearing in future releases of the client library, **and**
18444/// - New values received dynamically, without application changes.
18445///
18446/// Please consult the [Working with enums] section in the user guide for some
18447/// guidelines.
18448///
18449/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18450#[derive(Clone, Debug, PartialEq)]
18451#[non_exhaustive]
18452pub enum RouteType {
18453 /// No route type information specified
18454 Unspecified,
18455 /// The route leads to a destination within the primary address range of the
18456 /// VPC network's subnet.
18457 VpcPrimarySubnet,
18458 /// The route leads to a destination within the secondary address range of the
18459 /// VPC network's subnet.
18460 VpcSecondarySubnet,
18461 /// The route leads to a destination in a dynamic route. Dynamic routes are
18462 /// derived from Border Gateway Protocol (BGP) advertisements received from an
18463 /// NCC hybrid spoke.
18464 DynamicRoute,
18465 /// If set, the enum was initialized with an unknown value.
18466 ///
18467 /// Applications can examine the value using [RouteType::value] or
18468 /// [RouteType::name].
18469 UnknownValue(route_type::UnknownValue),
18470}
18471
18472#[doc(hidden)]
18473pub mod route_type {
18474 #[allow(unused_imports)]
18475 use super::*;
18476 #[derive(Clone, Debug, PartialEq)]
18477 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18478}
18479
18480impl RouteType {
18481 /// Gets the enum value.
18482 ///
18483 /// Returns `None` if the enum contains an unknown value deserialized from
18484 /// the string representation of enums.
18485 pub fn value(&self) -> std::option::Option<i32> {
18486 match self {
18487 Self::Unspecified => std::option::Option::Some(0),
18488 Self::VpcPrimarySubnet => std::option::Option::Some(1),
18489 Self::VpcSecondarySubnet => std::option::Option::Some(2),
18490 Self::DynamicRoute => std::option::Option::Some(3),
18491 Self::UnknownValue(u) => u.0.value(),
18492 }
18493 }
18494
18495 /// Gets the enum value as a string.
18496 ///
18497 /// Returns `None` if the enum contains an unknown value deserialized from
18498 /// the integer representation of enums.
18499 pub fn name(&self) -> std::option::Option<&str> {
18500 match self {
18501 Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
18502 Self::VpcPrimarySubnet => std::option::Option::Some("VPC_PRIMARY_SUBNET"),
18503 Self::VpcSecondarySubnet => std::option::Option::Some("VPC_SECONDARY_SUBNET"),
18504 Self::DynamicRoute => std::option::Option::Some("DYNAMIC_ROUTE"),
18505 Self::UnknownValue(u) => u.0.name(),
18506 }
18507 }
18508}
18509
18510impl std::default::Default for RouteType {
18511 fn default() -> Self {
18512 use std::convert::From;
18513 Self::from(0)
18514 }
18515}
18516
18517impl std::fmt::Display for RouteType {
18518 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18519 wkt::internal::display_enum(f, self.name(), self.value())
18520 }
18521}
18522
18523impl std::convert::From<i32> for RouteType {
18524 fn from(value: i32) -> Self {
18525 match value {
18526 0 => Self::Unspecified,
18527 1 => Self::VpcPrimarySubnet,
18528 2 => Self::VpcSecondarySubnet,
18529 3 => Self::DynamicRoute,
18530 _ => Self::UnknownValue(route_type::UnknownValue(
18531 wkt::internal::UnknownEnumValue::Integer(value),
18532 )),
18533 }
18534 }
18535}
18536
18537impl std::convert::From<&str> for RouteType {
18538 fn from(value: &str) -> Self {
18539 use std::string::ToString;
18540 match value {
18541 "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
18542 "VPC_PRIMARY_SUBNET" => Self::VpcPrimarySubnet,
18543 "VPC_SECONDARY_SUBNET" => Self::VpcSecondarySubnet,
18544 "DYNAMIC_ROUTE" => Self::DynamicRoute,
18545 _ => Self::UnknownValue(route_type::UnknownValue(
18546 wkt::internal::UnknownEnumValue::String(value.to_string()),
18547 )),
18548 }
18549 }
18550}
18551
18552impl serde::ser::Serialize for RouteType {
18553 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18554 where
18555 S: serde::Serializer,
18556 {
18557 match self {
18558 Self::Unspecified => serializer.serialize_i32(0),
18559 Self::VpcPrimarySubnet => serializer.serialize_i32(1),
18560 Self::VpcSecondarySubnet => serializer.serialize_i32(2),
18561 Self::DynamicRoute => serializer.serialize_i32(3),
18562 Self::UnknownValue(u) => u.0.serialize(serializer),
18563 }
18564 }
18565}
18566
18567impl<'de> serde::de::Deserialize<'de> for RouteType {
18568 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18569 where
18570 D: serde::Deserializer<'de>,
18571 {
18572 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
18573 ".google.cloud.networkconnectivity.v1.RouteType",
18574 ))
18575 }
18576}
18577
18578/// The State enum represents the lifecycle stage of a Network Connectivity
18579/// Center resource.
18580///
18581/// # Working with unknown values
18582///
18583/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18584/// additional enum variants at any time. Adding new variants is not considered
18585/// a breaking change. Applications should write their code in anticipation of:
18586///
18587/// - New values appearing in future releases of the client library, **and**
18588/// - New values received dynamically, without application changes.
18589///
18590/// Please consult the [Working with enums] section in the user guide for some
18591/// guidelines.
18592///
18593/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18594#[derive(Clone, Debug, PartialEq)]
18595#[non_exhaustive]
18596pub enum State {
18597 /// No state information available
18598 Unspecified,
18599 /// The resource's create operation is in progress.
18600 Creating,
18601 /// The resource is active
18602 Active,
18603 /// The resource's delete operation is in progress.
18604 Deleting,
18605 /// The resource's accept operation is in progress.
18606 Accepting,
18607 /// The resource's reject operation is in progress.
18608 Rejecting,
18609 /// The resource's update operation is in progress.
18610 Updating,
18611 /// The resource is inactive.
18612 Inactive,
18613 /// The hub associated with this spoke resource has been deleted.
18614 /// This state applies to spoke resources only.
18615 Obsolete,
18616 /// The resource is in an undefined state due to resource creation or deletion
18617 /// failure. You can try to delete the resource later or contact support for
18618 /// help.
18619 Failed,
18620 /// If set, the enum was initialized with an unknown value.
18621 ///
18622 /// Applications can examine the value using [State::value] or
18623 /// [State::name].
18624 UnknownValue(state::UnknownValue),
18625}
18626
18627#[doc(hidden)]
18628pub mod state {
18629 #[allow(unused_imports)]
18630 use super::*;
18631 #[derive(Clone, Debug, PartialEq)]
18632 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18633}
18634
18635impl State {
18636 /// Gets the enum value.
18637 ///
18638 /// Returns `None` if the enum contains an unknown value deserialized from
18639 /// the string representation of enums.
18640 pub fn value(&self) -> std::option::Option<i32> {
18641 match self {
18642 Self::Unspecified => std::option::Option::Some(0),
18643 Self::Creating => std::option::Option::Some(1),
18644 Self::Active => std::option::Option::Some(2),
18645 Self::Deleting => std::option::Option::Some(3),
18646 Self::Accepting => std::option::Option::Some(8),
18647 Self::Rejecting => std::option::Option::Some(9),
18648 Self::Updating => std::option::Option::Some(6),
18649 Self::Inactive => std::option::Option::Some(7),
18650 Self::Obsolete => std::option::Option::Some(10),
18651 Self::Failed => std::option::Option::Some(11),
18652 Self::UnknownValue(u) => u.0.value(),
18653 }
18654 }
18655
18656 /// Gets the enum value as a string.
18657 ///
18658 /// Returns `None` if the enum contains an unknown value deserialized from
18659 /// the integer representation of enums.
18660 pub fn name(&self) -> std::option::Option<&str> {
18661 match self {
18662 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18663 Self::Creating => std::option::Option::Some("CREATING"),
18664 Self::Active => std::option::Option::Some("ACTIVE"),
18665 Self::Deleting => std::option::Option::Some("DELETING"),
18666 Self::Accepting => std::option::Option::Some("ACCEPTING"),
18667 Self::Rejecting => std::option::Option::Some("REJECTING"),
18668 Self::Updating => std::option::Option::Some("UPDATING"),
18669 Self::Inactive => std::option::Option::Some("INACTIVE"),
18670 Self::Obsolete => std::option::Option::Some("OBSOLETE"),
18671 Self::Failed => std::option::Option::Some("FAILED"),
18672 Self::UnknownValue(u) => u.0.name(),
18673 }
18674 }
18675}
18676
18677impl std::default::Default for State {
18678 fn default() -> Self {
18679 use std::convert::From;
18680 Self::from(0)
18681 }
18682}
18683
18684impl std::fmt::Display for State {
18685 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18686 wkt::internal::display_enum(f, self.name(), self.value())
18687 }
18688}
18689
18690impl std::convert::From<i32> for State {
18691 fn from(value: i32) -> Self {
18692 match value {
18693 0 => Self::Unspecified,
18694 1 => Self::Creating,
18695 2 => Self::Active,
18696 3 => Self::Deleting,
18697 6 => Self::Updating,
18698 7 => Self::Inactive,
18699 8 => Self::Accepting,
18700 9 => Self::Rejecting,
18701 10 => Self::Obsolete,
18702 11 => Self::Failed,
18703 _ => Self::UnknownValue(state::UnknownValue(
18704 wkt::internal::UnknownEnumValue::Integer(value),
18705 )),
18706 }
18707 }
18708}
18709
18710impl std::convert::From<&str> for State {
18711 fn from(value: &str) -> Self {
18712 use std::string::ToString;
18713 match value {
18714 "STATE_UNSPECIFIED" => Self::Unspecified,
18715 "CREATING" => Self::Creating,
18716 "ACTIVE" => Self::Active,
18717 "DELETING" => Self::Deleting,
18718 "ACCEPTING" => Self::Accepting,
18719 "REJECTING" => Self::Rejecting,
18720 "UPDATING" => Self::Updating,
18721 "INACTIVE" => Self::Inactive,
18722 "OBSOLETE" => Self::Obsolete,
18723 "FAILED" => Self::Failed,
18724 _ => Self::UnknownValue(state::UnknownValue(
18725 wkt::internal::UnknownEnumValue::String(value.to_string()),
18726 )),
18727 }
18728 }
18729}
18730
18731impl serde::ser::Serialize for State {
18732 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18733 where
18734 S: serde::Serializer,
18735 {
18736 match self {
18737 Self::Unspecified => serializer.serialize_i32(0),
18738 Self::Creating => serializer.serialize_i32(1),
18739 Self::Active => serializer.serialize_i32(2),
18740 Self::Deleting => serializer.serialize_i32(3),
18741 Self::Accepting => serializer.serialize_i32(8),
18742 Self::Rejecting => serializer.serialize_i32(9),
18743 Self::Updating => serializer.serialize_i32(6),
18744 Self::Inactive => serializer.serialize_i32(7),
18745 Self::Obsolete => serializer.serialize_i32(10),
18746 Self::Failed => serializer.serialize_i32(11),
18747 Self::UnknownValue(u) => u.0.serialize(serializer),
18748 }
18749 }
18750}
18751
18752impl<'de> serde::de::Deserialize<'de> for State {
18753 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18754 where
18755 D: serde::Deserializer<'de>,
18756 {
18757 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18758 ".google.cloud.networkconnectivity.v1.State",
18759 ))
18760 }
18761}
18762
18763/// The SpokeType enum represents the type of spoke. The type
18764/// reflects the kind of resource that a spoke is associated with.
18765///
18766/// # Working with unknown values
18767///
18768/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18769/// additional enum variants at any time. Adding new variants is not considered
18770/// a breaking change. Applications should write their code in anticipation of:
18771///
18772/// - New values appearing in future releases of the client library, **and**
18773/// - New values received dynamically, without application changes.
18774///
18775/// Please consult the [Working with enums] section in the user guide for some
18776/// guidelines.
18777///
18778/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18779#[derive(Clone, Debug, PartialEq)]
18780#[non_exhaustive]
18781pub enum SpokeType {
18782 /// Unspecified spoke type.
18783 Unspecified,
18784 /// Spokes associated with VPN tunnels.
18785 VpnTunnel,
18786 /// Spokes associated with VLAN attachments.
18787 InterconnectAttachment,
18788 /// Spokes associated with router appliance instances.
18789 RouterAppliance,
18790 /// Spokes associated with VPC networks.
18791 VpcNetwork,
18792 /// Spokes that are backed by a producer VPC network.
18793 ProducerVpcNetwork,
18794 /// If set, the enum was initialized with an unknown value.
18795 ///
18796 /// Applications can examine the value using [SpokeType::value] or
18797 /// [SpokeType::name].
18798 UnknownValue(spoke_type::UnknownValue),
18799}
18800
18801#[doc(hidden)]
18802pub mod spoke_type {
18803 #[allow(unused_imports)]
18804 use super::*;
18805 #[derive(Clone, Debug, PartialEq)]
18806 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18807}
18808
18809impl SpokeType {
18810 /// Gets the enum value.
18811 ///
18812 /// Returns `None` if the enum contains an unknown value deserialized from
18813 /// the string representation of enums.
18814 pub fn value(&self) -> std::option::Option<i32> {
18815 match self {
18816 Self::Unspecified => std::option::Option::Some(0),
18817 Self::VpnTunnel => std::option::Option::Some(1),
18818 Self::InterconnectAttachment => std::option::Option::Some(2),
18819 Self::RouterAppliance => std::option::Option::Some(3),
18820 Self::VpcNetwork => std::option::Option::Some(4),
18821 Self::ProducerVpcNetwork => std::option::Option::Some(7),
18822 Self::UnknownValue(u) => u.0.value(),
18823 }
18824 }
18825
18826 /// Gets the enum value as a string.
18827 ///
18828 /// Returns `None` if the enum contains an unknown value deserialized from
18829 /// the integer representation of enums.
18830 pub fn name(&self) -> std::option::Option<&str> {
18831 match self {
18832 Self::Unspecified => std::option::Option::Some("SPOKE_TYPE_UNSPECIFIED"),
18833 Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
18834 Self::InterconnectAttachment => std::option::Option::Some("INTERCONNECT_ATTACHMENT"),
18835 Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
18836 Self::VpcNetwork => std::option::Option::Some("VPC_NETWORK"),
18837 Self::ProducerVpcNetwork => std::option::Option::Some("PRODUCER_VPC_NETWORK"),
18838 Self::UnknownValue(u) => u.0.name(),
18839 }
18840 }
18841}
18842
18843impl std::default::Default for SpokeType {
18844 fn default() -> Self {
18845 use std::convert::From;
18846 Self::from(0)
18847 }
18848}
18849
18850impl std::fmt::Display for SpokeType {
18851 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18852 wkt::internal::display_enum(f, self.name(), self.value())
18853 }
18854}
18855
18856impl std::convert::From<i32> for SpokeType {
18857 fn from(value: i32) -> Self {
18858 match value {
18859 0 => Self::Unspecified,
18860 1 => Self::VpnTunnel,
18861 2 => Self::InterconnectAttachment,
18862 3 => Self::RouterAppliance,
18863 4 => Self::VpcNetwork,
18864 7 => Self::ProducerVpcNetwork,
18865 _ => Self::UnknownValue(spoke_type::UnknownValue(
18866 wkt::internal::UnknownEnumValue::Integer(value),
18867 )),
18868 }
18869 }
18870}
18871
18872impl std::convert::From<&str> for SpokeType {
18873 fn from(value: &str) -> Self {
18874 use std::string::ToString;
18875 match value {
18876 "SPOKE_TYPE_UNSPECIFIED" => Self::Unspecified,
18877 "VPN_TUNNEL" => Self::VpnTunnel,
18878 "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
18879 "ROUTER_APPLIANCE" => Self::RouterAppliance,
18880 "VPC_NETWORK" => Self::VpcNetwork,
18881 "PRODUCER_VPC_NETWORK" => Self::ProducerVpcNetwork,
18882 _ => Self::UnknownValue(spoke_type::UnknownValue(
18883 wkt::internal::UnknownEnumValue::String(value.to_string()),
18884 )),
18885 }
18886 }
18887}
18888
18889impl serde::ser::Serialize for SpokeType {
18890 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18891 where
18892 S: serde::Serializer,
18893 {
18894 match self {
18895 Self::Unspecified => serializer.serialize_i32(0),
18896 Self::VpnTunnel => serializer.serialize_i32(1),
18897 Self::InterconnectAttachment => serializer.serialize_i32(2),
18898 Self::RouterAppliance => serializer.serialize_i32(3),
18899 Self::VpcNetwork => serializer.serialize_i32(4),
18900 Self::ProducerVpcNetwork => serializer.serialize_i32(7),
18901 Self::UnknownValue(u) => u.0.serialize(serializer),
18902 }
18903 }
18904}
18905
18906impl<'de> serde::de::Deserialize<'de> for SpokeType {
18907 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18908 where
18909 D: serde::Deserializer<'de>,
18910 {
18911 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeType>::new(
18912 ".google.cloud.networkconnectivity.v1.SpokeType",
18913 ))
18914 }
18915}
18916
18917/// This enum controls the policy mode used in a hub.
18918///
18919/// # Working with unknown values
18920///
18921/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18922/// additional enum variants at any time. Adding new variants is not considered
18923/// a breaking change. Applications should write their code in anticipation of:
18924///
18925/// - New values appearing in future releases of the client library, **and**
18926/// - New values received dynamically, without application changes.
18927///
18928/// Please consult the [Working with enums] section in the user guide for some
18929/// guidelines.
18930///
18931/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18932#[derive(Clone, Debug, PartialEq)]
18933#[non_exhaustive]
18934pub enum PolicyMode {
18935 /// Policy mode is unspecified. It defaults to PRESET
18936 /// with preset_topology = MESH.
18937 Unspecified,
18938 /// Hub uses one of the preset topologies.
18939 Preset,
18940 /// If set, the enum was initialized with an unknown value.
18941 ///
18942 /// Applications can examine the value using [PolicyMode::value] or
18943 /// [PolicyMode::name].
18944 UnknownValue(policy_mode::UnknownValue),
18945}
18946
18947#[doc(hidden)]
18948pub mod policy_mode {
18949 #[allow(unused_imports)]
18950 use super::*;
18951 #[derive(Clone, Debug, PartialEq)]
18952 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18953}
18954
18955impl PolicyMode {
18956 /// Gets the enum value.
18957 ///
18958 /// Returns `None` if the enum contains an unknown value deserialized from
18959 /// the string representation of enums.
18960 pub fn value(&self) -> std::option::Option<i32> {
18961 match self {
18962 Self::Unspecified => std::option::Option::Some(0),
18963 Self::Preset => std::option::Option::Some(1),
18964 Self::UnknownValue(u) => u.0.value(),
18965 }
18966 }
18967
18968 /// Gets the enum value as a string.
18969 ///
18970 /// Returns `None` if the enum contains an unknown value deserialized from
18971 /// the integer representation of enums.
18972 pub fn name(&self) -> std::option::Option<&str> {
18973 match self {
18974 Self::Unspecified => std::option::Option::Some("POLICY_MODE_UNSPECIFIED"),
18975 Self::Preset => std::option::Option::Some("PRESET"),
18976 Self::UnknownValue(u) => u.0.name(),
18977 }
18978 }
18979}
18980
18981impl std::default::Default for PolicyMode {
18982 fn default() -> Self {
18983 use std::convert::From;
18984 Self::from(0)
18985 }
18986}
18987
18988impl std::fmt::Display for PolicyMode {
18989 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18990 wkt::internal::display_enum(f, self.name(), self.value())
18991 }
18992}
18993
18994impl std::convert::From<i32> for PolicyMode {
18995 fn from(value: i32) -> Self {
18996 match value {
18997 0 => Self::Unspecified,
18998 1 => Self::Preset,
18999 _ => Self::UnknownValue(policy_mode::UnknownValue(
19000 wkt::internal::UnknownEnumValue::Integer(value),
19001 )),
19002 }
19003 }
19004}
19005
19006impl std::convert::From<&str> for PolicyMode {
19007 fn from(value: &str) -> Self {
19008 use std::string::ToString;
19009 match value {
19010 "POLICY_MODE_UNSPECIFIED" => Self::Unspecified,
19011 "PRESET" => Self::Preset,
19012 _ => Self::UnknownValue(policy_mode::UnknownValue(
19013 wkt::internal::UnknownEnumValue::String(value.to_string()),
19014 )),
19015 }
19016 }
19017}
19018
19019impl serde::ser::Serialize for PolicyMode {
19020 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19021 where
19022 S: serde::Serializer,
19023 {
19024 match self {
19025 Self::Unspecified => serializer.serialize_i32(0),
19026 Self::Preset => serializer.serialize_i32(1),
19027 Self::UnknownValue(u) => u.0.serialize(serializer),
19028 }
19029 }
19030}
19031
19032impl<'de> serde::de::Deserialize<'de> for PolicyMode {
19033 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19034 where
19035 D: serde::Deserializer<'de>,
19036 {
19037 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyMode>::new(
19038 ".google.cloud.networkconnectivity.v1.PolicyMode",
19039 ))
19040 }
19041}
19042
19043/// The list of available preset topologies.
19044///
19045/// # Working with unknown values
19046///
19047/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19048/// additional enum variants at any time. Adding new variants is not considered
19049/// a breaking change. Applications should write their code in anticipation of:
19050///
19051/// - New values appearing in future releases of the client library, **and**
19052/// - New values received dynamically, without application changes.
19053///
19054/// Please consult the [Working with enums] section in the user guide for some
19055/// guidelines.
19056///
19057/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19058#[derive(Clone, Debug, PartialEq)]
19059#[non_exhaustive]
19060pub enum PresetTopology {
19061 /// Preset topology is unspecified. When policy_mode = PRESET,
19062 /// it defaults to MESH.
19063 Unspecified,
19064 /// Mesh topology is implemented. Group `default` is automatically created.
19065 /// All spokes in the hub are added to group `default`.
19066 Mesh,
19067 /// Star topology is implemented. Two groups, `center` and `edge`, are
19068 /// automatically created along with hub creation. Spokes have to join one of
19069 /// the groups during creation.
19070 Star,
19071 /// If set, the enum was initialized with an unknown value.
19072 ///
19073 /// Applications can examine the value using [PresetTopology::value] or
19074 /// [PresetTopology::name].
19075 UnknownValue(preset_topology::UnknownValue),
19076}
19077
19078#[doc(hidden)]
19079pub mod preset_topology {
19080 #[allow(unused_imports)]
19081 use super::*;
19082 #[derive(Clone, Debug, PartialEq)]
19083 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19084}
19085
19086impl PresetTopology {
19087 /// Gets the enum value.
19088 ///
19089 /// Returns `None` if the enum contains an unknown value deserialized from
19090 /// the string representation of enums.
19091 pub fn value(&self) -> std::option::Option<i32> {
19092 match self {
19093 Self::Unspecified => std::option::Option::Some(0),
19094 Self::Mesh => std::option::Option::Some(2),
19095 Self::Star => std::option::Option::Some(3),
19096 Self::UnknownValue(u) => u.0.value(),
19097 }
19098 }
19099
19100 /// Gets the enum value as a string.
19101 ///
19102 /// Returns `None` if the enum contains an unknown value deserialized from
19103 /// the integer representation of enums.
19104 pub fn name(&self) -> std::option::Option<&str> {
19105 match self {
19106 Self::Unspecified => std::option::Option::Some("PRESET_TOPOLOGY_UNSPECIFIED"),
19107 Self::Mesh => std::option::Option::Some("MESH"),
19108 Self::Star => std::option::Option::Some("STAR"),
19109 Self::UnknownValue(u) => u.0.name(),
19110 }
19111 }
19112}
19113
19114impl std::default::Default for PresetTopology {
19115 fn default() -> Self {
19116 use std::convert::From;
19117 Self::from(0)
19118 }
19119}
19120
19121impl std::fmt::Display for PresetTopology {
19122 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19123 wkt::internal::display_enum(f, self.name(), self.value())
19124 }
19125}
19126
19127impl std::convert::From<i32> for PresetTopology {
19128 fn from(value: i32) -> Self {
19129 match value {
19130 0 => Self::Unspecified,
19131 2 => Self::Mesh,
19132 3 => Self::Star,
19133 _ => Self::UnknownValue(preset_topology::UnknownValue(
19134 wkt::internal::UnknownEnumValue::Integer(value),
19135 )),
19136 }
19137 }
19138}
19139
19140impl std::convert::From<&str> for PresetTopology {
19141 fn from(value: &str) -> Self {
19142 use std::string::ToString;
19143 match value {
19144 "PRESET_TOPOLOGY_UNSPECIFIED" => Self::Unspecified,
19145 "MESH" => Self::Mesh,
19146 "STAR" => Self::Star,
19147 _ => Self::UnknownValue(preset_topology::UnknownValue(
19148 wkt::internal::UnknownEnumValue::String(value.to_string()),
19149 )),
19150 }
19151 }
19152}
19153
19154impl serde::ser::Serialize for PresetTopology {
19155 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19156 where
19157 S: serde::Serializer,
19158 {
19159 match self {
19160 Self::Unspecified => serializer.serialize_i32(0),
19161 Self::Mesh => serializer.serialize_i32(2),
19162 Self::Star => serializer.serialize_i32(3),
19163 Self::UnknownValue(u) => u.0.serialize(serializer),
19164 }
19165 }
19166}
19167
19168impl<'de> serde::de::Deserialize<'de> for PresetTopology {
19169 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19170 where
19171 D: serde::Deserializer<'de>,
19172 {
19173 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PresetTopology>::new(
19174 ".google.cloud.networkconnectivity.v1.PresetTopology",
19175 ))
19176 }
19177}