google_cloud_networkconnectivity_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_rpc;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// Represents the metadata of the long-running operation.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct OperationMetadata {
44 /// Output only. The time the operation was created.
45 pub create_time: std::option::Option<wkt::Timestamp>,
46
47 /// Output only. The time the operation finished running.
48 pub end_time: std::option::Option<wkt::Timestamp>,
49
50 /// Output only. Server-defined resource path for the target of the operation.
51 pub target: std::string::String,
52
53 /// Output only. Name of the verb executed by the operation.
54 pub verb: std::string::String,
55
56 /// Output only. Human-readable status of the operation, if any.
57 pub status_message: std::string::String,
58
59 /// Output only. Identifies whether the user has requested cancellation
60 /// of the operation. Operations that have been cancelled successfully
61 /// have
62 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
63 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
64 /// corresponding to `Code.CANCELLED`.
65 ///
66 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
67 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
68 pub requested_cancellation: bool,
69
70 /// Output only. API version used to start the operation.
71 pub api_version: std::string::String,
72
73 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
74}
75
76impl OperationMetadata {
77 /// Creates a new default instance.
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 /// Creates a new default instance.
276 pub fn new() -> Self {
277 std::default::Default::default()
278 }
279
280 /// Sets the value of [name][crate::model::ServiceConnectionMap::name].
281 ///
282 /// # Example
283 /// ```ignore,no_run
284 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
285 /// # let project_id = "project_id";
286 /// # let location_id = "location_id";
287 /// # let service_connection_map_id = "service_connection_map_id";
288 /// let x = ServiceConnectionMap::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionMaps/{service_connection_map_id}"));
289 /// ```
290 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
291 self.name = v.into();
292 self
293 }
294
295 /// Sets the value of [create_time][crate::model::ServiceConnectionMap::create_time].
296 ///
297 /// # Example
298 /// ```ignore,no_run
299 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
300 /// use wkt::Timestamp;
301 /// let x = ServiceConnectionMap::new().set_create_time(Timestamp::default()/* use setters */);
302 /// ```
303 pub fn set_create_time<T>(mut self, v: T) -> Self
304 where
305 T: std::convert::Into<wkt::Timestamp>,
306 {
307 self.create_time = std::option::Option::Some(v.into());
308 self
309 }
310
311 /// Sets or clears the value of [create_time][crate::model::ServiceConnectionMap::create_time].
312 ///
313 /// # Example
314 /// ```ignore,no_run
315 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
316 /// use wkt::Timestamp;
317 /// let x = ServiceConnectionMap::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
318 /// let x = ServiceConnectionMap::new().set_or_clear_create_time(None::<Timestamp>);
319 /// ```
320 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
321 where
322 T: std::convert::Into<wkt::Timestamp>,
323 {
324 self.create_time = v.map(|x| x.into());
325 self
326 }
327
328 /// Sets the value of [update_time][crate::model::ServiceConnectionMap::update_time].
329 ///
330 /// # Example
331 /// ```ignore,no_run
332 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
333 /// use wkt::Timestamp;
334 /// let x = ServiceConnectionMap::new().set_update_time(Timestamp::default()/* use setters */);
335 /// ```
336 pub fn set_update_time<T>(mut self, v: T) -> Self
337 where
338 T: std::convert::Into<wkt::Timestamp>,
339 {
340 self.update_time = std::option::Option::Some(v.into());
341 self
342 }
343
344 /// Sets or clears the value of [update_time][crate::model::ServiceConnectionMap::update_time].
345 ///
346 /// # Example
347 /// ```ignore,no_run
348 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
349 /// use wkt::Timestamp;
350 /// let x = ServiceConnectionMap::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
351 /// let x = ServiceConnectionMap::new().set_or_clear_update_time(None::<Timestamp>);
352 /// ```
353 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
354 where
355 T: std::convert::Into<wkt::Timestamp>,
356 {
357 self.update_time = v.map(|x| x.into());
358 self
359 }
360
361 /// Sets the value of [labels][crate::model::ServiceConnectionMap::labels].
362 ///
363 /// # Example
364 /// ```ignore,no_run
365 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
366 /// let x = ServiceConnectionMap::new().set_labels([
367 /// ("key0", "abc"),
368 /// ("key1", "xyz"),
369 /// ]);
370 /// ```
371 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
372 where
373 T: std::iter::IntoIterator<Item = (K, V)>,
374 K: std::convert::Into<std::string::String>,
375 V: std::convert::Into<std::string::String>,
376 {
377 use std::iter::Iterator;
378 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
379 self
380 }
381
382 /// Sets the value of [description][crate::model::ServiceConnectionMap::description].
383 ///
384 /// # Example
385 /// ```ignore,no_run
386 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
387 /// let x = ServiceConnectionMap::new().set_description("example");
388 /// ```
389 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
390 self.description = v.into();
391 self
392 }
393
394 /// Sets the value of [service_class][crate::model::ServiceConnectionMap::service_class].
395 ///
396 /// # Example
397 /// ```ignore,no_run
398 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
399 /// let x = ServiceConnectionMap::new().set_service_class("example");
400 /// ```
401 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
402 self.service_class = v.into();
403 self
404 }
405
406 /// Sets the value of [service_class_uri][crate::model::ServiceConnectionMap::service_class_uri].
407 ///
408 /// # Example
409 /// ```ignore,no_run
410 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
411 /// let x = ServiceConnectionMap::new().set_service_class_uri("example");
412 /// ```
413 pub fn set_service_class_uri<T: std::convert::Into<std::string::String>>(
414 mut self,
415 v: T,
416 ) -> Self {
417 self.service_class_uri = v.into();
418 self
419 }
420
421 /// Sets the value of [infrastructure][crate::model::ServiceConnectionMap::infrastructure].
422 ///
423 /// # Example
424 /// ```ignore,no_run
425 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
426 /// use google_cloud_networkconnectivity_v1::model::Infrastructure;
427 /// let x0 = ServiceConnectionMap::new().set_infrastructure(Infrastructure::Psc);
428 /// ```
429 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
430 mut self,
431 v: T,
432 ) -> Self {
433 self.infrastructure = v.into();
434 self
435 }
436
437 /// Sets the value of [producer_psc_configs][crate::model::ServiceConnectionMap::producer_psc_configs].
438 ///
439 /// # Example
440 /// ```ignore,no_run
441 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
442 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ProducerPscConfig;
443 /// let x = ServiceConnectionMap::new()
444 /// .set_producer_psc_configs([
445 /// ProducerPscConfig::default()/* use setters */,
446 /// ProducerPscConfig::default()/* use (different) setters */,
447 /// ]);
448 /// ```
449 pub fn set_producer_psc_configs<T, V>(mut self, v: T) -> Self
450 where
451 T: std::iter::IntoIterator<Item = V>,
452 V: std::convert::Into<crate::model::service_connection_map::ProducerPscConfig>,
453 {
454 use std::iter::Iterator;
455 self.producer_psc_configs = v.into_iter().map(|i| i.into()).collect();
456 self
457 }
458
459 /// Sets the value of [consumer_psc_configs][crate::model::ServiceConnectionMap::consumer_psc_configs].
460 ///
461 /// # Example
462 /// ```ignore,no_run
463 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
464 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
465 /// let x = ServiceConnectionMap::new()
466 /// .set_consumer_psc_configs([
467 /// ConsumerPscConfig::default()/* use setters */,
468 /// ConsumerPscConfig::default()/* use (different) setters */,
469 /// ]);
470 /// ```
471 pub fn set_consumer_psc_configs<T, V>(mut self, v: T) -> Self
472 where
473 T: std::iter::IntoIterator<Item = V>,
474 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConfig>,
475 {
476 use std::iter::Iterator;
477 self.consumer_psc_configs = v.into_iter().map(|i| i.into()).collect();
478 self
479 }
480
481 /// Sets the value of [consumer_psc_connections][crate::model::ServiceConnectionMap::consumer_psc_connections].
482 ///
483 /// # Example
484 /// ```ignore,no_run
485 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
486 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
487 /// let x = ServiceConnectionMap::new()
488 /// .set_consumer_psc_connections([
489 /// ConsumerPscConnection::default()/* use setters */,
490 /// ConsumerPscConnection::default()/* use (different) setters */,
491 /// ]);
492 /// ```
493 pub fn set_consumer_psc_connections<T, V>(mut self, v: T) -> Self
494 where
495 T: std::iter::IntoIterator<Item = V>,
496 V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConnection>,
497 {
498 use std::iter::Iterator;
499 self.consumer_psc_connections = v.into_iter().map(|i| i.into()).collect();
500 self
501 }
502
503 /// Sets the value of [token][crate::model::ServiceConnectionMap::token].
504 ///
505 /// # Example
506 /// ```ignore,no_run
507 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
508 /// let x = ServiceConnectionMap::new().set_token("example");
509 /// ```
510 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
511 self.token = v.into();
512 self
513 }
514
515 /// Sets the value of [etag][crate::model::ServiceConnectionMap::etag].
516 ///
517 /// # Example
518 /// ```ignore,no_run
519 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
520 /// let x = ServiceConnectionMap::new().set_etag("example");
521 /// ```
522 pub fn set_etag<T>(mut self, v: T) -> Self
523 where
524 T: std::convert::Into<std::string::String>,
525 {
526 self.etag = std::option::Option::Some(v.into());
527 self
528 }
529
530 /// Sets or clears the value of [etag][crate::model::ServiceConnectionMap::etag].
531 ///
532 /// # Example
533 /// ```ignore,no_run
534 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
535 /// let x = ServiceConnectionMap::new().set_or_clear_etag(Some("example"));
536 /// let x = ServiceConnectionMap::new().set_or_clear_etag(None::<String>);
537 /// ```
538 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
539 where
540 T: std::convert::Into<std::string::String>,
541 {
542 self.etag = v.map(|x| x.into());
543 self
544 }
545}
546
547impl wkt::message::Message for ServiceConnectionMap {
548 fn typename() -> &'static str {
549 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap"
550 }
551}
552
553/// Defines additional types related to [ServiceConnectionMap].
554pub mod service_connection_map {
555 #[allow(unused_imports)]
556 use super::*;
557
558 /// The PSC configurations on producer side.
559 #[derive(Clone, Default, PartialEq)]
560 #[non_exhaustive]
561 pub struct ProducerPscConfig {
562 /// The resource path of a service attachment.
563 /// Example:
564 /// projects/{projectNumOrId}/regions/{region}/serviceAttachments/{resourceId}.
565 pub service_attachment_uri: std::string::String,
566
567 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
568 }
569
570 impl ProducerPscConfig {
571 /// Creates a new default instance.
572 pub fn new() -> Self {
573 std::default::Default::default()
574 }
575
576 /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ProducerPscConfig::service_attachment_uri].
577 ///
578 /// # Example
579 /// ```ignore,no_run
580 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ProducerPscConfig;
581 /// let x = ProducerPscConfig::new().set_service_attachment_uri("example");
582 /// ```
583 pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
584 mut self,
585 v: T,
586 ) -> Self {
587 self.service_attachment_uri = v.into();
588 self
589 }
590 }
591
592 impl wkt::message::Message for ProducerPscConfig {
593 fn typename() -> &'static str {
594 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ProducerPscConfig"
595 }
596 }
597
598 /// Allow the producer to specify which consumers can connect to it.
599 #[derive(Clone, Default, PartialEq)]
600 #[non_exhaustive]
601 pub struct ConsumerPscConfig {
602 /// The consumer project where PSC connections are allowed to be created in.
603 pub project: std::string::String,
604
605 /// The resource path of the consumer network where PSC connections are
606 /// allowed to be created in. Note, this network does not need be in the
607 /// ConsumerPscConfig.project in the case of SharedVPC.
608 /// Example:
609 /// projects/{projectNumOrId}/global/networks/{networkId}.
610 pub network: std::string::String,
611
612 /// This is used in PSC consumer ForwardingRule to control whether the PSC
613 /// endpoint can be accessed from another region.
614 pub disable_global_access: bool,
615
616 /// Output only. Overall state of PSC Connections management for this
617 /// consumer psc config.
618 pub state: crate::model::service_connection_map::consumer_psc_config::State,
619
620 /// Immutable. Deprecated. Use producer_instance_metadata instead.
621 /// An immutable identifier for the producer instance.
622 #[deprecated]
623 pub producer_instance_id: std::string::String,
624
625 /// Output only. A map to store mapping between customer vip and target
626 /// service attachment. Only service attachment with producer specified ip
627 /// addresses are stored here.
628 pub service_attachment_ip_address_map:
629 std::collections::HashMap<std::string::String, std::string::String>,
630
631 /// Required. The project ID or project number of the consumer project. This
632 /// project is the one that the consumer uses to interact with the producer
633 /// instance. From the perspective of a consumer who's created a producer
634 /// instance, this is the project of the producer instance. Format:
635 /// 'projects/<project_id_or_number>' Eg. 'projects/consumer-project' or
636 /// 'projects/1234'
637 pub consumer_instance_project: std::string::String,
638
639 /// Immutable. An immutable map for the producer instance metadata.
640 pub producer_instance_metadata:
641 std::collections::HashMap<std::string::String, std::string::String>,
642
643 /// The requested IP version for the PSC connection.
644 pub ip_version: std::option::Option<crate::model::IPVersion>,
645
646 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
647 }
648
649 impl ConsumerPscConfig {
650 /// Creates a new default instance.
651 pub fn new() -> Self {
652 std::default::Default::default()
653 }
654
655 /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConfig::project].
656 ///
657 /// # Example
658 /// ```ignore,no_run
659 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
660 /// let x = ConsumerPscConfig::new().set_project("example");
661 /// ```
662 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
663 self.project = v.into();
664 self
665 }
666
667 /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConfig::network].
668 ///
669 /// # Example
670 /// ```ignore,no_run
671 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
672 /// let x = ConsumerPscConfig::new().set_network("example");
673 /// ```
674 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
675 self.network = v.into();
676 self
677 }
678
679 /// Sets the value of [disable_global_access][crate::model::service_connection_map::ConsumerPscConfig::disable_global_access].
680 ///
681 /// # Example
682 /// ```ignore,no_run
683 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
684 /// let x = ConsumerPscConfig::new().set_disable_global_access(true);
685 /// ```
686 pub fn set_disable_global_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
687 self.disable_global_access = v.into();
688 self
689 }
690
691 /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConfig::state].
692 ///
693 /// # Example
694 /// ```ignore,no_run
695 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
696 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::consumer_psc_config::State;
697 /// let x0 = ConsumerPscConfig::new().set_state(State::Valid);
698 /// let x1 = ConsumerPscConfig::new().set_state(State::ConnectionPolicyMissing);
699 /// let x2 = ConsumerPscConfig::new().set_state(State::PolicyLimitReached);
700 /// ```
701 pub fn set_state<
702 T: std::convert::Into<crate::model::service_connection_map::consumer_psc_config::State>,
703 >(
704 mut self,
705 v: T,
706 ) -> Self {
707 self.state = v.into();
708 self
709 }
710
711 /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_id].
712 ///
713 /// # Example
714 /// ```ignore,no_run
715 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
716 /// let x = ConsumerPscConfig::new().set_producer_instance_id("example");
717 /// ```
718 #[deprecated]
719 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
720 mut self,
721 v: T,
722 ) -> Self {
723 self.producer_instance_id = v.into();
724 self
725 }
726
727 /// Sets the value of [service_attachment_ip_address_map][crate::model::service_connection_map::ConsumerPscConfig::service_attachment_ip_address_map].
728 ///
729 /// # Example
730 /// ```ignore,no_run
731 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
732 /// let x = ConsumerPscConfig::new().set_service_attachment_ip_address_map([
733 /// ("key0", "abc"),
734 /// ("key1", "xyz"),
735 /// ]);
736 /// ```
737 pub fn set_service_attachment_ip_address_map<T, K, V>(mut self, v: T) -> Self
738 where
739 T: std::iter::IntoIterator<Item = (K, V)>,
740 K: std::convert::Into<std::string::String>,
741 V: std::convert::Into<std::string::String>,
742 {
743 use std::iter::Iterator;
744 self.service_attachment_ip_address_map =
745 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
746 self
747 }
748
749 /// Sets the value of [consumer_instance_project][crate::model::service_connection_map::ConsumerPscConfig::consumer_instance_project].
750 ///
751 /// # Example
752 /// ```ignore,no_run
753 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
754 /// let x = ConsumerPscConfig::new().set_consumer_instance_project("example");
755 /// ```
756 pub fn set_consumer_instance_project<T: std::convert::Into<std::string::String>>(
757 mut self,
758 v: T,
759 ) -> Self {
760 self.consumer_instance_project = v.into();
761 self
762 }
763
764 /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_metadata].
765 ///
766 /// # Example
767 /// ```ignore,no_run
768 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
769 /// let x = ConsumerPscConfig::new().set_producer_instance_metadata([
770 /// ("key0", "abc"),
771 /// ("key1", "xyz"),
772 /// ]);
773 /// ```
774 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
775 where
776 T: std::iter::IntoIterator<Item = (K, V)>,
777 K: std::convert::Into<std::string::String>,
778 V: std::convert::Into<std::string::String>,
779 {
780 use std::iter::Iterator;
781 self.producer_instance_metadata =
782 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
783 self
784 }
785
786 /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
787 ///
788 /// # Example
789 /// ```ignore,no_run
790 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
791 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
792 /// let x0 = ConsumerPscConfig::new().set_ip_version(IPVersion::Ipv4);
793 /// let x1 = ConsumerPscConfig::new().set_ip_version(IPVersion::Ipv6);
794 /// ```
795 pub fn set_ip_version<T>(mut self, v: T) -> Self
796 where
797 T: std::convert::Into<crate::model::IPVersion>,
798 {
799 self.ip_version = std::option::Option::Some(v.into());
800 self
801 }
802
803 /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
804 ///
805 /// # Example
806 /// ```ignore,no_run
807 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConfig;
808 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
809 /// let x0 = ConsumerPscConfig::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
810 /// let x1 = ConsumerPscConfig::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
811 /// let x_none = ConsumerPscConfig::new().set_or_clear_ip_version(None::<IPVersion>);
812 /// ```
813 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
814 where
815 T: std::convert::Into<crate::model::IPVersion>,
816 {
817 self.ip_version = v.map(|x| x.into());
818 self
819 }
820 }
821
822 impl wkt::message::Message for ConsumerPscConfig {
823 fn typename() -> &'static str {
824 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig"
825 }
826 }
827
828 /// Defines additional types related to [ConsumerPscConfig].
829 pub mod consumer_psc_config {
830 #[allow(unused_imports)]
831 use super::*;
832
833 /// PSC Consumer Config State.
834 ///
835 /// # Working with unknown values
836 ///
837 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
838 /// additional enum variants at any time. Adding new variants is not considered
839 /// a breaking change. Applications should write their code in anticipation of:
840 ///
841 /// - New values appearing in future releases of the client library, **and**
842 /// - New values received dynamically, without application changes.
843 ///
844 /// Please consult the [Working with enums] section in the user guide for some
845 /// guidelines.
846 ///
847 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
848 #[derive(Clone, Debug, PartialEq)]
849 #[non_exhaustive]
850 pub enum State {
851 /// Default state, when Connection Map is created initially.
852 Unspecified,
853 /// Set when policy and map configuration is valid,
854 /// and their matching can lead to allowing creation of PSC Connections
855 /// subject to other constraints like connections limit.
856 Valid,
857 /// No Service Connection Policy found for this network and Service
858 /// Class
859 ConnectionPolicyMissing,
860 /// Service Connection Policy limit reached for this network and Service
861 /// Class
862 PolicyLimitReached,
863 /// The consumer instance project is not in
864 /// AllowedGoogleProducersResourceHierarchyLevels of the matching
865 /// ServiceConnectionPolicy.
866 ConsumerInstanceProjectNotAllowlisted,
867 /// If set, the enum was initialized with an unknown value.
868 ///
869 /// Applications can examine the value using [State::value] or
870 /// [State::name].
871 UnknownValue(state::UnknownValue),
872 }
873
874 #[doc(hidden)]
875 pub mod state {
876 #[allow(unused_imports)]
877 use super::*;
878 #[derive(Clone, Debug, PartialEq)]
879 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
880 }
881
882 impl State {
883 /// Gets the enum value.
884 ///
885 /// Returns `None` if the enum contains an unknown value deserialized from
886 /// the string representation of enums.
887 pub fn value(&self) -> std::option::Option<i32> {
888 match self {
889 Self::Unspecified => std::option::Option::Some(0),
890 Self::Valid => std::option::Option::Some(1),
891 Self::ConnectionPolicyMissing => std::option::Option::Some(2),
892 Self::PolicyLimitReached => std::option::Option::Some(3),
893 Self::ConsumerInstanceProjectNotAllowlisted => std::option::Option::Some(4),
894 Self::UnknownValue(u) => u.0.value(),
895 }
896 }
897
898 /// Gets the enum value as a string.
899 ///
900 /// Returns `None` if the enum contains an unknown value deserialized from
901 /// the integer representation of enums.
902 pub fn name(&self) -> std::option::Option<&str> {
903 match self {
904 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
905 Self::Valid => std::option::Option::Some("VALID"),
906 Self::ConnectionPolicyMissing => {
907 std::option::Option::Some("CONNECTION_POLICY_MISSING")
908 }
909 Self::PolicyLimitReached => std::option::Option::Some("POLICY_LIMIT_REACHED"),
910 Self::ConsumerInstanceProjectNotAllowlisted => {
911 std::option::Option::Some("CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED")
912 }
913 Self::UnknownValue(u) => u.0.name(),
914 }
915 }
916 }
917
918 impl std::default::Default for State {
919 fn default() -> Self {
920 use std::convert::From;
921 Self::from(0)
922 }
923 }
924
925 impl std::fmt::Display for State {
926 fn fmt(
927 &self,
928 f: &mut std::fmt::Formatter<'_>,
929 ) -> std::result::Result<(), std::fmt::Error> {
930 wkt::internal::display_enum(f, self.name(), self.value())
931 }
932 }
933
934 impl std::convert::From<i32> for State {
935 fn from(value: i32) -> Self {
936 match value {
937 0 => Self::Unspecified,
938 1 => Self::Valid,
939 2 => Self::ConnectionPolicyMissing,
940 3 => Self::PolicyLimitReached,
941 4 => Self::ConsumerInstanceProjectNotAllowlisted,
942 _ => Self::UnknownValue(state::UnknownValue(
943 wkt::internal::UnknownEnumValue::Integer(value),
944 )),
945 }
946 }
947 }
948
949 impl std::convert::From<&str> for State {
950 fn from(value: &str) -> Self {
951 use std::string::ToString;
952 match value {
953 "STATE_UNSPECIFIED" => Self::Unspecified,
954 "VALID" => Self::Valid,
955 "CONNECTION_POLICY_MISSING" => Self::ConnectionPolicyMissing,
956 "POLICY_LIMIT_REACHED" => Self::PolicyLimitReached,
957 "CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" => {
958 Self::ConsumerInstanceProjectNotAllowlisted
959 }
960 _ => Self::UnknownValue(state::UnknownValue(
961 wkt::internal::UnknownEnumValue::String(value.to_string()),
962 )),
963 }
964 }
965 }
966
967 impl serde::ser::Serialize for State {
968 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
969 where
970 S: serde::Serializer,
971 {
972 match self {
973 Self::Unspecified => serializer.serialize_i32(0),
974 Self::Valid => serializer.serialize_i32(1),
975 Self::ConnectionPolicyMissing => serializer.serialize_i32(2),
976 Self::PolicyLimitReached => serializer.serialize_i32(3),
977 Self::ConsumerInstanceProjectNotAllowlisted => serializer.serialize_i32(4),
978 Self::UnknownValue(u) => u.0.serialize(serializer),
979 }
980 }
981 }
982
983 impl<'de> serde::de::Deserialize<'de> for State {
984 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
985 where
986 D: serde::Deserializer<'de>,
987 {
988 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
989 ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig.State"))
990 }
991 }
992 }
993
994 /// PSC connection details on consumer side.
995 #[derive(Clone, Default, PartialEq)]
996 #[non_exhaustive]
997 pub struct ConsumerPscConnection {
998 /// The URI of a service attachment which is the target of the PSC
999 /// connection.
1000 pub service_attachment_uri: std::string::String,
1001
1002 /// The state of the PSC connection.
1003 pub state: crate::model::service_connection_map::consumer_psc_connection::State,
1004
1005 /// The consumer project whose PSC forwarding rule is connected to the
1006 /// service attachments in this service connection map.
1007 pub project: std::string::String,
1008
1009 /// The consumer network whose PSC forwarding rule is connected to the
1010 /// service attachments in this service connection map.
1011 /// Note that the network could be on a different project (shared VPC).
1012 pub network: std::string::String,
1013
1014 /// The PSC connection id of the PSC forwarding rule connected
1015 /// to the service attachments in this service connection map.
1016 pub psc_connection_id: std::string::String,
1017
1018 /// The IP literal allocated on the consumer network for the PSC forwarding
1019 /// rule that is created to connect to the producer service attachment in
1020 /// this service connection map.
1021 pub ip: std::string::String,
1022
1023 /// The error type indicates whether the error is consumer facing, producer
1024 /// facing or system internal.
1025 #[deprecated]
1026 pub error_type: crate::model::ConnectionErrorType,
1027
1028 /// The most recent error during operating this connection.
1029 #[deprecated]
1030 pub error: std::option::Option<google_cloud_rpc::model::Status>,
1031
1032 /// The last Compute Engine operation to setup PSC connection.
1033 pub gce_operation: std::string::String,
1034
1035 /// The URI of the consumer forwarding rule created.
1036 /// Example:
1037 /// projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.
1038 pub forwarding_rule: std::string::String,
1039
1040 /// Output only. The error info for the latest error during operating this
1041 /// connection.
1042 pub error_info: std::option::Option<google_cloud_rpc::model::ErrorInfo>,
1043
1044 /// Output only. The URI of the selected subnetwork selected to allocate IP
1045 /// address for this connection.
1046 pub selected_subnetwork: std::string::String,
1047
1048 /// Immutable. Deprecated. Use producer_instance_metadata instead.
1049 /// An immutable identifier for the producer instance.
1050 #[deprecated]
1051 pub producer_instance_id: std::string::String,
1052
1053 /// Immutable. An immutable map for the producer instance metadata.
1054 pub producer_instance_metadata:
1055 std::collections::HashMap<std::string::String, std::string::String>,
1056
1057 /// The requested IP version for the PSC connection.
1058 pub ip_version: std::option::Option<crate::model::IPVersion>,
1059
1060 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1061 }
1062
1063 impl ConsumerPscConnection {
1064 /// Creates a new default instance.
1065 pub fn new() -> Self {
1066 std::default::Default::default()
1067 }
1068
1069 /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ConsumerPscConnection::service_attachment_uri].
1070 ///
1071 /// # Example
1072 /// ```ignore,no_run
1073 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1074 /// let x = ConsumerPscConnection::new().set_service_attachment_uri("example");
1075 /// ```
1076 pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
1077 mut self,
1078 v: T,
1079 ) -> Self {
1080 self.service_attachment_uri = v.into();
1081 self
1082 }
1083
1084 /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConnection::state].
1085 ///
1086 /// # Example
1087 /// ```ignore,no_run
1088 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1089 /// use google_cloud_networkconnectivity_v1::model::service_connection_map::consumer_psc_connection::State;
1090 /// let x0 = ConsumerPscConnection::new().set_state(State::Active);
1091 /// let x1 = ConsumerPscConnection::new().set_state(State::Failed);
1092 /// let x2 = ConsumerPscConnection::new().set_state(State::Creating);
1093 /// ```
1094 pub fn set_state<
1095 T: std::convert::Into<
1096 crate::model::service_connection_map::consumer_psc_connection::State,
1097 >,
1098 >(
1099 mut self,
1100 v: T,
1101 ) -> Self {
1102 self.state = v.into();
1103 self
1104 }
1105
1106 /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConnection::project].
1107 ///
1108 /// # Example
1109 /// ```ignore,no_run
1110 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1111 /// let x = ConsumerPscConnection::new().set_project("example");
1112 /// ```
1113 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1114 self.project = v.into();
1115 self
1116 }
1117
1118 /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConnection::network].
1119 ///
1120 /// # Example
1121 /// ```ignore,no_run
1122 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1123 /// let x = ConsumerPscConnection::new().set_network("example");
1124 /// ```
1125 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1126 self.network = v.into();
1127 self
1128 }
1129
1130 /// Sets the value of [psc_connection_id][crate::model::service_connection_map::ConsumerPscConnection::psc_connection_id].
1131 ///
1132 /// # Example
1133 /// ```ignore,no_run
1134 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1135 /// let x = ConsumerPscConnection::new().set_psc_connection_id("example");
1136 /// ```
1137 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
1138 mut self,
1139 v: T,
1140 ) -> Self {
1141 self.psc_connection_id = v.into();
1142 self
1143 }
1144
1145 /// Sets the value of [ip][crate::model::service_connection_map::ConsumerPscConnection::ip].
1146 ///
1147 /// # Example
1148 /// ```ignore,no_run
1149 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1150 /// let x = ConsumerPscConnection::new().set_ip("example");
1151 /// ```
1152 pub fn set_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1153 self.ip = v.into();
1154 self
1155 }
1156
1157 /// Sets the value of [error_type][crate::model::service_connection_map::ConsumerPscConnection::error_type].
1158 ///
1159 /// # Example
1160 /// ```ignore,no_run
1161 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1162 /// use google_cloud_networkconnectivity_v1::model::ConnectionErrorType;
1163 /// let x0 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorInternal);
1164 /// let x1 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorConsumerSide);
1165 /// let x2 = ConsumerPscConnection::new().set_error_type(ConnectionErrorType::ErrorProducerSide);
1166 /// ```
1167 #[deprecated]
1168 pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
1169 mut self,
1170 v: T,
1171 ) -> Self {
1172 self.error_type = v.into();
1173 self
1174 }
1175
1176 /// Sets the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
1177 ///
1178 /// # Example
1179 /// ```ignore,no_run
1180 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1181 /// use google_cloud_rpc::model::Status;
1182 /// let x = ConsumerPscConnection::new().set_error(Status::default()/* use setters */);
1183 /// ```
1184 #[deprecated]
1185 pub fn set_error<T>(mut self, v: T) -> Self
1186 where
1187 T: std::convert::Into<google_cloud_rpc::model::Status>,
1188 {
1189 self.error = std::option::Option::Some(v.into());
1190 self
1191 }
1192
1193 /// Sets or clears the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
1194 ///
1195 /// # Example
1196 /// ```ignore,no_run
1197 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1198 /// use google_cloud_rpc::model::Status;
1199 /// let x = ConsumerPscConnection::new().set_or_clear_error(Some(Status::default()/* use setters */));
1200 /// let x = ConsumerPscConnection::new().set_or_clear_error(None::<Status>);
1201 /// ```
1202 #[deprecated]
1203 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1204 where
1205 T: std::convert::Into<google_cloud_rpc::model::Status>,
1206 {
1207 self.error = v.map(|x| x.into());
1208 self
1209 }
1210
1211 /// Sets the value of [gce_operation][crate::model::service_connection_map::ConsumerPscConnection::gce_operation].
1212 ///
1213 /// # Example
1214 /// ```ignore,no_run
1215 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1216 /// let x = ConsumerPscConnection::new().set_gce_operation("example");
1217 /// ```
1218 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
1219 mut self,
1220 v: T,
1221 ) -> Self {
1222 self.gce_operation = v.into();
1223 self
1224 }
1225
1226 /// Sets the value of [forwarding_rule][crate::model::service_connection_map::ConsumerPscConnection::forwarding_rule].
1227 ///
1228 /// # Example
1229 /// ```ignore,no_run
1230 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1231 /// let x = ConsumerPscConnection::new().set_forwarding_rule("example");
1232 /// ```
1233 pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(
1234 mut self,
1235 v: T,
1236 ) -> Self {
1237 self.forwarding_rule = v.into();
1238 self
1239 }
1240
1241 /// Sets the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
1242 ///
1243 /// # Example
1244 /// ```ignore,no_run
1245 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1246 /// use google_cloud_rpc::model::ErrorInfo;
1247 /// let x = ConsumerPscConnection::new().set_error_info(ErrorInfo::default()/* use setters */);
1248 /// ```
1249 pub fn set_error_info<T>(mut self, v: T) -> Self
1250 where
1251 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
1252 {
1253 self.error_info = std::option::Option::Some(v.into());
1254 self
1255 }
1256
1257 /// Sets or clears the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
1258 ///
1259 /// # Example
1260 /// ```ignore,no_run
1261 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1262 /// use google_cloud_rpc::model::ErrorInfo;
1263 /// let x = ConsumerPscConnection::new().set_or_clear_error_info(Some(ErrorInfo::default()/* use setters */));
1264 /// let x = ConsumerPscConnection::new().set_or_clear_error_info(None::<ErrorInfo>);
1265 /// ```
1266 pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
1267 where
1268 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
1269 {
1270 self.error_info = v.map(|x| x.into());
1271 self
1272 }
1273
1274 /// Sets the value of [selected_subnetwork][crate::model::service_connection_map::ConsumerPscConnection::selected_subnetwork].
1275 ///
1276 /// # Example
1277 /// ```ignore,no_run
1278 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1279 /// let x = ConsumerPscConnection::new().set_selected_subnetwork("example");
1280 /// ```
1281 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
1282 mut self,
1283 v: T,
1284 ) -> Self {
1285 self.selected_subnetwork = v.into();
1286 self
1287 }
1288
1289 /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_id].
1290 ///
1291 /// # Example
1292 /// ```ignore,no_run
1293 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1294 /// let x = ConsumerPscConnection::new().set_producer_instance_id("example");
1295 /// ```
1296 #[deprecated]
1297 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
1298 mut self,
1299 v: T,
1300 ) -> Self {
1301 self.producer_instance_id = v.into();
1302 self
1303 }
1304
1305 /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_metadata].
1306 ///
1307 /// # Example
1308 /// ```ignore,no_run
1309 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1310 /// let x = ConsumerPscConnection::new().set_producer_instance_metadata([
1311 /// ("key0", "abc"),
1312 /// ("key1", "xyz"),
1313 /// ]);
1314 /// ```
1315 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
1316 where
1317 T: std::iter::IntoIterator<Item = (K, V)>,
1318 K: std::convert::Into<std::string::String>,
1319 V: std::convert::Into<std::string::String>,
1320 {
1321 use std::iter::Iterator;
1322 self.producer_instance_metadata =
1323 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1324 self
1325 }
1326
1327 /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
1328 ///
1329 /// # Example
1330 /// ```ignore,no_run
1331 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1332 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
1333 /// let x0 = ConsumerPscConnection::new().set_ip_version(IPVersion::Ipv4);
1334 /// let x1 = ConsumerPscConnection::new().set_ip_version(IPVersion::Ipv6);
1335 /// ```
1336 pub fn set_ip_version<T>(mut self, v: T) -> Self
1337 where
1338 T: std::convert::Into<crate::model::IPVersion>,
1339 {
1340 self.ip_version = std::option::Option::Some(v.into());
1341 self
1342 }
1343
1344 /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
1345 ///
1346 /// # Example
1347 /// ```ignore,no_run
1348 /// # use google_cloud_networkconnectivity_v1::model::service_connection_map::ConsumerPscConnection;
1349 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
1350 /// let x0 = ConsumerPscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
1351 /// let x1 = ConsumerPscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
1352 /// let x_none = ConsumerPscConnection::new().set_or_clear_ip_version(None::<IPVersion>);
1353 /// ```
1354 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
1355 where
1356 T: std::convert::Into<crate::model::IPVersion>,
1357 {
1358 self.ip_version = v.map(|x| x.into());
1359 self
1360 }
1361 }
1362
1363 impl wkt::message::Message for ConsumerPscConnection {
1364 fn typename() -> &'static str {
1365 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection"
1366 }
1367 }
1368
1369 /// Defines additional types related to [ConsumerPscConnection].
1370 pub mod consumer_psc_connection {
1371 #[allow(unused_imports)]
1372 use super::*;
1373
1374 /// The state of the PSC connection.
1375 /// We reserve the right to add more states without notice in the future.
1376 /// Users should not use exhaustive switch statements on this enum.
1377 /// See <https://google.aip.dev/216>.
1378 ///
1379 /// # Working with unknown values
1380 ///
1381 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1382 /// additional enum variants at any time. Adding new variants is not considered
1383 /// a breaking change. Applications should write their code in anticipation of:
1384 ///
1385 /// - New values appearing in future releases of the client library, **and**
1386 /// - New values received dynamically, without application changes.
1387 ///
1388 /// Please consult the [Working with enums] section in the user guide for some
1389 /// guidelines.
1390 ///
1391 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1392 #[derive(Clone, Debug, PartialEq)]
1393 #[non_exhaustive]
1394 pub enum State {
1395 /// An invalid state as the default case.
1396 Unspecified,
1397 /// The connection has been created successfully. However, for the
1398 /// up-to-date connection status, please use the service attachment's
1399 /// "ConnectedEndpoint.status" as the source of truth.
1400 Active,
1401 /// The connection is not functional since some resources on the connection
1402 /// fail to be created.
1403 Failed,
1404 /// The connection is being created.
1405 Creating,
1406 /// The connection is being deleted.
1407 Deleting,
1408 /// The connection is being repaired to complete creation.
1409 CreateRepairing,
1410 /// The connection is being repaired to complete deletion.
1411 DeleteRepairing,
1412 /// If set, the enum was initialized with an unknown value.
1413 ///
1414 /// Applications can examine the value using [State::value] or
1415 /// [State::name].
1416 UnknownValue(state::UnknownValue),
1417 }
1418
1419 #[doc(hidden)]
1420 pub mod state {
1421 #[allow(unused_imports)]
1422 use super::*;
1423 #[derive(Clone, Debug, PartialEq)]
1424 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1425 }
1426
1427 impl State {
1428 /// Gets the enum value.
1429 ///
1430 /// Returns `None` if the enum contains an unknown value deserialized from
1431 /// the string representation of enums.
1432 pub fn value(&self) -> std::option::Option<i32> {
1433 match self {
1434 Self::Unspecified => std::option::Option::Some(0),
1435 Self::Active => std::option::Option::Some(1),
1436 Self::Failed => std::option::Option::Some(2),
1437 Self::Creating => std::option::Option::Some(3),
1438 Self::Deleting => std::option::Option::Some(4),
1439 Self::CreateRepairing => std::option::Option::Some(5),
1440 Self::DeleteRepairing => std::option::Option::Some(6),
1441 Self::UnknownValue(u) => u.0.value(),
1442 }
1443 }
1444
1445 /// Gets the enum value as a string.
1446 ///
1447 /// Returns `None` if the enum contains an unknown value deserialized from
1448 /// the integer representation of enums.
1449 pub fn name(&self) -> std::option::Option<&str> {
1450 match self {
1451 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1452 Self::Active => std::option::Option::Some("ACTIVE"),
1453 Self::Failed => std::option::Option::Some("FAILED"),
1454 Self::Creating => std::option::Option::Some("CREATING"),
1455 Self::Deleting => std::option::Option::Some("DELETING"),
1456 Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
1457 Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
1458 Self::UnknownValue(u) => u.0.name(),
1459 }
1460 }
1461 }
1462
1463 impl std::default::Default for State {
1464 fn default() -> Self {
1465 use std::convert::From;
1466 Self::from(0)
1467 }
1468 }
1469
1470 impl std::fmt::Display for State {
1471 fn fmt(
1472 &self,
1473 f: &mut std::fmt::Formatter<'_>,
1474 ) -> std::result::Result<(), std::fmt::Error> {
1475 wkt::internal::display_enum(f, self.name(), self.value())
1476 }
1477 }
1478
1479 impl std::convert::From<i32> for State {
1480 fn from(value: i32) -> Self {
1481 match value {
1482 0 => Self::Unspecified,
1483 1 => Self::Active,
1484 2 => Self::Failed,
1485 3 => Self::Creating,
1486 4 => Self::Deleting,
1487 5 => Self::CreateRepairing,
1488 6 => Self::DeleteRepairing,
1489 _ => Self::UnknownValue(state::UnknownValue(
1490 wkt::internal::UnknownEnumValue::Integer(value),
1491 )),
1492 }
1493 }
1494 }
1495
1496 impl std::convert::From<&str> for State {
1497 fn from(value: &str) -> Self {
1498 use std::string::ToString;
1499 match value {
1500 "STATE_UNSPECIFIED" => Self::Unspecified,
1501 "ACTIVE" => Self::Active,
1502 "FAILED" => Self::Failed,
1503 "CREATING" => Self::Creating,
1504 "DELETING" => Self::Deleting,
1505 "CREATE_REPAIRING" => Self::CreateRepairing,
1506 "DELETE_REPAIRING" => Self::DeleteRepairing,
1507 _ => Self::UnknownValue(state::UnknownValue(
1508 wkt::internal::UnknownEnumValue::String(value.to_string()),
1509 )),
1510 }
1511 }
1512 }
1513
1514 impl serde::ser::Serialize for State {
1515 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1516 where
1517 S: serde::Serializer,
1518 {
1519 match self {
1520 Self::Unspecified => serializer.serialize_i32(0),
1521 Self::Active => serializer.serialize_i32(1),
1522 Self::Failed => serializer.serialize_i32(2),
1523 Self::Creating => serializer.serialize_i32(3),
1524 Self::Deleting => serializer.serialize_i32(4),
1525 Self::CreateRepairing => serializer.serialize_i32(5),
1526 Self::DeleteRepairing => serializer.serialize_i32(6),
1527 Self::UnknownValue(u) => u.0.serialize(serializer),
1528 }
1529 }
1530 }
1531
1532 impl<'de> serde::de::Deserialize<'de> for State {
1533 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1534 where
1535 D: serde::Deserializer<'de>,
1536 {
1537 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1538 ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection.State"))
1539 }
1540 }
1541 }
1542}
1543
1544/// Request for ListServiceConnectionMaps.
1545#[derive(Clone, Default, PartialEq)]
1546#[non_exhaustive]
1547pub struct ListServiceConnectionMapsRequest {
1548 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
1549 pub parent: std::string::String,
1550
1551 /// The maximum number of results per page that should be returned.
1552 pub page_size: i32,
1553
1554 /// The page token.
1555 pub page_token: std::string::String,
1556
1557 /// A filter expression that filters the results listed in the response.
1558 pub filter: std::string::String,
1559
1560 /// Sort the results by a certain order.
1561 pub order_by: std::string::String,
1562
1563 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1564}
1565
1566impl ListServiceConnectionMapsRequest {
1567 /// Creates a new default instance.
1568 pub fn new() -> Self {
1569 std::default::Default::default()
1570 }
1571
1572 /// Sets the value of [parent][crate::model::ListServiceConnectionMapsRequest::parent].
1573 ///
1574 /// # Example
1575 /// ```ignore,no_run
1576 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1577 /// let x = ListServiceConnectionMapsRequest::new().set_parent("example");
1578 /// ```
1579 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1580 self.parent = v.into();
1581 self
1582 }
1583
1584 /// Sets the value of [page_size][crate::model::ListServiceConnectionMapsRequest::page_size].
1585 ///
1586 /// # Example
1587 /// ```ignore,no_run
1588 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1589 /// let x = ListServiceConnectionMapsRequest::new().set_page_size(42);
1590 /// ```
1591 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1592 self.page_size = v.into();
1593 self
1594 }
1595
1596 /// Sets the value of [page_token][crate::model::ListServiceConnectionMapsRequest::page_token].
1597 ///
1598 /// # Example
1599 /// ```ignore,no_run
1600 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1601 /// let x = ListServiceConnectionMapsRequest::new().set_page_token("example");
1602 /// ```
1603 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1604 self.page_token = v.into();
1605 self
1606 }
1607
1608 /// Sets the value of [filter][crate::model::ListServiceConnectionMapsRequest::filter].
1609 ///
1610 /// # Example
1611 /// ```ignore,no_run
1612 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1613 /// let x = ListServiceConnectionMapsRequest::new().set_filter("example");
1614 /// ```
1615 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1616 self.filter = v.into();
1617 self
1618 }
1619
1620 /// Sets the value of [order_by][crate::model::ListServiceConnectionMapsRequest::order_by].
1621 ///
1622 /// # Example
1623 /// ```ignore,no_run
1624 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsRequest;
1625 /// let x = ListServiceConnectionMapsRequest::new().set_order_by("example");
1626 /// ```
1627 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1628 self.order_by = v.into();
1629 self
1630 }
1631}
1632
1633impl wkt::message::Message for ListServiceConnectionMapsRequest {
1634 fn typename() -> &'static str {
1635 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsRequest"
1636 }
1637}
1638
1639/// Response for ListServiceConnectionMaps.
1640#[derive(Clone, Default, PartialEq)]
1641#[non_exhaustive]
1642pub struct ListServiceConnectionMapsResponse {
1643 /// ServiceConnectionMaps to be returned.
1644 pub service_connection_maps: std::vec::Vec<crate::model::ServiceConnectionMap>,
1645
1646 /// The next pagination token in the List response. It should be used as
1647 /// page_token for the following request. An empty value means no more result.
1648 pub next_page_token: std::string::String,
1649
1650 /// Locations that could not be reached.
1651 pub unreachable: std::vec::Vec<std::string::String>,
1652
1653 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1654}
1655
1656impl ListServiceConnectionMapsResponse {
1657 /// Creates a new default instance.
1658 pub fn new() -> Self {
1659 std::default::Default::default()
1660 }
1661
1662 /// Sets the value of [service_connection_maps][crate::model::ListServiceConnectionMapsResponse::service_connection_maps].
1663 ///
1664 /// # Example
1665 /// ```ignore,no_run
1666 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1667 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1668 /// let x = ListServiceConnectionMapsResponse::new()
1669 /// .set_service_connection_maps([
1670 /// ServiceConnectionMap::default()/* use setters */,
1671 /// ServiceConnectionMap::default()/* use (different) setters */,
1672 /// ]);
1673 /// ```
1674 pub fn set_service_connection_maps<T, V>(mut self, v: T) -> Self
1675 where
1676 T: std::iter::IntoIterator<Item = V>,
1677 V: std::convert::Into<crate::model::ServiceConnectionMap>,
1678 {
1679 use std::iter::Iterator;
1680 self.service_connection_maps = v.into_iter().map(|i| i.into()).collect();
1681 self
1682 }
1683
1684 /// Sets the value of [next_page_token][crate::model::ListServiceConnectionMapsResponse::next_page_token].
1685 ///
1686 /// # Example
1687 /// ```ignore,no_run
1688 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1689 /// let x = ListServiceConnectionMapsResponse::new().set_next_page_token("example");
1690 /// ```
1691 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1692 self.next_page_token = v.into();
1693 self
1694 }
1695
1696 /// Sets the value of [unreachable][crate::model::ListServiceConnectionMapsResponse::unreachable].
1697 ///
1698 /// # Example
1699 /// ```ignore,no_run
1700 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionMapsResponse;
1701 /// let x = ListServiceConnectionMapsResponse::new().set_unreachable(["a", "b", "c"]);
1702 /// ```
1703 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1704 where
1705 T: std::iter::IntoIterator<Item = V>,
1706 V: std::convert::Into<std::string::String>,
1707 {
1708 use std::iter::Iterator;
1709 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1710 self
1711 }
1712}
1713
1714impl wkt::message::Message for ListServiceConnectionMapsResponse {
1715 fn typename() -> &'static str {
1716 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsResponse"
1717 }
1718}
1719
1720#[doc(hidden)]
1721impl google_cloud_gax::paginator::internal::PageableResponse for ListServiceConnectionMapsResponse {
1722 type PageItem = crate::model::ServiceConnectionMap;
1723
1724 fn items(self) -> std::vec::Vec<Self::PageItem> {
1725 self.service_connection_maps
1726 }
1727
1728 fn next_page_token(&self) -> std::string::String {
1729 use std::clone::Clone;
1730 self.next_page_token.clone()
1731 }
1732}
1733
1734/// Request for GetServiceConnectionMap.
1735#[derive(Clone, Default, PartialEq)]
1736#[non_exhaustive]
1737pub struct GetServiceConnectionMapRequest {
1738 /// Required. Name of the ServiceConnectionMap to get.
1739 pub name: std::string::String,
1740
1741 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1742}
1743
1744impl GetServiceConnectionMapRequest {
1745 /// Creates a new default instance.
1746 pub fn new() -> Self {
1747 std::default::Default::default()
1748 }
1749
1750 /// Sets the value of [name][crate::model::GetServiceConnectionMapRequest::name].
1751 ///
1752 /// # Example
1753 /// ```ignore,no_run
1754 /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionMapRequest;
1755 /// # let project_id = "project_id";
1756 /// # let location_id = "location_id";
1757 /// # let service_connection_map_id = "service_connection_map_id";
1758 /// let x = GetServiceConnectionMapRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionMaps/{service_connection_map_id}"));
1759 /// ```
1760 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1761 self.name = v.into();
1762 self
1763 }
1764}
1765
1766impl wkt::message::Message for GetServiceConnectionMapRequest {
1767 fn typename() -> &'static str {
1768 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionMapRequest"
1769 }
1770}
1771
1772/// Request for CreateServiceConnectionMap.
1773#[derive(Clone, Default, PartialEq)]
1774#[non_exhaustive]
1775pub struct CreateServiceConnectionMapRequest {
1776 /// Required. The parent resource's name of the ServiceConnectionMap. ex.
1777 /// projects/123/locations/us-east1
1778 pub parent: std::string::String,
1779
1780 /// Optional. Resource ID
1781 /// (i.e. 'foo' in '[...]/projects/p/locations/l/serviceConnectionMaps/foo')
1782 /// See <https://google.aip.dev/122#resource-id-segments>
1783 /// Unique per location.
1784 /// If one is not provided, one will be generated.
1785 pub service_connection_map_id: std::string::String,
1786
1787 /// Required. Initial values for a new ServiceConnectionMaps
1788 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1789
1790 /// Optional. An optional request ID to identify requests. Specify a unique
1791 /// request ID so that if you must retry your request, the server will know to
1792 /// ignore the request if it has already been completed. The server will
1793 /// guarantee that for at least 60 minutes since the first request.
1794 ///
1795 /// For example, consider a situation where you make an initial request and
1796 /// the request times out. If you make the request again with the same request
1797 /// ID, the server can check if original operation with the same request ID
1798 /// was received, and if so, will ignore the second request. This prevents
1799 /// clients from accidentally creating duplicate commitments.
1800 ///
1801 /// The request ID must be a valid UUID with the exception that zero UUID is
1802 /// not supported (00000000-0000-0000-0000-000000000000).
1803 pub request_id: std::string::String,
1804
1805 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1806}
1807
1808impl CreateServiceConnectionMapRequest {
1809 /// Creates a new default instance.
1810 pub fn new() -> Self {
1811 std::default::Default::default()
1812 }
1813
1814 /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
1815 ///
1816 /// # Example
1817 /// ```ignore,no_run
1818 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1819 /// # let project_id = "project_id";
1820 /// # let location_id = "location_id";
1821 /// let x = CreateServiceConnectionMapRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
1822 /// ```
1823 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1824 self.parent = v.into();
1825 self
1826 }
1827
1828 /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
1829 ///
1830 /// # Example
1831 /// ```ignore,no_run
1832 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1833 /// let x = CreateServiceConnectionMapRequest::new().set_service_connection_map_id("example");
1834 /// ```
1835 pub fn set_service_connection_map_id<T: std::convert::Into<std::string::String>>(
1836 mut self,
1837 v: T,
1838 ) -> Self {
1839 self.service_connection_map_id = v.into();
1840 self
1841 }
1842
1843 /// Sets 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_service_connection_map(ServiceConnectionMap::default()/* use setters */);
1850 /// ```
1851 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1852 where
1853 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1854 {
1855 self.service_connection_map = std::option::Option::Some(v.into());
1856 self
1857 }
1858
1859 /// Sets or clears the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
1860 ///
1861 /// # Example
1862 /// ```ignore,no_run
1863 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1864 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1865 /// let x = CreateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(Some(ServiceConnectionMap::default()/* use setters */));
1866 /// let x = CreateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(None::<ServiceConnectionMap>);
1867 /// ```
1868 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1869 where
1870 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1871 {
1872 self.service_connection_map = v.map(|x| x.into());
1873 self
1874 }
1875
1876 /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
1877 ///
1878 /// # Example
1879 /// ```ignore,no_run
1880 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionMapRequest;
1881 /// let x = CreateServiceConnectionMapRequest::new().set_request_id("example");
1882 /// ```
1883 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1884 self.request_id = v.into();
1885 self
1886 }
1887}
1888
1889impl wkt::message::Message for CreateServiceConnectionMapRequest {
1890 fn typename() -> &'static str {
1891 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionMapRequest"
1892 }
1893}
1894
1895/// Request for UpdateServiceConnectionMap.
1896#[derive(Clone, Default, PartialEq)]
1897#[non_exhaustive]
1898pub struct UpdateServiceConnectionMapRequest {
1899 /// Optional. Field mask is used to specify the fields to be overwritten in the
1900 /// ServiceConnectionMap resource by the update.
1901 /// The fields specified in the update_mask are relative to the resource, not
1902 /// the full request. A field will be overwritten if it is in the mask. If the
1903 /// user does not provide a mask then all fields will be overwritten.
1904 pub update_mask: std::option::Option<wkt::FieldMask>,
1905
1906 /// Required. New values to be patched into the resource.
1907 pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
1908
1909 /// Optional. An optional request ID to identify requests. Specify a unique
1910 /// request ID so that if you must retry your request, the server will know to
1911 /// ignore the request if it has already been completed. The server will
1912 /// guarantee that for at least 60 minutes since the first request.
1913 ///
1914 /// For example, consider a situation where you make an initial request and
1915 /// the request times out. If you make the request again with the same request
1916 /// ID, the server can check if original operation with the same request ID
1917 /// was received, and if so, will ignore the second request. This prevents
1918 /// clients from accidentally creating duplicate commitments.
1919 ///
1920 /// The request ID must be a valid UUID with the exception that zero UUID is
1921 /// not supported (00000000-0000-0000-0000-000000000000).
1922 pub request_id: std::string::String,
1923
1924 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1925}
1926
1927impl UpdateServiceConnectionMapRequest {
1928 /// Creates a new default instance.
1929 pub fn new() -> Self {
1930 std::default::Default::default()
1931 }
1932
1933 /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1934 ///
1935 /// # Example
1936 /// ```ignore,no_run
1937 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1938 /// use wkt::FieldMask;
1939 /// let x = UpdateServiceConnectionMapRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1940 /// ```
1941 pub fn set_update_mask<T>(mut self, v: T) -> Self
1942 where
1943 T: std::convert::Into<wkt::FieldMask>,
1944 {
1945 self.update_mask = std::option::Option::Some(v.into());
1946 self
1947 }
1948
1949 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
1950 ///
1951 /// # Example
1952 /// ```ignore,no_run
1953 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1954 /// use wkt::FieldMask;
1955 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1956 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1957 /// ```
1958 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1959 where
1960 T: std::convert::Into<wkt::FieldMask>,
1961 {
1962 self.update_mask = v.map(|x| x.into());
1963 self
1964 }
1965
1966 /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1967 ///
1968 /// # Example
1969 /// ```ignore,no_run
1970 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1971 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1972 /// let x = UpdateServiceConnectionMapRequest::new().set_service_connection_map(ServiceConnectionMap::default()/* use setters */);
1973 /// ```
1974 pub fn set_service_connection_map<T>(mut self, v: T) -> Self
1975 where
1976 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1977 {
1978 self.service_connection_map = std::option::Option::Some(v.into());
1979 self
1980 }
1981
1982 /// Sets or clears the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
1983 ///
1984 /// # Example
1985 /// ```ignore,no_run
1986 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
1987 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionMap;
1988 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(Some(ServiceConnectionMap::default()/* use setters */));
1989 /// let x = UpdateServiceConnectionMapRequest::new().set_or_clear_service_connection_map(None::<ServiceConnectionMap>);
1990 /// ```
1991 pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
1992 where
1993 T: std::convert::Into<crate::model::ServiceConnectionMap>,
1994 {
1995 self.service_connection_map = v.map(|x| x.into());
1996 self
1997 }
1998
1999 /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
2000 ///
2001 /// # Example
2002 /// ```ignore,no_run
2003 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionMapRequest;
2004 /// let x = UpdateServiceConnectionMapRequest::new().set_request_id("example");
2005 /// ```
2006 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2007 self.request_id = v.into();
2008 self
2009 }
2010}
2011
2012impl wkt::message::Message for UpdateServiceConnectionMapRequest {
2013 fn typename() -> &'static str {
2014 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionMapRequest"
2015 }
2016}
2017
2018/// Request for DeleteServiceConnectionMap.
2019#[derive(Clone, Default, PartialEq)]
2020#[non_exhaustive]
2021pub struct DeleteServiceConnectionMapRequest {
2022 /// Required. The name of the ServiceConnectionMap to delete.
2023 pub name: std::string::String,
2024
2025 /// Optional. An optional request ID to identify requests. Specify a unique
2026 /// request ID so that if you must retry your request, the server will know to
2027 /// ignore the request if it has already been completed. The server will
2028 /// guarantee that for at least 60 minutes after the first request.
2029 ///
2030 /// For example, consider a situation where you make an initial request and
2031 /// the request times out. If you make the request again with the same request
2032 /// ID, the server can check if original operation with the same request ID
2033 /// was received, and if so, will ignore the second request. This prevents
2034 /// clients from accidentally creating duplicate commitments.
2035 ///
2036 /// The request ID must be a valid UUID with the exception that zero UUID is
2037 /// not supported (00000000-0000-0000-0000-000000000000).
2038 pub request_id: std::string::String,
2039
2040 /// Optional. The etag is computed by the server, and may be sent on update and
2041 /// delete requests to ensure the client has an up-to-date value before
2042 /// proceeding.
2043 pub etag: std::option::Option<std::string::String>,
2044
2045 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2046}
2047
2048impl DeleteServiceConnectionMapRequest {
2049 /// Creates a new default instance.
2050 pub fn new() -> Self {
2051 std::default::Default::default()
2052 }
2053
2054 /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
2055 ///
2056 /// # Example
2057 /// ```ignore,no_run
2058 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2059 /// # let project_id = "project_id";
2060 /// # let location_id = "location_id";
2061 /// # let service_connection_map_id = "service_connection_map_id";
2062 /// let x = DeleteServiceConnectionMapRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionMaps/{service_connection_map_id}"));
2063 /// ```
2064 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2065 self.name = v.into();
2066 self
2067 }
2068
2069 /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
2070 ///
2071 /// # Example
2072 /// ```ignore,no_run
2073 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2074 /// let x = DeleteServiceConnectionMapRequest::new().set_request_id("example");
2075 /// ```
2076 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2077 self.request_id = v.into();
2078 self
2079 }
2080
2081 /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
2082 ///
2083 /// # Example
2084 /// ```ignore,no_run
2085 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2086 /// let x = DeleteServiceConnectionMapRequest::new().set_etag("example");
2087 /// ```
2088 pub fn set_etag<T>(mut self, v: T) -> Self
2089 where
2090 T: std::convert::Into<std::string::String>,
2091 {
2092 self.etag = std::option::Option::Some(v.into());
2093 self
2094 }
2095
2096 /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
2097 ///
2098 /// # Example
2099 /// ```ignore,no_run
2100 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionMapRequest;
2101 /// let x = DeleteServiceConnectionMapRequest::new().set_or_clear_etag(Some("example"));
2102 /// let x = DeleteServiceConnectionMapRequest::new().set_or_clear_etag(None::<String>);
2103 /// ```
2104 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2105 where
2106 T: std::convert::Into<std::string::String>,
2107 {
2108 self.etag = v.map(|x| x.into());
2109 self
2110 }
2111}
2112
2113impl wkt::message::Message for DeleteServiceConnectionMapRequest {
2114 fn typename() -> &'static str {
2115 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionMapRequest"
2116 }
2117}
2118
2119/// The ServiceConnectionPolicy resource.
2120#[derive(Clone, Default, PartialEq)]
2121#[non_exhaustive]
2122pub struct ServiceConnectionPolicy {
2123 /// Immutable. The name of a ServiceConnectionPolicy.
2124 /// Format:
2125 /// projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy}
2126 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
2127 pub name: std::string::String,
2128
2129 /// Output only. Time when the ServiceConnectionPolicy was created.
2130 pub create_time: std::option::Option<wkt::Timestamp>,
2131
2132 /// Output only. Time when the ServiceConnectionPolicy was updated.
2133 pub update_time: std::option::Option<wkt::Timestamp>,
2134
2135 /// User-defined labels.
2136 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2137
2138 /// A description of this resource.
2139 pub description: std::string::String,
2140
2141 /// The resource path of the consumer network.
2142 /// Example:
2143 ///
2144 /// - projects/{projectNumOrId}/global/networks/{resourceId}.
2145 pub network: std::string::String,
2146
2147 /// The service class identifier for which this ServiceConnectionPolicy is for.
2148 /// The service class identifier is a unique, symbolic representation of a
2149 /// ServiceClass. It is provided by the Service Producer. Google services have
2150 /// a prefix of gcp or google-cloud. For example, gcp-memorystore-redis or
2151 /// google-cloud-sql. 3rd party services do not. For example,
2152 /// test-service-a3dfcx.
2153 pub service_class: std::string::String,
2154
2155 /// Output only. The type of underlying resources used to create the
2156 /// connection.
2157 pub infrastructure: crate::model::Infrastructure,
2158
2159 /// Configuration used for Private Service Connect connections. Used when
2160 /// Infrastructure is PSC.
2161 pub psc_config: std::option::Option<crate::model::service_connection_policy::PscConfig>,
2162
2163 /// Output only. [Output only] Information about each Private Service Connect
2164 /// connection.
2165 pub psc_connections: std::vec::Vec<crate::model::service_connection_policy::PscConnection>,
2166
2167 /// Optional. The etag is computed by the server, and may be sent on update and
2168 /// delete requests to ensure the client has an up-to-date value before
2169 /// proceeding.
2170 pub etag: std::option::Option<std::string::String>,
2171
2172 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2173}
2174
2175impl ServiceConnectionPolicy {
2176 /// Creates a new default instance.
2177 pub fn new() -> Self {
2178 std::default::Default::default()
2179 }
2180
2181 /// Sets the value of [name][crate::model::ServiceConnectionPolicy::name].
2182 ///
2183 /// # Example
2184 /// ```ignore,no_run
2185 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2186 /// # let project_id = "project_id";
2187 /// # let location_id = "location_id";
2188 /// # let service_connection_policy_id = "service_connection_policy_id";
2189 /// let x = ServiceConnectionPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionPolicies/{service_connection_policy_id}"));
2190 /// ```
2191 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2192 self.name = v.into();
2193 self
2194 }
2195
2196 /// Sets the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
2197 ///
2198 /// # Example
2199 /// ```ignore,no_run
2200 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2201 /// use wkt::Timestamp;
2202 /// let x = ServiceConnectionPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2203 /// ```
2204 pub fn set_create_time<T>(mut self, v: T) -> Self
2205 where
2206 T: std::convert::Into<wkt::Timestamp>,
2207 {
2208 self.create_time = std::option::Option::Some(v.into());
2209 self
2210 }
2211
2212 /// Sets or clears the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
2213 ///
2214 /// # Example
2215 /// ```ignore,no_run
2216 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2217 /// use wkt::Timestamp;
2218 /// let x = ServiceConnectionPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2219 /// let x = ServiceConnectionPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2220 /// ```
2221 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2222 where
2223 T: std::convert::Into<wkt::Timestamp>,
2224 {
2225 self.create_time = v.map(|x| x.into());
2226 self
2227 }
2228
2229 /// Sets the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
2230 ///
2231 /// # Example
2232 /// ```ignore,no_run
2233 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2234 /// use wkt::Timestamp;
2235 /// let x = ServiceConnectionPolicy::new().set_update_time(Timestamp::default()/* use setters */);
2236 /// ```
2237 pub fn set_update_time<T>(mut self, v: T) -> Self
2238 where
2239 T: std::convert::Into<wkt::Timestamp>,
2240 {
2241 self.update_time = std::option::Option::Some(v.into());
2242 self
2243 }
2244
2245 /// Sets or clears the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
2246 ///
2247 /// # Example
2248 /// ```ignore,no_run
2249 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2250 /// use wkt::Timestamp;
2251 /// let x = ServiceConnectionPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2252 /// let x = ServiceConnectionPolicy::new().set_or_clear_update_time(None::<Timestamp>);
2253 /// ```
2254 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2255 where
2256 T: std::convert::Into<wkt::Timestamp>,
2257 {
2258 self.update_time = v.map(|x| x.into());
2259 self
2260 }
2261
2262 /// Sets the value of [labels][crate::model::ServiceConnectionPolicy::labels].
2263 ///
2264 /// # Example
2265 /// ```ignore,no_run
2266 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2267 /// let x = ServiceConnectionPolicy::new().set_labels([
2268 /// ("key0", "abc"),
2269 /// ("key1", "xyz"),
2270 /// ]);
2271 /// ```
2272 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2273 where
2274 T: std::iter::IntoIterator<Item = (K, V)>,
2275 K: std::convert::Into<std::string::String>,
2276 V: std::convert::Into<std::string::String>,
2277 {
2278 use std::iter::Iterator;
2279 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2280 self
2281 }
2282
2283 /// Sets the value of [description][crate::model::ServiceConnectionPolicy::description].
2284 ///
2285 /// # Example
2286 /// ```ignore,no_run
2287 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2288 /// let x = ServiceConnectionPolicy::new().set_description("example");
2289 /// ```
2290 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2291 self.description = v.into();
2292 self
2293 }
2294
2295 /// Sets the value of [network][crate::model::ServiceConnectionPolicy::network].
2296 ///
2297 /// # Example
2298 /// ```ignore,no_run
2299 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2300 /// let x = ServiceConnectionPolicy::new().set_network("example");
2301 /// ```
2302 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2303 self.network = v.into();
2304 self
2305 }
2306
2307 /// Sets the value of [service_class][crate::model::ServiceConnectionPolicy::service_class].
2308 ///
2309 /// # Example
2310 /// ```ignore,no_run
2311 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2312 /// let x = ServiceConnectionPolicy::new().set_service_class("example");
2313 /// ```
2314 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2315 self.service_class = v.into();
2316 self
2317 }
2318
2319 /// Sets the value of [infrastructure][crate::model::ServiceConnectionPolicy::infrastructure].
2320 ///
2321 /// # Example
2322 /// ```ignore,no_run
2323 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2324 /// use google_cloud_networkconnectivity_v1::model::Infrastructure;
2325 /// let x0 = ServiceConnectionPolicy::new().set_infrastructure(Infrastructure::Psc);
2326 /// ```
2327 pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
2328 mut self,
2329 v: T,
2330 ) -> Self {
2331 self.infrastructure = v.into();
2332 self
2333 }
2334
2335 /// Sets the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
2336 ///
2337 /// # Example
2338 /// ```ignore,no_run
2339 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2340 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2341 /// let x = ServiceConnectionPolicy::new().set_psc_config(PscConfig::default()/* use setters */);
2342 /// ```
2343 pub fn set_psc_config<T>(mut self, v: T) -> Self
2344 where
2345 T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
2346 {
2347 self.psc_config = std::option::Option::Some(v.into());
2348 self
2349 }
2350
2351 /// Sets or clears the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
2352 ///
2353 /// # Example
2354 /// ```ignore,no_run
2355 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2356 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2357 /// let x = ServiceConnectionPolicy::new().set_or_clear_psc_config(Some(PscConfig::default()/* use setters */));
2358 /// let x = ServiceConnectionPolicy::new().set_or_clear_psc_config(None::<PscConfig>);
2359 /// ```
2360 pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
2361 where
2362 T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
2363 {
2364 self.psc_config = v.map(|x| x.into());
2365 self
2366 }
2367
2368 /// Sets the value of [psc_connections][crate::model::ServiceConnectionPolicy::psc_connections].
2369 ///
2370 /// # Example
2371 /// ```ignore,no_run
2372 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2373 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2374 /// let x = ServiceConnectionPolicy::new()
2375 /// .set_psc_connections([
2376 /// PscConnection::default()/* use setters */,
2377 /// PscConnection::default()/* use (different) setters */,
2378 /// ]);
2379 /// ```
2380 pub fn set_psc_connections<T, V>(mut self, v: T) -> Self
2381 where
2382 T: std::iter::IntoIterator<Item = V>,
2383 V: std::convert::Into<crate::model::service_connection_policy::PscConnection>,
2384 {
2385 use std::iter::Iterator;
2386 self.psc_connections = v.into_iter().map(|i| i.into()).collect();
2387 self
2388 }
2389
2390 /// Sets the value of [etag][crate::model::ServiceConnectionPolicy::etag].
2391 ///
2392 /// # Example
2393 /// ```ignore,no_run
2394 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2395 /// let x = ServiceConnectionPolicy::new().set_etag("example");
2396 /// ```
2397 pub fn set_etag<T>(mut self, v: T) -> Self
2398 where
2399 T: std::convert::Into<std::string::String>,
2400 {
2401 self.etag = std::option::Option::Some(v.into());
2402 self
2403 }
2404
2405 /// Sets or clears the value of [etag][crate::model::ServiceConnectionPolicy::etag].
2406 ///
2407 /// # Example
2408 /// ```ignore,no_run
2409 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
2410 /// let x = ServiceConnectionPolicy::new().set_or_clear_etag(Some("example"));
2411 /// let x = ServiceConnectionPolicy::new().set_or_clear_etag(None::<String>);
2412 /// ```
2413 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
2414 where
2415 T: std::convert::Into<std::string::String>,
2416 {
2417 self.etag = v.map(|x| x.into());
2418 self
2419 }
2420}
2421
2422impl wkt::message::Message for ServiceConnectionPolicy {
2423 fn typename() -> &'static str {
2424 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy"
2425 }
2426}
2427
2428/// Defines additional types related to [ServiceConnectionPolicy].
2429pub mod service_connection_policy {
2430 #[allow(unused_imports)]
2431 use super::*;
2432
2433 /// Configuration used for Private Service Connect connections. Used when
2434 /// Infrastructure is PSC.
2435 #[derive(Clone, Default, PartialEq)]
2436 #[non_exhaustive]
2437 pub struct PscConfig {
2438 /// The resource paths of subnetworks to use for IP address management.
2439 /// Example:
2440 /// projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}.
2441 pub subnetworks: std::vec::Vec<std::string::String>,
2442
2443 /// Optional. Max number of PSC connections for this policy.
2444 pub limit: std::option::Option<i64>,
2445
2446 /// Required. ProducerInstanceLocation is used to specify which authorization
2447 /// mechanism to use to determine which projects the Producer instance can be
2448 /// within.
2449 pub producer_instance_location:
2450 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
2451
2452 /// Optional. List of Projects, Folders, or Organizations from where the
2453 /// Producer instance can be within. For example, a network administrator can
2454 /// provide both 'organizations/foo' and 'projects/bar' as
2455 /// allowed_google_producers_resource_hierarchy_levels. This allowlists this
2456 /// network to connect with any Producer instance within the 'foo'
2457 /// organization or the 'bar' project. By default,
2458 /// allowed_google_producers_resource_hierarchy_level is empty. The format
2459 /// for each allowed_google_producers_resource_hierarchy_level is \<resource
2460 /// type\>/\<id\> where <resource type\> is one of 'projects', 'folders', or
2461 /// 'organizations' and \<id\> is either the ID or the number of the resource
2462 /// type. Format for each allowed_google_producers_resource_hierarchy_level
2463 /// value: 'projects/<project_id_or_number>' or 'folders/<folder_id>' or
2464 /// 'organizations/<organization_id>'
2465 /// Eg. [projects/my-project-id, projects/567, folders/891,
2466 /// organizations/123]
2467 pub allowed_google_producers_resource_hierarchy_level: std::vec::Vec<std::string::String>,
2468
2469 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2470 }
2471
2472 impl PscConfig {
2473 /// Creates a new default instance.
2474 pub fn new() -> Self {
2475 std::default::Default::default()
2476 }
2477
2478 /// Sets the value of [subnetworks][crate::model::service_connection_policy::PscConfig::subnetworks].
2479 ///
2480 /// # Example
2481 /// ```ignore,no_run
2482 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2483 /// let x = PscConfig::new().set_subnetworks(["a", "b", "c"]);
2484 /// ```
2485 pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
2486 where
2487 T: std::iter::IntoIterator<Item = V>,
2488 V: std::convert::Into<std::string::String>,
2489 {
2490 use std::iter::Iterator;
2491 self.subnetworks = v.into_iter().map(|i| i.into()).collect();
2492 self
2493 }
2494
2495 /// Sets the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
2496 ///
2497 /// # Example
2498 /// ```ignore,no_run
2499 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2500 /// let x = PscConfig::new().set_limit(42);
2501 /// ```
2502 pub fn set_limit<T>(mut self, v: T) -> Self
2503 where
2504 T: std::convert::Into<i64>,
2505 {
2506 self.limit = std::option::Option::Some(v.into());
2507 self
2508 }
2509
2510 /// Sets or clears the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
2511 ///
2512 /// # Example
2513 /// ```ignore,no_run
2514 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2515 /// let x = PscConfig::new().set_or_clear_limit(Some(42));
2516 /// let x = PscConfig::new().set_or_clear_limit(None::<i32>);
2517 /// ```
2518 pub fn set_or_clear_limit<T>(mut self, v: std::option::Option<T>) -> Self
2519 where
2520 T: std::convert::Into<i64>,
2521 {
2522 self.limit = v.map(|x| x.into());
2523 self
2524 }
2525
2526 /// Sets the value of [producer_instance_location][crate::model::service_connection_policy::PscConfig::producer_instance_location].
2527 ///
2528 /// # Example
2529 /// ```ignore,no_run
2530 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2531 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::psc_config::ProducerInstanceLocation;
2532 /// let x0 = PscConfig::new().set_producer_instance_location(ProducerInstanceLocation::CustomResourceHierarchyLevels);
2533 /// ```
2534 pub fn set_producer_instance_location<
2535 T: std::convert::Into<
2536 crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
2537 >,
2538 >(
2539 mut self,
2540 v: T,
2541 ) -> Self {
2542 self.producer_instance_location = v.into();
2543 self
2544 }
2545
2546 /// Sets the value of [allowed_google_producers_resource_hierarchy_level][crate::model::service_connection_policy::PscConfig::allowed_google_producers_resource_hierarchy_level].
2547 ///
2548 /// # Example
2549 /// ```ignore,no_run
2550 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConfig;
2551 /// let x = PscConfig::new().set_allowed_google_producers_resource_hierarchy_level(["a", "b", "c"]);
2552 /// ```
2553 pub fn set_allowed_google_producers_resource_hierarchy_level<T, V>(mut self, v: T) -> Self
2554 where
2555 T: std::iter::IntoIterator<Item = V>,
2556 V: std::convert::Into<std::string::String>,
2557 {
2558 use std::iter::Iterator;
2559 self.allowed_google_producers_resource_hierarchy_level =
2560 v.into_iter().map(|i| i.into()).collect();
2561 self
2562 }
2563 }
2564
2565 impl wkt::message::Message for PscConfig {
2566 fn typename() -> &'static str {
2567 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig"
2568 }
2569 }
2570
2571 /// Defines additional types related to [PscConfig].
2572 pub mod psc_config {
2573 #[allow(unused_imports)]
2574 use super::*;
2575
2576 /// ProducerInstanceLocation is used to specify which authorization mechanism
2577 /// to use to determine which projects the Producer instance can be within.
2578 ///
2579 /// # Working with unknown values
2580 ///
2581 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2582 /// additional enum variants at any time. Adding new variants is not considered
2583 /// a breaking change. Applications should write their code in anticipation of:
2584 ///
2585 /// - New values appearing in future releases of the client library, **and**
2586 /// - New values received dynamically, without application changes.
2587 ///
2588 /// Please consult the [Working with enums] section in the user guide for some
2589 /// guidelines.
2590 ///
2591 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2592 #[derive(Clone, Debug, PartialEq)]
2593 #[non_exhaustive]
2594 pub enum ProducerInstanceLocation {
2595 /// Producer instance location is not specified. When this option is
2596 /// chosen, then the PSC connections created by this
2597 /// ServiceConnectionPolicy must be within the same project as the Producer
2598 /// instance. This is the default ProducerInstanceLocation value.
2599 /// To allow for PSC connections from this network to other networks, use
2600 /// the CUSTOM_RESOURCE_HIERARCHY_LEVELS option.
2601 Unspecified,
2602 /// Producer instance must be within one of the values provided in
2603 /// allowed_google_producers_resource_hierarchy_level.
2604 CustomResourceHierarchyLevels,
2605 /// If set, the enum was initialized with an unknown value.
2606 ///
2607 /// Applications can examine the value using [ProducerInstanceLocation::value] or
2608 /// [ProducerInstanceLocation::name].
2609 UnknownValue(producer_instance_location::UnknownValue),
2610 }
2611
2612 #[doc(hidden)]
2613 pub mod producer_instance_location {
2614 #[allow(unused_imports)]
2615 use super::*;
2616 #[derive(Clone, Debug, PartialEq)]
2617 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2618 }
2619
2620 impl ProducerInstanceLocation {
2621 /// Gets the enum value.
2622 ///
2623 /// Returns `None` if the enum contains an unknown value deserialized from
2624 /// the string representation of enums.
2625 pub fn value(&self) -> std::option::Option<i32> {
2626 match self {
2627 Self::Unspecified => std::option::Option::Some(0),
2628 Self::CustomResourceHierarchyLevels => std::option::Option::Some(1),
2629 Self::UnknownValue(u) => u.0.value(),
2630 }
2631 }
2632
2633 /// Gets the enum value as a string.
2634 ///
2635 /// Returns `None` if the enum contains an unknown value deserialized from
2636 /// the integer representation of enums.
2637 pub fn name(&self) -> std::option::Option<&str> {
2638 match self {
2639 Self::Unspecified => {
2640 std::option::Option::Some("PRODUCER_INSTANCE_LOCATION_UNSPECIFIED")
2641 }
2642 Self::CustomResourceHierarchyLevels => {
2643 std::option::Option::Some("CUSTOM_RESOURCE_HIERARCHY_LEVELS")
2644 }
2645 Self::UnknownValue(u) => u.0.name(),
2646 }
2647 }
2648 }
2649
2650 impl std::default::Default for ProducerInstanceLocation {
2651 fn default() -> Self {
2652 use std::convert::From;
2653 Self::from(0)
2654 }
2655 }
2656
2657 impl std::fmt::Display for ProducerInstanceLocation {
2658 fn fmt(
2659 &self,
2660 f: &mut std::fmt::Formatter<'_>,
2661 ) -> std::result::Result<(), std::fmt::Error> {
2662 wkt::internal::display_enum(f, self.name(), self.value())
2663 }
2664 }
2665
2666 impl std::convert::From<i32> for ProducerInstanceLocation {
2667 fn from(value: i32) -> Self {
2668 match value {
2669 0 => Self::Unspecified,
2670 1 => Self::CustomResourceHierarchyLevels,
2671 _ => Self::UnknownValue(producer_instance_location::UnknownValue(
2672 wkt::internal::UnknownEnumValue::Integer(value),
2673 )),
2674 }
2675 }
2676 }
2677
2678 impl std::convert::From<&str> for ProducerInstanceLocation {
2679 fn from(value: &str) -> Self {
2680 use std::string::ToString;
2681 match value {
2682 "PRODUCER_INSTANCE_LOCATION_UNSPECIFIED" => Self::Unspecified,
2683 "CUSTOM_RESOURCE_HIERARCHY_LEVELS" => Self::CustomResourceHierarchyLevels,
2684 _ => Self::UnknownValue(producer_instance_location::UnknownValue(
2685 wkt::internal::UnknownEnumValue::String(value.to_string()),
2686 )),
2687 }
2688 }
2689 }
2690
2691 impl serde::ser::Serialize for ProducerInstanceLocation {
2692 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2693 where
2694 S: serde::Serializer,
2695 {
2696 match self {
2697 Self::Unspecified => serializer.serialize_i32(0),
2698 Self::CustomResourceHierarchyLevels => serializer.serialize_i32(1),
2699 Self::UnknownValue(u) => u.0.serialize(serializer),
2700 }
2701 }
2702 }
2703
2704 impl<'de> serde::de::Deserialize<'de> for ProducerInstanceLocation {
2705 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2706 where
2707 D: serde::Deserializer<'de>,
2708 {
2709 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProducerInstanceLocation>::new(
2710 ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig.ProducerInstanceLocation"))
2711 }
2712 }
2713 }
2714
2715 /// Information about a specific Private Service Connect connection.
2716 #[derive(Clone, Default, PartialEq)]
2717 #[non_exhaustive]
2718 pub struct PscConnection {
2719 /// State of the PSC Connection
2720 pub state: crate::model::service_connection_policy::State,
2721
2722 /// The resource reference of the PSC Forwarding Rule within the consumer
2723 /// VPC.
2724 pub consumer_forwarding_rule: std::string::String,
2725
2726 /// The resource reference of the consumer address.
2727 pub consumer_address: std::string::String,
2728
2729 /// The error type indicates whether the error is consumer facing, producer
2730 /// facing or system internal.
2731 #[deprecated]
2732 pub error_type: crate::model::ConnectionErrorType,
2733
2734 /// The most recent error during operating this connection.
2735 /// Deprecated, please use error_info instead.
2736 #[deprecated]
2737 pub error: std::option::Option<google_cloud_rpc::model::Status>,
2738
2739 /// The last Compute Engine operation to setup PSC connection.
2740 pub gce_operation: std::string::String,
2741
2742 /// The project where the PSC connection is created.
2743 pub consumer_target_project: std::string::String,
2744
2745 /// The PSC connection id of the PSC forwarding rule.
2746 pub psc_connection_id: std::string::String,
2747
2748 /// Output only. The error info for the latest error during operating this
2749 /// connection.
2750 pub error_info: std::option::Option<google_cloud_rpc::model::ErrorInfo>,
2751
2752 /// Output only. The URI of the subnetwork selected to allocate IP address
2753 /// for this connection.
2754 pub selected_subnetwork: std::string::String,
2755
2756 /// Immutable. Deprecated. Use producer_instance_metadata instead.
2757 /// An immutable identifier for the producer instance.
2758 #[deprecated]
2759 pub producer_instance_id: std::string::String,
2760
2761 /// Immutable. An immutable map for the producer instance metadata.
2762 pub producer_instance_metadata:
2763 std::collections::HashMap<std::string::String, std::string::String>,
2764
2765 /// Output only. [Output only] The service class associated with this PSC
2766 /// Connection. The value is derived from the SCPolicy and matches the
2767 /// service class name provided by the customer.
2768 pub service_class: std::string::String,
2769
2770 /// The requested IP version for the PSC connection.
2771 pub ip_version: std::option::Option<crate::model::IPVersion>,
2772
2773 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2774 }
2775
2776 impl PscConnection {
2777 /// Creates a new default instance.
2778 pub fn new() -> Self {
2779 std::default::Default::default()
2780 }
2781
2782 /// Sets the value of [state][crate::model::service_connection_policy::PscConnection::state].
2783 ///
2784 /// # Example
2785 /// ```ignore,no_run
2786 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2787 /// use google_cloud_networkconnectivity_v1::model::service_connection_policy::State;
2788 /// let x0 = PscConnection::new().set_state(State::Active);
2789 /// let x1 = PscConnection::new().set_state(State::Failed);
2790 /// let x2 = PscConnection::new().set_state(State::Creating);
2791 /// ```
2792 pub fn set_state<T: std::convert::Into<crate::model::service_connection_policy::State>>(
2793 mut self,
2794 v: T,
2795 ) -> Self {
2796 self.state = v.into();
2797 self
2798 }
2799
2800 /// Sets the value of [consumer_forwarding_rule][crate::model::service_connection_policy::PscConnection::consumer_forwarding_rule].
2801 ///
2802 /// # Example
2803 /// ```ignore,no_run
2804 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2805 /// let x = PscConnection::new().set_consumer_forwarding_rule("example");
2806 /// ```
2807 pub fn set_consumer_forwarding_rule<T: std::convert::Into<std::string::String>>(
2808 mut self,
2809 v: T,
2810 ) -> Self {
2811 self.consumer_forwarding_rule = v.into();
2812 self
2813 }
2814
2815 /// Sets the value of [consumer_address][crate::model::service_connection_policy::PscConnection::consumer_address].
2816 ///
2817 /// # Example
2818 /// ```ignore,no_run
2819 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2820 /// let x = PscConnection::new().set_consumer_address("example");
2821 /// ```
2822 pub fn set_consumer_address<T: std::convert::Into<std::string::String>>(
2823 mut self,
2824 v: T,
2825 ) -> Self {
2826 self.consumer_address = v.into();
2827 self
2828 }
2829
2830 /// Sets the value of [error_type][crate::model::service_connection_policy::PscConnection::error_type].
2831 ///
2832 /// # Example
2833 /// ```ignore,no_run
2834 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2835 /// use google_cloud_networkconnectivity_v1::model::ConnectionErrorType;
2836 /// let x0 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorInternal);
2837 /// let x1 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorConsumerSide);
2838 /// let x2 = PscConnection::new().set_error_type(ConnectionErrorType::ErrorProducerSide);
2839 /// ```
2840 #[deprecated]
2841 pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
2842 mut self,
2843 v: T,
2844 ) -> Self {
2845 self.error_type = v.into();
2846 self
2847 }
2848
2849 /// Sets the value of [error][crate::model::service_connection_policy::PscConnection::error].
2850 ///
2851 /// # Example
2852 /// ```ignore,no_run
2853 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2854 /// use google_cloud_rpc::model::Status;
2855 /// let x = PscConnection::new().set_error(Status::default()/* use setters */);
2856 /// ```
2857 #[deprecated]
2858 pub fn set_error<T>(mut self, v: T) -> Self
2859 where
2860 T: std::convert::Into<google_cloud_rpc::model::Status>,
2861 {
2862 self.error = std::option::Option::Some(v.into());
2863 self
2864 }
2865
2866 /// Sets or clears the value of [error][crate::model::service_connection_policy::PscConnection::error].
2867 ///
2868 /// # Example
2869 /// ```ignore,no_run
2870 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2871 /// use google_cloud_rpc::model::Status;
2872 /// let x = PscConnection::new().set_or_clear_error(Some(Status::default()/* use setters */));
2873 /// let x = PscConnection::new().set_or_clear_error(None::<Status>);
2874 /// ```
2875 #[deprecated]
2876 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
2877 where
2878 T: std::convert::Into<google_cloud_rpc::model::Status>,
2879 {
2880 self.error = v.map(|x| x.into());
2881 self
2882 }
2883
2884 /// Sets the value of [gce_operation][crate::model::service_connection_policy::PscConnection::gce_operation].
2885 ///
2886 /// # Example
2887 /// ```ignore,no_run
2888 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2889 /// let x = PscConnection::new().set_gce_operation("example");
2890 /// ```
2891 pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
2892 mut self,
2893 v: T,
2894 ) -> Self {
2895 self.gce_operation = v.into();
2896 self
2897 }
2898
2899 /// Sets the value of [consumer_target_project][crate::model::service_connection_policy::PscConnection::consumer_target_project].
2900 ///
2901 /// # Example
2902 /// ```ignore,no_run
2903 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2904 /// let x = PscConnection::new().set_consumer_target_project("example");
2905 /// ```
2906 pub fn set_consumer_target_project<T: std::convert::Into<std::string::String>>(
2907 mut self,
2908 v: T,
2909 ) -> Self {
2910 self.consumer_target_project = v.into();
2911 self
2912 }
2913
2914 /// Sets the value of [psc_connection_id][crate::model::service_connection_policy::PscConnection::psc_connection_id].
2915 ///
2916 /// # Example
2917 /// ```ignore,no_run
2918 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2919 /// let x = PscConnection::new().set_psc_connection_id("example");
2920 /// ```
2921 pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
2922 mut self,
2923 v: T,
2924 ) -> Self {
2925 self.psc_connection_id = v.into();
2926 self
2927 }
2928
2929 /// Sets the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
2930 ///
2931 /// # Example
2932 /// ```ignore,no_run
2933 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2934 /// use google_cloud_rpc::model::ErrorInfo;
2935 /// let x = PscConnection::new().set_error_info(ErrorInfo::default()/* use setters */);
2936 /// ```
2937 pub fn set_error_info<T>(mut self, v: T) -> Self
2938 where
2939 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
2940 {
2941 self.error_info = std::option::Option::Some(v.into());
2942 self
2943 }
2944
2945 /// Sets or clears the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
2946 ///
2947 /// # Example
2948 /// ```ignore,no_run
2949 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2950 /// use google_cloud_rpc::model::ErrorInfo;
2951 /// let x = PscConnection::new().set_or_clear_error_info(Some(ErrorInfo::default()/* use setters */));
2952 /// let x = PscConnection::new().set_or_clear_error_info(None::<ErrorInfo>);
2953 /// ```
2954 pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
2955 where
2956 T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
2957 {
2958 self.error_info = v.map(|x| x.into());
2959 self
2960 }
2961
2962 /// Sets the value of [selected_subnetwork][crate::model::service_connection_policy::PscConnection::selected_subnetwork].
2963 ///
2964 /// # Example
2965 /// ```ignore,no_run
2966 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2967 /// let x = PscConnection::new().set_selected_subnetwork("example");
2968 /// ```
2969 pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
2970 mut self,
2971 v: T,
2972 ) -> Self {
2973 self.selected_subnetwork = v.into();
2974 self
2975 }
2976
2977 /// Sets the value of [producer_instance_id][crate::model::service_connection_policy::PscConnection::producer_instance_id].
2978 ///
2979 /// # Example
2980 /// ```ignore,no_run
2981 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2982 /// let x = PscConnection::new().set_producer_instance_id("example");
2983 /// ```
2984 #[deprecated]
2985 pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
2986 mut self,
2987 v: T,
2988 ) -> Self {
2989 self.producer_instance_id = v.into();
2990 self
2991 }
2992
2993 /// Sets the value of [producer_instance_metadata][crate::model::service_connection_policy::PscConnection::producer_instance_metadata].
2994 ///
2995 /// # Example
2996 /// ```ignore,no_run
2997 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
2998 /// let x = PscConnection::new().set_producer_instance_metadata([
2999 /// ("key0", "abc"),
3000 /// ("key1", "xyz"),
3001 /// ]);
3002 /// ```
3003 pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
3004 where
3005 T: std::iter::IntoIterator<Item = (K, V)>,
3006 K: std::convert::Into<std::string::String>,
3007 V: std::convert::Into<std::string::String>,
3008 {
3009 use std::iter::Iterator;
3010 self.producer_instance_metadata =
3011 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3012 self
3013 }
3014
3015 /// Sets the value of [service_class][crate::model::service_connection_policy::PscConnection::service_class].
3016 ///
3017 /// # Example
3018 /// ```ignore,no_run
3019 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3020 /// let x = PscConnection::new().set_service_class("example");
3021 /// ```
3022 pub fn set_service_class<T: std::convert::Into<std::string::String>>(
3023 mut self,
3024 v: T,
3025 ) -> Self {
3026 self.service_class = v.into();
3027 self
3028 }
3029
3030 /// Sets the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
3031 ///
3032 /// # Example
3033 /// ```ignore,no_run
3034 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3035 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
3036 /// let x0 = PscConnection::new().set_ip_version(IPVersion::Ipv4);
3037 /// let x1 = PscConnection::new().set_ip_version(IPVersion::Ipv6);
3038 /// ```
3039 pub fn set_ip_version<T>(mut self, v: T) -> Self
3040 where
3041 T: std::convert::Into<crate::model::IPVersion>,
3042 {
3043 self.ip_version = std::option::Option::Some(v.into());
3044 self
3045 }
3046
3047 /// Sets or clears the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
3048 ///
3049 /// # Example
3050 /// ```ignore,no_run
3051 /// # use google_cloud_networkconnectivity_v1::model::service_connection_policy::PscConnection;
3052 /// use google_cloud_networkconnectivity_v1::model::IPVersion;
3053 /// let x0 = PscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv4));
3054 /// let x1 = PscConnection::new().set_or_clear_ip_version(Some(IPVersion::Ipv6));
3055 /// let x_none = PscConnection::new().set_or_clear_ip_version(None::<IPVersion>);
3056 /// ```
3057 pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
3058 where
3059 T: std::convert::Into<crate::model::IPVersion>,
3060 {
3061 self.ip_version = v.map(|x| x.into());
3062 self
3063 }
3064 }
3065
3066 impl wkt::message::Message for PscConnection {
3067 fn typename() -> &'static str {
3068 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection"
3069 }
3070 }
3071
3072 /// The state of the PSC connection.
3073 /// We reserve the right to add more states without notice in the future.
3074 /// Users should not use exhaustive switch statements on this enum.
3075 /// See <https://google.aip.dev/216>.
3076 ///
3077 /// # Working with unknown values
3078 ///
3079 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3080 /// additional enum variants at any time. Adding new variants is not considered
3081 /// a breaking change. Applications should write their code in anticipation of:
3082 ///
3083 /// - New values appearing in future releases of the client library, **and**
3084 /// - New values received dynamically, without application changes.
3085 ///
3086 /// Please consult the [Working with enums] section in the user guide for some
3087 /// guidelines.
3088 ///
3089 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3090 #[derive(Clone, Debug, PartialEq)]
3091 #[non_exhaustive]
3092 pub enum State {
3093 /// An invalid state as the default case.
3094 Unspecified,
3095 /// The connection has been created successfully. However, for the
3096 /// up-to-date connection status, please use the created forwarding rule's
3097 /// "PscConnectionStatus" as the source of truth.
3098 Active,
3099 /// The connection is not functional since some resources on the connection
3100 /// fail to be created.
3101 Failed,
3102 /// The connection is being created.
3103 Creating,
3104 /// The connection is being deleted.
3105 Deleting,
3106 /// The connection is being repaired to complete creation.
3107 CreateRepairing,
3108 /// The connection is being repaired to complete deletion.
3109 DeleteRepairing,
3110 /// If set, the enum was initialized with an unknown value.
3111 ///
3112 /// Applications can examine the value using [State::value] or
3113 /// [State::name].
3114 UnknownValue(state::UnknownValue),
3115 }
3116
3117 #[doc(hidden)]
3118 pub mod state {
3119 #[allow(unused_imports)]
3120 use super::*;
3121 #[derive(Clone, Debug, PartialEq)]
3122 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3123 }
3124
3125 impl State {
3126 /// Gets the enum value.
3127 ///
3128 /// Returns `None` if the enum contains an unknown value deserialized from
3129 /// the string representation of enums.
3130 pub fn value(&self) -> std::option::Option<i32> {
3131 match self {
3132 Self::Unspecified => std::option::Option::Some(0),
3133 Self::Active => std::option::Option::Some(1),
3134 Self::Failed => std::option::Option::Some(2),
3135 Self::Creating => std::option::Option::Some(3),
3136 Self::Deleting => std::option::Option::Some(4),
3137 Self::CreateRepairing => std::option::Option::Some(5),
3138 Self::DeleteRepairing => std::option::Option::Some(6),
3139 Self::UnknownValue(u) => u.0.value(),
3140 }
3141 }
3142
3143 /// Gets the enum value as a string.
3144 ///
3145 /// Returns `None` if the enum contains an unknown value deserialized from
3146 /// the integer representation of enums.
3147 pub fn name(&self) -> std::option::Option<&str> {
3148 match self {
3149 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3150 Self::Active => std::option::Option::Some("ACTIVE"),
3151 Self::Failed => std::option::Option::Some("FAILED"),
3152 Self::Creating => std::option::Option::Some("CREATING"),
3153 Self::Deleting => std::option::Option::Some("DELETING"),
3154 Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
3155 Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
3156 Self::UnknownValue(u) => u.0.name(),
3157 }
3158 }
3159 }
3160
3161 impl std::default::Default for State {
3162 fn default() -> Self {
3163 use std::convert::From;
3164 Self::from(0)
3165 }
3166 }
3167
3168 impl std::fmt::Display for State {
3169 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3170 wkt::internal::display_enum(f, self.name(), self.value())
3171 }
3172 }
3173
3174 impl std::convert::From<i32> for State {
3175 fn from(value: i32) -> Self {
3176 match value {
3177 0 => Self::Unspecified,
3178 1 => Self::Active,
3179 2 => Self::Failed,
3180 3 => Self::Creating,
3181 4 => Self::Deleting,
3182 5 => Self::CreateRepairing,
3183 6 => Self::DeleteRepairing,
3184 _ => Self::UnknownValue(state::UnknownValue(
3185 wkt::internal::UnknownEnumValue::Integer(value),
3186 )),
3187 }
3188 }
3189 }
3190
3191 impl std::convert::From<&str> for State {
3192 fn from(value: &str) -> Self {
3193 use std::string::ToString;
3194 match value {
3195 "STATE_UNSPECIFIED" => Self::Unspecified,
3196 "ACTIVE" => Self::Active,
3197 "FAILED" => Self::Failed,
3198 "CREATING" => Self::Creating,
3199 "DELETING" => Self::Deleting,
3200 "CREATE_REPAIRING" => Self::CreateRepairing,
3201 "DELETE_REPAIRING" => Self::DeleteRepairing,
3202 _ => Self::UnknownValue(state::UnknownValue(
3203 wkt::internal::UnknownEnumValue::String(value.to_string()),
3204 )),
3205 }
3206 }
3207 }
3208
3209 impl serde::ser::Serialize for State {
3210 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3211 where
3212 S: serde::Serializer,
3213 {
3214 match self {
3215 Self::Unspecified => serializer.serialize_i32(0),
3216 Self::Active => serializer.serialize_i32(1),
3217 Self::Failed => serializer.serialize_i32(2),
3218 Self::Creating => serializer.serialize_i32(3),
3219 Self::Deleting => serializer.serialize_i32(4),
3220 Self::CreateRepairing => serializer.serialize_i32(5),
3221 Self::DeleteRepairing => serializer.serialize_i32(6),
3222 Self::UnknownValue(u) => u.0.serialize(serializer),
3223 }
3224 }
3225 }
3226
3227 impl<'de> serde::de::Deserialize<'de> for State {
3228 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3229 where
3230 D: serde::Deserializer<'de>,
3231 {
3232 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3233 ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.State",
3234 ))
3235 }
3236 }
3237}
3238
3239/// Request for ListServiceConnectionPolicies.
3240#[derive(Clone, Default, PartialEq)]
3241#[non_exhaustive]
3242pub struct ListServiceConnectionPoliciesRequest {
3243 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
3244 pub parent: std::string::String,
3245
3246 /// The maximum number of results per page that should be returned.
3247 pub page_size: i32,
3248
3249 /// The page token.
3250 pub page_token: std::string::String,
3251
3252 /// A filter expression that filters the results listed in the response.
3253 pub filter: std::string::String,
3254
3255 /// Sort the results by a certain order.
3256 pub order_by: std::string::String,
3257
3258 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3259}
3260
3261impl ListServiceConnectionPoliciesRequest {
3262 /// Creates a new default instance.
3263 pub fn new() -> Self {
3264 std::default::Default::default()
3265 }
3266
3267 /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
3268 ///
3269 /// # Example
3270 /// ```ignore,no_run
3271 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3272 /// let x = ListServiceConnectionPoliciesRequest::new().set_parent("example");
3273 /// ```
3274 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3275 self.parent = v.into();
3276 self
3277 }
3278
3279 /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
3280 ///
3281 /// # Example
3282 /// ```ignore,no_run
3283 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3284 /// let x = ListServiceConnectionPoliciesRequest::new().set_page_size(42);
3285 /// ```
3286 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3287 self.page_size = v.into();
3288 self
3289 }
3290
3291 /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
3292 ///
3293 /// # Example
3294 /// ```ignore,no_run
3295 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3296 /// let x = ListServiceConnectionPoliciesRequest::new().set_page_token("example");
3297 /// ```
3298 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3299 self.page_token = v.into();
3300 self
3301 }
3302
3303 /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
3304 ///
3305 /// # Example
3306 /// ```ignore,no_run
3307 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3308 /// let x = ListServiceConnectionPoliciesRequest::new().set_filter("example");
3309 /// ```
3310 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3311 self.filter = v.into();
3312 self
3313 }
3314
3315 /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
3316 ///
3317 /// # Example
3318 /// ```ignore,no_run
3319 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesRequest;
3320 /// let x = ListServiceConnectionPoliciesRequest::new().set_order_by("example");
3321 /// ```
3322 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3323 self.order_by = v.into();
3324 self
3325 }
3326}
3327
3328impl wkt::message::Message for ListServiceConnectionPoliciesRequest {
3329 fn typename() -> &'static str {
3330 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesRequest"
3331 }
3332}
3333
3334/// Response for ListServiceConnectionPolicies.
3335#[derive(Clone, Default, PartialEq)]
3336#[non_exhaustive]
3337pub struct ListServiceConnectionPoliciesResponse {
3338 /// ServiceConnectionPolicies to be returned.
3339 pub service_connection_policies: std::vec::Vec<crate::model::ServiceConnectionPolicy>,
3340
3341 /// The next pagination token in the List response. It should be used as
3342 /// page_token for the following request. An empty value means no more result.
3343 pub next_page_token: std::string::String,
3344
3345 /// Locations that could not be reached.
3346 pub unreachable: std::vec::Vec<std::string::String>,
3347
3348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3349}
3350
3351impl ListServiceConnectionPoliciesResponse {
3352 /// Creates a new default instance.
3353 pub fn new() -> Self {
3354 std::default::Default::default()
3355 }
3356
3357 /// Sets the value of [service_connection_policies][crate::model::ListServiceConnectionPoliciesResponse::service_connection_policies].
3358 ///
3359 /// # Example
3360 /// ```ignore,no_run
3361 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3362 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3363 /// let x = ListServiceConnectionPoliciesResponse::new()
3364 /// .set_service_connection_policies([
3365 /// ServiceConnectionPolicy::default()/* use setters */,
3366 /// ServiceConnectionPolicy::default()/* use (different) setters */,
3367 /// ]);
3368 /// ```
3369 pub fn set_service_connection_policies<T, V>(mut self, v: T) -> Self
3370 where
3371 T: std::iter::IntoIterator<Item = V>,
3372 V: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3373 {
3374 use std::iter::Iterator;
3375 self.service_connection_policies = v.into_iter().map(|i| i.into()).collect();
3376 self
3377 }
3378
3379 /// Sets the value of [next_page_token][crate::model::ListServiceConnectionPoliciesResponse::next_page_token].
3380 ///
3381 /// # Example
3382 /// ```ignore,no_run
3383 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3384 /// let x = ListServiceConnectionPoliciesResponse::new().set_next_page_token("example");
3385 /// ```
3386 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3387 self.next_page_token = v.into();
3388 self
3389 }
3390
3391 /// Sets the value of [unreachable][crate::model::ListServiceConnectionPoliciesResponse::unreachable].
3392 ///
3393 /// # Example
3394 /// ```ignore,no_run
3395 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionPoliciesResponse;
3396 /// let x = ListServiceConnectionPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
3397 /// ```
3398 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3399 where
3400 T: std::iter::IntoIterator<Item = V>,
3401 V: std::convert::Into<std::string::String>,
3402 {
3403 use std::iter::Iterator;
3404 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3405 self
3406 }
3407}
3408
3409impl wkt::message::Message for ListServiceConnectionPoliciesResponse {
3410 fn typename() -> &'static str {
3411 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesResponse"
3412 }
3413}
3414
3415#[doc(hidden)]
3416impl google_cloud_gax::paginator::internal::PageableResponse
3417 for ListServiceConnectionPoliciesResponse
3418{
3419 type PageItem = crate::model::ServiceConnectionPolicy;
3420
3421 fn items(self) -> std::vec::Vec<Self::PageItem> {
3422 self.service_connection_policies
3423 }
3424
3425 fn next_page_token(&self) -> std::string::String {
3426 use std::clone::Clone;
3427 self.next_page_token.clone()
3428 }
3429}
3430
3431/// Request for GetServiceConnectionPolicy.
3432#[derive(Clone, Default, PartialEq)]
3433#[non_exhaustive]
3434pub struct GetServiceConnectionPolicyRequest {
3435 /// Required. Name of the ServiceConnectionPolicy to get.
3436 pub name: std::string::String,
3437
3438 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3439}
3440
3441impl GetServiceConnectionPolicyRequest {
3442 /// Creates a new default instance.
3443 pub fn new() -> Self {
3444 std::default::Default::default()
3445 }
3446
3447 /// Sets the value of [name][crate::model::GetServiceConnectionPolicyRequest::name].
3448 ///
3449 /// # Example
3450 /// ```ignore,no_run
3451 /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionPolicyRequest;
3452 /// # let project_id = "project_id";
3453 /// # let location_id = "location_id";
3454 /// # let service_connection_policy_id = "service_connection_policy_id";
3455 /// let x = GetServiceConnectionPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionPolicies/{service_connection_policy_id}"));
3456 /// ```
3457 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3458 self.name = v.into();
3459 self
3460 }
3461}
3462
3463impl wkt::message::Message for GetServiceConnectionPolicyRequest {
3464 fn typename() -> &'static str {
3465 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionPolicyRequest"
3466 }
3467}
3468
3469/// Request for CreateServiceConnectionPolicy.
3470#[derive(Clone, Default, PartialEq)]
3471#[non_exhaustive]
3472pub struct CreateServiceConnectionPolicyRequest {
3473 /// Required. The parent resource's name of the ServiceConnectionPolicy. ex.
3474 /// projects/123/locations/us-east1
3475 pub parent: std::string::String,
3476
3477 /// Optional. Resource ID
3478 /// (i.e. 'foo' in
3479 /// '[...]/projects/p/locations/l/serviceConnectionPolicies/foo') See
3480 /// <https://google.aip.dev/122#resource-id-segments> Unique per location.
3481 pub service_connection_policy_id: std::string::String,
3482
3483 /// Required. Initial values for a new ServiceConnectionPolicies
3484 pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
3485
3486 /// Optional. An optional request ID to identify requests. Specify a unique
3487 /// request ID so that if you must retry your request, the server will know to
3488 /// ignore the request if it has already been completed. The server will
3489 /// guarantee that for at least 60 minutes since the first request.
3490 ///
3491 /// For example, consider a situation where you make an initial request and
3492 /// the request times out. If you make the request again with the same request
3493 /// ID, the server can check if original operation with the same request ID
3494 /// was received, and if so, will ignore the second request. This prevents
3495 /// clients from accidentally creating duplicate commitments.
3496 ///
3497 /// The request ID must be a valid UUID with the exception that zero UUID is
3498 /// not supported (00000000-0000-0000-0000-000000000000).
3499 pub request_id: std::string::String,
3500
3501 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3502}
3503
3504impl CreateServiceConnectionPolicyRequest {
3505 /// Creates a new default instance.
3506 pub fn new() -> Self {
3507 std::default::Default::default()
3508 }
3509
3510 /// Sets the value of [parent][crate::model::CreateServiceConnectionPolicyRequest::parent].
3511 ///
3512 /// # Example
3513 /// ```ignore,no_run
3514 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3515 /// # let project_id = "project_id";
3516 /// # let location_id = "location_id";
3517 /// let x = CreateServiceConnectionPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3518 /// ```
3519 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3520 self.parent = v.into();
3521 self
3522 }
3523
3524 /// Sets the value of [service_connection_policy_id][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy_id].
3525 ///
3526 /// # Example
3527 /// ```ignore,no_run
3528 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3529 /// let x = CreateServiceConnectionPolicyRequest::new().set_service_connection_policy_id("example");
3530 /// ```
3531 pub fn set_service_connection_policy_id<T: std::convert::Into<std::string::String>>(
3532 mut self,
3533 v: T,
3534 ) -> Self {
3535 self.service_connection_policy_id = v.into();
3536 self
3537 }
3538
3539 /// Sets the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
3540 ///
3541 /// # Example
3542 /// ```ignore,no_run
3543 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3544 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3545 /// let x = CreateServiceConnectionPolicyRequest::new().set_service_connection_policy(ServiceConnectionPolicy::default()/* use setters */);
3546 /// ```
3547 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
3548 where
3549 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3550 {
3551 self.service_connection_policy = std::option::Option::Some(v.into());
3552 self
3553 }
3554
3555 /// Sets or clears the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
3556 ///
3557 /// # Example
3558 /// ```ignore,no_run
3559 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3560 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3561 /// let x = CreateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(Some(ServiceConnectionPolicy::default()/* use setters */));
3562 /// let x = CreateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(None::<ServiceConnectionPolicy>);
3563 /// ```
3564 pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
3565 where
3566 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3567 {
3568 self.service_connection_policy = v.map(|x| x.into());
3569 self
3570 }
3571
3572 /// Sets the value of [request_id][crate::model::CreateServiceConnectionPolicyRequest::request_id].
3573 ///
3574 /// # Example
3575 /// ```ignore,no_run
3576 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionPolicyRequest;
3577 /// let x = CreateServiceConnectionPolicyRequest::new().set_request_id("example");
3578 /// ```
3579 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3580 self.request_id = v.into();
3581 self
3582 }
3583}
3584
3585impl wkt::message::Message for CreateServiceConnectionPolicyRequest {
3586 fn typename() -> &'static str {
3587 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionPolicyRequest"
3588 }
3589}
3590
3591/// Request for UpdateServiceConnectionPolicy.
3592#[derive(Clone, Default, PartialEq)]
3593#[non_exhaustive]
3594pub struct UpdateServiceConnectionPolicyRequest {
3595 /// Optional. Field mask is used to specify the fields to be overwritten in the
3596 /// ServiceConnectionPolicy resource by the update.
3597 /// The fields specified in the update_mask are relative to the resource, not
3598 /// the full request. A field will be overwritten if it is in the mask. If the
3599 /// user does not provide a mask then all fields will be overwritten.
3600 pub update_mask: std::option::Option<wkt::FieldMask>,
3601
3602 /// Required. New values to be patched into the resource.
3603 pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
3604
3605 /// Optional. An optional request ID to identify requests. Specify a unique
3606 /// request ID so that if you must retry your request, the server will know to
3607 /// ignore the request if it has already been completed. The server will
3608 /// guarantee that for at least 60 minutes since the first request.
3609 ///
3610 /// For example, consider a situation where you make an initial request and
3611 /// the request times out. If you make the request again with the same request
3612 /// ID, the server can check if original operation with the same request ID
3613 /// was received, and if so, will ignore the second request. This prevents
3614 /// clients from accidentally creating duplicate commitments.
3615 ///
3616 /// The request ID must be a valid UUID with the exception that zero UUID is
3617 /// not supported (00000000-0000-0000-0000-000000000000).
3618 pub request_id: std::string::String,
3619
3620 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3621}
3622
3623impl UpdateServiceConnectionPolicyRequest {
3624 /// Creates a new default instance.
3625 pub fn new() -> Self {
3626 std::default::Default::default()
3627 }
3628
3629 /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
3630 ///
3631 /// # Example
3632 /// ```ignore,no_run
3633 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3634 /// use wkt::FieldMask;
3635 /// let x = UpdateServiceConnectionPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3636 /// ```
3637 pub fn set_update_mask<T>(mut self, v: T) -> Self
3638 where
3639 T: std::convert::Into<wkt::FieldMask>,
3640 {
3641 self.update_mask = std::option::Option::Some(v.into());
3642 self
3643 }
3644
3645 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
3646 ///
3647 /// # Example
3648 /// ```ignore,no_run
3649 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3650 /// use wkt::FieldMask;
3651 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3652 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3653 /// ```
3654 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3655 where
3656 T: std::convert::Into<wkt::FieldMask>,
3657 {
3658 self.update_mask = v.map(|x| x.into());
3659 self
3660 }
3661
3662 /// Sets the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
3663 ///
3664 /// # Example
3665 /// ```ignore,no_run
3666 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3667 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3668 /// let x = UpdateServiceConnectionPolicyRequest::new().set_service_connection_policy(ServiceConnectionPolicy::default()/* use setters */);
3669 /// ```
3670 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
3671 where
3672 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3673 {
3674 self.service_connection_policy = std::option::Option::Some(v.into());
3675 self
3676 }
3677
3678 /// Sets or clears the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
3679 ///
3680 /// # Example
3681 /// ```ignore,no_run
3682 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3683 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionPolicy;
3684 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(Some(ServiceConnectionPolicy::default()/* use setters */));
3685 /// let x = UpdateServiceConnectionPolicyRequest::new().set_or_clear_service_connection_policy(None::<ServiceConnectionPolicy>);
3686 /// ```
3687 pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
3688 where
3689 T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
3690 {
3691 self.service_connection_policy = v.map(|x| x.into());
3692 self
3693 }
3694
3695 /// Sets the value of [request_id][crate::model::UpdateServiceConnectionPolicyRequest::request_id].
3696 ///
3697 /// # Example
3698 /// ```ignore,no_run
3699 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceConnectionPolicyRequest;
3700 /// let x = UpdateServiceConnectionPolicyRequest::new().set_request_id("example");
3701 /// ```
3702 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3703 self.request_id = v.into();
3704 self
3705 }
3706}
3707
3708impl wkt::message::Message for UpdateServiceConnectionPolicyRequest {
3709 fn typename() -> &'static str {
3710 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionPolicyRequest"
3711 }
3712}
3713
3714/// Request for DeleteServiceConnectionPolicy.
3715#[derive(Clone, Default, PartialEq)]
3716#[non_exhaustive]
3717pub struct DeleteServiceConnectionPolicyRequest {
3718 /// Required. The name of the ServiceConnectionPolicy to delete.
3719 pub name: std::string::String,
3720
3721 /// Optional. An optional request ID to identify requests. Specify a unique
3722 /// request ID so that if you must retry your request, the server will know to
3723 /// ignore the request if it has already been completed. The server will
3724 /// guarantee that for at least 60 minutes after the first request.
3725 ///
3726 /// For example, consider a situation where you make an initial request and
3727 /// the request times out. If you make the request again with the same request
3728 /// ID, the server can check if original operation with the same request ID
3729 /// was received, and if so, will ignore the second request. This prevents
3730 /// clients from accidentally creating duplicate commitments.
3731 ///
3732 /// The request ID must be a valid UUID with the exception that zero UUID is
3733 /// not supported (00000000-0000-0000-0000-000000000000).
3734 pub request_id: std::string::String,
3735
3736 /// Optional. The etag is computed by the server, and may be sent on update and
3737 /// delete requests to ensure the client has an up-to-date value before
3738 /// proceeding.
3739 pub etag: std::option::Option<std::string::String>,
3740
3741 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3742}
3743
3744impl DeleteServiceConnectionPolicyRequest {
3745 /// Creates a new default instance.
3746 pub fn new() -> Self {
3747 std::default::Default::default()
3748 }
3749
3750 /// Sets the value of [name][crate::model::DeleteServiceConnectionPolicyRequest::name].
3751 ///
3752 /// # Example
3753 /// ```ignore,no_run
3754 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3755 /// # let project_id = "project_id";
3756 /// # let location_id = "location_id";
3757 /// # let service_connection_policy_id = "service_connection_policy_id";
3758 /// let x = DeleteServiceConnectionPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionPolicies/{service_connection_policy_id}"));
3759 /// ```
3760 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3761 self.name = v.into();
3762 self
3763 }
3764
3765 /// Sets the value of [request_id][crate::model::DeleteServiceConnectionPolicyRequest::request_id].
3766 ///
3767 /// # Example
3768 /// ```ignore,no_run
3769 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3770 /// let x = DeleteServiceConnectionPolicyRequest::new().set_request_id("example");
3771 /// ```
3772 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3773 self.request_id = v.into();
3774 self
3775 }
3776
3777 /// Sets the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
3778 ///
3779 /// # Example
3780 /// ```ignore,no_run
3781 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3782 /// let x = DeleteServiceConnectionPolicyRequest::new().set_etag("example");
3783 /// ```
3784 pub fn set_etag<T>(mut self, v: T) -> Self
3785 where
3786 T: std::convert::Into<std::string::String>,
3787 {
3788 self.etag = std::option::Option::Some(v.into());
3789 self
3790 }
3791
3792 /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
3793 ///
3794 /// # Example
3795 /// ```ignore,no_run
3796 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionPolicyRequest;
3797 /// let x = DeleteServiceConnectionPolicyRequest::new().set_or_clear_etag(Some("example"));
3798 /// let x = DeleteServiceConnectionPolicyRequest::new().set_or_clear_etag(None::<String>);
3799 /// ```
3800 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
3801 where
3802 T: std::convert::Into<std::string::String>,
3803 {
3804 self.etag = v.map(|x| x.into());
3805 self
3806 }
3807}
3808
3809impl wkt::message::Message for DeleteServiceConnectionPolicyRequest {
3810 fn typename() -> &'static str {
3811 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionPolicyRequest"
3812 }
3813}
3814
3815/// The ServiceClass resource.
3816#[derive(Clone, Default, PartialEq)]
3817#[non_exhaustive]
3818pub struct ServiceClass {
3819 /// Immutable. The name of a ServiceClass resource.
3820 /// Format:
3821 /// projects/{project}/locations/{location}/serviceClasses/{service_class}
3822 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
3823 pub name: std::string::String,
3824
3825 /// Output only. The generated service class name. Use this name to refer to
3826 /// the Service class in Service Connection Maps and Service Connection
3827 /// Policies.
3828 pub service_class: std::string::String,
3829
3830 /// Output only. Time when the ServiceClass was created.
3831 pub create_time: std::option::Option<wkt::Timestamp>,
3832
3833 /// Output only. Time when the ServiceClass was updated.
3834 pub update_time: std::option::Option<wkt::Timestamp>,
3835
3836 /// User-defined labels.
3837 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3838
3839 /// A description of this resource.
3840 pub description: std::string::String,
3841
3842 /// Optional. The etag is computed by the server, and may be sent on update and
3843 /// delete requests to ensure the client has an up-to-date value before
3844 /// proceeding.
3845 pub etag: std::option::Option<std::string::String>,
3846
3847 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3848}
3849
3850impl ServiceClass {
3851 /// Creates a new default instance.
3852 pub fn new() -> Self {
3853 std::default::Default::default()
3854 }
3855
3856 /// Sets the value of [name][crate::model::ServiceClass::name].
3857 ///
3858 /// # Example
3859 /// ```ignore,no_run
3860 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3861 /// # let project_id = "project_id";
3862 /// # let location_id = "location_id";
3863 /// # let service_class_id = "service_class_id";
3864 /// let x = ServiceClass::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceClasses/{service_class_id}"));
3865 /// ```
3866 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3867 self.name = v.into();
3868 self
3869 }
3870
3871 /// Sets the value of [service_class][crate::model::ServiceClass::service_class].
3872 ///
3873 /// # Example
3874 /// ```ignore,no_run
3875 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3876 /// let x = ServiceClass::new().set_service_class("example");
3877 /// ```
3878 pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3879 self.service_class = v.into();
3880 self
3881 }
3882
3883 /// Sets the value of [create_time][crate::model::ServiceClass::create_time].
3884 ///
3885 /// # Example
3886 /// ```ignore,no_run
3887 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3888 /// use wkt::Timestamp;
3889 /// let x = ServiceClass::new().set_create_time(Timestamp::default()/* use setters */);
3890 /// ```
3891 pub fn set_create_time<T>(mut self, v: T) -> Self
3892 where
3893 T: std::convert::Into<wkt::Timestamp>,
3894 {
3895 self.create_time = std::option::Option::Some(v.into());
3896 self
3897 }
3898
3899 /// Sets or clears the value of [create_time][crate::model::ServiceClass::create_time].
3900 ///
3901 /// # Example
3902 /// ```ignore,no_run
3903 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3904 /// use wkt::Timestamp;
3905 /// let x = ServiceClass::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3906 /// let x = ServiceClass::new().set_or_clear_create_time(None::<Timestamp>);
3907 /// ```
3908 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3909 where
3910 T: std::convert::Into<wkt::Timestamp>,
3911 {
3912 self.create_time = v.map(|x| x.into());
3913 self
3914 }
3915
3916 /// Sets the value of [update_time][crate::model::ServiceClass::update_time].
3917 ///
3918 /// # Example
3919 /// ```ignore,no_run
3920 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3921 /// use wkt::Timestamp;
3922 /// let x = ServiceClass::new().set_update_time(Timestamp::default()/* use setters */);
3923 /// ```
3924 pub fn set_update_time<T>(mut self, v: T) -> Self
3925 where
3926 T: std::convert::Into<wkt::Timestamp>,
3927 {
3928 self.update_time = std::option::Option::Some(v.into());
3929 self
3930 }
3931
3932 /// Sets or clears the value of [update_time][crate::model::ServiceClass::update_time].
3933 ///
3934 /// # Example
3935 /// ```ignore,no_run
3936 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3937 /// use wkt::Timestamp;
3938 /// let x = ServiceClass::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3939 /// let x = ServiceClass::new().set_or_clear_update_time(None::<Timestamp>);
3940 /// ```
3941 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3942 where
3943 T: std::convert::Into<wkt::Timestamp>,
3944 {
3945 self.update_time = v.map(|x| x.into());
3946 self
3947 }
3948
3949 /// Sets the value of [labels][crate::model::ServiceClass::labels].
3950 ///
3951 /// # Example
3952 /// ```ignore,no_run
3953 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3954 /// let x = ServiceClass::new().set_labels([
3955 /// ("key0", "abc"),
3956 /// ("key1", "xyz"),
3957 /// ]);
3958 /// ```
3959 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3960 where
3961 T: std::iter::IntoIterator<Item = (K, V)>,
3962 K: std::convert::Into<std::string::String>,
3963 V: std::convert::Into<std::string::String>,
3964 {
3965 use std::iter::Iterator;
3966 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3967 self
3968 }
3969
3970 /// Sets the value of [description][crate::model::ServiceClass::description].
3971 ///
3972 /// # Example
3973 /// ```ignore,no_run
3974 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3975 /// let x = ServiceClass::new().set_description("example");
3976 /// ```
3977 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3978 self.description = v.into();
3979 self
3980 }
3981
3982 /// Sets the value of [etag][crate::model::ServiceClass::etag].
3983 ///
3984 /// # Example
3985 /// ```ignore,no_run
3986 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
3987 /// let x = ServiceClass::new().set_etag("example");
3988 /// ```
3989 pub fn set_etag<T>(mut self, v: T) -> Self
3990 where
3991 T: std::convert::Into<std::string::String>,
3992 {
3993 self.etag = std::option::Option::Some(v.into());
3994 self
3995 }
3996
3997 /// Sets or clears the value of [etag][crate::model::ServiceClass::etag].
3998 ///
3999 /// # Example
4000 /// ```ignore,no_run
4001 /// # use google_cloud_networkconnectivity_v1::model::ServiceClass;
4002 /// let x = ServiceClass::new().set_or_clear_etag(Some("example"));
4003 /// let x = ServiceClass::new().set_or_clear_etag(None::<String>);
4004 /// ```
4005 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
4006 where
4007 T: std::convert::Into<std::string::String>,
4008 {
4009 self.etag = v.map(|x| x.into());
4010 self
4011 }
4012}
4013
4014impl wkt::message::Message for ServiceClass {
4015 fn typename() -> &'static str {
4016 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceClass"
4017 }
4018}
4019
4020/// Request for ListServiceClasses.
4021#[derive(Clone, Default, PartialEq)]
4022#[non_exhaustive]
4023pub struct ListServiceClassesRequest {
4024 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
4025 pub parent: std::string::String,
4026
4027 /// The maximum number of results per page that should be returned.
4028 pub page_size: i32,
4029
4030 /// The page token.
4031 pub page_token: std::string::String,
4032
4033 /// A filter expression that filters the results listed in the response.
4034 pub filter: std::string::String,
4035
4036 /// Sort the results by a certain order.
4037 pub order_by: std::string::String,
4038
4039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4040}
4041
4042impl ListServiceClassesRequest {
4043 /// Creates a new default instance.
4044 pub fn new() -> Self {
4045 std::default::Default::default()
4046 }
4047
4048 /// Sets the value of [parent][crate::model::ListServiceClassesRequest::parent].
4049 ///
4050 /// # Example
4051 /// ```ignore,no_run
4052 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4053 /// let x = ListServiceClassesRequest::new().set_parent("example");
4054 /// ```
4055 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4056 self.parent = v.into();
4057 self
4058 }
4059
4060 /// Sets the value of [page_size][crate::model::ListServiceClassesRequest::page_size].
4061 ///
4062 /// # Example
4063 /// ```ignore,no_run
4064 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4065 /// let x = ListServiceClassesRequest::new().set_page_size(42);
4066 /// ```
4067 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4068 self.page_size = v.into();
4069 self
4070 }
4071
4072 /// Sets the value of [page_token][crate::model::ListServiceClassesRequest::page_token].
4073 ///
4074 /// # Example
4075 /// ```ignore,no_run
4076 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4077 /// let x = ListServiceClassesRequest::new().set_page_token("example");
4078 /// ```
4079 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4080 self.page_token = v.into();
4081 self
4082 }
4083
4084 /// Sets the value of [filter][crate::model::ListServiceClassesRequest::filter].
4085 ///
4086 /// # Example
4087 /// ```ignore,no_run
4088 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4089 /// let x = ListServiceClassesRequest::new().set_filter("example");
4090 /// ```
4091 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4092 self.filter = v.into();
4093 self
4094 }
4095
4096 /// Sets the value of [order_by][crate::model::ListServiceClassesRequest::order_by].
4097 ///
4098 /// # Example
4099 /// ```ignore,no_run
4100 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesRequest;
4101 /// let x = ListServiceClassesRequest::new().set_order_by("example");
4102 /// ```
4103 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4104 self.order_by = v.into();
4105 self
4106 }
4107}
4108
4109impl wkt::message::Message for ListServiceClassesRequest {
4110 fn typename() -> &'static str {
4111 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesRequest"
4112 }
4113}
4114
4115/// Response for ListServiceClasses.
4116#[derive(Clone, Default, PartialEq)]
4117#[non_exhaustive]
4118pub struct ListServiceClassesResponse {
4119 /// ServiceClasses to be returned.
4120 pub service_classes: std::vec::Vec<crate::model::ServiceClass>,
4121
4122 /// The next pagination token in the List response. It should be used as
4123 /// page_token for the following request. An empty value means no more result.
4124 pub next_page_token: std::string::String,
4125
4126 /// Locations that could not be reached.
4127 pub unreachable: std::vec::Vec<std::string::String>,
4128
4129 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4130}
4131
4132impl ListServiceClassesResponse {
4133 /// Creates a new default instance.
4134 pub fn new() -> Self {
4135 std::default::Default::default()
4136 }
4137
4138 /// Sets the value of [service_classes][crate::model::ListServiceClassesResponse::service_classes].
4139 ///
4140 /// # Example
4141 /// ```ignore,no_run
4142 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesResponse;
4143 /// use google_cloud_networkconnectivity_v1::model::ServiceClass;
4144 /// let x = ListServiceClassesResponse::new()
4145 /// .set_service_classes([
4146 /// ServiceClass::default()/* use setters */,
4147 /// ServiceClass::default()/* use (different) setters */,
4148 /// ]);
4149 /// ```
4150 pub fn set_service_classes<T, V>(mut self, v: T) -> Self
4151 where
4152 T: std::iter::IntoIterator<Item = V>,
4153 V: std::convert::Into<crate::model::ServiceClass>,
4154 {
4155 use std::iter::Iterator;
4156 self.service_classes = v.into_iter().map(|i| i.into()).collect();
4157 self
4158 }
4159
4160 /// Sets the value of [next_page_token][crate::model::ListServiceClassesResponse::next_page_token].
4161 ///
4162 /// # Example
4163 /// ```ignore,no_run
4164 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesResponse;
4165 /// let x = ListServiceClassesResponse::new().set_next_page_token("example");
4166 /// ```
4167 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4168 self.next_page_token = v.into();
4169 self
4170 }
4171
4172 /// Sets the value of [unreachable][crate::model::ListServiceClassesResponse::unreachable].
4173 ///
4174 /// # Example
4175 /// ```ignore,no_run
4176 /// # use google_cloud_networkconnectivity_v1::model::ListServiceClassesResponse;
4177 /// let x = ListServiceClassesResponse::new().set_unreachable(["a", "b", "c"]);
4178 /// ```
4179 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4180 where
4181 T: std::iter::IntoIterator<Item = V>,
4182 V: std::convert::Into<std::string::String>,
4183 {
4184 use std::iter::Iterator;
4185 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4186 self
4187 }
4188}
4189
4190impl wkt::message::Message for ListServiceClassesResponse {
4191 fn typename() -> &'static str {
4192 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesResponse"
4193 }
4194}
4195
4196#[doc(hidden)]
4197impl google_cloud_gax::paginator::internal::PageableResponse for ListServiceClassesResponse {
4198 type PageItem = crate::model::ServiceClass;
4199
4200 fn items(self) -> std::vec::Vec<Self::PageItem> {
4201 self.service_classes
4202 }
4203
4204 fn next_page_token(&self) -> std::string::String {
4205 use std::clone::Clone;
4206 self.next_page_token.clone()
4207 }
4208}
4209
4210/// Request for GetServiceClass.
4211#[derive(Clone, Default, PartialEq)]
4212#[non_exhaustive]
4213pub struct GetServiceClassRequest {
4214 /// Required. Name of the ServiceClass to get.
4215 pub name: std::string::String,
4216
4217 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4218}
4219
4220impl GetServiceClassRequest {
4221 /// Creates a new default instance.
4222 pub fn new() -> Self {
4223 std::default::Default::default()
4224 }
4225
4226 /// Sets the value of [name][crate::model::GetServiceClassRequest::name].
4227 ///
4228 /// # Example
4229 /// ```ignore,no_run
4230 /// # use google_cloud_networkconnectivity_v1::model::GetServiceClassRequest;
4231 /// # let project_id = "project_id";
4232 /// # let location_id = "location_id";
4233 /// # let service_class_id = "service_class_id";
4234 /// let x = GetServiceClassRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceClasses/{service_class_id}"));
4235 /// ```
4236 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4237 self.name = v.into();
4238 self
4239 }
4240}
4241
4242impl wkt::message::Message for GetServiceClassRequest {
4243 fn typename() -> &'static str {
4244 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceClassRequest"
4245 }
4246}
4247
4248/// Request for UpdateServiceClass.
4249#[derive(Clone, Default, PartialEq)]
4250#[non_exhaustive]
4251pub struct UpdateServiceClassRequest {
4252 /// Optional. Field mask is used to specify the fields to be overwritten in the
4253 /// ServiceClass resource by the update.
4254 /// The fields specified in the update_mask are relative to the resource, not
4255 /// the full request. A field will be overwritten if it is in the mask. If the
4256 /// user does not provide a mask then all fields will be overwritten.
4257 pub update_mask: std::option::Option<wkt::FieldMask>,
4258
4259 /// Required. New values to be patched into the resource.
4260 pub service_class: std::option::Option<crate::model::ServiceClass>,
4261
4262 /// Optional. An optional request ID to identify requests. Specify a unique
4263 /// request ID so that if you must retry your request, the server will know to
4264 /// ignore the request if it has already been completed. The server will
4265 /// guarantee that for at least 60 minutes since the first request.
4266 ///
4267 /// For example, consider a situation where you make an initial request and
4268 /// the request times out. If you make the request again with the same request
4269 /// ID, the server can check if original operation with the same request ID
4270 /// was received, and if so, will ignore the second request. This prevents
4271 /// clients from accidentally creating duplicate commitments.
4272 ///
4273 /// The request ID must be a valid UUID with the exception that zero UUID is
4274 /// not supported (00000000-0000-0000-0000-000000000000).
4275 pub request_id: std::string::String,
4276
4277 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4278}
4279
4280impl UpdateServiceClassRequest {
4281 /// Creates a new default instance.
4282 pub fn new() -> Self {
4283 std::default::Default::default()
4284 }
4285
4286 /// Sets the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
4287 ///
4288 /// # Example
4289 /// ```ignore,no_run
4290 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4291 /// use wkt::FieldMask;
4292 /// let x = UpdateServiceClassRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4293 /// ```
4294 pub fn set_update_mask<T>(mut self, v: T) -> Self
4295 where
4296 T: std::convert::Into<wkt::FieldMask>,
4297 {
4298 self.update_mask = std::option::Option::Some(v.into());
4299 self
4300 }
4301
4302 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
4303 ///
4304 /// # Example
4305 /// ```ignore,no_run
4306 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4307 /// use wkt::FieldMask;
4308 /// let x = UpdateServiceClassRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4309 /// let x = UpdateServiceClassRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4310 /// ```
4311 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4312 where
4313 T: std::convert::Into<wkt::FieldMask>,
4314 {
4315 self.update_mask = v.map(|x| x.into());
4316 self
4317 }
4318
4319 /// Sets the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
4320 ///
4321 /// # Example
4322 /// ```ignore,no_run
4323 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4324 /// use google_cloud_networkconnectivity_v1::model::ServiceClass;
4325 /// let x = UpdateServiceClassRequest::new().set_service_class(ServiceClass::default()/* use setters */);
4326 /// ```
4327 pub fn set_service_class<T>(mut self, v: T) -> Self
4328 where
4329 T: std::convert::Into<crate::model::ServiceClass>,
4330 {
4331 self.service_class = std::option::Option::Some(v.into());
4332 self
4333 }
4334
4335 /// Sets or clears the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
4336 ///
4337 /// # Example
4338 /// ```ignore,no_run
4339 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4340 /// use google_cloud_networkconnectivity_v1::model::ServiceClass;
4341 /// let x = UpdateServiceClassRequest::new().set_or_clear_service_class(Some(ServiceClass::default()/* use setters */));
4342 /// let x = UpdateServiceClassRequest::new().set_or_clear_service_class(None::<ServiceClass>);
4343 /// ```
4344 pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
4345 where
4346 T: std::convert::Into<crate::model::ServiceClass>,
4347 {
4348 self.service_class = v.map(|x| x.into());
4349 self
4350 }
4351
4352 /// Sets the value of [request_id][crate::model::UpdateServiceClassRequest::request_id].
4353 ///
4354 /// # Example
4355 /// ```ignore,no_run
4356 /// # use google_cloud_networkconnectivity_v1::model::UpdateServiceClassRequest;
4357 /// let x = UpdateServiceClassRequest::new().set_request_id("example");
4358 /// ```
4359 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4360 self.request_id = v.into();
4361 self
4362 }
4363}
4364
4365impl wkt::message::Message for UpdateServiceClassRequest {
4366 fn typename() -> &'static str {
4367 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceClassRequest"
4368 }
4369}
4370
4371/// Request for DeleteServiceClass.
4372#[derive(Clone, Default, PartialEq)]
4373#[non_exhaustive]
4374pub struct DeleteServiceClassRequest {
4375 /// Required. The name of the ServiceClass to delete.
4376 pub name: std::string::String,
4377
4378 /// Optional. An optional request ID to identify requests. Specify a unique
4379 /// request ID so that if you must retry your request, the server will know to
4380 /// ignore the request if it has already been completed. The server will
4381 /// guarantee that for at least 60 minutes after the first request.
4382 ///
4383 /// For example, consider a situation where you make an initial request and
4384 /// the request times out. If you make the request again with the same request
4385 /// ID, the server can check if original operation with the same request ID
4386 /// was received, and if so, will ignore the second request. This prevents
4387 /// clients from accidentally creating duplicate commitments.
4388 ///
4389 /// The request ID must be a valid UUID with the exception that zero UUID is
4390 /// not supported (00000000-0000-0000-0000-000000000000).
4391 pub request_id: std::string::String,
4392
4393 /// Optional. The etag is computed by the server, and may be sent on update and
4394 /// delete requests to ensure the client has an up-to-date value before
4395 /// proceeding.
4396 pub etag: std::option::Option<std::string::String>,
4397
4398 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4399}
4400
4401impl DeleteServiceClassRequest {
4402 /// Creates a new default instance.
4403 pub fn new() -> Self {
4404 std::default::Default::default()
4405 }
4406
4407 /// Sets the value of [name][crate::model::DeleteServiceClassRequest::name].
4408 ///
4409 /// # Example
4410 /// ```ignore,no_run
4411 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4412 /// # let project_id = "project_id";
4413 /// # let location_id = "location_id";
4414 /// # let service_class_id = "service_class_id";
4415 /// let x = DeleteServiceClassRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceClasses/{service_class_id}"));
4416 /// ```
4417 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4418 self.name = v.into();
4419 self
4420 }
4421
4422 /// Sets the value of [request_id][crate::model::DeleteServiceClassRequest::request_id].
4423 ///
4424 /// # Example
4425 /// ```ignore,no_run
4426 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4427 /// let x = DeleteServiceClassRequest::new().set_request_id("example");
4428 /// ```
4429 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4430 self.request_id = v.into();
4431 self
4432 }
4433
4434 /// Sets the value of [etag][crate::model::DeleteServiceClassRequest::etag].
4435 ///
4436 /// # Example
4437 /// ```ignore,no_run
4438 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4439 /// let x = DeleteServiceClassRequest::new().set_etag("example");
4440 /// ```
4441 pub fn set_etag<T>(mut self, v: T) -> Self
4442 where
4443 T: std::convert::Into<std::string::String>,
4444 {
4445 self.etag = std::option::Option::Some(v.into());
4446 self
4447 }
4448
4449 /// Sets or clears the value of [etag][crate::model::DeleteServiceClassRequest::etag].
4450 ///
4451 /// # Example
4452 /// ```ignore,no_run
4453 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceClassRequest;
4454 /// let x = DeleteServiceClassRequest::new().set_or_clear_etag(Some("example"));
4455 /// let x = DeleteServiceClassRequest::new().set_or_clear_etag(None::<String>);
4456 /// ```
4457 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
4458 where
4459 T: std::convert::Into<std::string::String>,
4460 {
4461 self.etag = v.map(|x| x.into());
4462 self
4463 }
4464}
4465
4466impl wkt::message::Message for DeleteServiceClassRequest {
4467 fn typename() -> &'static str {
4468 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceClassRequest"
4469 }
4470}
4471
4472/// The ServiceConnectionToken resource.
4473#[derive(Clone, Default, PartialEq)]
4474#[non_exhaustive]
4475pub struct ServiceConnectionToken {
4476 /// Immutable. The name of a ServiceConnectionToken.
4477 /// Format:
4478 /// projects/{project}/locations/{location}/ServiceConnectionTokens/{service_connection_token}
4479 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
4480 pub name: std::string::String,
4481
4482 /// Output only. Time when the ServiceConnectionToken was created.
4483 pub create_time: std::option::Option<wkt::Timestamp>,
4484
4485 /// Output only. Time when the ServiceConnectionToken was updated.
4486 pub update_time: std::option::Option<wkt::Timestamp>,
4487
4488 /// User-defined labels.
4489 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4490
4491 /// A description of this resource.
4492 pub description: std::string::String,
4493
4494 /// The resource path of the network associated with this token.
4495 /// Example:
4496 /// projects/{projectNumOrId}/global/networks/{resourceId}.
4497 pub network: std::string::String,
4498
4499 /// Output only. The token generated by Automation.
4500 pub token: std::string::String,
4501
4502 /// Output only. The time to which this token is valid.
4503 pub expire_time: std::option::Option<wkt::Timestamp>,
4504
4505 /// Optional. The etag is computed by the server, and may be sent on update and
4506 /// delete requests to ensure the client has an up-to-date value before
4507 /// proceeding.
4508 pub etag: std::option::Option<std::string::String>,
4509
4510 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4511}
4512
4513impl ServiceConnectionToken {
4514 /// Creates a new default instance.
4515 pub fn new() -> Self {
4516 std::default::Default::default()
4517 }
4518
4519 /// Sets the value of [name][crate::model::ServiceConnectionToken::name].
4520 ///
4521 /// # Example
4522 /// ```ignore,no_run
4523 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4524 /// # let project_id = "project_id";
4525 /// # let location_id = "location_id";
4526 /// # let service_connection_token_id = "service_connection_token_id";
4527 /// let x = ServiceConnectionToken::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionTokens/{service_connection_token_id}"));
4528 /// ```
4529 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4530 self.name = v.into();
4531 self
4532 }
4533
4534 /// Sets the value of [create_time][crate::model::ServiceConnectionToken::create_time].
4535 ///
4536 /// # Example
4537 /// ```ignore,no_run
4538 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4539 /// use wkt::Timestamp;
4540 /// let x = ServiceConnectionToken::new().set_create_time(Timestamp::default()/* use setters */);
4541 /// ```
4542 pub fn set_create_time<T>(mut self, v: T) -> Self
4543 where
4544 T: std::convert::Into<wkt::Timestamp>,
4545 {
4546 self.create_time = std::option::Option::Some(v.into());
4547 self
4548 }
4549
4550 /// Sets or clears the value of [create_time][crate::model::ServiceConnectionToken::create_time].
4551 ///
4552 /// # Example
4553 /// ```ignore,no_run
4554 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4555 /// use wkt::Timestamp;
4556 /// let x = ServiceConnectionToken::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4557 /// let x = ServiceConnectionToken::new().set_or_clear_create_time(None::<Timestamp>);
4558 /// ```
4559 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4560 where
4561 T: std::convert::Into<wkt::Timestamp>,
4562 {
4563 self.create_time = v.map(|x| x.into());
4564 self
4565 }
4566
4567 /// Sets the value of [update_time][crate::model::ServiceConnectionToken::update_time].
4568 ///
4569 /// # Example
4570 /// ```ignore,no_run
4571 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4572 /// use wkt::Timestamp;
4573 /// let x = ServiceConnectionToken::new().set_update_time(Timestamp::default()/* use setters */);
4574 /// ```
4575 pub fn set_update_time<T>(mut self, v: T) -> Self
4576 where
4577 T: std::convert::Into<wkt::Timestamp>,
4578 {
4579 self.update_time = std::option::Option::Some(v.into());
4580 self
4581 }
4582
4583 /// Sets or clears the value of [update_time][crate::model::ServiceConnectionToken::update_time].
4584 ///
4585 /// # Example
4586 /// ```ignore,no_run
4587 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4588 /// use wkt::Timestamp;
4589 /// let x = ServiceConnectionToken::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4590 /// let x = ServiceConnectionToken::new().set_or_clear_update_time(None::<Timestamp>);
4591 /// ```
4592 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4593 where
4594 T: std::convert::Into<wkt::Timestamp>,
4595 {
4596 self.update_time = v.map(|x| x.into());
4597 self
4598 }
4599
4600 /// Sets the value of [labels][crate::model::ServiceConnectionToken::labels].
4601 ///
4602 /// # Example
4603 /// ```ignore,no_run
4604 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4605 /// let x = ServiceConnectionToken::new().set_labels([
4606 /// ("key0", "abc"),
4607 /// ("key1", "xyz"),
4608 /// ]);
4609 /// ```
4610 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4611 where
4612 T: std::iter::IntoIterator<Item = (K, V)>,
4613 K: std::convert::Into<std::string::String>,
4614 V: std::convert::Into<std::string::String>,
4615 {
4616 use std::iter::Iterator;
4617 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4618 self
4619 }
4620
4621 /// Sets the value of [description][crate::model::ServiceConnectionToken::description].
4622 ///
4623 /// # Example
4624 /// ```ignore,no_run
4625 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4626 /// let x = ServiceConnectionToken::new().set_description("example");
4627 /// ```
4628 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4629 self.description = v.into();
4630 self
4631 }
4632
4633 /// Sets the value of [network][crate::model::ServiceConnectionToken::network].
4634 ///
4635 /// # Example
4636 /// ```ignore,no_run
4637 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4638 /// let x = ServiceConnectionToken::new().set_network("example");
4639 /// ```
4640 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4641 self.network = v.into();
4642 self
4643 }
4644
4645 /// Sets the value of [token][crate::model::ServiceConnectionToken::token].
4646 ///
4647 /// # Example
4648 /// ```ignore,no_run
4649 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4650 /// let x = ServiceConnectionToken::new().set_token("example");
4651 /// ```
4652 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4653 self.token = v.into();
4654 self
4655 }
4656
4657 /// Sets the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
4658 ///
4659 /// # Example
4660 /// ```ignore,no_run
4661 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4662 /// use wkt::Timestamp;
4663 /// let x = ServiceConnectionToken::new().set_expire_time(Timestamp::default()/* use setters */);
4664 /// ```
4665 pub fn set_expire_time<T>(mut self, v: T) -> Self
4666 where
4667 T: std::convert::Into<wkt::Timestamp>,
4668 {
4669 self.expire_time = std::option::Option::Some(v.into());
4670 self
4671 }
4672
4673 /// Sets or clears the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
4674 ///
4675 /// # Example
4676 /// ```ignore,no_run
4677 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4678 /// use wkt::Timestamp;
4679 /// let x = ServiceConnectionToken::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
4680 /// let x = ServiceConnectionToken::new().set_or_clear_expire_time(None::<Timestamp>);
4681 /// ```
4682 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
4683 where
4684 T: std::convert::Into<wkt::Timestamp>,
4685 {
4686 self.expire_time = v.map(|x| x.into());
4687 self
4688 }
4689
4690 /// Sets the value of [etag][crate::model::ServiceConnectionToken::etag].
4691 ///
4692 /// # Example
4693 /// ```ignore,no_run
4694 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4695 /// let x = ServiceConnectionToken::new().set_etag("example");
4696 /// ```
4697 pub fn set_etag<T>(mut self, v: T) -> Self
4698 where
4699 T: std::convert::Into<std::string::String>,
4700 {
4701 self.etag = std::option::Option::Some(v.into());
4702 self
4703 }
4704
4705 /// Sets or clears the value of [etag][crate::model::ServiceConnectionToken::etag].
4706 ///
4707 /// # Example
4708 /// ```ignore,no_run
4709 /// # use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4710 /// let x = ServiceConnectionToken::new().set_or_clear_etag(Some("example"));
4711 /// let x = ServiceConnectionToken::new().set_or_clear_etag(None::<String>);
4712 /// ```
4713 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
4714 where
4715 T: std::convert::Into<std::string::String>,
4716 {
4717 self.etag = v.map(|x| x.into());
4718 self
4719 }
4720}
4721
4722impl wkt::message::Message for ServiceConnectionToken {
4723 fn typename() -> &'static str {
4724 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionToken"
4725 }
4726}
4727
4728/// Request for ListServiceConnectionTokens.
4729#[derive(Clone, Default, PartialEq)]
4730#[non_exhaustive]
4731pub struct ListServiceConnectionTokensRequest {
4732 /// Required. The parent resource's name. ex. projects/123/locations/us-east1
4733 pub parent: std::string::String,
4734
4735 /// The maximum number of results per page that should be returned.
4736 pub page_size: i32,
4737
4738 /// The page token.
4739 pub page_token: std::string::String,
4740
4741 /// A filter expression that filters the results listed in the response.
4742 pub filter: std::string::String,
4743
4744 /// Sort the results by a certain order.
4745 pub order_by: std::string::String,
4746
4747 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4748}
4749
4750impl ListServiceConnectionTokensRequest {
4751 /// Creates a new default instance.
4752 pub fn new() -> Self {
4753 std::default::Default::default()
4754 }
4755
4756 /// Sets the value of [parent][crate::model::ListServiceConnectionTokensRequest::parent].
4757 ///
4758 /// # Example
4759 /// ```ignore,no_run
4760 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4761 /// let x = ListServiceConnectionTokensRequest::new().set_parent("example");
4762 /// ```
4763 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4764 self.parent = v.into();
4765 self
4766 }
4767
4768 /// Sets the value of [page_size][crate::model::ListServiceConnectionTokensRequest::page_size].
4769 ///
4770 /// # Example
4771 /// ```ignore,no_run
4772 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4773 /// let x = ListServiceConnectionTokensRequest::new().set_page_size(42);
4774 /// ```
4775 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4776 self.page_size = v.into();
4777 self
4778 }
4779
4780 /// Sets the value of [page_token][crate::model::ListServiceConnectionTokensRequest::page_token].
4781 ///
4782 /// # Example
4783 /// ```ignore,no_run
4784 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4785 /// let x = ListServiceConnectionTokensRequest::new().set_page_token("example");
4786 /// ```
4787 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4788 self.page_token = v.into();
4789 self
4790 }
4791
4792 /// Sets the value of [filter][crate::model::ListServiceConnectionTokensRequest::filter].
4793 ///
4794 /// # Example
4795 /// ```ignore,no_run
4796 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4797 /// let x = ListServiceConnectionTokensRequest::new().set_filter("example");
4798 /// ```
4799 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4800 self.filter = v.into();
4801 self
4802 }
4803
4804 /// Sets the value of [order_by][crate::model::ListServiceConnectionTokensRequest::order_by].
4805 ///
4806 /// # Example
4807 /// ```ignore,no_run
4808 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensRequest;
4809 /// let x = ListServiceConnectionTokensRequest::new().set_order_by("example");
4810 /// ```
4811 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4812 self.order_by = v.into();
4813 self
4814 }
4815}
4816
4817impl wkt::message::Message for ListServiceConnectionTokensRequest {
4818 fn typename() -> &'static str {
4819 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensRequest"
4820 }
4821}
4822
4823/// Response for ListServiceConnectionTokens.
4824#[derive(Clone, Default, PartialEq)]
4825#[non_exhaustive]
4826pub struct ListServiceConnectionTokensResponse {
4827 /// ServiceConnectionTokens to be returned.
4828 pub service_connection_tokens: std::vec::Vec<crate::model::ServiceConnectionToken>,
4829
4830 /// The next pagination token in the List response. It should be used as
4831 /// page_token for the following request. An empty value means no more result.
4832 pub next_page_token: std::string::String,
4833
4834 /// Locations that could not be reached.
4835 pub unreachable: std::vec::Vec<std::string::String>,
4836
4837 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4838}
4839
4840impl ListServiceConnectionTokensResponse {
4841 /// Creates a new default instance.
4842 pub fn new() -> Self {
4843 std::default::Default::default()
4844 }
4845
4846 /// Sets the value of [service_connection_tokens][crate::model::ListServiceConnectionTokensResponse::service_connection_tokens].
4847 ///
4848 /// # Example
4849 /// ```ignore,no_run
4850 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensResponse;
4851 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
4852 /// let x = ListServiceConnectionTokensResponse::new()
4853 /// .set_service_connection_tokens([
4854 /// ServiceConnectionToken::default()/* use setters */,
4855 /// ServiceConnectionToken::default()/* use (different) setters */,
4856 /// ]);
4857 /// ```
4858 pub fn set_service_connection_tokens<T, V>(mut self, v: T) -> Self
4859 where
4860 T: std::iter::IntoIterator<Item = V>,
4861 V: std::convert::Into<crate::model::ServiceConnectionToken>,
4862 {
4863 use std::iter::Iterator;
4864 self.service_connection_tokens = v.into_iter().map(|i| i.into()).collect();
4865 self
4866 }
4867
4868 /// Sets the value of [next_page_token][crate::model::ListServiceConnectionTokensResponse::next_page_token].
4869 ///
4870 /// # Example
4871 /// ```ignore,no_run
4872 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensResponse;
4873 /// let x = ListServiceConnectionTokensResponse::new().set_next_page_token("example");
4874 /// ```
4875 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4876 self.next_page_token = v.into();
4877 self
4878 }
4879
4880 /// Sets the value of [unreachable][crate::model::ListServiceConnectionTokensResponse::unreachable].
4881 ///
4882 /// # Example
4883 /// ```ignore,no_run
4884 /// # use google_cloud_networkconnectivity_v1::model::ListServiceConnectionTokensResponse;
4885 /// let x = ListServiceConnectionTokensResponse::new().set_unreachable(["a", "b", "c"]);
4886 /// ```
4887 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4888 where
4889 T: std::iter::IntoIterator<Item = V>,
4890 V: std::convert::Into<std::string::String>,
4891 {
4892 use std::iter::Iterator;
4893 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4894 self
4895 }
4896}
4897
4898impl wkt::message::Message for ListServiceConnectionTokensResponse {
4899 fn typename() -> &'static str {
4900 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensResponse"
4901 }
4902}
4903
4904#[doc(hidden)]
4905impl google_cloud_gax::paginator::internal::PageableResponse
4906 for ListServiceConnectionTokensResponse
4907{
4908 type PageItem = crate::model::ServiceConnectionToken;
4909
4910 fn items(self) -> std::vec::Vec<Self::PageItem> {
4911 self.service_connection_tokens
4912 }
4913
4914 fn next_page_token(&self) -> std::string::String {
4915 use std::clone::Clone;
4916 self.next_page_token.clone()
4917 }
4918}
4919
4920/// Request for GetServiceConnectionToken.
4921#[derive(Clone, Default, PartialEq)]
4922#[non_exhaustive]
4923pub struct GetServiceConnectionTokenRequest {
4924 /// Required. Name of the ServiceConnectionToken to get.
4925 pub name: std::string::String,
4926
4927 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4928}
4929
4930impl GetServiceConnectionTokenRequest {
4931 /// Creates a new default instance.
4932 pub fn new() -> Self {
4933 std::default::Default::default()
4934 }
4935
4936 /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
4937 ///
4938 /// # Example
4939 /// ```ignore,no_run
4940 /// # use google_cloud_networkconnectivity_v1::model::GetServiceConnectionTokenRequest;
4941 /// # let project_id = "project_id";
4942 /// # let location_id = "location_id";
4943 /// # let service_connection_token_id = "service_connection_token_id";
4944 /// let x = GetServiceConnectionTokenRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionTokens/{service_connection_token_id}"));
4945 /// ```
4946 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4947 self.name = v.into();
4948 self
4949 }
4950}
4951
4952impl wkt::message::Message for GetServiceConnectionTokenRequest {
4953 fn typename() -> &'static str {
4954 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionTokenRequest"
4955 }
4956}
4957
4958/// Request for CreateServiceConnectionToken.
4959#[derive(Clone, Default, PartialEq)]
4960#[non_exhaustive]
4961pub struct CreateServiceConnectionTokenRequest {
4962 /// Required. The parent resource's name of the ServiceConnectionToken. ex.
4963 /// projects/123/locations/us-east1
4964 pub parent: std::string::String,
4965
4966 /// Optional. Resource ID
4967 /// (i.e. 'foo' in '[...]/projects/p/locations/l/ServiceConnectionTokens/foo')
4968 /// See <https://google.aip.dev/122#resource-id-segments>
4969 /// Unique per location.
4970 /// If one is not provided, one will be generated.
4971 pub service_connection_token_id: std::string::String,
4972
4973 /// Required. Initial values for a new ServiceConnectionTokens
4974 pub service_connection_token: std::option::Option<crate::model::ServiceConnectionToken>,
4975
4976 /// Optional. An optional request ID to identify requests. Specify a unique
4977 /// request ID so that if you must retry your request, the server will know to
4978 /// ignore the request if it has already been completed. The server will
4979 /// guarantee that for at least 60 minutes since the first request.
4980 ///
4981 /// For example, consider a situation where you make an initial request and
4982 /// the request times out. If you make the request again with the same request
4983 /// ID, the server can check if original operation with the same request ID
4984 /// was received, and if so, will ignore the second request. This prevents
4985 /// clients from accidentally creating duplicate commitments.
4986 ///
4987 /// The request ID must be a valid UUID with the exception that zero UUID is
4988 /// not supported (00000000-0000-0000-0000-000000000000).
4989 pub request_id: std::string::String,
4990
4991 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4992}
4993
4994impl CreateServiceConnectionTokenRequest {
4995 /// Creates a new default instance.
4996 pub fn new() -> Self {
4997 std::default::Default::default()
4998 }
4999
5000 /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
5001 ///
5002 /// # Example
5003 /// ```ignore,no_run
5004 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
5005 /// # let project_id = "project_id";
5006 /// # let location_id = "location_id";
5007 /// let x = CreateServiceConnectionTokenRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5008 /// ```
5009 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5010 self.parent = v.into();
5011 self
5012 }
5013
5014 /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
5015 ///
5016 /// # Example
5017 /// ```ignore,no_run
5018 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
5019 /// let x = CreateServiceConnectionTokenRequest::new().set_service_connection_token_id("example");
5020 /// ```
5021 pub fn set_service_connection_token_id<T: std::convert::Into<std::string::String>>(
5022 mut self,
5023 v: T,
5024 ) -> Self {
5025 self.service_connection_token_id = v.into();
5026 self
5027 }
5028
5029 /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
5030 ///
5031 /// # Example
5032 /// ```ignore,no_run
5033 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
5034 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
5035 /// let x = CreateServiceConnectionTokenRequest::new().set_service_connection_token(ServiceConnectionToken::default()/* use setters */);
5036 /// ```
5037 pub fn set_service_connection_token<T>(mut self, v: T) -> Self
5038 where
5039 T: std::convert::Into<crate::model::ServiceConnectionToken>,
5040 {
5041 self.service_connection_token = std::option::Option::Some(v.into());
5042 self
5043 }
5044
5045 /// Sets or clears the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
5046 ///
5047 /// # Example
5048 /// ```ignore,no_run
5049 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
5050 /// use google_cloud_networkconnectivity_v1::model::ServiceConnectionToken;
5051 /// let x = CreateServiceConnectionTokenRequest::new().set_or_clear_service_connection_token(Some(ServiceConnectionToken::default()/* use setters */));
5052 /// let x = CreateServiceConnectionTokenRequest::new().set_or_clear_service_connection_token(None::<ServiceConnectionToken>);
5053 /// ```
5054 pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
5055 where
5056 T: std::convert::Into<crate::model::ServiceConnectionToken>,
5057 {
5058 self.service_connection_token = v.map(|x| x.into());
5059 self
5060 }
5061
5062 /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
5063 ///
5064 /// # Example
5065 /// ```ignore,no_run
5066 /// # use google_cloud_networkconnectivity_v1::model::CreateServiceConnectionTokenRequest;
5067 /// let x = CreateServiceConnectionTokenRequest::new().set_request_id("example");
5068 /// ```
5069 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5070 self.request_id = v.into();
5071 self
5072 }
5073}
5074
5075impl wkt::message::Message for CreateServiceConnectionTokenRequest {
5076 fn typename() -> &'static str {
5077 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionTokenRequest"
5078 }
5079}
5080
5081/// Request for DeleteServiceConnectionToken.
5082#[derive(Clone, Default, PartialEq)]
5083#[non_exhaustive]
5084pub struct DeleteServiceConnectionTokenRequest {
5085 /// Required. The name of the ServiceConnectionToken to delete.
5086 pub name: std::string::String,
5087
5088 /// Optional. An optional request ID to identify requests. Specify a unique
5089 /// request ID so that if you must retry your request, the server will know to
5090 /// ignore the request if it has already been completed. The server will
5091 /// guarantee that for at least 60 minutes after the first request.
5092 ///
5093 /// For example, consider a situation where you make an initial request and
5094 /// the request times out. If you make the request again with the same request
5095 /// ID, the server can check if original operation with the same request ID
5096 /// was received, and if so, will ignore the second request. This prevents
5097 /// clients from accidentally creating duplicate commitments.
5098 ///
5099 /// The request ID must be a valid UUID with the exception that zero UUID is
5100 /// not supported (00000000-0000-0000-0000-000000000000).
5101 pub request_id: std::string::String,
5102
5103 /// Optional. The etag is computed by the server, and may be sent on update and
5104 /// delete requests to ensure the client has an up-to-date value before
5105 /// proceeding.
5106 pub etag: std::option::Option<std::string::String>,
5107
5108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5109}
5110
5111impl DeleteServiceConnectionTokenRequest {
5112 /// Creates a new default instance.
5113 pub fn new() -> Self {
5114 std::default::Default::default()
5115 }
5116
5117 /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
5118 ///
5119 /// # Example
5120 /// ```ignore,no_run
5121 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5122 /// # let project_id = "project_id";
5123 /// # let location_id = "location_id";
5124 /// # let service_connection_token_id = "service_connection_token_id";
5125 /// let x = DeleteServiceConnectionTokenRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/serviceConnectionTokens/{service_connection_token_id}"));
5126 /// ```
5127 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5128 self.name = v.into();
5129 self
5130 }
5131
5132 /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
5133 ///
5134 /// # Example
5135 /// ```ignore,no_run
5136 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5137 /// let x = DeleteServiceConnectionTokenRequest::new().set_request_id("example");
5138 /// ```
5139 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5140 self.request_id = v.into();
5141 self
5142 }
5143
5144 /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
5145 ///
5146 /// # Example
5147 /// ```ignore,no_run
5148 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5149 /// let x = DeleteServiceConnectionTokenRequest::new().set_etag("example");
5150 /// ```
5151 pub fn set_etag<T>(mut self, v: T) -> Self
5152 where
5153 T: std::convert::Into<std::string::String>,
5154 {
5155 self.etag = std::option::Option::Some(v.into());
5156 self
5157 }
5158
5159 /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
5160 ///
5161 /// # Example
5162 /// ```ignore,no_run
5163 /// # use google_cloud_networkconnectivity_v1::model::DeleteServiceConnectionTokenRequest;
5164 /// let x = DeleteServiceConnectionTokenRequest::new().set_or_clear_etag(Some("example"));
5165 /// let x = DeleteServiceConnectionTokenRequest::new().set_or_clear_etag(None::<String>);
5166 /// ```
5167 pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
5168 where
5169 T: std::convert::Into<std::string::String>,
5170 {
5171 self.etag = v.map(|x| x.into());
5172 self
5173 }
5174}
5175
5176impl wkt::message::Message for DeleteServiceConnectionTokenRequest {
5177 fn typename() -> &'static str {
5178 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionTokenRequest"
5179 }
5180}
5181
5182/// The `MulticloudDataTransferConfig` resource. It lists the services that you
5183/// configure for Data Transfer Essentials billing and metering.
5184#[derive(Clone, Default, PartialEq)]
5185#[non_exhaustive]
5186pub struct MulticloudDataTransferConfig {
5187 /// Identifier. The name of the `MulticloudDataTransferConfig` resource.
5188 /// Format:
5189 /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}`.
5190 pub name: std::string::String,
5191
5192 /// Output only. Time when the `MulticloudDataTransferConfig` resource was
5193 /// created.
5194 pub create_time: std::option::Option<wkt::Timestamp>,
5195
5196 /// Output only. Time when the `MulticloudDataTransferConfig` resource was
5197 /// updated.
5198 pub update_time: std::option::Option<wkt::Timestamp>,
5199
5200 /// Optional. User-defined labels.
5201 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5202
5203 /// The etag is computed by the server, and might be sent with update and
5204 /// delete requests so that the client has an up-to-date value before
5205 /// proceeding.
5206 pub etag: std::string::String,
5207
5208 /// Optional. A description of this resource.
5209 pub description: std::string::String,
5210
5211 /// Output only. The number of `Destination` resources configured for the
5212 /// `MulticloudDataTransferConfig` resource.
5213 pub destinations_count: i32,
5214
5215 /// Output only. The number of `Destination` resources in use with the
5216 /// `MulticloudDataTransferConfig` resource.
5217 pub destinations_active_count: i32,
5218
5219 /// Optional. Maps services to their current or planned states. Service names
5220 /// are keys, and the associated values describe the state of the service. If a
5221 /// state change is expected, the value is either `ADDING` or `DELETING`,
5222 /// depending on the actions taken.
5223 ///
5224 /// Sample output:
5225 /// "services": {
5226 /// "big-query": {
5227 /// "states": [
5228 /// {
5229 /// "effectiveTime": "2024-12-12T08:00:00Z"
5230 /// "state": "ADDING",
5231 /// },
5232 /// ]
5233 /// },
5234 /// "cloud-storage": {
5235 /// "states": [
5236 /// {
5237 /// "state": "ACTIVE",
5238 /// }
5239 /// ]
5240 /// }
5241 /// }
5242 pub services: std::collections::HashMap<std::string::String, crate::model::StateTimeline>,
5243
5244 /// Output only. The Google-generated unique ID for the
5245 /// `MulticloudDataTransferConfig` resource. This value is unique across all
5246 /// `MulticloudDataTransferConfig` resources. If a resource is deleted and
5247 /// another with the same name is created, the new resource is assigned a
5248 /// different and unique ID.
5249 pub uid: std::string::String,
5250
5251 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5252}
5253
5254impl MulticloudDataTransferConfig {
5255 /// Creates a new default instance.
5256 pub fn new() -> Self {
5257 std::default::Default::default()
5258 }
5259
5260 /// Sets the value of [name][crate::model::MulticloudDataTransferConfig::name].
5261 ///
5262 /// # Example
5263 /// ```ignore,no_run
5264 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5265 /// # let project_id = "project_id";
5266 /// # let location_id = "location_id";
5267 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
5268 /// let x = MulticloudDataTransferConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}"));
5269 /// ```
5270 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5271 self.name = v.into();
5272 self
5273 }
5274
5275 /// Sets the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
5276 ///
5277 /// # Example
5278 /// ```ignore,no_run
5279 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5280 /// use wkt::Timestamp;
5281 /// let x = MulticloudDataTransferConfig::new().set_create_time(Timestamp::default()/* use setters */);
5282 /// ```
5283 pub fn set_create_time<T>(mut self, v: T) -> Self
5284 where
5285 T: std::convert::Into<wkt::Timestamp>,
5286 {
5287 self.create_time = std::option::Option::Some(v.into());
5288 self
5289 }
5290
5291 /// Sets or clears the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
5292 ///
5293 /// # Example
5294 /// ```ignore,no_run
5295 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5296 /// use wkt::Timestamp;
5297 /// let x = MulticloudDataTransferConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5298 /// let x = MulticloudDataTransferConfig::new().set_or_clear_create_time(None::<Timestamp>);
5299 /// ```
5300 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5301 where
5302 T: std::convert::Into<wkt::Timestamp>,
5303 {
5304 self.create_time = v.map(|x| x.into());
5305 self
5306 }
5307
5308 /// Sets the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
5309 ///
5310 /// # Example
5311 /// ```ignore,no_run
5312 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5313 /// use wkt::Timestamp;
5314 /// let x = MulticloudDataTransferConfig::new().set_update_time(Timestamp::default()/* use setters */);
5315 /// ```
5316 pub fn set_update_time<T>(mut self, v: T) -> Self
5317 where
5318 T: std::convert::Into<wkt::Timestamp>,
5319 {
5320 self.update_time = std::option::Option::Some(v.into());
5321 self
5322 }
5323
5324 /// Sets or clears the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
5325 ///
5326 /// # Example
5327 /// ```ignore,no_run
5328 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5329 /// use wkt::Timestamp;
5330 /// let x = MulticloudDataTransferConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5331 /// let x = MulticloudDataTransferConfig::new().set_or_clear_update_time(None::<Timestamp>);
5332 /// ```
5333 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5334 where
5335 T: std::convert::Into<wkt::Timestamp>,
5336 {
5337 self.update_time = v.map(|x| x.into());
5338 self
5339 }
5340
5341 /// Sets the value of [labels][crate::model::MulticloudDataTransferConfig::labels].
5342 ///
5343 /// # Example
5344 /// ```ignore,no_run
5345 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5346 /// let x = MulticloudDataTransferConfig::new().set_labels([
5347 /// ("key0", "abc"),
5348 /// ("key1", "xyz"),
5349 /// ]);
5350 /// ```
5351 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5352 where
5353 T: std::iter::IntoIterator<Item = (K, V)>,
5354 K: std::convert::Into<std::string::String>,
5355 V: std::convert::Into<std::string::String>,
5356 {
5357 use std::iter::Iterator;
5358 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5359 self
5360 }
5361
5362 /// Sets the value of [etag][crate::model::MulticloudDataTransferConfig::etag].
5363 ///
5364 /// # Example
5365 /// ```ignore,no_run
5366 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5367 /// let x = MulticloudDataTransferConfig::new().set_etag("example");
5368 /// ```
5369 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5370 self.etag = v.into();
5371 self
5372 }
5373
5374 /// Sets the value of [description][crate::model::MulticloudDataTransferConfig::description].
5375 ///
5376 /// # Example
5377 /// ```ignore,no_run
5378 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5379 /// let x = MulticloudDataTransferConfig::new().set_description("example");
5380 /// ```
5381 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5382 self.description = v.into();
5383 self
5384 }
5385
5386 /// Sets the value of [destinations_count][crate::model::MulticloudDataTransferConfig::destinations_count].
5387 ///
5388 /// # Example
5389 /// ```ignore,no_run
5390 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5391 /// let x = MulticloudDataTransferConfig::new().set_destinations_count(42);
5392 /// ```
5393 pub fn set_destinations_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5394 self.destinations_count = v.into();
5395 self
5396 }
5397
5398 /// Sets the value of [destinations_active_count][crate::model::MulticloudDataTransferConfig::destinations_active_count].
5399 ///
5400 /// # Example
5401 /// ```ignore,no_run
5402 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5403 /// let x = MulticloudDataTransferConfig::new().set_destinations_active_count(42);
5404 /// ```
5405 pub fn set_destinations_active_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5406 self.destinations_active_count = v.into();
5407 self
5408 }
5409
5410 /// Sets the value of [services][crate::model::MulticloudDataTransferConfig::services].
5411 ///
5412 /// # Example
5413 /// ```ignore,no_run
5414 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5415 /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
5416 /// let x = MulticloudDataTransferConfig::new().set_services([
5417 /// ("key0", StateTimeline::default()/* use setters */),
5418 /// ("key1", StateTimeline::default()/* use (different) setters */),
5419 /// ]);
5420 /// ```
5421 pub fn set_services<T, K, V>(mut self, v: T) -> Self
5422 where
5423 T: std::iter::IntoIterator<Item = (K, V)>,
5424 K: std::convert::Into<std::string::String>,
5425 V: std::convert::Into<crate::model::StateTimeline>,
5426 {
5427 use std::iter::Iterator;
5428 self.services = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5429 self
5430 }
5431
5432 /// Sets the value of [uid][crate::model::MulticloudDataTransferConfig::uid].
5433 ///
5434 /// # Example
5435 /// ```ignore,no_run
5436 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5437 /// let x = MulticloudDataTransferConfig::new().set_uid("example");
5438 /// ```
5439 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5440 self.uid = v.into();
5441 self
5442 }
5443}
5444
5445impl wkt::message::Message for MulticloudDataTransferConfig {
5446 fn typename() -> &'static str {
5447 "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferConfig"
5448 }
5449}
5450
5451/// Request message to list `MulticloudDataTransferConfig` resources.
5452#[derive(Clone, Default, PartialEq)]
5453#[non_exhaustive]
5454pub struct ListMulticloudDataTransferConfigsRequest {
5455 /// Required. The name of the parent resource.
5456 pub parent: std::string::String,
5457
5458 /// Optional. The maximum number of results listed per page.
5459 pub page_size: i32,
5460
5461 /// Optional. The page token.
5462 pub page_token: std::string::String,
5463
5464 /// Optional. An expression that filters the results listed in the response.
5465 pub filter: std::string::String,
5466
5467 /// Optional. The sort order of the results.
5468 pub order_by: std::string::String,
5469
5470 /// Optional. If `true`, allows partial responses for multi-regional aggregated
5471 /// list requests.
5472 pub return_partial_success: bool,
5473
5474 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5475}
5476
5477impl ListMulticloudDataTransferConfigsRequest {
5478 /// Creates a new default instance.
5479 pub fn new() -> Self {
5480 std::default::Default::default()
5481 }
5482
5483 /// Sets the value of [parent][crate::model::ListMulticloudDataTransferConfigsRequest::parent].
5484 ///
5485 /// # Example
5486 /// ```ignore,no_run
5487 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5488 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_parent("example");
5489 /// ```
5490 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5491 self.parent = v.into();
5492 self
5493 }
5494
5495 /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferConfigsRequest::page_size].
5496 ///
5497 /// # Example
5498 /// ```ignore,no_run
5499 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5500 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_page_size(42);
5501 /// ```
5502 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5503 self.page_size = v.into();
5504 self
5505 }
5506
5507 /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferConfigsRequest::page_token].
5508 ///
5509 /// # Example
5510 /// ```ignore,no_run
5511 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5512 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_page_token("example");
5513 /// ```
5514 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5515 self.page_token = v.into();
5516 self
5517 }
5518
5519 /// Sets the value of [filter][crate::model::ListMulticloudDataTransferConfigsRequest::filter].
5520 ///
5521 /// # Example
5522 /// ```ignore,no_run
5523 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5524 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_filter("example");
5525 /// ```
5526 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5527 self.filter = v.into();
5528 self
5529 }
5530
5531 /// Sets the value of [order_by][crate::model::ListMulticloudDataTransferConfigsRequest::order_by].
5532 ///
5533 /// # Example
5534 /// ```ignore,no_run
5535 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5536 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_order_by("example");
5537 /// ```
5538 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5539 self.order_by = v.into();
5540 self
5541 }
5542
5543 /// Sets the value of [return_partial_success][crate::model::ListMulticloudDataTransferConfigsRequest::return_partial_success].
5544 ///
5545 /// # Example
5546 /// ```ignore,no_run
5547 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsRequest;
5548 /// let x = ListMulticloudDataTransferConfigsRequest::new().set_return_partial_success(true);
5549 /// ```
5550 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5551 self.return_partial_success = v.into();
5552 self
5553 }
5554}
5555
5556impl wkt::message::Message for ListMulticloudDataTransferConfigsRequest {
5557 fn typename() -> &'static str {
5558 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsRequest"
5559 }
5560}
5561
5562/// Response message to list `MulticloudDataTransferConfig` resources.
5563#[derive(Clone, Default, PartialEq)]
5564#[non_exhaustive]
5565pub struct ListMulticloudDataTransferConfigsResponse {
5566 /// The list of `MulticloudDataTransferConfig` resources to be listed.
5567 pub multicloud_data_transfer_configs: std::vec::Vec<crate::model::MulticloudDataTransferConfig>,
5568
5569 /// The next page token.
5570 pub next_page_token: std::string::String,
5571
5572 /// Locations that could not be reached.
5573 pub unreachable: std::vec::Vec<std::string::String>,
5574
5575 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5576}
5577
5578impl ListMulticloudDataTransferConfigsResponse {
5579 /// Creates a new default instance.
5580 pub fn new() -> Self {
5581 std::default::Default::default()
5582 }
5583
5584 /// Sets the value of [multicloud_data_transfer_configs][crate::model::ListMulticloudDataTransferConfigsResponse::multicloud_data_transfer_configs].
5585 ///
5586 /// # Example
5587 /// ```ignore,no_run
5588 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5589 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5590 /// let x = ListMulticloudDataTransferConfigsResponse::new()
5591 /// .set_multicloud_data_transfer_configs([
5592 /// MulticloudDataTransferConfig::default()/* use setters */,
5593 /// MulticloudDataTransferConfig::default()/* use (different) setters */,
5594 /// ]);
5595 /// ```
5596 pub fn set_multicloud_data_transfer_configs<T, V>(mut self, v: T) -> Self
5597 where
5598 T: std::iter::IntoIterator<Item = V>,
5599 V: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5600 {
5601 use std::iter::Iterator;
5602 self.multicloud_data_transfer_configs = v.into_iter().map(|i| i.into()).collect();
5603 self
5604 }
5605
5606 /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferConfigsResponse::next_page_token].
5607 ///
5608 /// # Example
5609 /// ```ignore,no_run
5610 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5611 /// let x = ListMulticloudDataTransferConfigsResponse::new().set_next_page_token("example");
5612 /// ```
5613 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5614 self.next_page_token = v.into();
5615 self
5616 }
5617
5618 /// Sets the value of [unreachable][crate::model::ListMulticloudDataTransferConfigsResponse::unreachable].
5619 ///
5620 /// # Example
5621 /// ```ignore,no_run
5622 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferConfigsResponse;
5623 /// let x = ListMulticloudDataTransferConfigsResponse::new().set_unreachable(["a", "b", "c"]);
5624 /// ```
5625 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5626 where
5627 T: std::iter::IntoIterator<Item = V>,
5628 V: std::convert::Into<std::string::String>,
5629 {
5630 use std::iter::Iterator;
5631 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5632 self
5633 }
5634}
5635
5636impl wkt::message::Message for ListMulticloudDataTransferConfigsResponse {
5637 fn typename() -> &'static str {
5638 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsResponse"
5639 }
5640}
5641
5642#[doc(hidden)]
5643impl google_cloud_gax::paginator::internal::PageableResponse
5644 for ListMulticloudDataTransferConfigsResponse
5645{
5646 type PageItem = crate::model::MulticloudDataTransferConfig;
5647
5648 fn items(self) -> std::vec::Vec<Self::PageItem> {
5649 self.multicloud_data_transfer_configs
5650 }
5651
5652 fn next_page_token(&self) -> std::string::String {
5653 use std::clone::Clone;
5654 self.next_page_token.clone()
5655 }
5656}
5657
5658/// Request message to get the details of a `MulticloudDataTransferConfig`
5659/// resource.
5660#[derive(Clone, Default, PartialEq)]
5661#[non_exhaustive]
5662pub struct GetMulticloudDataTransferConfigRequest {
5663 /// Required. The name of the `MulticloudDataTransferConfig` resource to get.
5664 pub name: std::string::String,
5665
5666 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5667}
5668
5669impl GetMulticloudDataTransferConfigRequest {
5670 /// Creates a new default instance.
5671 pub fn new() -> Self {
5672 std::default::Default::default()
5673 }
5674
5675 /// Sets the value of [name][crate::model::GetMulticloudDataTransferConfigRequest::name].
5676 ///
5677 /// # Example
5678 /// ```ignore,no_run
5679 /// # use google_cloud_networkconnectivity_v1::model::GetMulticloudDataTransferConfigRequest;
5680 /// # let project_id = "project_id";
5681 /// # let location_id = "location_id";
5682 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
5683 /// let x = GetMulticloudDataTransferConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}"));
5684 /// ```
5685 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5686 self.name = v.into();
5687 self
5688 }
5689}
5690
5691impl wkt::message::Message for GetMulticloudDataTransferConfigRequest {
5692 fn typename() -> &'static str {
5693 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferConfigRequest"
5694 }
5695}
5696
5697/// Request message to create a `MulticloudDataTransferConfig` resource.
5698#[derive(Clone, Default, PartialEq)]
5699#[non_exhaustive]
5700pub struct CreateMulticloudDataTransferConfigRequest {
5701 /// Required. The name of the parent resource.
5702 pub parent: std::string::String,
5703
5704 /// Required. The ID to use for the `MulticloudDataTransferConfig` resource,
5705 /// which becomes the final component of the `MulticloudDataTransferConfig`
5706 /// resource name.
5707 pub multicloud_data_transfer_config_id: std::string::String,
5708
5709 /// Required. The `MulticloudDataTransferConfig` resource to create.
5710 pub multicloud_data_transfer_config:
5711 std::option::Option<crate::model::MulticloudDataTransferConfig>,
5712
5713 /// Optional. A request ID to identify requests. Specify a unique request ID
5714 /// so that if you must retry your request, the server can ignore
5715 /// the request if it has already been completed. The server waits
5716 /// for at least 60 minutes since the first request.
5717 ///
5718 /// For example, consider a situation where you make an initial request and
5719 /// the request times out. If you make the request again with the same request
5720 /// ID, the server can check if original operation with the same request ID
5721 /// was received, and if so, can ignore the second request. This prevents
5722 /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5723 /// resources.
5724 ///
5725 /// The request ID must be a valid UUID with the exception that zero UUID
5726 /// (00000000-0000-0000-0000-000000000000) isn't supported.
5727 pub request_id: std::string::String,
5728
5729 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5730}
5731
5732impl CreateMulticloudDataTransferConfigRequest {
5733 /// Creates a new default instance.
5734 pub fn new() -> Self {
5735 std::default::Default::default()
5736 }
5737
5738 /// Sets the value of [parent][crate::model::CreateMulticloudDataTransferConfigRequest::parent].
5739 ///
5740 /// # Example
5741 /// ```ignore,no_run
5742 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5743 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_parent("example");
5744 /// ```
5745 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5746 self.parent = v.into();
5747 self
5748 }
5749
5750 /// Sets the value of [multicloud_data_transfer_config_id][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config_id].
5751 ///
5752 /// # Example
5753 /// ```ignore,no_run
5754 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5755 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config_id("example");
5756 /// ```
5757 pub fn set_multicloud_data_transfer_config_id<T: std::convert::Into<std::string::String>>(
5758 mut self,
5759 v: T,
5760 ) -> Self {
5761 self.multicloud_data_transfer_config_id = v.into();
5762 self
5763 }
5764
5765 /// Sets the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5766 ///
5767 /// # Example
5768 /// ```ignore,no_run
5769 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5770 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5771 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config(MulticloudDataTransferConfig::default()/* use setters */);
5772 /// ```
5773 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
5774 where
5775 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5776 {
5777 self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
5778 self
5779 }
5780
5781 /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5782 ///
5783 /// # Example
5784 /// ```ignore,no_run
5785 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5786 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5787 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(Some(MulticloudDataTransferConfig::default()/* use setters */));
5788 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(None::<MulticloudDataTransferConfig>);
5789 /// ```
5790 pub fn set_or_clear_multicloud_data_transfer_config<T>(
5791 mut self,
5792 v: std::option::Option<T>,
5793 ) -> Self
5794 where
5795 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5796 {
5797 self.multicloud_data_transfer_config = v.map(|x| x.into());
5798 self
5799 }
5800
5801 /// Sets the value of [request_id][crate::model::CreateMulticloudDataTransferConfigRequest::request_id].
5802 ///
5803 /// # Example
5804 /// ```ignore,no_run
5805 /// # use google_cloud_networkconnectivity_v1::model::CreateMulticloudDataTransferConfigRequest;
5806 /// let x = CreateMulticloudDataTransferConfigRequest::new().set_request_id("example");
5807 /// ```
5808 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5809 self.request_id = v.into();
5810 self
5811 }
5812}
5813
5814impl wkt::message::Message for CreateMulticloudDataTransferConfigRequest {
5815 fn typename() -> &'static str {
5816 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateMulticloudDataTransferConfigRequest"
5817 }
5818}
5819
5820/// Request message to update a `MulticloudDataTransferConfig` resource.
5821#[derive(Clone, Default, PartialEq)]
5822#[non_exhaustive]
5823pub struct UpdateMulticloudDataTransferConfigRequest {
5824 /// Optional. `FieldMask` is used to specify the fields in the
5825 /// `MulticloudDataTransferConfig` resource to be overwritten by the update.
5826 /// The fields specified in `update_mask` are relative to the resource, not
5827 /// the full request. A field is overwritten if it is in the mask. If you
5828 /// don't specify a mask, all fields are overwritten.
5829 pub update_mask: std::option::Option<wkt::FieldMask>,
5830
5831 /// Required. The `MulticloudDataTransferConfig` resource to update.
5832 pub multicloud_data_transfer_config:
5833 std::option::Option<crate::model::MulticloudDataTransferConfig>,
5834
5835 /// Optional. A request ID to identify requests. Specify a unique request ID
5836 /// so that if you must retry your request, the server can ignore
5837 /// the request if it has already been completed. The server waits
5838 /// for at least 60 minutes since the first request.
5839 ///
5840 /// For example, consider a situation where you make an initial request and
5841 /// the request times out. If you make the request again with the same request
5842 /// ID, the server can check if original operation with the same request ID
5843 /// was received, and if so, can ignore the second request. This prevents
5844 /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5845 /// resources.
5846 ///
5847 /// The request ID must be a valid UUID with the exception that zero UUID
5848 /// (00000000-0000-0000-0000-000000000000) isn't supported.
5849 pub request_id: std::string::String,
5850
5851 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5852}
5853
5854impl UpdateMulticloudDataTransferConfigRequest {
5855 /// Creates a new default instance.
5856 pub fn new() -> Self {
5857 std::default::Default::default()
5858 }
5859
5860 /// Sets the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
5861 ///
5862 /// # Example
5863 /// ```ignore,no_run
5864 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5865 /// use wkt::FieldMask;
5866 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5867 /// ```
5868 pub fn set_update_mask<T>(mut self, v: T) -> Self
5869 where
5870 T: std::convert::Into<wkt::FieldMask>,
5871 {
5872 self.update_mask = std::option::Option::Some(v.into());
5873 self
5874 }
5875
5876 /// Sets or clears the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
5877 ///
5878 /// # Example
5879 /// ```ignore,no_run
5880 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5881 /// use wkt::FieldMask;
5882 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5883 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5884 /// ```
5885 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5886 where
5887 T: std::convert::Into<wkt::FieldMask>,
5888 {
5889 self.update_mask = v.map(|x| x.into());
5890 self
5891 }
5892
5893 /// Sets the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5894 ///
5895 /// # Example
5896 /// ```ignore,no_run
5897 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5898 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5899 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_multicloud_data_transfer_config(MulticloudDataTransferConfig::default()/* use setters */);
5900 /// ```
5901 pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
5902 where
5903 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5904 {
5905 self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
5906 self
5907 }
5908
5909 /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
5910 ///
5911 /// # Example
5912 /// ```ignore,no_run
5913 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5914 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferConfig;
5915 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(Some(MulticloudDataTransferConfig::default()/* use setters */));
5916 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_or_clear_multicloud_data_transfer_config(None::<MulticloudDataTransferConfig>);
5917 /// ```
5918 pub fn set_or_clear_multicloud_data_transfer_config<T>(
5919 mut self,
5920 v: std::option::Option<T>,
5921 ) -> Self
5922 where
5923 T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
5924 {
5925 self.multicloud_data_transfer_config = v.map(|x| x.into());
5926 self
5927 }
5928
5929 /// Sets the value of [request_id][crate::model::UpdateMulticloudDataTransferConfigRequest::request_id].
5930 ///
5931 /// # Example
5932 /// ```ignore,no_run
5933 /// # use google_cloud_networkconnectivity_v1::model::UpdateMulticloudDataTransferConfigRequest;
5934 /// let x = UpdateMulticloudDataTransferConfigRequest::new().set_request_id("example");
5935 /// ```
5936 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5937 self.request_id = v.into();
5938 self
5939 }
5940}
5941
5942impl wkt::message::Message for UpdateMulticloudDataTransferConfigRequest {
5943 fn typename() -> &'static str {
5944 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateMulticloudDataTransferConfigRequest"
5945 }
5946}
5947
5948/// Request message to delete a `MulticloudDataTransferConfig` resource.
5949#[derive(Clone, Default, PartialEq)]
5950#[non_exhaustive]
5951pub struct DeleteMulticloudDataTransferConfigRequest {
5952 /// Required. The name of the `MulticloudDataTransferConfig` resource to
5953 /// delete.
5954 pub name: std::string::String,
5955
5956 /// Optional. A request ID to identify requests. Specify a unique request ID
5957 /// so that if you must retry your request, the server can ignore
5958 /// the request if it has already been completed. The server waits
5959 /// for at least 60 minutes since the first request.
5960 ///
5961 /// For example, consider a situation where you make an initial request and
5962 /// the request times out. If you make the request again with the same request
5963 /// ID, the server can check if original operation with the same request ID
5964 /// was received, and if so, can ignore the second request. This prevents
5965 /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
5966 /// resources.
5967 ///
5968 /// The request ID must be a valid UUID with the exception that zero UUID
5969 /// (00000000-0000-0000-0000-000000000000) isn't supported.
5970 pub request_id: std::string::String,
5971
5972 /// Optional. The etag is computed by the server, and might be sent with update
5973 /// and delete requests so that the client has an up-to-date value before
5974 /// proceeding.
5975 pub etag: std::string::String,
5976
5977 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5978}
5979
5980impl DeleteMulticloudDataTransferConfigRequest {
5981 /// Creates a new default instance.
5982 pub fn new() -> Self {
5983 std::default::Default::default()
5984 }
5985
5986 /// Sets the value of [name][crate::model::DeleteMulticloudDataTransferConfigRequest::name].
5987 ///
5988 /// # Example
5989 /// ```ignore,no_run
5990 /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
5991 /// # let project_id = "project_id";
5992 /// # let location_id = "location_id";
5993 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
5994 /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}"));
5995 /// ```
5996 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5997 self.name = v.into();
5998 self
5999 }
6000
6001 /// Sets the value of [request_id][crate::model::DeleteMulticloudDataTransferConfigRequest::request_id].
6002 ///
6003 /// # Example
6004 /// ```ignore,no_run
6005 /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
6006 /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_request_id("example");
6007 /// ```
6008 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6009 self.request_id = v.into();
6010 self
6011 }
6012
6013 /// Sets the value of [etag][crate::model::DeleteMulticloudDataTransferConfigRequest::etag].
6014 ///
6015 /// # Example
6016 /// ```ignore,no_run
6017 /// # use google_cloud_networkconnectivity_v1::model::DeleteMulticloudDataTransferConfigRequest;
6018 /// let x = DeleteMulticloudDataTransferConfigRequest::new().set_etag("example");
6019 /// ```
6020 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6021 self.etag = v.into();
6022 self
6023 }
6024}
6025
6026impl wkt::message::Message for DeleteMulticloudDataTransferConfigRequest {
6027 fn typename() -> &'static str {
6028 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteMulticloudDataTransferConfigRequest"
6029 }
6030}
6031
6032/// The `Destination` resource. It specifies the IP prefix and the associated
6033/// autonomous system numbers (ASN) that you want to include in a
6034/// `MulticloudDataTransferConfig` resource.
6035#[derive(Clone, Default, PartialEq)]
6036#[non_exhaustive]
6037pub struct Destination {
6038 /// Identifier. The name of the `Destination` resource.
6039 /// Format:
6040 /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}/destinations/{destination}`.
6041 pub name: std::string::String,
6042
6043 /// Output only. Time when the `Destination` resource was created.
6044 pub create_time: std::option::Option<wkt::Timestamp>,
6045
6046 /// Output only. Time when the `Destination` resource was updated.
6047 pub update_time: std::option::Option<wkt::Timestamp>,
6048
6049 /// Optional. User-defined labels.
6050 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6051
6052 /// The etag is computed by the server, and might be sent with update and
6053 /// delete requests so that the client has an up-to-date value before
6054 /// proceeding.
6055 pub etag: std::string::String,
6056
6057 /// Optional. A description of this resource.
6058 pub description: std::string::String,
6059
6060 /// Required. Immutable. The IP prefix that represents your workload on another
6061 /// CSP.
6062 pub ip_prefix: std::string::String,
6063
6064 /// Required. Unordered list. The list of `DestinationEndpoint` resources
6065 /// configured for the IP prefix.
6066 pub endpoints: std::vec::Vec<crate::model::destination::DestinationEndpoint>,
6067
6068 /// Output only. The timeline of the expected `Destination` states or the
6069 /// current rest state. If a state change is expected, the value is `ADDING`,
6070 /// `DELETING` or `SUSPENDING`, depending on the action specified.
6071 ///
6072 /// Example:
6073 /// "state_timeline": {
6074 /// "states": [
6075 /// {
6076 /// // The time when the `Destination` resource will be activated.
6077 /// "effectiveTime": "2024-12-01T08:00:00Z",
6078 /// "state": "ADDING"
6079 /// },
6080 /// {
6081 /// // The time when the `Destination` resource will be suspended.
6082 /// "effectiveTime": "2024-12-01T20:00:00Z",
6083 /// "state": "SUSPENDING"
6084 /// }
6085 /// ]
6086 /// }
6087 pub state_timeline: std::option::Option<crate::model::StateTimeline>,
6088
6089 /// Output only. The Google-generated unique ID for the `Destination` resource.
6090 /// This value is unique across all `Destination` resources.
6091 /// If a resource is deleted and another with the same name is
6092 /// created, the new resource is assigned a different and unique ID.
6093 pub uid: std::string::String,
6094
6095 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6096}
6097
6098impl Destination {
6099 /// Creates a new default instance.
6100 pub fn new() -> Self {
6101 std::default::Default::default()
6102 }
6103
6104 /// Sets the value of [name][crate::model::Destination::name].
6105 ///
6106 /// # Example
6107 /// ```ignore,no_run
6108 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6109 /// # let project_id = "project_id";
6110 /// # let location_id = "location_id";
6111 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
6112 /// # let destination_id = "destination_id";
6113 /// let x = Destination::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}/destinations/{destination_id}"));
6114 /// ```
6115 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6116 self.name = v.into();
6117 self
6118 }
6119
6120 /// Sets the value of [create_time][crate::model::Destination::create_time].
6121 ///
6122 /// # Example
6123 /// ```ignore,no_run
6124 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6125 /// use wkt::Timestamp;
6126 /// let x = Destination::new().set_create_time(Timestamp::default()/* use setters */);
6127 /// ```
6128 pub fn set_create_time<T>(mut self, v: T) -> Self
6129 where
6130 T: std::convert::Into<wkt::Timestamp>,
6131 {
6132 self.create_time = std::option::Option::Some(v.into());
6133 self
6134 }
6135
6136 /// Sets or clears the value of [create_time][crate::model::Destination::create_time].
6137 ///
6138 /// # Example
6139 /// ```ignore,no_run
6140 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6141 /// use wkt::Timestamp;
6142 /// let x = Destination::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6143 /// let x = Destination::new().set_or_clear_create_time(None::<Timestamp>);
6144 /// ```
6145 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6146 where
6147 T: std::convert::Into<wkt::Timestamp>,
6148 {
6149 self.create_time = v.map(|x| x.into());
6150 self
6151 }
6152
6153 /// Sets the value of [update_time][crate::model::Destination::update_time].
6154 ///
6155 /// # Example
6156 /// ```ignore,no_run
6157 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6158 /// use wkt::Timestamp;
6159 /// let x = Destination::new().set_update_time(Timestamp::default()/* use setters */);
6160 /// ```
6161 pub fn set_update_time<T>(mut self, v: T) -> Self
6162 where
6163 T: std::convert::Into<wkt::Timestamp>,
6164 {
6165 self.update_time = std::option::Option::Some(v.into());
6166 self
6167 }
6168
6169 /// Sets or clears the value of [update_time][crate::model::Destination::update_time].
6170 ///
6171 /// # Example
6172 /// ```ignore,no_run
6173 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6174 /// use wkt::Timestamp;
6175 /// let x = Destination::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6176 /// let x = Destination::new().set_or_clear_update_time(None::<Timestamp>);
6177 /// ```
6178 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6179 where
6180 T: std::convert::Into<wkt::Timestamp>,
6181 {
6182 self.update_time = v.map(|x| x.into());
6183 self
6184 }
6185
6186 /// Sets the value of [labels][crate::model::Destination::labels].
6187 ///
6188 /// # Example
6189 /// ```ignore,no_run
6190 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6191 /// let x = Destination::new().set_labels([
6192 /// ("key0", "abc"),
6193 /// ("key1", "xyz"),
6194 /// ]);
6195 /// ```
6196 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6197 where
6198 T: std::iter::IntoIterator<Item = (K, V)>,
6199 K: std::convert::Into<std::string::String>,
6200 V: std::convert::Into<std::string::String>,
6201 {
6202 use std::iter::Iterator;
6203 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6204 self
6205 }
6206
6207 /// Sets the value of [etag][crate::model::Destination::etag].
6208 ///
6209 /// # Example
6210 /// ```ignore,no_run
6211 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6212 /// let x = Destination::new().set_etag("example");
6213 /// ```
6214 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6215 self.etag = v.into();
6216 self
6217 }
6218
6219 /// Sets the value of [description][crate::model::Destination::description].
6220 ///
6221 /// # Example
6222 /// ```ignore,no_run
6223 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6224 /// let x = Destination::new().set_description("example");
6225 /// ```
6226 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6227 self.description = v.into();
6228 self
6229 }
6230
6231 /// Sets the value of [ip_prefix][crate::model::Destination::ip_prefix].
6232 ///
6233 /// # Example
6234 /// ```ignore,no_run
6235 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6236 /// let x = Destination::new().set_ip_prefix("example");
6237 /// ```
6238 pub fn set_ip_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6239 self.ip_prefix = v.into();
6240 self
6241 }
6242
6243 /// Sets the value of [endpoints][crate::model::Destination::endpoints].
6244 ///
6245 /// # Example
6246 /// ```ignore,no_run
6247 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6248 /// use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6249 /// let x = Destination::new()
6250 /// .set_endpoints([
6251 /// DestinationEndpoint::default()/* use setters */,
6252 /// DestinationEndpoint::default()/* use (different) setters */,
6253 /// ]);
6254 /// ```
6255 pub fn set_endpoints<T, V>(mut self, v: T) -> Self
6256 where
6257 T: std::iter::IntoIterator<Item = V>,
6258 V: std::convert::Into<crate::model::destination::DestinationEndpoint>,
6259 {
6260 use std::iter::Iterator;
6261 self.endpoints = v.into_iter().map(|i| i.into()).collect();
6262 self
6263 }
6264
6265 /// Sets the value of [state_timeline][crate::model::Destination::state_timeline].
6266 ///
6267 /// # Example
6268 /// ```ignore,no_run
6269 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6270 /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
6271 /// let x = Destination::new().set_state_timeline(StateTimeline::default()/* use setters */);
6272 /// ```
6273 pub fn set_state_timeline<T>(mut self, v: T) -> Self
6274 where
6275 T: std::convert::Into<crate::model::StateTimeline>,
6276 {
6277 self.state_timeline = std::option::Option::Some(v.into());
6278 self
6279 }
6280
6281 /// Sets or clears the value of [state_timeline][crate::model::Destination::state_timeline].
6282 ///
6283 /// # Example
6284 /// ```ignore,no_run
6285 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6286 /// use google_cloud_networkconnectivity_v1::model::StateTimeline;
6287 /// let x = Destination::new().set_or_clear_state_timeline(Some(StateTimeline::default()/* use setters */));
6288 /// let x = Destination::new().set_or_clear_state_timeline(None::<StateTimeline>);
6289 /// ```
6290 pub fn set_or_clear_state_timeline<T>(mut self, v: std::option::Option<T>) -> Self
6291 where
6292 T: std::convert::Into<crate::model::StateTimeline>,
6293 {
6294 self.state_timeline = v.map(|x| x.into());
6295 self
6296 }
6297
6298 /// Sets the value of [uid][crate::model::Destination::uid].
6299 ///
6300 /// # Example
6301 /// ```ignore,no_run
6302 /// # use google_cloud_networkconnectivity_v1::model::Destination;
6303 /// let x = Destination::new().set_uid("example");
6304 /// ```
6305 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6306 self.uid = v.into();
6307 self
6308 }
6309}
6310
6311impl wkt::message::Message for Destination {
6312 fn typename() -> &'static str {
6313 "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination"
6314 }
6315}
6316
6317/// Defines additional types related to [Destination].
6318pub mod destination {
6319 #[allow(unused_imports)]
6320 use super::*;
6321
6322 /// The metadata for a `DestinationEndpoint` resource.
6323 #[derive(Clone, Default, PartialEq)]
6324 #[non_exhaustive]
6325 pub struct DestinationEndpoint {
6326 /// Required. The ASN of the remote IP prefix.
6327 pub asn: i64,
6328
6329 /// Required. The CSP of the remote IP prefix.
6330 pub csp: std::string::String,
6331
6332 /// Output only. The state of the `DestinationEndpoint` resource.
6333 pub state: crate::model::destination::destination_endpoint::State,
6334
6335 /// Output only. Time when the `DestinationEndpoint` resource was updated.
6336 pub update_time: std::option::Option<wkt::Timestamp>,
6337
6338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6339 }
6340
6341 impl DestinationEndpoint {
6342 /// Creates a new default instance.
6343 pub fn new() -> Self {
6344 std::default::Default::default()
6345 }
6346
6347 /// Sets the value of [asn][crate::model::destination::DestinationEndpoint::asn].
6348 ///
6349 /// # Example
6350 /// ```ignore,no_run
6351 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6352 /// let x = DestinationEndpoint::new().set_asn(42);
6353 /// ```
6354 pub fn set_asn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6355 self.asn = v.into();
6356 self
6357 }
6358
6359 /// Sets the value of [csp][crate::model::destination::DestinationEndpoint::csp].
6360 ///
6361 /// # Example
6362 /// ```ignore,no_run
6363 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6364 /// let x = DestinationEndpoint::new().set_csp("example");
6365 /// ```
6366 pub fn set_csp<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6367 self.csp = v.into();
6368 self
6369 }
6370
6371 /// Sets the value of [state][crate::model::destination::DestinationEndpoint::state].
6372 ///
6373 /// # Example
6374 /// ```ignore,no_run
6375 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6376 /// use google_cloud_networkconnectivity_v1::model::destination::destination_endpoint::State;
6377 /// let x0 = DestinationEndpoint::new().set_state(State::Valid);
6378 /// let x1 = DestinationEndpoint::new().set_state(State::Invalid);
6379 /// ```
6380 pub fn set_state<
6381 T: std::convert::Into<crate::model::destination::destination_endpoint::State>,
6382 >(
6383 mut self,
6384 v: T,
6385 ) -> Self {
6386 self.state = v.into();
6387 self
6388 }
6389
6390 /// Sets the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
6391 ///
6392 /// # Example
6393 /// ```ignore,no_run
6394 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6395 /// use wkt::Timestamp;
6396 /// let x = DestinationEndpoint::new().set_update_time(Timestamp::default()/* use setters */);
6397 /// ```
6398 pub fn set_update_time<T>(mut self, v: T) -> Self
6399 where
6400 T: std::convert::Into<wkt::Timestamp>,
6401 {
6402 self.update_time = std::option::Option::Some(v.into());
6403 self
6404 }
6405
6406 /// Sets or clears the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
6407 ///
6408 /// # Example
6409 /// ```ignore,no_run
6410 /// # use google_cloud_networkconnectivity_v1::model::destination::DestinationEndpoint;
6411 /// use wkt::Timestamp;
6412 /// let x = DestinationEndpoint::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6413 /// let x = DestinationEndpoint::new().set_or_clear_update_time(None::<Timestamp>);
6414 /// ```
6415 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6416 where
6417 T: std::convert::Into<wkt::Timestamp>,
6418 {
6419 self.update_time = v.map(|x| x.into());
6420 self
6421 }
6422 }
6423
6424 impl wkt::message::Message for DestinationEndpoint {
6425 fn typename() -> &'static str {
6426 "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint"
6427 }
6428 }
6429
6430 /// Defines additional types related to [DestinationEndpoint].
6431 pub mod destination_endpoint {
6432 #[allow(unused_imports)]
6433 use super::*;
6434
6435 /// The state of the `DestinationEndpoint` resource.
6436 ///
6437 /// # Working with unknown values
6438 ///
6439 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6440 /// additional enum variants at any time. Adding new variants is not considered
6441 /// a breaking change. Applications should write their code in anticipation of:
6442 ///
6443 /// - New values appearing in future releases of the client library, **and**
6444 /// - New values received dynamically, without application changes.
6445 ///
6446 /// Please consult the [Working with enums] section in the user guide for some
6447 /// guidelines.
6448 ///
6449 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6450 #[derive(Clone, Debug, PartialEq)]
6451 #[non_exhaustive]
6452 pub enum State {
6453 /// An invalid state, which is the default case.
6454 Unspecified,
6455 /// The `DestinationEndpoint` resource is valid.
6456 Valid,
6457 /// The `DestinationEndpoint` resource is invalid.
6458 Invalid,
6459 /// If set, the enum was initialized with an unknown value.
6460 ///
6461 /// Applications can examine the value using [State::value] or
6462 /// [State::name].
6463 UnknownValue(state::UnknownValue),
6464 }
6465
6466 #[doc(hidden)]
6467 pub mod state {
6468 #[allow(unused_imports)]
6469 use super::*;
6470 #[derive(Clone, Debug, PartialEq)]
6471 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6472 }
6473
6474 impl State {
6475 /// Gets the enum value.
6476 ///
6477 /// Returns `None` if the enum contains an unknown value deserialized from
6478 /// the string representation of enums.
6479 pub fn value(&self) -> std::option::Option<i32> {
6480 match self {
6481 Self::Unspecified => std::option::Option::Some(0),
6482 Self::Valid => std::option::Option::Some(1),
6483 Self::Invalid => std::option::Option::Some(2),
6484 Self::UnknownValue(u) => u.0.value(),
6485 }
6486 }
6487
6488 /// Gets the enum value as a string.
6489 ///
6490 /// Returns `None` if the enum contains an unknown value deserialized from
6491 /// the integer representation of enums.
6492 pub fn name(&self) -> std::option::Option<&str> {
6493 match self {
6494 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6495 Self::Valid => std::option::Option::Some("VALID"),
6496 Self::Invalid => std::option::Option::Some("INVALID"),
6497 Self::UnknownValue(u) => u.0.name(),
6498 }
6499 }
6500 }
6501
6502 impl std::default::Default for State {
6503 fn default() -> Self {
6504 use std::convert::From;
6505 Self::from(0)
6506 }
6507 }
6508
6509 impl std::fmt::Display for State {
6510 fn fmt(
6511 &self,
6512 f: &mut std::fmt::Formatter<'_>,
6513 ) -> std::result::Result<(), std::fmt::Error> {
6514 wkt::internal::display_enum(f, self.name(), self.value())
6515 }
6516 }
6517
6518 impl std::convert::From<i32> for State {
6519 fn from(value: i32) -> Self {
6520 match value {
6521 0 => Self::Unspecified,
6522 1 => Self::Valid,
6523 2 => Self::Invalid,
6524 _ => Self::UnknownValue(state::UnknownValue(
6525 wkt::internal::UnknownEnumValue::Integer(value),
6526 )),
6527 }
6528 }
6529 }
6530
6531 impl std::convert::From<&str> for State {
6532 fn from(value: &str) -> Self {
6533 use std::string::ToString;
6534 match value {
6535 "STATE_UNSPECIFIED" => Self::Unspecified,
6536 "VALID" => Self::Valid,
6537 "INVALID" => Self::Invalid,
6538 _ => Self::UnknownValue(state::UnknownValue(
6539 wkt::internal::UnknownEnumValue::String(value.to_string()),
6540 )),
6541 }
6542 }
6543 }
6544
6545 impl serde::ser::Serialize for State {
6546 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6547 where
6548 S: serde::Serializer,
6549 {
6550 match self {
6551 Self::Unspecified => serializer.serialize_i32(0),
6552 Self::Valid => serializer.serialize_i32(1),
6553 Self::Invalid => serializer.serialize_i32(2),
6554 Self::UnknownValue(u) => u.0.serialize(serializer),
6555 }
6556 }
6557 }
6558
6559 impl<'de> serde::de::Deserialize<'de> for State {
6560 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6561 where
6562 D: serde::Deserializer<'de>,
6563 {
6564 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6565 ".google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint.State",
6566 ))
6567 }
6568 }
6569 }
6570}
6571
6572/// Request message to list `Destination` resources.
6573#[derive(Clone, Default, PartialEq)]
6574#[non_exhaustive]
6575pub struct ListDestinationsRequest {
6576 /// Required. The name of the parent resource.
6577 pub parent: std::string::String,
6578
6579 /// Optional. The maximum number of results listed per page.
6580 pub page_size: i32,
6581
6582 /// Optional. The page token.
6583 pub page_token: std::string::String,
6584
6585 /// Optional. An expression that filters the results listed in the response.
6586 pub filter: std::string::String,
6587
6588 /// Optional. The sort order of the results.
6589 pub order_by: std::string::String,
6590
6591 /// Optional. If `true`, allow partial responses for multi-regional aggregated
6592 /// list requests.
6593 pub return_partial_success: bool,
6594
6595 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6596}
6597
6598impl ListDestinationsRequest {
6599 /// Creates a new default instance.
6600 pub fn new() -> Self {
6601 std::default::Default::default()
6602 }
6603
6604 /// Sets the value of [parent][crate::model::ListDestinationsRequest::parent].
6605 ///
6606 /// # Example
6607 /// ```ignore,no_run
6608 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6609 /// # let project_id = "project_id";
6610 /// # let location_id = "location_id";
6611 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
6612 /// let x = ListDestinationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}"));
6613 /// ```
6614 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6615 self.parent = v.into();
6616 self
6617 }
6618
6619 /// Sets the value of [page_size][crate::model::ListDestinationsRequest::page_size].
6620 ///
6621 /// # Example
6622 /// ```ignore,no_run
6623 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6624 /// let x = ListDestinationsRequest::new().set_page_size(42);
6625 /// ```
6626 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6627 self.page_size = v.into();
6628 self
6629 }
6630
6631 /// Sets the value of [page_token][crate::model::ListDestinationsRequest::page_token].
6632 ///
6633 /// # Example
6634 /// ```ignore,no_run
6635 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6636 /// let x = ListDestinationsRequest::new().set_page_token("example");
6637 /// ```
6638 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6639 self.page_token = v.into();
6640 self
6641 }
6642
6643 /// Sets the value of [filter][crate::model::ListDestinationsRequest::filter].
6644 ///
6645 /// # Example
6646 /// ```ignore,no_run
6647 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6648 /// let x = ListDestinationsRequest::new().set_filter("example");
6649 /// ```
6650 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6651 self.filter = v.into();
6652 self
6653 }
6654
6655 /// Sets the value of [order_by][crate::model::ListDestinationsRequest::order_by].
6656 ///
6657 /// # Example
6658 /// ```ignore,no_run
6659 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6660 /// let x = ListDestinationsRequest::new().set_order_by("example");
6661 /// ```
6662 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6663 self.order_by = v.into();
6664 self
6665 }
6666
6667 /// Sets the value of [return_partial_success][crate::model::ListDestinationsRequest::return_partial_success].
6668 ///
6669 /// # Example
6670 /// ```ignore,no_run
6671 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsRequest;
6672 /// let x = ListDestinationsRequest::new().set_return_partial_success(true);
6673 /// ```
6674 pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6675 self.return_partial_success = v.into();
6676 self
6677 }
6678}
6679
6680impl wkt::message::Message for ListDestinationsRequest {
6681 fn typename() -> &'static str {
6682 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsRequest"
6683 }
6684}
6685
6686/// Response message to list `Destination` resources.
6687#[derive(Clone, Default, PartialEq)]
6688#[non_exhaustive]
6689pub struct ListDestinationsResponse {
6690 /// The list of `Destination` resources to be listed.
6691 pub destinations: std::vec::Vec<crate::model::Destination>,
6692
6693 /// The next page token.
6694 pub next_page_token: std::string::String,
6695
6696 /// Locations that could not be reached.
6697 pub unreachable: std::vec::Vec<std::string::String>,
6698
6699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6700}
6701
6702impl ListDestinationsResponse {
6703 /// Creates a new default instance.
6704 pub fn new() -> Self {
6705 std::default::Default::default()
6706 }
6707
6708 /// Sets the value of [destinations][crate::model::ListDestinationsResponse::destinations].
6709 ///
6710 /// # Example
6711 /// ```ignore,no_run
6712 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6713 /// use google_cloud_networkconnectivity_v1::model::Destination;
6714 /// let x = ListDestinationsResponse::new()
6715 /// .set_destinations([
6716 /// Destination::default()/* use setters */,
6717 /// Destination::default()/* use (different) setters */,
6718 /// ]);
6719 /// ```
6720 pub fn set_destinations<T, V>(mut self, v: T) -> Self
6721 where
6722 T: std::iter::IntoIterator<Item = V>,
6723 V: std::convert::Into<crate::model::Destination>,
6724 {
6725 use std::iter::Iterator;
6726 self.destinations = v.into_iter().map(|i| i.into()).collect();
6727 self
6728 }
6729
6730 /// Sets the value of [next_page_token][crate::model::ListDestinationsResponse::next_page_token].
6731 ///
6732 /// # Example
6733 /// ```ignore,no_run
6734 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6735 /// let x = ListDestinationsResponse::new().set_next_page_token("example");
6736 /// ```
6737 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6738 self.next_page_token = v.into();
6739 self
6740 }
6741
6742 /// Sets the value of [unreachable][crate::model::ListDestinationsResponse::unreachable].
6743 ///
6744 /// # Example
6745 /// ```ignore,no_run
6746 /// # use google_cloud_networkconnectivity_v1::model::ListDestinationsResponse;
6747 /// let x = ListDestinationsResponse::new().set_unreachable(["a", "b", "c"]);
6748 /// ```
6749 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6750 where
6751 T: std::iter::IntoIterator<Item = V>,
6752 V: std::convert::Into<std::string::String>,
6753 {
6754 use std::iter::Iterator;
6755 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6756 self
6757 }
6758}
6759
6760impl wkt::message::Message for ListDestinationsResponse {
6761 fn typename() -> &'static str {
6762 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsResponse"
6763 }
6764}
6765
6766#[doc(hidden)]
6767impl google_cloud_gax::paginator::internal::PageableResponse for ListDestinationsResponse {
6768 type PageItem = crate::model::Destination;
6769
6770 fn items(self) -> std::vec::Vec<Self::PageItem> {
6771 self.destinations
6772 }
6773
6774 fn next_page_token(&self) -> std::string::String {
6775 use std::clone::Clone;
6776 self.next_page_token.clone()
6777 }
6778}
6779
6780/// Request message to get the details of a `Destination` resource.
6781#[derive(Clone, Default, PartialEq)]
6782#[non_exhaustive]
6783pub struct GetDestinationRequest {
6784 /// Required. The name of the `Destination` resource to get.
6785 pub name: std::string::String,
6786
6787 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6788}
6789
6790impl GetDestinationRequest {
6791 /// Creates a new default instance.
6792 pub fn new() -> Self {
6793 std::default::Default::default()
6794 }
6795
6796 /// Sets the value of [name][crate::model::GetDestinationRequest::name].
6797 ///
6798 /// # Example
6799 /// ```ignore,no_run
6800 /// # use google_cloud_networkconnectivity_v1::model::GetDestinationRequest;
6801 /// # let project_id = "project_id";
6802 /// # let location_id = "location_id";
6803 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
6804 /// # let destination_id = "destination_id";
6805 /// let x = GetDestinationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}/destinations/{destination_id}"));
6806 /// ```
6807 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6808 self.name = v.into();
6809 self
6810 }
6811}
6812
6813impl wkt::message::Message for GetDestinationRequest {
6814 fn typename() -> &'static str {
6815 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetDestinationRequest"
6816 }
6817}
6818
6819/// Request message to create a `Destination` resource.
6820#[derive(Clone, Default, PartialEq)]
6821#[non_exhaustive]
6822pub struct CreateDestinationRequest {
6823 /// Required. The name of the parent resource.
6824 pub parent: std::string::String,
6825
6826 /// Required. The ID to use for the `Destination` resource, which becomes the
6827 /// final component of the `Destination` resource name.
6828 pub destination_id: std::string::String,
6829
6830 /// Required. The `Destination` resource to create.
6831 pub destination: std::option::Option<crate::model::Destination>,
6832
6833 /// Optional. A request ID to identify requests. Specify a unique request ID
6834 /// so that if you must retry your request, the server can ignore
6835 /// the request if it has already been completed. The server waits
6836 /// for at least 60 minutes since the first request.
6837 ///
6838 /// For example, consider a situation where you make an initial request and
6839 /// the request times out. If you make the request again with the same request
6840 /// ID, the server can check if original operation with the same request ID
6841 /// was received, and if so, can ignore the second request. This prevents
6842 /// clients from accidentally creating duplicate `Destination`
6843 /// resources.
6844 ///
6845 /// The request ID must be a valid UUID with the exception that zero UUID
6846 /// (00000000-0000-0000-0000-000000000000) isn't supported.
6847 pub request_id: std::string::String,
6848
6849 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6850}
6851
6852impl CreateDestinationRequest {
6853 /// Creates a new default instance.
6854 pub fn new() -> Self {
6855 std::default::Default::default()
6856 }
6857
6858 /// Sets the value of [parent][crate::model::CreateDestinationRequest::parent].
6859 ///
6860 /// # Example
6861 /// ```ignore,no_run
6862 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6863 /// # let project_id = "project_id";
6864 /// # let location_id = "location_id";
6865 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
6866 /// let x = CreateDestinationRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}"));
6867 /// ```
6868 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6869 self.parent = v.into();
6870 self
6871 }
6872
6873 /// Sets the value of [destination_id][crate::model::CreateDestinationRequest::destination_id].
6874 ///
6875 /// # Example
6876 /// ```ignore,no_run
6877 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6878 /// let x = CreateDestinationRequest::new().set_destination_id("example");
6879 /// ```
6880 pub fn set_destination_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6881 self.destination_id = v.into();
6882 self
6883 }
6884
6885 /// Sets the value of [destination][crate::model::CreateDestinationRequest::destination].
6886 ///
6887 /// # Example
6888 /// ```ignore,no_run
6889 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6890 /// use google_cloud_networkconnectivity_v1::model::Destination;
6891 /// let x = CreateDestinationRequest::new().set_destination(Destination::default()/* use setters */);
6892 /// ```
6893 pub fn set_destination<T>(mut self, v: T) -> Self
6894 where
6895 T: std::convert::Into<crate::model::Destination>,
6896 {
6897 self.destination = std::option::Option::Some(v.into());
6898 self
6899 }
6900
6901 /// Sets or clears the value of [destination][crate::model::CreateDestinationRequest::destination].
6902 ///
6903 /// # Example
6904 /// ```ignore,no_run
6905 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6906 /// use google_cloud_networkconnectivity_v1::model::Destination;
6907 /// let x = CreateDestinationRequest::new().set_or_clear_destination(Some(Destination::default()/* use setters */));
6908 /// let x = CreateDestinationRequest::new().set_or_clear_destination(None::<Destination>);
6909 /// ```
6910 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
6911 where
6912 T: std::convert::Into<crate::model::Destination>,
6913 {
6914 self.destination = v.map(|x| x.into());
6915 self
6916 }
6917
6918 /// Sets the value of [request_id][crate::model::CreateDestinationRequest::request_id].
6919 ///
6920 /// # Example
6921 /// ```ignore,no_run
6922 /// # use google_cloud_networkconnectivity_v1::model::CreateDestinationRequest;
6923 /// let x = CreateDestinationRequest::new().set_request_id("example");
6924 /// ```
6925 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6926 self.request_id = v.into();
6927 self
6928 }
6929}
6930
6931impl wkt::message::Message for CreateDestinationRequest {
6932 fn typename() -> &'static str {
6933 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateDestinationRequest"
6934 }
6935}
6936
6937/// Request message to update a `Destination` resource.
6938#[derive(Clone, Default, PartialEq)]
6939#[non_exhaustive]
6940pub struct UpdateDestinationRequest {
6941 /// Optional. `FieldMask is used to specify the fields to be overwritten in the
6942 /// `Destination` resource by the update.
6943 /// The fields specified in `update_mask` are relative to the resource, not
6944 /// the full request. A field is overwritten if it is in the mask. If you
6945 /// don't specify a mask, all fields are overwritten.
6946 pub update_mask: std::option::Option<wkt::FieldMask>,
6947
6948 /// Required. The `Destination` resource to update.
6949 pub destination: std::option::Option<crate::model::Destination>,
6950
6951 /// Optional. A request ID to identify requests. Specify a unique request ID
6952 /// so that if you must retry your request, the server can ignore
6953 /// the request if it has already been completed. The server waits
6954 /// for at least 60 minutes since the first request.
6955 ///
6956 /// For example, consider a situation where you make an initial request and
6957 /// the request times out. If you make the request again with the same request
6958 /// ID, the server can check if original operation with the same request ID
6959 /// was received, and if so, can ignore the second request.
6960 ///
6961 /// The request ID must be a valid UUID with the exception that zero UUID
6962 /// (00000000-0000-0000-0000-000000000000) isn't supported.
6963 pub request_id: std::string::String,
6964
6965 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6966}
6967
6968impl UpdateDestinationRequest {
6969 /// Creates a new default instance.
6970 pub fn new() -> Self {
6971 std::default::Default::default()
6972 }
6973
6974 /// Sets the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
6975 ///
6976 /// # Example
6977 /// ```ignore,no_run
6978 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6979 /// use wkt::FieldMask;
6980 /// let x = UpdateDestinationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6981 /// ```
6982 pub fn set_update_mask<T>(mut self, v: T) -> Self
6983 where
6984 T: std::convert::Into<wkt::FieldMask>,
6985 {
6986 self.update_mask = std::option::Option::Some(v.into());
6987 self
6988 }
6989
6990 /// Sets or clears the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
6991 ///
6992 /// # Example
6993 /// ```ignore,no_run
6994 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
6995 /// use wkt::FieldMask;
6996 /// let x = UpdateDestinationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6997 /// let x = UpdateDestinationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6998 /// ```
6999 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7000 where
7001 T: std::convert::Into<wkt::FieldMask>,
7002 {
7003 self.update_mask = v.map(|x| x.into());
7004 self
7005 }
7006
7007 /// Sets the value of [destination][crate::model::UpdateDestinationRequest::destination].
7008 ///
7009 /// # Example
7010 /// ```ignore,no_run
7011 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
7012 /// use google_cloud_networkconnectivity_v1::model::Destination;
7013 /// let x = UpdateDestinationRequest::new().set_destination(Destination::default()/* use setters */);
7014 /// ```
7015 pub fn set_destination<T>(mut self, v: T) -> Self
7016 where
7017 T: std::convert::Into<crate::model::Destination>,
7018 {
7019 self.destination = std::option::Option::Some(v.into());
7020 self
7021 }
7022
7023 /// Sets or clears the value of [destination][crate::model::UpdateDestinationRequest::destination].
7024 ///
7025 /// # Example
7026 /// ```ignore,no_run
7027 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
7028 /// use google_cloud_networkconnectivity_v1::model::Destination;
7029 /// let x = UpdateDestinationRequest::new().set_or_clear_destination(Some(Destination::default()/* use setters */));
7030 /// let x = UpdateDestinationRequest::new().set_or_clear_destination(None::<Destination>);
7031 /// ```
7032 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
7033 where
7034 T: std::convert::Into<crate::model::Destination>,
7035 {
7036 self.destination = v.map(|x| x.into());
7037 self
7038 }
7039
7040 /// Sets the value of [request_id][crate::model::UpdateDestinationRequest::request_id].
7041 ///
7042 /// # Example
7043 /// ```ignore,no_run
7044 /// # use google_cloud_networkconnectivity_v1::model::UpdateDestinationRequest;
7045 /// let x = UpdateDestinationRequest::new().set_request_id("example");
7046 /// ```
7047 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7048 self.request_id = v.into();
7049 self
7050 }
7051}
7052
7053impl wkt::message::Message for UpdateDestinationRequest {
7054 fn typename() -> &'static str {
7055 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateDestinationRequest"
7056 }
7057}
7058
7059/// Request message to delete a `Destination` resource.
7060#[derive(Clone, Default, PartialEq)]
7061#[non_exhaustive]
7062pub struct DeleteDestinationRequest {
7063 /// Required. The name of the `Destination` resource to delete.
7064 pub name: std::string::String,
7065
7066 /// Optional. A request ID to identify requests. Specify a unique request ID
7067 /// so that if you must retry your request, the server can ignore
7068 /// the request if it has already been completed. The server waits
7069 /// for at least 60 minutes since the first request.
7070 ///
7071 /// For example, consider a situation where you make an initial request and
7072 /// the request times out. If you make the request again with the same request
7073 /// ID, the server can check if original operation with the same request ID
7074 /// was received, and if so, can ignore the second request.
7075 ///
7076 /// The request ID must be a valid UUID with the exception that zero UUID
7077 /// (00000000-0000-0000-0000-000000000000) isn't supported.
7078 pub request_id: std::string::String,
7079
7080 /// Optional. The etag is computed by the server, and might be sent with update
7081 /// and delete requests so that the client has an up-to-date value before
7082 /// proceeding.
7083 pub etag: std::string::String,
7084
7085 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7086}
7087
7088impl DeleteDestinationRequest {
7089 /// Creates a new default instance.
7090 pub fn new() -> Self {
7091 std::default::Default::default()
7092 }
7093
7094 /// Sets the value of [name][crate::model::DeleteDestinationRequest::name].
7095 ///
7096 /// # Example
7097 /// ```ignore,no_run
7098 /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
7099 /// # let project_id = "project_id";
7100 /// # let location_id = "location_id";
7101 /// # let multicloud_data_transfer_config_id = "multicloud_data_transfer_config_id";
7102 /// # let destination_id = "destination_id";
7103 /// let x = DeleteDestinationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferConfigs/{multicloud_data_transfer_config_id}/destinations/{destination_id}"));
7104 /// ```
7105 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7106 self.name = v.into();
7107 self
7108 }
7109
7110 /// Sets the value of [request_id][crate::model::DeleteDestinationRequest::request_id].
7111 ///
7112 /// # Example
7113 /// ```ignore,no_run
7114 /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
7115 /// let x = DeleteDestinationRequest::new().set_request_id("example");
7116 /// ```
7117 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7118 self.request_id = v.into();
7119 self
7120 }
7121
7122 /// Sets the value of [etag][crate::model::DeleteDestinationRequest::etag].
7123 ///
7124 /// # Example
7125 /// ```ignore,no_run
7126 /// # use google_cloud_networkconnectivity_v1::model::DeleteDestinationRequest;
7127 /// let x = DeleteDestinationRequest::new().set_etag("example");
7128 /// ```
7129 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7130 self.etag = v.into();
7131 self
7132 }
7133}
7134
7135impl wkt::message::Message for DeleteDestinationRequest {
7136 fn typename() -> &'static str {
7137 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteDestinationRequest"
7138 }
7139}
7140
7141/// The timeline of the pending states for a resource.
7142#[derive(Clone, Default, PartialEq)]
7143#[non_exhaustive]
7144pub struct StateTimeline {
7145 /// Output only. The state and activation time details of the resource state.
7146 pub states: std::vec::Vec<crate::model::state_timeline::StateMetadata>,
7147
7148 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7149}
7150
7151impl StateTimeline {
7152 /// Creates a new default instance.
7153 pub fn new() -> Self {
7154 std::default::Default::default()
7155 }
7156
7157 /// Sets the value of [states][crate::model::StateTimeline::states].
7158 ///
7159 /// # Example
7160 /// ```ignore,no_run
7161 /// # use google_cloud_networkconnectivity_v1::model::StateTimeline;
7162 /// use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7163 /// let x = StateTimeline::new()
7164 /// .set_states([
7165 /// StateMetadata::default()/* use setters */,
7166 /// StateMetadata::default()/* use (different) setters */,
7167 /// ]);
7168 /// ```
7169 pub fn set_states<T, V>(mut self, v: T) -> Self
7170 where
7171 T: std::iter::IntoIterator<Item = V>,
7172 V: std::convert::Into<crate::model::state_timeline::StateMetadata>,
7173 {
7174 use std::iter::Iterator;
7175 self.states = v.into_iter().map(|i| i.into()).collect();
7176 self
7177 }
7178}
7179
7180impl wkt::message::Message for StateTimeline {
7181 fn typename() -> &'static str {
7182 "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline"
7183 }
7184}
7185
7186/// Defines additional types related to [StateTimeline].
7187pub mod state_timeline {
7188 #[allow(unused_imports)]
7189 use super::*;
7190
7191 /// The state and activation time details of the resource state.
7192 #[derive(Clone, Default, PartialEq)]
7193 #[non_exhaustive]
7194 pub struct StateMetadata {
7195 /// Output only. The state of the resource.
7196 pub state: crate::model::state_timeline::state_metadata::State,
7197
7198 /// Output only. Accompanies only the transient states, which include
7199 /// `ADDING`, `DELETING`, and `SUSPENDING`, to denote the time until which
7200 /// the transient state of the resource will be effective. For instance, if
7201 /// the state is `ADDING`, this field shows the time when the resource state
7202 /// transitions to `ACTIVE`.
7203 pub effective_time: std::option::Option<wkt::Timestamp>,
7204
7205 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7206 }
7207
7208 impl StateMetadata {
7209 /// Creates a new default instance.
7210 pub fn new() -> Self {
7211 std::default::Default::default()
7212 }
7213
7214 /// Sets the value of [state][crate::model::state_timeline::StateMetadata::state].
7215 ///
7216 /// # Example
7217 /// ```ignore,no_run
7218 /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7219 /// use google_cloud_networkconnectivity_v1::model::state_timeline::state_metadata::State;
7220 /// let x0 = StateMetadata::new().set_state(State::Adding);
7221 /// let x1 = StateMetadata::new().set_state(State::Active);
7222 /// let x2 = StateMetadata::new().set_state(State::Deleting);
7223 /// ```
7224 pub fn set_state<
7225 T: std::convert::Into<crate::model::state_timeline::state_metadata::State>,
7226 >(
7227 mut self,
7228 v: T,
7229 ) -> Self {
7230 self.state = v.into();
7231 self
7232 }
7233
7234 /// Sets the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
7235 ///
7236 /// # Example
7237 /// ```ignore,no_run
7238 /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7239 /// use wkt::Timestamp;
7240 /// let x = StateMetadata::new().set_effective_time(Timestamp::default()/* use setters */);
7241 /// ```
7242 pub fn set_effective_time<T>(mut self, v: T) -> Self
7243 where
7244 T: std::convert::Into<wkt::Timestamp>,
7245 {
7246 self.effective_time = std::option::Option::Some(v.into());
7247 self
7248 }
7249
7250 /// Sets or clears the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
7251 ///
7252 /// # Example
7253 /// ```ignore,no_run
7254 /// # use google_cloud_networkconnectivity_v1::model::state_timeline::StateMetadata;
7255 /// use wkt::Timestamp;
7256 /// let x = StateMetadata::new().set_or_clear_effective_time(Some(Timestamp::default()/* use setters */));
7257 /// let x = StateMetadata::new().set_or_clear_effective_time(None::<Timestamp>);
7258 /// ```
7259 pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
7260 where
7261 T: std::convert::Into<wkt::Timestamp>,
7262 {
7263 self.effective_time = v.map(|x| x.into());
7264 self
7265 }
7266 }
7267
7268 impl wkt::message::Message for StateMetadata {
7269 fn typename() -> &'static str {
7270 "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata"
7271 }
7272 }
7273
7274 /// Defines additional types related to [StateMetadata].
7275 pub mod state_metadata {
7276 #[allow(unused_imports)]
7277 use super::*;
7278
7279 /// The state of the resource.
7280 ///
7281 /// # Working with unknown values
7282 ///
7283 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7284 /// additional enum variants at any time. Adding new variants is not considered
7285 /// a breaking change. Applications should write their code in anticipation of:
7286 ///
7287 /// - New values appearing in future releases of the client library, **and**
7288 /// - New values received dynamically, without application changes.
7289 ///
7290 /// Please consult the [Working with enums] section in the user guide for some
7291 /// guidelines.
7292 ///
7293 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7294 #[derive(Clone, Debug, PartialEq)]
7295 #[non_exhaustive]
7296 pub enum State {
7297 /// An invalid state, which is the default case.
7298 Unspecified,
7299 /// The resource is being added.
7300 Adding,
7301 /// The resource is in use.
7302 Active,
7303 /// The resource is being deleted.
7304 Deleting,
7305 /// The resource is being suspended.
7306 Suspending,
7307 /// The resource is suspended and not in use.
7308 Suspended,
7309 /// If set, the enum was initialized with an unknown value.
7310 ///
7311 /// Applications can examine the value using [State::value] or
7312 /// [State::name].
7313 UnknownValue(state::UnknownValue),
7314 }
7315
7316 #[doc(hidden)]
7317 pub mod state {
7318 #[allow(unused_imports)]
7319 use super::*;
7320 #[derive(Clone, Debug, PartialEq)]
7321 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7322 }
7323
7324 impl State {
7325 /// Gets the enum value.
7326 ///
7327 /// Returns `None` if the enum contains an unknown value deserialized from
7328 /// the string representation of enums.
7329 pub fn value(&self) -> std::option::Option<i32> {
7330 match self {
7331 Self::Unspecified => std::option::Option::Some(0),
7332 Self::Adding => std::option::Option::Some(1),
7333 Self::Active => std::option::Option::Some(2),
7334 Self::Deleting => std::option::Option::Some(3),
7335 Self::Suspending => std::option::Option::Some(4),
7336 Self::Suspended => std::option::Option::Some(5),
7337 Self::UnknownValue(u) => u.0.value(),
7338 }
7339 }
7340
7341 /// Gets the enum value as a string.
7342 ///
7343 /// Returns `None` if the enum contains an unknown value deserialized from
7344 /// the integer representation of enums.
7345 pub fn name(&self) -> std::option::Option<&str> {
7346 match self {
7347 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7348 Self::Adding => std::option::Option::Some("ADDING"),
7349 Self::Active => std::option::Option::Some("ACTIVE"),
7350 Self::Deleting => std::option::Option::Some("DELETING"),
7351 Self::Suspending => std::option::Option::Some("SUSPENDING"),
7352 Self::Suspended => std::option::Option::Some("SUSPENDED"),
7353 Self::UnknownValue(u) => u.0.name(),
7354 }
7355 }
7356 }
7357
7358 impl std::default::Default for State {
7359 fn default() -> Self {
7360 use std::convert::From;
7361 Self::from(0)
7362 }
7363 }
7364
7365 impl std::fmt::Display for State {
7366 fn fmt(
7367 &self,
7368 f: &mut std::fmt::Formatter<'_>,
7369 ) -> std::result::Result<(), std::fmt::Error> {
7370 wkt::internal::display_enum(f, self.name(), self.value())
7371 }
7372 }
7373
7374 impl std::convert::From<i32> for State {
7375 fn from(value: i32) -> Self {
7376 match value {
7377 0 => Self::Unspecified,
7378 1 => Self::Adding,
7379 2 => Self::Active,
7380 3 => Self::Deleting,
7381 4 => Self::Suspending,
7382 5 => Self::Suspended,
7383 _ => Self::UnknownValue(state::UnknownValue(
7384 wkt::internal::UnknownEnumValue::Integer(value),
7385 )),
7386 }
7387 }
7388 }
7389
7390 impl std::convert::From<&str> for State {
7391 fn from(value: &str) -> Self {
7392 use std::string::ToString;
7393 match value {
7394 "STATE_UNSPECIFIED" => Self::Unspecified,
7395 "ADDING" => Self::Adding,
7396 "ACTIVE" => Self::Active,
7397 "DELETING" => Self::Deleting,
7398 "SUSPENDING" => Self::Suspending,
7399 "SUSPENDED" => Self::Suspended,
7400 _ => Self::UnknownValue(state::UnknownValue(
7401 wkt::internal::UnknownEnumValue::String(value.to_string()),
7402 )),
7403 }
7404 }
7405 }
7406
7407 impl serde::ser::Serialize for State {
7408 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7409 where
7410 S: serde::Serializer,
7411 {
7412 match self {
7413 Self::Unspecified => serializer.serialize_i32(0),
7414 Self::Adding => serializer.serialize_i32(1),
7415 Self::Active => serializer.serialize_i32(2),
7416 Self::Deleting => serializer.serialize_i32(3),
7417 Self::Suspending => serializer.serialize_i32(4),
7418 Self::Suspended => serializer.serialize_i32(5),
7419 Self::UnknownValue(u) => u.0.serialize(serializer),
7420 }
7421 }
7422 }
7423
7424 impl<'de> serde::de::Deserialize<'de> for State {
7425 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7426 where
7427 D: serde::Deserializer<'de>,
7428 {
7429 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7430 ".google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata.State",
7431 ))
7432 }
7433 }
7434 }
7435}
7436
7437/// A service in your project in a region that is eligible for Data Transfer
7438/// Essentials configuration.
7439#[derive(Clone, Default, PartialEq)]
7440#[non_exhaustive]
7441pub struct MulticloudDataTransferSupportedService {
7442 /// Identifier. The name of the service.
7443 pub name: std::string::String,
7444
7445 /// Output only. The network service tier or regional endpoint supported for
7446 /// the service.
7447 pub service_configs: std::vec::Vec<crate::model::ServiceConfig>,
7448
7449 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7450}
7451
7452impl MulticloudDataTransferSupportedService {
7453 /// Creates a new default instance.
7454 pub fn new() -> Self {
7455 std::default::Default::default()
7456 }
7457
7458 /// Sets the value of [name][crate::model::MulticloudDataTransferSupportedService::name].
7459 ///
7460 /// # Example
7461 /// ```ignore,no_run
7462 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7463 /// # let project_id = "project_id";
7464 /// # let location_id = "location_id";
7465 /// # let multicloud_data_transfer_supported_service_id = "multicloud_data_transfer_supported_service_id";
7466 /// let x = MulticloudDataTransferSupportedService::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferSupportedServices/{multicloud_data_transfer_supported_service_id}"));
7467 /// ```
7468 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7469 self.name = v.into();
7470 self
7471 }
7472
7473 /// Sets the value of [service_configs][crate::model::MulticloudDataTransferSupportedService::service_configs].
7474 ///
7475 /// # Example
7476 /// ```ignore,no_run
7477 /// # use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7478 /// use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7479 /// let x = MulticloudDataTransferSupportedService::new()
7480 /// .set_service_configs([
7481 /// ServiceConfig::default()/* use setters */,
7482 /// ServiceConfig::default()/* use (different) setters */,
7483 /// ]);
7484 /// ```
7485 pub fn set_service_configs<T, V>(mut self, v: T) -> Self
7486 where
7487 T: std::iter::IntoIterator<Item = V>,
7488 V: std::convert::Into<crate::model::ServiceConfig>,
7489 {
7490 use std::iter::Iterator;
7491 self.service_configs = v.into_iter().map(|i| i.into()).collect();
7492 self
7493 }
7494}
7495
7496impl wkt::message::Message for MulticloudDataTransferSupportedService {
7497 fn typename() -> &'static str {
7498 "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferSupportedService"
7499 }
7500}
7501
7502/// Specifies eligibility information for the service.
7503#[derive(Clone, Default, PartialEq)]
7504#[non_exhaustive]
7505pub struct ServiceConfig {
7506 /// Output only. The eligibility criteria for the service.
7507 pub eligibility_criteria: crate::model::service_config::EligibilityCriteria,
7508
7509 /// Output only. The end time for eligibility criteria support. If not
7510 /// specified, no planned end time is set.
7511 pub support_end_time: std::option::Option<wkt::Timestamp>,
7512
7513 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7514}
7515
7516impl ServiceConfig {
7517 /// Creates a new default instance.
7518 pub fn new() -> Self {
7519 std::default::Default::default()
7520 }
7521
7522 /// Sets the value of [eligibility_criteria][crate::model::ServiceConfig::eligibility_criteria].
7523 ///
7524 /// # Example
7525 /// ```ignore,no_run
7526 /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7527 /// use google_cloud_networkconnectivity_v1::model::service_config::EligibilityCriteria;
7528 /// let x0 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::NetworkServiceTierPremiumOnly);
7529 /// let x1 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::NetworkServiceTierStandardOnly);
7530 /// let x2 = ServiceConfig::new().set_eligibility_criteria(EligibilityCriteria::RequestEndpointRegionalEndpointOnly);
7531 /// ```
7532 pub fn set_eligibility_criteria<
7533 T: std::convert::Into<crate::model::service_config::EligibilityCriteria>,
7534 >(
7535 mut self,
7536 v: T,
7537 ) -> Self {
7538 self.eligibility_criteria = v.into();
7539 self
7540 }
7541
7542 /// Sets the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
7543 ///
7544 /// # Example
7545 /// ```ignore,no_run
7546 /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7547 /// use wkt::Timestamp;
7548 /// let x = ServiceConfig::new().set_support_end_time(Timestamp::default()/* use setters */);
7549 /// ```
7550 pub fn set_support_end_time<T>(mut self, v: T) -> Self
7551 where
7552 T: std::convert::Into<wkt::Timestamp>,
7553 {
7554 self.support_end_time = std::option::Option::Some(v.into());
7555 self
7556 }
7557
7558 /// Sets or clears the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
7559 ///
7560 /// # Example
7561 /// ```ignore,no_run
7562 /// # use google_cloud_networkconnectivity_v1::model::ServiceConfig;
7563 /// use wkt::Timestamp;
7564 /// let x = ServiceConfig::new().set_or_clear_support_end_time(Some(Timestamp::default()/* use setters */));
7565 /// let x = ServiceConfig::new().set_or_clear_support_end_time(None::<Timestamp>);
7566 /// ```
7567 pub fn set_or_clear_support_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7568 where
7569 T: std::convert::Into<wkt::Timestamp>,
7570 {
7571 self.support_end_time = v.map(|x| x.into());
7572 self
7573 }
7574}
7575
7576impl wkt::message::Message for ServiceConfig {
7577 fn typename() -> &'static str {
7578 "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConfig"
7579 }
7580}
7581
7582/// Defines additional types related to [ServiceConfig].
7583pub mod service_config {
7584 #[allow(unused_imports)]
7585 use super::*;
7586
7587 /// The eligibility information for the service.
7588 ///
7589 /// # Working with unknown values
7590 ///
7591 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7592 /// additional enum variants at any time. Adding new variants is not considered
7593 /// a breaking change. Applications should write their code in anticipation of:
7594 ///
7595 /// - New values appearing in future releases of the client library, **and**
7596 /// - New values received dynamically, without application changes.
7597 ///
7598 /// Please consult the [Working with enums] section in the user guide for some
7599 /// guidelines.
7600 ///
7601 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7602 #[derive(Clone, Debug, PartialEq)]
7603 #[non_exhaustive]
7604 pub enum EligibilityCriteria {
7605 /// The service is not eligible for Data Transfer Essentials configuration.
7606 /// This is the default case.
7607 Unspecified,
7608 /// The service is eligible for Data Transfer Essentials configuration only
7609 /// for Premium Tier.
7610 NetworkServiceTierPremiumOnly,
7611 /// The service is eligible for Data Transfer Essentials configuration only
7612 /// for Standard Tier.
7613 NetworkServiceTierStandardOnly,
7614 /// The service is eligible for Data Transfer Essentials configuration only
7615 /// for the regional endpoint.
7616 RequestEndpointRegionalEndpointOnly,
7617 /// If set, the enum was initialized with an unknown value.
7618 ///
7619 /// Applications can examine the value using [EligibilityCriteria::value] or
7620 /// [EligibilityCriteria::name].
7621 UnknownValue(eligibility_criteria::UnknownValue),
7622 }
7623
7624 #[doc(hidden)]
7625 pub mod eligibility_criteria {
7626 #[allow(unused_imports)]
7627 use super::*;
7628 #[derive(Clone, Debug, PartialEq)]
7629 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7630 }
7631
7632 impl EligibilityCriteria {
7633 /// Gets the enum value.
7634 ///
7635 /// Returns `None` if the enum contains an unknown value deserialized from
7636 /// the string representation of enums.
7637 pub fn value(&self) -> std::option::Option<i32> {
7638 match self {
7639 Self::Unspecified => std::option::Option::Some(0),
7640 Self::NetworkServiceTierPremiumOnly => std::option::Option::Some(1),
7641 Self::NetworkServiceTierStandardOnly => std::option::Option::Some(2),
7642 Self::RequestEndpointRegionalEndpointOnly => std::option::Option::Some(3),
7643 Self::UnknownValue(u) => u.0.value(),
7644 }
7645 }
7646
7647 /// Gets the enum value as a string.
7648 ///
7649 /// Returns `None` if the enum contains an unknown value deserialized from
7650 /// the integer representation of enums.
7651 pub fn name(&self) -> std::option::Option<&str> {
7652 match self {
7653 Self::Unspecified => std::option::Option::Some("ELIGIBILITY_CRITERIA_UNSPECIFIED"),
7654 Self::NetworkServiceTierPremiumOnly => {
7655 std::option::Option::Some("NETWORK_SERVICE_TIER_PREMIUM_ONLY")
7656 }
7657 Self::NetworkServiceTierStandardOnly => {
7658 std::option::Option::Some("NETWORK_SERVICE_TIER_STANDARD_ONLY")
7659 }
7660 Self::RequestEndpointRegionalEndpointOnly => {
7661 std::option::Option::Some("REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY")
7662 }
7663 Self::UnknownValue(u) => u.0.name(),
7664 }
7665 }
7666 }
7667
7668 impl std::default::Default for EligibilityCriteria {
7669 fn default() -> Self {
7670 use std::convert::From;
7671 Self::from(0)
7672 }
7673 }
7674
7675 impl std::fmt::Display for EligibilityCriteria {
7676 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7677 wkt::internal::display_enum(f, self.name(), self.value())
7678 }
7679 }
7680
7681 impl std::convert::From<i32> for EligibilityCriteria {
7682 fn from(value: i32) -> Self {
7683 match value {
7684 0 => Self::Unspecified,
7685 1 => Self::NetworkServiceTierPremiumOnly,
7686 2 => Self::NetworkServiceTierStandardOnly,
7687 3 => Self::RequestEndpointRegionalEndpointOnly,
7688 _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
7689 wkt::internal::UnknownEnumValue::Integer(value),
7690 )),
7691 }
7692 }
7693 }
7694
7695 impl std::convert::From<&str> for EligibilityCriteria {
7696 fn from(value: &str) -> Self {
7697 use std::string::ToString;
7698 match value {
7699 "ELIGIBILITY_CRITERIA_UNSPECIFIED" => Self::Unspecified,
7700 "NETWORK_SERVICE_TIER_PREMIUM_ONLY" => Self::NetworkServiceTierPremiumOnly,
7701 "NETWORK_SERVICE_TIER_STANDARD_ONLY" => Self::NetworkServiceTierStandardOnly,
7702 "REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY" => {
7703 Self::RequestEndpointRegionalEndpointOnly
7704 }
7705 _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
7706 wkt::internal::UnknownEnumValue::String(value.to_string()),
7707 )),
7708 }
7709 }
7710 }
7711
7712 impl serde::ser::Serialize for EligibilityCriteria {
7713 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7714 where
7715 S: serde::Serializer,
7716 {
7717 match self {
7718 Self::Unspecified => serializer.serialize_i32(0),
7719 Self::NetworkServiceTierPremiumOnly => serializer.serialize_i32(1),
7720 Self::NetworkServiceTierStandardOnly => serializer.serialize_i32(2),
7721 Self::RequestEndpointRegionalEndpointOnly => serializer.serialize_i32(3),
7722 Self::UnknownValue(u) => u.0.serialize(serializer),
7723 }
7724 }
7725 }
7726
7727 impl<'de> serde::de::Deserialize<'de> for EligibilityCriteria {
7728 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7729 where
7730 D: serde::Deserializer<'de>,
7731 {
7732 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EligibilityCriteria>::new(
7733 ".google.cloud.networkconnectivity.v1.ServiceConfig.EligibilityCriteria",
7734 ))
7735 }
7736 }
7737}
7738
7739/// Request message to check if a service in your project in a region is
7740/// eligible for Data Transfer Essentials configuration.
7741#[derive(Clone, Default, PartialEq)]
7742#[non_exhaustive]
7743pub struct GetMulticloudDataTransferSupportedServiceRequest {
7744 /// Required. The name of the service.
7745 pub name: std::string::String,
7746
7747 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7748}
7749
7750impl GetMulticloudDataTransferSupportedServiceRequest {
7751 /// Creates a new default instance.
7752 pub fn new() -> Self {
7753 std::default::Default::default()
7754 }
7755
7756 /// Sets the value of [name][crate::model::GetMulticloudDataTransferSupportedServiceRequest::name].
7757 ///
7758 /// # Example
7759 /// ```ignore,no_run
7760 /// # use google_cloud_networkconnectivity_v1::model::GetMulticloudDataTransferSupportedServiceRequest;
7761 /// # let project_id = "project_id";
7762 /// # let location_id = "location_id";
7763 /// # let multicloud_data_transfer_supported_service_id = "multicloud_data_transfer_supported_service_id";
7764 /// let x = GetMulticloudDataTransferSupportedServiceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/multicloudDataTransferSupportedServices/{multicloud_data_transfer_supported_service_id}"));
7765 /// ```
7766 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7767 self.name = v.into();
7768 self
7769 }
7770}
7771
7772impl wkt::message::Message for GetMulticloudDataTransferSupportedServiceRequest {
7773 fn typename() -> &'static str {
7774 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferSupportedServiceRequest"
7775 }
7776}
7777
7778/// Request message to list the services in your project that are eligible for
7779/// Data Transfer Essentials configuration.
7780#[derive(Clone, Default, PartialEq)]
7781#[non_exhaustive]
7782pub struct ListMulticloudDataTransferSupportedServicesRequest {
7783 /// Required. The name of the parent resource.
7784 pub parent: std::string::String,
7785
7786 /// Optional. The maximum number of results listed per page.
7787 pub page_size: i32,
7788
7789 /// Optional. The page token.
7790 pub page_token: std::string::String,
7791
7792 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7793}
7794
7795impl ListMulticloudDataTransferSupportedServicesRequest {
7796 /// Creates a new default instance.
7797 pub fn new() -> Self {
7798 std::default::Default::default()
7799 }
7800
7801 /// Sets the value of [parent][crate::model::ListMulticloudDataTransferSupportedServicesRequest::parent].
7802 ///
7803 /// # Example
7804 /// ```ignore,no_run
7805 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7806 /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_parent("example");
7807 /// ```
7808 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7809 self.parent = v.into();
7810 self
7811 }
7812
7813 /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_size].
7814 ///
7815 /// # Example
7816 /// ```ignore,no_run
7817 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7818 /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_page_size(42);
7819 /// ```
7820 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7821 self.page_size = v.into();
7822 self
7823 }
7824
7825 /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_token].
7826 ///
7827 /// # Example
7828 /// ```ignore,no_run
7829 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesRequest;
7830 /// let x = ListMulticloudDataTransferSupportedServicesRequest::new().set_page_token("example");
7831 /// ```
7832 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7833 self.page_token = v.into();
7834 self
7835 }
7836}
7837
7838impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesRequest {
7839 fn typename() -> &'static str {
7840 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesRequest"
7841 }
7842}
7843
7844/// Response message to list the services in your project in regions that are
7845/// eligible for Data Transfer Essentials configuration.
7846#[derive(Clone, Default, PartialEq)]
7847#[non_exhaustive]
7848pub struct ListMulticloudDataTransferSupportedServicesResponse {
7849 /// The list of supported services.
7850 pub multicloud_data_transfer_supported_services:
7851 std::vec::Vec<crate::model::MulticloudDataTransferSupportedService>,
7852
7853 /// The next page token.
7854 pub next_page_token: std::string::String,
7855
7856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7857}
7858
7859impl ListMulticloudDataTransferSupportedServicesResponse {
7860 /// Creates a new default instance.
7861 pub fn new() -> Self {
7862 std::default::Default::default()
7863 }
7864
7865 /// Sets the value of [multicloud_data_transfer_supported_services][crate::model::ListMulticloudDataTransferSupportedServicesResponse::multicloud_data_transfer_supported_services].
7866 ///
7867 /// # Example
7868 /// ```ignore,no_run
7869 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesResponse;
7870 /// use google_cloud_networkconnectivity_v1::model::MulticloudDataTransferSupportedService;
7871 /// let x = ListMulticloudDataTransferSupportedServicesResponse::new()
7872 /// .set_multicloud_data_transfer_supported_services([
7873 /// MulticloudDataTransferSupportedService::default()/* use setters */,
7874 /// MulticloudDataTransferSupportedService::default()/* use (different) setters */,
7875 /// ]);
7876 /// ```
7877 pub fn set_multicloud_data_transfer_supported_services<T, V>(mut self, v: T) -> Self
7878 where
7879 T: std::iter::IntoIterator<Item = V>,
7880 V: std::convert::Into<crate::model::MulticloudDataTransferSupportedService>,
7881 {
7882 use std::iter::Iterator;
7883 self.multicloud_data_transfer_supported_services =
7884 v.into_iter().map(|i| i.into()).collect();
7885 self
7886 }
7887
7888 /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferSupportedServicesResponse::next_page_token].
7889 ///
7890 /// # Example
7891 /// ```ignore,no_run
7892 /// # use google_cloud_networkconnectivity_v1::model::ListMulticloudDataTransferSupportedServicesResponse;
7893 /// let x = ListMulticloudDataTransferSupportedServicesResponse::new().set_next_page_token("example");
7894 /// ```
7895 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7896 self.next_page_token = v.into();
7897 self
7898 }
7899}
7900
7901impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesResponse {
7902 fn typename() -> &'static str {
7903 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesResponse"
7904 }
7905}
7906
7907#[doc(hidden)]
7908impl google_cloud_gax::paginator::internal::PageableResponse
7909 for ListMulticloudDataTransferSupportedServicesResponse
7910{
7911 type PageItem = crate::model::MulticloudDataTransferSupportedService;
7912
7913 fn items(self) -> std::vec::Vec<Self::PageItem> {
7914 self.multicloud_data_transfer_supported_services
7915 }
7916
7917 fn next_page_token(&self) -> std::string::String {
7918 use std::clone::Clone;
7919 self.next_page_token.clone()
7920 }
7921}
7922
7923/// A Network Connectivity Center hub is a global management resource to which
7924/// you attach spokes. A single hub can contain spokes from multiple regions.
7925/// However, if any of a hub's spokes use the site-to-site data transfer feature,
7926/// the resources associated with those spokes must all be in the same VPC
7927/// network. Spokes that do not use site-to-site data transfer can be associated
7928/// with any VPC network in your project.
7929#[derive(Clone, Default, PartialEq)]
7930#[non_exhaustive]
7931pub struct Hub {
7932 /// Immutable. The name of the hub. Hub names must be unique. They use the
7933 /// following form:
7934 /// `projects/{project_number}/locations/global/hubs/{hub_id}`
7935 pub name: std::string::String,
7936
7937 /// Output only. The time the hub was created.
7938 pub create_time: std::option::Option<wkt::Timestamp>,
7939
7940 /// Output only. The time the hub was last updated.
7941 pub update_time: std::option::Option<wkt::Timestamp>,
7942
7943 /// Optional labels in key-value pair format. For more information about
7944 /// labels, see [Requirements for
7945 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
7946 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7947
7948 /// Optional. An optional description of the hub.
7949 pub description: std::string::String,
7950
7951 /// Output only. The Google-generated UUID for the hub. This value is unique
7952 /// across all hub resources. If a hub is deleted and another with the same
7953 /// name is created, the new hub is assigned a different unique_id.
7954 pub unique_id: std::string::String,
7955
7956 /// Output only. The current lifecycle state of this hub.
7957 pub state: crate::model::State,
7958
7959 /// The VPC networks associated with this hub's spokes.
7960 ///
7961 /// This field is read-only. Network Connectivity Center automatically
7962 /// populates it based on the set of spokes attached to the hub.
7963 pub routing_vpcs: std::vec::Vec<crate::model::RoutingVPC>,
7964
7965 /// Output only. The route tables that belong to this hub. They use the
7966 /// following form:
7967 /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
7968 ///
7969 /// This field is read-only. Network Connectivity Center automatically
7970 /// populates it based on the route tables nested under the hub.
7971 pub route_tables: std::vec::Vec<std::string::String>,
7972
7973 /// Output only. A summary of the spokes associated with a hub. The
7974 /// summary includes a count of spokes according to type
7975 /// and according to state. If any spokes are inactive,
7976 /// the summary also lists the reasons they are inactive,
7977 /// including a count for each reason.
7978 pub spoke_summary: std::option::Option<crate::model::SpokeSummary>,
7979
7980 /// Optional. The policy mode of this hub. This field can be either
7981 /// PRESET or CUSTOM. If unspecified, the
7982 /// policy_mode defaults to PRESET.
7983 pub policy_mode: crate::model::PolicyMode,
7984
7985 /// Optional. The topology implemented in this hub. Currently, this field is
7986 /// only used when policy_mode = PRESET. The available preset topologies are
7987 /// MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET,
7988 /// the preset_topology defaults to MESH. When policy_mode = CUSTOM,
7989 /// the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED.
7990 pub preset_topology: crate::model::PresetTopology,
7991
7992 /// Optional. Whether Private Service Connect connection propagation is enabled
7993 /// for the hub. If true, Private Service Connect endpoints in VPC spokes
7994 /// attached to the hub are made accessible to other VPC spokes attached to the
7995 /// hub. The default value is false.
7996 pub export_psc: std::option::Option<bool>,
7997
7998 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7999}
8000
8001impl Hub {
8002 /// Creates a new default instance.
8003 pub fn new() -> Self {
8004 std::default::Default::default()
8005 }
8006
8007 /// Sets the value of [name][crate::model::Hub::name].
8008 ///
8009 /// # Example
8010 /// ```ignore,no_run
8011 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8012 /// # let project_id = "project_id";
8013 /// # let hub_id = "hub_id";
8014 /// let x = Hub::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
8015 /// ```
8016 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8017 self.name = v.into();
8018 self
8019 }
8020
8021 /// Sets the value of [create_time][crate::model::Hub::create_time].
8022 ///
8023 /// # Example
8024 /// ```ignore,no_run
8025 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8026 /// use wkt::Timestamp;
8027 /// let x = Hub::new().set_create_time(Timestamp::default()/* use setters */);
8028 /// ```
8029 pub fn set_create_time<T>(mut self, v: T) -> Self
8030 where
8031 T: std::convert::Into<wkt::Timestamp>,
8032 {
8033 self.create_time = std::option::Option::Some(v.into());
8034 self
8035 }
8036
8037 /// Sets or clears the value of [create_time][crate::model::Hub::create_time].
8038 ///
8039 /// # Example
8040 /// ```ignore,no_run
8041 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8042 /// use wkt::Timestamp;
8043 /// let x = Hub::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8044 /// let x = Hub::new().set_or_clear_create_time(None::<Timestamp>);
8045 /// ```
8046 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8047 where
8048 T: std::convert::Into<wkt::Timestamp>,
8049 {
8050 self.create_time = v.map(|x| x.into());
8051 self
8052 }
8053
8054 /// Sets the value of [update_time][crate::model::Hub::update_time].
8055 ///
8056 /// # Example
8057 /// ```ignore,no_run
8058 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8059 /// use wkt::Timestamp;
8060 /// let x = Hub::new().set_update_time(Timestamp::default()/* use setters */);
8061 /// ```
8062 pub fn set_update_time<T>(mut self, v: T) -> Self
8063 where
8064 T: std::convert::Into<wkt::Timestamp>,
8065 {
8066 self.update_time = std::option::Option::Some(v.into());
8067 self
8068 }
8069
8070 /// Sets or clears the value of [update_time][crate::model::Hub::update_time].
8071 ///
8072 /// # Example
8073 /// ```ignore,no_run
8074 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8075 /// use wkt::Timestamp;
8076 /// let x = Hub::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8077 /// let x = Hub::new().set_or_clear_update_time(None::<Timestamp>);
8078 /// ```
8079 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8080 where
8081 T: std::convert::Into<wkt::Timestamp>,
8082 {
8083 self.update_time = v.map(|x| x.into());
8084 self
8085 }
8086
8087 /// Sets the value of [labels][crate::model::Hub::labels].
8088 ///
8089 /// # Example
8090 /// ```ignore,no_run
8091 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8092 /// let x = Hub::new().set_labels([
8093 /// ("key0", "abc"),
8094 /// ("key1", "xyz"),
8095 /// ]);
8096 /// ```
8097 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8098 where
8099 T: std::iter::IntoIterator<Item = (K, V)>,
8100 K: std::convert::Into<std::string::String>,
8101 V: std::convert::Into<std::string::String>,
8102 {
8103 use std::iter::Iterator;
8104 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8105 self
8106 }
8107
8108 /// Sets the value of [description][crate::model::Hub::description].
8109 ///
8110 /// # Example
8111 /// ```ignore,no_run
8112 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8113 /// let x = Hub::new().set_description("example");
8114 /// ```
8115 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8116 self.description = v.into();
8117 self
8118 }
8119
8120 /// Sets the value of [unique_id][crate::model::Hub::unique_id].
8121 ///
8122 /// # Example
8123 /// ```ignore,no_run
8124 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8125 /// let x = Hub::new().set_unique_id("example");
8126 /// ```
8127 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8128 self.unique_id = v.into();
8129 self
8130 }
8131
8132 /// Sets the value of [state][crate::model::Hub::state].
8133 ///
8134 /// # Example
8135 /// ```ignore,no_run
8136 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8137 /// use google_cloud_networkconnectivity_v1::model::State;
8138 /// let x0 = Hub::new().set_state(State::Creating);
8139 /// let x1 = Hub::new().set_state(State::Active);
8140 /// let x2 = Hub::new().set_state(State::Deleting);
8141 /// ```
8142 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
8143 self.state = v.into();
8144 self
8145 }
8146
8147 /// Sets the value of [routing_vpcs][crate::model::Hub::routing_vpcs].
8148 ///
8149 /// # Example
8150 /// ```ignore,no_run
8151 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8152 /// use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8153 /// let x = Hub::new()
8154 /// .set_routing_vpcs([
8155 /// RoutingVPC::default()/* use setters */,
8156 /// RoutingVPC::default()/* use (different) setters */,
8157 /// ]);
8158 /// ```
8159 pub fn set_routing_vpcs<T, V>(mut self, v: T) -> Self
8160 where
8161 T: std::iter::IntoIterator<Item = V>,
8162 V: std::convert::Into<crate::model::RoutingVPC>,
8163 {
8164 use std::iter::Iterator;
8165 self.routing_vpcs = v.into_iter().map(|i| i.into()).collect();
8166 self
8167 }
8168
8169 /// Sets the value of [route_tables][crate::model::Hub::route_tables].
8170 ///
8171 /// # Example
8172 /// ```ignore,no_run
8173 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8174 /// let x = Hub::new().set_route_tables(["a", "b", "c"]);
8175 /// ```
8176 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
8177 where
8178 T: std::iter::IntoIterator<Item = V>,
8179 V: std::convert::Into<std::string::String>,
8180 {
8181 use std::iter::Iterator;
8182 self.route_tables = v.into_iter().map(|i| i.into()).collect();
8183 self
8184 }
8185
8186 /// Sets the value of [spoke_summary][crate::model::Hub::spoke_summary].
8187 ///
8188 /// # Example
8189 /// ```ignore,no_run
8190 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8191 /// use google_cloud_networkconnectivity_v1::model::SpokeSummary;
8192 /// let x = Hub::new().set_spoke_summary(SpokeSummary::default()/* use setters */);
8193 /// ```
8194 pub fn set_spoke_summary<T>(mut self, v: T) -> Self
8195 where
8196 T: std::convert::Into<crate::model::SpokeSummary>,
8197 {
8198 self.spoke_summary = std::option::Option::Some(v.into());
8199 self
8200 }
8201
8202 /// Sets or clears the value of [spoke_summary][crate::model::Hub::spoke_summary].
8203 ///
8204 /// # Example
8205 /// ```ignore,no_run
8206 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8207 /// use google_cloud_networkconnectivity_v1::model::SpokeSummary;
8208 /// let x = Hub::new().set_or_clear_spoke_summary(Some(SpokeSummary::default()/* use setters */));
8209 /// let x = Hub::new().set_or_clear_spoke_summary(None::<SpokeSummary>);
8210 /// ```
8211 pub fn set_or_clear_spoke_summary<T>(mut self, v: std::option::Option<T>) -> Self
8212 where
8213 T: std::convert::Into<crate::model::SpokeSummary>,
8214 {
8215 self.spoke_summary = v.map(|x| x.into());
8216 self
8217 }
8218
8219 /// Sets the value of [policy_mode][crate::model::Hub::policy_mode].
8220 ///
8221 /// # Example
8222 /// ```ignore,no_run
8223 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8224 /// use google_cloud_networkconnectivity_v1::model::PolicyMode;
8225 /// let x0 = Hub::new().set_policy_mode(PolicyMode::Preset);
8226 /// ```
8227 pub fn set_policy_mode<T: std::convert::Into<crate::model::PolicyMode>>(
8228 mut self,
8229 v: T,
8230 ) -> Self {
8231 self.policy_mode = v.into();
8232 self
8233 }
8234
8235 /// Sets the value of [preset_topology][crate::model::Hub::preset_topology].
8236 ///
8237 /// # Example
8238 /// ```ignore,no_run
8239 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8240 /// use google_cloud_networkconnectivity_v1::model::PresetTopology;
8241 /// let x0 = Hub::new().set_preset_topology(PresetTopology::Mesh);
8242 /// let x1 = Hub::new().set_preset_topology(PresetTopology::Star);
8243 /// ```
8244 pub fn set_preset_topology<T: std::convert::Into<crate::model::PresetTopology>>(
8245 mut self,
8246 v: T,
8247 ) -> Self {
8248 self.preset_topology = v.into();
8249 self
8250 }
8251
8252 /// Sets the value of [export_psc][crate::model::Hub::export_psc].
8253 ///
8254 /// # Example
8255 /// ```ignore,no_run
8256 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8257 /// let x = Hub::new().set_export_psc(true);
8258 /// ```
8259 pub fn set_export_psc<T>(mut self, v: T) -> Self
8260 where
8261 T: std::convert::Into<bool>,
8262 {
8263 self.export_psc = std::option::Option::Some(v.into());
8264 self
8265 }
8266
8267 /// Sets or clears the value of [export_psc][crate::model::Hub::export_psc].
8268 ///
8269 /// # Example
8270 /// ```ignore,no_run
8271 /// # use google_cloud_networkconnectivity_v1::model::Hub;
8272 /// let x = Hub::new().set_or_clear_export_psc(Some(false));
8273 /// let x = Hub::new().set_or_clear_export_psc(None::<bool>);
8274 /// ```
8275 pub fn set_or_clear_export_psc<T>(mut self, v: std::option::Option<T>) -> Self
8276 where
8277 T: std::convert::Into<bool>,
8278 {
8279 self.export_psc = v.map(|x| x.into());
8280 self
8281 }
8282}
8283
8284impl wkt::message::Message for Hub {
8285 fn typename() -> &'static str {
8286 "type.googleapis.com/google.cloud.networkconnectivity.v1.Hub"
8287 }
8288}
8289
8290/// RoutingVPC contains information about the VPC networks associated
8291/// with the spokes of a Network Connectivity Center hub.
8292#[derive(Clone, Default, PartialEq)]
8293#[non_exhaustive]
8294pub struct RoutingVPC {
8295 /// The URI of the VPC network.
8296 pub uri: std::string::String,
8297
8298 /// Output only. If true, indicates that this VPC network is currently
8299 /// associated with spokes that use the data transfer feature (spokes where the
8300 /// site_to_site_data_transfer field is set to true). If you create new spokes
8301 /// that use data transfer, they must be associated with this VPC network. At
8302 /// most, one VPC network will have this field set to true.
8303 pub required_for_new_site_to_site_data_transfer_spokes: bool,
8304
8305 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8306}
8307
8308impl RoutingVPC {
8309 /// Creates a new default instance.
8310 pub fn new() -> Self {
8311 std::default::Default::default()
8312 }
8313
8314 /// Sets the value of [uri][crate::model::RoutingVPC::uri].
8315 ///
8316 /// # Example
8317 /// ```ignore,no_run
8318 /// # use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8319 /// let x = RoutingVPC::new().set_uri("example");
8320 /// ```
8321 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8322 self.uri = v.into();
8323 self
8324 }
8325
8326 /// 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].
8327 ///
8328 /// # Example
8329 /// ```ignore,no_run
8330 /// # use google_cloud_networkconnectivity_v1::model::RoutingVPC;
8331 /// let x = RoutingVPC::new().set_required_for_new_site_to_site_data_transfer_spokes(true);
8332 /// ```
8333 pub fn set_required_for_new_site_to_site_data_transfer_spokes<T: std::convert::Into<bool>>(
8334 mut self,
8335 v: T,
8336 ) -> Self {
8337 self.required_for_new_site_to_site_data_transfer_spokes = v.into();
8338 self
8339 }
8340}
8341
8342impl wkt::message::Message for RoutingVPC {
8343 fn typename() -> &'static str {
8344 "type.googleapis.com/google.cloud.networkconnectivity.v1.RoutingVPC"
8345 }
8346}
8347
8348/// A Network Connectivity Center spoke represents one or more network
8349/// connectivity resources.
8350///
8351/// When you create a spoke, you associate it with a hub. You must also
8352/// identify a value for exactly one of the following fields:
8353///
8354/// * linked_vpn_tunnels
8355/// * linked_interconnect_attachments
8356/// * linked_router_appliance_instances
8357/// * linked_vpc_network
8358#[derive(Clone, Default, PartialEq)]
8359#[non_exhaustive]
8360pub struct Spoke {
8361 /// Immutable. The name of the spoke. Spoke names must be unique. They use the
8362 /// following form:
8363 /// `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
8364 pub name: std::string::String,
8365
8366 /// Output only. The time the spoke was created.
8367 pub create_time: std::option::Option<wkt::Timestamp>,
8368
8369 /// Output only. The time the spoke was last updated.
8370 pub update_time: std::option::Option<wkt::Timestamp>,
8371
8372 /// Optional labels in key-value pair format. For more information about
8373 /// labels, see [Requirements for
8374 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
8375 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8376
8377 /// Optional. An optional description of the spoke.
8378 pub description: std::string::String,
8379
8380 /// Immutable. The name of the hub that this spoke is attached to.
8381 pub hub: std::string::String,
8382
8383 /// Optional. The name of the group that this spoke is associated with.
8384 pub group: std::string::String,
8385
8386 /// Optional. VPN tunnels that are associated with the spoke.
8387 pub linked_vpn_tunnels: std::option::Option<crate::model::LinkedVpnTunnels>,
8388
8389 /// Optional. VLAN attachments that are associated with the spoke.
8390 pub linked_interconnect_attachments:
8391 std::option::Option<crate::model::LinkedInterconnectAttachments>,
8392
8393 /// Optional. Router appliance instances that are associated with the spoke.
8394 pub linked_router_appliance_instances:
8395 std::option::Option<crate::model::LinkedRouterApplianceInstances>,
8396
8397 /// Optional. VPC network that is associated with the spoke.
8398 pub linked_vpc_network: std::option::Option<crate::model::LinkedVpcNetwork>,
8399
8400 /// Optional. The linked producer VPC that is associated with the spoke.
8401 pub linked_producer_vpc_network: std::option::Option<crate::model::LinkedProducerVpcNetwork>,
8402
8403 /// Output only. The Google-generated UUID for the spoke. This value is unique
8404 /// across all spoke resources. If a spoke is deleted and another with the same
8405 /// name is created, the new spoke is assigned a different `unique_id`.
8406 pub unique_id: std::string::String,
8407
8408 /// Output only. The current lifecycle state of this spoke.
8409 pub state: crate::model::State,
8410
8411 /// Output only. The reasons for current state of the spoke.
8412 pub reasons: std::vec::Vec<crate::model::spoke::StateReason>,
8413
8414 /// Output only. The type of resource associated with the spoke.
8415 pub spoke_type: crate::model::SpokeType,
8416
8417 /// Optional. This checksum is computed by the server based on the value of
8418 /// other fields, and may be sent on update and delete requests to ensure the
8419 /// client has an up-to-date value before proceeding.
8420 pub etag: std::string::String,
8421
8422 /// Optional. The list of fields waiting for hub administration's approval.
8423 pub field_paths_pending_update: std::vec::Vec<std::string::String>,
8424
8425 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8426}
8427
8428impl Spoke {
8429 /// Creates a new default instance.
8430 pub fn new() -> Self {
8431 std::default::Default::default()
8432 }
8433
8434 /// Sets the value of [name][crate::model::Spoke::name].
8435 ///
8436 /// # Example
8437 /// ```ignore,no_run
8438 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8439 /// # let project_id = "project_id";
8440 /// # let location_id = "location_id";
8441 /// # let spoke_id = "spoke_id";
8442 /// let x = Spoke::new().set_name(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
8443 /// ```
8444 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8445 self.name = v.into();
8446 self
8447 }
8448
8449 /// Sets the value of [create_time][crate::model::Spoke::create_time].
8450 ///
8451 /// # Example
8452 /// ```ignore,no_run
8453 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8454 /// use wkt::Timestamp;
8455 /// let x = Spoke::new().set_create_time(Timestamp::default()/* use setters */);
8456 /// ```
8457 pub fn set_create_time<T>(mut self, v: T) -> Self
8458 where
8459 T: std::convert::Into<wkt::Timestamp>,
8460 {
8461 self.create_time = std::option::Option::Some(v.into());
8462 self
8463 }
8464
8465 /// Sets or clears the value of [create_time][crate::model::Spoke::create_time].
8466 ///
8467 /// # Example
8468 /// ```ignore,no_run
8469 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8470 /// use wkt::Timestamp;
8471 /// let x = Spoke::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8472 /// let x = Spoke::new().set_or_clear_create_time(None::<Timestamp>);
8473 /// ```
8474 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8475 where
8476 T: std::convert::Into<wkt::Timestamp>,
8477 {
8478 self.create_time = v.map(|x| x.into());
8479 self
8480 }
8481
8482 /// Sets the value of [update_time][crate::model::Spoke::update_time].
8483 ///
8484 /// # Example
8485 /// ```ignore,no_run
8486 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8487 /// use wkt::Timestamp;
8488 /// let x = Spoke::new().set_update_time(Timestamp::default()/* use setters */);
8489 /// ```
8490 pub fn set_update_time<T>(mut self, v: T) -> Self
8491 where
8492 T: std::convert::Into<wkt::Timestamp>,
8493 {
8494 self.update_time = std::option::Option::Some(v.into());
8495 self
8496 }
8497
8498 /// Sets or clears the value of [update_time][crate::model::Spoke::update_time].
8499 ///
8500 /// # Example
8501 /// ```ignore,no_run
8502 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8503 /// use wkt::Timestamp;
8504 /// let x = Spoke::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8505 /// let x = Spoke::new().set_or_clear_update_time(None::<Timestamp>);
8506 /// ```
8507 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8508 where
8509 T: std::convert::Into<wkt::Timestamp>,
8510 {
8511 self.update_time = v.map(|x| x.into());
8512 self
8513 }
8514
8515 /// Sets the value of [labels][crate::model::Spoke::labels].
8516 ///
8517 /// # Example
8518 /// ```ignore,no_run
8519 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8520 /// let x = Spoke::new().set_labels([
8521 /// ("key0", "abc"),
8522 /// ("key1", "xyz"),
8523 /// ]);
8524 /// ```
8525 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8526 where
8527 T: std::iter::IntoIterator<Item = (K, V)>,
8528 K: std::convert::Into<std::string::String>,
8529 V: std::convert::Into<std::string::String>,
8530 {
8531 use std::iter::Iterator;
8532 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8533 self
8534 }
8535
8536 /// Sets the value of [description][crate::model::Spoke::description].
8537 ///
8538 /// # Example
8539 /// ```ignore,no_run
8540 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8541 /// let x = Spoke::new().set_description("example");
8542 /// ```
8543 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8544 self.description = v.into();
8545 self
8546 }
8547
8548 /// Sets the value of [hub][crate::model::Spoke::hub].
8549 ///
8550 /// # Example
8551 /// ```ignore,no_run
8552 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8553 /// # let project_id = "project_id";
8554 /// # let hub_id = "hub_id";
8555 /// let x = Spoke::new().set_hub(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
8556 /// ```
8557 pub fn set_hub<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8558 self.hub = v.into();
8559 self
8560 }
8561
8562 /// Sets the value of [group][crate::model::Spoke::group].
8563 ///
8564 /// # Example
8565 /// ```ignore,no_run
8566 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8567 /// # let project_id = "project_id";
8568 /// # let hub_id = "hub_id";
8569 /// # let group_id = "group_id";
8570 /// let x = Spoke::new().set_group(format!("projects/{project_id}/locations/global/hubs/{hub_id}/groups/{group_id}"));
8571 /// ```
8572 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8573 self.group = v.into();
8574 self
8575 }
8576
8577 /// Sets the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
8578 ///
8579 /// # Example
8580 /// ```ignore,no_run
8581 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8582 /// use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
8583 /// let x = Spoke::new().set_linked_vpn_tunnels(LinkedVpnTunnels::default()/* use setters */);
8584 /// ```
8585 pub fn set_linked_vpn_tunnels<T>(mut self, v: T) -> Self
8586 where
8587 T: std::convert::Into<crate::model::LinkedVpnTunnels>,
8588 {
8589 self.linked_vpn_tunnels = std::option::Option::Some(v.into());
8590 self
8591 }
8592
8593 /// Sets or clears the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
8594 ///
8595 /// # Example
8596 /// ```ignore,no_run
8597 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8598 /// use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
8599 /// let x = Spoke::new().set_or_clear_linked_vpn_tunnels(Some(LinkedVpnTunnels::default()/* use setters */));
8600 /// let x = Spoke::new().set_or_clear_linked_vpn_tunnels(None::<LinkedVpnTunnels>);
8601 /// ```
8602 pub fn set_or_clear_linked_vpn_tunnels<T>(mut self, v: std::option::Option<T>) -> Self
8603 where
8604 T: std::convert::Into<crate::model::LinkedVpnTunnels>,
8605 {
8606 self.linked_vpn_tunnels = v.map(|x| x.into());
8607 self
8608 }
8609
8610 /// Sets the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
8611 ///
8612 /// # Example
8613 /// ```ignore,no_run
8614 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8615 /// use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
8616 /// let x = Spoke::new().set_linked_interconnect_attachments(LinkedInterconnectAttachments::default()/* use setters */);
8617 /// ```
8618 pub fn set_linked_interconnect_attachments<T>(mut self, v: T) -> Self
8619 where
8620 T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
8621 {
8622 self.linked_interconnect_attachments = std::option::Option::Some(v.into());
8623 self
8624 }
8625
8626 /// Sets or clears the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
8627 ///
8628 /// # Example
8629 /// ```ignore,no_run
8630 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8631 /// use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
8632 /// let x = Spoke::new().set_or_clear_linked_interconnect_attachments(Some(LinkedInterconnectAttachments::default()/* use setters */));
8633 /// let x = Spoke::new().set_or_clear_linked_interconnect_attachments(None::<LinkedInterconnectAttachments>);
8634 /// ```
8635 pub fn set_or_clear_linked_interconnect_attachments<T>(
8636 mut self,
8637 v: std::option::Option<T>,
8638 ) -> Self
8639 where
8640 T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
8641 {
8642 self.linked_interconnect_attachments = v.map(|x| x.into());
8643 self
8644 }
8645
8646 /// Sets the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
8647 ///
8648 /// # Example
8649 /// ```ignore,no_run
8650 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8651 /// use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
8652 /// let x = Spoke::new().set_linked_router_appliance_instances(LinkedRouterApplianceInstances::default()/* use setters */);
8653 /// ```
8654 pub fn set_linked_router_appliance_instances<T>(mut self, v: T) -> Self
8655 where
8656 T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
8657 {
8658 self.linked_router_appliance_instances = std::option::Option::Some(v.into());
8659 self
8660 }
8661
8662 /// Sets or clears the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
8663 ///
8664 /// # Example
8665 /// ```ignore,no_run
8666 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8667 /// use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
8668 /// let x = Spoke::new().set_or_clear_linked_router_appliance_instances(Some(LinkedRouterApplianceInstances::default()/* use setters */));
8669 /// let x = Spoke::new().set_or_clear_linked_router_appliance_instances(None::<LinkedRouterApplianceInstances>);
8670 /// ```
8671 pub fn set_or_clear_linked_router_appliance_instances<T>(
8672 mut self,
8673 v: std::option::Option<T>,
8674 ) -> Self
8675 where
8676 T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
8677 {
8678 self.linked_router_appliance_instances = v.map(|x| x.into());
8679 self
8680 }
8681
8682 /// Sets the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
8683 ///
8684 /// # Example
8685 /// ```ignore,no_run
8686 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8687 /// use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
8688 /// let x = Spoke::new().set_linked_vpc_network(LinkedVpcNetwork::default()/* use setters */);
8689 /// ```
8690 pub fn set_linked_vpc_network<T>(mut self, v: T) -> Self
8691 where
8692 T: std::convert::Into<crate::model::LinkedVpcNetwork>,
8693 {
8694 self.linked_vpc_network = std::option::Option::Some(v.into());
8695 self
8696 }
8697
8698 /// Sets or clears the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
8699 ///
8700 /// # Example
8701 /// ```ignore,no_run
8702 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8703 /// use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
8704 /// let x = Spoke::new().set_or_clear_linked_vpc_network(Some(LinkedVpcNetwork::default()/* use setters */));
8705 /// let x = Spoke::new().set_or_clear_linked_vpc_network(None::<LinkedVpcNetwork>);
8706 /// ```
8707 pub fn set_or_clear_linked_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
8708 where
8709 T: std::convert::Into<crate::model::LinkedVpcNetwork>,
8710 {
8711 self.linked_vpc_network = v.map(|x| x.into());
8712 self
8713 }
8714
8715 /// Sets the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
8716 ///
8717 /// # Example
8718 /// ```ignore,no_run
8719 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8720 /// use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
8721 /// let x = Spoke::new().set_linked_producer_vpc_network(LinkedProducerVpcNetwork::default()/* use setters */);
8722 /// ```
8723 pub fn set_linked_producer_vpc_network<T>(mut self, v: T) -> Self
8724 where
8725 T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
8726 {
8727 self.linked_producer_vpc_network = std::option::Option::Some(v.into());
8728 self
8729 }
8730
8731 /// Sets or clears the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
8732 ///
8733 /// # Example
8734 /// ```ignore,no_run
8735 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8736 /// use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
8737 /// let x = Spoke::new().set_or_clear_linked_producer_vpc_network(Some(LinkedProducerVpcNetwork::default()/* use setters */));
8738 /// let x = Spoke::new().set_or_clear_linked_producer_vpc_network(None::<LinkedProducerVpcNetwork>);
8739 /// ```
8740 pub fn set_or_clear_linked_producer_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
8741 where
8742 T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
8743 {
8744 self.linked_producer_vpc_network = v.map(|x| x.into());
8745 self
8746 }
8747
8748 /// Sets the value of [unique_id][crate::model::Spoke::unique_id].
8749 ///
8750 /// # Example
8751 /// ```ignore,no_run
8752 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8753 /// let x = Spoke::new().set_unique_id("example");
8754 /// ```
8755 pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8756 self.unique_id = v.into();
8757 self
8758 }
8759
8760 /// Sets the value of [state][crate::model::Spoke::state].
8761 ///
8762 /// # Example
8763 /// ```ignore,no_run
8764 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8765 /// use google_cloud_networkconnectivity_v1::model::State;
8766 /// let x0 = Spoke::new().set_state(State::Creating);
8767 /// let x1 = Spoke::new().set_state(State::Active);
8768 /// let x2 = Spoke::new().set_state(State::Deleting);
8769 /// ```
8770 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
8771 self.state = v.into();
8772 self
8773 }
8774
8775 /// Sets the value of [reasons][crate::model::Spoke::reasons].
8776 ///
8777 /// # Example
8778 /// ```ignore,no_run
8779 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8780 /// use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8781 /// let x = Spoke::new()
8782 /// .set_reasons([
8783 /// StateReason::default()/* use setters */,
8784 /// StateReason::default()/* use (different) setters */,
8785 /// ]);
8786 /// ```
8787 pub fn set_reasons<T, V>(mut self, v: T) -> Self
8788 where
8789 T: std::iter::IntoIterator<Item = V>,
8790 V: std::convert::Into<crate::model::spoke::StateReason>,
8791 {
8792 use std::iter::Iterator;
8793 self.reasons = v.into_iter().map(|i| i.into()).collect();
8794 self
8795 }
8796
8797 /// Sets the value of [spoke_type][crate::model::Spoke::spoke_type].
8798 ///
8799 /// # Example
8800 /// ```ignore,no_run
8801 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8802 /// use google_cloud_networkconnectivity_v1::model::SpokeType;
8803 /// let x0 = Spoke::new().set_spoke_type(SpokeType::VpnTunnel);
8804 /// let x1 = Spoke::new().set_spoke_type(SpokeType::InterconnectAttachment);
8805 /// let x2 = Spoke::new().set_spoke_type(SpokeType::RouterAppliance);
8806 /// ```
8807 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(mut self, v: T) -> Self {
8808 self.spoke_type = v.into();
8809 self
8810 }
8811
8812 /// Sets the value of [etag][crate::model::Spoke::etag].
8813 ///
8814 /// # Example
8815 /// ```ignore,no_run
8816 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8817 /// let x = Spoke::new().set_etag("example");
8818 /// ```
8819 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8820 self.etag = v.into();
8821 self
8822 }
8823
8824 /// Sets the value of [field_paths_pending_update][crate::model::Spoke::field_paths_pending_update].
8825 ///
8826 /// # Example
8827 /// ```ignore,no_run
8828 /// # use google_cloud_networkconnectivity_v1::model::Spoke;
8829 /// let x = Spoke::new().set_field_paths_pending_update(["a", "b", "c"]);
8830 /// ```
8831 pub fn set_field_paths_pending_update<T, V>(mut self, v: T) -> Self
8832 where
8833 T: std::iter::IntoIterator<Item = V>,
8834 V: std::convert::Into<std::string::String>,
8835 {
8836 use std::iter::Iterator;
8837 self.field_paths_pending_update = v.into_iter().map(|i| i.into()).collect();
8838 self
8839 }
8840}
8841
8842impl wkt::message::Message for Spoke {
8843 fn typename() -> &'static str {
8844 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke"
8845 }
8846}
8847
8848/// Defines additional types related to [Spoke].
8849pub mod spoke {
8850 #[allow(unused_imports)]
8851 use super::*;
8852
8853 /// The reason a spoke is inactive.
8854 #[derive(Clone, Default, PartialEq)]
8855 #[non_exhaustive]
8856 pub struct StateReason {
8857 /// The code associated with this reason.
8858 pub code: crate::model::spoke::state_reason::Code,
8859
8860 /// Human-readable details about this reason.
8861 pub message: std::string::String,
8862
8863 /// Additional information provided by the user in the RejectSpoke call.
8864 pub user_details: std::string::String,
8865
8866 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8867 }
8868
8869 impl StateReason {
8870 /// Creates a new default instance.
8871 pub fn new() -> Self {
8872 std::default::Default::default()
8873 }
8874
8875 /// Sets the value of [code][crate::model::spoke::StateReason::code].
8876 ///
8877 /// # Example
8878 /// ```ignore,no_run
8879 /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8880 /// use google_cloud_networkconnectivity_v1::model::spoke::state_reason::Code;
8881 /// let x0 = StateReason::new().set_code(Code::PendingReview);
8882 /// let x1 = StateReason::new().set_code(Code::Rejected);
8883 /// let x2 = StateReason::new().set_code(Code::Paused);
8884 /// ```
8885 pub fn set_code<T: std::convert::Into<crate::model::spoke::state_reason::Code>>(
8886 mut self,
8887 v: T,
8888 ) -> Self {
8889 self.code = v.into();
8890 self
8891 }
8892
8893 /// Sets the value of [message][crate::model::spoke::StateReason::message].
8894 ///
8895 /// # Example
8896 /// ```ignore,no_run
8897 /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8898 /// let x = StateReason::new().set_message("example");
8899 /// ```
8900 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8901 self.message = v.into();
8902 self
8903 }
8904
8905 /// Sets the value of [user_details][crate::model::spoke::StateReason::user_details].
8906 ///
8907 /// # Example
8908 /// ```ignore,no_run
8909 /// # use google_cloud_networkconnectivity_v1::model::spoke::StateReason;
8910 /// let x = StateReason::new().set_user_details("example");
8911 /// ```
8912 pub fn set_user_details<T: std::convert::Into<std::string::String>>(
8913 mut self,
8914 v: T,
8915 ) -> Self {
8916 self.user_details = v.into();
8917 self
8918 }
8919 }
8920
8921 impl wkt::message::Message for StateReason {
8922 fn typename() -> &'static str {
8923 "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke.StateReason"
8924 }
8925 }
8926
8927 /// Defines additional types related to [StateReason].
8928 pub mod state_reason {
8929 #[allow(unused_imports)]
8930 use super::*;
8931
8932 /// The Code enum represents the various reasons a state can be `INACTIVE`.
8933 ///
8934 /// # Working with unknown values
8935 ///
8936 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8937 /// additional enum variants at any time. Adding new variants is not considered
8938 /// a breaking change. Applications should write their code in anticipation of:
8939 ///
8940 /// - New values appearing in future releases of the client library, **and**
8941 /// - New values received dynamically, without application changes.
8942 ///
8943 /// Please consult the [Working with enums] section in the user guide for some
8944 /// guidelines.
8945 ///
8946 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8947 #[derive(Clone, Debug, PartialEq)]
8948 #[non_exhaustive]
8949 pub enum Code {
8950 /// No information available.
8951 Unspecified,
8952 /// The proposed spoke is pending review.
8953 PendingReview,
8954 /// The proposed spoke has been rejected by the hub administrator.
8955 Rejected,
8956 /// The spoke has been deactivated internally.
8957 Paused,
8958 /// Network Connectivity Center encountered errors while accepting
8959 /// the spoke.
8960 Failed,
8961 /// The proposed spoke update is pending review.
8962 UpdatePendingReview,
8963 /// The proposed spoke update has been rejected by the hub administrator.
8964 UpdateRejected,
8965 /// Network Connectivity Center encountered errors while accepting
8966 /// the spoke update.
8967 UpdateFailed,
8968 /// If set, the enum was initialized with an unknown value.
8969 ///
8970 /// Applications can examine the value using [Code::value] or
8971 /// [Code::name].
8972 UnknownValue(code::UnknownValue),
8973 }
8974
8975 #[doc(hidden)]
8976 pub mod code {
8977 #[allow(unused_imports)]
8978 use super::*;
8979 #[derive(Clone, Debug, PartialEq)]
8980 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8981 }
8982
8983 impl Code {
8984 /// Gets the enum value.
8985 ///
8986 /// Returns `None` if the enum contains an unknown value deserialized from
8987 /// the string representation of enums.
8988 pub fn value(&self) -> std::option::Option<i32> {
8989 match self {
8990 Self::Unspecified => std::option::Option::Some(0),
8991 Self::PendingReview => std::option::Option::Some(1),
8992 Self::Rejected => std::option::Option::Some(2),
8993 Self::Paused => std::option::Option::Some(3),
8994 Self::Failed => std::option::Option::Some(4),
8995 Self::UpdatePendingReview => std::option::Option::Some(5),
8996 Self::UpdateRejected => std::option::Option::Some(6),
8997 Self::UpdateFailed => std::option::Option::Some(7),
8998 Self::UnknownValue(u) => u.0.value(),
8999 }
9000 }
9001
9002 /// Gets the enum value as a string.
9003 ///
9004 /// Returns `None` if the enum contains an unknown value deserialized from
9005 /// the integer representation of enums.
9006 pub fn name(&self) -> std::option::Option<&str> {
9007 match self {
9008 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
9009 Self::PendingReview => std::option::Option::Some("PENDING_REVIEW"),
9010 Self::Rejected => std::option::Option::Some("REJECTED"),
9011 Self::Paused => std::option::Option::Some("PAUSED"),
9012 Self::Failed => std::option::Option::Some("FAILED"),
9013 Self::UpdatePendingReview => std::option::Option::Some("UPDATE_PENDING_REVIEW"),
9014 Self::UpdateRejected => std::option::Option::Some("UPDATE_REJECTED"),
9015 Self::UpdateFailed => std::option::Option::Some("UPDATE_FAILED"),
9016 Self::UnknownValue(u) => u.0.name(),
9017 }
9018 }
9019 }
9020
9021 impl std::default::Default for Code {
9022 fn default() -> Self {
9023 use std::convert::From;
9024 Self::from(0)
9025 }
9026 }
9027
9028 impl std::fmt::Display for Code {
9029 fn fmt(
9030 &self,
9031 f: &mut std::fmt::Formatter<'_>,
9032 ) -> std::result::Result<(), std::fmt::Error> {
9033 wkt::internal::display_enum(f, self.name(), self.value())
9034 }
9035 }
9036
9037 impl std::convert::From<i32> for Code {
9038 fn from(value: i32) -> Self {
9039 match value {
9040 0 => Self::Unspecified,
9041 1 => Self::PendingReview,
9042 2 => Self::Rejected,
9043 3 => Self::Paused,
9044 4 => Self::Failed,
9045 5 => Self::UpdatePendingReview,
9046 6 => Self::UpdateRejected,
9047 7 => Self::UpdateFailed,
9048 _ => Self::UnknownValue(code::UnknownValue(
9049 wkt::internal::UnknownEnumValue::Integer(value),
9050 )),
9051 }
9052 }
9053 }
9054
9055 impl std::convert::From<&str> for Code {
9056 fn from(value: &str) -> Self {
9057 use std::string::ToString;
9058 match value {
9059 "CODE_UNSPECIFIED" => Self::Unspecified,
9060 "PENDING_REVIEW" => Self::PendingReview,
9061 "REJECTED" => Self::Rejected,
9062 "PAUSED" => Self::Paused,
9063 "FAILED" => Self::Failed,
9064 "UPDATE_PENDING_REVIEW" => Self::UpdatePendingReview,
9065 "UPDATE_REJECTED" => Self::UpdateRejected,
9066 "UPDATE_FAILED" => Self::UpdateFailed,
9067 _ => Self::UnknownValue(code::UnknownValue(
9068 wkt::internal::UnknownEnumValue::String(value.to_string()),
9069 )),
9070 }
9071 }
9072 }
9073
9074 impl serde::ser::Serialize for Code {
9075 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9076 where
9077 S: serde::Serializer,
9078 {
9079 match self {
9080 Self::Unspecified => serializer.serialize_i32(0),
9081 Self::PendingReview => serializer.serialize_i32(1),
9082 Self::Rejected => serializer.serialize_i32(2),
9083 Self::Paused => serializer.serialize_i32(3),
9084 Self::Failed => serializer.serialize_i32(4),
9085 Self::UpdatePendingReview => serializer.serialize_i32(5),
9086 Self::UpdateRejected => serializer.serialize_i32(6),
9087 Self::UpdateFailed => serializer.serialize_i32(7),
9088 Self::UnknownValue(u) => u.0.serialize(serializer),
9089 }
9090 }
9091 }
9092
9093 impl<'de> serde::de::Deserialize<'de> for Code {
9094 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9095 where
9096 D: serde::Deserializer<'de>,
9097 {
9098 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
9099 ".google.cloud.networkconnectivity.v1.Spoke.StateReason.Code",
9100 ))
9101 }
9102 }
9103 }
9104}
9105
9106#[allow(missing_docs)]
9107#[derive(Clone, Default, PartialEq)]
9108#[non_exhaustive]
9109pub struct RouteTable {
9110 /// Immutable. The name of the route table. Route table names must be unique.
9111 /// They use the following form:
9112 /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}`
9113 pub name: std::string::String,
9114
9115 /// Output only. The time the route table was created.
9116 pub create_time: std::option::Option<wkt::Timestamp>,
9117
9118 /// Output only. The time the route table was last updated.
9119 pub update_time: std::option::Option<wkt::Timestamp>,
9120
9121 /// Optional labels in key-value pair format. For more information about
9122 /// labels, see [Requirements for
9123 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
9124 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9125
9126 /// An optional description of the route table.
9127 pub description: std::string::String,
9128
9129 /// Output only. The Google-generated UUID for the route table. This value is
9130 /// unique across all route table resources. If a route table is deleted and
9131 /// another with the same name is created, the new route table is assigned
9132 /// a different `uid`.
9133 pub uid: std::string::String,
9134
9135 /// Output only. The current lifecycle state of this route table.
9136 pub state: crate::model::State,
9137
9138 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9139}
9140
9141impl RouteTable {
9142 /// Creates a new default instance.
9143 pub fn new() -> Self {
9144 std::default::Default::default()
9145 }
9146
9147 /// Sets the value of [name][crate::model::RouteTable::name].
9148 ///
9149 /// # Example
9150 /// ```ignore,no_run
9151 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9152 /// # let project_id = "project_id";
9153 /// # let hub_id = "hub_id";
9154 /// # let route_table_id = "route_table_id";
9155 /// let x = RouteTable::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}"));
9156 /// ```
9157 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9158 self.name = v.into();
9159 self
9160 }
9161
9162 /// Sets the value of [create_time][crate::model::RouteTable::create_time].
9163 ///
9164 /// # Example
9165 /// ```ignore,no_run
9166 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9167 /// use wkt::Timestamp;
9168 /// let x = RouteTable::new().set_create_time(Timestamp::default()/* use setters */);
9169 /// ```
9170 pub fn set_create_time<T>(mut self, v: T) -> Self
9171 where
9172 T: std::convert::Into<wkt::Timestamp>,
9173 {
9174 self.create_time = std::option::Option::Some(v.into());
9175 self
9176 }
9177
9178 /// Sets or clears the value of [create_time][crate::model::RouteTable::create_time].
9179 ///
9180 /// # Example
9181 /// ```ignore,no_run
9182 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9183 /// use wkt::Timestamp;
9184 /// let x = RouteTable::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9185 /// let x = RouteTable::new().set_or_clear_create_time(None::<Timestamp>);
9186 /// ```
9187 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9188 where
9189 T: std::convert::Into<wkt::Timestamp>,
9190 {
9191 self.create_time = v.map(|x| x.into());
9192 self
9193 }
9194
9195 /// Sets the value of [update_time][crate::model::RouteTable::update_time].
9196 ///
9197 /// # Example
9198 /// ```ignore,no_run
9199 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9200 /// use wkt::Timestamp;
9201 /// let x = RouteTable::new().set_update_time(Timestamp::default()/* use setters */);
9202 /// ```
9203 pub fn set_update_time<T>(mut self, v: T) -> Self
9204 where
9205 T: std::convert::Into<wkt::Timestamp>,
9206 {
9207 self.update_time = std::option::Option::Some(v.into());
9208 self
9209 }
9210
9211 /// Sets or clears the value of [update_time][crate::model::RouteTable::update_time].
9212 ///
9213 /// # Example
9214 /// ```ignore,no_run
9215 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9216 /// use wkt::Timestamp;
9217 /// let x = RouteTable::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9218 /// let x = RouteTable::new().set_or_clear_update_time(None::<Timestamp>);
9219 /// ```
9220 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9221 where
9222 T: std::convert::Into<wkt::Timestamp>,
9223 {
9224 self.update_time = v.map(|x| x.into());
9225 self
9226 }
9227
9228 /// Sets the value of [labels][crate::model::RouteTable::labels].
9229 ///
9230 /// # Example
9231 /// ```ignore,no_run
9232 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9233 /// let x = RouteTable::new().set_labels([
9234 /// ("key0", "abc"),
9235 /// ("key1", "xyz"),
9236 /// ]);
9237 /// ```
9238 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9239 where
9240 T: std::iter::IntoIterator<Item = (K, V)>,
9241 K: std::convert::Into<std::string::String>,
9242 V: std::convert::Into<std::string::String>,
9243 {
9244 use std::iter::Iterator;
9245 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9246 self
9247 }
9248
9249 /// Sets the value of [description][crate::model::RouteTable::description].
9250 ///
9251 /// # Example
9252 /// ```ignore,no_run
9253 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9254 /// let x = RouteTable::new().set_description("example");
9255 /// ```
9256 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9257 self.description = v.into();
9258 self
9259 }
9260
9261 /// Sets the value of [uid][crate::model::RouteTable::uid].
9262 ///
9263 /// # Example
9264 /// ```ignore,no_run
9265 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9266 /// let x = RouteTable::new().set_uid("example");
9267 /// ```
9268 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9269 self.uid = v.into();
9270 self
9271 }
9272
9273 /// Sets the value of [state][crate::model::RouteTable::state].
9274 ///
9275 /// # Example
9276 /// ```ignore,no_run
9277 /// # use google_cloud_networkconnectivity_v1::model::RouteTable;
9278 /// use google_cloud_networkconnectivity_v1::model::State;
9279 /// let x0 = RouteTable::new().set_state(State::Creating);
9280 /// let x1 = RouteTable::new().set_state(State::Active);
9281 /// let x2 = RouteTable::new().set_state(State::Deleting);
9282 /// ```
9283 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9284 self.state = v.into();
9285 self
9286 }
9287}
9288
9289impl wkt::message::Message for RouteTable {
9290 fn typename() -> &'static str {
9291 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouteTable"
9292 }
9293}
9294
9295/// A route defines a path from VM instances within a spoke to a specific
9296/// destination resource. Only VPC spokes have routes.
9297#[derive(Clone, Default, PartialEq)]
9298#[non_exhaustive]
9299pub struct Route {
9300 /// Immutable. The name of the route. Route names must be unique. Route names
9301 /// use the following form:
9302 /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}/routes/{route_id}`
9303 pub name: std::string::String,
9304
9305 /// Output only. The time the route was created.
9306 pub create_time: std::option::Option<wkt::Timestamp>,
9307
9308 /// Output only. The time the route was last updated.
9309 pub update_time: std::option::Option<wkt::Timestamp>,
9310
9311 /// The destination IP address range.
9312 pub ip_cidr_range: std::string::String,
9313
9314 /// Output only. The route's type. Its type is determined by the properties of
9315 /// its IP address range.
9316 pub r#type: crate::model::RouteType,
9317
9318 /// Immutable. The destination VPC network for packets on this route.
9319 pub next_hop_vpc_network: std::option::Option<crate::model::NextHopVpcNetwork>,
9320
9321 /// Optional labels in key-value pair format. For more information about
9322 /// labels, see [Requirements for
9323 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
9324 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9325
9326 /// An optional description of the route.
9327 pub description: std::string::String,
9328
9329 /// Output only. The Google-generated UUID for the route. This value is unique
9330 /// across all Network Connectivity Center route resources. If a
9331 /// route is deleted and another with the same name is created,
9332 /// the new route is assigned a different `uid`.
9333 pub uid: std::string::String,
9334
9335 /// Output only. The current lifecycle state of the route.
9336 pub state: crate::model::State,
9337
9338 /// Immutable. The spoke that this route leads to.
9339 /// Example: projects/12345/locations/global/spokes/SPOKE
9340 pub spoke: std::string::String,
9341
9342 /// Output only. The origin location of the route.
9343 /// Uses the following form: "projects/{project}/locations/{location}"
9344 /// Example: projects/1234/locations/us-central1
9345 pub location: std::string::String,
9346
9347 /// Output only. The priority of this route. Priority is used to break ties in
9348 /// cases where a destination matches more than one route. In these cases the
9349 /// route with the lowest-numbered priority value wins.
9350 pub priority: i64,
9351
9352 /// Immutable. The next-hop VPN tunnel for packets on this route.
9353 pub next_hop_vpn_tunnel: std::option::Option<crate::model::NextHopVPNTunnel>,
9354
9355 /// Immutable. The next-hop Router appliance instance for packets on this
9356 /// route.
9357 pub next_hop_router_appliance_instance:
9358 std::option::Option<crate::model::NextHopRouterApplianceInstance>,
9359
9360 /// Immutable. The next-hop VLAN attachment for packets on this route.
9361 pub next_hop_interconnect_attachment:
9362 std::option::Option<crate::model::NextHopInterconnectAttachment>,
9363
9364 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9365}
9366
9367impl Route {
9368 /// Creates a new default instance.
9369 pub fn new() -> Self {
9370 std::default::Default::default()
9371 }
9372
9373 /// Sets the value of [name][crate::model::Route::name].
9374 ///
9375 /// # Example
9376 /// ```ignore,no_run
9377 /// # use google_cloud_networkconnectivity_v1::model::Route;
9378 /// # let project_id = "project_id";
9379 /// # let hub_id = "hub_id";
9380 /// # let route_table_id = "route_table_id";
9381 /// # let route_id = "route_id";
9382 /// let x = Route::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}/routes/{route_id}"));
9383 /// ```
9384 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9385 self.name = v.into();
9386 self
9387 }
9388
9389 /// Sets the value of [create_time][crate::model::Route::create_time].
9390 ///
9391 /// # Example
9392 /// ```ignore,no_run
9393 /// # use google_cloud_networkconnectivity_v1::model::Route;
9394 /// use wkt::Timestamp;
9395 /// let x = Route::new().set_create_time(Timestamp::default()/* use setters */);
9396 /// ```
9397 pub fn set_create_time<T>(mut self, v: T) -> Self
9398 where
9399 T: std::convert::Into<wkt::Timestamp>,
9400 {
9401 self.create_time = std::option::Option::Some(v.into());
9402 self
9403 }
9404
9405 /// Sets or clears the value of [create_time][crate::model::Route::create_time].
9406 ///
9407 /// # Example
9408 /// ```ignore,no_run
9409 /// # use google_cloud_networkconnectivity_v1::model::Route;
9410 /// use wkt::Timestamp;
9411 /// let x = Route::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9412 /// let x = Route::new().set_or_clear_create_time(None::<Timestamp>);
9413 /// ```
9414 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9415 where
9416 T: std::convert::Into<wkt::Timestamp>,
9417 {
9418 self.create_time = v.map(|x| x.into());
9419 self
9420 }
9421
9422 /// Sets the value of [update_time][crate::model::Route::update_time].
9423 ///
9424 /// # Example
9425 /// ```ignore,no_run
9426 /// # use google_cloud_networkconnectivity_v1::model::Route;
9427 /// use wkt::Timestamp;
9428 /// let x = Route::new().set_update_time(Timestamp::default()/* use setters */);
9429 /// ```
9430 pub fn set_update_time<T>(mut self, v: T) -> Self
9431 where
9432 T: std::convert::Into<wkt::Timestamp>,
9433 {
9434 self.update_time = std::option::Option::Some(v.into());
9435 self
9436 }
9437
9438 /// Sets or clears the value of [update_time][crate::model::Route::update_time].
9439 ///
9440 /// # Example
9441 /// ```ignore,no_run
9442 /// # use google_cloud_networkconnectivity_v1::model::Route;
9443 /// use wkt::Timestamp;
9444 /// let x = Route::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9445 /// let x = Route::new().set_or_clear_update_time(None::<Timestamp>);
9446 /// ```
9447 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9448 where
9449 T: std::convert::Into<wkt::Timestamp>,
9450 {
9451 self.update_time = v.map(|x| x.into());
9452 self
9453 }
9454
9455 /// Sets the value of [ip_cidr_range][crate::model::Route::ip_cidr_range].
9456 ///
9457 /// # Example
9458 /// ```ignore,no_run
9459 /// # use google_cloud_networkconnectivity_v1::model::Route;
9460 /// let x = Route::new().set_ip_cidr_range("example");
9461 /// ```
9462 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9463 self.ip_cidr_range = v.into();
9464 self
9465 }
9466
9467 /// Sets the value of [r#type][crate::model::Route::type].
9468 ///
9469 /// # Example
9470 /// ```ignore,no_run
9471 /// # use google_cloud_networkconnectivity_v1::model::Route;
9472 /// use google_cloud_networkconnectivity_v1::model::RouteType;
9473 /// let x0 = Route::new().set_type(RouteType::VpcPrimarySubnet);
9474 /// let x1 = Route::new().set_type(RouteType::VpcSecondarySubnet);
9475 /// let x2 = Route::new().set_type(RouteType::DynamicRoute);
9476 /// ```
9477 pub fn set_type<T: std::convert::Into<crate::model::RouteType>>(mut self, v: T) -> Self {
9478 self.r#type = v.into();
9479 self
9480 }
9481
9482 /// Sets the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
9483 ///
9484 /// # Example
9485 /// ```ignore,no_run
9486 /// # use google_cloud_networkconnectivity_v1::model::Route;
9487 /// use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
9488 /// let x = Route::new().set_next_hop_vpc_network(NextHopVpcNetwork::default()/* use setters */);
9489 /// ```
9490 pub fn set_next_hop_vpc_network<T>(mut self, v: T) -> Self
9491 where
9492 T: std::convert::Into<crate::model::NextHopVpcNetwork>,
9493 {
9494 self.next_hop_vpc_network = std::option::Option::Some(v.into());
9495 self
9496 }
9497
9498 /// Sets or clears the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
9499 ///
9500 /// # Example
9501 /// ```ignore,no_run
9502 /// # use google_cloud_networkconnectivity_v1::model::Route;
9503 /// use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
9504 /// let x = Route::new().set_or_clear_next_hop_vpc_network(Some(NextHopVpcNetwork::default()/* use setters */));
9505 /// let x = Route::new().set_or_clear_next_hop_vpc_network(None::<NextHopVpcNetwork>);
9506 /// ```
9507 pub fn set_or_clear_next_hop_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
9508 where
9509 T: std::convert::Into<crate::model::NextHopVpcNetwork>,
9510 {
9511 self.next_hop_vpc_network = v.map(|x| x.into());
9512 self
9513 }
9514
9515 /// Sets the value of [labels][crate::model::Route::labels].
9516 ///
9517 /// # Example
9518 /// ```ignore,no_run
9519 /// # use google_cloud_networkconnectivity_v1::model::Route;
9520 /// let x = Route::new().set_labels([
9521 /// ("key0", "abc"),
9522 /// ("key1", "xyz"),
9523 /// ]);
9524 /// ```
9525 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9526 where
9527 T: std::iter::IntoIterator<Item = (K, V)>,
9528 K: std::convert::Into<std::string::String>,
9529 V: std::convert::Into<std::string::String>,
9530 {
9531 use std::iter::Iterator;
9532 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9533 self
9534 }
9535
9536 /// Sets the value of [description][crate::model::Route::description].
9537 ///
9538 /// # Example
9539 /// ```ignore,no_run
9540 /// # use google_cloud_networkconnectivity_v1::model::Route;
9541 /// let x = Route::new().set_description("example");
9542 /// ```
9543 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9544 self.description = v.into();
9545 self
9546 }
9547
9548 /// Sets the value of [uid][crate::model::Route::uid].
9549 ///
9550 /// # Example
9551 /// ```ignore,no_run
9552 /// # use google_cloud_networkconnectivity_v1::model::Route;
9553 /// let x = Route::new().set_uid("example");
9554 /// ```
9555 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9556 self.uid = v.into();
9557 self
9558 }
9559
9560 /// Sets the value of [state][crate::model::Route::state].
9561 ///
9562 /// # Example
9563 /// ```ignore,no_run
9564 /// # use google_cloud_networkconnectivity_v1::model::Route;
9565 /// use google_cloud_networkconnectivity_v1::model::State;
9566 /// let x0 = Route::new().set_state(State::Creating);
9567 /// let x1 = Route::new().set_state(State::Active);
9568 /// let x2 = Route::new().set_state(State::Deleting);
9569 /// ```
9570 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9571 self.state = v.into();
9572 self
9573 }
9574
9575 /// Sets the value of [spoke][crate::model::Route::spoke].
9576 ///
9577 /// # Example
9578 /// ```ignore,no_run
9579 /// # use google_cloud_networkconnectivity_v1::model::Route;
9580 /// # let project_id = "project_id";
9581 /// # let location_id = "location_id";
9582 /// # let spoke_id = "spoke_id";
9583 /// let x = Route::new().set_spoke(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
9584 /// ```
9585 pub fn set_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9586 self.spoke = v.into();
9587 self
9588 }
9589
9590 /// Sets the value of [location][crate::model::Route::location].
9591 ///
9592 /// # Example
9593 /// ```ignore,no_run
9594 /// # use google_cloud_networkconnectivity_v1::model::Route;
9595 /// let x = Route::new().set_location("example");
9596 /// ```
9597 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9598 self.location = v.into();
9599 self
9600 }
9601
9602 /// Sets the value of [priority][crate::model::Route::priority].
9603 ///
9604 /// # Example
9605 /// ```ignore,no_run
9606 /// # use google_cloud_networkconnectivity_v1::model::Route;
9607 /// let x = Route::new().set_priority(42);
9608 /// ```
9609 pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9610 self.priority = v.into();
9611 self
9612 }
9613
9614 /// Sets the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
9615 ///
9616 /// # Example
9617 /// ```ignore,no_run
9618 /// # use google_cloud_networkconnectivity_v1::model::Route;
9619 /// use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
9620 /// let x = Route::new().set_next_hop_vpn_tunnel(NextHopVPNTunnel::default()/* use setters */);
9621 /// ```
9622 pub fn set_next_hop_vpn_tunnel<T>(mut self, v: T) -> Self
9623 where
9624 T: std::convert::Into<crate::model::NextHopVPNTunnel>,
9625 {
9626 self.next_hop_vpn_tunnel = std::option::Option::Some(v.into());
9627 self
9628 }
9629
9630 /// Sets or clears the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
9631 ///
9632 /// # Example
9633 /// ```ignore,no_run
9634 /// # use google_cloud_networkconnectivity_v1::model::Route;
9635 /// use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
9636 /// let x = Route::new().set_or_clear_next_hop_vpn_tunnel(Some(NextHopVPNTunnel::default()/* use setters */));
9637 /// let x = Route::new().set_or_clear_next_hop_vpn_tunnel(None::<NextHopVPNTunnel>);
9638 /// ```
9639 pub fn set_or_clear_next_hop_vpn_tunnel<T>(mut self, v: std::option::Option<T>) -> Self
9640 where
9641 T: std::convert::Into<crate::model::NextHopVPNTunnel>,
9642 {
9643 self.next_hop_vpn_tunnel = v.map(|x| x.into());
9644 self
9645 }
9646
9647 /// Sets the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
9648 ///
9649 /// # Example
9650 /// ```ignore,no_run
9651 /// # use google_cloud_networkconnectivity_v1::model::Route;
9652 /// use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
9653 /// let x = Route::new().set_next_hop_router_appliance_instance(NextHopRouterApplianceInstance::default()/* use setters */);
9654 /// ```
9655 pub fn set_next_hop_router_appliance_instance<T>(mut self, v: T) -> Self
9656 where
9657 T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
9658 {
9659 self.next_hop_router_appliance_instance = std::option::Option::Some(v.into());
9660 self
9661 }
9662
9663 /// Sets or clears the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
9664 ///
9665 /// # Example
9666 /// ```ignore,no_run
9667 /// # use google_cloud_networkconnectivity_v1::model::Route;
9668 /// use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
9669 /// let x = Route::new().set_or_clear_next_hop_router_appliance_instance(Some(NextHopRouterApplianceInstance::default()/* use setters */));
9670 /// let x = Route::new().set_or_clear_next_hop_router_appliance_instance(None::<NextHopRouterApplianceInstance>);
9671 /// ```
9672 pub fn set_or_clear_next_hop_router_appliance_instance<T>(
9673 mut self,
9674 v: std::option::Option<T>,
9675 ) -> Self
9676 where
9677 T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
9678 {
9679 self.next_hop_router_appliance_instance = v.map(|x| x.into());
9680 self
9681 }
9682
9683 /// Sets the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
9684 ///
9685 /// # Example
9686 /// ```ignore,no_run
9687 /// # use google_cloud_networkconnectivity_v1::model::Route;
9688 /// use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
9689 /// let x = Route::new().set_next_hop_interconnect_attachment(NextHopInterconnectAttachment::default()/* use setters */);
9690 /// ```
9691 pub fn set_next_hop_interconnect_attachment<T>(mut self, v: T) -> Self
9692 where
9693 T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
9694 {
9695 self.next_hop_interconnect_attachment = std::option::Option::Some(v.into());
9696 self
9697 }
9698
9699 /// Sets or clears the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
9700 ///
9701 /// # Example
9702 /// ```ignore,no_run
9703 /// # use google_cloud_networkconnectivity_v1::model::Route;
9704 /// use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
9705 /// let x = Route::new().set_or_clear_next_hop_interconnect_attachment(Some(NextHopInterconnectAttachment::default()/* use setters */));
9706 /// let x = Route::new().set_or_clear_next_hop_interconnect_attachment(None::<NextHopInterconnectAttachment>);
9707 /// ```
9708 pub fn set_or_clear_next_hop_interconnect_attachment<T>(
9709 mut self,
9710 v: std::option::Option<T>,
9711 ) -> Self
9712 where
9713 T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
9714 {
9715 self.next_hop_interconnect_attachment = v.map(|x| x.into());
9716 self
9717 }
9718}
9719
9720impl wkt::message::Message for Route {
9721 fn typename() -> &'static str {
9722 "type.googleapis.com/google.cloud.networkconnectivity.v1.Route"
9723 }
9724}
9725
9726/// A group represents a subset of spokes attached to a hub.
9727#[derive(Clone, Default, PartialEq)]
9728#[non_exhaustive]
9729pub struct Group {
9730 /// Immutable. The name of the group. Group names must be unique. They
9731 /// use the following form:
9732 /// `projects/{project_number}/locations/global/hubs/{hub}/groups/{group_id}`
9733 pub name: std::string::String,
9734
9735 /// Output only. The time the group was created.
9736 pub create_time: std::option::Option<wkt::Timestamp>,
9737
9738 /// Output only. The time the group was last updated.
9739 pub update_time: std::option::Option<wkt::Timestamp>,
9740
9741 /// Optional. Labels in key-value pair format. For more information about
9742 /// labels, see [Requirements for
9743 /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
9744 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9745
9746 /// Optional. The description of the group.
9747 pub description: std::string::String,
9748
9749 /// Output only. The Google-generated UUID for the group. This value is unique
9750 /// across all group resources. If a group is deleted and
9751 /// another with the same name is created, the new route table is assigned
9752 /// a different unique_id.
9753 pub uid: std::string::String,
9754
9755 /// Output only. The current lifecycle state of this group.
9756 pub state: crate::model::State,
9757
9758 /// Optional. The auto-accept setting for this group.
9759 pub auto_accept: std::option::Option<crate::model::AutoAccept>,
9760
9761 /// Output only. The name of the route table that corresponds to this group.
9762 /// They use the following form:
9763 /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
9764 pub route_table: std::string::String,
9765
9766 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9767}
9768
9769impl Group {
9770 /// Creates a new default instance.
9771 pub fn new() -> Self {
9772 std::default::Default::default()
9773 }
9774
9775 /// Sets the value of [name][crate::model::Group::name].
9776 ///
9777 /// # Example
9778 /// ```ignore,no_run
9779 /// # use google_cloud_networkconnectivity_v1::model::Group;
9780 /// # let project_id = "project_id";
9781 /// # let hub_id = "hub_id";
9782 /// # let group_id = "group_id";
9783 /// let x = Group::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}/groups/{group_id}"));
9784 /// ```
9785 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9786 self.name = v.into();
9787 self
9788 }
9789
9790 /// Sets the value of [create_time][crate::model::Group::create_time].
9791 ///
9792 /// # Example
9793 /// ```ignore,no_run
9794 /// # use google_cloud_networkconnectivity_v1::model::Group;
9795 /// use wkt::Timestamp;
9796 /// let x = Group::new().set_create_time(Timestamp::default()/* use setters */);
9797 /// ```
9798 pub fn set_create_time<T>(mut self, v: T) -> Self
9799 where
9800 T: std::convert::Into<wkt::Timestamp>,
9801 {
9802 self.create_time = std::option::Option::Some(v.into());
9803 self
9804 }
9805
9806 /// Sets or clears the value of [create_time][crate::model::Group::create_time].
9807 ///
9808 /// # Example
9809 /// ```ignore,no_run
9810 /// # use google_cloud_networkconnectivity_v1::model::Group;
9811 /// use wkt::Timestamp;
9812 /// let x = Group::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9813 /// let x = Group::new().set_or_clear_create_time(None::<Timestamp>);
9814 /// ```
9815 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9816 where
9817 T: std::convert::Into<wkt::Timestamp>,
9818 {
9819 self.create_time = v.map(|x| x.into());
9820 self
9821 }
9822
9823 /// Sets the value of [update_time][crate::model::Group::update_time].
9824 ///
9825 /// # Example
9826 /// ```ignore,no_run
9827 /// # use google_cloud_networkconnectivity_v1::model::Group;
9828 /// use wkt::Timestamp;
9829 /// let x = Group::new().set_update_time(Timestamp::default()/* use setters */);
9830 /// ```
9831 pub fn set_update_time<T>(mut self, v: T) -> Self
9832 where
9833 T: std::convert::Into<wkt::Timestamp>,
9834 {
9835 self.update_time = std::option::Option::Some(v.into());
9836 self
9837 }
9838
9839 /// Sets or clears the value of [update_time][crate::model::Group::update_time].
9840 ///
9841 /// # Example
9842 /// ```ignore,no_run
9843 /// # use google_cloud_networkconnectivity_v1::model::Group;
9844 /// use wkt::Timestamp;
9845 /// let x = Group::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9846 /// let x = Group::new().set_or_clear_update_time(None::<Timestamp>);
9847 /// ```
9848 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9849 where
9850 T: std::convert::Into<wkt::Timestamp>,
9851 {
9852 self.update_time = v.map(|x| x.into());
9853 self
9854 }
9855
9856 /// Sets the value of [labels][crate::model::Group::labels].
9857 ///
9858 /// # Example
9859 /// ```ignore,no_run
9860 /// # use google_cloud_networkconnectivity_v1::model::Group;
9861 /// let x = Group::new().set_labels([
9862 /// ("key0", "abc"),
9863 /// ("key1", "xyz"),
9864 /// ]);
9865 /// ```
9866 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9867 where
9868 T: std::iter::IntoIterator<Item = (K, V)>,
9869 K: std::convert::Into<std::string::String>,
9870 V: std::convert::Into<std::string::String>,
9871 {
9872 use std::iter::Iterator;
9873 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9874 self
9875 }
9876
9877 /// Sets the value of [description][crate::model::Group::description].
9878 ///
9879 /// # Example
9880 /// ```ignore,no_run
9881 /// # use google_cloud_networkconnectivity_v1::model::Group;
9882 /// let x = Group::new().set_description("example");
9883 /// ```
9884 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9885 self.description = v.into();
9886 self
9887 }
9888
9889 /// Sets the value of [uid][crate::model::Group::uid].
9890 ///
9891 /// # Example
9892 /// ```ignore,no_run
9893 /// # use google_cloud_networkconnectivity_v1::model::Group;
9894 /// let x = Group::new().set_uid("example");
9895 /// ```
9896 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9897 self.uid = v.into();
9898 self
9899 }
9900
9901 /// Sets the value of [state][crate::model::Group::state].
9902 ///
9903 /// # Example
9904 /// ```ignore,no_run
9905 /// # use google_cloud_networkconnectivity_v1::model::Group;
9906 /// use google_cloud_networkconnectivity_v1::model::State;
9907 /// let x0 = Group::new().set_state(State::Creating);
9908 /// let x1 = Group::new().set_state(State::Active);
9909 /// let x2 = Group::new().set_state(State::Deleting);
9910 /// ```
9911 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
9912 self.state = v.into();
9913 self
9914 }
9915
9916 /// Sets the value of [auto_accept][crate::model::Group::auto_accept].
9917 ///
9918 /// # Example
9919 /// ```ignore,no_run
9920 /// # use google_cloud_networkconnectivity_v1::model::Group;
9921 /// use google_cloud_networkconnectivity_v1::model::AutoAccept;
9922 /// let x = Group::new().set_auto_accept(AutoAccept::default()/* use setters */);
9923 /// ```
9924 pub fn set_auto_accept<T>(mut self, v: T) -> Self
9925 where
9926 T: std::convert::Into<crate::model::AutoAccept>,
9927 {
9928 self.auto_accept = std::option::Option::Some(v.into());
9929 self
9930 }
9931
9932 /// Sets or clears the value of [auto_accept][crate::model::Group::auto_accept].
9933 ///
9934 /// # Example
9935 /// ```ignore,no_run
9936 /// # use google_cloud_networkconnectivity_v1::model::Group;
9937 /// use google_cloud_networkconnectivity_v1::model::AutoAccept;
9938 /// let x = Group::new().set_or_clear_auto_accept(Some(AutoAccept::default()/* use setters */));
9939 /// let x = Group::new().set_or_clear_auto_accept(None::<AutoAccept>);
9940 /// ```
9941 pub fn set_or_clear_auto_accept<T>(mut self, v: std::option::Option<T>) -> Self
9942 where
9943 T: std::convert::Into<crate::model::AutoAccept>,
9944 {
9945 self.auto_accept = v.map(|x| x.into());
9946 self
9947 }
9948
9949 /// Sets the value of [route_table][crate::model::Group::route_table].
9950 ///
9951 /// # Example
9952 /// ```ignore,no_run
9953 /// # use google_cloud_networkconnectivity_v1::model::Group;
9954 /// let x = Group::new().set_route_table("example");
9955 /// ```
9956 pub fn set_route_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9957 self.route_table = v.into();
9958 self
9959 }
9960}
9961
9962impl wkt::message::Message for Group {
9963 fn typename() -> &'static str {
9964 "type.googleapis.com/google.cloud.networkconnectivity.v1.Group"
9965 }
9966}
9967
9968/// The auto-accept setting for a group controls whether
9969/// proposed spokes are automatically attached to the hub. If auto-accept is
9970/// enabled, the spoke immediately is attached to the hub and becomes part of the
9971/// group. In this case, the new spoke is in the ACTIVE state.
9972/// If auto-accept is disabled, the spoke goes to the INACTIVE
9973/// state, and it must be reviewed and accepted by a hub
9974/// administrator.
9975#[derive(Clone, Default, PartialEq)]
9976#[non_exhaustive]
9977pub struct AutoAccept {
9978 /// Optional. A list of project ids or project numbers for which you want
9979 /// to enable auto-accept. The auto-accept setting is applied to
9980 /// spokes being created or updated in these projects.
9981 pub auto_accept_projects: std::vec::Vec<std::string::String>,
9982
9983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9984}
9985
9986impl AutoAccept {
9987 /// Creates a new default instance.
9988 pub fn new() -> Self {
9989 std::default::Default::default()
9990 }
9991
9992 /// Sets the value of [auto_accept_projects][crate::model::AutoAccept::auto_accept_projects].
9993 ///
9994 /// # Example
9995 /// ```ignore,no_run
9996 /// # use google_cloud_networkconnectivity_v1::model::AutoAccept;
9997 /// let x = AutoAccept::new().set_auto_accept_projects(["a", "b", "c"]);
9998 /// ```
9999 pub fn set_auto_accept_projects<T, V>(mut self, v: T) -> Self
10000 where
10001 T: std::iter::IntoIterator<Item = V>,
10002 V: std::convert::Into<std::string::String>,
10003 {
10004 use std::iter::Iterator;
10005 self.auto_accept_projects = v.into_iter().map(|i| i.into()).collect();
10006 self
10007 }
10008}
10009
10010impl wkt::message::Message for AutoAccept {
10011 fn typename() -> &'static str {
10012 "type.googleapis.com/google.cloud.networkconnectivity.v1.AutoAccept"
10013 }
10014}
10015
10016/// Request for
10017/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
10018/// method.
10019///
10020/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
10021#[derive(Clone, Default, PartialEq)]
10022#[non_exhaustive]
10023pub struct ListHubsRequest {
10024 /// Required. The parent resource's name.
10025 pub parent: std::string::String,
10026
10027 /// The maximum number of results per page to return.
10028 pub page_size: i32,
10029
10030 /// The page token.
10031 pub page_token: std::string::String,
10032
10033 /// An expression that filters the list of results.
10034 pub filter: std::string::String,
10035
10036 /// Sort the results by a certain order.
10037 pub order_by: std::string::String,
10038
10039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10040}
10041
10042impl ListHubsRequest {
10043 /// Creates a new default instance.
10044 pub fn new() -> Self {
10045 std::default::Default::default()
10046 }
10047
10048 /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
10049 ///
10050 /// # Example
10051 /// ```ignore,no_run
10052 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
10053 /// let x = ListHubsRequest::new().set_parent("example");
10054 /// ```
10055 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10056 self.parent = v.into();
10057 self
10058 }
10059
10060 /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
10061 ///
10062 /// # Example
10063 /// ```ignore,no_run
10064 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
10065 /// let x = ListHubsRequest::new().set_page_size(42);
10066 /// ```
10067 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10068 self.page_size = v.into();
10069 self
10070 }
10071
10072 /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
10073 ///
10074 /// # Example
10075 /// ```ignore,no_run
10076 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
10077 /// let x = ListHubsRequest::new().set_page_token("example");
10078 /// ```
10079 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10080 self.page_token = v.into();
10081 self
10082 }
10083
10084 /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
10085 ///
10086 /// # Example
10087 /// ```ignore,no_run
10088 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
10089 /// let x = ListHubsRequest::new().set_filter("example");
10090 /// ```
10091 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10092 self.filter = v.into();
10093 self
10094 }
10095
10096 /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
10097 ///
10098 /// # Example
10099 /// ```ignore,no_run
10100 /// # use google_cloud_networkconnectivity_v1::model::ListHubsRequest;
10101 /// let x = ListHubsRequest::new().set_order_by("example");
10102 /// ```
10103 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10104 self.order_by = v.into();
10105 self
10106 }
10107}
10108
10109impl wkt::message::Message for ListHubsRequest {
10110 fn typename() -> &'static str {
10111 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsRequest"
10112 }
10113}
10114
10115/// Response for
10116/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
10117/// method.
10118///
10119/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
10120#[derive(Clone, Default, PartialEq)]
10121#[non_exhaustive]
10122pub struct ListHubsResponse {
10123 /// The requested hubs.
10124 pub hubs: std::vec::Vec<crate::model::Hub>,
10125
10126 /// The token for the next page of the response. To see more results,
10127 /// use this value as the page_token for your next request. If this value
10128 /// is empty, there are no more results.
10129 pub next_page_token: std::string::String,
10130
10131 /// Locations that could not be reached.
10132 pub unreachable: std::vec::Vec<std::string::String>,
10133
10134 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10135}
10136
10137impl ListHubsResponse {
10138 /// Creates a new default instance.
10139 pub fn new() -> Self {
10140 std::default::Default::default()
10141 }
10142
10143 /// Sets the value of [hubs][crate::model::ListHubsResponse::hubs].
10144 ///
10145 /// # Example
10146 /// ```ignore,no_run
10147 /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
10148 /// use google_cloud_networkconnectivity_v1::model::Hub;
10149 /// let x = ListHubsResponse::new()
10150 /// .set_hubs([
10151 /// Hub::default()/* use setters */,
10152 /// Hub::default()/* use (different) setters */,
10153 /// ]);
10154 /// ```
10155 pub fn set_hubs<T, V>(mut self, v: T) -> Self
10156 where
10157 T: std::iter::IntoIterator<Item = V>,
10158 V: std::convert::Into<crate::model::Hub>,
10159 {
10160 use std::iter::Iterator;
10161 self.hubs = v.into_iter().map(|i| i.into()).collect();
10162 self
10163 }
10164
10165 /// Sets the value of [next_page_token][crate::model::ListHubsResponse::next_page_token].
10166 ///
10167 /// # Example
10168 /// ```ignore,no_run
10169 /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
10170 /// let x = ListHubsResponse::new().set_next_page_token("example");
10171 /// ```
10172 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10173 self.next_page_token = v.into();
10174 self
10175 }
10176
10177 /// Sets the value of [unreachable][crate::model::ListHubsResponse::unreachable].
10178 ///
10179 /// # Example
10180 /// ```ignore,no_run
10181 /// # use google_cloud_networkconnectivity_v1::model::ListHubsResponse;
10182 /// let x = ListHubsResponse::new().set_unreachable(["a", "b", "c"]);
10183 /// ```
10184 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10185 where
10186 T: std::iter::IntoIterator<Item = V>,
10187 V: std::convert::Into<std::string::String>,
10188 {
10189 use std::iter::Iterator;
10190 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10191 self
10192 }
10193}
10194
10195impl wkt::message::Message for ListHubsResponse {
10196 fn typename() -> &'static str {
10197 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsResponse"
10198 }
10199}
10200
10201#[doc(hidden)]
10202impl google_cloud_gax::paginator::internal::PageableResponse for ListHubsResponse {
10203 type PageItem = crate::model::Hub;
10204
10205 fn items(self) -> std::vec::Vec<Self::PageItem> {
10206 self.hubs
10207 }
10208
10209 fn next_page_token(&self) -> std::string::String {
10210 use std::clone::Clone;
10211 self.next_page_token.clone()
10212 }
10213}
10214
10215/// Request for
10216/// [HubService.GetHub][google.cloud.networkconnectivity.v1.HubService.GetHub]
10217/// method.
10218///
10219/// [google.cloud.networkconnectivity.v1.HubService.GetHub]: crate::client::HubService::get_hub
10220#[derive(Clone, Default, PartialEq)]
10221#[non_exhaustive]
10222pub struct GetHubRequest {
10223 /// Required. The name of the hub resource to get.
10224 pub name: std::string::String,
10225
10226 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10227}
10228
10229impl GetHubRequest {
10230 /// Creates a new default instance.
10231 pub fn new() -> Self {
10232 std::default::Default::default()
10233 }
10234
10235 /// Sets the value of [name][crate::model::GetHubRequest::name].
10236 ///
10237 /// # Example
10238 /// ```ignore,no_run
10239 /// # use google_cloud_networkconnectivity_v1::model::GetHubRequest;
10240 /// # let project_id = "project_id";
10241 /// # let hub_id = "hub_id";
10242 /// let x = GetHubRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
10243 /// ```
10244 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10245 self.name = v.into();
10246 self
10247 }
10248}
10249
10250impl wkt::message::Message for GetHubRequest {
10251 fn typename() -> &'static str {
10252 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetHubRequest"
10253 }
10254}
10255
10256/// Request for
10257/// [HubService.CreateHub][google.cloud.networkconnectivity.v1.HubService.CreateHub]
10258/// method.
10259///
10260/// [google.cloud.networkconnectivity.v1.HubService.CreateHub]: crate::client::HubService::create_hub
10261#[derive(Clone, Default, PartialEq)]
10262#[non_exhaustive]
10263pub struct CreateHubRequest {
10264 /// Required. The parent resource.
10265 pub parent: std::string::String,
10266
10267 /// Required. A unique identifier for the hub.
10268 pub hub_id: std::string::String,
10269
10270 /// Required. The initial values for a new hub.
10271 pub hub: std::option::Option<crate::model::Hub>,
10272
10273 /// Optional. A request ID to identify requests. Specify a unique request ID so
10274 /// that if you must retry your request, the server knows to ignore the request
10275 /// if it has already been completed. The server guarantees that a request
10276 /// doesn't result in creation of duplicate commitments for at least 60
10277 /// minutes.
10278 ///
10279 /// For example, consider a situation where you make an initial request and
10280 /// the request times out. If you make the request again with the same request
10281 /// ID, the server can check to see whether the original operation
10282 /// was received. If it was, the server ignores the second request. This
10283 /// behavior prevents clients from mistakenly creating duplicate commitments.
10284 ///
10285 /// The request ID must be a valid UUID, with the exception that zero UUID is
10286 /// not supported (00000000-0000-0000-0000-000000000000).
10287 pub request_id: std::string::String,
10288
10289 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10290}
10291
10292impl CreateHubRequest {
10293 /// Creates a new default instance.
10294 pub fn new() -> Self {
10295 std::default::Default::default()
10296 }
10297
10298 /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
10299 ///
10300 /// # Example
10301 /// ```ignore,no_run
10302 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10303 /// let x = CreateHubRequest::new().set_parent("example");
10304 /// ```
10305 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10306 self.parent = v.into();
10307 self
10308 }
10309
10310 /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
10311 ///
10312 /// # Example
10313 /// ```ignore,no_run
10314 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10315 /// let x = CreateHubRequest::new().set_hub_id("example");
10316 /// ```
10317 pub fn set_hub_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10318 self.hub_id = v.into();
10319 self
10320 }
10321
10322 /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
10323 ///
10324 /// # Example
10325 /// ```ignore,no_run
10326 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10327 /// use google_cloud_networkconnectivity_v1::model::Hub;
10328 /// let x = CreateHubRequest::new().set_hub(Hub::default()/* use setters */);
10329 /// ```
10330 pub fn set_hub<T>(mut self, v: T) -> Self
10331 where
10332 T: std::convert::Into<crate::model::Hub>,
10333 {
10334 self.hub = std::option::Option::Some(v.into());
10335 self
10336 }
10337
10338 /// Sets or clears the value of [hub][crate::model::CreateHubRequest::hub].
10339 ///
10340 /// # Example
10341 /// ```ignore,no_run
10342 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10343 /// use google_cloud_networkconnectivity_v1::model::Hub;
10344 /// let x = CreateHubRequest::new().set_or_clear_hub(Some(Hub::default()/* use setters */));
10345 /// let x = CreateHubRequest::new().set_or_clear_hub(None::<Hub>);
10346 /// ```
10347 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
10348 where
10349 T: std::convert::Into<crate::model::Hub>,
10350 {
10351 self.hub = v.map(|x| x.into());
10352 self
10353 }
10354
10355 /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
10356 ///
10357 /// # Example
10358 /// ```ignore,no_run
10359 /// # use google_cloud_networkconnectivity_v1::model::CreateHubRequest;
10360 /// let x = CreateHubRequest::new().set_request_id("example");
10361 /// ```
10362 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10363 self.request_id = v.into();
10364 self
10365 }
10366}
10367
10368impl wkt::message::Message for CreateHubRequest {
10369 fn typename() -> &'static str {
10370 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateHubRequest"
10371 }
10372}
10373
10374/// Request for
10375/// [HubService.UpdateHub][google.cloud.networkconnectivity.v1.HubService.UpdateHub]
10376/// method.
10377///
10378/// [google.cloud.networkconnectivity.v1.HubService.UpdateHub]: crate::client::HubService::update_hub
10379#[derive(Clone, Default, PartialEq)]
10380#[non_exhaustive]
10381pub struct UpdateHubRequest {
10382 /// Optional. In the case of an update to an existing hub, field mask is used
10383 /// to specify the fields to be overwritten. The fields specified in the
10384 /// update_mask are relative to the resource, not the full request. A field is
10385 /// overwritten if it is in the mask. If the user does not provide a mask, then
10386 /// all fields are overwritten.
10387 pub update_mask: std::option::Option<wkt::FieldMask>,
10388
10389 /// Required. The state that the hub should be in after the update.
10390 pub hub: std::option::Option<crate::model::Hub>,
10391
10392 /// Optional. A request ID to identify requests. Specify a unique request ID so
10393 /// that if you must retry your request, the server knows to ignore the request
10394 /// if it has already been completed. The server guarantees that a request
10395 /// doesn't result in creation of duplicate commitments for at least 60
10396 /// minutes.
10397 ///
10398 /// For example, consider a situation where you make an initial request and
10399 /// the request times out. If you make the request again with the same request
10400 /// ID, the server can check to see whether the original operation
10401 /// was received. If it was, the server ignores the second request. This
10402 /// behavior prevents clients from mistakenly creating duplicate commitments.
10403 ///
10404 /// The request ID must be a valid UUID, with the exception that zero UUID is
10405 /// not supported (00000000-0000-0000-0000-000000000000).
10406 pub request_id: std::string::String,
10407
10408 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10409}
10410
10411impl UpdateHubRequest {
10412 /// Creates a new default instance.
10413 pub fn new() -> Self {
10414 std::default::Default::default()
10415 }
10416
10417 /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
10418 ///
10419 /// # Example
10420 /// ```ignore,no_run
10421 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10422 /// use wkt::FieldMask;
10423 /// let x = UpdateHubRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10424 /// ```
10425 pub fn set_update_mask<T>(mut self, v: T) -> Self
10426 where
10427 T: std::convert::Into<wkt::FieldMask>,
10428 {
10429 self.update_mask = std::option::Option::Some(v.into());
10430 self
10431 }
10432
10433 /// Sets or clears the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
10434 ///
10435 /// # Example
10436 /// ```ignore,no_run
10437 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10438 /// use wkt::FieldMask;
10439 /// let x = UpdateHubRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10440 /// let x = UpdateHubRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10441 /// ```
10442 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10443 where
10444 T: std::convert::Into<wkt::FieldMask>,
10445 {
10446 self.update_mask = v.map(|x| x.into());
10447 self
10448 }
10449
10450 /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
10451 ///
10452 /// # Example
10453 /// ```ignore,no_run
10454 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10455 /// use google_cloud_networkconnectivity_v1::model::Hub;
10456 /// let x = UpdateHubRequest::new().set_hub(Hub::default()/* use setters */);
10457 /// ```
10458 pub fn set_hub<T>(mut self, v: T) -> Self
10459 where
10460 T: std::convert::Into<crate::model::Hub>,
10461 {
10462 self.hub = std::option::Option::Some(v.into());
10463 self
10464 }
10465
10466 /// Sets or clears the value of [hub][crate::model::UpdateHubRequest::hub].
10467 ///
10468 /// # Example
10469 /// ```ignore,no_run
10470 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10471 /// use google_cloud_networkconnectivity_v1::model::Hub;
10472 /// let x = UpdateHubRequest::new().set_or_clear_hub(Some(Hub::default()/* use setters */));
10473 /// let x = UpdateHubRequest::new().set_or_clear_hub(None::<Hub>);
10474 /// ```
10475 pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
10476 where
10477 T: std::convert::Into<crate::model::Hub>,
10478 {
10479 self.hub = v.map(|x| x.into());
10480 self
10481 }
10482
10483 /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
10484 ///
10485 /// # Example
10486 /// ```ignore,no_run
10487 /// # use google_cloud_networkconnectivity_v1::model::UpdateHubRequest;
10488 /// let x = UpdateHubRequest::new().set_request_id("example");
10489 /// ```
10490 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10491 self.request_id = v.into();
10492 self
10493 }
10494}
10495
10496impl wkt::message::Message for UpdateHubRequest {
10497 fn typename() -> &'static str {
10498 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateHubRequest"
10499 }
10500}
10501
10502/// The request for
10503/// [HubService.DeleteHub][google.cloud.networkconnectivity.v1.HubService.DeleteHub].
10504///
10505/// [google.cloud.networkconnectivity.v1.HubService.DeleteHub]: crate::client::HubService::delete_hub
10506#[derive(Clone, Default, PartialEq)]
10507#[non_exhaustive]
10508pub struct DeleteHubRequest {
10509 /// Required. The name of the hub to delete.
10510 pub name: std::string::String,
10511
10512 /// Optional. A request ID to identify requests. Specify a unique request ID so
10513 /// that if you must retry your request, the server knows to ignore the request
10514 /// if it has already been completed. The server guarantees that a request
10515 /// doesn't result in creation of duplicate commitments for at least 60
10516 /// minutes.
10517 ///
10518 /// For example, consider a situation where you make an initial request and
10519 /// the request times out. If you make the request again with the same request
10520 /// ID, the server can check to see whether the original operation
10521 /// was received. If it was, the server ignores the second request. This
10522 /// behavior prevents clients from mistakenly creating duplicate commitments.
10523 ///
10524 /// The request ID must be a valid UUID, with the exception that zero UUID is
10525 /// not supported (00000000-0000-0000-0000-000000000000).
10526 pub request_id: std::string::String,
10527
10528 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10529}
10530
10531impl DeleteHubRequest {
10532 /// Creates a new default instance.
10533 pub fn new() -> Self {
10534 std::default::Default::default()
10535 }
10536
10537 /// Sets the value of [name][crate::model::DeleteHubRequest::name].
10538 ///
10539 /// # Example
10540 /// ```ignore,no_run
10541 /// # use google_cloud_networkconnectivity_v1::model::DeleteHubRequest;
10542 /// # let project_id = "project_id";
10543 /// # let hub_id = "hub_id";
10544 /// let x = DeleteHubRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
10545 /// ```
10546 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10547 self.name = v.into();
10548 self
10549 }
10550
10551 /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
10552 ///
10553 /// # Example
10554 /// ```ignore,no_run
10555 /// # use google_cloud_networkconnectivity_v1::model::DeleteHubRequest;
10556 /// let x = DeleteHubRequest::new().set_request_id("example");
10557 /// ```
10558 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10559 self.request_id = v.into();
10560 self
10561 }
10562}
10563
10564impl wkt::message::Message for DeleteHubRequest {
10565 fn typename() -> &'static str {
10566 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteHubRequest"
10567 }
10568}
10569
10570/// The request for
10571/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
10572///
10573/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
10574#[derive(Clone, Default, PartialEq)]
10575#[non_exhaustive]
10576pub struct ListHubSpokesRequest {
10577 /// Required. The name of the hub.
10578 pub name: std::string::String,
10579
10580 /// A list of locations.
10581 /// Specify one of the following: `[global]`, a single region (for
10582 /// example, `[us-central1]`), or a combination of
10583 /// values (for example, `[global, us-central1, us-west1]`).
10584 /// If the spoke_locations field is populated, the list of results
10585 /// includes only spokes in the specified location.
10586 /// If the spoke_locations field is not populated, the list of results
10587 /// includes spokes in all locations.
10588 pub spoke_locations: std::vec::Vec<std::string::String>,
10589
10590 /// The maximum number of results to return per page.
10591 pub page_size: i32,
10592
10593 /// The page token.
10594 pub page_token: std::string::String,
10595
10596 /// An expression that filters the list of results.
10597 pub filter: std::string::String,
10598
10599 /// Sort the results by name or create_time.
10600 pub order_by: std::string::String,
10601
10602 /// The view of the spoke to return.
10603 /// The view that you use determines which spoke fields are included in the
10604 /// response.
10605 pub view: crate::model::list_hub_spokes_request::SpokeView,
10606
10607 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10608}
10609
10610impl ListHubSpokesRequest {
10611 /// Creates a new default instance.
10612 pub fn new() -> Self {
10613 std::default::Default::default()
10614 }
10615
10616 /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
10617 ///
10618 /// # Example
10619 /// ```ignore,no_run
10620 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10621 /// # let project_id = "project_id";
10622 /// # let hub_id = "hub_id";
10623 /// let x = ListHubSpokesRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
10624 /// ```
10625 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10626 self.name = v.into();
10627 self
10628 }
10629
10630 /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
10631 ///
10632 /// # Example
10633 /// ```ignore,no_run
10634 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10635 /// let x = ListHubSpokesRequest::new().set_spoke_locations(["a", "b", "c"]);
10636 /// ```
10637 pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
10638 where
10639 T: std::iter::IntoIterator<Item = V>,
10640 V: std::convert::Into<std::string::String>,
10641 {
10642 use std::iter::Iterator;
10643 self.spoke_locations = v.into_iter().map(|i| i.into()).collect();
10644 self
10645 }
10646
10647 /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
10648 ///
10649 /// # Example
10650 /// ```ignore,no_run
10651 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10652 /// let x = ListHubSpokesRequest::new().set_page_size(42);
10653 /// ```
10654 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10655 self.page_size = v.into();
10656 self
10657 }
10658
10659 /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
10660 ///
10661 /// # Example
10662 /// ```ignore,no_run
10663 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10664 /// let x = ListHubSpokesRequest::new().set_page_token("example");
10665 /// ```
10666 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10667 self.page_token = v.into();
10668 self
10669 }
10670
10671 /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
10672 ///
10673 /// # Example
10674 /// ```ignore,no_run
10675 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10676 /// let x = ListHubSpokesRequest::new().set_filter("example");
10677 /// ```
10678 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10679 self.filter = v.into();
10680 self
10681 }
10682
10683 /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
10684 ///
10685 /// # Example
10686 /// ```ignore,no_run
10687 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10688 /// let x = ListHubSpokesRequest::new().set_order_by("example");
10689 /// ```
10690 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10691 self.order_by = v.into();
10692 self
10693 }
10694
10695 /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
10696 ///
10697 /// # Example
10698 /// ```ignore,no_run
10699 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesRequest;
10700 /// use google_cloud_networkconnectivity_v1::model::list_hub_spokes_request::SpokeView;
10701 /// let x0 = ListHubSpokesRequest::new().set_view(SpokeView::Basic);
10702 /// let x1 = ListHubSpokesRequest::new().set_view(SpokeView::Detailed);
10703 /// ```
10704 pub fn set_view<T: std::convert::Into<crate::model::list_hub_spokes_request::SpokeView>>(
10705 mut self,
10706 v: T,
10707 ) -> Self {
10708 self.view = v.into();
10709 self
10710 }
10711}
10712
10713impl wkt::message::Message for ListHubSpokesRequest {
10714 fn typename() -> &'static str {
10715 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"
10716 }
10717}
10718
10719/// Defines additional types related to [ListHubSpokesRequest].
10720pub mod list_hub_spokes_request {
10721 #[allow(unused_imports)]
10722 use super::*;
10723
10724 /// Enum that controls which spoke fields are included in the response.
10725 ///
10726 /// # Working with unknown values
10727 ///
10728 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10729 /// additional enum variants at any time. Adding new variants is not considered
10730 /// a breaking change. Applications should write their code in anticipation of:
10731 ///
10732 /// - New values appearing in future releases of the client library, **and**
10733 /// - New values received dynamically, without application changes.
10734 ///
10735 /// Please consult the [Working with enums] section in the user guide for some
10736 /// guidelines.
10737 ///
10738 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10739 #[derive(Clone, Debug, PartialEq)]
10740 #[non_exhaustive]
10741 pub enum SpokeView {
10742 /// The spoke view is unspecified. When the spoke view is unspecified, the
10743 /// API returns the same fields as the `BASIC` view.
10744 Unspecified,
10745 /// Includes `name`, `create_time`, `hub`, `unique_id`, `state`, `reasons`,
10746 /// and `spoke_type`. This is the default value.
10747 Basic,
10748 /// Includes all spoke fields except `labels`.
10749 /// You can use the `DETAILED` view only when you set the `spoke_locations`
10750 /// field to `[global]`.
10751 Detailed,
10752 /// If set, the enum was initialized with an unknown value.
10753 ///
10754 /// Applications can examine the value using [SpokeView::value] or
10755 /// [SpokeView::name].
10756 UnknownValue(spoke_view::UnknownValue),
10757 }
10758
10759 #[doc(hidden)]
10760 pub mod spoke_view {
10761 #[allow(unused_imports)]
10762 use super::*;
10763 #[derive(Clone, Debug, PartialEq)]
10764 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10765 }
10766
10767 impl SpokeView {
10768 /// Gets the enum value.
10769 ///
10770 /// Returns `None` if the enum contains an unknown value deserialized from
10771 /// the string representation of enums.
10772 pub fn value(&self) -> std::option::Option<i32> {
10773 match self {
10774 Self::Unspecified => std::option::Option::Some(0),
10775 Self::Basic => std::option::Option::Some(1),
10776 Self::Detailed => std::option::Option::Some(2),
10777 Self::UnknownValue(u) => u.0.value(),
10778 }
10779 }
10780
10781 /// Gets the enum value as a string.
10782 ///
10783 /// Returns `None` if the enum contains an unknown value deserialized from
10784 /// the integer representation of enums.
10785 pub fn name(&self) -> std::option::Option<&str> {
10786 match self {
10787 Self::Unspecified => std::option::Option::Some("SPOKE_VIEW_UNSPECIFIED"),
10788 Self::Basic => std::option::Option::Some("BASIC"),
10789 Self::Detailed => std::option::Option::Some("DETAILED"),
10790 Self::UnknownValue(u) => u.0.name(),
10791 }
10792 }
10793 }
10794
10795 impl std::default::Default for SpokeView {
10796 fn default() -> Self {
10797 use std::convert::From;
10798 Self::from(0)
10799 }
10800 }
10801
10802 impl std::fmt::Display for SpokeView {
10803 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10804 wkt::internal::display_enum(f, self.name(), self.value())
10805 }
10806 }
10807
10808 impl std::convert::From<i32> for SpokeView {
10809 fn from(value: i32) -> Self {
10810 match value {
10811 0 => Self::Unspecified,
10812 1 => Self::Basic,
10813 2 => Self::Detailed,
10814 _ => Self::UnknownValue(spoke_view::UnknownValue(
10815 wkt::internal::UnknownEnumValue::Integer(value),
10816 )),
10817 }
10818 }
10819 }
10820
10821 impl std::convert::From<&str> for SpokeView {
10822 fn from(value: &str) -> Self {
10823 use std::string::ToString;
10824 match value {
10825 "SPOKE_VIEW_UNSPECIFIED" => Self::Unspecified,
10826 "BASIC" => Self::Basic,
10827 "DETAILED" => Self::Detailed,
10828 _ => Self::UnknownValue(spoke_view::UnknownValue(
10829 wkt::internal::UnknownEnumValue::String(value.to_string()),
10830 )),
10831 }
10832 }
10833 }
10834
10835 impl serde::ser::Serialize for SpokeView {
10836 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10837 where
10838 S: serde::Serializer,
10839 {
10840 match self {
10841 Self::Unspecified => serializer.serialize_i32(0),
10842 Self::Basic => serializer.serialize_i32(1),
10843 Self::Detailed => serializer.serialize_i32(2),
10844 Self::UnknownValue(u) => u.0.serialize(serializer),
10845 }
10846 }
10847 }
10848
10849 impl<'de> serde::de::Deserialize<'de> for SpokeView {
10850 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10851 where
10852 D: serde::Deserializer<'de>,
10853 {
10854 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeView>::new(
10855 ".google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView",
10856 ))
10857 }
10858 }
10859}
10860
10861/// The response for
10862/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
10863///
10864/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
10865#[derive(Clone, Default, PartialEq)]
10866#[non_exhaustive]
10867pub struct ListHubSpokesResponse {
10868 /// The requested spokes.
10869 /// The spoke fields can be partially populated based on the `view` field in
10870 /// the request message.
10871 pub spokes: std::vec::Vec<crate::model::Spoke>,
10872
10873 /// The token for the next page of the response. To see more results,
10874 /// use this value as the page_token for your next request. If this value
10875 /// is empty, there are no more results.
10876 pub next_page_token: std::string::String,
10877
10878 /// Locations that could not be reached.
10879 pub unreachable: std::vec::Vec<std::string::String>,
10880
10881 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10882}
10883
10884impl ListHubSpokesResponse {
10885 /// Creates a new default instance.
10886 pub fn new() -> Self {
10887 std::default::Default::default()
10888 }
10889
10890 /// Sets the value of [spokes][crate::model::ListHubSpokesResponse::spokes].
10891 ///
10892 /// # Example
10893 /// ```ignore,no_run
10894 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10895 /// use google_cloud_networkconnectivity_v1::model::Spoke;
10896 /// let x = ListHubSpokesResponse::new()
10897 /// .set_spokes([
10898 /// Spoke::default()/* use setters */,
10899 /// Spoke::default()/* use (different) setters */,
10900 /// ]);
10901 /// ```
10902 pub fn set_spokes<T, V>(mut self, v: T) -> Self
10903 where
10904 T: std::iter::IntoIterator<Item = V>,
10905 V: std::convert::Into<crate::model::Spoke>,
10906 {
10907 use std::iter::Iterator;
10908 self.spokes = v.into_iter().map(|i| i.into()).collect();
10909 self
10910 }
10911
10912 /// Sets the value of [next_page_token][crate::model::ListHubSpokesResponse::next_page_token].
10913 ///
10914 /// # Example
10915 /// ```ignore,no_run
10916 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10917 /// let x = ListHubSpokesResponse::new().set_next_page_token("example");
10918 /// ```
10919 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10920 self.next_page_token = v.into();
10921 self
10922 }
10923
10924 /// Sets the value of [unreachable][crate::model::ListHubSpokesResponse::unreachable].
10925 ///
10926 /// # Example
10927 /// ```ignore,no_run
10928 /// # use google_cloud_networkconnectivity_v1::model::ListHubSpokesResponse;
10929 /// let x = ListHubSpokesResponse::new().set_unreachable(["a", "b", "c"]);
10930 /// ```
10931 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10932 where
10933 T: std::iter::IntoIterator<Item = V>,
10934 V: std::convert::Into<std::string::String>,
10935 {
10936 use std::iter::Iterator;
10937 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10938 self
10939 }
10940}
10941
10942impl wkt::message::Message for ListHubSpokesResponse {
10943 fn typename() -> &'static str {
10944 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"
10945 }
10946}
10947
10948#[doc(hidden)]
10949impl google_cloud_gax::paginator::internal::PageableResponse for ListHubSpokesResponse {
10950 type PageItem = crate::model::Spoke;
10951
10952 fn items(self) -> std::vec::Vec<Self::PageItem> {
10953 self.spokes
10954 }
10955
10956 fn next_page_token(&self) -> std::string::String {
10957 use std::clone::Clone;
10958 self.next_page_token.clone()
10959 }
10960}
10961
10962/// The request for
10963/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
10964///
10965/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
10966#[derive(Clone, Default, PartialEq)]
10967#[non_exhaustive]
10968pub struct QueryHubStatusRequest {
10969 /// Required. The name of the hub.
10970 pub name: std::string::String,
10971
10972 /// Optional. The maximum number of results to return per page.
10973 pub page_size: i32,
10974
10975 /// Optional. The page token.
10976 pub page_token: std::string::String,
10977
10978 /// Optional. An expression that filters the list of results.
10979 /// The filter can be used to filter the results by the following fields:
10980 ///
10981 /// * `psc_propagation_status.source_spoke`
10982 /// * `psc_propagation_status.source_group`
10983 /// * `psc_propagation_status.source_forwarding_rule`
10984 /// * `psc_propagation_status.target_spoke`
10985 /// * `psc_propagation_status.target_group`
10986 /// * `psc_propagation_status.code`
10987 /// * `psc_propagation_status.message`
10988 pub filter: std::string::String,
10989
10990 /// Optional. Sort the results in ascending order by the specified fields.
10991 /// A comma-separated list of any of these fields:
10992 ///
10993 /// * `psc_propagation_status.source_spoke`
10994 /// * `psc_propagation_status.source_group`
10995 /// * `psc_propagation_status.source_forwarding_rule`
10996 /// * `psc_propagation_status.target_spoke`
10997 /// * `psc_propagation_status.target_group`
10998 /// * `psc_propagation_status.code`
10999 /// If `group_by` is set, the value of the `order_by` field must be the
11000 /// same as or a subset of the `group_by` field.
11001 pub order_by: std::string::String,
11002
11003 /// Optional. Aggregate the results by the specified fields.
11004 /// A comma-separated list of any of these fields:
11005 ///
11006 /// * `psc_propagation_status.source_spoke`
11007 /// * `psc_propagation_status.source_group`
11008 /// * `psc_propagation_status.source_forwarding_rule`
11009 /// * `psc_propagation_status.target_spoke`
11010 /// * `psc_propagation_status.target_group`
11011 /// * `psc_propagation_status.code`
11012 pub group_by: std::string::String,
11013
11014 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11015}
11016
11017impl QueryHubStatusRequest {
11018 /// Creates a new default instance.
11019 pub fn new() -> Self {
11020 std::default::Default::default()
11021 }
11022
11023 /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
11024 ///
11025 /// # Example
11026 /// ```ignore,no_run
11027 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
11028 /// # let project_id = "project_id";
11029 /// # let hub_id = "hub_id";
11030 /// let x = QueryHubStatusRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
11031 /// ```
11032 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11033 self.name = v.into();
11034 self
11035 }
11036
11037 /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
11038 ///
11039 /// # Example
11040 /// ```ignore,no_run
11041 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
11042 /// let x = QueryHubStatusRequest::new().set_page_size(42);
11043 /// ```
11044 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11045 self.page_size = v.into();
11046 self
11047 }
11048
11049 /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
11050 ///
11051 /// # Example
11052 /// ```ignore,no_run
11053 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
11054 /// let x = QueryHubStatusRequest::new().set_page_token("example");
11055 /// ```
11056 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11057 self.page_token = v.into();
11058 self
11059 }
11060
11061 /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
11062 ///
11063 /// # Example
11064 /// ```ignore,no_run
11065 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
11066 /// let x = QueryHubStatusRequest::new().set_filter("example");
11067 /// ```
11068 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11069 self.filter = v.into();
11070 self
11071 }
11072
11073 /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
11074 ///
11075 /// # Example
11076 /// ```ignore,no_run
11077 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
11078 /// let x = QueryHubStatusRequest::new().set_order_by("example");
11079 /// ```
11080 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11081 self.order_by = v.into();
11082 self
11083 }
11084
11085 /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
11086 ///
11087 /// # Example
11088 /// ```ignore,no_run
11089 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusRequest;
11090 /// let x = QueryHubStatusRequest::new().set_group_by("example");
11091 /// ```
11092 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11093 self.group_by = v.into();
11094 self
11095 }
11096}
11097
11098impl wkt::message::Message for QueryHubStatusRequest {
11099 fn typename() -> &'static str {
11100 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusRequest"
11101 }
11102}
11103
11104/// The response for
11105/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
11106///
11107/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
11108#[derive(Clone, Default, PartialEq)]
11109#[non_exhaustive]
11110pub struct QueryHubStatusResponse {
11111 /// The list of hub status.
11112 pub hub_status_entries: std::vec::Vec<crate::model::HubStatusEntry>,
11113
11114 /// The token for the next page of the response. To see more results,
11115 /// use this value as the page_token for your next request. If this value
11116 /// is empty, there are no more results.
11117 pub next_page_token: std::string::String,
11118
11119 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11120}
11121
11122impl QueryHubStatusResponse {
11123 /// Creates a new default instance.
11124 pub fn new() -> Self {
11125 std::default::Default::default()
11126 }
11127
11128 /// Sets the value of [hub_status_entries][crate::model::QueryHubStatusResponse::hub_status_entries].
11129 ///
11130 /// # Example
11131 /// ```ignore,no_run
11132 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusResponse;
11133 /// use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11134 /// let x = QueryHubStatusResponse::new()
11135 /// .set_hub_status_entries([
11136 /// HubStatusEntry::default()/* use setters */,
11137 /// HubStatusEntry::default()/* use (different) setters */,
11138 /// ]);
11139 /// ```
11140 pub fn set_hub_status_entries<T, V>(mut self, v: T) -> Self
11141 where
11142 T: std::iter::IntoIterator<Item = V>,
11143 V: std::convert::Into<crate::model::HubStatusEntry>,
11144 {
11145 use std::iter::Iterator;
11146 self.hub_status_entries = v.into_iter().map(|i| i.into()).collect();
11147 self
11148 }
11149
11150 /// Sets the value of [next_page_token][crate::model::QueryHubStatusResponse::next_page_token].
11151 ///
11152 /// # Example
11153 /// ```ignore,no_run
11154 /// # use google_cloud_networkconnectivity_v1::model::QueryHubStatusResponse;
11155 /// let x = QueryHubStatusResponse::new().set_next_page_token("example");
11156 /// ```
11157 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11158 self.next_page_token = v.into();
11159 self
11160 }
11161}
11162
11163impl wkt::message::Message for QueryHubStatusResponse {
11164 fn typename() -> &'static str {
11165 "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusResponse"
11166 }
11167}
11168
11169#[doc(hidden)]
11170impl google_cloud_gax::paginator::internal::PageableResponse for QueryHubStatusResponse {
11171 type PageItem = crate::model::HubStatusEntry;
11172
11173 fn items(self) -> std::vec::Vec<Self::PageItem> {
11174 self.hub_status_entries
11175 }
11176
11177 fn next_page_token(&self) -> std::string::String {
11178 use std::clone::Clone;
11179 self.next_page_token.clone()
11180 }
11181}
11182
11183/// A hub status entry represents the status of a set of propagated Private
11184/// Service Connect connections grouped by certain fields.
11185#[derive(Clone, Default, PartialEq)]
11186#[non_exhaustive]
11187pub struct HubStatusEntry {
11188 /// The number of propagated Private Service Connect connections with this
11189 /// status. If the `group_by` field was not set in the request message, the
11190 /// value of this field is 1.
11191 pub count: i32,
11192
11193 /// The fields that this entry is grouped by. This has the same value as the
11194 /// `group_by` field in the request message.
11195 pub group_by: std::string::String,
11196
11197 /// The Private Service Connect propagation status.
11198 pub psc_propagation_status: std::option::Option<crate::model::PscPropagationStatus>,
11199
11200 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11201}
11202
11203impl HubStatusEntry {
11204 /// Creates a new default instance.
11205 pub fn new() -> Self {
11206 std::default::Default::default()
11207 }
11208
11209 /// Sets the value of [count][crate::model::HubStatusEntry::count].
11210 ///
11211 /// # Example
11212 /// ```ignore,no_run
11213 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11214 /// let x = HubStatusEntry::new().set_count(42);
11215 /// ```
11216 pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11217 self.count = v.into();
11218 self
11219 }
11220
11221 /// Sets the value of [group_by][crate::model::HubStatusEntry::group_by].
11222 ///
11223 /// # Example
11224 /// ```ignore,no_run
11225 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11226 /// let x = HubStatusEntry::new().set_group_by("example");
11227 /// ```
11228 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11229 self.group_by = v.into();
11230 self
11231 }
11232
11233 /// Sets the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
11234 ///
11235 /// # Example
11236 /// ```ignore,no_run
11237 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11238 /// use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11239 /// let x = HubStatusEntry::new().set_psc_propagation_status(PscPropagationStatus::default()/* use setters */);
11240 /// ```
11241 pub fn set_psc_propagation_status<T>(mut self, v: T) -> Self
11242 where
11243 T: std::convert::Into<crate::model::PscPropagationStatus>,
11244 {
11245 self.psc_propagation_status = std::option::Option::Some(v.into());
11246 self
11247 }
11248
11249 /// Sets or clears the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
11250 ///
11251 /// # Example
11252 /// ```ignore,no_run
11253 /// # use google_cloud_networkconnectivity_v1::model::HubStatusEntry;
11254 /// use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11255 /// let x = HubStatusEntry::new().set_or_clear_psc_propagation_status(Some(PscPropagationStatus::default()/* use setters */));
11256 /// let x = HubStatusEntry::new().set_or_clear_psc_propagation_status(None::<PscPropagationStatus>);
11257 /// ```
11258 pub fn set_or_clear_psc_propagation_status<T>(mut self, v: std::option::Option<T>) -> Self
11259 where
11260 T: std::convert::Into<crate::model::PscPropagationStatus>,
11261 {
11262 self.psc_propagation_status = v.map(|x| x.into());
11263 self
11264 }
11265}
11266
11267impl wkt::message::Message for HubStatusEntry {
11268 fn typename() -> &'static str {
11269 "type.googleapis.com/google.cloud.networkconnectivity.v1.HubStatusEntry"
11270 }
11271}
11272
11273/// The status of one or more propagated Private Service Connect connections in a
11274/// hub.
11275#[derive(Clone, Default, PartialEq)]
11276#[non_exhaustive]
11277pub struct PscPropagationStatus {
11278 /// The name of the spoke that the source forwarding rule belongs to.
11279 pub source_spoke: std::string::String,
11280
11281 /// The name of the group that the source spoke belongs to.
11282 pub source_group: std::string::String,
11283
11284 /// The name of the forwarding rule exported to the hub.
11285 pub source_forwarding_rule: std::string::String,
11286
11287 /// The name of the spoke that the source forwarding rule propagates to.
11288 pub target_spoke: std::string::String,
11289
11290 /// The name of the group that the target spoke belongs to.
11291 pub target_group: std::string::String,
11292
11293 /// The propagation status.
11294 pub code: crate::model::psc_propagation_status::Code,
11295
11296 /// The human-readable summary of the Private Service Connect connection
11297 /// propagation status.
11298 pub message: std::string::String,
11299
11300 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11301}
11302
11303impl PscPropagationStatus {
11304 /// Creates a new default instance.
11305 pub fn new() -> Self {
11306 std::default::Default::default()
11307 }
11308
11309 /// Sets the value of [source_spoke][crate::model::PscPropagationStatus::source_spoke].
11310 ///
11311 /// # Example
11312 /// ```ignore,no_run
11313 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11314 /// let x = PscPropagationStatus::new().set_source_spoke("example");
11315 /// ```
11316 pub fn set_source_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11317 self.source_spoke = v.into();
11318 self
11319 }
11320
11321 /// Sets the value of [source_group][crate::model::PscPropagationStatus::source_group].
11322 ///
11323 /// # Example
11324 /// ```ignore,no_run
11325 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11326 /// let x = PscPropagationStatus::new().set_source_group("example");
11327 /// ```
11328 pub fn set_source_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11329 self.source_group = v.into();
11330 self
11331 }
11332
11333 /// Sets the value of [source_forwarding_rule][crate::model::PscPropagationStatus::source_forwarding_rule].
11334 ///
11335 /// # Example
11336 /// ```ignore,no_run
11337 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11338 /// let x = PscPropagationStatus::new().set_source_forwarding_rule("example");
11339 /// ```
11340 pub fn set_source_forwarding_rule<T: std::convert::Into<std::string::String>>(
11341 mut self,
11342 v: T,
11343 ) -> Self {
11344 self.source_forwarding_rule = v.into();
11345 self
11346 }
11347
11348 /// Sets the value of [target_spoke][crate::model::PscPropagationStatus::target_spoke].
11349 ///
11350 /// # Example
11351 /// ```ignore,no_run
11352 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11353 /// let x = PscPropagationStatus::new().set_target_spoke("example");
11354 /// ```
11355 pub fn set_target_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11356 self.target_spoke = v.into();
11357 self
11358 }
11359
11360 /// Sets the value of [target_group][crate::model::PscPropagationStatus::target_group].
11361 ///
11362 /// # Example
11363 /// ```ignore,no_run
11364 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11365 /// let x = PscPropagationStatus::new().set_target_group("example");
11366 /// ```
11367 pub fn set_target_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11368 self.target_group = v.into();
11369 self
11370 }
11371
11372 /// Sets the value of [code][crate::model::PscPropagationStatus::code].
11373 ///
11374 /// # Example
11375 /// ```ignore,no_run
11376 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11377 /// use google_cloud_networkconnectivity_v1::model::psc_propagation_status::Code;
11378 /// let x0 = PscPropagationStatus::new().set_code(Code::Ready);
11379 /// let x1 = PscPropagationStatus::new().set_code(Code::Propagating);
11380 /// let x2 = PscPropagationStatus::new().set_code(Code::ErrorProducerPropagatedConnectionLimitExceeded);
11381 /// ```
11382 pub fn set_code<T: std::convert::Into<crate::model::psc_propagation_status::Code>>(
11383 mut self,
11384 v: T,
11385 ) -> Self {
11386 self.code = v.into();
11387 self
11388 }
11389
11390 /// Sets the value of [message][crate::model::PscPropagationStatus::message].
11391 ///
11392 /// # Example
11393 /// ```ignore,no_run
11394 /// # use google_cloud_networkconnectivity_v1::model::PscPropagationStatus;
11395 /// let x = PscPropagationStatus::new().set_message("example");
11396 /// ```
11397 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11398 self.message = v.into();
11399 self
11400 }
11401}
11402
11403impl wkt::message::Message for PscPropagationStatus {
11404 fn typename() -> &'static str {
11405 "type.googleapis.com/google.cloud.networkconnectivity.v1.PscPropagationStatus"
11406 }
11407}
11408
11409/// Defines additional types related to [PscPropagationStatus].
11410pub mod psc_propagation_status {
11411 #[allow(unused_imports)]
11412 use super::*;
11413
11414 /// The Code enum represents the state of the Private Service Connect
11415 /// propagation.
11416 ///
11417 /// # Working with unknown values
11418 ///
11419 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11420 /// additional enum variants at any time. Adding new variants is not considered
11421 /// a breaking change. Applications should write their code in anticipation of:
11422 ///
11423 /// - New values appearing in future releases of the client library, **and**
11424 /// - New values received dynamically, without application changes.
11425 ///
11426 /// Please consult the [Working with enums] section in the user guide for some
11427 /// guidelines.
11428 ///
11429 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11430 #[derive(Clone, Debug, PartialEq)]
11431 #[non_exhaustive]
11432 pub enum Code {
11433 /// The code is unspecified.
11434 Unspecified,
11435 /// The propagated Private Service Connect connection is ready.
11436 Ready,
11437 /// The Private Service Connect connection is propagating. This is a
11438 /// transient state.
11439 Propagating,
11440 /// The Private Service Connect connection propagation failed because the VPC
11441 /// network or the project of the target spoke has exceeded the connection
11442 /// limit set by the producer.
11443 ErrorProducerPropagatedConnectionLimitExceeded,
11444 /// The Private Service Connect connection propagation failed because the NAT
11445 /// IP subnet space has been exhausted. It is equivalent to the `Needs
11446 /// attention` status of the Private Service Connect connection. See
11447 /// <https://cloud.google.com/vpc/docs/about-accessing-vpc-hosted-services-endpoints#connection-statuses>.
11448 ErrorProducerNatIpSpaceExhausted,
11449 /// The Private Service Connect connection propagation failed because the
11450 /// `PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK` quota in the
11451 /// producer VPC network has been exceeded.
11452 ErrorProducerQuotaExceeded,
11453 /// The Private Service Connect connection propagation failed because the
11454 /// `PSC_PROPAGATED_CONNECTIONS_PER_VPC_NETWORK` quota in the consumer
11455 /// VPC network has been exceeded.
11456 ErrorConsumerQuotaExceeded,
11457 /// If set, the enum was initialized with an unknown value.
11458 ///
11459 /// Applications can examine the value using [Code::value] or
11460 /// [Code::name].
11461 UnknownValue(code::UnknownValue),
11462 }
11463
11464 #[doc(hidden)]
11465 pub mod code {
11466 #[allow(unused_imports)]
11467 use super::*;
11468 #[derive(Clone, Debug, PartialEq)]
11469 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11470 }
11471
11472 impl Code {
11473 /// Gets the enum value.
11474 ///
11475 /// Returns `None` if the enum contains an unknown value deserialized from
11476 /// the string representation of enums.
11477 pub fn value(&self) -> std::option::Option<i32> {
11478 match self {
11479 Self::Unspecified => std::option::Option::Some(0),
11480 Self::Ready => std::option::Option::Some(1),
11481 Self::Propagating => std::option::Option::Some(2),
11482 Self::ErrorProducerPropagatedConnectionLimitExceeded => {
11483 std::option::Option::Some(3)
11484 }
11485 Self::ErrorProducerNatIpSpaceExhausted => std::option::Option::Some(4),
11486 Self::ErrorProducerQuotaExceeded => std::option::Option::Some(5),
11487 Self::ErrorConsumerQuotaExceeded => std::option::Option::Some(6),
11488 Self::UnknownValue(u) => u.0.value(),
11489 }
11490 }
11491
11492 /// Gets the enum value as a string.
11493 ///
11494 /// Returns `None` if the enum contains an unknown value deserialized from
11495 /// the integer representation of enums.
11496 pub fn name(&self) -> std::option::Option<&str> {
11497 match self {
11498 Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
11499 Self::Ready => std::option::Option::Some("READY"),
11500 Self::Propagating => std::option::Option::Some("PROPAGATING"),
11501 Self::ErrorProducerPropagatedConnectionLimitExceeded => {
11502 std::option::Option::Some("ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED")
11503 }
11504 Self::ErrorProducerNatIpSpaceExhausted => {
11505 std::option::Option::Some("ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED")
11506 }
11507 Self::ErrorProducerQuotaExceeded => {
11508 std::option::Option::Some("ERROR_PRODUCER_QUOTA_EXCEEDED")
11509 }
11510 Self::ErrorConsumerQuotaExceeded => {
11511 std::option::Option::Some("ERROR_CONSUMER_QUOTA_EXCEEDED")
11512 }
11513 Self::UnknownValue(u) => u.0.name(),
11514 }
11515 }
11516 }
11517
11518 impl std::default::Default for Code {
11519 fn default() -> Self {
11520 use std::convert::From;
11521 Self::from(0)
11522 }
11523 }
11524
11525 impl std::fmt::Display for Code {
11526 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11527 wkt::internal::display_enum(f, self.name(), self.value())
11528 }
11529 }
11530
11531 impl std::convert::From<i32> for Code {
11532 fn from(value: i32) -> Self {
11533 match value {
11534 0 => Self::Unspecified,
11535 1 => Self::Ready,
11536 2 => Self::Propagating,
11537 3 => Self::ErrorProducerPropagatedConnectionLimitExceeded,
11538 4 => Self::ErrorProducerNatIpSpaceExhausted,
11539 5 => Self::ErrorProducerQuotaExceeded,
11540 6 => Self::ErrorConsumerQuotaExceeded,
11541 _ => Self::UnknownValue(code::UnknownValue(
11542 wkt::internal::UnknownEnumValue::Integer(value),
11543 )),
11544 }
11545 }
11546 }
11547
11548 impl std::convert::From<&str> for Code {
11549 fn from(value: &str) -> Self {
11550 use std::string::ToString;
11551 match value {
11552 "CODE_UNSPECIFIED" => Self::Unspecified,
11553 "READY" => Self::Ready,
11554 "PROPAGATING" => Self::Propagating,
11555 "ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED" => {
11556 Self::ErrorProducerPropagatedConnectionLimitExceeded
11557 }
11558 "ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED" => Self::ErrorProducerNatIpSpaceExhausted,
11559 "ERROR_PRODUCER_QUOTA_EXCEEDED" => Self::ErrorProducerQuotaExceeded,
11560 "ERROR_CONSUMER_QUOTA_EXCEEDED" => Self::ErrorConsumerQuotaExceeded,
11561 _ => Self::UnknownValue(code::UnknownValue(
11562 wkt::internal::UnknownEnumValue::String(value.to_string()),
11563 )),
11564 }
11565 }
11566 }
11567
11568 impl serde::ser::Serialize for Code {
11569 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11570 where
11571 S: serde::Serializer,
11572 {
11573 match self {
11574 Self::Unspecified => serializer.serialize_i32(0),
11575 Self::Ready => serializer.serialize_i32(1),
11576 Self::Propagating => serializer.serialize_i32(2),
11577 Self::ErrorProducerPropagatedConnectionLimitExceeded => serializer.serialize_i32(3),
11578 Self::ErrorProducerNatIpSpaceExhausted => serializer.serialize_i32(4),
11579 Self::ErrorProducerQuotaExceeded => serializer.serialize_i32(5),
11580 Self::ErrorConsumerQuotaExceeded => serializer.serialize_i32(6),
11581 Self::UnknownValue(u) => u.0.serialize(serializer),
11582 }
11583 }
11584 }
11585
11586 impl<'de> serde::de::Deserialize<'de> for Code {
11587 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11588 where
11589 D: serde::Deserializer<'de>,
11590 {
11591 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
11592 ".google.cloud.networkconnectivity.v1.PscPropagationStatus.Code",
11593 ))
11594 }
11595 }
11596}
11597
11598/// The request for
11599/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
11600///
11601/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
11602#[derive(Clone, Default, PartialEq)]
11603#[non_exhaustive]
11604pub struct ListSpokesRequest {
11605 /// Required. The parent resource.
11606 pub parent: std::string::String,
11607
11608 /// The maximum number of results to return per page.
11609 pub page_size: i32,
11610
11611 /// The page token.
11612 pub page_token: std::string::String,
11613
11614 /// An expression that filters the list of results.
11615 pub filter: std::string::String,
11616
11617 /// Sort the results by a certain order.
11618 pub order_by: std::string::String,
11619
11620 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11621}
11622
11623impl ListSpokesRequest {
11624 /// Creates a new default instance.
11625 pub fn new() -> Self {
11626 std::default::Default::default()
11627 }
11628
11629 /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
11630 ///
11631 /// # Example
11632 /// ```ignore,no_run
11633 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11634 /// let x = ListSpokesRequest::new().set_parent("example");
11635 /// ```
11636 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11637 self.parent = v.into();
11638 self
11639 }
11640
11641 /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
11642 ///
11643 /// # Example
11644 /// ```ignore,no_run
11645 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11646 /// let x = ListSpokesRequest::new().set_page_size(42);
11647 /// ```
11648 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11649 self.page_size = v.into();
11650 self
11651 }
11652
11653 /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
11654 ///
11655 /// # Example
11656 /// ```ignore,no_run
11657 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11658 /// let x = ListSpokesRequest::new().set_page_token("example");
11659 /// ```
11660 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11661 self.page_token = v.into();
11662 self
11663 }
11664
11665 /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
11666 ///
11667 /// # Example
11668 /// ```ignore,no_run
11669 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11670 /// let x = ListSpokesRequest::new().set_filter("example");
11671 /// ```
11672 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11673 self.filter = v.into();
11674 self
11675 }
11676
11677 /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
11678 ///
11679 /// # Example
11680 /// ```ignore,no_run
11681 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesRequest;
11682 /// let x = ListSpokesRequest::new().set_order_by("example");
11683 /// ```
11684 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11685 self.order_by = v.into();
11686 self
11687 }
11688}
11689
11690impl wkt::message::Message for ListSpokesRequest {
11691 fn typename() -> &'static str {
11692 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesRequest"
11693 }
11694}
11695
11696/// The response for
11697/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
11698///
11699/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
11700#[derive(Clone, Default, PartialEq)]
11701#[non_exhaustive]
11702pub struct ListSpokesResponse {
11703 /// The requested spokes.
11704 pub spokes: std::vec::Vec<crate::model::Spoke>,
11705
11706 /// The token for the next page of the response. To see more results,
11707 /// use this value as the page_token for your next request. If this value
11708 /// is empty, there are no more results.
11709 pub next_page_token: std::string::String,
11710
11711 /// Locations that could not be reached.
11712 pub unreachable: std::vec::Vec<std::string::String>,
11713
11714 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11715}
11716
11717impl ListSpokesResponse {
11718 /// Creates a new default instance.
11719 pub fn new() -> Self {
11720 std::default::Default::default()
11721 }
11722
11723 /// Sets the value of [spokes][crate::model::ListSpokesResponse::spokes].
11724 ///
11725 /// # Example
11726 /// ```ignore,no_run
11727 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11728 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11729 /// let x = ListSpokesResponse::new()
11730 /// .set_spokes([
11731 /// Spoke::default()/* use setters */,
11732 /// Spoke::default()/* use (different) setters */,
11733 /// ]);
11734 /// ```
11735 pub fn set_spokes<T, V>(mut self, v: T) -> Self
11736 where
11737 T: std::iter::IntoIterator<Item = V>,
11738 V: std::convert::Into<crate::model::Spoke>,
11739 {
11740 use std::iter::Iterator;
11741 self.spokes = v.into_iter().map(|i| i.into()).collect();
11742 self
11743 }
11744
11745 /// Sets the value of [next_page_token][crate::model::ListSpokesResponse::next_page_token].
11746 ///
11747 /// # Example
11748 /// ```ignore,no_run
11749 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11750 /// let x = ListSpokesResponse::new().set_next_page_token("example");
11751 /// ```
11752 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11753 self.next_page_token = v.into();
11754 self
11755 }
11756
11757 /// Sets the value of [unreachable][crate::model::ListSpokesResponse::unreachable].
11758 ///
11759 /// # Example
11760 /// ```ignore,no_run
11761 /// # use google_cloud_networkconnectivity_v1::model::ListSpokesResponse;
11762 /// let x = ListSpokesResponse::new().set_unreachable(["a", "b", "c"]);
11763 /// ```
11764 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11765 where
11766 T: std::iter::IntoIterator<Item = V>,
11767 V: std::convert::Into<std::string::String>,
11768 {
11769 use std::iter::Iterator;
11770 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11771 self
11772 }
11773}
11774
11775impl wkt::message::Message for ListSpokesResponse {
11776 fn typename() -> &'static str {
11777 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesResponse"
11778 }
11779}
11780
11781#[doc(hidden)]
11782impl google_cloud_gax::paginator::internal::PageableResponse for ListSpokesResponse {
11783 type PageItem = crate::model::Spoke;
11784
11785 fn items(self) -> std::vec::Vec<Self::PageItem> {
11786 self.spokes
11787 }
11788
11789 fn next_page_token(&self) -> std::string::String {
11790 use std::clone::Clone;
11791 self.next_page_token.clone()
11792 }
11793}
11794
11795/// The request for
11796/// [HubService.GetSpoke][google.cloud.networkconnectivity.v1.HubService.GetSpoke].
11797///
11798/// [google.cloud.networkconnectivity.v1.HubService.GetSpoke]: crate::client::HubService::get_spoke
11799#[derive(Clone, Default, PartialEq)]
11800#[non_exhaustive]
11801pub struct GetSpokeRequest {
11802 /// Required. The name of the spoke resource.
11803 pub name: std::string::String,
11804
11805 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11806}
11807
11808impl GetSpokeRequest {
11809 /// Creates a new default instance.
11810 pub fn new() -> Self {
11811 std::default::Default::default()
11812 }
11813
11814 /// Sets the value of [name][crate::model::GetSpokeRequest::name].
11815 ///
11816 /// # Example
11817 /// ```ignore,no_run
11818 /// # use google_cloud_networkconnectivity_v1::model::GetSpokeRequest;
11819 /// # let project_id = "project_id";
11820 /// # let location_id = "location_id";
11821 /// # let spoke_id = "spoke_id";
11822 /// let x = GetSpokeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
11823 /// ```
11824 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11825 self.name = v.into();
11826 self
11827 }
11828}
11829
11830impl wkt::message::Message for GetSpokeRequest {
11831 fn typename() -> &'static str {
11832 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetSpokeRequest"
11833 }
11834}
11835
11836/// The request for
11837/// [HubService.CreateSpoke][google.cloud.networkconnectivity.v1.HubService.CreateSpoke].
11838///
11839/// [google.cloud.networkconnectivity.v1.HubService.CreateSpoke]: crate::client::HubService::create_spoke
11840#[derive(Clone, Default, PartialEq)]
11841#[non_exhaustive]
11842pub struct CreateSpokeRequest {
11843 /// Required. The parent resource.
11844 pub parent: std::string::String,
11845
11846 /// Required. Unique id for the spoke to create.
11847 pub spoke_id: std::string::String,
11848
11849 /// Required. The initial values for a new spoke.
11850 pub spoke: std::option::Option<crate::model::Spoke>,
11851
11852 /// Optional. A request ID to identify requests. Specify a unique request ID so
11853 /// that if you must retry your request, the server knows to ignore the request
11854 /// if it has already been completed. The server guarantees that a request
11855 /// doesn't result in creation of duplicate commitments for at least 60
11856 /// minutes.
11857 ///
11858 /// For example, consider a situation where you make an initial request and
11859 /// the request times out. If you make the request again with the same request
11860 /// ID, the server can check to see whether the original operation
11861 /// was received. If it was, the server ignores the second request. This
11862 /// behavior prevents clients from mistakenly creating duplicate commitments.
11863 ///
11864 /// The request ID must be a valid UUID, with the exception that zero UUID is
11865 /// not supported (00000000-0000-0000-0000-000000000000).
11866 pub request_id: std::string::String,
11867
11868 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11869}
11870
11871impl CreateSpokeRequest {
11872 /// Creates a new default instance.
11873 pub fn new() -> Self {
11874 std::default::Default::default()
11875 }
11876
11877 /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
11878 ///
11879 /// # Example
11880 /// ```ignore,no_run
11881 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11882 /// let x = CreateSpokeRequest::new().set_parent("example");
11883 /// ```
11884 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11885 self.parent = v.into();
11886 self
11887 }
11888
11889 /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
11890 ///
11891 /// # Example
11892 /// ```ignore,no_run
11893 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11894 /// let x = CreateSpokeRequest::new().set_spoke_id("example");
11895 /// ```
11896 pub fn set_spoke_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11897 self.spoke_id = v.into();
11898 self
11899 }
11900
11901 /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
11902 ///
11903 /// # Example
11904 /// ```ignore,no_run
11905 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11906 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11907 /// let x = CreateSpokeRequest::new().set_spoke(Spoke::default()/* use setters */);
11908 /// ```
11909 pub fn set_spoke<T>(mut self, v: T) -> Self
11910 where
11911 T: std::convert::Into<crate::model::Spoke>,
11912 {
11913 self.spoke = std::option::Option::Some(v.into());
11914 self
11915 }
11916
11917 /// Sets or clears the value of [spoke][crate::model::CreateSpokeRequest::spoke].
11918 ///
11919 /// # Example
11920 /// ```ignore,no_run
11921 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11922 /// use google_cloud_networkconnectivity_v1::model::Spoke;
11923 /// let x = CreateSpokeRequest::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
11924 /// let x = CreateSpokeRequest::new().set_or_clear_spoke(None::<Spoke>);
11925 /// ```
11926 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
11927 where
11928 T: std::convert::Into<crate::model::Spoke>,
11929 {
11930 self.spoke = v.map(|x| x.into());
11931 self
11932 }
11933
11934 /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
11935 ///
11936 /// # Example
11937 /// ```ignore,no_run
11938 /// # use google_cloud_networkconnectivity_v1::model::CreateSpokeRequest;
11939 /// let x = CreateSpokeRequest::new().set_request_id("example");
11940 /// ```
11941 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11942 self.request_id = v.into();
11943 self
11944 }
11945}
11946
11947impl wkt::message::Message for CreateSpokeRequest {
11948 fn typename() -> &'static str {
11949 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateSpokeRequest"
11950 }
11951}
11952
11953/// Request for
11954/// [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]
11955/// method.
11956///
11957/// [google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]: crate::client::HubService::update_spoke
11958#[derive(Clone, Default, PartialEq)]
11959#[non_exhaustive]
11960pub struct UpdateSpokeRequest {
11961 /// Optional. In the case of an update to an existing spoke, field mask is used
11962 /// to specify the fields to be overwritten. The fields specified in the
11963 /// update_mask are relative to the resource, not the full request. A field is
11964 /// overwritten if it is in the mask. If the user does not provide a mask, then
11965 /// all fields are overwritten.
11966 pub update_mask: std::option::Option<wkt::FieldMask>,
11967
11968 /// Required. The state that the spoke should be in after the update.
11969 pub spoke: std::option::Option<crate::model::Spoke>,
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 UpdateSpokeRequest {
11991 /// Creates a new default instance.
11992 pub fn new() -> Self {
11993 std::default::Default::default()
11994 }
11995
11996 /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
11997 ///
11998 /// # Example
11999 /// ```ignore,no_run
12000 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
12001 /// use wkt::FieldMask;
12002 /// let x = UpdateSpokeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
12003 /// ```
12004 pub fn set_update_mask<T>(mut self, v: T) -> Self
12005 where
12006 T: std::convert::Into<wkt::FieldMask>,
12007 {
12008 self.update_mask = std::option::Option::Some(v.into());
12009 self
12010 }
12011
12012 /// Sets or clears the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
12013 ///
12014 /// # Example
12015 /// ```ignore,no_run
12016 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
12017 /// use wkt::FieldMask;
12018 /// let x = UpdateSpokeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
12019 /// let x = UpdateSpokeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
12020 /// ```
12021 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12022 where
12023 T: std::convert::Into<wkt::FieldMask>,
12024 {
12025 self.update_mask = v.map(|x| x.into());
12026 self
12027 }
12028
12029 /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
12030 ///
12031 /// # Example
12032 /// ```ignore,no_run
12033 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
12034 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12035 /// let x = UpdateSpokeRequest::new().set_spoke(Spoke::default()/* use setters */);
12036 /// ```
12037 pub fn set_spoke<T>(mut self, v: T) -> Self
12038 where
12039 T: std::convert::Into<crate::model::Spoke>,
12040 {
12041 self.spoke = std::option::Option::Some(v.into());
12042 self
12043 }
12044
12045 /// Sets or clears the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
12046 ///
12047 /// # Example
12048 /// ```ignore,no_run
12049 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
12050 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12051 /// let x = UpdateSpokeRequest::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12052 /// let x = UpdateSpokeRequest::new().set_or_clear_spoke(None::<Spoke>);
12053 /// ```
12054 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12055 where
12056 T: std::convert::Into<crate::model::Spoke>,
12057 {
12058 self.spoke = v.map(|x| x.into());
12059 self
12060 }
12061
12062 /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
12063 ///
12064 /// # Example
12065 /// ```ignore,no_run
12066 /// # use google_cloud_networkconnectivity_v1::model::UpdateSpokeRequest;
12067 /// let x = UpdateSpokeRequest::new().set_request_id("example");
12068 /// ```
12069 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12070 self.request_id = v.into();
12071 self
12072 }
12073}
12074
12075impl wkt::message::Message for UpdateSpokeRequest {
12076 fn typename() -> &'static str {
12077 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"
12078 }
12079}
12080
12081/// The request for
12082/// [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1.HubService.DeleteSpoke].
12083///
12084/// [google.cloud.networkconnectivity.v1.HubService.DeleteSpoke]: crate::client::HubService::delete_spoke
12085#[derive(Clone, Default, PartialEq)]
12086#[non_exhaustive]
12087pub struct DeleteSpokeRequest {
12088 /// Required. The name of the spoke to delete.
12089 pub name: std::string::String,
12090
12091 /// Optional. A request ID to identify requests. Specify a unique request ID so
12092 /// that if you must retry your request, the server knows to ignore the request
12093 /// if it has already been completed. The server guarantees that a request
12094 /// doesn't result in creation of duplicate commitments for at least 60
12095 /// minutes.
12096 ///
12097 /// For example, consider a situation where you make an initial request and
12098 /// the request times out. If you make the request again with the same request
12099 /// ID, the server can check to see whether the original operation
12100 /// was received. If it was, the server ignores the second request. This
12101 /// behavior prevents clients from mistakenly creating duplicate commitments.
12102 ///
12103 /// The request ID must be a valid UUID, with the exception that zero UUID is
12104 /// not supported (00000000-0000-0000-0000-000000000000).
12105 pub request_id: std::string::String,
12106
12107 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12108}
12109
12110impl DeleteSpokeRequest {
12111 /// Creates a new default instance.
12112 pub fn new() -> Self {
12113 std::default::Default::default()
12114 }
12115
12116 /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
12117 ///
12118 /// # Example
12119 /// ```ignore,no_run
12120 /// # use google_cloud_networkconnectivity_v1::model::DeleteSpokeRequest;
12121 /// # let project_id = "project_id";
12122 /// # let location_id = "location_id";
12123 /// # let spoke_id = "spoke_id";
12124 /// let x = DeleteSpokeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
12125 /// ```
12126 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12127 self.name = v.into();
12128 self
12129 }
12130
12131 /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
12132 ///
12133 /// # Example
12134 /// ```ignore,no_run
12135 /// # use google_cloud_networkconnectivity_v1::model::DeleteSpokeRequest;
12136 /// let x = DeleteSpokeRequest::new().set_request_id("example");
12137 /// ```
12138 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12139 self.request_id = v.into();
12140 self
12141 }
12142}
12143
12144impl wkt::message::Message for DeleteSpokeRequest {
12145 fn typename() -> &'static str {
12146 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"
12147 }
12148}
12149
12150/// The request for
12151/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
12152///
12153/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
12154#[derive(Clone, Default, PartialEq)]
12155#[non_exhaustive]
12156pub struct AcceptHubSpokeRequest {
12157 /// Required. The name of the hub into which to accept the spoke.
12158 pub name: std::string::String,
12159
12160 /// Required. The URI of the spoke to accept into the hub.
12161 pub spoke_uri: std::string::String,
12162
12163 /// Optional. A request ID to identify requests. Specify a unique request ID so
12164 /// that if you must retry your request, the server knows to ignore the request
12165 /// if it has already been completed. The server guarantees that a request
12166 /// doesn't result in creation of duplicate commitments for at least 60
12167 /// minutes.
12168 ///
12169 /// For example, consider a situation where you make an initial request and
12170 /// the request times out. If you make the request again with the same request
12171 /// ID, the server can check to see whether the original operation
12172 /// was received. If it was, the server ignores the second request. This
12173 /// behavior prevents clients from mistakenly creating duplicate commitments.
12174 ///
12175 /// The request ID must be a valid UUID, with the exception that zero UUID is
12176 /// not supported (00000000-0000-0000-0000-000000000000).
12177 pub request_id: std::string::String,
12178
12179 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12180}
12181
12182impl AcceptHubSpokeRequest {
12183 /// Creates a new default instance.
12184 pub fn new() -> Self {
12185 std::default::Default::default()
12186 }
12187
12188 /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
12189 ///
12190 /// # Example
12191 /// ```ignore,no_run
12192 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12193 /// # let project_id = "project_id";
12194 /// # let hub_id = "hub_id";
12195 /// let x = AcceptHubSpokeRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
12196 /// ```
12197 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12198 self.name = v.into();
12199 self
12200 }
12201
12202 /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
12203 ///
12204 /// # Example
12205 /// ```ignore,no_run
12206 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12207 /// # let project_id = "project_id";
12208 /// # let location_id = "location_id";
12209 /// # let spoke_id = "spoke_id";
12210 /// let x = AcceptHubSpokeRequest::new().set_spoke_uri(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
12211 /// ```
12212 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12213 self.spoke_uri = v.into();
12214 self
12215 }
12216
12217 /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
12218 ///
12219 /// # Example
12220 /// ```ignore,no_run
12221 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeRequest;
12222 /// let x = AcceptHubSpokeRequest::new().set_request_id("example");
12223 /// ```
12224 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12225 self.request_id = v.into();
12226 self
12227 }
12228}
12229
12230impl wkt::message::Message for AcceptHubSpokeRequest {
12231 fn typename() -> &'static str {
12232 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"
12233 }
12234}
12235
12236/// The response for
12237/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
12238///
12239/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
12240#[derive(Clone, Default, PartialEq)]
12241#[non_exhaustive]
12242pub struct AcceptHubSpokeResponse {
12243 /// The spoke that was operated on.
12244 pub spoke: std::option::Option<crate::model::Spoke>,
12245
12246 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12247}
12248
12249impl AcceptHubSpokeResponse {
12250 /// Creates a new default instance.
12251 pub fn new() -> Self {
12252 std::default::Default::default()
12253 }
12254
12255 /// Sets the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
12256 ///
12257 /// # Example
12258 /// ```ignore,no_run
12259 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeResponse;
12260 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12261 /// let x = AcceptHubSpokeResponse::new().set_spoke(Spoke::default()/* use setters */);
12262 /// ```
12263 pub fn set_spoke<T>(mut self, v: T) -> Self
12264 where
12265 T: std::convert::Into<crate::model::Spoke>,
12266 {
12267 self.spoke = std::option::Option::Some(v.into());
12268 self
12269 }
12270
12271 /// Sets or clears the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
12272 ///
12273 /// # Example
12274 /// ```ignore,no_run
12275 /// # use google_cloud_networkconnectivity_v1::model::AcceptHubSpokeResponse;
12276 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12277 /// let x = AcceptHubSpokeResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12278 /// let x = AcceptHubSpokeResponse::new().set_or_clear_spoke(None::<Spoke>);
12279 /// ```
12280 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12281 where
12282 T: std::convert::Into<crate::model::Spoke>,
12283 {
12284 self.spoke = v.map(|x| x.into());
12285 self
12286 }
12287}
12288
12289impl wkt::message::Message for AcceptHubSpokeResponse {
12290 fn typename() -> &'static str {
12291 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"
12292 }
12293}
12294
12295/// The request for
12296/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
12297///
12298/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
12299#[derive(Clone, Default, PartialEq)]
12300#[non_exhaustive]
12301pub struct RejectHubSpokeRequest {
12302 /// Required. The name of the hub from which to reject the spoke.
12303 pub name: std::string::String,
12304
12305 /// Required. The URI of the spoke to reject from the hub.
12306 pub spoke_uri: std::string::String,
12307
12308 /// Optional. A request ID to identify requests. Specify a unique request ID so
12309 /// that if you must retry your request, the server knows to ignore the request
12310 /// if it has already been completed. The server guarantees that a request
12311 /// doesn't result in creation of duplicate commitments for at least 60
12312 /// minutes.
12313 ///
12314 /// For example, consider a situation where you make an initial request and
12315 /// the request times out. If you make the request again with the same request
12316 /// ID, the server can check to see whether the original operation
12317 /// was received. If it was, the server ignores the second request. This
12318 /// behavior prevents clients from mistakenly creating duplicate commitments.
12319 ///
12320 /// The request ID must be a valid UUID, with the exception that zero UUID is
12321 /// not supported (00000000-0000-0000-0000-000000000000).
12322 pub request_id: std::string::String,
12323
12324 /// Optional. Additional information provided by the hub administrator.
12325 pub details: std::string::String,
12326
12327 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12328}
12329
12330impl RejectHubSpokeRequest {
12331 /// Creates a new default instance.
12332 pub fn new() -> Self {
12333 std::default::Default::default()
12334 }
12335
12336 /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
12337 ///
12338 /// # Example
12339 /// ```ignore,no_run
12340 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12341 /// # let project_id = "project_id";
12342 /// # let hub_id = "hub_id";
12343 /// let x = RejectHubSpokeRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
12344 /// ```
12345 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12346 self.name = v.into();
12347 self
12348 }
12349
12350 /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
12351 ///
12352 /// # Example
12353 /// ```ignore,no_run
12354 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12355 /// # let project_id = "project_id";
12356 /// # let location_id = "location_id";
12357 /// # let spoke_id = "spoke_id";
12358 /// let x = RejectHubSpokeRequest::new().set_spoke_uri(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
12359 /// ```
12360 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12361 self.spoke_uri = v.into();
12362 self
12363 }
12364
12365 /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
12366 ///
12367 /// # Example
12368 /// ```ignore,no_run
12369 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12370 /// let x = RejectHubSpokeRequest::new().set_request_id("example");
12371 /// ```
12372 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12373 self.request_id = v.into();
12374 self
12375 }
12376
12377 /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
12378 ///
12379 /// # Example
12380 /// ```ignore,no_run
12381 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeRequest;
12382 /// let x = RejectHubSpokeRequest::new().set_details("example");
12383 /// ```
12384 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12385 self.details = v.into();
12386 self
12387 }
12388}
12389
12390impl wkt::message::Message for RejectHubSpokeRequest {
12391 fn typename() -> &'static str {
12392 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"
12393 }
12394}
12395
12396/// The response for
12397/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
12398///
12399/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
12400#[derive(Clone, Default, PartialEq)]
12401#[non_exhaustive]
12402pub struct RejectHubSpokeResponse {
12403 /// The spoke that was operated on.
12404 pub spoke: std::option::Option<crate::model::Spoke>,
12405
12406 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12407}
12408
12409impl RejectHubSpokeResponse {
12410 /// Creates a new default instance.
12411 pub fn new() -> Self {
12412 std::default::Default::default()
12413 }
12414
12415 /// Sets the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
12416 ///
12417 /// # Example
12418 /// ```ignore,no_run
12419 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeResponse;
12420 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12421 /// let x = RejectHubSpokeResponse::new().set_spoke(Spoke::default()/* use setters */);
12422 /// ```
12423 pub fn set_spoke<T>(mut self, v: T) -> Self
12424 where
12425 T: std::convert::Into<crate::model::Spoke>,
12426 {
12427 self.spoke = std::option::Option::Some(v.into());
12428 self
12429 }
12430
12431 /// Sets or clears the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
12432 ///
12433 /// # Example
12434 /// ```ignore,no_run
12435 /// # use google_cloud_networkconnectivity_v1::model::RejectHubSpokeResponse;
12436 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12437 /// let x = RejectHubSpokeResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12438 /// let x = RejectHubSpokeResponse::new().set_or_clear_spoke(None::<Spoke>);
12439 /// ```
12440 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12441 where
12442 T: std::convert::Into<crate::model::Spoke>,
12443 {
12444 self.spoke = v.map(|x| x.into());
12445 self
12446 }
12447}
12448
12449impl wkt::message::Message for RejectHubSpokeResponse {
12450 fn typename() -> &'static str {
12451 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"
12452 }
12453}
12454
12455/// The request for
12456/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
12457///
12458/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
12459#[derive(Clone, Default, PartialEq)]
12460#[non_exhaustive]
12461pub struct AcceptSpokeUpdateRequest {
12462 /// Required. The name of the hub to accept spoke update.
12463 pub name: std::string::String,
12464
12465 /// Required. The URI of the spoke to accept update.
12466 pub spoke_uri: std::string::String,
12467
12468 /// Required. The etag of the spoke to accept update.
12469 pub spoke_etag: std::string::String,
12470
12471 /// Optional. A request ID to identify requests. Specify a unique request ID so
12472 /// that if you must retry your request, the server knows to ignore the request
12473 /// if it has already been completed. The server guarantees that a request
12474 /// doesn't result in creation of duplicate commitments for at least 60
12475 /// minutes.
12476 ///
12477 /// For example, consider a situation where you make an initial request and
12478 /// the request times out. If you make the request again with the same request
12479 /// ID, the server can check to see whether the original operation
12480 /// was received. If it was, the server ignores the second request. This
12481 /// behavior prevents clients from mistakenly creating duplicate commitments.
12482 ///
12483 /// The request ID must be a valid UUID, with the exception that zero UUID is
12484 /// not supported (00000000-0000-0000-0000-000000000000).
12485 pub request_id: std::string::String,
12486
12487 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12488}
12489
12490impl AcceptSpokeUpdateRequest {
12491 /// Creates a new default instance.
12492 pub fn new() -> Self {
12493 std::default::Default::default()
12494 }
12495
12496 /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
12497 ///
12498 /// # Example
12499 /// ```ignore,no_run
12500 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12501 /// # let project_id = "project_id";
12502 /// # let hub_id = "hub_id";
12503 /// let x = AcceptSpokeUpdateRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
12504 /// ```
12505 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12506 self.name = v.into();
12507 self
12508 }
12509
12510 /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
12511 ///
12512 /// # Example
12513 /// ```ignore,no_run
12514 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12515 /// # let project_id = "project_id";
12516 /// # let location_id = "location_id";
12517 /// # let spoke_id = "spoke_id";
12518 /// let x = AcceptSpokeUpdateRequest::new().set_spoke_uri(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
12519 /// ```
12520 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12521 self.spoke_uri = v.into();
12522 self
12523 }
12524
12525 /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
12526 ///
12527 /// # Example
12528 /// ```ignore,no_run
12529 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12530 /// let x = AcceptSpokeUpdateRequest::new().set_spoke_etag("example");
12531 /// ```
12532 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12533 self.spoke_etag = v.into();
12534 self
12535 }
12536
12537 /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
12538 ///
12539 /// # Example
12540 /// ```ignore,no_run
12541 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateRequest;
12542 /// let x = AcceptSpokeUpdateRequest::new().set_request_id("example");
12543 /// ```
12544 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12545 self.request_id = v.into();
12546 self
12547 }
12548}
12549
12550impl wkt::message::Message for AcceptSpokeUpdateRequest {
12551 fn typename() -> &'static str {
12552 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateRequest"
12553 }
12554}
12555
12556/// The response for
12557/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
12558///
12559/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
12560#[derive(Clone, Default, PartialEq)]
12561#[non_exhaustive]
12562pub struct AcceptSpokeUpdateResponse {
12563 /// The spoke that was operated on.
12564 pub spoke: std::option::Option<crate::model::Spoke>,
12565
12566 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12567}
12568
12569impl AcceptSpokeUpdateResponse {
12570 /// Creates a new default instance.
12571 pub fn new() -> Self {
12572 std::default::Default::default()
12573 }
12574
12575 /// Sets the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
12576 ///
12577 /// # Example
12578 /// ```ignore,no_run
12579 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateResponse;
12580 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12581 /// let x = AcceptSpokeUpdateResponse::new().set_spoke(Spoke::default()/* use setters */);
12582 /// ```
12583 pub fn set_spoke<T>(mut self, v: T) -> Self
12584 where
12585 T: std::convert::Into<crate::model::Spoke>,
12586 {
12587 self.spoke = std::option::Option::Some(v.into());
12588 self
12589 }
12590
12591 /// Sets or clears the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
12592 ///
12593 /// # Example
12594 /// ```ignore,no_run
12595 /// # use google_cloud_networkconnectivity_v1::model::AcceptSpokeUpdateResponse;
12596 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12597 /// let x = AcceptSpokeUpdateResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12598 /// let x = AcceptSpokeUpdateResponse::new().set_or_clear_spoke(None::<Spoke>);
12599 /// ```
12600 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12601 where
12602 T: std::convert::Into<crate::model::Spoke>,
12603 {
12604 self.spoke = v.map(|x| x.into());
12605 self
12606 }
12607}
12608
12609impl wkt::message::Message for AcceptSpokeUpdateResponse {
12610 fn typename() -> &'static str {
12611 "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateResponse"
12612 }
12613}
12614
12615/// The request for
12616/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
12617///
12618/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
12619#[derive(Clone, Default, PartialEq)]
12620#[non_exhaustive]
12621pub struct RejectSpokeUpdateRequest {
12622 /// Required. The name of the hub to reject spoke update.
12623 pub name: std::string::String,
12624
12625 /// Required. The URI of the spoke to reject update.
12626 pub spoke_uri: std::string::String,
12627
12628 /// Required. The etag of the spoke to reject update.
12629 pub spoke_etag: std::string::String,
12630
12631 /// Optional. Additional information provided by the hub administrator.
12632 pub details: std::string::String,
12633
12634 /// Optional. A request ID to identify requests. Specify a unique request ID so
12635 /// that if you must retry your request, the server knows to ignore the request
12636 /// if it has already been completed. The server guarantees that a request
12637 /// doesn't result in creation of duplicate commitments for at least 60
12638 /// minutes.
12639 ///
12640 /// For example, consider a situation where you make an initial request and
12641 /// the request times out. If you make the request again with the same request
12642 /// ID, the server can check to see whether the original operation
12643 /// was received. If it was, the server ignores the second request. This
12644 /// behavior prevents clients from mistakenly creating duplicate commitments.
12645 ///
12646 /// The request ID must be a valid UUID, with the exception that zero UUID is
12647 /// not supported (00000000-0000-0000-0000-000000000000).
12648 pub request_id: std::string::String,
12649
12650 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12651}
12652
12653impl RejectSpokeUpdateRequest {
12654 /// Creates a new default instance.
12655 pub fn new() -> Self {
12656 std::default::Default::default()
12657 }
12658
12659 /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
12660 ///
12661 /// # Example
12662 /// ```ignore,no_run
12663 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12664 /// # let project_id = "project_id";
12665 /// # let hub_id = "hub_id";
12666 /// let x = RejectSpokeUpdateRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
12667 /// ```
12668 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12669 self.name = v.into();
12670 self
12671 }
12672
12673 /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
12674 ///
12675 /// # Example
12676 /// ```ignore,no_run
12677 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12678 /// # let project_id = "project_id";
12679 /// # let location_id = "location_id";
12680 /// # let spoke_id = "spoke_id";
12681 /// let x = RejectSpokeUpdateRequest::new().set_spoke_uri(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
12682 /// ```
12683 pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12684 self.spoke_uri = v.into();
12685 self
12686 }
12687
12688 /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
12689 ///
12690 /// # Example
12691 /// ```ignore,no_run
12692 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12693 /// let x = RejectSpokeUpdateRequest::new().set_spoke_etag("example");
12694 /// ```
12695 pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12696 self.spoke_etag = v.into();
12697 self
12698 }
12699
12700 /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
12701 ///
12702 /// # Example
12703 /// ```ignore,no_run
12704 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12705 /// let x = RejectSpokeUpdateRequest::new().set_details("example");
12706 /// ```
12707 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12708 self.details = v.into();
12709 self
12710 }
12711
12712 /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
12713 ///
12714 /// # Example
12715 /// ```ignore,no_run
12716 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateRequest;
12717 /// let x = RejectSpokeUpdateRequest::new().set_request_id("example");
12718 /// ```
12719 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12720 self.request_id = v.into();
12721 self
12722 }
12723}
12724
12725impl wkt::message::Message for RejectSpokeUpdateRequest {
12726 fn typename() -> &'static str {
12727 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateRequest"
12728 }
12729}
12730
12731/// The response for
12732/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
12733///
12734/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
12735#[derive(Clone, Default, PartialEq)]
12736#[non_exhaustive]
12737pub struct RejectSpokeUpdateResponse {
12738 /// The spoke that was operated on.
12739 pub spoke: std::option::Option<crate::model::Spoke>,
12740
12741 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12742}
12743
12744impl RejectSpokeUpdateResponse {
12745 /// Creates a new default instance.
12746 pub fn new() -> Self {
12747 std::default::Default::default()
12748 }
12749
12750 /// Sets the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
12751 ///
12752 /// # Example
12753 /// ```ignore,no_run
12754 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateResponse;
12755 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12756 /// let x = RejectSpokeUpdateResponse::new().set_spoke(Spoke::default()/* use setters */);
12757 /// ```
12758 pub fn set_spoke<T>(mut self, v: T) -> Self
12759 where
12760 T: std::convert::Into<crate::model::Spoke>,
12761 {
12762 self.spoke = std::option::Option::Some(v.into());
12763 self
12764 }
12765
12766 /// Sets or clears the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
12767 ///
12768 /// # Example
12769 /// ```ignore,no_run
12770 /// # use google_cloud_networkconnectivity_v1::model::RejectSpokeUpdateResponse;
12771 /// use google_cloud_networkconnectivity_v1::model::Spoke;
12772 /// let x = RejectSpokeUpdateResponse::new().set_or_clear_spoke(Some(Spoke::default()/* use setters */));
12773 /// let x = RejectSpokeUpdateResponse::new().set_or_clear_spoke(None::<Spoke>);
12774 /// ```
12775 pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
12776 where
12777 T: std::convert::Into<crate::model::Spoke>,
12778 {
12779 self.spoke = v.map(|x| x.into());
12780 self
12781 }
12782}
12783
12784impl wkt::message::Message for RejectSpokeUpdateResponse {
12785 fn typename() -> &'static str {
12786 "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateResponse"
12787 }
12788}
12789
12790/// The request for
12791/// [HubService.GetRouteTable][google.cloud.networkconnectivity.v1.HubService.GetRouteTable].
12792///
12793/// [google.cloud.networkconnectivity.v1.HubService.GetRouteTable]: crate::client::HubService::get_route_table
12794#[derive(Clone, Default, PartialEq)]
12795#[non_exhaustive]
12796pub struct GetRouteTableRequest {
12797 /// Required. The name of the route table resource.
12798 pub name: std::string::String,
12799
12800 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12801}
12802
12803impl GetRouteTableRequest {
12804 /// Creates a new default instance.
12805 pub fn new() -> Self {
12806 std::default::Default::default()
12807 }
12808
12809 /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
12810 ///
12811 /// # Example
12812 /// ```ignore,no_run
12813 /// # use google_cloud_networkconnectivity_v1::model::GetRouteTableRequest;
12814 /// # let project_id = "project_id";
12815 /// # let hub_id = "hub_id";
12816 /// # let route_table_id = "route_table_id";
12817 /// let x = GetRouteTableRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}"));
12818 /// ```
12819 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12820 self.name = v.into();
12821 self
12822 }
12823}
12824
12825impl wkt::message::Message for GetRouteTableRequest {
12826 fn typename() -> &'static str {
12827 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteTableRequest"
12828 }
12829}
12830
12831/// The request for
12832/// [HubService.GetRoute][google.cloud.networkconnectivity.v1.HubService.GetRoute].
12833///
12834/// [google.cloud.networkconnectivity.v1.HubService.GetRoute]: crate::client::HubService::get_route
12835#[derive(Clone, Default, PartialEq)]
12836#[non_exhaustive]
12837pub struct GetRouteRequest {
12838 /// Required. The name of the route resource.
12839 pub name: std::string::String,
12840
12841 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12842}
12843
12844impl GetRouteRequest {
12845 /// Creates a new default instance.
12846 pub fn new() -> Self {
12847 std::default::Default::default()
12848 }
12849
12850 /// Sets the value of [name][crate::model::GetRouteRequest::name].
12851 ///
12852 /// # Example
12853 /// ```ignore,no_run
12854 /// # use google_cloud_networkconnectivity_v1::model::GetRouteRequest;
12855 /// # let project_id = "project_id";
12856 /// # let hub_id = "hub_id";
12857 /// # let route_table_id = "route_table_id";
12858 /// # let route_id = "route_id";
12859 /// let x = GetRouteRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}/routes/{route_id}"));
12860 /// ```
12861 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12862 self.name = v.into();
12863 self
12864 }
12865}
12866
12867impl wkt::message::Message for GetRouteRequest {
12868 fn typename() -> &'static str {
12869 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteRequest"
12870 }
12871}
12872
12873/// Request for
12874/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
12875/// method.
12876///
12877/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
12878#[derive(Clone, Default, PartialEq)]
12879#[non_exhaustive]
12880pub struct ListRoutesRequest {
12881 /// Required. The parent resource's name.
12882 pub parent: std::string::String,
12883
12884 /// The maximum number of results to return per page.
12885 pub page_size: i32,
12886
12887 /// The page token.
12888 pub page_token: std::string::String,
12889
12890 /// An expression that filters the list of results.
12891 pub filter: std::string::String,
12892
12893 /// Sort the results by a certain order.
12894 pub order_by: std::string::String,
12895
12896 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12897}
12898
12899impl ListRoutesRequest {
12900 /// Creates a new default instance.
12901 pub fn new() -> Self {
12902 std::default::Default::default()
12903 }
12904
12905 /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
12906 ///
12907 /// # Example
12908 /// ```ignore,no_run
12909 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12910 /// # let project_id = "project_id";
12911 /// # let hub_id = "hub_id";
12912 /// # let route_table_id = "route_table_id";
12913 /// let x = ListRoutesRequest::new().set_parent(format!("projects/{project_id}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}"));
12914 /// ```
12915 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12916 self.parent = v.into();
12917 self
12918 }
12919
12920 /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
12921 ///
12922 /// # Example
12923 /// ```ignore,no_run
12924 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12925 /// let x = ListRoutesRequest::new().set_page_size(42);
12926 /// ```
12927 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12928 self.page_size = v.into();
12929 self
12930 }
12931
12932 /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
12933 ///
12934 /// # Example
12935 /// ```ignore,no_run
12936 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12937 /// let x = ListRoutesRequest::new().set_page_token("example");
12938 /// ```
12939 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12940 self.page_token = v.into();
12941 self
12942 }
12943
12944 /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
12945 ///
12946 /// # Example
12947 /// ```ignore,no_run
12948 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12949 /// let x = ListRoutesRequest::new().set_filter("example");
12950 /// ```
12951 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12952 self.filter = v.into();
12953 self
12954 }
12955
12956 /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
12957 ///
12958 /// # Example
12959 /// ```ignore,no_run
12960 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesRequest;
12961 /// let x = ListRoutesRequest::new().set_order_by("example");
12962 /// ```
12963 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12964 self.order_by = v.into();
12965 self
12966 }
12967}
12968
12969impl wkt::message::Message for ListRoutesRequest {
12970 fn typename() -> &'static str {
12971 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesRequest"
12972 }
12973}
12974
12975/// Response for
12976/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
12977/// method.
12978///
12979/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
12980#[derive(Clone, Default, PartialEq)]
12981#[non_exhaustive]
12982pub struct ListRoutesResponse {
12983 /// The requested routes.
12984 pub routes: std::vec::Vec<crate::model::Route>,
12985
12986 /// The token for the next page of the response. To see more results,
12987 /// use this value as the page_token for your next request. If this value
12988 /// is empty, there are no more results.
12989 pub next_page_token: std::string::String,
12990
12991 /// RouteTables that could not be reached.
12992 pub unreachable: std::vec::Vec<std::string::String>,
12993
12994 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12995}
12996
12997impl ListRoutesResponse {
12998 /// Creates a new default instance.
12999 pub fn new() -> Self {
13000 std::default::Default::default()
13001 }
13002
13003 /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
13004 ///
13005 /// # Example
13006 /// ```ignore,no_run
13007 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
13008 /// use google_cloud_networkconnectivity_v1::model::Route;
13009 /// let x = ListRoutesResponse::new()
13010 /// .set_routes([
13011 /// Route::default()/* use setters */,
13012 /// Route::default()/* use (different) setters */,
13013 /// ]);
13014 /// ```
13015 pub fn set_routes<T, V>(mut self, v: T) -> Self
13016 where
13017 T: std::iter::IntoIterator<Item = V>,
13018 V: std::convert::Into<crate::model::Route>,
13019 {
13020 use std::iter::Iterator;
13021 self.routes = v.into_iter().map(|i| i.into()).collect();
13022 self
13023 }
13024
13025 /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
13026 ///
13027 /// # Example
13028 /// ```ignore,no_run
13029 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
13030 /// let x = ListRoutesResponse::new().set_next_page_token("example");
13031 /// ```
13032 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13033 self.next_page_token = v.into();
13034 self
13035 }
13036
13037 /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
13038 ///
13039 /// # Example
13040 /// ```ignore,no_run
13041 /// # use google_cloud_networkconnectivity_v1::model::ListRoutesResponse;
13042 /// let x = ListRoutesResponse::new().set_unreachable(["a", "b", "c"]);
13043 /// ```
13044 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13045 where
13046 T: std::iter::IntoIterator<Item = V>,
13047 V: std::convert::Into<std::string::String>,
13048 {
13049 use std::iter::Iterator;
13050 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13051 self
13052 }
13053}
13054
13055impl wkt::message::Message for ListRoutesResponse {
13056 fn typename() -> &'static str {
13057 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesResponse"
13058 }
13059}
13060
13061#[doc(hidden)]
13062impl google_cloud_gax::paginator::internal::PageableResponse for ListRoutesResponse {
13063 type PageItem = crate::model::Route;
13064
13065 fn items(self) -> std::vec::Vec<Self::PageItem> {
13066 self.routes
13067 }
13068
13069 fn next_page_token(&self) -> std::string::String {
13070 use std::clone::Clone;
13071 self.next_page_token.clone()
13072 }
13073}
13074
13075/// Request for
13076/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
13077/// method.
13078///
13079/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
13080#[derive(Clone, Default, PartialEq)]
13081#[non_exhaustive]
13082pub struct ListRouteTablesRequest {
13083 /// Required. The parent resource's name.
13084 pub parent: std::string::String,
13085
13086 /// The maximum number of results to return per page.
13087 pub page_size: i32,
13088
13089 /// The page token.
13090 pub page_token: std::string::String,
13091
13092 /// An expression that filters the list of results.
13093 pub filter: std::string::String,
13094
13095 /// Sort the results by a certain order.
13096 pub order_by: std::string::String,
13097
13098 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13099}
13100
13101impl ListRouteTablesRequest {
13102 /// Creates a new default instance.
13103 pub fn new() -> Self {
13104 std::default::Default::default()
13105 }
13106
13107 /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
13108 ///
13109 /// # Example
13110 /// ```ignore,no_run
13111 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
13112 /// # let project_id = "project_id";
13113 /// # let hub_id = "hub_id";
13114 /// let x = ListRouteTablesRequest::new().set_parent(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
13115 /// ```
13116 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13117 self.parent = v.into();
13118 self
13119 }
13120
13121 /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
13122 ///
13123 /// # Example
13124 /// ```ignore,no_run
13125 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
13126 /// let x = ListRouteTablesRequest::new().set_page_size(42);
13127 /// ```
13128 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13129 self.page_size = v.into();
13130 self
13131 }
13132
13133 /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
13134 ///
13135 /// # Example
13136 /// ```ignore,no_run
13137 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
13138 /// let x = ListRouteTablesRequest::new().set_page_token("example");
13139 /// ```
13140 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13141 self.page_token = v.into();
13142 self
13143 }
13144
13145 /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
13146 ///
13147 /// # Example
13148 /// ```ignore,no_run
13149 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
13150 /// let x = ListRouteTablesRequest::new().set_filter("example");
13151 /// ```
13152 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13153 self.filter = v.into();
13154 self
13155 }
13156
13157 /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
13158 ///
13159 /// # Example
13160 /// ```ignore,no_run
13161 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesRequest;
13162 /// let x = ListRouteTablesRequest::new().set_order_by("example");
13163 /// ```
13164 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13165 self.order_by = v.into();
13166 self
13167 }
13168}
13169
13170impl wkt::message::Message for ListRouteTablesRequest {
13171 fn typename() -> &'static str {
13172 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"
13173 }
13174}
13175
13176/// Response for
13177/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
13178/// method.
13179///
13180/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
13181#[derive(Clone, Default, PartialEq)]
13182#[non_exhaustive]
13183pub struct ListRouteTablesResponse {
13184 /// The requested route tables.
13185 pub route_tables: std::vec::Vec<crate::model::RouteTable>,
13186
13187 /// The token for the next page of the response. To see more results,
13188 /// use this value as the page_token for your next request. If this value
13189 /// is empty, there are no more results.
13190 pub next_page_token: std::string::String,
13191
13192 /// Hubs that could not be reached.
13193 pub unreachable: std::vec::Vec<std::string::String>,
13194
13195 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13196}
13197
13198impl ListRouteTablesResponse {
13199 /// Creates a new default instance.
13200 pub fn new() -> Self {
13201 std::default::Default::default()
13202 }
13203
13204 /// Sets the value of [route_tables][crate::model::ListRouteTablesResponse::route_tables].
13205 ///
13206 /// # Example
13207 /// ```ignore,no_run
13208 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
13209 /// use google_cloud_networkconnectivity_v1::model::RouteTable;
13210 /// let x = ListRouteTablesResponse::new()
13211 /// .set_route_tables([
13212 /// RouteTable::default()/* use setters */,
13213 /// RouteTable::default()/* use (different) setters */,
13214 /// ]);
13215 /// ```
13216 pub fn set_route_tables<T, V>(mut self, v: T) -> Self
13217 where
13218 T: std::iter::IntoIterator<Item = V>,
13219 V: std::convert::Into<crate::model::RouteTable>,
13220 {
13221 use std::iter::Iterator;
13222 self.route_tables = v.into_iter().map(|i| i.into()).collect();
13223 self
13224 }
13225
13226 /// Sets the value of [next_page_token][crate::model::ListRouteTablesResponse::next_page_token].
13227 ///
13228 /// # Example
13229 /// ```ignore,no_run
13230 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
13231 /// let x = ListRouteTablesResponse::new().set_next_page_token("example");
13232 /// ```
13233 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13234 self.next_page_token = v.into();
13235 self
13236 }
13237
13238 /// Sets the value of [unreachable][crate::model::ListRouteTablesResponse::unreachable].
13239 ///
13240 /// # Example
13241 /// ```ignore,no_run
13242 /// # use google_cloud_networkconnectivity_v1::model::ListRouteTablesResponse;
13243 /// let x = ListRouteTablesResponse::new().set_unreachable(["a", "b", "c"]);
13244 /// ```
13245 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13246 where
13247 T: std::iter::IntoIterator<Item = V>,
13248 V: std::convert::Into<std::string::String>,
13249 {
13250 use std::iter::Iterator;
13251 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13252 self
13253 }
13254}
13255
13256impl wkt::message::Message for ListRouteTablesResponse {
13257 fn typename() -> &'static str {
13258 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"
13259 }
13260}
13261
13262#[doc(hidden)]
13263impl google_cloud_gax::paginator::internal::PageableResponse for ListRouteTablesResponse {
13264 type PageItem = crate::model::RouteTable;
13265
13266 fn items(self) -> std::vec::Vec<Self::PageItem> {
13267 self.route_tables
13268 }
13269
13270 fn next_page_token(&self) -> std::string::String {
13271 use std::clone::Clone;
13272 self.next_page_token.clone()
13273 }
13274}
13275
13276/// Request for
13277/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
13278/// method.
13279///
13280/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
13281#[derive(Clone, Default, PartialEq)]
13282#[non_exhaustive]
13283pub struct ListGroupsRequest {
13284 /// Required. The parent resource's name.
13285 pub parent: std::string::String,
13286
13287 /// The maximum number of results to return per page.
13288 pub page_size: i32,
13289
13290 /// The page token.
13291 pub page_token: std::string::String,
13292
13293 /// An expression that filters the list of results.
13294 pub filter: std::string::String,
13295
13296 /// Sort the results by a certain order.
13297 pub order_by: std::string::String,
13298
13299 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13300}
13301
13302impl ListGroupsRequest {
13303 /// Creates a new default instance.
13304 pub fn new() -> Self {
13305 std::default::Default::default()
13306 }
13307
13308 /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
13309 ///
13310 /// # Example
13311 /// ```ignore,no_run
13312 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13313 /// # let project_id = "project_id";
13314 /// # let hub_id = "hub_id";
13315 /// let x = ListGroupsRequest::new().set_parent(format!("projects/{project_id}/locations/global/hubs/{hub_id}"));
13316 /// ```
13317 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13318 self.parent = v.into();
13319 self
13320 }
13321
13322 /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
13323 ///
13324 /// # Example
13325 /// ```ignore,no_run
13326 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13327 /// let x = ListGroupsRequest::new().set_page_size(42);
13328 /// ```
13329 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13330 self.page_size = v.into();
13331 self
13332 }
13333
13334 /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
13335 ///
13336 /// # Example
13337 /// ```ignore,no_run
13338 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13339 /// let x = ListGroupsRequest::new().set_page_token("example");
13340 /// ```
13341 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13342 self.page_token = v.into();
13343 self
13344 }
13345
13346 /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
13347 ///
13348 /// # Example
13349 /// ```ignore,no_run
13350 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13351 /// let x = ListGroupsRequest::new().set_filter("example");
13352 /// ```
13353 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13354 self.filter = v.into();
13355 self
13356 }
13357
13358 /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
13359 ///
13360 /// # Example
13361 /// ```ignore,no_run
13362 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsRequest;
13363 /// let x = ListGroupsRequest::new().set_order_by("example");
13364 /// ```
13365 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13366 self.order_by = v.into();
13367 self
13368 }
13369}
13370
13371impl wkt::message::Message for ListGroupsRequest {
13372 fn typename() -> &'static str {
13373 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsRequest"
13374 }
13375}
13376
13377/// Response for
13378/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
13379/// method.
13380///
13381/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
13382#[derive(Clone, Default, PartialEq)]
13383#[non_exhaustive]
13384pub struct ListGroupsResponse {
13385 /// The requested groups.
13386 pub groups: std::vec::Vec<crate::model::Group>,
13387
13388 /// The token for the next page of the response. To see more results,
13389 /// use this value as the page_token for your next request. If this value
13390 /// is empty, there are no more results.
13391 pub next_page_token: std::string::String,
13392
13393 /// Hubs that could not be reached.
13394 pub unreachable: std::vec::Vec<std::string::String>,
13395
13396 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13397}
13398
13399impl ListGroupsResponse {
13400 /// Creates a new default instance.
13401 pub fn new() -> Self {
13402 std::default::Default::default()
13403 }
13404
13405 /// Sets the value of [groups][crate::model::ListGroupsResponse::groups].
13406 ///
13407 /// # Example
13408 /// ```ignore,no_run
13409 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13410 /// use google_cloud_networkconnectivity_v1::model::Group;
13411 /// let x = ListGroupsResponse::new()
13412 /// .set_groups([
13413 /// Group::default()/* use setters */,
13414 /// Group::default()/* use (different) setters */,
13415 /// ]);
13416 /// ```
13417 pub fn set_groups<T, V>(mut self, v: T) -> Self
13418 where
13419 T: std::iter::IntoIterator<Item = V>,
13420 V: std::convert::Into<crate::model::Group>,
13421 {
13422 use std::iter::Iterator;
13423 self.groups = v.into_iter().map(|i| i.into()).collect();
13424 self
13425 }
13426
13427 /// Sets the value of [next_page_token][crate::model::ListGroupsResponse::next_page_token].
13428 ///
13429 /// # Example
13430 /// ```ignore,no_run
13431 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13432 /// let x = ListGroupsResponse::new().set_next_page_token("example");
13433 /// ```
13434 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13435 self.next_page_token = v.into();
13436 self
13437 }
13438
13439 /// Sets the value of [unreachable][crate::model::ListGroupsResponse::unreachable].
13440 ///
13441 /// # Example
13442 /// ```ignore,no_run
13443 /// # use google_cloud_networkconnectivity_v1::model::ListGroupsResponse;
13444 /// let x = ListGroupsResponse::new().set_unreachable(["a", "b", "c"]);
13445 /// ```
13446 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13447 where
13448 T: std::iter::IntoIterator<Item = V>,
13449 V: std::convert::Into<std::string::String>,
13450 {
13451 use std::iter::Iterator;
13452 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13453 self
13454 }
13455}
13456
13457impl wkt::message::Message for ListGroupsResponse {
13458 fn typename() -> &'static str {
13459 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsResponse"
13460 }
13461}
13462
13463#[doc(hidden)]
13464impl google_cloud_gax::paginator::internal::PageableResponse for ListGroupsResponse {
13465 type PageItem = crate::model::Group;
13466
13467 fn items(self) -> std::vec::Vec<Self::PageItem> {
13468 self.groups
13469 }
13470
13471 fn next_page_token(&self) -> std::string::String {
13472 use std::clone::Clone;
13473 self.next_page_token.clone()
13474 }
13475}
13476
13477/// A collection of Cloud VPN tunnel resources. These resources should be
13478/// redundant HA VPN tunnels that all advertise the same prefixes to Google
13479/// Cloud. Alternatively, in a passive/active configuration, all tunnels
13480/// should be capable of advertising the same prefixes.
13481#[derive(Clone, Default, PartialEq)]
13482#[non_exhaustive]
13483pub struct LinkedVpnTunnels {
13484 /// The URIs of linked VPN tunnel resources.
13485 pub uris: std::vec::Vec<std::string::String>,
13486
13487 /// A value that controls whether site-to-site data transfer is enabled for
13488 /// these resources. Data transfer is available only in [supported
13489 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13490 pub site_to_site_data_transfer: bool,
13491
13492 /// Output only. The VPC network where these VPN tunnels are located.
13493 pub vpc_network: std::string::String,
13494
13495 /// Optional. IP ranges allowed to be included during import from hub (does not
13496 /// control transit connectivity). The only allowed value for now is
13497 /// "ALL_IPV4_RANGES".
13498 pub include_import_ranges: std::vec::Vec<std::string::String>,
13499
13500 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13501}
13502
13503impl LinkedVpnTunnels {
13504 /// Creates a new default instance.
13505 pub fn new() -> Self {
13506 std::default::Default::default()
13507 }
13508
13509 /// Sets the value of [uris][crate::model::LinkedVpnTunnels::uris].
13510 ///
13511 /// # Example
13512 /// ```ignore,no_run
13513 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13514 /// let x = LinkedVpnTunnels::new().set_uris(["a", "b", "c"]);
13515 /// ```
13516 pub fn set_uris<T, V>(mut self, v: T) -> Self
13517 where
13518 T: std::iter::IntoIterator<Item = V>,
13519 V: std::convert::Into<std::string::String>,
13520 {
13521 use std::iter::Iterator;
13522 self.uris = v.into_iter().map(|i| i.into()).collect();
13523 self
13524 }
13525
13526 /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedVpnTunnels::site_to_site_data_transfer].
13527 ///
13528 /// # Example
13529 /// ```ignore,no_run
13530 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13531 /// let x = LinkedVpnTunnels::new().set_site_to_site_data_transfer(true);
13532 /// ```
13533 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13534 self.site_to_site_data_transfer = v.into();
13535 self
13536 }
13537
13538 /// Sets the value of [vpc_network][crate::model::LinkedVpnTunnels::vpc_network].
13539 ///
13540 /// # Example
13541 /// ```ignore,no_run
13542 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13543 /// let x = LinkedVpnTunnels::new().set_vpc_network("example");
13544 /// ```
13545 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13546 self.vpc_network = v.into();
13547 self
13548 }
13549
13550 /// Sets the value of [include_import_ranges][crate::model::LinkedVpnTunnels::include_import_ranges].
13551 ///
13552 /// # Example
13553 /// ```ignore,no_run
13554 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpnTunnels;
13555 /// let x = LinkedVpnTunnels::new().set_include_import_ranges(["a", "b", "c"]);
13556 /// ```
13557 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13558 where
13559 T: std::iter::IntoIterator<Item = V>,
13560 V: std::convert::Into<std::string::String>,
13561 {
13562 use std::iter::Iterator;
13563 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13564 self
13565 }
13566}
13567
13568impl wkt::message::Message for LinkedVpnTunnels {
13569 fn typename() -> &'static str {
13570 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"
13571 }
13572}
13573
13574/// A collection of VLAN attachment resources. These resources should
13575/// be redundant attachments that all advertise the same prefixes to Google
13576/// Cloud. Alternatively, in active/passive configurations, all attachments
13577/// should be capable of advertising the same prefixes.
13578#[derive(Clone, Default, PartialEq)]
13579#[non_exhaustive]
13580pub struct LinkedInterconnectAttachments {
13581 /// The URIs of linked interconnect attachment resources
13582 pub uris: std::vec::Vec<std::string::String>,
13583
13584 /// A value that controls whether site-to-site data transfer is enabled for
13585 /// these resources. Data transfer is available only in [supported
13586 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13587 pub site_to_site_data_transfer: bool,
13588
13589 /// Output only. The VPC network where these VLAN attachments are located.
13590 pub vpc_network: std::string::String,
13591
13592 /// Optional. IP ranges allowed to be included during import from hub (does not
13593 /// control transit connectivity). The only allowed value for now is
13594 /// "ALL_IPV4_RANGES".
13595 pub include_import_ranges: std::vec::Vec<std::string::String>,
13596
13597 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13598}
13599
13600impl LinkedInterconnectAttachments {
13601 /// Creates a new default instance.
13602 pub fn new() -> Self {
13603 std::default::Default::default()
13604 }
13605
13606 /// Sets the value of [uris][crate::model::LinkedInterconnectAttachments::uris].
13607 ///
13608 /// # Example
13609 /// ```ignore,no_run
13610 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13611 /// let x = LinkedInterconnectAttachments::new().set_uris(["a", "b", "c"]);
13612 /// ```
13613 pub fn set_uris<T, V>(mut self, v: T) -> Self
13614 where
13615 T: std::iter::IntoIterator<Item = V>,
13616 V: std::convert::Into<std::string::String>,
13617 {
13618 use std::iter::Iterator;
13619 self.uris = v.into_iter().map(|i| i.into()).collect();
13620 self
13621 }
13622
13623 /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedInterconnectAttachments::site_to_site_data_transfer].
13624 ///
13625 /// # Example
13626 /// ```ignore,no_run
13627 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13628 /// let x = LinkedInterconnectAttachments::new().set_site_to_site_data_transfer(true);
13629 /// ```
13630 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13631 self.site_to_site_data_transfer = v.into();
13632 self
13633 }
13634
13635 /// Sets the value of [vpc_network][crate::model::LinkedInterconnectAttachments::vpc_network].
13636 ///
13637 /// # Example
13638 /// ```ignore,no_run
13639 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13640 /// let x = LinkedInterconnectAttachments::new().set_vpc_network("example");
13641 /// ```
13642 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13643 self.vpc_network = v.into();
13644 self
13645 }
13646
13647 /// Sets the value of [include_import_ranges][crate::model::LinkedInterconnectAttachments::include_import_ranges].
13648 ///
13649 /// # Example
13650 /// ```ignore,no_run
13651 /// # use google_cloud_networkconnectivity_v1::model::LinkedInterconnectAttachments;
13652 /// let x = LinkedInterconnectAttachments::new().set_include_import_ranges(["a", "b", "c"]);
13653 /// ```
13654 pub fn set_include_import_ranges<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.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13661 self
13662 }
13663}
13664
13665impl wkt::message::Message for LinkedInterconnectAttachments {
13666 fn typename() -> &'static str {
13667 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"
13668 }
13669}
13670
13671/// A collection of router appliance instances. If you configure multiple router
13672/// appliance instances to receive data from the same set of sites outside of
13673/// Google Cloud, we recommend that you associate those instances with the same
13674/// spoke.
13675#[derive(Clone, Default, PartialEq)]
13676#[non_exhaustive]
13677pub struct LinkedRouterApplianceInstances {
13678 /// The list of router appliance instances.
13679 pub instances: std::vec::Vec<crate::model::RouterApplianceInstance>,
13680
13681 /// A value that controls whether site-to-site data transfer is enabled for
13682 /// these resources. Data transfer is available only in [supported
13683 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
13684 pub site_to_site_data_transfer: bool,
13685
13686 /// Output only. The VPC network where these router appliance instances are
13687 /// located.
13688 pub vpc_network: std::string::String,
13689
13690 /// Optional. IP ranges allowed to be included during import from hub (does not
13691 /// control transit connectivity). The only allowed value for now is
13692 /// "ALL_IPV4_RANGES".
13693 pub include_import_ranges: std::vec::Vec<std::string::String>,
13694
13695 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13696}
13697
13698impl LinkedRouterApplianceInstances {
13699 /// Creates a new default instance.
13700 pub fn new() -> Self {
13701 std::default::Default::default()
13702 }
13703
13704 /// Sets the value of [instances][crate::model::LinkedRouterApplianceInstances::instances].
13705 ///
13706 /// # Example
13707 /// ```ignore,no_run
13708 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13709 /// use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
13710 /// let x = LinkedRouterApplianceInstances::new()
13711 /// .set_instances([
13712 /// RouterApplianceInstance::default()/* use setters */,
13713 /// RouterApplianceInstance::default()/* use (different) setters */,
13714 /// ]);
13715 /// ```
13716 pub fn set_instances<T, V>(mut self, v: T) -> Self
13717 where
13718 T: std::iter::IntoIterator<Item = V>,
13719 V: std::convert::Into<crate::model::RouterApplianceInstance>,
13720 {
13721 use std::iter::Iterator;
13722 self.instances = v.into_iter().map(|i| i.into()).collect();
13723 self
13724 }
13725
13726 /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedRouterApplianceInstances::site_to_site_data_transfer].
13727 ///
13728 /// # Example
13729 /// ```ignore,no_run
13730 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13731 /// let x = LinkedRouterApplianceInstances::new().set_site_to_site_data_transfer(true);
13732 /// ```
13733 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13734 self.site_to_site_data_transfer = v.into();
13735 self
13736 }
13737
13738 /// Sets the value of [vpc_network][crate::model::LinkedRouterApplianceInstances::vpc_network].
13739 ///
13740 /// # Example
13741 /// ```ignore,no_run
13742 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13743 /// let x = LinkedRouterApplianceInstances::new().set_vpc_network("example");
13744 /// ```
13745 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13746 self.vpc_network = v.into();
13747 self
13748 }
13749
13750 /// Sets the value of [include_import_ranges][crate::model::LinkedRouterApplianceInstances::include_import_ranges].
13751 ///
13752 /// # Example
13753 /// ```ignore,no_run
13754 /// # use google_cloud_networkconnectivity_v1::model::LinkedRouterApplianceInstances;
13755 /// let x = LinkedRouterApplianceInstances::new().set_include_import_ranges(["a", "b", "c"]);
13756 /// ```
13757 pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
13758 where
13759 T: std::iter::IntoIterator<Item = V>,
13760 V: std::convert::Into<std::string::String>,
13761 {
13762 use std::iter::Iterator;
13763 self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
13764 self
13765 }
13766}
13767
13768impl wkt::message::Message for LinkedRouterApplianceInstances {
13769 fn typename() -> &'static str {
13770 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"
13771 }
13772}
13773
13774/// An existing VPC network.
13775#[derive(Clone, Default, PartialEq)]
13776#[non_exhaustive]
13777pub struct LinkedVpcNetwork {
13778 /// Required. The URI of the VPC network resource.
13779 pub uri: std::string::String,
13780
13781 /// Optional. IP ranges encompassing the subnets to be excluded from peering.
13782 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
13783
13784 /// Optional. IP ranges allowed to be included from peering.
13785 pub include_export_ranges: std::vec::Vec<std::string::String>,
13786
13787 /// Optional. The proposed include export IP ranges waiting for hub
13788 /// administration's approval.
13789 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
13790
13791 /// Output only. The proposed exclude export IP ranges waiting for hub
13792 /// administration's approval.
13793 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
13794
13795 /// Output only. The list of Producer VPC spokes that this VPC spoke is a
13796 /// service consumer VPC spoke for. These producer VPCs are connected through
13797 /// VPC peering to this spoke's backing VPC network. Because they are directly
13798 /// connected throuh VPC peering, NCC export filters do not apply between the
13799 /// service consumer VPC spoke and any of its producer VPC spokes. This VPC
13800 /// spoke cannot be deleted as long as any of these producer VPC spokes are
13801 /// connected to the NCC Hub.
13802 pub producer_vpc_spokes: std::vec::Vec<std::string::String>,
13803
13804 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13805}
13806
13807impl LinkedVpcNetwork {
13808 /// Creates a new default instance.
13809 pub fn new() -> Self {
13810 std::default::Default::default()
13811 }
13812
13813 /// Sets the value of [uri][crate::model::LinkedVpcNetwork::uri].
13814 ///
13815 /// # Example
13816 /// ```ignore,no_run
13817 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13818 /// let x = LinkedVpcNetwork::new().set_uri("example");
13819 /// ```
13820 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13821 self.uri = v.into();
13822 self
13823 }
13824
13825 /// Sets the value of [exclude_export_ranges][crate::model::LinkedVpcNetwork::exclude_export_ranges].
13826 ///
13827 /// # Example
13828 /// ```ignore,no_run
13829 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13830 /// let x = LinkedVpcNetwork::new().set_exclude_export_ranges(["a", "b", "c"]);
13831 /// ```
13832 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13833 where
13834 T: std::iter::IntoIterator<Item = V>,
13835 V: std::convert::Into<std::string::String>,
13836 {
13837 use std::iter::Iterator;
13838 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13839 self
13840 }
13841
13842 /// Sets the value of [include_export_ranges][crate::model::LinkedVpcNetwork::include_export_ranges].
13843 ///
13844 /// # Example
13845 /// ```ignore,no_run
13846 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13847 /// let x = LinkedVpcNetwork::new().set_include_export_ranges(["a", "b", "c"]);
13848 /// ```
13849 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
13850 where
13851 T: std::iter::IntoIterator<Item = V>,
13852 V: std::convert::Into<std::string::String>,
13853 {
13854 use std::iter::Iterator;
13855 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13856 self
13857 }
13858
13859 /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedVpcNetwork::proposed_include_export_ranges].
13860 ///
13861 /// # Example
13862 /// ```ignore,no_run
13863 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13864 /// let x = LinkedVpcNetwork::new().set_proposed_include_export_ranges(["a", "b", "c"]);
13865 /// ```
13866 pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
13867 where
13868 T: std::iter::IntoIterator<Item = V>,
13869 V: std::convert::Into<std::string::String>,
13870 {
13871 use std::iter::Iterator;
13872 self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
13873 self
13874 }
13875
13876 /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedVpcNetwork::proposed_exclude_export_ranges].
13877 ///
13878 /// # Example
13879 /// ```ignore,no_run
13880 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13881 /// let x = LinkedVpcNetwork::new().set_proposed_exclude_export_ranges(["a", "b", "c"]);
13882 /// ```
13883 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
13884 where
13885 T: std::iter::IntoIterator<Item = V>,
13886 V: std::convert::Into<std::string::String>,
13887 {
13888 use std::iter::Iterator;
13889 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
13890 self
13891 }
13892
13893 /// Sets the value of [producer_vpc_spokes][crate::model::LinkedVpcNetwork::producer_vpc_spokes].
13894 ///
13895 /// # Example
13896 /// ```ignore,no_run
13897 /// # use google_cloud_networkconnectivity_v1::model::LinkedVpcNetwork;
13898 /// let x = LinkedVpcNetwork::new().set_producer_vpc_spokes(["a", "b", "c"]);
13899 /// ```
13900 pub fn set_producer_vpc_spokes<T, V>(mut self, v: T) -> Self
13901 where
13902 T: std::iter::IntoIterator<Item = V>,
13903 V: std::convert::Into<std::string::String>,
13904 {
13905 use std::iter::Iterator;
13906 self.producer_vpc_spokes = v.into_iter().map(|i| i.into()).collect();
13907 self
13908 }
13909}
13910
13911impl wkt::message::Message for LinkedVpcNetwork {
13912 fn typename() -> &'static str {
13913 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"
13914 }
13915}
13916
13917#[allow(missing_docs)]
13918#[derive(Clone, Default, PartialEq)]
13919#[non_exhaustive]
13920pub struct LinkedProducerVpcNetwork {
13921 /// Immutable. The URI of the Service Consumer VPC that the Producer VPC is
13922 /// peered with.
13923 pub network: std::string::String,
13924
13925 /// Output only. The Service Consumer Network spoke.
13926 pub service_consumer_vpc_spoke: std::string::String,
13927
13928 /// Immutable. The name of the VPC peering between the Service Consumer VPC and
13929 /// the Producer VPC (defined in the Tenant project) which is added to the NCC
13930 /// hub. This peering must be in ACTIVE state.
13931 pub peering: std::string::String,
13932
13933 /// Output only. The URI of the Producer VPC.
13934 pub producer_network: std::string::String,
13935
13936 /// Optional. IP ranges encompassing the subnets to be excluded from peering.
13937 pub exclude_export_ranges: std::vec::Vec<std::string::String>,
13938
13939 /// Optional. IP ranges allowed to be included from peering.
13940 pub include_export_ranges: std::vec::Vec<std::string::String>,
13941
13942 /// Optional. The proposed include export IP ranges waiting for hub
13943 /// administration's approval.
13944 pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
13945
13946 /// Output only. The proposed exclude export IP ranges waiting for hub
13947 /// administration's approval.
13948 pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
13949
13950 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13951}
13952
13953impl LinkedProducerVpcNetwork {
13954 /// Creates a new default instance.
13955 pub fn new() -> Self {
13956 std::default::Default::default()
13957 }
13958
13959 /// Sets the value of [network][crate::model::LinkedProducerVpcNetwork::network].
13960 ///
13961 /// # Example
13962 /// ```ignore,no_run
13963 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13964 /// let x = LinkedProducerVpcNetwork::new().set_network("example");
13965 /// ```
13966 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13967 self.network = v.into();
13968 self
13969 }
13970
13971 /// Sets the value of [service_consumer_vpc_spoke][crate::model::LinkedProducerVpcNetwork::service_consumer_vpc_spoke].
13972 ///
13973 /// # Example
13974 /// ```ignore,no_run
13975 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13976 /// # let project_id = "project_id";
13977 /// # let location_id = "location_id";
13978 /// # let spoke_id = "spoke_id";
13979 /// let x = LinkedProducerVpcNetwork::new().set_service_consumer_vpc_spoke(format!("projects/{project_id}/locations/{location_id}/spokes/{spoke_id}"));
13980 /// ```
13981 pub fn set_service_consumer_vpc_spoke<T: std::convert::Into<std::string::String>>(
13982 mut self,
13983 v: T,
13984 ) -> Self {
13985 self.service_consumer_vpc_spoke = v.into();
13986 self
13987 }
13988
13989 /// Sets the value of [peering][crate::model::LinkedProducerVpcNetwork::peering].
13990 ///
13991 /// # Example
13992 /// ```ignore,no_run
13993 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
13994 /// let x = LinkedProducerVpcNetwork::new().set_peering("example");
13995 /// ```
13996 pub fn set_peering<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13997 self.peering = v.into();
13998 self
13999 }
14000
14001 /// Sets the value of [producer_network][crate::model::LinkedProducerVpcNetwork::producer_network].
14002 ///
14003 /// # Example
14004 /// ```ignore,no_run
14005 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
14006 /// let x = LinkedProducerVpcNetwork::new().set_producer_network("example");
14007 /// ```
14008 pub fn set_producer_network<T: std::convert::Into<std::string::String>>(
14009 mut self,
14010 v: T,
14011 ) -> Self {
14012 self.producer_network = v.into();
14013 self
14014 }
14015
14016 /// Sets the value of [exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::exclude_export_ranges].
14017 ///
14018 /// # Example
14019 /// ```ignore,no_run
14020 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
14021 /// let x = LinkedProducerVpcNetwork::new().set_exclude_export_ranges(["a", "b", "c"]);
14022 /// ```
14023 pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
14024 where
14025 T: std::iter::IntoIterator<Item = V>,
14026 V: std::convert::Into<std::string::String>,
14027 {
14028 use std::iter::Iterator;
14029 self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
14030 self
14031 }
14032
14033 /// Sets the value of [include_export_ranges][crate::model::LinkedProducerVpcNetwork::include_export_ranges].
14034 ///
14035 /// # Example
14036 /// ```ignore,no_run
14037 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
14038 /// let x = LinkedProducerVpcNetwork::new().set_include_export_ranges(["a", "b", "c"]);
14039 /// ```
14040 pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
14041 where
14042 T: std::iter::IntoIterator<Item = V>,
14043 V: std::convert::Into<std::string::String>,
14044 {
14045 use std::iter::Iterator;
14046 self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
14047 self
14048 }
14049
14050 /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_include_export_ranges].
14051 ///
14052 /// # Example
14053 /// ```ignore,no_run
14054 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
14055 /// let x = LinkedProducerVpcNetwork::new().set_proposed_include_export_ranges(["a", "b", "c"]);
14056 /// ```
14057 pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
14058 where
14059 T: std::iter::IntoIterator<Item = V>,
14060 V: std::convert::Into<std::string::String>,
14061 {
14062 use std::iter::Iterator;
14063 self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
14064 self
14065 }
14066
14067 /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_exclude_export_ranges].
14068 ///
14069 /// # Example
14070 /// ```ignore,no_run
14071 /// # use google_cloud_networkconnectivity_v1::model::LinkedProducerVpcNetwork;
14072 /// let x = LinkedProducerVpcNetwork::new().set_proposed_exclude_export_ranges(["a", "b", "c"]);
14073 /// ```
14074 pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
14075 where
14076 T: std::iter::IntoIterator<Item = V>,
14077 V: std::convert::Into<std::string::String>,
14078 {
14079 use std::iter::Iterator;
14080 self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
14081 self
14082 }
14083}
14084
14085impl wkt::message::Message for LinkedProducerVpcNetwork {
14086 fn typename() -> &'static str {
14087 "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedProducerVpcNetwork"
14088 }
14089}
14090
14091/// A router appliance instance is a Compute Engine virtual machine (VM) instance
14092/// that acts as a BGP speaker. A router appliance instance is specified by the
14093/// URI of the VM and the internal IP address of one of the VM's network
14094/// interfaces.
14095#[derive(Clone, Default, PartialEq)]
14096#[non_exhaustive]
14097pub struct RouterApplianceInstance {
14098 /// The URI of the VM.
14099 pub virtual_machine: std::string::String,
14100
14101 /// The IP address on the VM to use for peering.
14102 pub ip_address: std::string::String,
14103
14104 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14105}
14106
14107impl RouterApplianceInstance {
14108 /// Creates a new default instance.
14109 pub fn new() -> Self {
14110 std::default::Default::default()
14111 }
14112
14113 /// Sets the value of [virtual_machine][crate::model::RouterApplianceInstance::virtual_machine].
14114 ///
14115 /// # Example
14116 /// ```ignore,no_run
14117 /// # use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
14118 /// let x = RouterApplianceInstance::new().set_virtual_machine("example");
14119 /// ```
14120 pub fn set_virtual_machine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14121 self.virtual_machine = v.into();
14122 self
14123 }
14124
14125 /// Sets the value of [ip_address][crate::model::RouterApplianceInstance::ip_address].
14126 ///
14127 /// # Example
14128 /// ```ignore,no_run
14129 /// # use google_cloud_networkconnectivity_v1::model::RouterApplianceInstance;
14130 /// let x = RouterApplianceInstance::new().set_ip_address("example");
14131 /// ```
14132 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14133 self.ip_address = v.into();
14134 self
14135 }
14136}
14137
14138impl wkt::message::Message for RouterApplianceInstance {
14139 fn typename() -> &'static str {
14140 "type.googleapis.com/google.cloud.networkconnectivity.v1.RouterApplianceInstance"
14141 }
14142}
14143
14144/// Metadata about locations
14145#[derive(Clone, Default, PartialEq)]
14146#[non_exhaustive]
14147pub struct LocationMetadata {
14148 /// List of supported features
14149 pub location_features: std::vec::Vec<crate::model::LocationFeature>,
14150
14151 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14152}
14153
14154impl LocationMetadata {
14155 /// Creates a new default instance.
14156 pub fn new() -> Self {
14157 std::default::Default::default()
14158 }
14159
14160 /// Sets the value of [location_features][crate::model::LocationMetadata::location_features].
14161 ///
14162 /// # Example
14163 /// ```ignore,no_run
14164 /// # use google_cloud_networkconnectivity_v1::model::LocationMetadata;
14165 /// use google_cloud_networkconnectivity_v1::model::LocationFeature;
14166 /// let x = LocationMetadata::new().set_location_features([
14167 /// LocationFeature::SiteToCloudSpokes,
14168 /// LocationFeature::SiteToSiteSpokes,
14169 /// ]);
14170 /// ```
14171 pub fn set_location_features<T, V>(mut self, v: T) -> Self
14172 where
14173 T: std::iter::IntoIterator<Item = V>,
14174 V: std::convert::Into<crate::model::LocationFeature>,
14175 {
14176 use std::iter::Iterator;
14177 self.location_features = v.into_iter().map(|i| i.into()).collect();
14178 self
14179 }
14180}
14181
14182impl wkt::message::Message for LocationMetadata {
14183 fn typename() -> &'static str {
14184 "type.googleapis.com/google.cloud.networkconnectivity.v1.LocationMetadata"
14185 }
14186}
14187
14188#[allow(missing_docs)]
14189#[derive(Clone, Default, PartialEq)]
14190#[non_exhaustive]
14191pub struct NextHopVpcNetwork {
14192 /// The URI of the VPC network resource
14193 pub uri: std::string::String,
14194
14195 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14196}
14197
14198impl NextHopVpcNetwork {
14199 /// Creates a new default instance.
14200 pub fn new() -> Self {
14201 std::default::Default::default()
14202 }
14203
14204 /// Sets the value of [uri][crate::model::NextHopVpcNetwork::uri].
14205 ///
14206 /// # Example
14207 /// ```ignore,no_run
14208 /// # use google_cloud_networkconnectivity_v1::model::NextHopVpcNetwork;
14209 /// let x = NextHopVpcNetwork::new().set_uri("example");
14210 /// ```
14211 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14212 self.uri = v.into();
14213 self
14214 }
14215}
14216
14217impl wkt::message::Message for NextHopVpcNetwork {
14218 fn typename() -> &'static str {
14219 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"
14220 }
14221}
14222
14223/// A route next hop that leads to a VPN tunnel resource.
14224#[derive(Clone, Default, PartialEq)]
14225#[non_exhaustive]
14226pub struct NextHopVPNTunnel {
14227 /// The URI of the VPN tunnel resource.
14228 pub uri: std::string::String,
14229
14230 /// The VPC network where this VPN tunnel is located.
14231 pub vpc_network: std::string::String,
14232
14233 /// Indicates whether site-to-site data transfer is allowed for this VPN tunnel
14234 /// resource. Data transfer is available only in [supported
14235 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
14236 pub site_to_site_data_transfer: bool,
14237
14238 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14239}
14240
14241impl NextHopVPNTunnel {
14242 /// Creates a new default instance.
14243 pub fn new() -> Self {
14244 std::default::Default::default()
14245 }
14246
14247 /// Sets the value of [uri][crate::model::NextHopVPNTunnel::uri].
14248 ///
14249 /// # Example
14250 /// ```ignore,no_run
14251 /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
14252 /// let x = NextHopVPNTunnel::new().set_uri("example");
14253 /// ```
14254 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14255 self.uri = v.into();
14256 self
14257 }
14258
14259 /// Sets the value of [vpc_network][crate::model::NextHopVPNTunnel::vpc_network].
14260 ///
14261 /// # Example
14262 /// ```ignore,no_run
14263 /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
14264 /// let x = NextHopVPNTunnel::new().set_vpc_network("example");
14265 /// ```
14266 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14267 self.vpc_network = v.into();
14268 self
14269 }
14270
14271 /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopVPNTunnel::site_to_site_data_transfer].
14272 ///
14273 /// # Example
14274 /// ```ignore,no_run
14275 /// # use google_cloud_networkconnectivity_v1::model::NextHopVPNTunnel;
14276 /// let x = NextHopVPNTunnel::new().set_site_to_site_data_transfer(true);
14277 /// ```
14278 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14279 self.site_to_site_data_transfer = v.into();
14280 self
14281 }
14282}
14283
14284impl wkt::message::Message for NextHopVPNTunnel {
14285 fn typename() -> &'static str {
14286 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVPNTunnel"
14287 }
14288}
14289
14290/// A route next hop that leads to a Router appliance instance.
14291#[derive(Clone, Default, PartialEq)]
14292#[non_exhaustive]
14293pub struct NextHopRouterApplianceInstance {
14294 /// The URI of the Router appliance instance.
14295 pub uri: std::string::String,
14296
14297 /// The VPC network where this VM is located.
14298 pub vpc_network: std::string::String,
14299
14300 /// Indicates whether site-to-site data transfer is allowed for this Router
14301 /// appliance instance resource. Data transfer is available only in [supported
14302 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
14303 pub site_to_site_data_transfer: bool,
14304
14305 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14306}
14307
14308impl NextHopRouterApplianceInstance {
14309 /// Creates a new default instance.
14310 pub fn new() -> Self {
14311 std::default::Default::default()
14312 }
14313
14314 /// Sets the value of [uri][crate::model::NextHopRouterApplianceInstance::uri].
14315 ///
14316 /// # Example
14317 /// ```ignore,no_run
14318 /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14319 /// let x = NextHopRouterApplianceInstance::new().set_uri("example");
14320 /// ```
14321 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14322 self.uri = v.into();
14323 self
14324 }
14325
14326 /// Sets the value of [vpc_network][crate::model::NextHopRouterApplianceInstance::vpc_network].
14327 ///
14328 /// # Example
14329 /// ```ignore,no_run
14330 /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14331 /// let x = NextHopRouterApplianceInstance::new().set_vpc_network("example");
14332 /// ```
14333 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14334 self.vpc_network = v.into();
14335 self
14336 }
14337
14338 /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopRouterApplianceInstance::site_to_site_data_transfer].
14339 ///
14340 /// # Example
14341 /// ```ignore,no_run
14342 /// # use google_cloud_networkconnectivity_v1::model::NextHopRouterApplianceInstance;
14343 /// let x = NextHopRouterApplianceInstance::new().set_site_to_site_data_transfer(true);
14344 /// ```
14345 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14346 self.site_to_site_data_transfer = v.into();
14347 self
14348 }
14349}
14350
14351impl wkt::message::Message for NextHopRouterApplianceInstance {
14352 fn typename() -> &'static str {
14353 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance"
14354 }
14355}
14356
14357/// A route next hop that leads to an interconnect attachment resource.
14358#[derive(Clone, Default, PartialEq)]
14359#[non_exhaustive]
14360pub struct NextHopInterconnectAttachment {
14361 /// The URI of the interconnect attachment resource.
14362 pub uri: std::string::String,
14363
14364 /// The VPC network where this interconnect attachment is located.
14365 pub vpc_network: std::string::String,
14366
14367 /// Indicates whether site-to-site data transfer is allowed for this
14368 /// interconnect attachment resource. Data transfer is available only in
14369 /// [supported
14370 /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
14371 pub site_to_site_data_transfer: bool,
14372
14373 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14374}
14375
14376impl NextHopInterconnectAttachment {
14377 /// Creates a new default instance.
14378 pub fn new() -> Self {
14379 std::default::Default::default()
14380 }
14381
14382 /// Sets the value of [uri][crate::model::NextHopInterconnectAttachment::uri].
14383 ///
14384 /// # Example
14385 /// ```ignore,no_run
14386 /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14387 /// let x = NextHopInterconnectAttachment::new().set_uri("example");
14388 /// ```
14389 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14390 self.uri = v.into();
14391 self
14392 }
14393
14394 /// Sets the value of [vpc_network][crate::model::NextHopInterconnectAttachment::vpc_network].
14395 ///
14396 /// # Example
14397 /// ```ignore,no_run
14398 /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14399 /// let x = NextHopInterconnectAttachment::new().set_vpc_network("example");
14400 /// ```
14401 pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14402 self.vpc_network = v.into();
14403 self
14404 }
14405
14406 /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopInterconnectAttachment::site_to_site_data_transfer].
14407 ///
14408 /// # Example
14409 /// ```ignore,no_run
14410 /// # use google_cloud_networkconnectivity_v1::model::NextHopInterconnectAttachment;
14411 /// let x = NextHopInterconnectAttachment::new().set_site_to_site_data_transfer(true);
14412 /// ```
14413 pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14414 self.site_to_site_data_transfer = v.into();
14415 self
14416 }
14417}
14418
14419impl wkt::message::Message for NextHopInterconnectAttachment {
14420 fn typename() -> &'static str {
14421 "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopInterconnectAttachment"
14422 }
14423}
14424
14425/// Summarizes information about the spokes associated with a hub.
14426/// The summary includes a count of spokes according to type
14427/// and according to state. If any spokes are inactive,
14428/// the summary also lists the reasons they are inactive,
14429/// including a count for each reason.
14430#[derive(Clone, Default, PartialEq)]
14431#[non_exhaustive]
14432pub struct SpokeSummary {
14433 /// Output only. Counts the number of spokes of each type that are
14434 /// associated with a specific hub.
14435 pub spoke_type_counts: std::vec::Vec<crate::model::spoke_summary::SpokeTypeCount>,
14436
14437 /// Output only. Counts the number of spokes that are in each state
14438 /// and associated with a given hub.
14439 pub spoke_state_counts: std::vec::Vec<crate::model::spoke_summary::SpokeStateCount>,
14440
14441 /// Output only. Counts the number of spokes that are inactive for each
14442 /// possible reason and associated with a given hub.
14443 pub spoke_state_reason_counts:
14444 std::vec::Vec<crate::model::spoke_summary::SpokeStateReasonCount>,
14445
14446 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14447}
14448
14449impl SpokeSummary {
14450 /// Creates a new default instance.
14451 pub fn new() -> Self {
14452 std::default::Default::default()
14453 }
14454
14455 /// Sets the value of [spoke_type_counts][crate::model::SpokeSummary::spoke_type_counts].
14456 ///
14457 /// # Example
14458 /// ```ignore,no_run
14459 /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14460 /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14461 /// let x = SpokeSummary::new()
14462 /// .set_spoke_type_counts([
14463 /// SpokeTypeCount::default()/* use setters */,
14464 /// SpokeTypeCount::default()/* use (different) setters */,
14465 /// ]);
14466 /// ```
14467 pub fn set_spoke_type_counts<T, V>(mut self, v: T) -> Self
14468 where
14469 T: std::iter::IntoIterator<Item = V>,
14470 V: std::convert::Into<crate::model::spoke_summary::SpokeTypeCount>,
14471 {
14472 use std::iter::Iterator;
14473 self.spoke_type_counts = v.into_iter().map(|i| i.into()).collect();
14474 self
14475 }
14476
14477 /// Sets the value of [spoke_state_counts][crate::model::SpokeSummary::spoke_state_counts].
14478 ///
14479 /// # Example
14480 /// ```ignore,no_run
14481 /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14482 /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14483 /// let x = SpokeSummary::new()
14484 /// .set_spoke_state_counts([
14485 /// SpokeStateCount::default()/* use setters */,
14486 /// SpokeStateCount::default()/* use (different) setters */,
14487 /// ]);
14488 /// ```
14489 pub fn set_spoke_state_counts<T, V>(mut self, v: T) -> Self
14490 where
14491 T: std::iter::IntoIterator<Item = V>,
14492 V: std::convert::Into<crate::model::spoke_summary::SpokeStateCount>,
14493 {
14494 use std::iter::Iterator;
14495 self.spoke_state_counts = v.into_iter().map(|i| i.into()).collect();
14496 self
14497 }
14498
14499 /// Sets the value of [spoke_state_reason_counts][crate::model::SpokeSummary::spoke_state_reason_counts].
14500 ///
14501 /// # Example
14502 /// ```ignore,no_run
14503 /// # use google_cloud_networkconnectivity_v1::model::SpokeSummary;
14504 /// use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14505 /// let x = SpokeSummary::new()
14506 /// .set_spoke_state_reason_counts([
14507 /// SpokeStateReasonCount::default()/* use setters */,
14508 /// SpokeStateReasonCount::default()/* use (different) setters */,
14509 /// ]);
14510 /// ```
14511 pub fn set_spoke_state_reason_counts<T, V>(mut self, v: T) -> Self
14512 where
14513 T: std::iter::IntoIterator<Item = V>,
14514 V: std::convert::Into<crate::model::spoke_summary::SpokeStateReasonCount>,
14515 {
14516 use std::iter::Iterator;
14517 self.spoke_state_reason_counts = v.into_iter().map(|i| i.into()).collect();
14518 self
14519 }
14520}
14521
14522impl wkt::message::Message for SpokeSummary {
14523 fn typename() -> &'static str {
14524 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary"
14525 }
14526}
14527
14528/// Defines additional types related to [SpokeSummary].
14529pub mod spoke_summary {
14530 #[allow(unused_imports)]
14531 use super::*;
14532
14533 /// The number of spokes of a given type that are associated
14534 /// with a specific hub. The type indicates what kind of
14535 /// resource is associated with the spoke.
14536 #[derive(Clone, Default, PartialEq)]
14537 #[non_exhaustive]
14538 pub struct SpokeTypeCount {
14539 /// Output only. The type of the spokes.
14540 pub spoke_type: crate::model::SpokeType,
14541
14542 /// Output only. The total number of spokes of this type that are
14543 /// associated with the hub.
14544 pub count: i64,
14545
14546 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14547 }
14548
14549 impl SpokeTypeCount {
14550 /// Creates a new default instance.
14551 pub fn new() -> Self {
14552 std::default::Default::default()
14553 }
14554
14555 /// Sets the value of [spoke_type][crate::model::spoke_summary::SpokeTypeCount::spoke_type].
14556 ///
14557 /// # Example
14558 /// ```ignore,no_run
14559 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14560 /// use google_cloud_networkconnectivity_v1::model::SpokeType;
14561 /// let x0 = SpokeTypeCount::new().set_spoke_type(SpokeType::VpnTunnel);
14562 /// let x1 = SpokeTypeCount::new().set_spoke_type(SpokeType::InterconnectAttachment);
14563 /// let x2 = SpokeTypeCount::new().set_spoke_type(SpokeType::RouterAppliance);
14564 /// ```
14565 pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(
14566 mut self,
14567 v: T,
14568 ) -> Self {
14569 self.spoke_type = v.into();
14570 self
14571 }
14572
14573 /// Sets the value of [count][crate::model::spoke_summary::SpokeTypeCount::count].
14574 ///
14575 /// # Example
14576 /// ```ignore,no_run
14577 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeTypeCount;
14578 /// let x = SpokeTypeCount::new().set_count(42);
14579 /// ```
14580 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14581 self.count = v.into();
14582 self
14583 }
14584 }
14585
14586 impl wkt::message::Message for SpokeTypeCount {
14587 fn typename() -> &'static str {
14588 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"
14589 }
14590 }
14591
14592 /// The number of spokes that are in a particular state
14593 /// and associated with a given hub.
14594 #[derive(Clone, Default, PartialEq)]
14595 #[non_exhaustive]
14596 pub struct SpokeStateCount {
14597 /// Output only. The state of the spokes.
14598 pub state: crate::model::State,
14599
14600 /// Output only. The total number of spokes that are in this state
14601 /// and associated with a given hub.
14602 pub count: i64,
14603
14604 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14605 }
14606
14607 impl SpokeStateCount {
14608 /// Creates a new default instance.
14609 pub fn new() -> Self {
14610 std::default::Default::default()
14611 }
14612
14613 /// Sets the value of [state][crate::model::spoke_summary::SpokeStateCount::state].
14614 ///
14615 /// # Example
14616 /// ```ignore,no_run
14617 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14618 /// use google_cloud_networkconnectivity_v1::model::State;
14619 /// let x0 = SpokeStateCount::new().set_state(State::Creating);
14620 /// let x1 = SpokeStateCount::new().set_state(State::Active);
14621 /// let x2 = SpokeStateCount::new().set_state(State::Deleting);
14622 /// ```
14623 pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
14624 self.state = v.into();
14625 self
14626 }
14627
14628 /// Sets the value of [count][crate::model::spoke_summary::SpokeStateCount::count].
14629 ///
14630 /// # Example
14631 /// ```ignore,no_run
14632 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateCount;
14633 /// let x = SpokeStateCount::new().set_count(42);
14634 /// ```
14635 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14636 self.count = v.into();
14637 self
14638 }
14639 }
14640
14641 impl wkt::message::Message for SpokeStateCount {
14642 fn typename() -> &'static str {
14643 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"
14644 }
14645 }
14646
14647 /// The number of spokes in the hub that are inactive for this reason.
14648 #[derive(Clone, Default, PartialEq)]
14649 #[non_exhaustive]
14650 pub struct SpokeStateReasonCount {
14651 /// Output only. The reason that a spoke is inactive.
14652 pub state_reason_code: crate::model::spoke::state_reason::Code,
14653
14654 /// Output only. The total number of spokes that are inactive for a
14655 /// particular reason and associated with a given hub.
14656 pub count: i64,
14657
14658 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14659 }
14660
14661 impl SpokeStateReasonCount {
14662 /// Creates a new default instance.
14663 pub fn new() -> Self {
14664 std::default::Default::default()
14665 }
14666
14667 /// Sets the value of [state_reason_code][crate::model::spoke_summary::SpokeStateReasonCount::state_reason_code].
14668 ///
14669 /// # Example
14670 /// ```ignore,no_run
14671 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14672 /// use google_cloud_networkconnectivity_v1::model::spoke::state_reason::Code;
14673 /// let x0 = SpokeStateReasonCount::new().set_state_reason_code(Code::PendingReview);
14674 /// let x1 = SpokeStateReasonCount::new().set_state_reason_code(Code::Rejected);
14675 /// let x2 = SpokeStateReasonCount::new().set_state_reason_code(Code::Paused);
14676 /// ```
14677 pub fn set_state_reason_code<
14678 T: std::convert::Into<crate::model::spoke::state_reason::Code>,
14679 >(
14680 mut self,
14681 v: T,
14682 ) -> Self {
14683 self.state_reason_code = v.into();
14684 self
14685 }
14686
14687 /// Sets the value of [count][crate::model::spoke_summary::SpokeStateReasonCount::count].
14688 ///
14689 /// # Example
14690 /// ```ignore,no_run
14691 /// # use google_cloud_networkconnectivity_v1::model::spoke_summary::SpokeStateReasonCount;
14692 /// let x = SpokeStateReasonCount::new().set_count(42);
14693 /// ```
14694 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14695 self.count = v.into();
14696 self
14697 }
14698 }
14699
14700 impl wkt::message::Message for SpokeStateReasonCount {
14701 fn typename() -> &'static str {
14702 "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"
14703 }
14704 }
14705}
14706
14707/// The request for
14708/// [HubService.GetGroup][google.cloud.networkconnectivity.v1.HubService.GetGroup].
14709///
14710/// [google.cloud.networkconnectivity.v1.HubService.GetGroup]: crate::client::HubService::get_group
14711#[derive(Clone, Default, PartialEq)]
14712#[non_exhaustive]
14713pub struct GetGroupRequest {
14714 /// Required. The name of the route table resource.
14715 pub name: std::string::String,
14716
14717 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14718}
14719
14720impl GetGroupRequest {
14721 /// Creates a new default instance.
14722 pub fn new() -> Self {
14723 std::default::Default::default()
14724 }
14725
14726 /// Sets the value of [name][crate::model::GetGroupRequest::name].
14727 ///
14728 /// # Example
14729 /// ```ignore,no_run
14730 /// # use google_cloud_networkconnectivity_v1::model::GetGroupRequest;
14731 /// # let project_id = "project_id";
14732 /// # let hub_id = "hub_id";
14733 /// # let group_id = "group_id";
14734 /// let x = GetGroupRequest::new().set_name(format!("projects/{project_id}/locations/global/hubs/{hub_id}/groups/{group_id}"));
14735 /// ```
14736 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14737 self.name = v.into();
14738 self
14739 }
14740}
14741
14742impl wkt::message::Message for GetGroupRequest {
14743 fn typename() -> &'static str {
14744 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetGroupRequest"
14745 }
14746}
14747
14748/// Request for
14749/// [HubService.UpdateGroup][google.cloud.networkconnectivity.v1.HubService.UpdateGroup]
14750/// method.
14751///
14752/// [google.cloud.networkconnectivity.v1.HubService.UpdateGroup]: crate::client::HubService::update_group
14753#[derive(Clone, Default, PartialEq)]
14754#[non_exhaustive]
14755pub struct UpdateGroupRequest {
14756 /// Optional. In the case of an update to an existing group, field mask is used
14757 /// to specify the fields to be overwritten. The fields specified in the
14758 /// update_mask are relative to the resource, not the full request. A field is
14759 /// overwritten if it is in the mask. If the user does not provide a mask, then
14760 /// all fields are overwritten.
14761 pub update_mask: std::option::Option<wkt::FieldMask>,
14762
14763 /// Required. The state that the group should be in after the update.
14764 pub group: std::option::Option<crate::model::Group>,
14765
14766 /// Optional. A request ID to identify requests. Specify a unique request ID so
14767 /// that if you must retry your request, the server knows to ignore the request
14768 /// if it has already been completed. The server guarantees that a request
14769 /// doesn't result in creation of duplicate commitments for at least 60
14770 /// minutes.
14771 ///
14772 /// For example, consider a situation where you make an initial request and
14773 /// the request times out. If you make the request again with the same request
14774 /// ID, the server can check to see whether the original operation
14775 /// was received. If it was, the server ignores the second request. This
14776 /// behavior prevents clients from mistakenly creating duplicate commitments.
14777 ///
14778 /// The request ID must be a valid UUID, with the exception that zero UUID is
14779 /// not supported (00000000-0000-0000-0000-000000000000).
14780 pub request_id: std::string::String,
14781
14782 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14783}
14784
14785impl UpdateGroupRequest {
14786 /// Creates a new default instance.
14787 pub fn new() -> Self {
14788 std::default::Default::default()
14789 }
14790
14791 /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
14792 ///
14793 /// # Example
14794 /// ```ignore,no_run
14795 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14796 /// use wkt::FieldMask;
14797 /// let x = UpdateGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
14798 /// ```
14799 pub fn set_update_mask<T>(mut self, v: T) -> Self
14800 where
14801 T: std::convert::Into<wkt::FieldMask>,
14802 {
14803 self.update_mask = std::option::Option::Some(v.into());
14804 self
14805 }
14806
14807 /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
14808 ///
14809 /// # Example
14810 /// ```ignore,no_run
14811 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14812 /// use wkt::FieldMask;
14813 /// let x = UpdateGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
14814 /// let x = UpdateGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
14815 /// ```
14816 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14817 where
14818 T: std::convert::Into<wkt::FieldMask>,
14819 {
14820 self.update_mask = v.map(|x| x.into());
14821 self
14822 }
14823
14824 /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
14825 ///
14826 /// # Example
14827 /// ```ignore,no_run
14828 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14829 /// use google_cloud_networkconnectivity_v1::model::Group;
14830 /// let x = UpdateGroupRequest::new().set_group(Group::default()/* use setters */);
14831 /// ```
14832 pub fn set_group<T>(mut self, v: T) -> Self
14833 where
14834 T: std::convert::Into<crate::model::Group>,
14835 {
14836 self.group = std::option::Option::Some(v.into());
14837 self
14838 }
14839
14840 /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
14841 ///
14842 /// # Example
14843 /// ```ignore,no_run
14844 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14845 /// use google_cloud_networkconnectivity_v1::model::Group;
14846 /// let x = UpdateGroupRequest::new().set_or_clear_group(Some(Group::default()/* use setters */));
14847 /// let x = UpdateGroupRequest::new().set_or_clear_group(None::<Group>);
14848 /// ```
14849 pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
14850 where
14851 T: std::convert::Into<crate::model::Group>,
14852 {
14853 self.group = v.map(|x| x.into());
14854 self
14855 }
14856
14857 /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
14858 ///
14859 /// # Example
14860 /// ```ignore,no_run
14861 /// # use google_cloud_networkconnectivity_v1::model::UpdateGroupRequest;
14862 /// let x = UpdateGroupRequest::new().set_request_id("example");
14863 /// ```
14864 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14865 self.request_id = v.into();
14866 self
14867 }
14868}
14869
14870impl wkt::message::Message for UpdateGroupRequest {
14871 fn typename() -> &'static str {
14872 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateGroupRequest"
14873 }
14874}
14875
14876/// The internal range resource for IPAM operations within a VPC network.
14877/// Used to represent a private address range along with behavioral
14878/// characteristics of that range (its usage and peering behavior).
14879/// Networking resources can link to this range if they are created
14880/// as belonging to it.
14881#[derive(Clone, Default, PartialEq)]
14882#[non_exhaustive]
14883pub struct InternalRange {
14884 /// Identifier. The name of an internal range.
14885 /// Format:
14886 /// projects/{project}/locations/{location}/internalRanges/{internal_range}
14887 /// See: <https://google.aip.dev/122#fields-representing-resource-names>
14888 pub name: std::string::String,
14889
14890 /// Output only. Time when the internal range was created.
14891 pub create_time: std::option::Option<wkt::Timestamp>,
14892
14893 /// Output only. Time when the internal range was updated.
14894 pub update_time: std::option::Option<wkt::Timestamp>,
14895
14896 /// User-defined labels.
14897 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14898
14899 /// Optional. A description of this resource.
14900 pub description: std::string::String,
14901
14902 /// Optional. The IP range that this internal range defines.
14903 /// NOTE: IPv6 ranges are limited to usage=EXTERNAL_TO_VPC and
14904 /// peering=FOR_SELF.
14905 /// NOTE: For IPv6 Ranges this field is compulsory, i.e. the address range must
14906 /// be specified explicitly.
14907 pub ip_cidr_range: std::string::String,
14908
14909 /// Immutable. The URL or resource ID of the network in which to reserve the
14910 /// internal range. The network cannot be deleted if there are any reserved
14911 /// internal ranges referring to it. Legacy networks are not supported. For
14912 /// example:
14913 /// <https://www.googleapis.com/compute/v1/projects/{project}/locations/global/networks/{network}>
14914 /// projects/{project}/locations/global/networks/{network}
14915 /// {network}
14916 pub network: std::string::String,
14917
14918 /// Optional. The type of usage set for this InternalRange.
14919 pub usage: crate::model::internal_range::Usage,
14920
14921 /// Optional. The type of peering set for this internal range.
14922 pub peering: crate::model::internal_range::Peering,
14923
14924 /// Optional. An alternate to ip_cidr_range. Can be set when trying to create
14925 /// an IPv4 reservation that automatically finds a free range of the given
14926 /// size. If both ip_cidr_range and prefix_length are set, there is an error if
14927 /// the range sizes do not match. Can also be used during updates to change the
14928 /// range size.
14929 /// NOTE: For IPv6 this field only works if ip_cidr_range is set as well, and
14930 /// both fields must match. In other words, with IPv6 this field only works as
14931 /// a redundant parameter.
14932 pub prefix_length: i32,
14933
14934 /// Optional. Can be set to narrow down or pick a different address space while
14935 /// searching for a free range. If not set, defaults to the ["10.0.0.0/8",
14936 /// "172.16.0.0/12", "192.168.0.0/16"] address space (for auto-mode networks,
14937 /// the "10.0.0.0/9" range is used instead of "10.0.0.0/8"). This can be used
14938 /// to target the search in other rfc-1918 address spaces like "172.16.0.0/12"
14939 /// and "192.168.0.0/16" or non-rfc-1918 address spaces used in the VPC.
14940 pub target_cidr_range: std::vec::Vec<std::string::String>,
14941
14942 /// Output only. The list of resources that refer to this internal range.
14943 /// Resources that use the internal range for their range allocation
14944 /// are referred to as users of the range. Other resources mark themselves
14945 /// as users while doing so by creating a reference to this internal range.
14946 /// Having a user, based on this reference, prevents deletion of the
14947 /// internal range referred to. Can be empty.
14948 pub users: std::vec::Vec<std::string::String>,
14949
14950 /// Optional. Types of resources that are allowed to overlap with the current
14951 /// internal range.
14952 pub overlaps: std::vec::Vec<crate::model::internal_range::Overlap>,
14953
14954 /// Optional. Must be present if usage is set to FOR_MIGRATION.
14955 pub migration: std::option::Option<crate::model::internal_range::Migration>,
14956
14957 /// Optional. Immutable ranges cannot have their fields modified, except for
14958 /// labels and description.
14959 pub immutable: bool,
14960
14961 /// Optional. Range auto-allocation options, may be set only when
14962 /// auto-allocation is selected by not setting ip_cidr_range (and setting
14963 /// prefix_length).
14964 pub allocation_options: std::option::Option<crate::model::internal_range::AllocationOptions>,
14965
14966 /// Optional. ExcludeCidrRanges flag. Specifies a set of CIDR blocks that
14967 /// allows exclusion of particular CIDR ranges from the auto-allocation
14968 /// process, without having to reserve these blocks
14969 pub exclude_cidr_ranges: std::vec::Vec<std::string::String>,
14970
14971 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14972}
14973
14974impl InternalRange {
14975 /// Creates a new default instance.
14976 pub fn new() -> Self {
14977 std::default::Default::default()
14978 }
14979
14980 /// Sets the value of [name][crate::model::InternalRange::name].
14981 ///
14982 /// # Example
14983 /// ```ignore,no_run
14984 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
14985 /// # let project_id = "project_id";
14986 /// # let location_id = "location_id";
14987 /// # let internal_range_id = "internal_range_id";
14988 /// let x = InternalRange::new().set_name(format!("projects/{project_id}/locations/{location_id}/internalRanges/{internal_range_id}"));
14989 /// ```
14990 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14991 self.name = v.into();
14992 self
14993 }
14994
14995 /// Sets the value of [create_time][crate::model::InternalRange::create_time].
14996 ///
14997 /// # Example
14998 /// ```ignore,no_run
14999 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15000 /// use wkt::Timestamp;
15001 /// let x = InternalRange::new().set_create_time(Timestamp::default()/* use setters */);
15002 /// ```
15003 pub fn set_create_time<T>(mut self, v: T) -> Self
15004 where
15005 T: std::convert::Into<wkt::Timestamp>,
15006 {
15007 self.create_time = std::option::Option::Some(v.into());
15008 self
15009 }
15010
15011 /// Sets or clears the value of [create_time][crate::model::InternalRange::create_time].
15012 ///
15013 /// # Example
15014 /// ```ignore,no_run
15015 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15016 /// use wkt::Timestamp;
15017 /// let x = InternalRange::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15018 /// let x = InternalRange::new().set_or_clear_create_time(None::<Timestamp>);
15019 /// ```
15020 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15021 where
15022 T: std::convert::Into<wkt::Timestamp>,
15023 {
15024 self.create_time = v.map(|x| x.into());
15025 self
15026 }
15027
15028 /// Sets the value of [update_time][crate::model::InternalRange::update_time].
15029 ///
15030 /// # Example
15031 /// ```ignore,no_run
15032 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15033 /// use wkt::Timestamp;
15034 /// let x = InternalRange::new().set_update_time(Timestamp::default()/* use setters */);
15035 /// ```
15036 pub fn set_update_time<T>(mut self, v: T) -> Self
15037 where
15038 T: std::convert::Into<wkt::Timestamp>,
15039 {
15040 self.update_time = std::option::Option::Some(v.into());
15041 self
15042 }
15043
15044 /// Sets or clears the value of [update_time][crate::model::InternalRange::update_time].
15045 ///
15046 /// # Example
15047 /// ```ignore,no_run
15048 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15049 /// use wkt::Timestamp;
15050 /// let x = InternalRange::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
15051 /// let x = InternalRange::new().set_or_clear_update_time(None::<Timestamp>);
15052 /// ```
15053 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15054 where
15055 T: std::convert::Into<wkt::Timestamp>,
15056 {
15057 self.update_time = v.map(|x| x.into());
15058 self
15059 }
15060
15061 /// Sets the value of [labels][crate::model::InternalRange::labels].
15062 ///
15063 /// # Example
15064 /// ```ignore,no_run
15065 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15066 /// let x = InternalRange::new().set_labels([
15067 /// ("key0", "abc"),
15068 /// ("key1", "xyz"),
15069 /// ]);
15070 /// ```
15071 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
15072 where
15073 T: std::iter::IntoIterator<Item = (K, V)>,
15074 K: std::convert::Into<std::string::String>,
15075 V: std::convert::Into<std::string::String>,
15076 {
15077 use std::iter::Iterator;
15078 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15079 self
15080 }
15081
15082 /// Sets the value of [description][crate::model::InternalRange::description].
15083 ///
15084 /// # Example
15085 /// ```ignore,no_run
15086 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15087 /// let x = InternalRange::new().set_description("example");
15088 /// ```
15089 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15090 self.description = v.into();
15091 self
15092 }
15093
15094 /// Sets the value of [ip_cidr_range][crate::model::InternalRange::ip_cidr_range].
15095 ///
15096 /// # Example
15097 /// ```ignore,no_run
15098 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15099 /// let x = InternalRange::new().set_ip_cidr_range("example");
15100 /// ```
15101 pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15102 self.ip_cidr_range = v.into();
15103 self
15104 }
15105
15106 /// Sets the value of [network][crate::model::InternalRange::network].
15107 ///
15108 /// # Example
15109 /// ```ignore,no_run
15110 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15111 /// let x = InternalRange::new().set_network("example");
15112 /// ```
15113 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15114 self.network = v.into();
15115 self
15116 }
15117
15118 /// Sets the value of [usage][crate::model::InternalRange::usage].
15119 ///
15120 /// # Example
15121 /// ```ignore,no_run
15122 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15123 /// use google_cloud_networkconnectivity_v1::model::internal_range::Usage;
15124 /// let x0 = InternalRange::new().set_usage(Usage::ForVpc);
15125 /// let x1 = InternalRange::new().set_usage(Usage::ExternalToVpc);
15126 /// let x2 = InternalRange::new().set_usage(Usage::ForMigration);
15127 /// ```
15128 pub fn set_usage<T: std::convert::Into<crate::model::internal_range::Usage>>(
15129 mut self,
15130 v: T,
15131 ) -> Self {
15132 self.usage = v.into();
15133 self
15134 }
15135
15136 /// Sets the value of [peering][crate::model::InternalRange::peering].
15137 ///
15138 /// # Example
15139 /// ```ignore,no_run
15140 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15141 /// use google_cloud_networkconnectivity_v1::model::internal_range::Peering;
15142 /// let x0 = InternalRange::new().set_peering(Peering::ForSelf);
15143 /// let x1 = InternalRange::new().set_peering(Peering::ForPeer);
15144 /// let x2 = InternalRange::new().set_peering(Peering::NotShared);
15145 /// ```
15146 pub fn set_peering<T: std::convert::Into<crate::model::internal_range::Peering>>(
15147 mut self,
15148 v: T,
15149 ) -> Self {
15150 self.peering = v.into();
15151 self
15152 }
15153
15154 /// Sets the value of [prefix_length][crate::model::InternalRange::prefix_length].
15155 ///
15156 /// # Example
15157 /// ```ignore,no_run
15158 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15159 /// let x = InternalRange::new().set_prefix_length(42);
15160 /// ```
15161 pub fn set_prefix_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15162 self.prefix_length = v.into();
15163 self
15164 }
15165
15166 /// Sets the value of [target_cidr_range][crate::model::InternalRange::target_cidr_range].
15167 ///
15168 /// # Example
15169 /// ```ignore,no_run
15170 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15171 /// let x = InternalRange::new().set_target_cidr_range(["a", "b", "c"]);
15172 /// ```
15173 pub fn set_target_cidr_range<T, V>(mut self, v: T) -> Self
15174 where
15175 T: std::iter::IntoIterator<Item = V>,
15176 V: std::convert::Into<std::string::String>,
15177 {
15178 use std::iter::Iterator;
15179 self.target_cidr_range = v.into_iter().map(|i| i.into()).collect();
15180 self
15181 }
15182
15183 /// Sets the value of [users][crate::model::InternalRange::users].
15184 ///
15185 /// # Example
15186 /// ```ignore,no_run
15187 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15188 /// let x = InternalRange::new().set_users(["a", "b", "c"]);
15189 /// ```
15190 pub fn set_users<T, V>(mut self, v: T) -> Self
15191 where
15192 T: std::iter::IntoIterator<Item = V>,
15193 V: std::convert::Into<std::string::String>,
15194 {
15195 use std::iter::Iterator;
15196 self.users = v.into_iter().map(|i| i.into()).collect();
15197 self
15198 }
15199
15200 /// Sets the value of [overlaps][crate::model::InternalRange::overlaps].
15201 ///
15202 /// # Example
15203 /// ```ignore,no_run
15204 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15205 /// use google_cloud_networkconnectivity_v1::model::internal_range::Overlap;
15206 /// let x = InternalRange::new().set_overlaps([
15207 /// Overlap::RouteRange,
15208 /// Overlap::ExistingSubnetRange,
15209 /// ]);
15210 /// ```
15211 pub fn set_overlaps<T, V>(mut self, v: T) -> Self
15212 where
15213 T: std::iter::IntoIterator<Item = V>,
15214 V: std::convert::Into<crate::model::internal_range::Overlap>,
15215 {
15216 use std::iter::Iterator;
15217 self.overlaps = v.into_iter().map(|i| i.into()).collect();
15218 self
15219 }
15220
15221 /// Sets the value of [migration][crate::model::InternalRange::migration].
15222 ///
15223 /// # Example
15224 /// ```ignore,no_run
15225 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15226 /// use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15227 /// let x = InternalRange::new().set_migration(Migration::default()/* use setters */);
15228 /// ```
15229 pub fn set_migration<T>(mut self, v: T) -> Self
15230 where
15231 T: std::convert::Into<crate::model::internal_range::Migration>,
15232 {
15233 self.migration = std::option::Option::Some(v.into());
15234 self
15235 }
15236
15237 /// Sets or clears the value of [migration][crate::model::InternalRange::migration].
15238 ///
15239 /// # Example
15240 /// ```ignore,no_run
15241 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15242 /// use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15243 /// let x = InternalRange::new().set_or_clear_migration(Some(Migration::default()/* use setters */));
15244 /// let x = InternalRange::new().set_or_clear_migration(None::<Migration>);
15245 /// ```
15246 pub fn set_or_clear_migration<T>(mut self, v: std::option::Option<T>) -> Self
15247 where
15248 T: std::convert::Into<crate::model::internal_range::Migration>,
15249 {
15250 self.migration = v.map(|x| x.into());
15251 self
15252 }
15253
15254 /// Sets the value of [immutable][crate::model::InternalRange::immutable].
15255 ///
15256 /// # Example
15257 /// ```ignore,no_run
15258 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15259 /// let x = InternalRange::new().set_immutable(true);
15260 /// ```
15261 pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15262 self.immutable = v.into();
15263 self
15264 }
15265
15266 /// Sets the value of [allocation_options][crate::model::InternalRange::allocation_options].
15267 ///
15268 /// # Example
15269 /// ```ignore,no_run
15270 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15271 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15272 /// let x = InternalRange::new().set_allocation_options(AllocationOptions::default()/* use setters */);
15273 /// ```
15274 pub fn set_allocation_options<T>(mut self, v: T) -> Self
15275 where
15276 T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
15277 {
15278 self.allocation_options = std::option::Option::Some(v.into());
15279 self
15280 }
15281
15282 /// Sets or clears the value of [allocation_options][crate::model::InternalRange::allocation_options].
15283 ///
15284 /// # Example
15285 /// ```ignore,no_run
15286 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15287 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15288 /// let x = InternalRange::new().set_or_clear_allocation_options(Some(AllocationOptions::default()/* use setters */));
15289 /// let x = InternalRange::new().set_or_clear_allocation_options(None::<AllocationOptions>);
15290 /// ```
15291 pub fn set_or_clear_allocation_options<T>(mut self, v: std::option::Option<T>) -> Self
15292 where
15293 T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
15294 {
15295 self.allocation_options = v.map(|x| x.into());
15296 self
15297 }
15298
15299 /// Sets the value of [exclude_cidr_ranges][crate::model::InternalRange::exclude_cidr_ranges].
15300 ///
15301 /// # Example
15302 /// ```ignore,no_run
15303 /// # use google_cloud_networkconnectivity_v1::model::InternalRange;
15304 /// let x = InternalRange::new().set_exclude_cidr_ranges(["a", "b", "c"]);
15305 /// ```
15306 pub fn set_exclude_cidr_ranges<T, V>(mut self, v: T) -> Self
15307 where
15308 T: std::iter::IntoIterator<Item = V>,
15309 V: std::convert::Into<std::string::String>,
15310 {
15311 use std::iter::Iterator;
15312 self.exclude_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
15313 self
15314 }
15315}
15316
15317impl wkt::message::Message for InternalRange {
15318 fn typename() -> &'static str {
15319 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange"
15320 }
15321}
15322
15323/// Defines additional types related to [InternalRange].
15324pub mod internal_range {
15325 #[allow(unused_imports)]
15326 use super::*;
15327
15328 /// Specification for migration with source and target resource names.
15329 #[derive(Clone, Default, PartialEq)]
15330 #[non_exhaustive]
15331 pub struct Migration {
15332 /// Immutable. Resource path as an URI of the source resource, for example a
15333 /// subnet. The project for the source resource should match the project for
15334 /// the InternalRange. An example:
15335 /// /projects/{project}/regions/{region}/subnetworks/{subnet}
15336 pub source: std::string::String,
15337
15338 /// Immutable. Resource path of the target resource. The target project can
15339 /// be different, as in the cases when migrating to peer networks. For
15340 /// example:
15341 /// /projects/{project}/regions/{region}/subnetworks/{subnet}
15342 pub target: std::string::String,
15343
15344 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15345 }
15346
15347 impl Migration {
15348 /// Creates a new default instance.
15349 pub fn new() -> Self {
15350 std::default::Default::default()
15351 }
15352
15353 /// Sets the value of [source][crate::model::internal_range::Migration::source].
15354 ///
15355 /// # Example
15356 /// ```ignore,no_run
15357 /// # use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15358 /// let x = Migration::new().set_source("example");
15359 /// ```
15360 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15361 self.source = v.into();
15362 self
15363 }
15364
15365 /// Sets the value of [target][crate::model::internal_range::Migration::target].
15366 ///
15367 /// # Example
15368 /// ```ignore,no_run
15369 /// # use google_cloud_networkconnectivity_v1::model::internal_range::Migration;
15370 /// let x = Migration::new().set_target("example");
15371 /// ```
15372 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15373 self.target = v.into();
15374 self
15375 }
15376 }
15377
15378 impl wkt::message::Message for Migration {
15379 fn typename() -> &'static str {
15380 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.Migration"
15381 }
15382 }
15383
15384 /// Range auto-allocation options, to be optionally used when CIDR block is not
15385 /// explicitly set.
15386 #[derive(Clone, Default, PartialEq)]
15387 #[non_exhaustive]
15388 pub struct AllocationOptions {
15389 /// Optional. Allocation strategy Not setting this field when the allocation
15390 /// is requested means an implementation defined strategy is used.
15391 pub allocation_strategy: crate::model::internal_range::AllocationStrategy,
15392
15393 /// Optional. This field must be set only when allocation_strategy is set to
15394 /// RANDOM_FIRST_N_AVAILABLE.
15395 /// The value should be the maximum expected parallelism of range creation
15396 /// requests issued to the same space of peered netwroks.
15397 pub first_available_ranges_lookup_size: i32,
15398
15399 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15400 }
15401
15402 impl AllocationOptions {
15403 /// Creates a new default instance.
15404 pub fn new() -> Self {
15405 std::default::Default::default()
15406 }
15407
15408 /// Sets the value of [allocation_strategy][crate::model::internal_range::AllocationOptions::allocation_strategy].
15409 ///
15410 /// # Example
15411 /// ```ignore,no_run
15412 /// # use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15413 /// use google_cloud_networkconnectivity_v1::model::internal_range::AllocationStrategy;
15414 /// let x0 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::Random);
15415 /// let x1 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::FirstAvailable);
15416 /// let x2 = AllocationOptions::new().set_allocation_strategy(AllocationStrategy::RandomFirstNAvailable);
15417 /// ```
15418 pub fn set_allocation_strategy<
15419 T: std::convert::Into<crate::model::internal_range::AllocationStrategy>,
15420 >(
15421 mut self,
15422 v: T,
15423 ) -> Self {
15424 self.allocation_strategy = v.into();
15425 self
15426 }
15427
15428 /// Sets the value of [first_available_ranges_lookup_size][crate::model::internal_range::AllocationOptions::first_available_ranges_lookup_size].
15429 ///
15430 /// # Example
15431 /// ```ignore,no_run
15432 /// # use google_cloud_networkconnectivity_v1::model::internal_range::AllocationOptions;
15433 /// let x = AllocationOptions::new().set_first_available_ranges_lookup_size(42);
15434 /// ```
15435 pub fn set_first_available_ranges_lookup_size<T: std::convert::Into<i32>>(
15436 mut self,
15437 v: T,
15438 ) -> Self {
15439 self.first_available_ranges_lookup_size = v.into();
15440 self
15441 }
15442 }
15443
15444 impl wkt::message::Message for AllocationOptions {
15445 fn typename() -> &'static str {
15446 "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.AllocationOptions"
15447 }
15448 }
15449
15450 /// Possible usage of an internal range.
15451 ///
15452 /// # Working with unknown values
15453 ///
15454 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15455 /// additional enum variants at any time. Adding new variants is not considered
15456 /// a breaking change. Applications should write their code in anticipation of:
15457 ///
15458 /// - New values appearing in future releases of the client library, **and**
15459 /// - New values received dynamically, without application changes.
15460 ///
15461 /// Please consult the [Working with enums] section in the user guide for some
15462 /// guidelines.
15463 ///
15464 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15465 #[derive(Clone, Debug, PartialEq)]
15466 #[non_exhaustive]
15467 pub enum Usage {
15468 /// Unspecified usage is allowed in calls which identify the resource by
15469 /// other fields and do not need Usage set to complete. These are, i.e.:
15470 /// GetInternalRange and DeleteInternalRange.
15471 /// Usage needs to be specified explicitly in CreateInternalRange
15472 /// or UpdateInternalRange calls.
15473 Unspecified,
15474 /// A VPC resource can use the reserved CIDR block by associating it with the
15475 /// internal range resource if usage is set to FOR_VPC.
15476 ForVpc,
15477 /// Ranges created with EXTERNAL_TO_VPC cannot be associated with VPC
15478 /// resources and are meant to block out address ranges for various use
15479 /// cases, like for example, usage on-prem, with dynamic route announcements
15480 /// via interconnect.
15481 ExternalToVpc,
15482 /// Ranges created FOR_MIGRATION can be used to lock a CIDR range between a
15483 /// source and target subnet. If usage is set to FOR_MIGRATION, the peering
15484 /// value has to be set to FOR_SELF or default to FOR_SELF when unset.
15485 ForMigration,
15486 /// If set, the enum was initialized with an unknown value.
15487 ///
15488 /// Applications can examine the value using [Usage::value] or
15489 /// [Usage::name].
15490 UnknownValue(usage::UnknownValue),
15491 }
15492
15493 #[doc(hidden)]
15494 pub mod usage {
15495 #[allow(unused_imports)]
15496 use super::*;
15497 #[derive(Clone, Debug, PartialEq)]
15498 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15499 }
15500
15501 impl Usage {
15502 /// Gets the enum value.
15503 ///
15504 /// Returns `None` if the enum contains an unknown value deserialized from
15505 /// the string representation of enums.
15506 pub fn value(&self) -> std::option::Option<i32> {
15507 match self {
15508 Self::Unspecified => std::option::Option::Some(0),
15509 Self::ForVpc => std::option::Option::Some(1),
15510 Self::ExternalToVpc => std::option::Option::Some(2),
15511 Self::ForMigration => std::option::Option::Some(3),
15512 Self::UnknownValue(u) => u.0.value(),
15513 }
15514 }
15515
15516 /// Gets the enum value as a string.
15517 ///
15518 /// Returns `None` if the enum contains an unknown value deserialized from
15519 /// the integer representation of enums.
15520 pub fn name(&self) -> std::option::Option<&str> {
15521 match self {
15522 Self::Unspecified => std::option::Option::Some("USAGE_UNSPECIFIED"),
15523 Self::ForVpc => std::option::Option::Some("FOR_VPC"),
15524 Self::ExternalToVpc => std::option::Option::Some("EXTERNAL_TO_VPC"),
15525 Self::ForMigration => std::option::Option::Some("FOR_MIGRATION"),
15526 Self::UnknownValue(u) => u.0.name(),
15527 }
15528 }
15529 }
15530
15531 impl std::default::Default for Usage {
15532 fn default() -> Self {
15533 use std::convert::From;
15534 Self::from(0)
15535 }
15536 }
15537
15538 impl std::fmt::Display for Usage {
15539 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15540 wkt::internal::display_enum(f, self.name(), self.value())
15541 }
15542 }
15543
15544 impl std::convert::From<i32> for Usage {
15545 fn from(value: i32) -> Self {
15546 match value {
15547 0 => Self::Unspecified,
15548 1 => Self::ForVpc,
15549 2 => Self::ExternalToVpc,
15550 3 => Self::ForMigration,
15551 _ => Self::UnknownValue(usage::UnknownValue(
15552 wkt::internal::UnknownEnumValue::Integer(value),
15553 )),
15554 }
15555 }
15556 }
15557
15558 impl std::convert::From<&str> for Usage {
15559 fn from(value: &str) -> Self {
15560 use std::string::ToString;
15561 match value {
15562 "USAGE_UNSPECIFIED" => Self::Unspecified,
15563 "FOR_VPC" => Self::ForVpc,
15564 "EXTERNAL_TO_VPC" => Self::ExternalToVpc,
15565 "FOR_MIGRATION" => Self::ForMigration,
15566 _ => Self::UnknownValue(usage::UnknownValue(
15567 wkt::internal::UnknownEnumValue::String(value.to_string()),
15568 )),
15569 }
15570 }
15571 }
15572
15573 impl serde::ser::Serialize for Usage {
15574 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15575 where
15576 S: serde::Serializer,
15577 {
15578 match self {
15579 Self::Unspecified => serializer.serialize_i32(0),
15580 Self::ForVpc => serializer.serialize_i32(1),
15581 Self::ExternalToVpc => serializer.serialize_i32(2),
15582 Self::ForMigration => serializer.serialize_i32(3),
15583 Self::UnknownValue(u) => u.0.serialize(serializer),
15584 }
15585 }
15586 }
15587
15588 impl<'de> serde::de::Deserialize<'de> for Usage {
15589 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15590 where
15591 D: serde::Deserializer<'de>,
15592 {
15593 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Usage>::new(
15594 ".google.cloud.networkconnectivity.v1.InternalRange.Usage",
15595 ))
15596 }
15597 }
15598
15599 /// Peering type.
15600 ///
15601 /// # Working with unknown values
15602 ///
15603 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15604 /// additional enum variants at any time. Adding new variants is not considered
15605 /// a breaking change. Applications should write their code in anticipation of:
15606 ///
15607 /// - New values appearing in future releases of the client library, **and**
15608 /// - New values received dynamically, without application changes.
15609 ///
15610 /// Please consult the [Working with enums] section in the user guide for some
15611 /// guidelines.
15612 ///
15613 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15614 #[derive(Clone, Debug, PartialEq)]
15615 #[non_exhaustive]
15616 pub enum Peering {
15617 /// If Peering is left unspecified in CreateInternalRange or
15618 /// UpdateInternalRange, it will be defaulted to FOR_SELF.
15619 Unspecified,
15620 /// This is the default behavior and represents the case that this
15621 /// internal range is intended to be used in the VPC in which it is created
15622 /// and is accessible from its peers. This implies that peers or
15623 /// peers-of-peers cannot use this range.
15624 ForSelf,
15625 /// This behavior can be set when the internal range is being reserved for
15626 /// usage by peers. This means that no resource within the VPC in which
15627 /// it is being created can use this to associate with a VPC resource, but
15628 /// one of the peers can. This represents donating a range for peers to
15629 /// use.
15630 ForPeer,
15631 /// This behavior can be set when the internal range is being reserved for
15632 /// usage by the VPC in which it is created, but not shared with peers.
15633 /// In a sense, it is local to the VPC. This can be used to create internal
15634 /// ranges for various purposes like HTTP_INTERNAL_LOAD_BALANCER or for
15635 /// Interconnect routes that are not shared with peers. This also implies
15636 /// that peers cannot use this range in a way that is visible to this VPC,
15637 /// but can re-use this range as long as it is NOT_SHARED from the peer VPC,
15638 /// too.
15639 NotShared,
15640 /// If set, the enum was initialized with an unknown value.
15641 ///
15642 /// Applications can examine the value using [Peering::value] or
15643 /// [Peering::name].
15644 UnknownValue(peering::UnknownValue),
15645 }
15646
15647 #[doc(hidden)]
15648 pub mod peering {
15649 #[allow(unused_imports)]
15650 use super::*;
15651 #[derive(Clone, Debug, PartialEq)]
15652 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15653 }
15654
15655 impl Peering {
15656 /// Gets the enum value.
15657 ///
15658 /// Returns `None` if the enum contains an unknown value deserialized from
15659 /// the string representation of enums.
15660 pub fn value(&self) -> std::option::Option<i32> {
15661 match self {
15662 Self::Unspecified => std::option::Option::Some(0),
15663 Self::ForSelf => std::option::Option::Some(1),
15664 Self::ForPeer => std::option::Option::Some(2),
15665 Self::NotShared => std::option::Option::Some(3),
15666 Self::UnknownValue(u) => u.0.value(),
15667 }
15668 }
15669
15670 /// Gets the enum value as a string.
15671 ///
15672 /// Returns `None` if the enum contains an unknown value deserialized from
15673 /// the integer representation of enums.
15674 pub fn name(&self) -> std::option::Option<&str> {
15675 match self {
15676 Self::Unspecified => std::option::Option::Some("PEERING_UNSPECIFIED"),
15677 Self::ForSelf => std::option::Option::Some("FOR_SELF"),
15678 Self::ForPeer => std::option::Option::Some("FOR_PEER"),
15679 Self::NotShared => std::option::Option::Some("NOT_SHARED"),
15680 Self::UnknownValue(u) => u.0.name(),
15681 }
15682 }
15683 }
15684
15685 impl std::default::Default for Peering {
15686 fn default() -> Self {
15687 use std::convert::From;
15688 Self::from(0)
15689 }
15690 }
15691
15692 impl std::fmt::Display for Peering {
15693 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15694 wkt::internal::display_enum(f, self.name(), self.value())
15695 }
15696 }
15697
15698 impl std::convert::From<i32> for Peering {
15699 fn from(value: i32) -> Self {
15700 match value {
15701 0 => Self::Unspecified,
15702 1 => Self::ForSelf,
15703 2 => Self::ForPeer,
15704 3 => Self::NotShared,
15705 _ => Self::UnknownValue(peering::UnknownValue(
15706 wkt::internal::UnknownEnumValue::Integer(value),
15707 )),
15708 }
15709 }
15710 }
15711
15712 impl std::convert::From<&str> for Peering {
15713 fn from(value: &str) -> Self {
15714 use std::string::ToString;
15715 match value {
15716 "PEERING_UNSPECIFIED" => Self::Unspecified,
15717 "FOR_SELF" => Self::ForSelf,
15718 "FOR_PEER" => Self::ForPeer,
15719 "NOT_SHARED" => Self::NotShared,
15720 _ => Self::UnknownValue(peering::UnknownValue(
15721 wkt::internal::UnknownEnumValue::String(value.to_string()),
15722 )),
15723 }
15724 }
15725 }
15726
15727 impl serde::ser::Serialize for Peering {
15728 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15729 where
15730 S: serde::Serializer,
15731 {
15732 match self {
15733 Self::Unspecified => serializer.serialize_i32(0),
15734 Self::ForSelf => serializer.serialize_i32(1),
15735 Self::ForPeer => serializer.serialize_i32(2),
15736 Self::NotShared => serializer.serialize_i32(3),
15737 Self::UnknownValue(u) => u.0.serialize(serializer),
15738 }
15739 }
15740 }
15741
15742 impl<'de> serde::de::Deserialize<'de> for Peering {
15743 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15744 where
15745 D: serde::Deserializer<'de>,
15746 {
15747 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Peering>::new(
15748 ".google.cloud.networkconnectivity.v1.InternalRange.Peering",
15749 ))
15750 }
15751 }
15752
15753 /// Overlap specifications.
15754 ///
15755 /// # Working with unknown values
15756 ///
15757 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15758 /// additional enum variants at any time. Adding new variants is not considered
15759 /// a breaking change. Applications should write their code in anticipation of:
15760 ///
15761 /// - New values appearing in future releases of the client library, **and**
15762 /// - New values received dynamically, without application changes.
15763 ///
15764 /// Please consult the [Working with enums] section in the user guide for some
15765 /// guidelines.
15766 ///
15767 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15768 #[derive(Clone, Debug, PartialEq)]
15769 #[non_exhaustive]
15770 pub enum Overlap {
15771 /// No overlap overrides.
15772 Unspecified,
15773 /// Allow creation of static routes more specific that the current
15774 /// internal range.
15775 RouteRange,
15776 /// Allow creation of internal ranges that overlap with existing subnets.
15777 ExistingSubnetRange,
15778 /// If set, the enum was initialized with an unknown value.
15779 ///
15780 /// Applications can examine the value using [Overlap::value] or
15781 /// [Overlap::name].
15782 UnknownValue(overlap::UnknownValue),
15783 }
15784
15785 #[doc(hidden)]
15786 pub mod overlap {
15787 #[allow(unused_imports)]
15788 use super::*;
15789 #[derive(Clone, Debug, PartialEq)]
15790 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15791 }
15792
15793 impl Overlap {
15794 /// Gets the enum value.
15795 ///
15796 /// Returns `None` if the enum contains an unknown value deserialized from
15797 /// the string representation of enums.
15798 pub fn value(&self) -> std::option::Option<i32> {
15799 match self {
15800 Self::Unspecified => std::option::Option::Some(0),
15801 Self::RouteRange => std::option::Option::Some(1),
15802 Self::ExistingSubnetRange => std::option::Option::Some(2),
15803 Self::UnknownValue(u) => u.0.value(),
15804 }
15805 }
15806
15807 /// Gets the enum value as a string.
15808 ///
15809 /// Returns `None` if the enum contains an unknown value deserialized from
15810 /// the integer representation of enums.
15811 pub fn name(&self) -> std::option::Option<&str> {
15812 match self {
15813 Self::Unspecified => std::option::Option::Some("OVERLAP_UNSPECIFIED"),
15814 Self::RouteRange => std::option::Option::Some("OVERLAP_ROUTE_RANGE"),
15815 Self::ExistingSubnetRange => {
15816 std::option::Option::Some("OVERLAP_EXISTING_SUBNET_RANGE")
15817 }
15818 Self::UnknownValue(u) => u.0.name(),
15819 }
15820 }
15821 }
15822
15823 impl std::default::Default for Overlap {
15824 fn default() -> Self {
15825 use std::convert::From;
15826 Self::from(0)
15827 }
15828 }
15829
15830 impl std::fmt::Display for Overlap {
15831 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15832 wkt::internal::display_enum(f, self.name(), self.value())
15833 }
15834 }
15835
15836 impl std::convert::From<i32> for Overlap {
15837 fn from(value: i32) -> Self {
15838 match value {
15839 0 => Self::Unspecified,
15840 1 => Self::RouteRange,
15841 2 => Self::ExistingSubnetRange,
15842 _ => Self::UnknownValue(overlap::UnknownValue(
15843 wkt::internal::UnknownEnumValue::Integer(value),
15844 )),
15845 }
15846 }
15847 }
15848
15849 impl std::convert::From<&str> for Overlap {
15850 fn from(value: &str) -> Self {
15851 use std::string::ToString;
15852 match value {
15853 "OVERLAP_UNSPECIFIED" => Self::Unspecified,
15854 "OVERLAP_ROUTE_RANGE" => Self::RouteRange,
15855 "OVERLAP_EXISTING_SUBNET_RANGE" => Self::ExistingSubnetRange,
15856 _ => Self::UnknownValue(overlap::UnknownValue(
15857 wkt::internal::UnknownEnumValue::String(value.to_string()),
15858 )),
15859 }
15860 }
15861 }
15862
15863 impl serde::ser::Serialize for Overlap {
15864 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15865 where
15866 S: serde::Serializer,
15867 {
15868 match self {
15869 Self::Unspecified => serializer.serialize_i32(0),
15870 Self::RouteRange => serializer.serialize_i32(1),
15871 Self::ExistingSubnetRange => serializer.serialize_i32(2),
15872 Self::UnknownValue(u) => u.0.serialize(serializer),
15873 }
15874 }
15875 }
15876
15877 impl<'de> serde::de::Deserialize<'de> for Overlap {
15878 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15879 where
15880 D: serde::Deserializer<'de>,
15881 {
15882 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Overlap>::new(
15883 ".google.cloud.networkconnectivity.v1.InternalRange.Overlap",
15884 ))
15885 }
15886 }
15887
15888 /// Enumeration of range auto-allocation strategies
15889 ///
15890 /// # Working with unknown values
15891 ///
15892 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15893 /// additional enum variants at any time. Adding new variants is not considered
15894 /// a breaking change. Applications should write their code in anticipation of:
15895 ///
15896 /// - New values appearing in future releases of the client library, **and**
15897 /// - New values received dynamically, without application changes.
15898 ///
15899 /// Please consult the [Working with enums] section in the user guide for some
15900 /// guidelines.
15901 ///
15902 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15903 #[derive(Clone, Debug, PartialEq)]
15904 #[non_exhaustive]
15905 pub enum AllocationStrategy {
15906 /// Unspecified is the only valid option when the range is specified
15907 /// explicitly by ip_cidr_range field. Otherwise unspefified means using the
15908 /// default strategy.
15909 Unspecified,
15910 /// Random strategy, the legacy algorithm, used for backwards compatibility.
15911 /// This allocation strategy remains efficient in the case of concurrent
15912 /// allocation requests in the same peered network space and doesn't require
15913 /// providing the level of concurrency in an explicit parameter, but it is
15914 /// prone to fragmenting available address space.
15915 Random,
15916 /// Pick the first available address range. This strategy is deterministic
15917 /// and the result is easy to predict.
15918 FirstAvailable,
15919 /// Pick an arbitrary range out of the first N available ones. The N will be
15920 /// set in the first_available_ranges_lookup_size field. This strategy should
15921 /// be used when concurrent allocation requests are made in the same space of
15922 /// peered networks while the fragmentation of the addrress space is reduced.
15923 RandomFirstNAvailable,
15924 /// Pick the smallest but fitting available range. This deterministic
15925 /// strategy minimizes fragmentation of the address space.
15926 FirstSmallestFitting,
15927 /// If set, the enum was initialized with an unknown value.
15928 ///
15929 /// Applications can examine the value using [AllocationStrategy::value] or
15930 /// [AllocationStrategy::name].
15931 UnknownValue(allocation_strategy::UnknownValue),
15932 }
15933
15934 #[doc(hidden)]
15935 pub mod allocation_strategy {
15936 #[allow(unused_imports)]
15937 use super::*;
15938 #[derive(Clone, Debug, PartialEq)]
15939 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15940 }
15941
15942 impl AllocationStrategy {
15943 /// Gets the enum value.
15944 ///
15945 /// Returns `None` if the enum contains an unknown value deserialized from
15946 /// the string representation of enums.
15947 pub fn value(&self) -> std::option::Option<i32> {
15948 match self {
15949 Self::Unspecified => std::option::Option::Some(0),
15950 Self::Random => std::option::Option::Some(1),
15951 Self::FirstAvailable => std::option::Option::Some(2),
15952 Self::RandomFirstNAvailable => std::option::Option::Some(3),
15953 Self::FirstSmallestFitting => std::option::Option::Some(4),
15954 Self::UnknownValue(u) => u.0.value(),
15955 }
15956 }
15957
15958 /// Gets the enum value as a string.
15959 ///
15960 /// Returns `None` if the enum contains an unknown value deserialized from
15961 /// the integer representation of enums.
15962 pub fn name(&self) -> std::option::Option<&str> {
15963 match self {
15964 Self::Unspecified => std::option::Option::Some("ALLOCATION_STRATEGY_UNSPECIFIED"),
15965 Self::Random => std::option::Option::Some("RANDOM"),
15966 Self::FirstAvailable => std::option::Option::Some("FIRST_AVAILABLE"),
15967 Self::RandomFirstNAvailable => {
15968 std::option::Option::Some("RANDOM_FIRST_N_AVAILABLE")
15969 }
15970 Self::FirstSmallestFitting => std::option::Option::Some("FIRST_SMALLEST_FITTING"),
15971 Self::UnknownValue(u) => u.0.name(),
15972 }
15973 }
15974 }
15975
15976 impl std::default::Default for AllocationStrategy {
15977 fn default() -> Self {
15978 use std::convert::From;
15979 Self::from(0)
15980 }
15981 }
15982
15983 impl std::fmt::Display for AllocationStrategy {
15984 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15985 wkt::internal::display_enum(f, self.name(), self.value())
15986 }
15987 }
15988
15989 impl std::convert::From<i32> for AllocationStrategy {
15990 fn from(value: i32) -> Self {
15991 match value {
15992 0 => Self::Unspecified,
15993 1 => Self::Random,
15994 2 => Self::FirstAvailable,
15995 3 => Self::RandomFirstNAvailable,
15996 4 => Self::FirstSmallestFitting,
15997 _ => Self::UnknownValue(allocation_strategy::UnknownValue(
15998 wkt::internal::UnknownEnumValue::Integer(value),
15999 )),
16000 }
16001 }
16002 }
16003
16004 impl std::convert::From<&str> for AllocationStrategy {
16005 fn from(value: &str) -> Self {
16006 use std::string::ToString;
16007 match value {
16008 "ALLOCATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
16009 "RANDOM" => Self::Random,
16010 "FIRST_AVAILABLE" => Self::FirstAvailable,
16011 "RANDOM_FIRST_N_AVAILABLE" => Self::RandomFirstNAvailable,
16012 "FIRST_SMALLEST_FITTING" => Self::FirstSmallestFitting,
16013 _ => Self::UnknownValue(allocation_strategy::UnknownValue(
16014 wkt::internal::UnknownEnumValue::String(value.to_string()),
16015 )),
16016 }
16017 }
16018 }
16019
16020 impl serde::ser::Serialize for AllocationStrategy {
16021 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16022 where
16023 S: serde::Serializer,
16024 {
16025 match self {
16026 Self::Unspecified => serializer.serialize_i32(0),
16027 Self::Random => serializer.serialize_i32(1),
16028 Self::FirstAvailable => serializer.serialize_i32(2),
16029 Self::RandomFirstNAvailable => serializer.serialize_i32(3),
16030 Self::FirstSmallestFitting => serializer.serialize_i32(4),
16031 Self::UnknownValue(u) => u.0.serialize(serializer),
16032 }
16033 }
16034 }
16035
16036 impl<'de> serde::de::Deserialize<'de> for AllocationStrategy {
16037 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16038 where
16039 D: serde::Deserializer<'de>,
16040 {
16041 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AllocationStrategy>::new(
16042 ".google.cloud.networkconnectivity.v1.InternalRange.AllocationStrategy",
16043 ))
16044 }
16045 }
16046}
16047
16048/// Request for InternalRangeService.ListInternalRanges
16049#[derive(Clone, Default, PartialEq)]
16050#[non_exhaustive]
16051pub struct ListInternalRangesRequest {
16052 /// Required. The parent resource's name.
16053 pub parent: std::string::String,
16054
16055 /// The maximum number of results per page that should be returned.
16056 pub page_size: i32,
16057
16058 /// The page token.
16059 pub page_token: std::string::String,
16060
16061 /// A filter expression that filters the results listed in the response.
16062 pub filter: std::string::String,
16063
16064 /// Sort the results by a certain order.
16065 pub order_by: std::string::String,
16066
16067 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16068}
16069
16070impl ListInternalRangesRequest {
16071 /// Creates a new default instance.
16072 pub fn new() -> Self {
16073 std::default::Default::default()
16074 }
16075
16076 /// Sets the value of [parent][crate::model::ListInternalRangesRequest::parent].
16077 ///
16078 /// # Example
16079 /// ```ignore,no_run
16080 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
16081 /// let x = ListInternalRangesRequest::new().set_parent("example");
16082 /// ```
16083 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16084 self.parent = v.into();
16085 self
16086 }
16087
16088 /// Sets the value of [page_size][crate::model::ListInternalRangesRequest::page_size].
16089 ///
16090 /// # Example
16091 /// ```ignore,no_run
16092 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
16093 /// let x = ListInternalRangesRequest::new().set_page_size(42);
16094 /// ```
16095 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16096 self.page_size = v.into();
16097 self
16098 }
16099
16100 /// Sets the value of [page_token][crate::model::ListInternalRangesRequest::page_token].
16101 ///
16102 /// # Example
16103 /// ```ignore,no_run
16104 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
16105 /// let x = ListInternalRangesRequest::new().set_page_token("example");
16106 /// ```
16107 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16108 self.page_token = v.into();
16109 self
16110 }
16111
16112 /// Sets the value of [filter][crate::model::ListInternalRangesRequest::filter].
16113 ///
16114 /// # Example
16115 /// ```ignore,no_run
16116 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
16117 /// let x = ListInternalRangesRequest::new().set_filter("example");
16118 /// ```
16119 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16120 self.filter = v.into();
16121 self
16122 }
16123
16124 /// Sets the value of [order_by][crate::model::ListInternalRangesRequest::order_by].
16125 ///
16126 /// # Example
16127 /// ```ignore,no_run
16128 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesRequest;
16129 /// let x = ListInternalRangesRequest::new().set_order_by("example");
16130 /// ```
16131 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16132 self.order_by = v.into();
16133 self
16134 }
16135}
16136
16137impl wkt::message::Message for ListInternalRangesRequest {
16138 fn typename() -> &'static str {
16139 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesRequest"
16140 }
16141}
16142
16143/// Response for InternalRange.ListInternalRanges
16144#[derive(Clone, Default, PartialEq)]
16145#[non_exhaustive]
16146pub struct ListInternalRangesResponse {
16147 /// Internal ranges to be returned.
16148 pub internal_ranges: std::vec::Vec<crate::model::InternalRange>,
16149
16150 /// The next pagination token in the List response. It should be used as
16151 /// page_token for the following request. An empty value means no more result.
16152 pub next_page_token: std::string::String,
16153
16154 /// Locations that could not be reached.
16155 pub unreachable: std::vec::Vec<std::string::String>,
16156
16157 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16158}
16159
16160impl ListInternalRangesResponse {
16161 /// Creates a new default instance.
16162 pub fn new() -> Self {
16163 std::default::Default::default()
16164 }
16165
16166 /// Sets the value of [internal_ranges][crate::model::ListInternalRangesResponse::internal_ranges].
16167 ///
16168 /// # Example
16169 /// ```ignore,no_run
16170 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
16171 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16172 /// let x = ListInternalRangesResponse::new()
16173 /// .set_internal_ranges([
16174 /// InternalRange::default()/* use setters */,
16175 /// InternalRange::default()/* use (different) setters */,
16176 /// ]);
16177 /// ```
16178 pub fn set_internal_ranges<T, V>(mut self, v: T) -> Self
16179 where
16180 T: std::iter::IntoIterator<Item = V>,
16181 V: std::convert::Into<crate::model::InternalRange>,
16182 {
16183 use std::iter::Iterator;
16184 self.internal_ranges = v.into_iter().map(|i| i.into()).collect();
16185 self
16186 }
16187
16188 /// Sets the value of [next_page_token][crate::model::ListInternalRangesResponse::next_page_token].
16189 ///
16190 /// # Example
16191 /// ```ignore,no_run
16192 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
16193 /// let x = ListInternalRangesResponse::new().set_next_page_token("example");
16194 /// ```
16195 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16196 self.next_page_token = v.into();
16197 self
16198 }
16199
16200 /// Sets the value of [unreachable][crate::model::ListInternalRangesResponse::unreachable].
16201 ///
16202 /// # Example
16203 /// ```ignore,no_run
16204 /// # use google_cloud_networkconnectivity_v1::model::ListInternalRangesResponse;
16205 /// let x = ListInternalRangesResponse::new().set_unreachable(["a", "b", "c"]);
16206 /// ```
16207 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
16208 where
16209 T: std::iter::IntoIterator<Item = V>,
16210 V: std::convert::Into<std::string::String>,
16211 {
16212 use std::iter::Iterator;
16213 self.unreachable = v.into_iter().map(|i| i.into()).collect();
16214 self
16215 }
16216}
16217
16218impl wkt::message::Message for ListInternalRangesResponse {
16219 fn typename() -> &'static str {
16220 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesResponse"
16221 }
16222}
16223
16224#[doc(hidden)]
16225impl google_cloud_gax::paginator::internal::PageableResponse for ListInternalRangesResponse {
16226 type PageItem = crate::model::InternalRange;
16227
16228 fn items(self) -> std::vec::Vec<Self::PageItem> {
16229 self.internal_ranges
16230 }
16231
16232 fn next_page_token(&self) -> std::string::String {
16233 use std::clone::Clone;
16234 self.next_page_token.clone()
16235 }
16236}
16237
16238/// Request for InternalRangeService.GetInternalRange
16239#[derive(Clone, Default, PartialEq)]
16240#[non_exhaustive]
16241pub struct GetInternalRangeRequest {
16242 /// Required. Name of the InternalRange to get.
16243 pub name: std::string::String,
16244
16245 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16246}
16247
16248impl GetInternalRangeRequest {
16249 /// Creates a new default instance.
16250 pub fn new() -> Self {
16251 std::default::Default::default()
16252 }
16253
16254 /// Sets the value of [name][crate::model::GetInternalRangeRequest::name].
16255 ///
16256 /// # Example
16257 /// ```ignore,no_run
16258 /// # use google_cloud_networkconnectivity_v1::model::GetInternalRangeRequest;
16259 /// # let project_id = "project_id";
16260 /// # let location_id = "location_id";
16261 /// # let internal_range_id = "internal_range_id";
16262 /// let x = GetInternalRangeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/internalRanges/{internal_range_id}"));
16263 /// ```
16264 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16265 self.name = v.into();
16266 self
16267 }
16268}
16269
16270impl wkt::message::Message for GetInternalRangeRequest {
16271 fn typename() -> &'static str {
16272 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetInternalRangeRequest"
16273 }
16274}
16275
16276/// Request for InternalRangeService.CreateInternalRange
16277#[derive(Clone, Default, PartialEq)]
16278#[non_exhaustive]
16279pub struct CreateInternalRangeRequest {
16280 /// Required. The parent resource's name of the internal range.
16281 pub parent: std::string::String,
16282
16283 /// Optional. Resource ID
16284 /// (i.e. 'foo' in '[...]/projects/p/locations/l/internalRanges/foo')
16285 /// See <https://google.aip.dev/122#resource-id-segments>
16286 /// Unique per location.
16287 pub internal_range_id: std::string::String,
16288
16289 /// Required. Initial values for a new internal range
16290 pub internal_range: std::option::Option<crate::model::InternalRange>,
16291
16292 /// Optional. An optional request ID to identify requests. Specify a unique
16293 /// request ID so that if you must retry your request, the server will know to
16294 /// ignore the request if it has already been completed. The server will
16295 /// guarantee that for at least 60 minutes since the first request.
16296 ///
16297 /// For example, consider a situation where you make an initial request and
16298 /// the request times out. If you make the request again with the same request
16299 /// ID, the server can check if original operation with the same request ID
16300 /// was received, and if so, will ignore the second request. This prevents
16301 /// clients from accidentally creating duplicate commitments.
16302 ///
16303 /// The request ID must be a valid UUID with the exception that zero UUID is
16304 /// not supported (00000000-0000-0000-0000-000000000000).
16305 pub request_id: std::string::String,
16306
16307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16308}
16309
16310impl CreateInternalRangeRequest {
16311 /// Creates a new default instance.
16312 pub fn new() -> Self {
16313 std::default::Default::default()
16314 }
16315
16316 /// Sets the value of [parent][crate::model::CreateInternalRangeRequest::parent].
16317 ///
16318 /// # Example
16319 /// ```ignore,no_run
16320 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16321 /// # let project_id = "project_id";
16322 /// # let location_id = "location_id";
16323 /// let x = CreateInternalRangeRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
16324 /// ```
16325 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16326 self.parent = v.into();
16327 self
16328 }
16329
16330 /// Sets the value of [internal_range_id][crate::model::CreateInternalRangeRequest::internal_range_id].
16331 ///
16332 /// # Example
16333 /// ```ignore,no_run
16334 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16335 /// let x = CreateInternalRangeRequest::new().set_internal_range_id("example");
16336 /// ```
16337 pub fn set_internal_range_id<T: std::convert::Into<std::string::String>>(
16338 mut self,
16339 v: T,
16340 ) -> Self {
16341 self.internal_range_id = v.into();
16342 self
16343 }
16344
16345 /// Sets the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
16346 ///
16347 /// # Example
16348 /// ```ignore,no_run
16349 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16350 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16351 /// let x = CreateInternalRangeRequest::new().set_internal_range(InternalRange::default()/* use setters */);
16352 /// ```
16353 pub fn set_internal_range<T>(mut self, v: T) -> Self
16354 where
16355 T: std::convert::Into<crate::model::InternalRange>,
16356 {
16357 self.internal_range = std::option::Option::Some(v.into());
16358 self
16359 }
16360
16361 /// Sets or clears the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
16362 ///
16363 /// # Example
16364 /// ```ignore,no_run
16365 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16366 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16367 /// let x = CreateInternalRangeRequest::new().set_or_clear_internal_range(Some(InternalRange::default()/* use setters */));
16368 /// let x = CreateInternalRangeRequest::new().set_or_clear_internal_range(None::<InternalRange>);
16369 /// ```
16370 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
16371 where
16372 T: std::convert::Into<crate::model::InternalRange>,
16373 {
16374 self.internal_range = v.map(|x| x.into());
16375 self
16376 }
16377
16378 /// Sets the value of [request_id][crate::model::CreateInternalRangeRequest::request_id].
16379 ///
16380 /// # Example
16381 /// ```ignore,no_run
16382 /// # use google_cloud_networkconnectivity_v1::model::CreateInternalRangeRequest;
16383 /// let x = CreateInternalRangeRequest::new().set_request_id("example");
16384 /// ```
16385 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16386 self.request_id = v.into();
16387 self
16388 }
16389}
16390
16391impl wkt::message::Message for CreateInternalRangeRequest {
16392 fn typename() -> &'static str {
16393 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateInternalRangeRequest"
16394 }
16395}
16396
16397/// Request for InternalRangeService.UpdateInternalRange
16398#[derive(Clone, Default, PartialEq)]
16399#[non_exhaustive]
16400pub struct UpdateInternalRangeRequest {
16401 /// Optional. Field mask is used to specify the fields to be overwritten in the
16402 /// InternalRange resource by the update.
16403 /// The fields specified in the update_mask are relative to the resource, not
16404 /// the full request. A field will be overwritten if it is in the mask. If the
16405 /// user does not provide a mask then all fields will be overwritten.
16406 pub update_mask: std::option::Option<wkt::FieldMask>,
16407
16408 /// Required. New values to be patched into the resource.
16409 pub internal_range: std::option::Option<crate::model::InternalRange>,
16410
16411 /// Optional. An optional request ID to identify requests. Specify a unique
16412 /// request ID so that if you must retry your request, the server will know to
16413 /// ignore the request if it has already been completed. The server will
16414 /// guarantee that for at least 60 minutes since the first request.
16415 ///
16416 /// For example, consider a situation where you make an initial request and
16417 /// the request times out. If you make the request again with the same request
16418 /// ID, the server can check if original operation with the same request ID
16419 /// was received, and if so, will ignore the second request. This prevents
16420 /// clients from accidentally creating duplicate commitments.
16421 ///
16422 /// The request ID must be a valid UUID with the exception that zero UUID is
16423 /// not supported (00000000-0000-0000-0000-000000000000).
16424 pub request_id: std::string::String,
16425
16426 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16427}
16428
16429impl UpdateInternalRangeRequest {
16430 /// Creates a new default instance.
16431 pub fn new() -> Self {
16432 std::default::Default::default()
16433 }
16434
16435 /// Sets the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
16436 ///
16437 /// # Example
16438 /// ```ignore,no_run
16439 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16440 /// use wkt::FieldMask;
16441 /// let x = UpdateInternalRangeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
16442 /// ```
16443 pub fn set_update_mask<T>(mut self, v: T) -> Self
16444 where
16445 T: std::convert::Into<wkt::FieldMask>,
16446 {
16447 self.update_mask = std::option::Option::Some(v.into());
16448 self
16449 }
16450
16451 /// Sets or clears the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
16452 ///
16453 /// # Example
16454 /// ```ignore,no_run
16455 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16456 /// use wkt::FieldMask;
16457 /// let x = UpdateInternalRangeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
16458 /// let x = UpdateInternalRangeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
16459 /// ```
16460 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16461 where
16462 T: std::convert::Into<wkt::FieldMask>,
16463 {
16464 self.update_mask = v.map(|x| x.into());
16465 self
16466 }
16467
16468 /// Sets the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
16469 ///
16470 /// # Example
16471 /// ```ignore,no_run
16472 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16473 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16474 /// let x = UpdateInternalRangeRequest::new().set_internal_range(InternalRange::default()/* use setters */);
16475 /// ```
16476 pub fn set_internal_range<T>(mut self, v: T) -> Self
16477 where
16478 T: std::convert::Into<crate::model::InternalRange>,
16479 {
16480 self.internal_range = std::option::Option::Some(v.into());
16481 self
16482 }
16483
16484 /// Sets or clears the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
16485 ///
16486 /// # Example
16487 /// ```ignore,no_run
16488 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16489 /// use google_cloud_networkconnectivity_v1::model::InternalRange;
16490 /// let x = UpdateInternalRangeRequest::new().set_or_clear_internal_range(Some(InternalRange::default()/* use setters */));
16491 /// let x = UpdateInternalRangeRequest::new().set_or_clear_internal_range(None::<InternalRange>);
16492 /// ```
16493 pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
16494 where
16495 T: std::convert::Into<crate::model::InternalRange>,
16496 {
16497 self.internal_range = v.map(|x| x.into());
16498 self
16499 }
16500
16501 /// Sets the value of [request_id][crate::model::UpdateInternalRangeRequest::request_id].
16502 ///
16503 /// # Example
16504 /// ```ignore,no_run
16505 /// # use google_cloud_networkconnectivity_v1::model::UpdateInternalRangeRequest;
16506 /// let x = UpdateInternalRangeRequest::new().set_request_id("example");
16507 /// ```
16508 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16509 self.request_id = v.into();
16510 self
16511 }
16512}
16513
16514impl wkt::message::Message for UpdateInternalRangeRequest {
16515 fn typename() -> &'static str {
16516 "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateInternalRangeRequest"
16517 }
16518}
16519
16520/// Request for InternalRangeService.DeleteInternalRange
16521#[derive(Clone, Default, PartialEq)]
16522#[non_exhaustive]
16523pub struct DeleteInternalRangeRequest {
16524 /// Required. The name of the internal range to delete.
16525 pub name: std::string::String,
16526
16527 /// Optional. An optional request ID to identify requests. Specify a unique
16528 /// request ID so that if you must retry your request, the server will know to
16529 /// ignore the request if it has already been completed. The server will
16530 /// guarantee that for at least 60 minutes after the first request.
16531 ///
16532 /// For example, consider a situation where you make an initial request and
16533 /// the request times out. If you make the request again with the same request
16534 /// ID, the server can check if original operation with the same request ID
16535 /// was received, and if so, will ignore the second request. This prevents
16536 /// clients from accidentally creating duplicate commitments.
16537 ///
16538 /// The request ID must be a valid UUID with the exception that zero UUID is
16539 /// not supported (00000000-0000-0000-0000-000000000000).
16540 pub request_id: std::string::String,
16541
16542 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16543}
16544
16545impl DeleteInternalRangeRequest {
16546 /// Creates a new default instance.
16547 pub fn new() -> Self {
16548 std::default::Default::default()
16549 }
16550
16551 /// Sets the value of [name][crate::model::DeleteInternalRangeRequest::name].
16552 ///
16553 /// # Example
16554 /// ```ignore,no_run
16555 /// # use google_cloud_networkconnectivity_v1::model::DeleteInternalRangeRequest;
16556 /// # let project_id = "project_id";
16557 /// # let location_id = "location_id";
16558 /// # let internal_range_id = "internal_range_id";
16559 /// let x = DeleteInternalRangeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/internalRanges/{internal_range_id}"));
16560 /// ```
16561 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16562 self.name = v.into();
16563 self
16564 }
16565
16566 /// Sets the value of [request_id][crate::model::DeleteInternalRangeRequest::request_id].
16567 ///
16568 /// # Example
16569 /// ```ignore,no_run
16570 /// # use google_cloud_networkconnectivity_v1::model::DeleteInternalRangeRequest;
16571 /// let x = DeleteInternalRangeRequest::new().set_request_id("example");
16572 /// ```
16573 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16574 self.request_id = v.into();
16575 self
16576 }
16577}
16578
16579impl wkt::message::Message for DeleteInternalRangeRequest {
16580 fn typename() -> &'static str {
16581 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteInternalRangeRequest"
16582 }
16583}
16584
16585/// Policy-based routes route L4 network traffic based on not just destination IP
16586/// address, but also source IP address, protocol, and more. If a policy-based
16587/// route conflicts with other types of routes, the policy-based route always
16588/// takes precedence.
16589#[derive(Clone, Default, PartialEq)]
16590#[non_exhaustive]
16591pub struct PolicyBasedRoute {
16592 /// Immutable. A unique name of the resource in the form of
16593 /// `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
16594 pub name: std::string::String,
16595
16596 /// Output only. Time when the policy-based route was created.
16597 pub create_time: std::option::Option<wkt::Timestamp>,
16598
16599 /// Output only. Time when the policy-based route was updated.
16600 pub update_time: std::option::Option<wkt::Timestamp>,
16601
16602 /// User-defined labels.
16603 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16604
16605 /// Optional. An optional description of this resource. Provide this field when
16606 /// you create the resource.
16607 pub description: std::string::String,
16608
16609 /// Required. Fully-qualified URL of the network that this route applies to,
16610 /// for example: projects/my-project/global/networks/my-network.
16611 pub network: std::string::String,
16612
16613 /// Required. The filter to match L4 traffic.
16614 pub filter: std::option::Option<crate::model::policy_based_route::Filter>,
16615
16616 /// Optional. The priority of this policy-based route. Priority is used to
16617 /// break ties in cases where there are more than one matching policy-based
16618 /// routes found. In cases where multiple policy-based routes are matched, the
16619 /// one with the lowest-numbered priority value wins. The default value is
16620 /// 1000. The priority value must be from 1 to 65535, inclusive.
16621 pub priority: i32,
16622
16623 /// Output only. If potential misconfigurations are detected for this route,
16624 /// this field will be populated with warning messages.
16625 pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,
16626
16627 /// Output only. Server-defined fully-qualified URL for this resource.
16628 pub self_link: std::string::String,
16629
16630 /// Output only. Type of this resource. Always
16631 /// networkconnectivity#policyBasedRoute for policy-based Route resources.
16632 pub kind: std::string::String,
16633
16634 /// Target specifies network endpoints that this policy-based route applies to.
16635 /// If no target is specified, the PBR will be installed on all network
16636 /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
16637 pub target: std::option::Option<crate::model::policy_based_route::Target>,
16638
16639 #[allow(missing_docs)]
16640 pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,
16641
16642 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16643}
16644
16645impl PolicyBasedRoute {
16646 /// Creates a new default instance.
16647 pub fn new() -> Self {
16648 std::default::Default::default()
16649 }
16650
16651 /// Sets the value of [name][crate::model::PolicyBasedRoute::name].
16652 ///
16653 /// # Example
16654 /// ```ignore,no_run
16655 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16656 /// # let project_id = "project_id";
16657 /// # let policy_based_route_id = "policy_based_route_id";
16658 /// let x = PolicyBasedRoute::new().set_name(format!("projects/{project_id}/locations/global/PolicyBasedRoutes/{policy_based_route_id}"));
16659 /// ```
16660 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16661 self.name = v.into();
16662 self
16663 }
16664
16665 /// Sets the value of [create_time][crate::model::PolicyBasedRoute::create_time].
16666 ///
16667 /// # Example
16668 /// ```ignore,no_run
16669 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16670 /// use wkt::Timestamp;
16671 /// let x = PolicyBasedRoute::new().set_create_time(Timestamp::default()/* use setters */);
16672 /// ```
16673 pub fn set_create_time<T>(mut self, v: T) -> Self
16674 where
16675 T: std::convert::Into<wkt::Timestamp>,
16676 {
16677 self.create_time = std::option::Option::Some(v.into());
16678 self
16679 }
16680
16681 /// Sets or clears the value of [create_time][crate::model::PolicyBasedRoute::create_time].
16682 ///
16683 /// # Example
16684 /// ```ignore,no_run
16685 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16686 /// use wkt::Timestamp;
16687 /// let x = PolicyBasedRoute::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16688 /// let x = PolicyBasedRoute::new().set_or_clear_create_time(None::<Timestamp>);
16689 /// ```
16690 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16691 where
16692 T: std::convert::Into<wkt::Timestamp>,
16693 {
16694 self.create_time = v.map(|x| x.into());
16695 self
16696 }
16697
16698 /// Sets the value of [update_time][crate::model::PolicyBasedRoute::update_time].
16699 ///
16700 /// # Example
16701 /// ```ignore,no_run
16702 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16703 /// use wkt::Timestamp;
16704 /// let x = PolicyBasedRoute::new().set_update_time(Timestamp::default()/* use setters */);
16705 /// ```
16706 pub fn set_update_time<T>(mut self, v: T) -> Self
16707 where
16708 T: std::convert::Into<wkt::Timestamp>,
16709 {
16710 self.update_time = std::option::Option::Some(v.into());
16711 self
16712 }
16713
16714 /// Sets or clears the value of [update_time][crate::model::PolicyBasedRoute::update_time].
16715 ///
16716 /// # Example
16717 /// ```ignore,no_run
16718 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16719 /// use wkt::Timestamp;
16720 /// let x = PolicyBasedRoute::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16721 /// let x = PolicyBasedRoute::new().set_or_clear_update_time(None::<Timestamp>);
16722 /// ```
16723 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16724 where
16725 T: std::convert::Into<wkt::Timestamp>,
16726 {
16727 self.update_time = v.map(|x| x.into());
16728 self
16729 }
16730
16731 /// Sets the value of [labels][crate::model::PolicyBasedRoute::labels].
16732 ///
16733 /// # Example
16734 /// ```ignore,no_run
16735 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16736 /// let x = PolicyBasedRoute::new().set_labels([
16737 /// ("key0", "abc"),
16738 /// ("key1", "xyz"),
16739 /// ]);
16740 /// ```
16741 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16742 where
16743 T: std::iter::IntoIterator<Item = (K, V)>,
16744 K: std::convert::Into<std::string::String>,
16745 V: std::convert::Into<std::string::String>,
16746 {
16747 use std::iter::Iterator;
16748 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16749 self
16750 }
16751
16752 /// Sets the value of [description][crate::model::PolicyBasedRoute::description].
16753 ///
16754 /// # Example
16755 /// ```ignore,no_run
16756 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16757 /// let x = PolicyBasedRoute::new().set_description("example");
16758 /// ```
16759 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16760 self.description = v.into();
16761 self
16762 }
16763
16764 /// Sets the value of [network][crate::model::PolicyBasedRoute::network].
16765 ///
16766 /// # Example
16767 /// ```ignore,no_run
16768 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16769 /// let x = PolicyBasedRoute::new().set_network("example");
16770 /// ```
16771 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16772 self.network = v.into();
16773 self
16774 }
16775
16776 /// Sets the value of [filter][crate::model::PolicyBasedRoute::filter].
16777 ///
16778 /// # Example
16779 /// ```ignore,no_run
16780 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16781 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16782 /// let x = PolicyBasedRoute::new().set_filter(Filter::default()/* use setters */);
16783 /// ```
16784 pub fn set_filter<T>(mut self, v: T) -> Self
16785 where
16786 T: std::convert::Into<crate::model::policy_based_route::Filter>,
16787 {
16788 self.filter = std::option::Option::Some(v.into());
16789 self
16790 }
16791
16792 /// Sets or clears the value of [filter][crate::model::PolicyBasedRoute::filter].
16793 ///
16794 /// # Example
16795 /// ```ignore,no_run
16796 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16797 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
16798 /// let x = PolicyBasedRoute::new().set_or_clear_filter(Some(Filter::default()/* use setters */));
16799 /// let x = PolicyBasedRoute::new().set_or_clear_filter(None::<Filter>);
16800 /// ```
16801 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
16802 where
16803 T: std::convert::Into<crate::model::policy_based_route::Filter>,
16804 {
16805 self.filter = v.map(|x| x.into());
16806 self
16807 }
16808
16809 /// Sets the value of [priority][crate::model::PolicyBasedRoute::priority].
16810 ///
16811 /// # Example
16812 /// ```ignore,no_run
16813 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16814 /// let x = PolicyBasedRoute::new().set_priority(42);
16815 /// ```
16816 pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16817 self.priority = v.into();
16818 self
16819 }
16820
16821 /// Sets the value of [warnings][crate::model::PolicyBasedRoute::warnings].
16822 ///
16823 /// # Example
16824 /// ```ignore,no_run
16825 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16826 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
16827 /// let x = PolicyBasedRoute::new()
16828 /// .set_warnings([
16829 /// Warnings::default()/* use setters */,
16830 /// Warnings::default()/* use (different) setters */,
16831 /// ]);
16832 /// ```
16833 pub fn set_warnings<T, V>(mut self, v: T) -> Self
16834 where
16835 T: std::iter::IntoIterator<Item = V>,
16836 V: std::convert::Into<crate::model::policy_based_route::Warnings>,
16837 {
16838 use std::iter::Iterator;
16839 self.warnings = v.into_iter().map(|i| i.into()).collect();
16840 self
16841 }
16842
16843 /// Sets the value of [self_link][crate::model::PolicyBasedRoute::self_link].
16844 ///
16845 /// # Example
16846 /// ```ignore,no_run
16847 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16848 /// let x = PolicyBasedRoute::new().set_self_link("example");
16849 /// ```
16850 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16851 self.self_link = v.into();
16852 self
16853 }
16854
16855 /// Sets the value of [kind][crate::model::PolicyBasedRoute::kind].
16856 ///
16857 /// # Example
16858 /// ```ignore,no_run
16859 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16860 /// let x = PolicyBasedRoute::new().set_kind("example");
16861 /// ```
16862 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16863 self.kind = v.into();
16864 self
16865 }
16866
16867 /// Sets the value of [target][crate::model::PolicyBasedRoute::target].
16868 ///
16869 /// Note that all the setters affecting `target` are mutually
16870 /// exclusive.
16871 ///
16872 /// # Example
16873 /// ```ignore,no_run
16874 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16875 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16876 /// let x = PolicyBasedRoute::new().set_target(Some(
16877 /// google_cloud_networkconnectivity_v1::model::policy_based_route::Target::VirtualMachine(VirtualMachine::default().into())));
16878 /// ```
16879 pub fn set_target<
16880 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
16881 >(
16882 mut self,
16883 v: T,
16884 ) -> Self {
16885 self.target = v.into();
16886 self
16887 }
16888
16889 /// The value of [target][crate::model::PolicyBasedRoute::target]
16890 /// if it holds a `VirtualMachine`, `None` if the field is not set or
16891 /// holds a different branch.
16892 pub fn virtual_machine(
16893 &self,
16894 ) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
16895 {
16896 #[allow(unreachable_patterns)]
16897 self.target.as_ref().and_then(|v| match v {
16898 crate::model::policy_based_route::Target::VirtualMachine(v) => {
16899 std::option::Option::Some(v)
16900 }
16901 _ => std::option::Option::None,
16902 })
16903 }
16904
16905 /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
16906 /// to hold a `VirtualMachine`.
16907 ///
16908 /// Note that all the setters affecting `target` are
16909 /// mutually exclusive.
16910 ///
16911 /// # Example
16912 /// ```ignore,no_run
16913 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16914 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
16915 /// let x = PolicyBasedRoute::new().set_virtual_machine(VirtualMachine::default()/* use setters */);
16916 /// assert!(x.virtual_machine().is_some());
16917 /// assert!(x.interconnect_attachment().is_none());
16918 /// ```
16919 pub fn set_virtual_machine<
16920 T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
16921 >(
16922 mut self,
16923 v: T,
16924 ) -> Self {
16925 self.target = std::option::Option::Some(
16926 crate::model::policy_based_route::Target::VirtualMachine(v.into()),
16927 );
16928 self
16929 }
16930
16931 /// The value of [target][crate::model::PolicyBasedRoute::target]
16932 /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
16933 /// holds a different branch.
16934 pub fn interconnect_attachment(
16935 &self,
16936 ) -> std::option::Option<
16937 &std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
16938 > {
16939 #[allow(unreachable_patterns)]
16940 self.target.as_ref().and_then(|v| match v {
16941 crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
16942 std::option::Option::Some(v)
16943 }
16944 _ => std::option::Option::None,
16945 })
16946 }
16947
16948 /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
16949 /// to hold a `InterconnectAttachment`.
16950 ///
16951 /// Note that all the setters affecting `target` are
16952 /// mutually exclusive.
16953 ///
16954 /// # Example
16955 /// ```ignore,no_run
16956 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16957 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::InterconnectAttachment;
16958 /// let x = PolicyBasedRoute::new().set_interconnect_attachment(InterconnectAttachment::default()/* use setters */);
16959 /// assert!(x.interconnect_attachment().is_some());
16960 /// assert!(x.virtual_machine().is_none());
16961 /// ```
16962 pub fn set_interconnect_attachment<
16963 T: std::convert::Into<
16964 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
16965 >,
16966 >(
16967 mut self,
16968 v: T,
16969 ) -> Self {
16970 self.target = std::option::Option::Some(
16971 crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
16972 );
16973 self
16974 }
16975
16976 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop].
16977 ///
16978 /// Note that all the setters affecting `next_hop` are mutually
16979 /// exclusive.
16980 ///
16981 /// # Example
16982 /// ```ignore,no_run
16983 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
16984 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::NextHop;
16985 /// let x = PolicyBasedRoute::new().set_next_hop(Some(NextHop::NextHopIlbIp("example".to_string())));
16986 /// ```
16987 pub fn set_next_hop<
16988 T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
16989 >(
16990 mut self,
16991 v: T,
16992 ) -> Self {
16993 self.next_hop = v.into();
16994 self
16995 }
16996
16997 /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
16998 /// if it holds a `NextHopIlbIp`, `None` if the field is not set or
16999 /// holds a different branch.
17000 pub fn next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
17001 #[allow(unreachable_patterns)]
17002 self.next_hop.as_ref().and_then(|v| match v {
17003 crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
17004 std::option::Option::Some(v)
17005 }
17006 _ => std::option::Option::None,
17007 })
17008 }
17009
17010 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
17011 /// to hold a `NextHopIlbIp`.
17012 ///
17013 /// Note that all the setters affecting `next_hop` are
17014 /// mutually exclusive.
17015 ///
17016 /// # Example
17017 /// ```ignore,no_run
17018 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17019 /// let x = PolicyBasedRoute::new().set_next_hop_ilb_ip("example");
17020 /// assert!(x.next_hop_ilb_ip().is_some());
17021 /// assert!(x.next_hop_other_routes().is_none());
17022 /// ```
17023 pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17024 self.next_hop = std::option::Option::Some(
17025 crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
17026 );
17027 self
17028 }
17029
17030 /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
17031 /// if it holds a `NextHopOtherRoutes`, `None` if the field is not set or
17032 /// holds a different branch.
17033 pub fn next_hop_other_routes(
17034 &self,
17035 ) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
17036 #[allow(unreachable_patterns)]
17037 self.next_hop.as_ref().and_then(|v| match v {
17038 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
17039 std::option::Option::Some(v)
17040 }
17041 _ => std::option::Option::None,
17042 })
17043 }
17044
17045 /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
17046 /// to hold a `NextHopOtherRoutes`.
17047 ///
17048 /// Note that all the setters affecting `next_hop` are
17049 /// mutually exclusive.
17050 ///
17051 /// # Example
17052 /// ```ignore,no_run
17053 /// # use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17054 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::OtherRoutes;
17055 /// let x0 = PolicyBasedRoute::new().set_next_hop_other_routes(OtherRoutes::DefaultRouting);
17056 /// assert!(x0.next_hop_other_routes().is_some());
17057 /// assert!(x0.next_hop_ilb_ip().is_none());
17058 /// ```
17059 pub fn set_next_hop_other_routes<
17060 T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
17061 >(
17062 mut self,
17063 v: T,
17064 ) -> Self {
17065 self.next_hop = std::option::Option::Some(
17066 crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
17067 );
17068 self
17069 }
17070}
17071
17072impl wkt::message::Message for PolicyBasedRoute {
17073 fn typename() -> &'static str {
17074 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
17075 }
17076}
17077
17078/// Defines additional types related to [PolicyBasedRoute].
17079pub mod policy_based_route {
17080 #[allow(unused_imports)]
17081 use super::*;
17082
17083 /// VM instances that this policy-based route applies to.
17084 #[derive(Clone, Default, PartialEq)]
17085 #[non_exhaustive]
17086 pub struct VirtualMachine {
17087 /// Optional. A list of VM instance tags that this policy-based route applies
17088 /// to. VM instances that have ANY of tags specified here installs this PBR.
17089 pub tags: std::vec::Vec<std::string::String>,
17090
17091 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17092 }
17093
17094 impl VirtualMachine {
17095 /// Creates a new default instance.
17096 pub fn new() -> Self {
17097 std::default::Default::default()
17098 }
17099
17100 /// Sets the value of [tags][crate::model::policy_based_route::VirtualMachine::tags].
17101 ///
17102 /// # Example
17103 /// ```ignore,no_run
17104 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::VirtualMachine;
17105 /// let x = VirtualMachine::new().set_tags(["a", "b", "c"]);
17106 /// ```
17107 pub fn set_tags<T, V>(mut self, v: T) -> Self
17108 where
17109 T: std::iter::IntoIterator<Item = V>,
17110 V: std::convert::Into<std::string::String>,
17111 {
17112 use std::iter::Iterator;
17113 self.tags = v.into_iter().map(|i| i.into()).collect();
17114 self
17115 }
17116 }
17117
17118 impl wkt::message::Message for VirtualMachine {
17119 fn typename() -> &'static str {
17120 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
17121 }
17122 }
17123
17124 /// InterconnectAttachment that this route applies to.
17125 #[derive(Clone, Default, PartialEq)]
17126 #[non_exhaustive]
17127 pub struct InterconnectAttachment {
17128 /// Optional. Cloud region to install this policy-based route on interconnect
17129 /// attachment. Use `all` to install it on all interconnect attachments.
17130 pub region: std::string::String,
17131
17132 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17133 }
17134
17135 impl InterconnectAttachment {
17136 /// Creates a new default instance.
17137 pub fn new() -> Self {
17138 std::default::Default::default()
17139 }
17140
17141 /// Sets the value of [region][crate::model::policy_based_route::InterconnectAttachment::region].
17142 ///
17143 /// # Example
17144 /// ```ignore,no_run
17145 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::InterconnectAttachment;
17146 /// let x = InterconnectAttachment::new().set_region("example");
17147 /// ```
17148 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17149 self.region = v.into();
17150 self
17151 }
17152 }
17153
17154 impl wkt::message::Message for InterconnectAttachment {
17155 fn typename() -> &'static str {
17156 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
17157 }
17158 }
17159
17160 /// Filter matches L4 traffic.
17161 #[derive(Clone, Default, PartialEq)]
17162 #[non_exhaustive]
17163 pub struct Filter {
17164 /// Optional. The IP protocol that this policy-based route applies to. Valid
17165 /// values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
17166 pub ip_protocol: std::string::String,
17167
17168 /// Optional. The source IP range of outgoing packets that this policy-based
17169 /// route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
17170 pub src_range: std::string::String,
17171
17172 /// Optional. The destination IP range of outgoing packets that this
17173 /// policy-based route applies to. Default is "0.0.0.0/0" if protocol version
17174 /// is IPv4.
17175 pub dest_range: std::string::String,
17176
17177 /// Required. Internet protocol versions this policy-based route applies to.
17178 /// For this version, only IPV4 is supported. IPV6 is supported in preview.
17179 pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,
17180
17181 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17182 }
17183
17184 impl Filter {
17185 /// Creates a new default instance.
17186 pub fn new() -> Self {
17187 std::default::Default::default()
17188 }
17189
17190 /// Sets the value of [ip_protocol][crate::model::policy_based_route::Filter::ip_protocol].
17191 ///
17192 /// # Example
17193 /// ```ignore,no_run
17194 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
17195 /// let x = Filter::new().set_ip_protocol("example");
17196 /// ```
17197 pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17198 self.ip_protocol = v.into();
17199 self
17200 }
17201
17202 /// Sets the value of [src_range][crate::model::policy_based_route::Filter::src_range].
17203 ///
17204 /// # Example
17205 /// ```ignore,no_run
17206 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
17207 /// let x = Filter::new().set_src_range("example");
17208 /// ```
17209 pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17210 self.src_range = v.into();
17211 self
17212 }
17213
17214 /// Sets the value of [dest_range][crate::model::policy_based_route::Filter::dest_range].
17215 ///
17216 /// # Example
17217 /// ```ignore,no_run
17218 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
17219 /// let x = Filter::new().set_dest_range("example");
17220 /// ```
17221 pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17222 self.dest_range = v.into();
17223 self
17224 }
17225
17226 /// Sets the value of [protocol_version][crate::model::policy_based_route::Filter::protocol_version].
17227 ///
17228 /// # Example
17229 /// ```ignore,no_run
17230 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Filter;
17231 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::filter::ProtocolVersion;
17232 /// let x0 = Filter::new().set_protocol_version(ProtocolVersion::Ipv4);
17233 /// ```
17234 pub fn set_protocol_version<
17235 T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
17236 >(
17237 mut self,
17238 v: T,
17239 ) -> Self {
17240 self.protocol_version = v.into();
17241 self
17242 }
17243 }
17244
17245 impl wkt::message::Message for Filter {
17246 fn typename() -> &'static str {
17247 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
17248 }
17249 }
17250
17251 /// Defines additional types related to [Filter].
17252 pub mod filter {
17253 #[allow(unused_imports)]
17254 use super::*;
17255
17256 /// The internet protocol version.
17257 ///
17258 /// # Working with unknown values
17259 ///
17260 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17261 /// additional enum variants at any time. Adding new variants is not considered
17262 /// a breaking change. Applications should write their code in anticipation of:
17263 ///
17264 /// - New values appearing in future releases of the client library, **and**
17265 /// - New values received dynamically, without application changes.
17266 ///
17267 /// Please consult the [Working with enums] section in the user guide for some
17268 /// guidelines.
17269 ///
17270 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17271 #[derive(Clone, Debug, PartialEq)]
17272 #[non_exhaustive]
17273 pub enum ProtocolVersion {
17274 /// Default value.
17275 Unspecified,
17276 /// The PBR is for IPv4 internet protocol traffic.
17277 Ipv4,
17278 /// If set, the enum was initialized with an unknown value.
17279 ///
17280 /// Applications can examine the value using [ProtocolVersion::value] or
17281 /// [ProtocolVersion::name].
17282 UnknownValue(protocol_version::UnknownValue),
17283 }
17284
17285 #[doc(hidden)]
17286 pub mod protocol_version {
17287 #[allow(unused_imports)]
17288 use super::*;
17289 #[derive(Clone, Debug, PartialEq)]
17290 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17291 }
17292
17293 impl ProtocolVersion {
17294 /// Gets the enum value.
17295 ///
17296 /// Returns `None` if the enum contains an unknown value deserialized from
17297 /// the string representation of enums.
17298 pub fn value(&self) -> std::option::Option<i32> {
17299 match self {
17300 Self::Unspecified => std::option::Option::Some(0),
17301 Self::Ipv4 => std::option::Option::Some(1),
17302 Self::UnknownValue(u) => u.0.value(),
17303 }
17304 }
17305
17306 /// Gets the enum value as a string.
17307 ///
17308 /// Returns `None` if the enum contains an unknown value deserialized from
17309 /// the integer representation of enums.
17310 pub fn name(&self) -> std::option::Option<&str> {
17311 match self {
17312 Self::Unspecified => std::option::Option::Some("PROTOCOL_VERSION_UNSPECIFIED"),
17313 Self::Ipv4 => std::option::Option::Some("IPV4"),
17314 Self::UnknownValue(u) => u.0.name(),
17315 }
17316 }
17317 }
17318
17319 impl std::default::Default for ProtocolVersion {
17320 fn default() -> Self {
17321 use std::convert::From;
17322 Self::from(0)
17323 }
17324 }
17325
17326 impl std::fmt::Display for ProtocolVersion {
17327 fn fmt(
17328 &self,
17329 f: &mut std::fmt::Formatter<'_>,
17330 ) -> std::result::Result<(), std::fmt::Error> {
17331 wkt::internal::display_enum(f, self.name(), self.value())
17332 }
17333 }
17334
17335 impl std::convert::From<i32> for ProtocolVersion {
17336 fn from(value: i32) -> Self {
17337 match value {
17338 0 => Self::Unspecified,
17339 1 => Self::Ipv4,
17340 _ => Self::UnknownValue(protocol_version::UnknownValue(
17341 wkt::internal::UnknownEnumValue::Integer(value),
17342 )),
17343 }
17344 }
17345 }
17346
17347 impl std::convert::From<&str> for ProtocolVersion {
17348 fn from(value: &str) -> Self {
17349 use std::string::ToString;
17350 match value {
17351 "PROTOCOL_VERSION_UNSPECIFIED" => Self::Unspecified,
17352 "IPV4" => Self::Ipv4,
17353 _ => Self::UnknownValue(protocol_version::UnknownValue(
17354 wkt::internal::UnknownEnumValue::String(value.to_string()),
17355 )),
17356 }
17357 }
17358 }
17359
17360 impl serde::ser::Serialize for ProtocolVersion {
17361 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17362 where
17363 S: serde::Serializer,
17364 {
17365 match self {
17366 Self::Unspecified => serializer.serialize_i32(0),
17367 Self::Ipv4 => serializer.serialize_i32(1),
17368 Self::UnknownValue(u) => u.0.serialize(serializer),
17369 }
17370 }
17371 }
17372
17373 impl<'de> serde::de::Deserialize<'de> for ProtocolVersion {
17374 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17375 where
17376 D: serde::Deserializer<'de>,
17377 {
17378 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProtocolVersion>::new(
17379 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion",
17380 ))
17381 }
17382 }
17383 }
17384
17385 /// Informational warning message.
17386 #[derive(Clone, Default, PartialEq)]
17387 #[non_exhaustive]
17388 pub struct Warnings {
17389 /// Output only. A warning code, if applicable.
17390 pub code: crate::model::policy_based_route::warnings::Code,
17391
17392 /// Output only. Metadata about this warning in key: value format. The key
17393 /// should provides more detail on the warning being returned. For example,
17394 /// for warnings where there are no results in a list request for a
17395 /// particular zone, this key might be scope and the key value might be the
17396 /// zone name. Other examples might be a key indicating a deprecated resource
17397 /// and a suggested replacement.
17398 pub data: std::collections::HashMap<std::string::String, std::string::String>,
17399
17400 /// Output only. A human-readable description of the warning code.
17401 pub warning_message: std::string::String,
17402
17403 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17404 }
17405
17406 impl Warnings {
17407 /// Creates a new default instance.
17408 pub fn new() -> Self {
17409 std::default::Default::default()
17410 }
17411
17412 /// Sets the value of [code][crate::model::policy_based_route::Warnings::code].
17413 ///
17414 /// # Example
17415 /// ```ignore,no_run
17416 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17417 /// use google_cloud_networkconnectivity_v1::model::policy_based_route::warnings::Code;
17418 /// let x0 = Warnings::new().set_code(Code::ResourceNotActive);
17419 /// let x1 = Warnings::new().set_code(Code::ResourceBeingModified);
17420 /// ```
17421 pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
17422 mut self,
17423 v: T,
17424 ) -> Self {
17425 self.code = v.into();
17426 self
17427 }
17428
17429 /// Sets the value of [data][crate::model::policy_based_route::Warnings::data].
17430 ///
17431 /// # Example
17432 /// ```ignore,no_run
17433 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17434 /// let x = Warnings::new().set_data([
17435 /// ("key0", "abc"),
17436 /// ("key1", "xyz"),
17437 /// ]);
17438 /// ```
17439 pub fn set_data<T, K, V>(mut self, v: T) -> Self
17440 where
17441 T: std::iter::IntoIterator<Item = (K, V)>,
17442 K: std::convert::Into<std::string::String>,
17443 V: std::convert::Into<std::string::String>,
17444 {
17445 use std::iter::Iterator;
17446 self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17447 self
17448 }
17449
17450 /// Sets the value of [warning_message][crate::model::policy_based_route::Warnings::warning_message].
17451 ///
17452 /// # Example
17453 /// ```ignore,no_run
17454 /// # use google_cloud_networkconnectivity_v1::model::policy_based_route::Warnings;
17455 /// let x = Warnings::new().set_warning_message("example");
17456 /// ```
17457 pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
17458 mut self,
17459 v: T,
17460 ) -> Self {
17461 self.warning_message = v.into();
17462 self
17463 }
17464 }
17465
17466 impl wkt::message::Message for Warnings {
17467 fn typename() -> &'static str {
17468 "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
17469 }
17470 }
17471
17472 /// Defines additional types related to [Warnings].
17473 pub mod warnings {
17474 #[allow(unused_imports)]
17475 use super::*;
17476
17477 /// Warning code for policy-based routing. Expect to add values in the
17478 /// future.
17479 ///
17480 /// # Working with unknown values
17481 ///
17482 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17483 /// additional enum variants at any time. Adding new variants is not considered
17484 /// a breaking change. Applications should write their code in anticipation of:
17485 ///
17486 /// - New values appearing in future releases of the client library, **and**
17487 /// - New values received dynamically, without application changes.
17488 ///
17489 /// Please consult the [Working with enums] section in the user guide for some
17490 /// guidelines.
17491 ///
17492 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17493 #[derive(Clone, Debug, PartialEq)]
17494 #[non_exhaustive]
17495 pub enum Code {
17496 /// Default value.
17497 WarningUnspecified,
17498 /// The policy-based route is not active and functioning. Common causes are
17499 /// that the dependent network was deleted or the resource project was
17500 /// turned off.
17501 ResourceNotActive,
17502 /// The policy-based route is being modified (e.g. created/deleted) at this
17503 /// time.
17504 ResourceBeingModified,
17505 /// If set, the enum was initialized with an unknown value.
17506 ///
17507 /// Applications can examine the value using [Code::value] or
17508 /// [Code::name].
17509 UnknownValue(code::UnknownValue),
17510 }
17511
17512 #[doc(hidden)]
17513 pub mod code {
17514 #[allow(unused_imports)]
17515 use super::*;
17516 #[derive(Clone, Debug, PartialEq)]
17517 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17518 }
17519
17520 impl Code {
17521 /// Gets the enum value.
17522 ///
17523 /// Returns `None` if the enum contains an unknown value deserialized from
17524 /// the string representation of enums.
17525 pub fn value(&self) -> std::option::Option<i32> {
17526 match self {
17527 Self::WarningUnspecified => std::option::Option::Some(0),
17528 Self::ResourceNotActive => std::option::Option::Some(1),
17529 Self::ResourceBeingModified => std::option::Option::Some(2),
17530 Self::UnknownValue(u) => u.0.value(),
17531 }
17532 }
17533
17534 /// Gets the enum value as a string.
17535 ///
17536 /// Returns `None` if the enum contains an unknown value deserialized from
17537 /// the integer representation of enums.
17538 pub fn name(&self) -> std::option::Option<&str> {
17539 match self {
17540 Self::WarningUnspecified => std::option::Option::Some("WARNING_UNSPECIFIED"),
17541 Self::ResourceNotActive => std::option::Option::Some("RESOURCE_NOT_ACTIVE"),
17542 Self::ResourceBeingModified => {
17543 std::option::Option::Some("RESOURCE_BEING_MODIFIED")
17544 }
17545 Self::UnknownValue(u) => u.0.name(),
17546 }
17547 }
17548 }
17549
17550 impl std::default::Default for Code {
17551 fn default() -> Self {
17552 use std::convert::From;
17553 Self::from(0)
17554 }
17555 }
17556
17557 impl std::fmt::Display for Code {
17558 fn fmt(
17559 &self,
17560 f: &mut std::fmt::Formatter<'_>,
17561 ) -> std::result::Result<(), std::fmt::Error> {
17562 wkt::internal::display_enum(f, self.name(), self.value())
17563 }
17564 }
17565
17566 impl std::convert::From<i32> for Code {
17567 fn from(value: i32) -> Self {
17568 match value {
17569 0 => Self::WarningUnspecified,
17570 1 => Self::ResourceNotActive,
17571 2 => Self::ResourceBeingModified,
17572 _ => Self::UnknownValue(code::UnknownValue(
17573 wkt::internal::UnknownEnumValue::Integer(value),
17574 )),
17575 }
17576 }
17577 }
17578
17579 impl std::convert::From<&str> for Code {
17580 fn from(value: &str) -> Self {
17581 use std::string::ToString;
17582 match value {
17583 "WARNING_UNSPECIFIED" => Self::WarningUnspecified,
17584 "RESOURCE_NOT_ACTIVE" => Self::ResourceNotActive,
17585 "RESOURCE_BEING_MODIFIED" => Self::ResourceBeingModified,
17586 _ => Self::UnknownValue(code::UnknownValue(
17587 wkt::internal::UnknownEnumValue::String(value.to_string()),
17588 )),
17589 }
17590 }
17591 }
17592
17593 impl serde::ser::Serialize for Code {
17594 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17595 where
17596 S: serde::Serializer,
17597 {
17598 match self {
17599 Self::WarningUnspecified => serializer.serialize_i32(0),
17600 Self::ResourceNotActive => serializer.serialize_i32(1),
17601 Self::ResourceBeingModified => serializer.serialize_i32(2),
17602 Self::UnknownValue(u) => u.0.serialize(serializer),
17603 }
17604 }
17605 }
17606
17607 impl<'de> serde::de::Deserialize<'de> for Code {
17608 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17609 where
17610 D: serde::Deserializer<'de>,
17611 {
17612 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
17613 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code",
17614 ))
17615 }
17616 }
17617 }
17618
17619 /// The other routing cases.
17620 ///
17621 /// # Working with unknown values
17622 ///
17623 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17624 /// additional enum variants at any time. Adding new variants is not considered
17625 /// a breaking change. Applications should write their code in anticipation of:
17626 ///
17627 /// - New values appearing in future releases of the client library, **and**
17628 /// - New values received dynamically, without application changes.
17629 ///
17630 /// Please consult the [Working with enums] section in the user guide for some
17631 /// guidelines.
17632 ///
17633 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17634 #[derive(Clone, Debug, PartialEq)]
17635 #[non_exhaustive]
17636 pub enum OtherRoutes {
17637 /// Default value.
17638 Unspecified,
17639 /// Use the routes from the default routing tables (system-generated routes,
17640 /// custom routes, peering route) to determine the next hop. This effectively
17641 /// excludes matching packets being applied on other PBRs with a lower
17642 /// priority.
17643 DefaultRouting,
17644 /// If set, the enum was initialized with an unknown value.
17645 ///
17646 /// Applications can examine the value using [OtherRoutes::value] or
17647 /// [OtherRoutes::name].
17648 UnknownValue(other_routes::UnknownValue),
17649 }
17650
17651 #[doc(hidden)]
17652 pub mod other_routes {
17653 #[allow(unused_imports)]
17654 use super::*;
17655 #[derive(Clone, Debug, PartialEq)]
17656 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17657 }
17658
17659 impl OtherRoutes {
17660 /// Gets the enum value.
17661 ///
17662 /// Returns `None` if the enum contains an unknown value deserialized from
17663 /// the string representation of enums.
17664 pub fn value(&self) -> std::option::Option<i32> {
17665 match self {
17666 Self::Unspecified => std::option::Option::Some(0),
17667 Self::DefaultRouting => std::option::Option::Some(1),
17668 Self::UnknownValue(u) => u.0.value(),
17669 }
17670 }
17671
17672 /// Gets the enum value as a string.
17673 ///
17674 /// Returns `None` if the enum contains an unknown value deserialized from
17675 /// the integer representation of enums.
17676 pub fn name(&self) -> std::option::Option<&str> {
17677 match self {
17678 Self::Unspecified => std::option::Option::Some("OTHER_ROUTES_UNSPECIFIED"),
17679 Self::DefaultRouting => std::option::Option::Some("DEFAULT_ROUTING"),
17680 Self::UnknownValue(u) => u.0.name(),
17681 }
17682 }
17683 }
17684
17685 impl std::default::Default for OtherRoutes {
17686 fn default() -> Self {
17687 use std::convert::From;
17688 Self::from(0)
17689 }
17690 }
17691
17692 impl std::fmt::Display for OtherRoutes {
17693 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17694 wkt::internal::display_enum(f, self.name(), self.value())
17695 }
17696 }
17697
17698 impl std::convert::From<i32> for OtherRoutes {
17699 fn from(value: i32) -> Self {
17700 match value {
17701 0 => Self::Unspecified,
17702 1 => Self::DefaultRouting,
17703 _ => Self::UnknownValue(other_routes::UnknownValue(
17704 wkt::internal::UnknownEnumValue::Integer(value),
17705 )),
17706 }
17707 }
17708 }
17709
17710 impl std::convert::From<&str> for OtherRoutes {
17711 fn from(value: &str) -> Self {
17712 use std::string::ToString;
17713 match value {
17714 "OTHER_ROUTES_UNSPECIFIED" => Self::Unspecified,
17715 "DEFAULT_ROUTING" => Self::DefaultRouting,
17716 _ => Self::UnknownValue(other_routes::UnknownValue(
17717 wkt::internal::UnknownEnumValue::String(value.to_string()),
17718 )),
17719 }
17720 }
17721 }
17722
17723 impl serde::ser::Serialize for OtherRoutes {
17724 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17725 where
17726 S: serde::Serializer,
17727 {
17728 match self {
17729 Self::Unspecified => serializer.serialize_i32(0),
17730 Self::DefaultRouting => serializer.serialize_i32(1),
17731 Self::UnknownValue(u) => u.0.serialize(serializer),
17732 }
17733 }
17734 }
17735
17736 impl<'de> serde::de::Deserialize<'de> for OtherRoutes {
17737 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17738 where
17739 D: serde::Deserializer<'de>,
17740 {
17741 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OtherRoutes>::new(
17742 ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes",
17743 ))
17744 }
17745 }
17746
17747 /// Target specifies network endpoints that this policy-based route applies to.
17748 /// If no target is specified, the PBR will be installed on all network
17749 /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
17750 #[derive(Clone, Debug, PartialEq)]
17751 #[non_exhaustive]
17752 pub enum Target {
17753 /// Optional. VM instances that this policy-based route applies to.
17754 VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
17755 /// Optional. The interconnect attachments that this policy-based route
17756 /// applies to.
17757 InterconnectAttachment(
17758 std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
17759 ),
17760 }
17761
17762 #[allow(missing_docs)]
17763 #[derive(Clone, Debug, PartialEq)]
17764 #[non_exhaustive]
17765 pub enum NextHop {
17766 /// Optional. The IP address of a global-access-enabled L4 ILB that is the
17767 /// next hop for matching packets. For this version, only nextHopIlbIp is
17768 /// supported.
17769 NextHopIlbIp(std::string::String),
17770 /// Optional. Other routes that will be referenced to determine the next hop
17771 /// of the packet.
17772 NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
17773 }
17774}
17775
17776/// Request for
17777/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
17778/// method.
17779///
17780/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
17781#[derive(Clone, Default, PartialEq)]
17782#[non_exhaustive]
17783pub struct ListPolicyBasedRoutesRequest {
17784 /// Required. The parent resource's name.
17785 pub parent: std::string::String,
17786
17787 /// The maximum number of results per page that should be returned.
17788 pub page_size: i32,
17789
17790 /// The page token.
17791 pub page_token: std::string::String,
17792
17793 /// A filter expression that filters the results listed in the response.
17794 pub filter: std::string::String,
17795
17796 /// Sort the results by a certain order.
17797 pub order_by: std::string::String,
17798
17799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17800}
17801
17802impl ListPolicyBasedRoutesRequest {
17803 /// Creates a new default instance.
17804 pub fn new() -> Self {
17805 std::default::Default::default()
17806 }
17807
17808 /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
17809 ///
17810 /// # Example
17811 /// ```ignore,no_run
17812 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17813 /// let x = ListPolicyBasedRoutesRequest::new().set_parent("example");
17814 /// ```
17815 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17816 self.parent = v.into();
17817 self
17818 }
17819
17820 /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
17821 ///
17822 /// # Example
17823 /// ```ignore,no_run
17824 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17825 /// let x = ListPolicyBasedRoutesRequest::new().set_page_size(42);
17826 /// ```
17827 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17828 self.page_size = v.into();
17829 self
17830 }
17831
17832 /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
17833 ///
17834 /// # Example
17835 /// ```ignore,no_run
17836 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17837 /// let x = ListPolicyBasedRoutesRequest::new().set_page_token("example");
17838 /// ```
17839 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17840 self.page_token = v.into();
17841 self
17842 }
17843
17844 /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
17845 ///
17846 /// # Example
17847 /// ```ignore,no_run
17848 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17849 /// let x = ListPolicyBasedRoutesRequest::new().set_filter("example");
17850 /// ```
17851 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17852 self.filter = v.into();
17853 self
17854 }
17855
17856 /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
17857 ///
17858 /// # Example
17859 /// ```ignore,no_run
17860 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesRequest;
17861 /// let x = ListPolicyBasedRoutesRequest::new().set_order_by("example");
17862 /// ```
17863 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17864 self.order_by = v.into();
17865 self
17866 }
17867}
17868
17869impl wkt::message::Message for ListPolicyBasedRoutesRequest {
17870 fn typename() -> &'static str {
17871 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
17872 }
17873}
17874
17875/// Response for
17876/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
17877/// method.
17878///
17879/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
17880#[derive(Clone, Default, PartialEq)]
17881#[non_exhaustive]
17882pub struct ListPolicyBasedRoutesResponse {
17883 /// Policy-based routes to be returned.
17884 pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,
17885
17886 /// The next pagination token in the List response. It should be used as
17887 /// page_token for the following request. An empty value means no more result.
17888 pub next_page_token: std::string::String,
17889
17890 /// Locations that could not be reached.
17891 pub unreachable: std::vec::Vec<std::string::String>,
17892
17893 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17894}
17895
17896impl ListPolicyBasedRoutesResponse {
17897 /// Creates a new default instance.
17898 pub fn new() -> Self {
17899 std::default::Default::default()
17900 }
17901
17902 /// Sets the value of [policy_based_routes][crate::model::ListPolicyBasedRoutesResponse::policy_based_routes].
17903 ///
17904 /// # Example
17905 /// ```ignore,no_run
17906 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17907 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
17908 /// let x = ListPolicyBasedRoutesResponse::new()
17909 /// .set_policy_based_routes([
17910 /// PolicyBasedRoute::default()/* use setters */,
17911 /// PolicyBasedRoute::default()/* use (different) setters */,
17912 /// ]);
17913 /// ```
17914 pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
17915 where
17916 T: std::iter::IntoIterator<Item = V>,
17917 V: std::convert::Into<crate::model::PolicyBasedRoute>,
17918 {
17919 use std::iter::Iterator;
17920 self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
17921 self
17922 }
17923
17924 /// Sets the value of [next_page_token][crate::model::ListPolicyBasedRoutesResponse::next_page_token].
17925 ///
17926 /// # Example
17927 /// ```ignore,no_run
17928 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17929 /// let x = ListPolicyBasedRoutesResponse::new().set_next_page_token("example");
17930 /// ```
17931 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17932 self.next_page_token = v.into();
17933 self
17934 }
17935
17936 /// Sets the value of [unreachable][crate::model::ListPolicyBasedRoutesResponse::unreachable].
17937 ///
17938 /// # Example
17939 /// ```ignore,no_run
17940 /// # use google_cloud_networkconnectivity_v1::model::ListPolicyBasedRoutesResponse;
17941 /// let x = ListPolicyBasedRoutesResponse::new().set_unreachable(["a", "b", "c"]);
17942 /// ```
17943 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17944 where
17945 T: std::iter::IntoIterator<Item = V>,
17946 V: std::convert::Into<std::string::String>,
17947 {
17948 use std::iter::Iterator;
17949 self.unreachable = v.into_iter().map(|i| i.into()).collect();
17950 self
17951 }
17952}
17953
17954impl wkt::message::Message for ListPolicyBasedRoutesResponse {
17955 fn typename() -> &'static str {
17956 "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
17957 }
17958}
17959
17960#[doc(hidden)]
17961impl google_cloud_gax::paginator::internal::PageableResponse for ListPolicyBasedRoutesResponse {
17962 type PageItem = crate::model::PolicyBasedRoute;
17963
17964 fn items(self) -> std::vec::Vec<Self::PageItem> {
17965 self.policy_based_routes
17966 }
17967
17968 fn next_page_token(&self) -> std::string::String {
17969 use std::clone::Clone;
17970 self.next_page_token.clone()
17971 }
17972}
17973
17974/// Request for
17975/// [PolicyBasedRoutingService.GetPolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]
17976/// method.
17977///
17978/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]: crate::client::PolicyBasedRoutingService::get_policy_based_route
17979#[derive(Clone, Default, PartialEq)]
17980#[non_exhaustive]
17981pub struct GetPolicyBasedRouteRequest {
17982 /// Required. Name of the PolicyBasedRoute resource to get.
17983 pub name: std::string::String,
17984
17985 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17986}
17987
17988impl GetPolicyBasedRouteRequest {
17989 /// Creates a new default instance.
17990 pub fn new() -> Self {
17991 std::default::Default::default()
17992 }
17993
17994 /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
17995 ///
17996 /// # Example
17997 /// ```ignore,no_run
17998 /// # use google_cloud_networkconnectivity_v1::model::GetPolicyBasedRouteRequest;
17999 /// # let project_id = "project_id";
18000 /// # let policy_based_route_id = "policy_based_route_id";
18001 /// let x = GetPolicyBasedRouteRequest::new().set_name(format!("projects/{project_id}/locations/global/PolicyBasedRoutes/{policy_based_route_id}"));
18002 /// ```
18003 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18004 self.name = v.into();
18005 self
18006 }
18007}
18008
18009impl wkt::message::Message for GetPolicyBasedRouteRequest {
18010 fn typename() -> &'static str {
18011 "type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
18012 }
18013}
18014
18015/// Request for
18016/// [PolicyBasedRoutingService.CreatePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]
18017/// method.
18018///
18019/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::create_policy_based_route
18020#[derive(Clone, Default, PartialEq)]
18021#[non_exhaustive]
18022pub struct CreatePolicyBasedRouteRequest {
18023 /// Required. The parent resource's name of the PolicyBasedRoute.
18024 pub parent: std::string::String,
18025
18026 /// Required. Unique id for the policy-based route to create. Provided by the
18027 /// client when the resource is created. The name must comply with
18028 /// <https://google.aip.dev/122#resource-id-segments>. Specifically, the name
18029 /// must be 1-63 characters long and match the regular expression
18030 /// [a-z]([a-z0-9-]*[a-z0-9])?. The first character must be a lowercase letter,
18031 /// and all following characters (except for the last character) must be a
18032 /// dash, lowercase letter, or digit. The last character must be a lowercase
18033 /// letter or digit.
18034 pub policy_based_route_id: std::string::String,
18035
18036 /// Required. Initial values for a new policy-based route.
18037 pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,
18038
18039 /// Optional. An optional request ID to identify requests. Specify a unique
18040 /// request ID so that if you must retry your request, the server knows to
18041 /// ignore the request if it has already been completed. The server guarantees
18042 /// that for at least 60 minutes since the first request.
18043 ///
18044 /// For example, consider a situation where you make an initial request and
18045 /// the request times out. If you make the request again with the same request
18046 /// ID, the server can check if original operation with the same request ID
18047 /// was received, and if so, ignores the second request. This prevents clients
18048 /// from accidentally creating duplicate commitments.
18049 ///
18050 /// The request ID must be a valid UUID with the exception that zero UUID is
18051 /// not supported (00000000-0000-0000-0000-000000000000).
18052 pub request_id: std::string::String,
18053
18054 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18055}
18056
18057impl CreatePolicyBasedRouteRequest {
18058 /// Creates a new default instance.
18059 pub fn new() -> Self {
18060 std::default::Default::default()
18061 }
18062
18063 /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
18064 ///
18065 /// # Example
18066 /// ```ignore,no_run
18067 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
18068 /// let x = CreatePolicyBasedRouteRequest::new().set_parent("example");
18069 /// ```
18070 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18071 self.parent = v.into();
18072 self
18073 }
18074
18075 /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
18076 ///
18077 /// # Example
18078 /// ```ignore,no_run
18079 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
18080 /// let x = CreatePolicyBasedRouteRequest::new().set_policy_based_route_id("example");
18081 /// ```
18082 pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
18083 mut self,
18084 v: T,
18085 ) -> Self {
18086 self.policy_based_route_id = v.into();
18087 self
18088 }
18089
18090 /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
18091 ///
18092 /// # Example
18093 /// ```ignore,no_run
18094 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
18095 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
18096 /// let x = CreatePolicyBasedRouteRequest::new().set_policy_based_route(PolicyBasedRoute::default()/* use setters */);
18097 /// ```
18098 pub fn set_policy_based_route<T>(mut self, v: T) -> Self
18099 where
18100 T: std::convert::Into<crate::model::PolicyBasedRoute>,
18101 {
18102 self.policy_based_route = std::option::Option::Some(v.into());
18103 self
18104 }
18105
18106 /// Sets or clears the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
18107 ///
18108 /// # Example
18109 /// ```ignore,no_run
18110 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
18111 /// use google_cloud_networkconnectivity_v1::model::PolicyBasedRoute;
18112 /// let x = CreatePolicyBasedRouteRequest::new().set_or_clear_policy_based_route(Some(PolicyBasedRoute::default()/* use setters */));
18113 /// let x = CreatePolicyBasedRouteRequest::new().set_or_clear_policy_based_route(None::<PolicyBasedRoute>);
18114 /// ```
18115 pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
18116 where
18117 T: std::convert::Into<crate::model::PolicyBasedRoute>,
18118 {
18119 self.policy_based_route = v.map(|x| x.into());
18120 self
18121 }
18122
18123 /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
18124 ///
18125 /// # Example
18126 /// ```ignore,no_run
18127 /// # use google_cloud_networkconnectivity_v1::model::CreatePolicyBasedRouteRequest;
18128 /// let x = CreatePolicyBasedRouteRequest::new().set_request_id("example");
18129 /// ```
18130 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18131 self.request_id = v.into();
18132 self
18133 }
18134}
18135
18136impl wkt::message::Message for CreatePolicyBasedRouteRequest {
18137 fn typename() -> &'static str {
18138 "type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
18139 }
18140}
18141
18142/// Request for
18143/// [PolicyBasedRoutingService.DeletePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]
18144/// method.
18145///
18146/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::delete_policy_based_route
18147#[derive(Clone, Default, PartialEq)]
18148#[non_exhaustive]
18149pub struct DeletePolicyBasedRouteRequest {
18150 /// Required. Name of the policy-based route resource to delete.
18151 pub name: std::string::String,
18152
18153 /// Optional. An optional request ID to identify requests. Specify a unique
18154 /// request ID so that if you must retry your request, the server knows to
18155 /// ignore the request if it has already been completed. The server guarantees
18156 /// that for at least 60 minutes after the first request.
18157 ///
18158 /// For example, consider a situation where you make an initial request and
18159 /// the request times out. If you make the request again with the same request
18160 /// ID, the server can check if original operation with the same request ID
18161 /// was received, and if so, ignores the second request. This prevents clients
18162 /// from accidentally creating duplicate commitments.
18163 ///
18164 /// The request ID must be a valid UUID with the exception that zero UUID is
18165 /// not supported (00000000-0000-0000-0000-000000000000).
18166 pub request_id: std::string::String,
18167
18168 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18169}
18170
18171impl DeletePolicyBasedRouteRequest {
18172 /// Creates a new default instance.
18173 pub fn new() -> Self {
18174 std::default::Default::default()
18175 }
18176
18177 /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
18178 ///
18179 /// # Example
18180 /// ```ignore,no_run
18181 /// # use google_cloud_networkconnectivity_v1::model::DeletePolicyBasedRouteRequest;
18182 /// # let project_id = "project_id";
18183 /// # let policy_based_route_id = "policy_based_route_id";
18184 /// let x = DeletePolicyBasedRouteRequest::new().set_name(format!("projects/{project_id}/locations/global/PolicyBasedRoutes/{policy_based_route_id}"));
18185 /// ```
18186 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18187 self.name = v.into();
18188 self
18189 }
18190
18191 /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
18192 ///
18193 /// # Example
18194 /// ```ignore,no_run
18195 /// # use google_cloud_networkconnectivity_v1::model::DeletePolicyBasedRouteRequest;
18196 /// let x = DeletePolicyBasedRouteRequest::new().set_request_id("example");
18197 /// ```
18198 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18199 self.request_id = v.into();
18200 self
18201 }
18202}
18203
18204impl wkt::message::Message for DeletePolicyBasedRouteRequest {
18205 fn typename() -> &'static str {
18206 "type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
18207 }
18208}
18209
18210/// The infrastructure used for connections between consumers/producers.
18211///
18212/// # Working with unknown values
18213///
18214/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18215/// additional enum variants at any time. Adding new variants is not considered
18216/// a breaking change. Applications should write their code in anticipation of:
18217///
18218/// - New values appearing in future releases of the client library, **and**
18219/// - New values received dynamically, without application changes.
18220///
18221/// Please consult the [Working with enums] section in the user guide for some
18222/// guidelines.
18223///
18224/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18225#[derive(Clone, Debug, PartialEq)]
18226#[non_exhaustive]
18227pub enum Infrastructure {
18228 /// An invalid infrastructure as the default case.
18229 Unspecified,
18230 /// Private Service Connect is used for connections.
18231 Psc,
18232 /// If set, the enum was initialized with an unknown value.
18233 ///
18234 /// Applications can examine the value using [Infrastructure::value] or
18235 /// [Infrastructure::name].
18236 UnknownValue(infrastructure::UnknownValue),
18237}
18238
18239#[doc(hidden)]
18240pub mod infrastructure {
18241 #[allow(unused_imports)]
18242 use super::*;
18243 #[derive(Clone, Debug, PartialEq)]
18244 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18245}
18246
18247impl Infrastructure {
18248 /// Gets the enum value.
18249 ///
18250 /// Returns `None` if the enum contains an unknown value deserialized from
18251 /// the string representation of enums.
18252 pub fn value(&self) -> std::option::Option<i32> {
18253 match self {
18254 Self::Unspecified => std::option::Option::Some(0),
18255 Self::Psc => std::option::Option::Some(1),
18256 Self::UnknownValue(u) => u.0.value(),
18257 }
18258 }
18259
18260 /// Gets the enum value as a string.
18261 ///
18262 /// Returns `None` if the enum contains an unknown value deserialized from
18263 /// the integer representation of enums.
18264 pub fn name(&self) -> std::option::Option<&str> {
18265 match self {
18266 Self::Unspecified => std::option::Option::Some("INFRASTRUCTURE_UNSPECIFIED"),
18267 Self::Psc => std::option::Option::Some("PSC"),
18268 Self::UnknownValue(u) => u.0.name(),
18269 }
18270 }
18271}
18272
18273impl std::default::Default for Infrastructure {
18274 fn default() -> Self {
18275 use std::convert::From;
18276 Self::from(0)
18277 }
18278}
18279
18280impl std::fmt::Display for Infrastructure {
18281 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18282 wkt::internal::display_enum(f, self.name(), self.value())
18283 }
18284}
18285
18286impl std::convert::From<i32> for Infrastructure {
18287 fn from(value: i32) -> Self {
18288 match value {
18289 0 => Self::Unspecified,
18290 1 => Self::Psc,
18291 _ => Self::UnknownValue(infrastructure::UnknownValue(
18292 wkt::internal::UnknownEnumValue::Integer(value),
18293 )),
18294 }
18295 }
18296}
18297
18298impl std::convert::From<&str> for Infrastructure {
18299 fn from(value: &str) -> Self {
18300 use std::string::ToString;
18301 match value {
18302 "INFRASTRUCTURE_UNSPECIFIED" => Self::Unspecified,
18303 "PSC" => Self::Psc,
18304 _ => Self::UnknownValue(infrastructure::UnknownValue(
18305 wkt::internal::UnknownEnumValue::String(value.to_string()),
18306 )),
18307 }
18308 }
18309}
18310
18311impl serde::ser::Serialize for Infrastructure {
18312 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18313 where
18314 S: serde::Serializer,
18315 {
18316 match self {
18317 Self::Unspecified => serializer.serialize_i32(0),
18318 Self::Psc => serializer.serialize_i32(1),
18319 Self::UnknownValue(u) => u.0.serialize(serializer),
18320 }
18321 }
18322}
18323
18324impl<'de> serde::de::Deserialize<'de> for Infrastructure {
18325 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18326 where
18327 D: serde::Deserializer<'de>,
18328 {
18329 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Infrastructure>::new(
18330 ".google.cloud.networkconnectivity.v1.Infrastructure",
18331 ))
18332 }
18333}
18334
18335/// The error type indicates whether a connection error is consumer facing,
18336/// producer facing or system internal.
18337///
18338/// # Working with unknown values
18339///
18340/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18341/// additional enum variants at any time. Adding new variants is not considered
18342/// a breaking change. Applications should write their code in anticipation of:
18343///
18344/// - New values appearing in future releases of the client library, **and**
18345/// - New values received dynamically, without application changes.
18346///
18347/// Please consult the [Working with enums] section in the user guide for some
18348/// guidelines.
18349///
18350/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18351#[derive(Clone, Debug, PartialEq)]
18352#[non_exhaustive]
18353pub enum ConnectionErrorType {
18354 /// An invalid error type as the default case.
18355 Unspecified,
18356 /// The error is due to Service Automation system internal.
18357 ErrorInternal,
18358 /// The error is due to the setup on consumer side.
18359 ErrorConsumerSide,
18360 /// The error is due to the setup on producer side.
18361 ErrorProducerSide,
18362 /// If set, the enum was initialized with an unknown value.
18363 ///
18364 /// Applications can examine the value using [ConnectionErrorType::value] or
18365 /// [ConnectionErrorType::name].
18366 UnknownValue(connection_error_type::UnknownValue),
18367}
18368
18369#[doc(hidden)]
18370pub mod connection_error_type {
18371 #[allow(unused_imports)]
18372 use super::*;
18373 #[derive(Clone, Debug, PartialEq)]
18374 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18375}
18376
18377impl ConnectionErrorType {
18378 /// Gets the enum value.
18379 ///
18380 /// Returns `None` if the enum contains an unknown value deserialized from
18381 /// the string representation of enums.
18382 pub fn value(&self) -> std::option::Option<i32> {
18383 match self {
18384 Self::Unspecified => std::option::Option::Some(0),
18385 Self::ErrorInternal => std::option::Option::Some(1),
18386 Self::ErrorConsumerSide => std::option::Option::Some(2),
18387 Self::ErrorProducerSide => std::option::Option::Some(3),
18388 Self::UnknownValue(u) => u.0.value(),
18389 }
18390 }
18391
18392 /// Gets the enum value as a string.
18393 ///
18394 /// Returns `None` if the enum contains an unknown value deserialized from
18395 /// the integer representation of enums.
18396 pub fn name(&self) -> std::option::Option<&str> {
18397 match self {
18398 Self::Unspecified => std::option::Option::Some("CONNECTION_ERROR_TYPE_UNSPECIFIED"),
18399 Self::ErrorInternal => std::option::Option::Some("ERROR_INTERNAL"),
18400 Self::ErrorConsumerSide => std::option::Option::Some("ERROR_CONSUMER_SIDE"),
18401 Self::ErrorProducerSide => std::option::Option::Some("ERROR_PRODUCER_SIDE"),
18402 Self::UnknownValue(u) => u.0.name(),
18403 }
18404 }
18405}
18406
18407impl std::default::Default for ConnectionErrorType {
18408 fn default() -> Self {
18409 use std::convert::From;
18410 Self::from(0)
18411 }
18412}
18413
18414impl std::fmt::Display for ConnectionErrorType {
18415 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18416 wkt::internal::display_enum(f, self.name(), self.value())
18417 }
18418}
18419
18420impl std::convert::From<i32> for ConnectionErrorType {
18421 fn from(value: i32) -> Self {
18422 match value {
18423 0 => Self::Unspecified,
18424 1 => Self::ErrorInternal,
18425 2 => Self::ErrorConsumerSide,
18426 3 => Self::ErrorProducerSide,
18427 _ => Self::UnknownValue(connection_error_type::UnknownValue(
18428 wkt::internal::UnknownEnumValue::Integer(value),
18429 )),
18430 }
18431 }
18432}
18433
18434impl std::convert::From<&str> for ConnectionErrorType {
18435 fn from(value: &str) -> Self {
18436 use std::string::ToString;
18437 match value {
18438 "CONNECTION_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
18439 "ERROR_INTERNAL" => Self::ErrorInternal,
18440 "ERROR_CONSUMER_SIDE" => Self::ErrorConsumerSide,
18441 "ERROR_PRODUCER_SIDE" => Self::ErrorProducerSide,
18442 _ => Self::UnknownValue(connection_error_type::UnknownValue(
18443 wkt::internal::UnknownEnumValue::String(value.to_string()),
18444 )),
18445 }
18446 }
18447}
18448
18449impl serde::ser::Serialize for ConnectionErrorType {
18450 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18451 where
18452 S: serde::Serializer,
18453 {
18454 match self {
18455 Self::Unspecified => serializer.serialize_i32(0),
18456 Self::ErrorInternal => serializer.serialize_i32(1),
18457 Self::ErrorConsumerSide => serializer.serialize_i32(2),
18458 Self::ErrorProducerSide => serializer.serialize_i32(3),
18459 Self::UnknownValue(u) => u.0.serialize(serializer),
18460 }
18461 }
18462}
18463
18464impl<'de> serde::de::Deserialize<'de> for ConnectionErrorType {
18465 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18466 where
18467 D: serde::Deserializer<'de>,
18468 {
18469 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionErrorType>::new(
18470 ".google.cloud.networkconnectivity.v1.ConnectionErrorType",
18471 ))
18472 }
18473}
18474
18475/// The requested IP version for the PSC connection.
18476///
18477/// # Working with unknown values
18478///
18479/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18480/// additional enum variants at any time. Adding new variants is not considered
18481/// a breaking change. Applications should write their code in anticipation of:
18482///
18483/// - New values appearing in future releases of the client library, **and**
18484/// - New values received dynamically, without application changes.
18485///
18486/// Please consult the [Working with enums] section in the user guide for some
18487/// guidelines.
18488///
18489/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18490#[derive(Clone, Debug, PartialEq)]
18491#[non_exhaustive]
18492pub enum IPVersion {
18493 /// Default value. We will use IPv4 or IPv6 depending on the IP version of
18494 /// first available subnetwork.
18495 Unspecified,
18496 /// Will use IPv4 only.
18497 Ipv4,
18498 /// Will use IPv6 only.
18499 Ipv6,
18500 /// If set, the enum was initialized with an unknown value.
18501 ///
18502 /// Applications can examine the value using [IPVersion::value] or
18503 /// [IPVersion::name].
18504 UnknownValue(ip_version::UnknownValue),
18505}
18506
18507#[doc(hidden)]
18508pub mod ip_version {
18509 #[allow(unused_imports)]
18510 use super::*;
18511 #[derive(Clone, Debug, PartialEq)]
18512 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18513}
18514
18515impl IPVersion {
18516 /// Gets the enum value.
18517 ///
18518 /// Returns `None` if the enum contains an unknown value deserialized from
18519 /// the string representation of enums.
18520 pub fn value(&self) -> std::option::Option<i32> {
18521 match self {
18522 Self::Unspecified => std::option::Option::Some(0),
18523 Self::Ipv4 => std::option::Option::Some(1),
18524 Self::Ipv6 => std::option::Option::Some(2),
18525 Self::UnknownValue(u) => u.0.value(),
18526 }
18527 }
18528
18529 /// Gets the enum value as a string.
18530 ///
18531 /// Returns `None` if the enum contains an unknown value deserialized from
18532 /// the integer representation of enums.
18533 pub fn name(&self) -> std::option::Option<&str> {
18534 match self {
18535 Self::Unspecified => std::option::Option::Some("IP_VERSION_UNSPECIFIED"),
18536 Self::Ipv4 => std::option::Option::Some("IPV4"),
18537 Self::Ipv6 => std::option::Option::Some("IPV6"),
18538 Self::UnknownValue(u) => u.0.name(),
18539 }
18540 }
18541}
18542
18543impl std::default::Default for IPVersion {
18544 fn default() -> Self {
18545 use std::convert::From;
18546 Self::from(0)
18547 }
18548}
18549
18550impl std::fmt::Display for IPVersion {
18551 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18552 wkt::internal::display_enum(f, self.name(), self.value())
18553 }
18554}
18555
18556impl std::convert::From<i32> for IPVersion {
18557 fn from(value: i32) -> Self {
18558 match value {
18559 0 => Self::Unspecified,
18560 1 => Self::Ipv4,
18561 2 => Self::Ipv6,
18562 _ => Self::UnknownValue(ip_version::UnknownValue(
18563 wkt::internal::UnknownEnumValue::Integer(value),
18564 )),
18565 }
18566 }
18567}
18568
18569impl std::convert::From<&str> for IPVersion {
18570 fn from(value: &str) -> Self {
18571 use std::string::ToString;
18572 match value {
18573 "IP_VERSION_UNSPECIFIED" => Self::Unspecified,
18574 "IPV4" => Self::Ipv4,
18575 "IPV6" => Self::Ipv6,
18576 _ => Self::UnknownValue(ip_version::UnknownValue(
18577 wkt::internal::UnknownEnumValue::String(value.to_string()),
18578 )),
18579 }
18580 }
18581}
18582
18583impl serde::ser::Serialize for IPVersion {
18584 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18585 where
18586 S: serde::Serializer,
18587 {
18588 match self {
18589 Self::Unspecified => serializer.serialize_i32(0),
18590 Self::Ipv4 => serializer.serialize_i32(1),
18591 Self::Ipv6 => serializer.serialize_i32(2),
18592 Self::UnknownValue(u) => u.0.serialize(serializer),
18593 }
18594 }
18595}
18596
18597impl<'de> serde::de::Deserialize<'de> for IPVersion {
18598 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18599 where
18600 D: serde::Deserializer<'de>,
18601 {
18602 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IPVersion>::new(
18603 ".google.cloud.networkconnectivity.v1.IPVersion",
18604 ))
18605 }
18606}
18607
18608/// Supported features for a location
18609///
18610/// # Working with unknown values
18611///
18612/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18613/// additional enum variants at any time. Adding new variants is not considered
18614/// a breaking change. Applications should write their code in anticipation of:
18615///
18616/// - New values appearing in future releases of the client library, **and**
18617/// - New values received dynamically, without application changes.
18618///
18619/// Please consult the [Working with enums] section in the user guide for some
18620/// guidelines.
18621///
18622/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18623#[derive(Clone, Debug, PartialEq)]
18624#[non_exhaustive]
18625pub enum LocationFeature {
18626 /// No publicly supported feature in this location
18627 Unspecified,
18628 /// Site-to-cloud spokes are supported in this location
18629 SiteToCloudSpokes,
18630 /// Site-to-site spokes are supported in this location
18631 SiteToSiteSpokes,
18632 /// If set, the enum was initialized with an unknown value.
18633 ///
18634 /// Applications can examine the value using [LocationFeature::value] or
18635 /// [LocationFeature::name].
18636 UnknownValue(location_feature::UnknownValue),
18637}
18638
18639#[doc(hidden)]
18640pub mod location_feature {
18641 #[allow(unused_imports)]
18642 use super::*;
18643 #[derive(Clone, Debug, PartialEq)]
18644 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18645}
18646
18647impl LocationFeature {
18648 /// Gets the enum value.
18649 ///
18650 /// Returns `None` if the enum contains an unknown value deserialized from
18651 /// the string representation of enums.
18652 pub fn value(&self) -> std::option::Option<i32> {
18653 match self {
18654 Self::Unspecified => std::option::Option::Some(0),
18655 Self::SiteToCloudSpokes => std::option::Option::Some(1),
18656 Self::SiteToSiteSpokes => std::option::Option::Some(2),
18657 Self::UnknownValue(u) => u.0.value(),
18658 }
18659 }
18660
18661 /// Gets the enum value as a string.
18662 ///
18663 /// Returns `None` if the enum contains an unknown value deserialized from
18664 /// the integer representation of enums.
18665 pub fn name(&self) -> std::option::Option<&str> {
18666 match self {
18667 Self::Unspecified => std::option::Option::Some("LOCATION_FEATURE_UNSPECIFIED"),
18668 Self::SiteToCloudSpokes => std::option::Option::Some("SITE_TO_CLOUD_SPOKES"),
18669 Self::SiteToSiteSpokes => std::option::Option::Some("SITE_TO_SITE_SPOKES"),
18670 Self::UnknownValue(u) => u.0.name(),
18671 }
18672 }
18673}
18674
18675impl std::default::Default for LocationFeature {
18676 fn default() -> Self {
18677 use std::convert::From;
18678 Self::from(0)
18679 }
18680}
18681
18682impl std::fmt::Display for LocationFeature {
18683 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18684 wkt::internal::display_enum(f, self.name(), self.value())
18685 }
18686}
18687
18688impl std::convert::From<i32> for LocationFeature {
18689 fn from(value: i32) -> Self {
18690 match value {
18691 0 => Self::Unspecified,
18692 1 => Self::SiteToCloudSpokes,
18693 2 => Self::SiteToSiteSpokes,
18694 _ => Self::UnknownValue(location_feature::UnknownValue(
18695 wkt::internal::UnknownEnumValue::Integer(value),
18696 )),
18697 }
18698 }
18699}
18700
18701impl std::convert::From<&str> for LocationFeature {
18702 fn from(value: &str) -> Self {
18703 use std::string::ToString;
18704 match value {
18705 "LOCATION_FEATURE_UNSPECIFIED" => Self::Unspecified,
18706 "SITE_TO_CLOUD_SPOKES" => Self::SiteToCloudSpokes,
18707 "SITE_TO_SITE_SPOKES" => Self::SiteToSiteSpokes,
18708 _ => Self::UnknownValue(location_feature::UnknownValue(
18709 wkt::internal::UnknownEnumValue::String(value.to_string()),
18710 )),
18711 }
18712 }
18713}
18714
18715impl serde::ser::Serialize for LocationFeature {
18716 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18717 where
18718 S: serde::Serializer,
18719 {
18720 match self {
18721 Self::Unspecified => serializer.serialize_i32(0),
18722 Self::SiteToCloudSpokes => serializer.serialize_i32(1),
18723 Self::SiteToSiteSpokes => serializer.serialize_i32(2),
18724 Self::UnknownValue(u) => u.0.serialize(serializer),
18725 }
18726 }
18727}
18728
18729impl<'de> serde::de::Deserialize<'de> for LocationFeature {
18730 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18731 where
18732 D: serde::Deserializer<'de>,
18733 {
18734 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationFeature>::new(
18735 ".google.cloud.networkconnectivity.v1.LocationFeature",
18736 ))
18737 }
18738}
18739
18740/// The route's type
18741///
18742/// # Working with unknown values
18743///
18744/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18745/// additional enum variants at any time. Adding new variants is not considered
18746/// a breaking change. Applications should write their code in anticipation of:
18747///
18748/// - New values appearing in future releases of the client library, **and**
18749/// - New values received dynamically, without application changes.
18750///
18751/// Please consult the [Working with enums] section in the user guide for some
18752/// guidelines.
18753///
18754/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18755#[derive(Clone, Debug, PartialEq)]
18756#[non_exhaustive]
18757pub enum RouteType {
18758 /// No route type information specified
18759 Unspecified,
18760 /// The route leads to a destination within the primary address range of the
18761 /// VPC network's subnet.
18762 VpcPrimarySubnet,
18763 /// The route leads to a destination within the secondary address range of the
18764 /// VPC network's subnet.
18765 VpcSecondarySubnet,
18766 /// The route leads to a destination in a dynamic route. Dynamic routes are
18767 /// derived from Border Gateway Protocol (BGP) advertisements received from an
18768 /// NCC hybrid spoke.
18769 DynamicRoute,
18770 /// If set, the enum was initialized with an unknown value.
18771 ///
18772 /// Applications can examine the value using [RouteType::value] or
18773 /// [RouteType::name].
18774 UnknownValue(route_type::UnknownValue),
18775}
18776
18777#[doc(hidden)]
18778pub mod route_type {
18779 #[allow(unused_imports)]
18780 use super::*;
18781 #[derive(Clone, Debug, PartialEq)]
18782 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18783}
18784
18785impl RouteType {
18786 /// Gets the enum value.
18787 ///
18788 /// Returns `None` if the enum contains an unknown value deserialized from
18789 /// the string representation of enums.
18790 pub fn value(&self) -> std::option::Option<i32> {
18791 match self {
18792 Self::Unspecified => std::option::Option::Some(0),
18793 Self::VpcPrimarySubnet => std::option::Option::Some(1),
18794 Self::VpcSecondarySubnet => std::option::Option::Some(2),
18795 Self::DynamicRoute => std::option::Option::Some(3),
18796 Self::UnknownValue(u) => u.0.value(),
18797 }
18798 }
18799
18800 /// Gets the enum value as a string.
18801 ///
18802 /// Returns `None` if the enum contains an unknown value deserialized from
18803 /// the integer representation of enums.
18804 pub fn name(&self) -> std::option::Option<&str> {
18805 match self {
18806 Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
18807 Self::VpcPrimarySubnet => std::option::Option::Some("VPC_PRIMARY_SUBNET"),
18808 Self::VpcSecondarySubnet => std::option::Option::Some("VPC_SECONDARY_SUBNET"),
18809 Self::DynamicRoute => std::option::Option::Some("DYNAMIC_ROUTE"),
18810 Self::UnknownValue(u) => u.0.name(),
18811 }
18812 }
18813}
18814
18815impl std::default::Default for RouteType {
18816 fn default() -> Self {
18817 use std::convert::From;
18818 Self::from(0)
18819 }
18820}
18821
18822impl std::fmt::Display for RouteType {
18823 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18824 wkt::internal::display_enum(f, self.name(), self.value())
18825 }
18826}
18827
18828impl std::convert::From<i32> for RouteType {
18829 fn from(value: i32) -> Self {
18830 match value {
18831 0 => Self::Unspecified,
18832 1 => Self::VpcPrimarySubnet,
18833 2 => Self::VpcSecondarySubnet,
18834 3 => Self::DynamicRoute,
18835 _ => Self::UnknownValue(route_type::UnknownValue(
18836 wkt::internal::UnknownEnumValue::Integer(value),
18837 )),
18838 }
18839 }
18840}
18841
18842impl std::convert::From<&str> for RouteType {
18843 fn from(value: &str) -> Self {
18844 use std::string::ToString;
18845 match value {
18846 "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
18847 "VPC_PRIMARY_SUBNET" => Self::VpcPrimarySubnet,
18848 "VPC_SECONDARY_SUBNET" => Self::VpcSecondarySubnet,
18849 "DYNAMIC_ROUTE" => Self::DynamicRoute,
18850 _ => Self::UnknownValue(route_type::UnknownValue(
18851 wkt::internal::UnknownEnumValue::String(value.to_string()),
18852 )),
18853 }
18854 }
18855}
18856
18857impl serde::ser::Serialize for RouteType {
18858 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18859 where
18860 S: serde::Serializer,
18861 {
18862 match self {
18863 Self::Unspecified => serializer.serialize_i32(0),
18864 Self::VpcPrimarySubnet => serializer.serialize_i32(1),
18865 Self::VpcSecondarySubnet => serializer.serialize_i32(2),
18866 Self::DynamicRoute => serializer.serialize_i32(3),
18867 Self::UnknownValue(u) => u.0.serialize(serializer),
18868 }
18869 }
18870}
18871
18872impl<'de> serde::de::Deserialize<'de> for RouteType {
18873 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18874 where
18875 D: serde::Deserializer<'de>,
18876 {
18877 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
18878 ".google.cloud.networkconnectivity.v1.RouteType",
18879 ))
18880 }
18881}
18882
18883/// The State enum represents the lifecycle stage of a Network Connectivity
18884/// Center resource.
18885///
18886/// # Working with unknown values
18887///
18888/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18889/// additional enum variants at any time. Adding new variants is not considered
18890/// a breaking change. Applications should write their code in anticipation of:
18891///
18892/// - New values appearing in future releases of the client library, **and**
18893/// - New values received dynamically, without application changes.
18894///
18895/// Please consult the [Working with enums] section in the user guide for some
18896/// guidelines.
18897///
18898/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18899#[derive(Clone, Debug, PartialEq)]
18900#[non_exhaustive]
18901pub enum State {
18902 /// No state information available
18903 Unspecified,
18904 /// The resource's create operation is in progress.
18905 Creating,
18906 /// The resource is active
18907 Active,
18908 /// The resource's delete operation is in progress.
18909 Deleting,
18910 /// The resource's accept operation is in progress.
18911 Accepting,
18912 /// The resource's reject operation is in progress.
18913 Rejecting,
18914 /// The resource's update operation is in progress.
18915 Updating,
18916 /// The resource is inactive.
18917 Inactive,
18918 /// The hub associated with this spoke resource has been deleted.
18919 /// This state applies to spoke resources only.
18920 Obsolete,
18921 /// The resource is in an undefined state due to resource creation or deletion
18922 /// failure. You can try to delete the resource later or contact support for
18923 /// help.
18924 Failed,
18925 /// If set, the enum was initialized with an unknown value.
18926 ///
18927 /// Applications can examine the value using [State::value] or
18928 /// [State::name].
18929 UnknownValue(state::UnknownValue),
18930}
18931
18932#[doc(hidden)]
18933pub mod state {
18934 #[allow(unused_imports)]
18935 use super::*;
18936 #[derive(Clone, Debug, PartialEq)]
18937 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18938}
18939
18940impl State {
18941 /// Gets the enum value.
18942 ///
18943 /// Returns `None` if the enum contains an unknown value deserialized from
18944 /// the string representation of enums.
18945 pub fn value(&self) -> std::option::Option<i32> {
18946 match self {
18947 Self::Unspecified => std::option::Option::Some(0),
18948 Self::Creating => std::option::Option::Some(1),
18949 Self::Active => std::option::Option::Some(2),
18950 Self::Deleting => std::option::Option::Some(3),
18951 Self::Accepting => std::option::Option::Some(8),
18952 Self::Rejecting => std::option::Option::Some(9),
18953 Self::Updating => std::option::Option::Some(6),
18954 Self::Inactive => std::option::Option::Some(7),
18955 Self::Obsolete => std::option::Option::Some(10),
18956 Self::Failed => std::option::Option::Some(11),
18957 Self::UnknownValue(u) => u.0.value(),
18958 }
18959 }
18960
18961 /// Gets the enum value as a string.
18962 ///
18963 /// Returns `None` if the enum contains an unknown value deserialized from
18964 /// the integer representation of enums.
18965 pub fn name(&self) -> std::option::Option<&str> {
18966 match self {
18967 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
18968 Self::Creating => std::option::Option::Some("CREATING"),
18969 Self::Active => std::option::Option::Some("ACTIVE"),
18970 Self::Deleting => std::option::Option::Some("DELETING"),
18971 Self::Accepting => std::option::Option::Some("ACCEPTING"),
18972 Self::Rejecting => std::option::Option::Some("REJECTING"),
18973 Self::Updating => std::option::Option::Some("UPDATING"),
18974 Self::Inactive => std::option::Option::Some("INACTIVE"),
18975 Self::Obsolete => std::option::Option::Some("OBSOLETE"),
18976 Self::Failed => std::option::Option::Some("FAILED"),
18977 Self::UnknownValue(u) => u.0.name(),
18978 }
18979 }
18980}
18981
18982impl std::default::Default for State {
18983 fn default() -> Self {
18984 use std::convert::From;
18985 Self::from(0)
18986 }
18987}
18988
18989impl std::fmt::Display for State {
18990 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18991 wkt::internal::display_enum(f, self.name(), self.value())
18992 }
18993}
18994
18995impl std::convert::From<i32> for State {
18996 fn from(value: i32) -> Self {
18997 match value {
18998 0 => Self::Unspecified,
18999 1 => Self::Creating,
19000 2 => Self::Active,
19001 3 => Self::Deleting,
19002 6 => Self::Updating,
19003 7 => Self::Inactive,
19004 8 => Self::Accepting,
19005 9 => Self::Rejecting,
19006 10 => Self::Obsolete,
19007 11 => Self::Failed,
19008 _ => Self::UnknownValue(state::UnknownValue(
19009 wkt::internal::UnknownEnumValue::Integer(value),
19010 )),
19011 }
19012 }
19013}
19014
19015impl std::convert::From<&str> for State {
19016 fn from(value: &str) -> Self {
19017 use std::string::ToString;
19018 match value {
19019 "STATE_UNSPECIFIED" => Self::Unspecified,
19020 "CREATING" => Self::Creating,
19021 "ACTIVE" => Self::Active,
19022 "DELETING" => Self::Deleting,
19023 "ACCEPTING" => Self::Accepting,
19024 "REJECTING" => Self::Rejecting,
19025 "UPDATING" => Self::Updating,
19026 "INACTIVE" => Self::Inactive,
19027 "OBSOLETE" => Self::Obsolete,
19028 "FAILED" => Self::Failed,
19029 _ => Self::UnknownValue(state::UnknownValue(
19030 wkt::internal::UnknownEnumValue::String(value.to_string()),
19031 )),
19032 }
19033 }
19034}
19035
19036impl serde::ser::Serialize for State {
19037 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19038 where
19039 S: serde::Serializer,
19040 {
19041 match self {
19042 Self::Unspecified => serializer.serialize_i32(0),
19043 Self::Creating => serializer.serialize_i32(1),
19044 Self::Active => serializer.serialize_i32(2),
19045 Self::Deleting => serializer.serialize_i32(3),
19046 Self::Accepting => serializer.serialize_i32(8),
19047 Self::Rejecting => serializer.serialize_i32(9),
19048 Self::Updating => serializer.serialize_i32(6),
19049 Self::Inactive => serializer.serialize_i32(7),
19050 Self::Obsolete => serializer.serialize_i32(10),
19051 Self::Failed => serializer.serialize_i32(11),
19052 Self::UnknownValue(u) => u.0.serialize(serializer),
19053 }
19054 }
19055}
19056
19057impl<'de> serde::de::Deserialize<'de> for State {
19058 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19059 where
19060 D: serde::Deserializer<'de>,
19061 {
19062 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
19063 ".google.cloud.networkconnectivity.v1.State",
19064 ))
19065 }
19066}
19067
19068/// The SpokeType enum represents the type of spoke. The type
19069/// reflects the kind of resource that a spoke is associated with.
19070///
19071/// # Working with unknown values
19072///
19073/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19074/// additional enum variants at any time. Adding new variants is not considered
19075/// a breaking change. Applications should write their code in anticipation of:
19076///
19077/// - New values appearing in future releases of the client library, **and**
19078/// - New values received dynamically, without application changes.
19079///
19080/// Please consult the [Working with enums] section in the user guide for some
19081/// guidelines.
19082///
19083/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19084#[derive(Clone, Debug, PartialEq)]
19085#[non_exhaustive]
19086pub enum SpokeType {
19087 /// Unspecified spoke type.
19088 Unspecified,
19089 /// Spokes associated with VPN tunnels.
19090 VpnTunnel,
19091 /// Spokes associated with VLAN attachments.
19092 InterconnectAttachment,
19093 /// Spokes associated with router appliance instances.
19094 RouterAppliance,
19095 /// Spokes associated with VPC networks.
19096 VpcNetwork,
19097 /// Spokes that are backed by a producer VPC network.
19098 ProducerVpcNetwork,
19099 /// If set, the enum was initialized with an unknown value.
19100 ///
19101 /// Applications can examine the value using [SpokeType::value] or
19102 /// [SpokeType::name].
19103 UnknownValue(spoke_type::UnknownValue),
19104}
19105
19106#[doc(hidden)]
19107pub mod spoke_type {
19108 #[allow(unused_imports)]
19109 use super::*;
19110 #[derive(Clone, Debug, PartialEq)]
19111 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19112}
19113
19114impl SpokeType {
19115 /// Gets the enum value.
19116 ///
19117 /// Returns `None` if the enum contains an unknown value deserialized from
19118 /// the string representation of enums.
19119 pub fn value(&self) -> std::option::Option<i32> {
19120 match self {
19121 Self::Unspecified => std::option::Option::Some(0),
19122 Self::VpnTunnel => std::option::Option::Some(1),
19123 Self::InterconnectAttachment => std::option::Option::Some(2),
19124 Self::RouterAppliance => std::option::Option::Some(3),
19125 Self::VpcNetwork => std::option::Option::Some(4),
19126 Self::ProducerVpcNetwork => std::option::Option::Some(7),
19127 Self::UnknownValue(u) => u.0.value(),
19128 }
19129 }
19130
19131 /// Gets the enum value as a string.
19132 ///
19133 /// Returns `None` if the enum contains an unknown value deserialized from
19134 /// the integer representation of enums.
19135 pub fn name(&self) -> std::option::Option<&str> {
19136 match self {
19137 Self::Unspecified => std::option::Option::Some("SPOKE_TYPE_UNSPECIFIED"),
19138 Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
19139 Self::InterconnectAttachment => std::option::Option::Some("INTERCONNECT_ATTACHMENT"),
19140 Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
19141 Self::VpcNetwork => std::option::Option::Some("VPC_NETWORK"),
19142 Self::ProducerVpcNetwork => std::option::Option::Some("PRODUCER_VPC_NETWORK"),
19143 Self::UnknownValue(u) => u.0.name(),
19144 }
19145 }
19146}
19147
19148impl std::default::Default for SpokeType {
19149 fn default() -> Self {
19150 use std::convert::From;
19151 Self::from(0)
19152 }
19153}
19154
19155impl std::fmt::Display for SpokeType {
19156 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19157 wkt::internal::display_enum(f, self.name(), self.value())
19158 }
19159}
19160
19161impl std::convert::From<i32> for SpokeType {
19162 fn from(value: i32) -> Self {
19163 match value {
19164 0 => Self::Unspecified,
19165 1 => Self::VpnTunnel,
19166 2 => Self::InterconnectAttachment,
19167 3 => Self::RouterAppliance,
19168 4 => Self::VpcNetwork,
19169 7 => Self::ProducerVpcNetwork,
19170 _ => Self::UnknownValue(spoke_type::UnknownValue(
19171 wkt::internal::UnknownEnumValue::Integer(value),
19172 )),
19173 }
19174 }
19175}
19176
19177impl std::convert::From<&str> for SpokeType {
19178 fn from(value: &str) -> Self {
19179 use std::string::ToString;
19180 match value {
19181 "SPOKE_TYPE_UNSPECIFIED" => Self::Unspecified,
19182 "VPN_TUNNEL" => Self::VpnTunnel,
19183 "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
19184 "ROUTER_APPLIANCE" => Self::RouterAppliance,
19185 "VPC_NETWORK" => Self::VpcNetwork,
19186 "PRODUCER_VPC_NETWORK" => Self::ProducerVpcNetwork,
19187 _ => Self::UnknownValue(spoke_type::UnknownValue(
19188 wkt::internal::UnknownEnumValue::String(value.to_string()),
19189 )),
19190 }
19191 }
19192}
19193
19194impl serde::ser::Serialize for SpokeType {
19195 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19196 where
19197 S: serde::Serializer,
19198 {
19199 match self {
19200 Self::Unspecified => serializer.serialize_i32(0),
19201 Self::VpnTunnel => serializer.serialize_i32(1),
19202 Self::InterconnectAttachment => serializer.serialize_i32(2),
19203 Self::RouterAppliance => serializer.serialize_i32(3),
19204 Self::VpcNetwork => serializer.serialize_i32(4),
19205 Self::ProducerVpcNetwork => serializer.serialize_i32(7),
19206 Self::UnknownValue(u) => u.0.serialize(serializer),
19207 }
19208 }
19209}
19210
19211impl<'de> serde::de::Deserialize<'de> for SpokeType {
19212 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19213 where
19214 D: serde::Deserializer<'de>,
19215 {
19216 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeType>::new(
19217 ".google.cloud.networkconnectivity.v1.SpokeType",
19218 ))
19219 }
19220}
19221
19222/// This enum controls the policy mode used in a hub.
19223///
19224/// # Working with unknown values
19225///
19226/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19227/// additional enum variants at any time. Adding new variants is not considered
19228/// a breaking change. Applications should write their code in anticipation of:
19229///
19230/// - New values appearing in future releases of the client library, **and**
19231/// - New values received dynamically, without application changes.
19232///
19233/// Please consult the [Working with enums] section in the user guide for some
19234/// guidelines.
19235///
19236/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19237#[derive(Clone, Debug, PartialEq)]
19238#[non_exhaustive]
19239pub enum PolicyMode {
19240 /// Policy mode is unspecified. It defaults to PRESET
19241 /// with preset_topology = MESH.
19242 Unspecified,
19243 /// Hub uses one of the preset topologies.
19244 Preset,
19245 /// If set, the enum was initialized with an unknown value.
19246 ///
19247 /// Applications can examine the value using [PolicyMode::value] or
19248 /// [PolicyMode::name].
19249 UnknownValue(policy_mode::UnknownValue),
19250}
19251
19252#[doc(hidden)]
19253pub mod policy_mode {
19254 #[allow(unused_imports)]
19255 use super::*;
19256 #[derive(Clone, Debug, PartialEq)]
19257 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19258}
19259
19260impl PolicyMode {
19261 /// Gets the enum value.
19262 ///
19263 /// Returns `None` if the enum contains an unknown value deserialized from
19264 /// the string representation of enums.
19265 pub fn value(&self) -> std::option::Option<i32> {
19266 match self {
19267 Self::Unspecified => std::option::Option::Some(0),
19268 Self::Preset => std::option::Option::Some(1),
19269 Self::UnknownValue(u) => u.0.value(),
19270 }
19271 }
19272
19273 /// Gets the enum value as a string.
19274 ///
19275 /// Returns `None` if the enum contains an unknown value deserialized from
19276 /// the integer representation of enums.
19277 pub fn name(&self) -> std::option::Option<&str> {
19278 match self {
19279 Self::Unspecified => std::option::Option::Some("POLICY_MODE_UNSPECIFIED"),
19280 Self::Preset => std::option::Option::Some("PRESET"),
19281 Self::UnknownValue(u) => u.0.name(),
19282 }
19283 }
19284}
19285
19286impl std::default::Default for PolicyMode {
19287 fn default() -> Self {
19288 use std::convert::From;
19289 Self::from(0)
19290 }
19291}
19292
19293impl std::fmt::Display for PolicyMode {
19294 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19295 wkt::internal::display_enum(f, self.name(), self.value())
19296 }
19297}
19298
19299impl std::convert::From<i32> for PolicyMode {
19300 fn from(value: i32) -> Self {
19301 match value {
19302 0 => Self::Unspecified,
19303 1 => Self::Preset,
19304 _ => Self::UnknownValue(policy_mode::UnknownValue(
19305 wkt::internal::UnknownEnumValue::Integer(value),
19306 )),
19307 }
19308 }
19309}
19310
19311impl std::convert::From<&str> for PolicyMode {
19312 fn from(value: &str) -> Self {
19313 use std::string::ToString;
19314 match value {
19315 "POLICY_MODE_UNSPECIFIED" => Self::Unspecified,
19316 "PRESET" => Self::Preset,
19317 _ => Self::UnknownValue(policy_mode::UnknownValue(
19318 wkt::internal::UnknownEnumValue::String(value.to_string()),
19319 )),
19320 }
19321 }
19322}
19323
19324impl serde::ser::Serialize for PolicyMode {
19325 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19326 where
19327 S: serde::Serializer,
19328 {
19329 match self {
19330 Self::Unspecified => serializer.serialize_i32(0),
19331 Self::Preset => serializer.serialize_i32(1),
19332 Self::UnknownValue(u) => u.0.serialize(serializer),
19333 }
19334 }
19335}
19336
19337impl<'de> serde::de::Deserialize<'de> for PolicyMode {
19338 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19339 where
19340 D: serde::Deserializer<'de>,
19341 {
19342 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyMode>::new(
19343 ".google.cloud.networkconnectivity.v1.PolicyMode",
19344 ))
19345 }
19346}
19347
19348/// The list of available preset topologies.
19349///
19350/// # Working with unknown values
19351///
19352/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19353/// additional enum variants at any time. Adding new variants is not considered
19354/// a breaking change. Applications should write their code in anticipation of:
19355///
19356/// - New values appearing in future releases of the client library, **and**
19357/// - New values received dynamically, without application changes.
19358///
19359/// Please consult the [Working with enums] section in the user guide for some
19360/// guidelines.
19361///
19362/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19363#[derive(Clone, Debug, PartialEq)]
19364#[non_exhaustive]
19365pub enum PresetTopology {
19366 /// Preset topology is unspecified. When policy_mode = PRESET,
19367 /// it defaults to MESH.
19368 Unspecified,
19369 /// Mesh topology is implemented. Group `default` is automatically created.
19370 /// All spokes in the hub are added to group `default`.
19371 Mesh,
19372 /// Star topology is implemented. Two groups, `center` and `edge`, are
19373 /// automatically created along with hub creation. Spokes have to join one of
19374 /// the groups during creation.
19375 Star,
19376 /// If set, the enum was initialized with an unknown value.
19377 ///
19378 /// Applications can examine the value using [PresetTopology::value] or
19379 /// [PresetTopology::name].
19380 UnknownValue(preset_topology::UnknownValue),
19381}
19382
19383#[doc(hidden)]
19384pub mod preset_topology {
19385 #[allow(unused_imports)]
19386 use super::*;
19387 #[derive(Clone, Debug, PartialEq)]
19388 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19389}
19390
19391impl PresetTopology {
19392 /// Gets the enum value.
19393 ///
19394 /// Returns `None` if the enum contains an unknown value deserialized from
19395 /// the string representation of enums.
19396 pub fn value(&self) -> std::option::Option<i32> {
19397 match self {
19398 Self::Unspecified => std::option::Option::Some(0),
19399 Self::Mesh => std::option::Option::Some(2),
19400 Self::Star => std::option::Option::Some(3),
19401 Self::UnknownValue(u) => u.0.value(),
19402 }
19403 }
19404
19405 /// Gets the enum value as a string.
19406 ///
19407 /// Returns `None` if the enum contains an unknown value deserialized from
19408 /// the integer representation of enums.
19409 pub fn name(&self) -> std::option::Option<&str> {
19410 match self {
19411 Self::Unspecified => std::option::Option::Some("PRESET_TOPOLOGY_UNSPECIFIED"),
19412 Self::Mesh => std::option::Option::Some("MESH"),
19413 Self::Star => std::option::Option::Some("STAR"),
19414 Self::UnknownValue(u) => u.0.name(),
19415 }
19416 }
19417}
19418
19419impl std::default::Default for PresetTopology {
19420 fn default() -> Self {
19421 use std::convert::From;
19422 Self::from(0)
19423 }
19424}
19425
19426impl std::fmt::Display for PresetTopology {
19427 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19428 wkt::internal::display_enum(f, self.name(), self.value())
19429 }
19430}
19431
19432impl std::convert::From<i32> for PresetTopology {
19433 fn from(value: i32) -> Self {
19434 match value {
19435 0 => Self::Unspecified,
19436 2 => Self::Mesh,
19437 3 => Self::Star,
19438 _ => Self::UnknownValue(preset_topology::UnknownValue(
19439 wkt::internal::UnknownEnumValue::Integer(value),
19440 )),
19441 }
19442 }
19443}
19444
19445impl std::convert::From<&str> for PresetTopology {
19446 fn from(value: &str) -> Self {
19447 use std::string::ToString;
19448 match value {
19449 "PRESET_TOPOLOGY_UNSPECIFIED" => Self::Unspecified,
19450 "MESH" => Self::Mesh,
19451 "STAR" => Self::Star,
19452 _ => Self::UnknownValue(preset_topology::UnknownValue(
19453 wkt::internal::UnknownEnumValue::String(value.to_string()),
19454 )),
19455 }
19456 }
19457}
19458
19459impl serde::ser::Serialize for PresetTopology {
19460 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19461 where
19462 S: serde::Serializer,
19463 {
19464 match self {
19465 Self::Unspecified => serializer.serialize_i32(0),
19466 Self::Mesh => serializer.serialize_i32(2),
19467 Self::Star => serializer.serialize_i32(3),
19468 Self::UnknownValue(u) => u.0.serialize(serializer),
19469 }
19470 }
19471}
19472
19473impl<'de> serde::de::Deserialize<'de> for PresetTopology {
19474 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19475 where
19476 D: serde::Deserializer<'de>,
19477 {
19478 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PresetTopology>::new(
19479 ".google.cloud.networkconnectivity.v1.PresetTopology",
19480 ))
19481 }
19482}