google_cloud_eventarc_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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_iam_v1;
27extern crate google_cloud_location;
28extern crate google_cloud_longrunning;
29extern crate google_cloud_lro;
30extern crate google_cloud_rpc;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// A representation of the Channel resource.
43/// A Channel is a resource on which event providers publish their events.
44/// The published events are delivered through the transport associated with the
45/// channel. Note that a channel is associated with exactly one event provider.
46#[derive(Clone, Default, PartialEq)]
47#[non_exhaustive]
48pub struct Channel {
49 /// Required. The resource name of the channel. Must be unique within the
50 /// location on the project and must be in
51 /// `projects/{project}/locations/{location}/channels/{channel_id}` format.
52 pub name: std::string::String,
53
54 /// Output only. Server assigned unique identifier for the channel. The value
55 /// is a UUID4 string and guaranteed to remain unchanged until the resource is
56 /// deleted.
57 pub uid: std::string::String,
58
59 /// Output only. The creation time.
60 pub create_time: std::option::Option<wkt::Timestamp>,
61
62 /// Output only. The last-modified time.
63 pub update_time: std::option::Option<wkt::Timestamp>,
64
65 /// The name of the event provider (e.g. Eventarc SaaS partner) associated
66 /// with the channel. This provider will be granted permissions to publish
67 /// events to the channel. Format:
68 /// `projects/{project}/locations/{location}/providers/{provider_id}`.
69 pub provider: std::string::String,
70
71 /// Output only. The state of a Channel.
72 pub state: crate::model::channel::State,
73
74 /// Output only. The activation token for the channel. The token must be used
75 /// by the provider to register the channel for publishing.
76 pub activation_token: std::string::String,
77
78 /// Optional. Resource name of a KMS crypto key (managed by the user) used to
79 /// encrypt/decrypt their event data.
80 ///
81 /// It must match the pattern
82 /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
83 pub crypto_key_name: std::string::String,
84
85 /// Output only. Whether or not this Channel satisfies the requirements of
86 /// physical zone separation
87 pub satisfies_pzs: bool,
88
89 /// Optional. Resource labels.
90 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
91
92 #[allow(missing_docs)]
93 pub transport: std::option::Option<crate::model::channel::Transport>,
94
95 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
96}
97
98impl Channel {
99 /// Creates a new default instance.
100 pub fn new() -> Self {
101 std::default::Default::default()
102 }
103
104 /// Sets the value of [name][crate::model::Channel::name].
105 ///
106 /// # Example
107 /// ```ignore,no_run
108 /// # use google_cloud_eventarc_v1::model::Channel;
109 /// # let project_id = "project_id";
110 /// # let location_id = "location_id";
111 /// # let channel_id = "channel_id";
112 /// let x = Channel::new().set_name(format!("projects/{project_id}/locations/{location_id}/channels/{channel_id}"));
113 /// ```
114 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
115 self.name = v.into();
116 self
117 }
118
119 /// Sets the value of [uid][crate::model::Channel::uid].
120 ///
121 /// # Example
122 /// ```ignore,no_run
123 /// # use google_cloud_eventarc_v1::model::Channel;
124 /// let x = Channel::new().set_uid("example");
125 /// ```
126 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
127 self.uid = v.into();
128 self
129 }
130
131 /// Sets the value of [create_time][crate::model::Channel::create_time].
132 ///
133 /// # Example
134 /// ```ignore,no_run
135 /// # use google_cloud_eventarc_v1::model::Channel;
136 /// use wkt::Timestamp;
137 /// let x = Channel::new().set_create_time(Timestamp::default()/* use setters */);
138 /// ```
139 pub fn set_create_time<T>(mut self, v: T) -> Self
140 where
141 T: std::convert::Into<wkt::Timestamp>,
142 {
143 self.create_time = std::option::Option::Some(v.into());
144 self
145 }
146
147 /// Sets or clears the value of [create_time][crate::model::Channel::create_time].
148 ///
149 /// # Example
150 /// ```ignore,no_run
151 /// # use google_cloud_eventarc_v1::model::Channel;
152 /// use wkt::Timestamp;
153 /// let x = Channel::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
154 /// let x = Channel::new().set_or_clear_create_time(None::<Timestamp>);
155 /// ```
156 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
157 where
158 T: std::convert::Into<wkt::Timestamp>,
159 {
160 self.create_time = v.map(|x| x.into());
161 self
162 }
163
164 /// Sets the value of [update_time][crate::model::Channel::update_time].
165 ///
166 /// # Example
167 /// ```ignore,no_run
168 /// # use google_cloud_eventarc_v1::model::Channel;
169 /// use wkt::Timestamp;
170 /// let x = Channel::new().set_update_time(Timestamp::default()/* use setters */);
171 /// ```
172 pub fn set_update_time<T>(mut self, v: T) -> Self
173 where
174 T: std::convert::Into<wkt::Timestamp>,
175 {
176 self.update_time = std::option::Option::Some(v.into());
177 self
178 }
179
180 /// Sets or clears the value of [update_time][crate::model::Channel::update_time].
181 ///
182 /// # Example
183 /// ```ignore,no_run
184 /// # use google_cloud_eventarc_v1::model::Channel;
185 /// use wkt::Timestamp;
186 /// let x = Channel::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
187 /// let x = Channel::new().set_or_clear_update_time(None::<Timestamp>);
188 /// ```
189 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
190 where
191 T: std::convert::Into<wkt::Timestamp>,
192 {
193 self.update_time = v.map(|x| x.into());
194 self
195 }
196
197 /// Sets the value of [provider][crate::model::Channel::provider].
198 ///
199 /// # Example
200 /// ```ignore,no_run
201 /// # use google_cloud_eventarc_v1::model::Channel;
202 /// let x = Channel::new().set_provider("example");
203 /// ```
204 pub fn set_provider<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
205 self.provider = v.into();
206 self
207 }
208
209 /// Sets the value of [state][crate::model::Channel::state].
210 ///
211 /// # Example
212 /// ```ignore,no_run
213 /// # use google_cloud_eventarc_v1::model::Channel;
214 /// use google_cloud_eventarc_v1::model::channel::State;
215 /// let x0 = Channel::new().set_state(State::Pending);
216 /// let x1 = Channel::new().set_state(State::Active);
217 /// let x2 = Channel::new().set_state(State::Inactive);
218 /// ```
219 pub fn set_state<T: std::convert::Into<crate::model::channel::State>>(mut self, v: T) -> Self {
220 self.state = v.into();
221 self
222 }
223
224 /// Sets the value of [activation_token][crate::model::Channel::activation_token].
225 ///
226 /// # Example
227 /// ```ignore,no_run
228 /// # use google_cloud_eventarc_v1::model::Channel;
229 /// let x = Channel::new().set_activation_token("example");
230 /// ```
231 pub fn set_activation_token<T: std::convert::Into<std::string::String>>(
232 mut self,
233 v: T,
234 ) -> Self {
235 self.activation_token = v.into();
236 self
237 }
238
239 /// Sets the value of [crypto_key_name][crate::model::Channel::crypto_key_name].
240 ///
241 /// # Example
242 /// ```ignore,no_run
243 /// # use google_cloud_eventarc_v1::model::Channel;
244 /// let x = Channel::new().set_crypto_key_name("example");
245 /// ```
246 pub fn set_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
247 self.crypto_key_name = v.into();
248 self
249 }
250
251 /// Sets the value of [satisfies_pzs][crate::model::Channel::satisfies_pzs].
252 ///
253 /// # Example
254 /// ```ignore,no_run
255 /// # use google_cloud_eventarc_v1::model::Channel;
256 /// let x = Channel::new().set_satisfies_pzs(true);
257 /// ```
258 pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
259 self.satisfies_pzs = v.into();
260 self
261 }
262
263 /// Sets the value of [labels][crate::model::Channel::labels].
264 ///
265 /// # Example
266 /// ```ignore,no_run
267 /// # use google_cloud_eventarc_v1::model::Channel;
268 /// let x = Channel::new().set_labels([
269 /// ("key0", "abc"),
270 /// ("key1", "xyz"),
271 /// ]);
272 /// ```
273 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
274 where
275 T: std::iter::IntoIterator<Item = (K, V)>,
276 K: std::convert::Into<std::string::String>,
277 V: std::convert::Into<std::string::String>,
278 {
279 use std::iter::Iterator;
280 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
281 self
282 }
283
284 /// Sets the value of [transport][crate::model::Channel::transport].
285 ///
286 /// Note that all the setters affecting `transport` are mutually
287 /// exclusive.
288 ///
289 /// # Example
290 /// ```ignore,no_run
291 /// # use google_cloud_eventarc_v1::model::Channel;
292 /// use google_cloud_eventarc_v1::model::channel::Transport;
293 /// let x = Channel::new().set_transport(Some(Transport::PubsubTopic("example".to_string())));
294 /// ```
295 pub fn set_transport<
296 T: std::convert::Into<std::option::Option<crate::model::channel::Transport>>,
297 >(
298 mut self,
299 v: T,
300 ) -> Self {
301 self.transport = v.into();
302 self
303 }
304
305 /// The value of [transport][crate::model::Channel::transport]
306 /// if it holds a `PubsubTopic`, `None` if the field is not set or
307 /// holds a different branch.
308 pub fn pubsub_topic(&self) -> std::option::Option<&std::string::String> {
309 #[allow(unreachable_patterns)]
310 self.transport.as_ref().and_then(|v| match v {
311 crate::model::channel::Transport::PubsubTopic(v) => std::option::Option::Some(v),
312 _ => std::option::Option::None,
313 })
314 }
315
316 /// Sets the value of [transport][crate::model::Channel::transport]
317 /// to hold a `PubsubTopic`.
318 ///
319 /// Note that all the setters affecting `transport` are
320 /// mutually exclusive.
321 ///
322 /// # Example
323 /// ```ignore,no_run
324 /// # use google_cloud_eventarc_v1::model::Channel;
325 /// let x = Channel::new().set_pubsub_topic("example");
326 /// assert!(x.pubsub_topic().is_some());
327 /// ```
328 pub fn set_pubsub_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
329 self.transport =
330 std::option::Option::Some(crate::model::channel::Transport::PubsubTopic(v.into()));
331 self
332 }
333}
334
335impl wkt::message::Message for Channel {
336 fn typename() -> &'static str {
337 "type.googleapis.com/google.cloud.eventarc.v1.Channel"
338 }
339}
340
341/// Defines additional types related to [Channel].
342pub mod channel {
343 #[allow(unused_imports)]
344 use super::*;
345
346 /// State lists all the possible states of a Channel
347 ///
348 /// # Working with unknown values
349 ///
350 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
351 /// additional enum variants at any time. Adding new variants is not considered
352 /// a breaking change. Applications should write their code in anticipation of:
353 ///
354 /// - New values appearing in future releases of the client library, **and**
355 /// - New values received dynamically, without application changes.
356 ///
357 /// Please consult the [Working with enums] section in the user guide for some
358 /// guidelines.
359 ///
360 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
361 #[derive(Clone, Debug, PartialEq)]
362 #[non_exhaustive]
363 pub enum State {
364 /// Default value. This value is unused.
365 Unspecified,
366 /// The PENDING state indicates that a Channel has been created successfully
367 /// and there is a new activation token available for the subscriber to use
368 /// to convey the Channel to the provider in order to create a Connection.
369 Pending,
370 /// The ACTIVE state indicates that a Channel has been successfully
371 /// connected with the event provider.
372 /// An ACTIVE Channel is ready to receive and route events from the
373 /// event provider.
374 Active,
375 /// The INACTIVE state indicates that the Channel cannot receive events
376 /// permanently. There are two possible cases this state can happen:
377 ///
378 /// 1. The SaaS provider disconnected from this Channel.
379 /// 1. The Channel activation token has expired but the SaaS provider
380 /// wasn't connected.
381 ///
382 /// To re-establish a Connection with a provider, the subscriber
383 /// should create a new Channel and give it to the provider.
384 Inactive,
385 /// If set, the enum was initialized with an unknown value.
386 ///
387 /// Applications can examine the value using [State::value] or
388 /// [State::name].
389 UnknownValue(state::UnknownValue),
390 }
391
392 #[doc(hidden)]
393 pub mod state {
394 #[allow(unused_imports)]
395 use super::*;
396 #[derive(Clone, Debug, PartialEq)]
397 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
398 }
399
400 impl State {
401 /// Gets the enum value.
402 ///
403 /// Returns `None` if the enum contains an unknown value deserialized from
404 /// the string representation of enums.
405 pub fn value(&self) -> std::option::Option<i32> {
406 match self {
407 Self::Unspecified => std::option::Option::Some(0),
408 Self::Pending => std::option::Option::Some(1),
409 Self::Active => std::option::Option::Some(2),
410 Self::Inactive => std::option::Option::Some(3),
411 Self::UnknownValue(u) => u.0.value(),
412 }
413 }
414
415 /// Gets the enum value as a string.
416 ///
417 /// Returns `None` if the enum contains an unknown value deserialized from
418 /// the integer representation of enums.
419 pub fn name(&self) -> std::option::Option<&str> {
420 match self {
421 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
422 Self::Pending => std::option::Option::Some("PENDING"),
423 Self::Active => std::option::Option::Some("ACTIVE"),
424 Self::Inactive => std::option::Option::Some("INACTIVE"),
425 Self::UnknownValue(u) => u.0.name(),
426 }
427 }
428 }
429
430 impl std::default::Default for State {
431 fn default() -> Self {
432 use std::convert::From;
433 Self::from(0)
434 }
435 }
436
437 impl std::fmt::Display for State {
438 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
439 wkt::internal::display_enum(f, self.name(), self.value())
440 }
441 }
442
443 impl std::convert::From<i32> for State {
444 fn from(value: i32) -> Self {
445 match value {
446 0 => Self::Unspecified,
447 1 => Self::Pending,
448 2 => Self::Active,
449 3 => Self::Inactive,
450 _ => Self::UnknownValue(state::UnknownValue(
451 wkt::internal::UnknownEnumValue::Integer(value),
452 )),
453 }
454 }
455 }
456
457 impl std::convert::From<&str> for State {
458 fn from(value: &str) -> Self {
459 use std::string::ToString;
460 match value {
461 "STATE_UNSPECIFIED" => Self::Unspecified,
462 "PENDING" => Self::Pending,
463 "ACTIVE" => Self::Active,
464 "INACTIVE" => Self::Inactive,
465 _ => Self::UnknownValue(state::UnknownValue(
466 wkt::internal::UnknownEnumValue::String(value.to_string()),
467 )),
468 }
469 }
470 }
471
472 impl serde::ser::Serialize for State {
473 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
474 where
475 S: serde::Serializer,
476 {
477 match self {
478 Self::Unspecified => serializer.serialize_i32(0),
479 Self::Pending => serializer.serialize_i32(1),
480 Self::Active => serializer.serialize_i32(2),
481 Self::Inactive => serializer.serialize_i32(3),
482 Self::UnknownValue(u) => u.0.serialize(serializer),
483 }
484 }
485 }
486
487 impl<'de> serde::de::Deserialize<'de> for State {
488 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
489 where
490 D: serde::Deserializer<'de>,
491 {
492 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
493 ".google.cloud.eventarc.v1.Channel.State",
494 ))
495 }
496 }
497
498 #[allow(missing_docs)]
499 #[derive(Clone, Debug, PartialEq)]
500 #[non_exhaustive]
501 pub enum Transport {
502 /// Output only. The name of the Pub/Sub topic created and managed by
503 /// Eventarc system as a transport for the event delivery. Format:
504 /// `projects/{project}/topics/{topic_id}`.
505 PubsubTopic(std::string::String),
506 }
507}
508
509/// A representation of the ChannelConnection resource.
510/// A ChannelConnection is a resource which event providers create during the
511/// activation process to establish a connection between the provider and the
512/// subscriber channel.
513#[derive(Clone, Default, PartialEq)]
514#[non_exhaustive]
515pub struct ChannelConnection {
516 /// Required. The name of the connection.
517 pub name: std::string::String,
518
519 /// Output only. Server assigned ID of the resource.
520 /// The server guarantees uniqueness and immutability until deleted.
521 pub uid: std::string::String,
522
523 /// Required. The name of the connected subscriber Channel.
524 /// This is a weak reference to avoid cross project and cross accounts
525 /// references. This must be in
526 /// `projects/{project}/location/{location}/channels/{channel_id}` format.
527 pub channel: std::string::String,
528
529 /// Output only. The creation time.
530 pub create_time: std::option::Option<wkt::Timestamp>,
531
532 /// Output only. The last-modified time.
533 pub update_time: std::option::Option<wkt::Timestamp>,
534
535 /// Input only. Activation token for the channel. The token will be used
536 /// during the creation of ChannelConnection to bind the channel with the
537 /// provider project. This field will not be stored in the provider resource.
538 pub activation_token: std::string::String,
539
540 /// Optional. Resource labels.
541 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
542
543 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
544}
545
546impl ChannelConnection {
547 /// Creates a new default instance.
548 pub fn new() -> Self {
549 std::default::Default::default()
550 }
551
552 /// Sets the value of [name][crate::model::ChannelConnection::name].
553 ///
554 /// # Example
555 /// ```ignore,no_run
556 /// # use google_cloud_eventarc_v1::model::ChannelConnection;
557 /// # let project_id = "project_id";
558 /// # let location_id = "location_id";
559 /// # let channel_connection_id = "channel_connection_id";
560 /// let x = ChannelConnection::new().set_name(format!("projects/{project_id}/locations/{location_id}/channelConnections/{channel_connection_id}"));
561 /// ```
562 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
563 self.name = v.into();
564 self
565 }
566
567 /// Sets the value of [uid][crate::model::ChannelConnection::uid].
568 ///
569 /// # Example
570 /// ```ignore,no_run
571 /// # use google_cloud_eventarc_v1::model::ChannelConnection;
572 /// let x = ChannelConnection::new().set_uid("example");
573 /// ```
574 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
575 self.uid = v.into();
576 self
577 }
578
579 /// Sets the value of [channel][crate::model::ChannelConnection::channel].
580 ///
581 /// # Example
582 /// ```ignore,no_run
583 /// # use google_cloud_eventarc_v1::model::ChannelConnection;
584 /// # let project_id = "project_id";
585 /// # let location_id = "location_id";
586 /// # let channel_id = "channel_id";
587 /// let x = ChannelConnection::new().set_channel(format!("projects/{project_id}/locations/{location_id}/channels/{channel_id}"));
588 /// ```
589 pub fn set_channel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
590 self.channel = v.into();
591 self
592 }
593
594 /// Sets the value of [create_time][crate::model::ChannelConnection::create_time].
595 ///
596 /// # Example
597 /// ```ignore,no_run
598 /// # use google_cloud_eventarc_v1::model::ChannelConnection;
599 /// use wkt::Timestamp;
600 /// let x = ChannelConnection::new().set_create_time(Timestamp::default()/* use setters */);
601 /// ```
602 pub fn set_create_time<T>(mut self, v: T) -> Self
603 where
604 T: std::convert::Into<wkt::Timestamp>,
605 {
606 self.create_time = std::option::Option::Some(v.into());
607 self
608 }
609
610 /// Sets or clears the value of [create_time][crate::model::ChannelConnection::create_time].
611 ///
612 /// # Example
613 /// ```ignore,no_run
614 /// # use google_cloud_eventarc_v1::model::ChannelConnection;
615 /// use wkt::Timestamp;
616 /// let x = ChannelConnection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
617 /// let x = ChannelConnection::new().set_or_clear_create_time(None::<Timestamp>);
618 /// ```
619 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
620 where
621 T: std::convert::Into<wkt::Timestamp>,
622 {
623 self.create_time = v.map(|x| x.into());
624 self
625 }
626
627 /// Sets the value of [update_time][crate::model::ChannelConnection::update_time].
628 ///
629 /// # Example
630 /// ```ignore,no_run
631 /// # use google_cloud_eventarc_v1::model::ChannelConnection;
632 /// use wkt::Timestamp;
633 /// let x = ChannelConnection::new().set_update_time(Timestamp::default()/* use setters */);
634 /// ```
635 pub fn set_update_time<T>(mut self, v: T) -> Self
636 where
637 T: std::convert::Into<wkt::Timestamp>,
638 {
639 self.update_time = std::option::Option::Some(v.into());
640 self
641 }
642
643 /// Sets or clears the value of [update_time][crate::model::ChannelConnection::update_time].
644 ///
645 /// # Example
646 /// ```ignore,no_run
647 /// # use google_cloud_eventarc_v1::model::ChannelConnection;
648 /// use wkt::Timestamp;
649 /// let x = ChannelConnection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
650 /// let x = ChannelConnection::new().set_or_clear_update_time(None::<Timestamp>);
651 /// ```
652 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
653 where
654 T: std::convert::Into<wkt::Timestamp>,
655 {
656 self.update_time = v.map(|x| x.into());
657 self
658 }
659
660 /// Sets the value of [activation_token][crate::model::ChannelConnection::activation_token].
661 ///
662 /// # Example
663 /// ```ignore,no_run
664 /// # use google_cloud_eventarc_v1::model::ChannelConnection;
665 /// let x = ChannelConnection::new().set_activation_token("example");
666 /// ```
667 pub fn set_activation_token<T: std::convert::Into<std::string::String>>(
668 mut self,
669 v: T,
670 ) -> Self {
671 self.activation_token = v.into();
672 self
673 }
674
675 /// Sets the value of [labels][crate::model::ChannelConnection::labels].
676 ///
677 /// # Example
678 /// ```ignore,no_run
679 /// # use google_cloud_eventarc_v1::model::ChannelConnection;
680 /// let x = ChannelConnection::new().set_labels([
681 /// ("key0", "abc"),
682 /// ("key1", "xyz"),
683 /// ]);
684 /// ```
685 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
686 where
687 T: std::iter::IntoIterator<Item = (K, V)>,
688 K: std::convert::Into<std::string::String>,
689 V: std::convert::Into<std::string::String>,
690 {
691 use std::iter::Iterator;
692 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
693 self
694 }
695}
696
697impl wkt::message::Message for ChannelConnection {
698 fn typename() -> &'static str {
699 "type.googleapis.com/google.cloud.eventarc.v1.ChannelConnection"
700 }
701}
702
703/// A representation of the Provider resource.
704#[derive(Clone, Default, PartialEq)]
705#[non_exhaustive]
706pub struct Provider {
707 /// Output only. In
708 /// `projects/{project}/locations/{location}/providers/{provider_id}` format.
709 pub name: std::string::String,
710
711 /// Output only. Human friendly name for the Provider. For example "Cloud
712 /// Storage".
713 pub display_name: std::string::String,
714
715 /// Output only. Event types for this provider.
716 pub event_types: std::vec::Vec<crate::model::EventType>,
717
718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
719}
720
721impl Provider {
722 /// Creates a new default instance.
723 pub fn new() -> Self {
724 std::default::Default::default()
725 }
726
727 /// Sets the value of [name][crate::model::Provider::name].
728 ///
729 /// # Example
730 /// ```ignore,no_run
731 /// # use google_cloud_eventarc_v1::model::Provider;
732 /// # let project_id = "project_id";
733 /// # let location_id = "location_id";
734 /// # let provider_id = "provider_id";
735 /// let x = Provider::new().set_name(format!("projects/{project_id}/locations/{location_id}/providers/{provider_id}"));
736 /// ```
737 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
738 self.name = v.into();
739 self
740 }
741
742 /// Sets the value of [display_name][crate::model::Provider::display_name].
743 ///
744 /// # Example
745 /// ```ignore,no_run
746 /// # use google_cloud_eventarc_v1::model::Provider;
747 /// let x = Provider::new().set_display_name("example");
748 /// ```
749 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
750 self.display_name = v.into();
751 self
752 }
753
754 /// Sets the value of [event_types][crate::model::Provider::event_types].
755 ///
756 /// # Example
757 /// ```ignore,no_run
758 /// # use google_cloud_eventarc_v1::model::Provider;
759 /// use google_cloud_eventarc_v1::model::EventType;
760 /// let x = Provider::new()
761 /// .set_event_types([
762 /// EventType::default()/* use setters */,
763 /// EventType::default()/* use (different) setters */,
764 /// ]);
765 /// ```
766 pub fn set_event_types<T, V>(mut self, v: T) -> Self
767 where
768 T: std::iter::IntoIterator<Item = V>,
769 V: std::convert::Into<crate::model::EventType>,
770 {
771 use std::iter::Iterator;
772 self.event_types = v.into_iter().map(|i| i.into()).collect();
773 self
774 }
775}
776
777impl wkt::message::Message for Provider {
778 fn typename() -> &'static str {
779 "type.googleapis.com/google.cloud.eventarc.v1.Provider"
780 }
781}
782
783/// A representation of the event type resource.
784#[derive(Clone, Default, PartialEq)]
785#[non_exhaustive]
786pub struct EventType {
787 /// Output only. The full name of the event type (for example,
788 /// "google.cloud.storage.object.v1.finalized"). In the form of
789 /// {provider-specific-prefix}.{resource}.{version}.{verb}. Types MUST be
790 /// versioned and event schemas are guaranteed to remain backward compatible
791 /// within one version. Note that event type versions and API versions do not
792 /// need to match.
793 pub r#type: std::string::String,
794
795 /// Output only. Human friendly description of what the event type is about.
796 /// For example "Bucket created in Cloud Storage".
797 pub description: std::string::String,
798
799 /// Output only. Filtering attributes for the event type.
800 pub filtering_attributes: std::vec::Vec<crate::model::FilteringAttribute>,
801
802 /// Output only. URI for the event schema.
803 /// For example
804 /// `https://github.com/googleapis/google-cloudevents/blob/master/proto/google/events/cloud/storage/v1/events.proto`
805 pub event_schema_uri: std::string::String,
806
807 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
808}
809
810impl EventType {
811 /// Creates a new default instance.
812 pub fn new() -> Self {
813 std::default::Default::default()
814 }
815
816 /// Sets the value of [r#type][crate::model::EventType::type].
817 ///
818 /// # Example
819 /// ```ignore,no_run
820 /// # use google_cloud_eventarc_v1::model::EventType;
821 /// let x = EventType::new().set_type("example");
822 /// ```
823 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
824 self.r#type = v.into();
825 self
826 }
827
828 /// Sets the value of [description][crate::model::EventType::description].
829 ///
830 /// # Example
831 /// ```ignore,no_run
832 /// # use google_cloud_eventarc_v1::model::EventType;
833 /// let x = EventType::new().set_description("example");
834 /// ```
835 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
836 self.description = v.into();
837 self
838 }
839
840 /// Sets the value of [filtering_attributes][crate::model::EventType::filtering_attributes].
841 ///
842 /// # Example
843 /// ```ignore,no_run
844 /// # use google_cloud_eventarc_v1::model::EventType;
845 /// use google_cloud_eventarc_v1::model::FilteringAttribute;
846 /// let x = EventType::new()
847 /// .set_filtering_attributes([
848 /// FilteringAttribute::default()/* use setters */,
849 /// FilteringAttribute::default()/* use (different) setters */,
850 /// ]);
851 /// ```
852 pub fn set_filtering_attributes<T, V>(mut self, v: T) -> Self
853 where
854 T: std::iter::IntoIterator<Item = V>,
855 V: std::convert::Into<crate::model::FilteringAttribute>,
856 {
857 use std::iter::Iterator;
858 self.filtering_attributes = v.into_iter().map(|i| i.into()).collect();
859 self
860 }
861
862 /// Sets the value of [event_schema_uri][crate::model::EventType::event_schema_uri].
863 ///
864 /// # Example
865 /// ```ignore,no_run
866 /// # use google_cloud_eventarc_v1::model::EventType;
867 /// let x = EventType::new().set_event_schema_uri("example");
868 /// ```
869 pub fn set_event_schema_uri<T: std::convert::Into<std::string::String>>(
870 mut self,
871 v: T,
872 ) -> Self {
873 self.event_schema_uri = v.into();
874 self
875 }
876}
877
878impl wkt::message::Message for EventType {
879 fn typename() -> &'static str {
880 "type.googleapis.com/google.cloud.eventarc.v1.EventType"
881 }
882}
883
884/// A representation of the FilteringAttribute resource.
885/// Filtering attributes are per event type.
886#[derive(Clone, Default, PartialEq)]
887#[non_exhaustive]
888pub struct FilteringAttribute {
889 /// Output only. Attribute used for filtering the event type.
890 pub attribute: std::string::String,
891
892 /// Output only. Description of the purpose of the attribute.
893 pub description: std::string::String,
894
895 /// Output only. If true, the triggers for this provider should always specify
896 /// a filter on these attributes. Trigger creation will fail otherwise.
897 pub required: bool,
898
899 /// Output only. If true, the attribute accepts matching expressions in the
900 /// Eventarc PathPattern format.
901 pub path_pattern_supported: bool,
902
903 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
904}
905
906impl FilteringAttribute {
907 /// Creates a new default instance.
908 pub fn new() -> Self {
909 std::default::Default::default()
910 }
911
912 /// Sets the value of [attribute][crate::model::FilteringAttribute::attribute].
913 ///
914 /// # Example
915 /// ```ignore,no_run
916 /// # use google_cloud_eventarc_v1::model::FilteringAttribute;
917 /// let x = FilteringAttribute::new().set_attribute("example");
918 /// ```
919 pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
920 self.attribute = v.into();
921 self
922 }
923
924 /// Sets the value of [description][crate::model::FilteringAttribute::description].
925 ///
926 /// # Example
927 /// ```ignore,no_run
928 /// # use google_cloud_eventarc_v1::model::FilteringAttribute;
929 /// let x = FilteringAttribute::new().set_description("example");
930 /// ```
931 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
932 self.description = v.into();
933 self
934 }
935
936 /// Sets the value of [required][crate::model::FilteringAttribute::required].
937 ///
938 /// # Example
939 /// ```ignore,no_run
940 /// # use google_cloud_eventarc_v1::model::FilteringAttribute;
941 /// let x = FilteringAttribute::new().set_required(true);
942 /// ```
943 pub fn set_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
944 self.required = v.into();
945 self
946 }
947
948 /// Sets the value of [path_pattern_supported][crate::model::FilteringAttribute::path_pattern_supported].
949 ///
950 /// # Example
951 /// ```ignore,no_run
952 /// # use google_cloud_eventarc_v1::model::FilteringAttribute;
953 /// let x = FilteringAttribute::new().set_path_pattern_supported(true);
954 /// ```
955 pub fn set_path_pattern_supported<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
956 self.path_pattern_supported = v.into();
957 self
958 }
959}
960
961impl wkt::message::Message for FilteringAttribute {
962 fn typename() -> &'static str {
963 "type.googleapis.com/google.cloud.eventarc.v1.FilteringAttribute"
964 }
965}
966
967/// An enrollment represents a subscription for messages on a particular message
968/// bus. It defines a matching criteria for messages on the bus and the
969/// subscriber endpoint where matched messages should be delivered.
970#[derive(Clone, Default, PartialEq)]
971#[non_exhaustive]
972pub struct Enrollment {
973 /// Identifier. Resource name of the form
974 /// projects/{project}/locations/{location}/enrollments/{enrollment}
975 pub name: std::string::String,
976
977 /// Output only. Server assigned unique identifier for the channel. The value
978 /// is a UUID4 string and guaranteed to remain unchanged until the resource is
979 /// deleted.
980 pub uid: std::string::String,
981
982 /// Output only. This checksum is computed by the server based on the value of
983 /// other fields, and might be sent only on update and delete requests to
984 /// ensure that the client has an up-to-date value before proceeding.
985 pub etag: std::string::String,
986
987 /// Output only. The creation time.
988 pub create_time: std::option::Option<wkt::Timestamp>,
989
990 /// Output only. The last-modified time.
991 pub update_time: std::option::Option<wkt::Timestamp>,
992
993 /// Optional. Resource labels.
994 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
995
996 /// Optional. Resource annotations.
997 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
998
999 /// Optional. Resource display name.
1000 pub display_name: std::string::String,
1001
1002 /// Required. A CEL expression identifying which messages this enrollment
1003 /// applies to.
1004 pub cel_match: std::string::String,
1005
1006 /// Required. Immutable. Resource name of the message bus identifying the
1007 /// source of the messages. It matches the form
1008 /// projects/{project}/locations/{location}/messageBuses/{messageBus}.
1009 pub message_bus: std::string::String,
1010
1011 /// Required. Destination is the Pipeline that the Enrollment is delivering to.
1012 /// It must point to the full resource name of a Pipeline. Format:
1013 /// "projects/{PROJECT_ID}/locations/{region}/pipelines/{PIPELINE_ID)"
1014 pub destination: std::string::String,
1015
1016 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1017}
1018
1019impl Enrollment {
1020 /// Creates a new default instance.
1021 pub fn new() -> Self {
1022 std::default::Default::default()
1023 }
1024
1025 /// Sets the value of [name][crate::model::Enrollment::name].
1026 ///
1027 /// # Example
1028 /// ```ignore,no_run
1029 /// # use google_cloud_eventarc_v1::model::Enrollment;
1030 /// # let project_id = "project_id";
1031 /// # let location_id = "location_id";
1032 /// # let enrollment_id = "enrollment_id";
1033 /// let x = Enrollment::new().set_name(format!("projects/{project_id}/locations/{location_id}/enrollments/{enrollment_id}"));
1034 /// ```
1035 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1036 self.name = v.into();
1037 self
1038 }
1039
1040 /// Sets the value of [uid][crate::model::Enrollment::uid].
1041 ///
1042 /// # Example
1043 /// ```ignore,no_run
1044 /// # use google_cloud_eventarc_v1::model::Enrollment;
1045 /// let x = Enrollment::new().set_uid("example");
1046 /// ```
1047 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1048 self.uid = v.into();
1049 self
1050 }
1051
1052 /// Sets the value of [etag][crate::model::Enrollment::etag].
1053 ///
1054 /// # Example
1055 /// ```ignore,no_run
1056 /// # use google_cloud_eventarc_v1::model::Enrollment;
1057 /// let x = Enrollment::new().set_etag("example");
1058 /// ```
1059 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1060 self.etag = v.into();
1061 self
1062 }
1063
1064 /// Sets the value of [create_time][crate::model::Enrollment::create_time].
1065 ///
1066 /// # Example
1067 /// ```ignore,no_run
1068 /// # use google_cloud_eventarc_v1::model::Enrollment;
1069 /// use wkt::Timestamp;
1070 /// let x = Enrollment::new().set_create_time(Timestamp::default()/* use setters */);
1071 /// ```
1072 pub fn set_create_time<T>(mut self, v: T) -> Self
1073 where
1074 T: std::convert::Into<wkt::Timestamp>,
1075 {
1076 self.create_time = std::option::Option::Some(v.into());
1077 self
1078 }
1079
1080 /// Sets or clears the value of [create_time][crate::model::Enrollment::create_time].
1081 ///
1082 /// # Example
1083 /// ```ignore,no_run
1084 /// # use google_cloud_eventarc_v1::model::Enrollment;
1085 /// use wkt::Timestamp;
1086 /// let x = Enrollment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1087 /// let x = Enrollment::new().set_or_clear_create_time(None::<Timestamp>);
1088 /// ```
1089 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1090 where
1091 T: std::convert::Into<wkt::Timestamp>,
1092 {
1093 self.create_time = v.map(|x| x.into());
1094 self
1095 }
1096
1097 /// Sets the value of [update_time][crate::model::Enrollment::update_time].
1098 ///
1099 /// # Example
1100 /// ```ignore,no_run
1101 /// # use google_cloud_eventarc_v1::model::Enrollment;
1102 /// use wkt::Timestamp;
1103 /// let x = Enrollment::new().set_update_time(Timestamp::default()/* use setters */);
1104 /// ```
1105 pub fn set_update_time<T>(mut self, v: T) -> Self
1106 where
1107 T: std::convert::Into<wkt::Timestamp>,
1108 {
1109 self.update_time = std::option::Option::Some(v.into());
1110 self
1111 }
1112
1113 /// Sets or clears the value of [update_time][crate::model::Enrollment::update_time].
1114 ///
1115 /// # Example
1116 /// ```ignore,no_run
1117 /// # use google_cloud_eventarc_v1::model::Enrollment;
1118 /// use wkt::Timestamp;
1119 /// let x = Enrollment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1120 /// let x = Enrollment::new().set_or_clear_update_time(None::<Timestamp>);
1121 /// ```
1122 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1123 where
1124 T: std::convert::Into<wkt::Timestamp>,
1125 {
1126 self.update_time = v.map(|x| x.into());
1127 self
1128 }
1129
1130 /// Sets the value of [labels][crate::model::Enrollment::labels].
1131 ///
1132 /// # Example
1133 /// ```ignore,no_run
1134 /// # use google_cloud_eventarc_v1::model::Enrollment;
1135 /// let x = Enrollment::new().set_labels([
1136 /// ("key0", "abc"),
1137 /// ("key1", "xyz"),
1138 /// ]);
1139 /// ```
1140 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1141 where
1142 T: std::iter::IntoIterator<Item = (K, V)>,
1143 K: std::convert::Into<std::string::String>,
1144 V: std::convert::Into<std::string::String>,
1145 {
1146 use std::iter::Iterator;
1147 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1148 self
1149 }
1150
1151 /// Sets the value of [annotations][crate::model::Enrollment::annotations].
1152 ///
1153 /// # Example
1154 /// ```ignore,no_run
1155 /// # use google_cloud_eventarc_v1::model::Enrollment;
1156 /// let x = Enrollment::new().set_annotations([
1157 /// ("key0", "abc"),
1158 /// ("key1", "xyz"),
1159 /// ]);
1160 /// ```
1161 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
1162 where
1163 T: std::iter::IntoIterator<Item = (K, V)>,
1164 K: std::convert::Into<std::string::String>,
1165 V: std::convert::Into<std::string::String>,
1166 {
1167 use std::iter::Iterator;
1168 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1169 self
1170 }
1171
1172 /// Sets the value of [display_name][crate::model::Enrollment::display_name].
1173 ///
1174 /// # Example
1175 /// ```ignore,no_run
1176 /// # use google_cloud_eventarc_v1::model::Enrollment;
1177 /// let x = Enrollment::new().set_display_name("example");
1178 /// ```
1179 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1180 self.display_name = v.into();
1181 self
1182 }
1183
1184 /// Sets the value of [cel_match][crate::model::Enrollment::cel_match].
1185 ///
1186 /// # Example
1187 /// ```ignore,no_run
1188 /// # use google_cloud_eventarc_v1::model::Enrollment;
1189 /// let x = Enrollment::new().set_cel_match("example");
1190 /// ```
1191 pub fn set_cel_match<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1192 self.cel_match = v.into();
1193 self
1194 }
1195
1196 /// Sets the value of [message_bus][crate::model::Enrollment::message_bus].
1197 ///
1198 /// # Example
1199 /// ```ignore,no_run
1200 /// # use google_cloud_eventarc_v1::model::Enrollment;
1201 /// # let project_id = "project_id";
1202 /// # let location_id = "location_id";
1203 /// # let message_bus_id = "message_bus_id";
1204 /// let x = Enrollment::new().set_message_bus(format!("projects/{project_id}/locations/{location_id}/messageBuses/{message_bus_id}"));
1205 /// ```
1206 pub fn set_message_bus<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1207 self.message_bus = v.into();
1208 self
1209 }
1210
1211 /// Sets the value of [destination][crate::model::Enrollment::destination].
1212 ///
1213 /// # Example
1214 /// ```ignore,no_run
1215 /// # use google_cloud_eventarc_v1::model::Enrollment;
1216 /// let x = Enrollment::new().set_destination("example");
1217 /// ```
1218 pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1219 self.destination = v.into();
1220 self
1221 }
1222}
1223
1224impl wkt::message::Message for Enrollment {
1225 fn typename() -> &'static str {
1226 "type.googleapis.com/google.cloud.eventarc.v1.Enrollment"
1227 }
1228}
1229
1230/// The request message for the GetTrigger method.
1231#[derive(Clone, Default, PartialEq)]
1232#[non_exhaustive]
1233pub struct GetTriggerRequest {
1234 /// Required. The name of the trigger to get.
1235 pub name: std::string::String,
1236
1237 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1238}
1239
1240impl GetTriggerRequest {
1241 /// Creates a new default instance.
1242 pub fn new() -> Self {
1243 std::default::Default::default()
1244 }
1245
1246 /// Sets the value of [name][crate::model::GetTriggerRequest::name].
1247 ///
1248 /// # Example
1249 /// ```ignore,no_run
1250 /// # use google_cloud_eventarc_v1::model::GetTriggerRequest;
1251 /// # let project_id = "project_id";
1252 /// # let location_id = "location_id";
1253 /// # let trigger_id = "trigger_id";
1254 /// let x = GetTriggerRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/triggers/{trigger_id}"));
1255 /// ```
1256 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1257 self.name = v.into();
1258 self
1259 }
1260}
1261
1262impl wkt::message::Message for GetTriggerRequest {
1263 fn typename() -> &'static str {
1264 "type.googleapis.com/google.cloud.eventarc.v1.GetTriggerRequest"
1265 }
1266}
1267
1268/// The request message for the ListTriggers method.
1269#[derive(Clone, Default, PartialEq)]
1270#[non_exhaustive]
1271pub struct ListTriggersRequest {
1272 /// Required. The parent collection to list triggers on.
1273 pub parent: std::string::String,
1274
1275 /// The maximum number of triggers to return on each page.
1276 ///
1277 /// Note: The service may send fewer.
1278 pub page_size: i32,
1279
1280 /// The page token; provide the value from the `next_page_token` field in a
1281 /// previous `ListTriggers` call to retrieve the subsequent page.
1282 ///
1283 /// When paginating, all other parameters provided to `ListTriggers` must match
1284 /// the call that provided the page token.
1285 pub page_token: std::string::String,
1286
1287 /// The sorting order of the resources returned. Value should be a
1288 /// comma-separated list of fields. The default sorting order is ascending. To
1289 /// specify descending order for a field, append a `desc` suffix; for example:
1290 /// `name desc, trigger_id`.
1291 pub order_by: std::string::String,
1292
1293 /// Filter field. Used to filter the Triggers to be listed. Possible filters
1294 /// are described in <https://google.aip.dev/160>. For example, using
1295 /// "?filter=destination:gke" would list only Triggers with a gke destination.
1296 pub filter: std::string::String,
1297
1298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1299}
1300
1301impl ListTriggersRequest {
1302 /// Creates a new default instance.
1303 pub fn new() -> Self {
1304 std::default::Default::default()
1305 }
1306
1307 /// Sets the value of [parent][crate::model::ListTriggersRequest::parent].
1308 ///
1309 /// # Example
1310 /// ```ignore,no_run
1311 /// # use google_cloud_eventarc_v1::model::ListTriggersRequest;
1312 /// # let project_id = "project_id";
1313 /// # let location_id = "location_id";
1314 /// let x = ListTriggersRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
1315 /// ```
1316 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1317 self.parent = v.into();
1318 self
1319 }
1320
1321 /// Sets the value of [page_size][crate::model::ListTriggersRequest::page_size].
1322 ///
1323 /// # Example
1324 /// ```ignore,no_run
1325 /// # use google_cloud_eventarc_v1::model::ListTriggersRequest;
1326 /// let x = ListTriggersRequest::new().set_page_size(42);
1327 /// ```
1328 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1329 self.page_size = v.into();
1330 self
1331 }
1332
1333 /// Sets the value of [page_token][crate::model::ListTriggersRequest::page_token].
1334 ///
1335 /// # Example
1336 /// ```ignore,no_run
1337 /// # use google_cloud_eventarc_v1::model::ListTriggersRequest;
1338 /// let x = ListTriggersRequest::new().set_page_token("example");
1339 /// ```
1340 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1341 self.page_token = v.into();
1342 self
1343 }
1344
1345 /// Sets the value of [order_by][crate::model::ListTriggersRequest::order_by].
1346 ///
1347 /// # Example
1348 /// ```ignore,no_run
1349 /// # use google_cloud_eventarc_v1::model::ListTriggersRequest;
1350 /// let x = ListTriggersRequest::new().set_order_by("example");
1351 /// ```
1352 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1353 self.order_by = v.into();
1354 self
1355 }
1356
1357 /// Sets the value of [filter][crate::model::ListTriggersRequest::filter].
1358 ///
1359 /// # Example
1360 /// ```ignore,no_run
1361 /// # use google_cloud_eventarc_v1::model::ListTriggersRequest;
1362 /// let x = ListTriggersRequest::new().set_filter("example");
1363 /// ```
1364 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1365 self.filter = v.into();
1366 self
1367 }
1368}
1369
1370impl wkt::message::Message for ListTriggersRequest {
1371 fn typename() -> &'static str {
1372 "type.googleapis.com/google.cloud.eventarc.v1.ListTriggersRequest"
1373 }
1374}
1375
1376/// The response message for the `ListTriggers` method.
1377#[derive(Clone, Default, PartialEq)]
1378#[non_exhaustive]
1379pub struct ListTriggersResponse {
1380 /// The requested triggers, up to the number specified in `page_size`.
1381 pub triggers: std::vec::Vec<crate::model::Trigger>,
1382
1383 /// A page token that can be sent to `ListTriggers` to request the next page.
1384 /// If this is empty, then there are no more pages.
1385 pub next_page_token: std::string::String,
1386
1387 /// Unreachable resources, if any.
1388 pub unreachable: std::vec::Vec<std::string::String>,
1389
1390 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1391}
1392
1393impl ListTriggersResponse {
1394 /// Creates a new default instance.
1395 pub fn new() -> Self {
1396 std::default::Default::default()
1397 }
1398
1399 /// Sets the value of [triggers][crate::model::ListTriggersResponse::triggers].
1400 ///
1401 /// # Example
1402 /// ```ignore,no_run
1403 /// # use google_cloud_eventarc_v1::model::ListTriggersResponse;
1404 /// use google_cloud_eventarc_v1::model::Trigger;
1405 /// let x = ListTriggersResponse::new()
1406 /// .set_triggers([
1407 /// Trigger::default()/* use setters */,
1408 /// Trigger::default()/* use (different) setters */,
1409 /// ]);
1410 /// ```
1411 pub fn set_triggers<T, V>(mut self, v: T) -> Self
1412 where
1413 T: std::iter::IntoIterator<Item = V>,
1414 V: std::convert::Into<crate::model::Trigger>,
1415 {
1416 use std::iter::Iterator;
1417 self.triggers = v.into_iter().map(|i| i.into()).collect();
1418 self
1419 }
1420
1421 /// Sets the value of [next_page_token][crate::model::ListTriggersResponse::next_page_token].
1422 ///
1423 /// # Example
1424 /// ```ignore,no_run
1425 /// # use google_cloud_eventarc_v1::model::ListTriggersResponse;
1426 /// let x = ListTriggersResponse::new().set_next_page_token("example");
1427 /// ```
1428 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1429 self.next_page_token = v.into();
1430 self
1431 }
1432
1433 /// Sets the value of [unreachable][crate::model::ListTriggersResponse::unreachable].
1434 ///
1435 /// # Example
1436 /// ```ignore,no_run
1437 /// # use google_cloud_eventarc_v1::model::ListTriggersResponse;
1438 /// let x = ListTriggersResponse::new().set_unreachable(["a", "b", "c"]);
1439 /// ```
1440 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1441 where
1442 T: std::iter::IntoIterator<Item = V>,
1443 V: std::convert::Into<std::string::String>,
1444 {
1445 use std::iter::Iterator;
1446 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1447 self
1448 }
1449}
1450
1451impl wkt::message::Message for ListTriggersResponse {
1452 fn typename() -> &'static str {
1453 "type.googleapis.com/google.cloud.eventarc.v1.ListTriggersResponse"
1454 }
1455}
1456
1457#[doc(hidden)]
1458impl google_cloud_gax::paginator::internal::PageableResponse for ListTriggersResponse {
1459 type PageItem = crate::model::Trigger;
1460
1461 fn items(self) -> std::vec::Vec<Self::PageItem> {
1462 self.triggers
1463 }
1464
1465 fn next_page_token(&self) -> std::string::String {
1466 use std::clone::Clone;
1467 self.next_page_token.clone()
1468 }
1469}
1470
1471/// The request message for the CreateTrigger method.
1472#[derive(Clone, Default, PartialEq)]
1473#[non_exhaustive]
1474pub struct CreateTriggerRequest {
1475 /// Required. The parent collection in which to add this trigger.
1476 pub parent: std::string::String,
1477
1478 /// Required. The trigger to create.
1479 pub trigger: std::option::Option<crate::model::Trigger>,
1480
1481 /// Required. The user-provided ID to be assigned to the trigger.
1482 pub trigger_id: std::string::String,
1483
1484 /// Optional. If set, validate the request and preview the review, but do not
1485 /// post it.
1486 pub validate_only: bool,
1487
1488 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1489}
1490
1491impl CreateTriggerRequest {
1492 /// Creates a new default instance.
1493 pub fn new() -> Self {
1494 std::default::Default::default()
1495 }
1496
1497 /// Sets the value of [parent][crate::model::CreateTriggerRequest::parent].
1498 ///
1499 /// # Example
1500 /// ```ignore,no_run
1501 /// # use google_cloud_eventarc_v1::model::CreateTriggerRequest;
1502 /// # let project_id = "project_id";
1503 /// # let location_id = "location_id";
1504 /// let x = CreateTriggerRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
1505 /// ```
1506 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1507 self.parent = v.into();
1508 self
1509 }
1510
1511 /// Sets the value of [trigger][crate::model::CreateTriggerRequest::trigger].
1512 ///
1513 /// # Example
1514 /// ```ignore,no_run
1515 /// # use google_cloud_eventarc_v1::model::CreateTriggerRequest;
1516 /// use google_cloud_eventarc_v1::model::Trigger;
1517 /// let x = CreateTriggerRequest::new().set_trigger(Trigger::default()/* use setters */);
1518 /// ```
1519 pub fn set_trigger<T>(mut self, v: T) -> Self
1520 where
1521 T: std::convert::Into<crate::model::Trigger>,
1522 {
1523 self.trigger = std::option::Option::Some(v.into());
1524 self
1525 }
1526
1527 /// Sets or clears the value of [trigger][crate::model::CreateTriggerRequest::trigger].
1528 ///
1529 /// # Example
1530 /// ```ignore,no_run
1531 /// # use google_cloud_eventarc_v1::model::CreateTriggerRequest;
1532 /// use google_cloud_eventarc_v1::model::Trigger;
1533 /// let x = CreateTriggerRequest::new().set_or_clear_trigger(Some(Trigger::default()/* use setters */));
1534 /// let x = CreateTriggerRequest::new().set_or_clear_trigger(None::<Trigger>);
1535 /// ```
1536 pub fn set_or_clear_trigger<T>(mut self, v: std::option::Option<T>) -> Self
1537 where
1538 T: std::convert::Into<crate::model::Trigger>,
1539 {
1540 self.trigger = v.map(|x| x.into());
1541 self
1542 }
1543
1544 /// Sets the value of [trigger_id][crate::model::CreateTriggerRequest::trigger_id].
1545 ///
1546 /// # Example
1547 /// ```ignore,no_run
1548 /// # use google_cloud_eventarc_v1::model::CreateTriggerRequest;
1549 /// let x = CreateTriggerRequest::new().set_trigger_id("example");
1550 /// ```
1551 pub fn set_trigger_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1552 self.trigger_id = v.into();
1553 self
1554 }
1555
1556 /// Sets the value of [validate_only][crate::model::CreateTriggerRequest::validate_only].
1557 ///
1558 /// # Example
1559 /// ```ignore,no_run
1560 /// # use google_cloud_eventarc_v1::model::CreateTriggerRequest;
1561 /// let x = CreateTriggerRequest::new().set_validate_only(true);
1562 /// ```
1563 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1564 self.validate_only = v.into();
1565 self
1566 }
1567}
1568
1569impl wkt::message::Message for CreateTriggerRequest {
1570 fn typename() -> &'static str {
1571 "type.googleapis.com/google.cloud.eventarc.v1.CreateTriggerRequest"
1572 }
1573}
1574
1575/// The request message for the UpdateTrigger method.
1576#[derive(Clone, Default, PartialEq)]
1577#[non_exhaustive]
1578pub struct UpdateTriggerRequest {
1579 /// The trigger to be updated.
1580 pub trigger: std::option::Option<crate::model::Trigger>,
1581
1582 /// The fields to be updated; only fields explicitly provided are updated.
1583 /// If no field mask is provided, all provided fields in the request are
1584 /// updated. To update all fields, provide a field mask of "*".
1585 pub update_mask: std::option::Option<wkt::FieldMask>,
1586
1587 /// If set to true, and the trigger is not found, a new trigger will be
1588 /// created. In this situation, `update_mask` is ignored.
1589 pub allow_missing: bool,
1590
1591 /// Optional. If set, validate the request and preview the review, but do not
1592 /// post it.
1593 pub validate_only: bool,
1594
1595 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1596}
1597
1598impl UpdateTriggerRequest {
1599 /// Creates a new default instance.
1600 pub fn new() -> Self {
1601 std::default::Default::default()
1602 }
1603
1604 /// Sets the value of [trigger][crate::model::UpdateTriggerRequest::trigger].
1605 ///
1606 /// # Example
1607 /// ```ignore,no_run
1608 /// # use google_cloud_eventarc_v1::model::UpdateTriggerRequest;
1609 /// use google_cloud_eventarc_v1::model::Trigger;
1610 /// let x = UpdateTriggerRequest::new().set_trigger(Trigger::default()/* use setters */);
1611 /// ```
1612 pub fn set_trigger<T>(mut self, v: T) -> Self
1613 where
1614 T: std::convert::Into<crate::model::Trigger>,
1615 {
1616 self.trigger = std::option::Option::Some(v.into());
1617 self
1618 }
1619
1620 /// Sets or clears the value of [trigger][crate::model::UpdateTriggerRequest::trigger].
1621 ///
1622 /// # Example
1623 /// ```ignore,no_run
1624 /// # use google_cloud_eventarc_v1::model::UpdateTriggerRequest;
1625 /// use google_cloud_eventarc_v1::model::Trigger;
1626 /// let x = UpdateTriggerRequest::new().set_or_clear_trigger(Some(Trigger::default()/* use setters */));
1627 /// let x = UpdateTriggerRequest::new().set_or_clear_trigger(None::<Trigger>);
1628 /// ```
1629 pub fn set_or_clear_trigger<T>(mut self, v: std::option::Option<T>) -> Self
1630 where
1631 T: std::convert::Into<crate::model::Trigger>,
1632 {
1633 self.trigger = v.map(|x| x.into());
1634 self
1635 }
1636
1637 /// Sets the value of [update_mask][crate::model::UpdateTriggerRequest::update_mask].
1638 ///
1639 /// # Example
1640 /// ```ignore,no_run
1641 /// # use google_cloud_eventarc_v1::model::UpdateTriggerRequest;
1642 /// use wkt::FieldMask;
1643 /// let x = UpdateTriggerRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1644 /// ```
1645 pub fn set_update_mask<T>(mut self, v: T) -> Self
1646 where
1647 T: std::convert::Into<wkt::FieldMask>,
1648 {
1649 self.update_mask = std::option::Option::Some(v.into());
1650 self
1651 }
1652
1653 /// Sets or clears the value of [update_mask][crate::model::UpdateTriggerRequest::update_mask].
1654 ///
1655 /// # Example
1656 /// ```ignore,no_run
1657 /// # use google_cloud_eventarc_v1::model::UpdateTriggerRequest;
1658 /// use wkt::FieldMask;
1659 /// let x = UpdateTriggerRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1660 /// let x = UpdateTriggerRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1661 /// ```
1662 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1663 where
1664 T: std::convert::Into<wkt::FieldMask>,
1665 {
1666 self.update_mask = v.map(|x| x.into());
1667 self
1668 }
1669
1670 /// Sets the value of [allow_missing][crate::model::UpdateTriggerRequest::allow_missing].
1671 ///
1672 /// # Example
1673 /// ```ignore,no_run
1674 /// # use google_cloud_eventarc_v1::model::UpdateTriggerRequest;
1675 /// let x = UpdateTriggerRequest::new().set_allow_missing(true);
1676 /// ```
1677 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1678 self.allow_missing = v.into();
1679 self
1680 }
1681
1682 /// Sets the value of [validate_only][crate::model::UpdateTriggerRequest::validate_only].
1683 ///
1684 /// # Example
1685 /// ```ignore,no_run
1686 /// # use google_cloud_eventarc_v1::model::UpdateTriggerRequest;
1687 /// let x = UpdateTriggerRequest::new().set_validate_only(true);
1688 /// ```
1689 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1690 self.validate_only = v.into();
1691 self
1692 }
1693}
1694
1695impl wkt::message::Message for UpdateTriggerRequest {
1696 fn typename() -> &'static str {
1697 "type.googleapis.com/google.cloud.eventarc.v1.UpdateTriggerRequest"
1698 }
1699}
1700
1701/// The request message for the DeleteTrigger method.
1702#[derive(Clone, Default, PartialEq)]
1703#[non_exhaustive]
1704pub struct DeleteTriggerRequest {
1705 /// Required. The name of the trigger to be deleted.
1706 pub name: std::string::String,
1707
1708 /// If provided, the trigger will only be deleted if the etag matches the
1709 /// current etag on the resource.
1710 pub etag: std::string::String,
1711
1712 /// If set to true, and the trigger is not found, the request will succeed
1713 /// but no action will be taken on the server.
1714 pub allow_missing: bool,
1715
1716 /// Optional. If set, validate the request and preview the review, but do not
1717 /// post it.
1718 pub validate_only: bool,
1719
1720 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1721}
1722
1723impl DeleteTriggerRequest {
1724 /// Creates a new default instance.
1725 pub fn new() -> Self {
1726 std::default::Default::default()
1727 }
1728
1729 /// Sets the value of [name][crate::model::DeleteTriggerRequest::name].
1730 ///
1731 /// # Example
1732 /// ```ignore,no_run
1733 /// # use google_cloud_eventarc_v1::model::DeleteTriggerRequest;
1734 /// # let project_id = "project_id";
1735 /// # let location_id = "location_id";
1736 /// # let trigger_id = "trigger_id";
1737 /// let x = DeleteTriggerRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/triggers/{trigger_id}"));
1738 /// ```
1739 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1740 self.name = v.into();
1741 self
1742 }
1743
1744 /// Sets the value of [etag][crate::model::DeleteTriggerRequest::etag].
1745 ///
1746 /// # Example
1747 /// ```ignore,no_run
1748 /// # use google_cloud_eventarc_v1::model::DeleteTriggerRequest;
1749 /// let x = DeleteTriggerRequest::new().set_etag("example");
1750 /// ```
1751 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1752 self.etag = v.into();
1753 self
1754 }
1755
1756 /// Sets the value of [allow_missing][crate::model::DeleteTriggerRequest::allow_missing].
1757 ///
1758 /// # Example
1759 /// ```ignore,no_run
1760 /// # use google_cloud_eventarc_v1::model::DeleteTriggerRequest;
1761 /// let x = DeleteTriggerRequest::new().set_allow_missing(true);
1762 /// ```
1763 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1764 self.allow_missing = v.into();
1765 self
1766 }
1767
1768 /// Sets the value of [validate_only][crate::model::DeleteTriggerRequest::validate_only].
1769 ///
1770 /// # Example
1771 /// ```ignore,no_run
1772 /// # use google_cloud_eventarc_v1::model::DeleteTriggerRequest;
1773 /// let x = DeleteTriggerRequest::new().set_validate_only(true);
1774 /// ```
1775 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1776 self.validate_only = v.into();
1777 self
1778 }
1779}
1780
1781impl wkt::message::Message for DeleteTriggerRequest {
1782 fn typename() -> &'static str {
1783 "type.googleapis.com/google.cloud.eventarc.v1.DeleteTriggerRequest"
1784 }
1785}
1786
1787/// The request message for the GetChannel method.
1788#[derive(Clone, Default, PartialEq)]
1789#[non_exhaustive]
1790pub struct GetChannelRequest {
1791 /// Required. The name of the channel to get.
1792 pub name: std::string::String,
1793
1794 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1795}
1796
1797impl GetChannelRequest {
1798 /// Creates a new default instance.
1799 pub fn new() -> Self {
1800 std::default::Default::default()
1801 }
1802
1803 /// Sets the value of [name][crate::model::GetChannelRequest::name].
1804 ///
1805 /// # Example
1806 /// ```ignore,no_run
1807 /// # use google_cloud_eventarc_v1::model::GetChannelRequest;
1808 /// # let project_id = "project_id";
1809 /// # let location_id = "location_id";
1810 /// # let channel_id = "channel_id";
1811 /// let x = GetChannelRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/channels/{channel_id}"));
1812 /// ```
1813 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1814 self.name = v.into();
1815 self
1816 }
1817}
1818
1819impl wkt::message::Message for GetChannelRequest {
1820 fn typename() -> &'static str {
1821 "type.googleapis.com/google.cloud.eventarc.v1.GetChannelRequest"
1822 }
1823}
1824
1825/// The request message for the ListChannels method.
1826#[derive(Clone, Default, PartialEq)]
1827#[non_exhaustive]
1828pub struct ListChannelsRequest {
1829 /// Required. The parent collection to list channels on.
1830 pub parent: std::string::String,
1831
1832 /// The maximum number of channels to return on each page.
1833 ///
1834 /// Note: The service may send fewer.
1835 pub page_size: i32,
1836
1837 /// The page token; provide the value from the `next_page_token` field in a
1838 /// previous `ListChannels` call to retrieve the subsequent page.
1839 ///
1840 /// When paginating, all other parameters provided to `ListChannels` must
1841 /// match the call that provided the page token.
1842 pub page_token: std::string::String,
1843
1844 /// The sorting order of the resources returned. Value should be a
1845 /// comma-separated list of fields. The default sorting order is ascending. To
1846 /// specify descending order for a field, append a `desc` suffix; for example:
1847 /// `name desc, channel_id`.
1848 pub order_by: std::string::String,
1849
1850 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1851}
1852
1853impl ListChannelsRequest {
1854 /// Creates a new default instance.
1855 pub fn new() -> Self {
1856 std::default::Default::default()
1857 }
1858
1859 /// Sets the value of [parent][crate::model::ListChannelsRequest::parent].
1860 ///
1861 /// # Example
1862 /// ```ignore,no_run
1863 /// # use google_cloud_eventarc_v1::model::ListChannelsRequest;
1864 /// # let project_id = "project_id";
1865 /// # let location_id = "location_id";
1866 /// let x = ListChannelsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
1867 /// ```
1868 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1869 self.parent = v.into();
1870 self
1871 }
1872
1873 /// Sets the value of [page_size][crate::model::ListChannelsRequest::page_size].
1874 ///
1875 /// # Example
1876 /// ```ignore,no_run
1877 /// # use google_cloud_eventarc_v1::model::ListChannelsRequest;
1878 /// let x = ListChannelsRequest::new().set_page_size(42);
1879 /// ```
1880 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1881 self.page_size = v.into();
1882 self
1883 }
1884
1885 /// Sets the value of [page_token][crate::model::ListChannelsRequest::page_token].
1886 ///
1887 /// # Example
1888 /// ```ignore,no_run
1889 /// # use google_cloud_eventarc_v1::model::ListChannelsRequest;
1890 /// let x = ListChannelsRequest::new().set_page_token("example");
1891 /// ```
1892 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1893 self.page_token = v.into();
1894 self
1895 }
1896
1897 /// Sets the value of [order_by][crate::model::ListChannelsRequest::order_by].
1898 ///
1899 /// # Example
1900 /// ```ignore,no_run
1901 /// # use google_cloud_eventarc_v1::model::ListChannelsRequest;
1902 /// let x = ListChannelsRequest::new().set_order_by("example");
1903 /// ```
1904 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1905 self.order_by = v.into();
1906 self
1907 }
1908}
1909
1910impl wkt::message::Message for ListChannelsRequest {
1911 fn typename() -> &'static str {
1912 "type.googleapis.com/google.cloud.eventarc.v1.ListChannelsRequest"
1913 }
1914}
1915
1916/// The response message for the `ListChannels` method.
1917#[derive(Clone, Default, PartialEq)]
1918#[non_exhaustive]
1919pub struct ListChannelsResponse {
1920 /// The requested channels, up to the number specified in `page_size`.
1921 pub channels: std::vec::Vec<crate::model::Channel>,
1922
1923 /// A page token that can be sent to `ListChannels` to request the next page.
1924 /// If this is empty, then there are no more pages.
1925 pub next_page_token: std::string::String,
1926
1927 /// Unreachable resources, if any.
1928 pub unreachable: std::vec::Vec<std::string::String>,
1929
1930 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1931}
1932
1933impl ListChannelsResponse {
1934 /// Creates a new default instance.
1935 pub fn new() -> Self {
1936 std::default::Default::default()
1937 }
1938
1939 /// Sets the value of [channels][crate::model::ListChannelsResponse::channels].
1940 ///
1941 /// # Example
1942 /// ```ignore,no_run
1943 /// # use google_cloud_eventarc_v1::model::ListChannelsResponse;
1944 /// use google_cloud_eventarc_v1::model::Channel;
1945 /// let x = ListChannelsResponse::new()
1946 /// .set_channels([
1947 /// Channel::default()/* use setters */,
1948 /// Channel::default()/* use (different) setters */,
1949 /// ]);
1950 /// ```
1951 pub fn set_channels<T, V>(mut self, v: T) -> Self
1952 where
1953 T: std::iter::IntoIterator<Item = V>,
1954 V: std::convert::Into<crate::model::Channel>,
1955 {
1956 use std::iter::Iterator;
1957 self.channels = v.into_iter().map(|i| i.into()).collect();
1958 self
1959 }
1960
1961 /// Sets the value of [next_page_token][crate::model::ListChannelsResponse::next_page_token].
1962 ///
1963 /// # Example
1964 /// ```ignore,no_run
1965 /// # use google_cloud_eventarc_v1::model::ListChannelsResponse;
1966 /// let x = ListChannelsResponse::new().set_next_page_token("example");
1967 /// ```
1968 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1969 self.next_page_token = v.into();
1970 self
1971 }
1972
1973 /// Sets the value of [unreachable][crate::model::ListChannelsResponse::unreachable].
1974 ///
1975 /// # Example
1976 /// ```ignore,no_run
1977 /// # use google_cloud_eventarc_v1::model::ListChannelsResponse;
1978 /// let x = ListChannelsResponse::new().set_unreachable(["a", "b", "c"]);
1979 /// ```
1980 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1981 where
1982 T: std::iter::IntoIterator<Item = V>,
1983 V: std::convert::Into<std::string::String>,
1984 {
1985 use std::iter::Iterator;
1986 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1987 self
1988 }
1989}
1990
1991impl wkt::message::Message for ListChannelsResponse {
1992 fn typename() -> &'static str {
1993 "type.googleapis.com/google.cloud.eventarc.v1.ListChannelsResponse"
1994 }
1995}
1996
1997#[doc(hidden)]
1998impl google_cloud_gax::paginator::internal::PageableResponse for ListChannelsResponse {
1999 type PageItem = crate::model::Channel;
2000
2001 fn items(self) -> std::vec::Vec<Self::PageItem> {
2002 self.channels
2003 }
2004
2005 fn next_page_token(&self) -> std::string::String {
2006 use std::clone::Clone;
2007 self.next_page_token.clone()
2008 }
2009}
2010
2011/// The request message for the CreateChannel method.
2012#[derive(Clone, Default, PartialEq)]
2013#[non_exhaustive]
2014pub struct CreateChannelRequest {
2015 /// Required. The parent collection in which to add this channel.
2016 pub parent: std::string::String,
2017
2018 /// Required. The channel to create.
2019 pub channel: std::option::Option<crate::model::Channel>,
2020
2021 /// Required. The user-provided ID to be assigned to the channel.
2022 pub channel_id: std::string::String,
2023
2024 /// Optional. If set, validate the request and preview the review, but do not
2025 /// post it.
2026 pub validate_only: bool,
2027
2028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2029}
2030
2031impl CreateChannelRequest {
2032 /// Creates a new default instance.
2033 pub fn new() -> Self {
2034 std::default::Default::default()
2035 }
2036
2037 /// Sets the value of [parent][crate::model::CreateChannelRequest::parent].
2038 ///
2039 /// # Example
2040 /// ```ignore,no_run
2041 /// # use google_cloud_eventarc_v1::model::CreateChannelRequest;
2042 /// # let project_id = "project_id";
2043 /// # let location_id = "location_id";
2044 /// let x = CreateChannelRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
2045 /// ```
2046 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2047 self.parent = v.into();
2048 self
2049 }
2050
2051 /// Sets the value of [channel][crate::model::CreateChannelRequest::channel].
2052 ///
2053 /// # Example
2054 /// ```ignore,no_run
2055 /// # use google_cloud_eventarc_v1::model::CreateChannelRequest;
2056 /// use google_cloud_eventarc_v1::model::Channel;
2057 /// let x = CreateChannelRequest::new().set_channel(Channel::default()/* use setters */);
2058 /// ```
2059 pub fn set_channel<T>(mut self, v: T) -> Self
2060 where
2061 T: std::convert::Into<crate::model::Channel>,
2062 {
2063 self.channel = std::option::Option::Some(v.into());
2064 self
2065 }
2066
2067 /// Sets or clears the value of [channel][crate::model::CreateChannelRequest::channel].
2068 ///
2069 /// # Example
2070 /// ```ignore,no_run
2071 /// # use google_cloud_eventarc_v1::model::CreateChannelRequest;
2072 /// use google_cloud_eventarc_v1::model::Channel;
2073 /// let x = CreateChannelRequest::new().set_or_clear_channel(Some(Channel::default()/* use setters */));
2074 /// let x = CreateChannelRequest::new().set_or_clear_channel(None::<Channel>);
2075 /// ```
2076 pub fn set_or_clear_channel<T>(mut self, v: std::option::Option<T>) -> Self
2077 where
2078 T: std::convert::Into<crate::model::Channel>,
2079 {
2080 self.channel = v.map(|x| x.into());
2081 self
2082 }
2083
2084 /// Sets the value of [channel_id][crate::model::CreateChannelRequest::channel_id].
2085 ///
2086 /// # Example
2087 /// ```ignore,no_run
2088 /// # use google_cloud_eventarc_v1::model::CreateChannelRequest;
2089 /// let x = CreateChannelRequest::new().set_channel_id("example");
2090 /// ```
2091 pub fn set_channel_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2092 self.channel_id = v.into();
2093 self
2094 }
2095
2096 /// Sets the value of [validate_only][crate::model::CreateChannelRequest::validate_only].
2097 ///
2098 /// # Example
2099 /// ```ignore,no_run
2100 /// # use google_cloud_eventarc_v1::model::CreateChannelRequest;
2101 /// let x = CreateChannelRequest::new().set_validate_only(true);
2102 /// ```
2103 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2104 self.validate_only = v.into();
2105 self
2106 }
2107}
2108
2109impl wkt::message::Message for CreateChannelRequest {
2110 fn typename() -> &'static str {
2111 "type.googleapis.com/google.cloud.eventarc.v1.CreateChannelRequest"
2112 }
2113}
2114
2115/// The request message for the UpdateChannel method.
2116#[derive(Clone, Default, PartialEq)]
2117#[non_exhaustive]
2118pub struct UpdateChannelRequest {
2119 /// The channel to be updated.
2120 pub channel: std::option::Option<crate::model::Channel>,
2121
2122 /// The fields to be updated; only fields explicitly provided are updated.
2123 /// If no field mask is provided, all provided fields in the request are
2124 /// updated. To update all fields, provide a field mask of "*".
2125 pub update_mask: std::option::Option<wkt::FieldMask>,
2126
2127 /// Optional. If set, validate the request and preview the review, but do not
2128 /// post it.
2129 pub validate_only: bool,
2130
2131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2132}
2133
2134impl UpdateChannelRequest {
2135 /// Creates a new default instance.
2136 pub fn new() -> Self {
2137 std::default::Default::default()
2138 }
2139
2140 /// Sets the value of [channel][crate::model::UpdateChannelRequest::channel].
2141 ///
2142 /// # Example
2143 /// ```ignore,no_run
2144 /// # use google_cloud_eventarc_v1::model::UpdateChannelRequest;
2145 /// use google_cloud_eventarc_v1::model::Channel;
2146 /// let x = UpdateChannelRequest::new().set_channel(Channel::default()/* use setters */);
2147 /// ```
2148 pub fn set_channel<T>(mut self, v: T) -> Self
2149 where
2150 T: std::convert::Into<crate::model::Channel>,
2151 {
2152 self.channel = std::option::Option::Some(v.into());
2153 self
2154 }
2155
2156 /// Sets or clears the value of [channel][crate::model::UpdateChannelRequest::channel].
2157 ///
2158 /// # Example
2159 /// ```ignore,no_run
2160 /// # use google_cloud_eventarc_v1::model::UpdateChannelRequest;
2161 /// use google_cloud_eventarc_v1::model::Channel;
2162 /// let x = UpdateChannelRequest::new().set_or_clear_channel(Some(Channel::default()/* use setters */));
2163 /// let x = UpdateChannelRequest::new().set_or_clear_channel(None::<Channel>);
2164 /// ```
2165 pub fn set_or_clear_channel<T>(mut self, v: std::option::Option<T>) -> Self
2166 where
2167 T: std::convert::Into<crate::model::Channel>,
2168 {
2169 self.channel = v.map(|x| x.into());
2170 self
2171 }
2172
2173 /// Sets the value of [update_mask][crate::model::UpdateChannelRequest::update_mask].
2174 ///
2175 /// # Example
2176 /// ```ignore,no_run
2177 /// # use google_cloud_eventarc_v1::model::UpdateChannelRequest;
2178 /// use wkt::FieldMask;
2179 /// let x = UpdateChannelRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2180 /// ```
2181 pub fn set_update_mask<T>(mut self, v: T) -> Self
2182 where
2183 T: std::convert::Into<wkt::FieldMask>,
2184 {
2185 self.update_mask = std::option::Option::Some(v.into());
2186 self
2187 }
2188
2189 /// Sets or clears the value of [update_mask][crate::model::UpdateChannelRequest::update_mask].
2190 ///
2191 /// # Example
2192 /// ```ignore,no_run
2193 /// # use google_cloud_eventarc_v1::model::UpdateChannelRequest;
2194 /// use wkt::FieldMask;
2195 /// let x = UpdateChannelRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2196 /// let x = UpdateChannelRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2197 /// ```
2198 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2199 where
2200 T: std::convert::Into<wkt::FieldMask>,
2201 {
2202 self.update_mask = v.map(|x| x.into());
2203 self
2204 }
2205
2206 /// Sets the value of [validate_only][crate::model::UpdateChannelRequest::validate_only].
2207 ///
2208 /// # Example
2209 /// ```ignore,no_run
2210 /// # use google_cloud_eventarc_v1::model::UpdateChannelRequest;
2211 /// let x = UpdateChannelRequest::new().set_validate_only(true);
2212 /// ```
2213 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2214 self.validate_only = v.into();
2215 self
2216 }
2217}
2218
2219impl wkt::message::Message for UpdateChannelRequest {
2220 fn typename() -> &'static str {
2221 "type.googleapis.com/google.cloud.eventarc.v1.UpdateChannelRequest"
2222 }
2223}
2224
2225/// The request message for the DeleteChannel method.
2226#[derive(Clone, Default, PartialEq)]
2227#[non_exhaustive]
2228pub struct DeleteChannelRequest {
2229 /// Required. The name of the channel to be deleted.
2230 pub name: std::string::String,
2231
2232 /// Optional. If set, validate the request and preview the review, but do not
2233 /// post it.
2234 pub validate_only: bool,
2235
2236 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2237}
2238
2239impl DeleteChannelRequest {
2240 /// Creates a new default instance.
2241 pub fn new() -> Self {
2242 std::default::Default::default()
2243 }
2244
2245 /// Sets the value of [name][crate::model::DeleteChannelRequest::name].
2246 ///
2247 /// # Example
2248 /// ```ignore,no_run
2249 /// # use google_cloud_eventarc_v1::model::DeleteChannelRequest;
2250 /// # let project_id = "project_id";
2251 /// # let location_id = "location_id";
2252 /// # let channel_id = "channel_id";
2253 /// let x = DeleteChannelRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/channels/{channel_id}"));
2254 /// ```
2255 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2256 self.name = v.into();
2257 self
2258 }
2259
2260 /// Sets the value of [validate_only][crate::model::DeleteChannelRequest::validate_only].
2261 ///
2262 /// # Example
2263 /// ```ignore,no_run
2264 /// # use google_cloud_eventarc_v1::model::DeleteChannelRequest;
2265 /// let x = DeleteChannelRequest::new().set_validate_only(true);
2266 /// ```
2267 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2268 self.validate_only = v.into();
2269 self
2270 }
2271}
2272
2273impl wkt::message::Message for DeleteChannelRequest {
2274 fn typename() -> &'static str {
2275 "type.googleapis.com/google.cloud.eventarc.v1.DeleteChannelRequest"
2276 }
2277}
2278
2279/// The request message for the GetProvider method.
2280#[derive(Clone, Default, PartialEq)]
2281#[non_exhaustive]
2282pub struct GetProviderRequest {
2283 /// Required. The name of the provider to get.
2284 pub name: std::string::String,
2285
2286 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2287}
2288
2289impl GetProviderRequest {
2290 /// Creates a new default instance.
2291 pub fn new() -> Self {
2292 std::default::Default::default()
2293 }
2294
2295 /// Sets the value of [name][crate::model::GetProviderRequest::name].
2296 ///
2297 /// # Example
2298 /// ```ignore,no_run
2299 /// # use google_cloud_eventarc_v1::model::GetProviderRequest;
2300 /// # let project_id = "project_id";
2301 /// # let location_id = "location_id";
2302 /// # let provider_id = "provider_id";
2303 /// let x = GetProviderRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/providers/{provider_id}"));
2304 /// ```
2305 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2306 self.name = v.into();
2307 self
2308 }
2309}
2310
2311impl wkt::message::Message for GetProviderRequest {
2312 fn typename() -> &'static str {
2313 "type.googleapis.com/google.cloud.eventarc.v1.GetProviderRequest"
2314 }
2315}
2316
2317/// The request message for the ListProviders method.
2318#[derive(Clone, Default, PartialEq)]
2319#[non_exhaustive]
2320pub struct ListProvidersRequest {
2321 /// Required. The parent of the provider to get.
2322 pub parent: std::string::String,
2323
2324 /// The maximum number of providers to return on each page.
2325 pub page_size: i32,
2326
2327 /// The page token; provide the value from the `next_page_token` field in a
2328 /// previous `ListProviders` call to retrieve the subsequent page.
2329 ///
2330 /// When paginating, all other parameters provided to `ListProviders` must
2331 /// match the call that provided the page token.
2332 pub page_token: std::string::String,
2333
2334 /// The sorting order of the resources returned. Value should be a
2335 /// comma-separated list of fields. The default sorting oder is ascending. To
2336 /// specify descending order for a field, append a `desc` suffix; for example:
2337 /// `name desc, _id`.
2338 pub order_by: std::string::String,
2339
2340 /// The filter field that the list request will filter on.
2341 pub filter: std::string::String,
2342
2343 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2344}
2345
2346impl ListProvidersRequest {
2347 /// Creates a new default instance.
2348 pub fn new() -> Self {
2349 std::default::Default::default()
2350 }
2351
2352 /// Sets the value of [parent][crate::model::ListProvidersRequest::parent].
2353 ///
2354 /// # Example
2355 /// ```ignore,no_run
2356 /// # use google_cloud_eventarc_v1::model::ListProvidersRequest;
2357 /// # let project_id = "project_id";
2358 /// # let location_id = "location_id";
2359 /// let x = ListProvidersRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
2360 /// ```
2361 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2362 self.parent = v.into();
2363 self
2364 }
2365
2366 /// Sets the value of [page_size][crate::model::ListProvidersRequest::page_size].
2367 ///
2368 /// # Example
2369 /// ```ignore,no_run
2370 /// # use google_cloud_eventarc_v1::model::ListProvidersRequest;
2371 /// let x = ListProvidersRequest::new().set_page_size(42);
2372 /// ```
2373 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2374 self.page_size = v.into();
2375 self
2376 }
2377
2378 /// Sets the value of [page_token][crate::model::ListProvidersRequest::page_token].
2379 ///
2380 /// # Example
2381 /// ```ignore,no_run
2382 /// # use google_cloud_eventarc_v1::model::ListProvidersRequest;
2383 /// let x = ListProvidersRequest::new().set_page_token("example");
2384 /// ```
2385 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2386 self.page_token = v.into();
2387 self
2388 }
2389
2390 /// Sets the value of [order_by][crate::model::ListProvidersRequest::order_by].
2391 ///
2392 /// # Example
2393 /// ```ignore,no_run
2394 /// # use google_cloud_eventarc_v1::model::ListProvidersRequest;
2395 /// let x = ListProvidersRequest::new().set_order_by("example");
2396 /// ```
2397 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2398 self.order_by = v.into();
2399 self
2400 }
2401
2402 /// Sets the value of [filter][crate::model::ListProvidersRequest::filter].
2403 ///
2404 /// # Example
2405 /// ```ignore,no_run
2406 /// # use google_cloud_eventarc_v1::model::ListProvidersRequest;
2407 /// let x = ListProvidersRequest::new().set_filter("example");
2408 /// ```
2409 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2410 self.filter = v.into();
2411 self
2412 }
2413}
2414
2415impl wkt::message::Message for ListProvidersRequest {
2416 fn typename() -> &'static str {
2417 "type.googleapis.com/google.cloud.eventarc.v1.ListProvidersRequest"
2418 }
2419}
2420
2421/// The response message for the `ListProviders` method.
2422#[derive(Clone, Default, PartialEq)]
2423#[non_exhaustive]
2424pub struct ListProvidersResponse {
2425 /// The requested providers, up to the number specified in `page_size`.
2426 pub providers: std::vec::Vec<crate::model::Provider>,
2427
2428 /// A page token that can be sent to `ListProviders` to request the next page.
2429 /// If this is empty, then there are no more pages.
2430 pub next_page_token: std::string::String,
2431
2432 /// Unreachable resources, if any.
2433 pub unreachable: std::vec::Vec<std::string::String>,
2434
2435 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2436}
2437
2438impl ListProvidersResponse {
2439 /// Creates a new default instance.
2440 pub fn new() -> Self {
2441 std::default::Default::default()
2442 }
2443
2444 /// Sets the value of [providers][crate::model::ListProvidersResponse::providers].
2445 ///
2446 /// # Example
2447 /// ```ignore,no_run
2448 /// # use google_cloud_eventarc_v1::model::ListProvidersResponse;
2449 /// use google_cloud_eventarc_v1::model::Provider;
2450 /// let x = ListProvidersResponse::new()
2451 /// .set_providers([
2452 /// Provider::default()/* use setters */,
2453 /// Provider::default()/* use (different) setters */,
2454 /// ]);
2455 /// ```
2456 pub fn set_providers<T, V>(mut self, v: T) -> Self
2457 where
2458 T: std::iter::IntoIterator<Item = V>,
2459 V: std::convert::Into<crate::model::Provider>,
2460 {
2461 use std::iter::Iterator;
2462 self.providers = v.into_iter().map(|i| i.into()).collect();
2463 self
2464 }
2465
2466 /// Sets the value of [next_page_token][crate::model::ListProvidersResponse::next_page_token].
2467 ///
2468 /// # Example
2469 /// ```ignore,no_run
2470 /// # use google_cloud_eventarc_v1::model::ListProvidersResponse;
2471 /// let x = ListProvidersResponse::new().set_next_page_token("example");
2472 /// ```
2473 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2474 self.next_page_token = v.into();
2475 self
2476 }
2477
2478 /// Sets the value of [unreachable][crate::model::ListProvidersResponse::unreachable].
2479 ///
2480 /// # Example
2481 /// ```ignore,no_run
2482 /// # use google_cloud_eventarc_v1::model::ListProvidersResponse;
2483 /// let x = ListProvidersResponse::new().set_unreachable(["a", "b", "c"]);
2484 /// ```
2485 pub fn set_unreachable<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.unreachable = v.into_iter().map(|i| i.into()).collect();
2492 self
2493 }
2494}
2495
2496impl wkt::message::Message for ListProvidersResponse {
2497 fn typename() -> &'static str {
2498 "type.googleapis.com/google.cloud.eventarc.v1.ListProvidersResponse"
2499 }
2500}
2501
2502#[doc(hidden)]
2503impl google_cloud_gax::paginator::internal::PageableResponse for ListProvidersResponse {
2504 type PageItem = crate::model::Provider;
2505
2506 fn items(self) -> std::vec::Vec<Self::PageItem> {
2507 self.providers
2508 }
2509
2510 fn next_page_token(&self) -> std::string::String {
2511 use std::clone::Clone;
2512 self.next_page_token.clone()
2513 }
2514}
2515
2516/// The request message for the GetChannelConnection method.
2517#[derive(Clone, Default, PartialEq)]
2518#[non_exhaustive]
2519pub struct GetChannelConnectionRequest {
2520 /// Required. The name of the channel connection to get.
2521 pub name: std::string::String,
2522
2523 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2524}
2525
2526impl GetChannelConnectionRequest {
2527 /// Creates a new default instance.
2528 pub fn new() -> Self {
2529 std::default::Default::default()
2530 }
2531
2532 /// Sets the value of [name][crate::model::GetChannelConnectionRequest::name].
2533 ///
2534 /// # Example
2535 /// ```ignore,no_run
2536 /// # use google_cloud_eventarc_v1::model::GetChannelConnectionRequest;
2537 /// # let project_id = "project_id";
2538 /// # let location_id = "location_id";
2539 /// # let channel_connection_id = "channel_connection_id";
2540 /// let x = GetChannelConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/channelConnections/{channel_connection_id}"));
2541 /// ```
2542 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2543 self.name = v.into();
2544 self
2545 }
2546}
2547
2548impl wkt::message::Message for GetChannelConnectionRequest {
2549 fn typename() -> &'static str {
2550 "type.googleapis.com/google.cloud.eventarc.v1.GetChannelConnectionRequest"
2551 }
2552}
2553
2554/// The request message for the ListChannelConnections method.
2555#[derive(Clone, Default, PartialEq)]
2556#[non_exhaustive]
2557pub struct ListChannelConnectionsRequest {
2558 /// Required. The parent collection from which to list channel connections.
2559 pub parent: std::string::String,
2560
2561 /// The maximum number of channel connections to return on each page.
2562 ///
2563 /// Note: The service may send fewer responses.
2564 pub page_size: i32,
2565
2566 /// The page token; provide the value from the `next_page_token` field in a
2567 /// previous `ListChannelConnections` call to retrieve the subsequent page.
2568 ///
2569 /// When paginating, all other parameters provided to `ListChannelConnetions`
2570 /// match the call that provided the page token.
2571 pub page_token: std::string::String,
2572
2573 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2574}
2575
2576impl ListChannelConnectionsRequest {
2577 /// Creates a new default instance.
2578 pub fn new() -> Self {
2579 std::default::Default::default()
2580 }
2581
2582 /// Sets the value of [parent][crate::model::ListChannelConnectionsRequest::parent].
2583 ///
2584 /// # Example
2585 /// ```ignore,no_run
2586 /// # use google_cloud_eventarc_v1::model::ListChannelConnectionsRequest;
2587 /// # let project_id = "project_id";
2588 /// # let location_id = "location_id";
2589 /// let x = ListChannelConnectionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
2590 /// ```
2591 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2592 self.parent = v.into();
2593 self
2594 }
2595
2596 /// Sets the value of [page_size][crate::model::ListChannelConnectionsRequest::page_size].
2597 ///
2598 /// # Example
2599 /// ```ignore,no_run
2600 /// # use google_cloud_eventarc_v1::model::ListChannelConnectionsRequest;
2601 /// let x = ListChannelConnectionsRequest::new().set_page_size(42);
2602 /// ```
2603 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2604 self.page_size = v.into();
2605 self
2606 }
2607
2608 /// Sets the value of [page_token][crate::model::ListChannelConnectionsRequest::page_token].
2609 ///
2610 /// # Example
2611 /// ```ignore,no_run
2612 /// # use google_cloud_eventarc_v1::model::ListChannelConnectionsRequest;
2613 /// let x = ListChannelConnectionsRequest::new().set_page_token("example");
2614 /// ```
2615 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2616 self.page_token = v.into();
2617 self
2618 }
2619}
2620
2621impl wkt::message::Message for ListChannelConnectionsRequest {
2622 fn typename() -> &'static str {
2623 "type.googleapis.com/google.cloud.eventarc.v1.ListChannelConnectionsRequest"
2624 }
2625}
2626
2627/// The response message for the `ListChannelConnections` method.
2628#[derive(Clone, Default, PartialEq)]
2629#[non_exhaustive]
2630pub struct ListChannelConnectionsResponse {
2631 /// The requested channel connections, up to the number specified in
2632 /// `page_size`.
2633 pub channel_connections: std::vec::Vec<crate::model::ChannelConnection>,
2634
2635 /// A page token that can be sent to `ListChannelConnections` to request the
2636 /// next page.
2637 /// If this is empty, then there are no more pages.
2638 pub next_page_token: std::string::String,
2639
2640 /// Unreachable resources, if any.
2641 pub unreachable: std::vec::Vec<std::string::String>,
2642
2643 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2644}
2645
2646impl ListChannelConnectionsResponse {
2647 /// Creates a new default instance.
2648 pub fn new() -> Self {
2649 std::default::Default::default()
2650 }
2651
2652 /// Sets the value of [channel_connections][crate::model::ListChannelConnectionsResponse::channel_connections].
2653 ///
2654 /// # Example
2655 /// ```ignore,no_run
2656 /// # use google_cloud_eventarc_v1::model::ListChannelConnectionsResponse;
2657 /// use google_cloud_eventarc_v1::model::ChannelConnection;
2658 /// let x = ListChannelConnectionsResponse::new()
2659 /// .set_channel_connections([
2660 /// ChannelConnection::default()/* use setters */,
2661 /// ChannelConnection::default()/* use (different) setters */,
2662 /// ]);
2663 /// ```
2664 pub fn set_channel_connections<T, V>(mut self, v: T) -> Self
2665 where
2666 T: std::iter::IntoIterator<Item = V>,
2667 V: std::convert::Into<crate::model::ChannelConnection>,
2668 {
2669 use std::iter::Iterator;
2670 self.channel_connections = v.into_iter().map(|i| i.into()).collect();
2671 self
2672 }
2673
2674 /// Sets the value of [next_page_token][crate::model::ListChannelConnectionsResponse::next_page_token].
2675 ///
2676 /// # Example
2677 /// ```ignore,no_run
2678 /// # use google_cloud_eventarc_v1::model::ListChannelConnectionsResponse;
2679 /// let x = ListChannelConnectionsResponse::new().set_next_page_token("example");
2680 /// ```
2681 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2682 self.next_page_token = v.into();
2683 self
2684 }
2685
2686 /// Sets the value of [unreachable][crate::model::ListChannelConnectionsResponse::unreachable].
2687 ///
2688 /// # Example
2689 /// ```ignore,no_run
2690 /// # use google_cloud_eventarc_v1::model::ListChannelConnectionsResponse;
2691 /// let x = ListChannelConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
2692 /// ```
2693 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2694 where
2695 T: std::iter::IntoIterator<Item = V>,
2696 V: std::convert::Into<std::string::String>,
2697 {
2698 use std::iter::Iterator;
2699 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2700 self
2701 }
2702}
2703
2704impl wkt::message::Message for ListChannelConnectionsResponse {
2705 fn typename() -> &'static str {
2706 "type.googleapis.com/google.cloud.eventarc.v1.ListChannelConnectionsResponse"
2707 }
2708}
2709
2710#[doc(hidden)]
2711impl google_cloud_gax::paginator::internal::PageableResponse for ListChannelConnectionsResponse {
2712 type PageItem = crate::model::ChannelConnection;
2713
2714 fn items(self) -> std::vec::Vec<Self::PageItem> {
2715 self.channel_connections
2716 }
2717
2718 fn next_page_token(&self) -> std::string::String {
2719 use std::clone::Clone;
2720 self.next_page_token.clone()
2721 }
2722}
2723
2724/// The request message for the CreateChannelConnection method.
2725#[derive(Clone, Default, PartialEq)]
2726#[non_exhaustive]
2727pub struct CreateChannelConnectionRequest {
2728 /// Required. The parent collection in which to add this channel connection.
2729 pub parent: std::string::String,
2730
2731 /// Required. Channel connection to create.
2732 pub channel_connection: std::option::Option<crate::model::ChannelConnection>,
2733
2734 /// Required. The user-provided ID to be assigned to the channel connection.
2735 pub channel_connection_id: std::string::String,
2736
2737 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2738}
2739
2740impl CreateChannelConnectionRequest {
2741 /// Creates a new default instance.
2742 pub fn new() -> Self {
2743 std::default::Default::default()
2744 }
2745
2746 /// Sets the value of [parent][crate::model::CreateChannelConnectionRequest::parent].
2747 ///
2748 /// # Example
2749 /// ```ignore,no_run
2750 /// # use google_cloud_eventarc_v1::model::CreateChannelConnectionRequest;
2751 /// # let project_id = "project_id";
2752 /// # let location_id = "location_id";
2753 /// let x = CreateChannelConnectionRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
2754 /// ```
2755 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2756 self.parent = v.into();
2757 self
2758 }
2759
2760 /// Sets the value of [channel_connection][crate::model::CreateChannelConnectionRequest::channel_connection].
2761 ///
2762 /// # Example
2763 /// ```ignore,no_run
2764 /// # use google_cloud_eventarc_v1::model::CreateChannelConnectionRequest;
2765 /// use google_cloud_eventarc_v1::model::ChannelConnection;
2766 /// let x = CreateChannelConnectionRequest::new().set_channel_connection(ChannelConnection::default()/* use setters */);
2767 /// ```
2768 pub fn set_channel_connection<T>(mut self, v: T) -> Self
2769 where
2770 T: std::convert::Into<crate::model::ChannelConnection>,
2771 {
2772 self.channel_connection = std::option::Option::Some(v.into());
2773 self
2774 }
2775
2776 /// Sets or clears the value of [channel_connection][crate::model::CreateChannelConnectionRequest::channel_connection].
2777 ///
2778 /// # Example
2779 /// ```ignore,no_run
2780 /// # use google_cloud_eventarc_v1::model::CreateChannelConnectionRequest;
2781 /// use google_cloud_eventarc_v1::model::ChannelConnection;
2782 /// let x = CreateChannelConnectionRequest::new().set_or_clear_channel_connection(Some(ChannelConnection::default()/* use setters */));
2783 /// let x = CreateChannelConnectionRequest::new().set_or_clear_channel_connection(None::<ChannelConnection>);
2784 /// ```
2785 pub fn set_or_clear_channel_connection<T>(mut self, v: std::option::Option<T>) -> Self
2786 where
2787 T: std::convert::Into<crate::model::ChannelConnection>,
2788 {
2789 self.channel_connection = v.map(|x| x.into());
2790 self
2791 }
2792
2793 /// Sets the value of [channel_connection_id][crate::model::CreateChannelConnectionRequest::channel_connection_id].
2794 ///
2795 /// # Example
2796 /// ```ignore,no_run
2797 /// # use google_cloud_eventarc_v1::model::CreateChannelConnectionRequest;
2798 /// let x = CreateChannelConnectionRequest::new().set_channel_connection_id("example");
2799 /// ```
2800 pub fn set_channel_connection_id<T: std::convert::Into<std::string::String>>(
2801 mut self,
2802 v: T,
2803 ) -> Self {
2804 self.channel_connection_id = v.into();
2805 self
2806 }
2807}
2808
2809impl wkt::message::Message for CreateChannelConnectionRequest {
2810 fn typename() -> &'static str {
2811 "type.googleapis.com/google.cloud.eventarc.v1.CreateChannelConnectionRequest"
2812 }
2813}
2814
2815/// The request message for the DeleteChannelConnection method.
2816#[derive(Clone, Default, PartialEq)]
2817#[non_exhaustive]
2818pub struct DeleteChannelConnectionRequest {
2819 /// Required. The name of the channel connection to delete.
2820 pub name: std::string::String,
2821
2822 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2823}
2824
2825impl DeleteChannelConnectionRequest {
2826 /// Creates a new default instance.
2827 pub fn new() -> Self {
2828 std::default::Default::default()
2829 }
2830
2831 /// Sets the value of [name][crate::model::DeleteChannelConnectionRequest::name].
2832 ///
2833 /// # Example
2834 /// ```ignore,no_run
2835 /// # use google_cloud_eventarc_v1::model::DeleteChannelConnectionRequest;
2836 /// # let project_id = "project_id";
2837 /// # let location_id = "location_id";
2838 /// # let channel_connection_id = "channel_connection_id";
2839 /// let x = DeleteChannelConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/channelConnections/{channel_connection_id}"));
2840 /// ```
2841 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2842 self.name = v.into();
2843 self
2844 }
2845}
2846
2847impl wkt::message::Message for DeleteChannelConnectionRequest {
2848 fn typename() -> &'static str {
2849 "type.googleapis.com/google.cloud.eventarc.v1.DeleteChannelConnectionRequest"
2850 }
2851}
2852
2853/// The request message for the UpdateGoogleChannelConfig method.
2854#[derive(Clone, Default, PartialEq)]
2855#[non_exhaustive]
2856pub struct UpdateGoogleChannelConfigRequest {
2857 /// Required. The config to be updated.
2858 pub google_channel_config: std::option::Option<crate::model::GoogleChannelConfig>,
2859
2860 /// The fields to be updated; only fields explicitly provided are updated.
2861 /// If no field mask is provided, all provided fields in the request are
2862 /// updated. To update all fields, provide a field mask of "*".
2863 pub update_mask: std::option::Option<wkt::FieldMask>,
2864
2865 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2866}
2867
2868impl UpdateGoogleChannelConfigRequest {
2869 /// Creates a new default instance.
2870 pub fn new() -> Self {
2871 std::default::Default::default()
2872 }
2873
2874 /// Sets the value of [google_channel_config][crate::model::UpdateGoogleChannelConfigRequest::google_channel_config].
2875 ///
2876 /// # Example
2877 /// ```ignore,no_run
2878 /// # use google_cloud_eventarc_v1::model::UpdateGoogleChannelConfigRequest;
2879 /// use google_cloud_eventarc_v1::model::GoogleChannelConfig;
2880 /// let x = UpdateGoogleChannelConfigRequest::new().set_google_channel_config(GoogleChannelConfig::default()/* use setters */);
2881 /// ```
2882 pub fn set_google_channel_config<T>(mut self, v: T) -> Self
2883 where
2884 T: std::convert::Into<crate::model::GoogleChannelConfig>,
2885 {
2886 self.google_channel_config = std::option::Option::Some(v.into());
2887 self
2888 }
2889
2890 /// Sets or clears the value of [google_channel_config][crate::model::UpdateGoogleChannelConfigRequest::google_channel_config].
2891 ///
2892 /// # Example
2893 /// ```ignore,no_run
2894 /// # use google_cloud_eventarc_v1::model::UpdateGoogleChannelConfigRequest;
2895 /// use google_cloud_eventarc_v1::model::GoogleChannelConfig;
2896 /// let x = UpdateGoogleChannelConfigRequest::new().set_or_clear_google_channel_config(Some(GoogleChannelConfig::default()/* use setters */));
2897 /// let x = UpdateGoogleChannelConfigRequest::new().set_or_clear_google_channel_config(None::<GoogleChannelConfig>);
2898 /// ```
2899 pub fn set_or_clear_google_channel_config<T>(mut self, v: std::option::Option<T>) -> Self
2900 where
2901 T: std::convert::Into<crate::model::GoogleChannelConfig>,
2902 {
2903 self.google_channel_config = v.map(|x| x.into());
2904 self
2905 }
2906
2907 /// Sets the value of [update_mask][crate::model::UpdateGoogleChannelConfigRequest::update_mask].
2908 ///
2909 /// # Example
2910 /// ```ignore,no_run
2911 /// # use google_cloud_eventarc_v1::model::UpdateGoogleChannelConfigRequest;
2912 /// use wkt::FieldMask;
2913 /// let x = UpdateGoogleChannelConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2914 /// ```
2915 pub fn set_update_mask<T>(mut self, v: T) -> Self
2916 where
2917 T: std::convert::Into<wkt::FieldMask>,
2918 {
2919 self.update_mask = std::option::Option::Some(v.into());
2920 self
2921 }
2922
2923 /// Sets or clears the value of [update_mask][crate::model::UpdateGoogleChannelConfigRequest::update_mask].
2924 ///
2925 /// # Example
2926 /// ```ignore,no_run
2927 /// # use google_cloud_eventarc_v1::model::UpdateGoogleChannelConfigRequest;
2928 /// use wkt::FieldMask;
2929 /// let x = UpdateGoogleChannelConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2930 /// let x = UpdateGoogleChannelConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2931 /// ```
2932 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2933 where
2934 T: std::convert::Into<wkt::FieldMask>,
2935 {
2936 self.update_mask = v.map(|x| x.into());
2937 self
2938 }
2939}
2940
2941impl wkt::message::Message for UpdateGoogleChannelConfigRequest {
2942 fn typename() -> &'static str {
2943 "type.googleapis.com/google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest"
2944 }
2945}
2946
2947/// The request message for the GetGoogleChannelConfig method.
2948#[derive(Clone, Default, PartialEq)]
2949#[non_exhaustive]
2950pub struct GetGoogleChannelConfigRequest {
2951 /// Required. The name of the config to get.
2952 pub name: std::string::String,
2953
2954 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2955}
2956
2957impl GetGoogleChannelConfigRequest {
2958 /// Creates a new default instance.
2959 pub fn new() -> Self {
2960 std::default::Default::default()
2961 }
2962
2963 /// Sets the value of [name][crate::model::GetGoogleChannelConfigRequest::name].
2964 ///
2965 /// # Example
2966 /// ```ignore,no_run
2967 /// # use google_cloud_eventarc_v1::model::GetGoogleChannelConfigRequest;
2968 /// # let project_id = "project_id";
2969 /// # let location_id = "location_id";
2970 /// let x = GetGoogleChannelConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/googleChannelConfig"));
2971 /// ```
2972 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2973 self.name = v.into();
2974 self
2975 }
2976}
2977
2978impl wkt::message::Message for GetGoogleChannelConfigRequest {
2979 fn typename() -> &'static str {
2980 "type.googleapis.com/google.cloud.eventarc.v1.GetGoogleChannelConfigRequest"
2981 }
2982}
2983
2984/// The request message for the GetMessageBus method.
2985#[derive(Clone, Default, PartialEq)]
2986#[non_exhaustive]
2987pub struct GetMessageBusRequest {
2988 /// Required. The name of the message bus to get.
2989 pub name: std::string::String,
2990
2991 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2992}
2993
2994impl GetMessageBusRequest {
2995 /// Creates a new default instance.
2996 pub fn new() -> Self {
2997 std::default::Default::default()
2998 }
2999
3000 /// Sets the value of [name][crate::model::GetMessageBusRequest::name].
3001 ///
3002 /// # Example
3003 /// ```ignore,no_run
3004 /// # use google_cloud_eventarc_v1::model::GetMessageBusRequest;
3005 /// # let project_id = "project_id";
3006 /// # let location_id = "location_id";
3007 /// # let message_bus_id = "message_bus_id";
3008 /// let x = GetMessageBusRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/messageBuses/{message_bus_id}"));
3009 /// ```
3010 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3011 self.name = v.into();
3012 self
3013 }
3014}
3015
3016impl wkt::message::Message for GetMessageBusRequest {
3017 fn typename() -> &'static str {
3018 "type.googleapis.com/google.cloud.eventarc.v1.GetMessageBusRequest"
3019 }
3020}
3021
3022/// The request message for the ListMessageBuses method.
3023#[derive(Clone, Default, PartialEq)]
3024#[non_exhaustive]
3025pub struct ListMessageBusesRequest {
3026 /// Required. The parent collection to list message buses on.
3027 pub parent: std::string::String,
3028
3029 /// Optional. The maximum number of results to return on each page.
3030 ///
3031 /// Note: The service may send fewer.
3032 pub page_size: i32,
3033
3034 /// Optional. The page token; provide the value from the `next_page_token`
3035 /// field in a previous call to retrieve the subsequent page.
3036 ///
3037 /// When paginating, all other parameters provided must match
3038 /// the previous call that provided the page token.
3039 pub page_token: std::string::String,
3040
3041 /// Optional. The sorting order of the resources returned. Value should be a
3042 /// comma-separated list of fields. The default sorting order is ascending. To
3043 /// specify descending order for a field, append a `desc` suffix; for example:
3044 /// `name desc, update_time`.
3045 pub order_by: std::string::String,
3046
3047 /// Optional. The filter field that the list request will filter on.
3048 /// Possible filtersare described in <https://google.aip.dev/160>.
3049 pub filter: std::string::String,
3050
3051 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3052}
3053
3054impl ListMessageBusesRequest {
3055 /// Creates a new default instance.
3056 pub fn new() -> Self {
3057 std::default::Default::default()
3058 }
3059
3060 /// Sets the value of [parent][crate::model::ListMessageBusesRequest::parent].
3061 ///
3062 /// # Example
3063 /// ```ignore,no_run
3064 /// # use google_cloud_eventarc_v1::model::ListMessageBusesRequest;
3065 /// # let project_id = "project_id";
3066 /// # let location_id = "location_id";
3067 /// let x = ListMessageBusesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3068 /// ```
3069 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3070 self.parent = v.into();
3071 self
3072 }
3073
3074 /// Sets the value of [page_size][crate::model::ListMessageBusesRequest::page_size].
3075 ///
3076 /// # Example
3077 /// ```ignore,no_run
3078 /// # use google_cloud_eventarc_v1::model::ListMessageBusesRequest;
3079 /// let x = ListMessageBusesRequest::new().set_page_size(42);
3080 /// ```
3081 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3082 self.page_size = v.into();
3083 self
3084 }
3085
3086 /// Sets the value of [page_token][crate::model::ListMessageBusesRequest::page_token].
3087 ///
3088 /// # Example
3089 /// ```ignore,no_run
3090 /// # use google_cloud_eventarc_v1::model::ListMessageBusesRequest;
3091 /// let x = ListMessageBusesRequest::new().set_page_token("example");
3092 /// ```
3093 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3094 self.page_token = v.into();
3095 self
3096 }
3097
3098 /// Sets the value of [order_by][crate::model::ListMessageBusesRequest::order_by].
3099 ///
3100 /// # Example
3101 /// ```ignore,no_run
3102 /// # use google_cloud_eventarc_v1::model::ListMessageBusesRequest;
3103 /// let x = ListMessageBusesRequest::new().set_order_by("example");
3104 /// ```
3105 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3106 self.order_by = v.into();
3107 self
3108 }
3109
3110 /// Sets the value of [filter][crate::model::ListMessageBusesRequest::filter].
3111 ///
3112 /// # Example
3113 /// ```ignore,no_run
3114 /// # use google_cloud_eventarc_v1::model::ListMessageBusesRequest;
3115 /// let x = ListMessageBusesRequest::new().set_filter("example");
3116 /// ```
3117 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3118 self.filter = v.into();
3119 self
3120 }
3121}
3122
3123impl wkt::message::Message for ListMessageBusesRequest {
3124 fn typename() -> &'static str {
3125 "type.googleapis.com/google.cloud.eventarc.v1.ListMessageBusesRequest"
3126 }
3127}
3128
3129/// The response message for the `ListMessageBuses` method.
3130#[derive(Clone, Default, PartialEq)]
3131#[non_exhaustive]
3132pub struct ListMessageBusesResponse {
3133 /// The requested message buses, up to the number specified in `page_size`.
3134 pub message_buses: std::vec::Vec<crate::model::MessageBus>,
3135
3136 /// A page token that can be sent to `ListMessageBuses` to request the next
3137 /// page. If this is empty, then there are no more pages.
3138 pub next_page_token: std::string::String,
3139
3140 /// Unreachable resources, if any.
3141 pub unreachable: std::vec::Vec<std::string::String>,
3142
3143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3144}
3145
3146impl ListMessageBusesResponse {
3147 /// Creates a new default instance.
3148 pub fn new() -> Self {
3149 std::default::Default::default()
3150 }
3151
3152 /// Sets the value of [message_buses][crate::model::ListMessageBusesResponse::message_buses].
3153 ///
3154 /// # Example
3155 /// ```ignore,no_run
3156 /// # use google_cloud_eventarc_v1::model::ListMessageBusesResponse;
3157 /// use google_cloud_eventarc_v1::model::MessageBus;
3158 /// let x = ListMessageBusesResponse::new()
3159 /// .set_message_buses([
3160 /// MessageBus::default()/* use setters */,
3161 /// MessageBus::default()/* use (different) setters */,
3162 /// ]);
3163 /// ```
3164 pub fn set_message_buses<T, V>(mut self, v: T) -> Self
3165 where
3166 T: std::iter::IntoIterator<Item = V>,
3167 V: std::convert::Into<crate::model::MessageBus>,
3168 {
3169 use std::iter::Iterator;
3170 self.message_buses = v.into_iter().map(|i| i.into()).collect();
3171 self
3172 }
3173
3174 /// Sets the value of [next_page_token][crate::model::ListMessageBusesResponse::next_page_token].
3175 ///
3176 /// # Example
3177 /// ```ignore,no_run
3178 /// # use google_cloud_eventarc_v1::model::ListMessageBusesResponse;
3179 /// let x = ListMessageBusesResponse::new().set_next_page_token("example");
3180 /// ```
3181 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3182 self.next_page_token = v.into();
3183 self
3184 }
3185
3186 /// Sets the value of [unreachable][crate::model::ListMessageBusesResponse::unreachable].
3187 ///
3188 /// # Example
3189 /// ```ignore,no_run
3190 /// # use google_cloud_eventarc_v1::model::ListMessageBusesResponse;
3191 /// let x = ListMessageBusesResponse::new().set_unreachable(["a", "b", "c"]);
3192 /// ```
3193 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3194 where
3195 T: std::iter::IntoIterator<Item = V>,
3196 V: std::convert::Into<std::string::String>,
3197 {
3198 use std::iter::Iterator;
3199 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3200 self
3201 }
3202}
3203
3204impl wkt::message::Message for ListMessageBusesResponse {
3205 fn typename() -> &'static str {
3206 "type.googleapis.com/google.cloud.eventarc.v1.ListMessageBusesResponse"
3207 }
3208}
3209
3210#[doc(hidden)]
3211impl google_cloud_gax::paginator::internal::PageableResponse for ListMessageBusesResponse {
3212 type PageItem = crate::model::MessageBus;
3213
3214 fn items(self) -> std::vec::Vec<Self::PageItem> {
3215 self.message_buses
3216 }
3217
3218 fn next_page_token(&self) -> std::string::String {
3219 use std::clone::Clone;
3220 self.next_page_token.clone()
3221 }
3222}
3223
3224/// The request message for the `ListMessageBusEnrollments` method.
3225#[derive(Clone, Default, PartialEq)]
3226#[non_exhaustive]
3227pub struct ListMessageBusEnrollmentsRequest {
3228 /// Required. The parent message bus to list enrollments on.
3229 pub parent: std::string::String,
3230
3231 /// Optional. The maximum number of results to return on each page.
3232 ///
3233 /// Note: The service may send fewer.
3234 pub page_size: i32,
3235
3236 /// Optional. The page token; provide the value from the `next_page_token`
3237 /// field in a previous call to retrieve the subsequent page.
3238 ///
3239 /// When paginating, all other parameters provided must match
3240 /// the previous call that provided the page token.
3241 pub page_token: std::string::String,
3242
3243 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3244}
3245
3246impl ListMessageBusEnrollmentsRequest {
3247 /// Creates a new default instance.
3248 pub fn new() -> Self {
3249 std::default::Default::default()
3250 }
3251
3252 /// Sets the value of [parent][crate::model::ListMessageBusEnrollmentsRequest::parent].
3253 ///
3254 /// # Example
3255 /// ```ignore,no_run
3256 /// # use google_cloud_eventarc_v1::model::ListMessageBusEnrollmentsRequest;
3257 /// # let project_id = "project_id";
3258 /// # let location_id = "location_id";
3259 /// # let message_bus_id = "message_bus_id";
3260 /// let x = ListMessageBusEnrollmentsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/messageBuses/{message_bus_id}"));
3261 /// ```
3262 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3263 self.parent = v.into();
3264 self
3265 }
3266
3267 /// Sets the value of [page_size][crate::model::ListMessageBusEnrollmentsRequest::page_size].
3268 ///
3269 /// # Example
3270 /// ```ignore,no_run
3271 /// # use google_cloud_eventarc_v1::model::ListMessageBusEnrollmentsRequest;
3272 /// let x = ListMessageBusEnrollmentsRequest::new().set_page_size(42);
3273 /// ```
3274 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3275 self.page_size = v.into();
3276 self
3277 }
3278
3279 /// Sets the value of [page_token][crate::model::ListMessageBusEnrollmentsRequest::page_token].
3280 ///
3281 /// # Example
3282 /// ```ignore,no_run
3283 /// # use google_cloud_eventarc_v1::model::ListMessageBusEnrollmentsRequest;
3284 /// let x = ListMessageBusEnrollmentsRequest::new().set_page_token("example");
3285 /// ```
3286 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3287 self.page_token = v.into();
3288 self
3289 }
3290}
3291
3292impl wkt::message::Message for ListMessageBusEnrollmentsRequest {
3293 fn typename() -> &'static str {
3294 "type.googleapis.com/google.cloud.eventarc.v1.ListMessageBusEnrollmentsRequest"
3295 }
3296}
3297
3298/// The response message for the `ListMessageBusEnrollments` method.`
3299#[derive(Clone, Default, PartialEq)]
3300#[non_exhaustive]
3301pub struct ListMessageBusEnrollmentsResponse {
3302 /// The requested enrollments, up to the number specified in `page_size`.
3303 pub enrollments: std::vec::Vec<std::string::String>,
3304
3305 /// A page token that can be sent to `ListMessageBusEnrollments` to request the
3306 /// next page. If this is empty, then there are no more pages.
3307 pub next_page_token: std::string::String,
3308
3309 /// Unreachable resources, if any.
3310 pub unreachable: std::vec::Vec<std::string::String>,
3311
3312 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3313}
3314
3315impl ListMessageBusEnrollmentsResponse {
3316 /// Creates a new default instance.
3317 pub fn new() -> Self {
3318 std::default::Default::default()
3319 }
3320
3321 /// Sets the value of [enrollments][crate::model::ListMessageBusEnrollmentsResponse::enrollments].
3322 ///
3323 /// # Example
3324 /// ```ignore,no_run
3325 /// # use google_cloud_eventarc_v1::model::ListMessageBusEnrollmentsResponse;
3326 /// let x = ListMessageBusEnrollmentsResponse::new().set_enrollments(["a", "b", "c"]);
3327 /// ```
3328 pub fn set_enrollments<T, V>(mut self, v: T) -> Self
3329 where
3330 T: std::iter::IntoIterator<Item = V>,
3331 V: std::convert::Into<std::string::String>,
3332 {
3333 use std::iter::Iterator;
3334 self.enrollments = v.into_iter().map(|i| i.into()).collect();
3335 self
3336 }
3337
3338 /// Sets the value of [next_page_token][crate::model::ListMessageBusEnrollmentsResponse::next_page_token].
3339 ///
3340 /// # Example
3341 /// ```ignore,no_run
3342 /// # use google_cloud_eventarc_v1::model::ListMessageBusEnrollmentsResponse;
3343 /// let x = ListMessageBusEnrollmentsResponse::new().set_next_page_token("example");
3344 /// ```
3345 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3346 self.next_page_token = v.into();
3347 self
3348 }
3349
3350 /// Sets the value of [unreachable][crate::model::ListMessageBusEnrollmentsResponse::unreachable].
3351 ///
3352 /// # Example
3353 /// ```ignore,no_run
3354 /// # use google_cloud_eventarc_v1::model::ListMessageBusEnrollmentsResponse;
3355 /// let x = ListMessageBusEnrollmentsResponse::new().set_unreachable(["a", "b", "c"]);
3356 /// ```
3357 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3358 where
3359 T: std::iter::IntoIterator<Item = V>,
3360 V: std::convert::Into<std::string::String>,
3361 {
3362 use std::iter::Iterator;
3363 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3364 self
3365 }
3366}
3367
3368impl wkt::message::Message for ListMessageBusEnrollmentsResponse {
3369 fn typename() -> &'static str {
3370 "type.googleapis.com/google.cloud.eventarc.v1.ListMessageBusEnrollmentsResponse"
3371 }
3372}
3373
3374/// The request message for the CreateMessageBus method.
3375#[derive(Clone, Default, PartialEq)]
3376#[non_exhaustive]
3377pub struct CreateMessageBusRequest {
3378 /// Required. The parent collection in which to add this message bus.
3379 pub parent: std::string::String,
3380
3381 /// Required. The message bus to create.
3382 pub message_bus: std::option::Option<crate::model::MessageBus>,
3383
3384 /// Required. The user-provided ID to be assigned to the MessageBus. It should
3385 /// match the format `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
3386 pub message_bus_id: std::string::String,
3387
3388 /// Optional. If set, validate the request and preview the review, but do not
3389 /// post it.
3390 pub validate_only: bool,
3391
3392 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3393}
3394
3395impl CreateMessageBusRequest {
3396 /// Creates a new default instance.
3397 pub fn new() -> Self {
3398 std::default::Default::default()
3399 }
3400
3401 /// Sets the value of [parent][crate::model::CreateMessageBusRequest::parent].
3402 ///
3403 /// # Example
3404 /// ```ignore,no_run
3405 /// # use google_cloud_eventarc_v1::model::CreateMessageBusRequest;
3406 /// # let project_id = "project_id";
3407 /// # let location_id = "location_id";
3408 /// let x = CreateMessageBusRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3409 /// ```
3410 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3411 self.parent = v.into();
3412 self
3413 }
3414
3415 /// Sets the value of [message_bus][crate::model::CreateMessageBusRequest::message_bus].
3416 ///
3417 /// # Example
3418 /// ```ignore,no_run
3419 /// # use google_cloud_eventarc_v1::model::CreateMessageBusRequest;
3420 /// use google_cloud_eventarc_v1::model::MessageBus;
3421 /// let x = CreateMessageBusRequest::new().set_message_bus(MessageBus::default()/* use setters */);
3422 /// ```
3423 pub fn set_message_bus<T>(mut self, v: T) -> Self
3424 where
3425 T: std::convert::Into<crate::model::MessageBus>,
3426 {
3427 self.message_bus = std::option::Option::Some(v.into());
3428 self
3429 }
3430
3431 /// Sets or clears the value of [message_bus][crate::model::CreateMessageBusRequest::message_bus].
3432 ///
3433 /// # Example
3434 /// ```ignore,no_run
3435 /// # use google_cloud_eventarc_v1::model::CreateMessageBusRequest;
3436 /// use google_cloud_eventarc_v1::model::MessageBus;
3437 /// let x = CreateMessageBusRequest::new().set_or_clear_message_bus(Some(MessageBus::default()/* use setters */));
3438 /// let x = CreateMessageBusRequest::new().set_or_clear_message_bus(None::<MessageBus>);
3439 /// ```
3440 pub fn set_or_clear_message_bus<T>(mut self, v: std::option::Option<T>) -> Self
3441 where
3442 T: std::convert::Into<crate::model::MessageBus>,
3443 {
3444 self.message_bus = v.map(|x| x.into());
3445 self
3446 }
3447
3448 /// Sets the value of [message_bus_id][crate::model::CreateMessageBusRequest::message_bus_id].
3449 ///
3450 /// # Example
3451 /// ```ignore,no_run
3452 /// # use google_cloud_eventarc_v1::model::CreateMessageBusRequest;
3453 /// let x = CreateMessageBusRequest::new().set_message_bus_id("example");
3454 /// ```
3455 pub fn set_message_bus_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3456 self.message_bus_id = v.into();
3457 self
3458 }
3459
3460 /// Sets the value of [validate_only][crate::model::CreateMessageBusRequest::validate_only].
3461 ///
3462 /// # Example
3463 /// ```ignore,no_run
3464 /// # use google_cloud_eventarc_v1::model::CreateMessageBusRequest;
3465 /// let x = CreateMessageBusRequest::new().set_validate_only(true);
3466 /// ```
3467 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3468 self.validate_only = v.into();
3469 self
3470 }
3471}
3472
3473impl wkt::message::Message for CreateMessageBusRequest {
3474 fn typename() -> &'static str {
3475 "type.googleapis.com/google.cloud.eventarc.v1.CreateMessageBusRequest"
3476 }
3477}
3478
3479/// The request message for the UpdateMessageBus method.
3480#[derive(Clone, Default, PartialEq)]
3481#[non_exhaustive]
3482pub struct UpdateMessageBusRequest {
3483 /// Required. The MessageBus to be updated.
3484 pub message_bus: std::option::Option<crate::model::MessageBus>,
3485
3486 /// Optional. The fields to be updated; only fields explicitly provided are
3487 /// updated. If no field mask is provided, all provided fields in the request
3488 /// are updated. To update all fields, provide a field mask of "*".
3489 pub update_mask: std::option::Option<wkt::FieldMask>,
3490
3491 /// Optional. If set to true, and the MessageBus is not found, a new MessageBus
3492 /// will be created. In this situation, `update_mask` is ignored.
3493 pub allow_missing: bool,
3494
3495 /// Optional. If set, validate the request and preview the review, but do not
3496 /// post it.
3497 pub validate_only: bool,
3498
3499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3500}
3501
3502impl UpdateMessageBusRequest {
3503 /// Creates a new default instance.
3504 pub fn new() -> Self {
3505 std::default::Default::default()
3506 }
3507
3508 /// Sets the value of [message_bus][crate::model::UpdateMessageBusRequest::message_bus].
3509 ///
3510 /// # Example
3511 /// ```ignore,no_run
3512 /// # use google_cloud_eventarc_v1::model::UpdateMessageBusRequest;
3513 /// use google_cloud_eventarc_v1::model::MessageBus;
3514 /// let x = UpdateMessageBusRequest::new().set_message_bus(MessageBus::default()/* use setters */);
3515 /// ```
3516 pub fn set_message_bus<T>(mut self, v: T) -> Self
3517 where
3518 T: std::convert::Into<crate::model::MessageBus>,
3519 {
3520 self.message_bus = std::option::Option::Some(v.into());
3521 self
3522 }
3523
3524 /// Sets or clears the value of [message_bus][crate::model::UpdateMessageBusRequest::message_bus].
3525 ///
3526 /// # Example
3527 /// ```ignore,no_run
3528 /// # use google_cloud_eventarc_v1::model::UpdateMessageBusRequest;
3529 /// use google_cloud_eventarc_v1::model::MessageBus;
3530 /// let x = UpdateMessageBusRequest::new().set_or_clear_message_bus(Some(MessageBus::default()/* use setters */));
3531 /// let x = UpdateMessageBusRequest::new().set_or_clear_message_bus(None::<MessageBus>);
3532 /// ```
3533 pub fn set_or_clear_message_bus<T>(mut self, v: std::option::Option<T>) -> Self
3534 where
3535 T: std::convert::Into<crate::model::MessageBus>,
3536 {
3537 self.message_bus = v.map(|x| x.into());
3538 self
3539 }
3540
3541 /// Sets the value of [update_mask][crate::model::UpdateMessageBusRequest::update_mask].
3542 ///
3543 /// # Example
3544 /// ```ignore,no_run
3545 /// # use google_cloud_eventarc_v1::model::UpdateMessageBusRequest;
3546 /// use wkt::FieldMask;
3547 /// let x = UpdateMessageBusRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3548 /// ```
3549 pub fn set_update_mask<T>(mut self, v: T) -> Self
3550 where
3551 T: std::convert::Into<wkt::FieldMask>,
3552 {
3553 self.update_mask = std::option::Option::Some(v.into());
3554 self
3555 }
3556
3557 /// Sets or clears the value of [update_mask][crate::model::UpdateMessageBusRequest::update_mask].
3558 ///
3559 /// # Example
3560 /// ```ignore,no_run
3561 /// # use google_cloud_eventarc_v1::model::UpdateMessageBusRequest;
3562 /// use wkt::FieldMask;
3563 /// let x = UpdateMessageBusRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3564 /// let x = UpdateMessageBusRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3565 /// ```
3566 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3567 where
3568 T: std::convert::Into<wkt::FieldMask>,
3569 {
3570 self.update_mask = v.map(|x| x.into());
3571 self
3572 }
3573
3574 /// Sets the value of [allow_missing][crate::model::UpdateMessageBusRequest::allow_missing].
3575 ///
3576 /// # Example
3577 /// ```ignore,no_run
3578 /// # use google_cloud_eventarc_v1::model::UpdateMessageBusRequest;
3579 /// let x = UpdateMessageBusRequest::new().set_allow_missing(true);
3580 /// ```
3581 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3582 self.allow_missing = v.into();
3583 self
3584 }
3585
3586 /// Sets the value of [validate_only][crate::model::UpdateMessageBusRequest::validate_only].
3587 ///
3588 /// # Example
3589 /// ```ignore,no_run
3590 /// # use google_cloud_eventarc_v1::model::UpdateMessageBusRequest;
3591 /// let x = UpdateMessageBusRequest::new().set_validate_only(true);
3592 /// ```
3593 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3594 self.validate_only = v.into();
3595 self
3596 }
3597}
3598
3599impl wkt::message::Message for UpdateMessageBusRequest {
3600 fn typename() -> &'static str {
3601 "type.googleapis.com/google.cloud.eventarc.v1.UpdateMessageBusRequest"
3602 }
3603}
3604
3605/// The request message for the DeleteMessageBus method.
3606#[derive(Clone, Default, PartialEq)]
3607#[non_exhaustive]
3608pub struct DeleteMessageBusRequest {
3609 /// Required. The name of the MessageBus to be deleted.
3610 pub name: std::string::String,
3611
3612 /// Optional. If provided, the MessageBus will only be deleted if the etag
3613 /// matches the current etag on the resource.
3614 pub etag: std::string::String,
3615
3616 /// Optional. If set to true, and the MessageBus is not found, the request will
3617 /// succeed but no action will be taken on the server.
3618 pub allow_missing: bool,
3619
3620 /// Optional. If set, validate the request and preview the review, but do not
3621 /// post it.
3622 pub validate_only: bool,
3623
3624 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3625}
3626
3627impl DeleteMessageBusRequest {
3628 /// Creates a new default instance.
3629 pub fn new() -> Self {
3630 std::default::Default::default()
3631 }
3632
3633 /// Sets the value of [name][crate::model::DeleteMessageBusRequest::name].
3634 ///
3635 /// # Example
3636 /// ```ignore,no_run
3637 /// # use google_cloud_eventarc_v1::model::DeleteMessageBusRequest;
3638 /// # let project_id = "project_id";
3639 /// # let location_id = "location_id";
3640 /// # let message_bus_id = "message_bus_id";
3641 /// let x = DeleteMessageBusRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/messageBuses/{message_bus_id}"));
3642 /// ```
3643 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3644 self.name = v.into();
3645 self
3646 }
3647
3648 /// Sets the value of [etag][crate::model::DeleteMessageBusRequest::etag].
3649 ///
3650 /// # Example
3651 /// ```ignore,no_run
3652 /// # use google_cloud_eventarc_v1::model::DeleteMessageBusRequest;
3653 /// let x = DeleteMessageBusRequest::new().set_etag("example");
3654 /// ```
3655 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3656 self.etag = v.into();
3657 self
3658 }
3659
3660 /// Sets the value of [allow_missing][crate::model::DeleteMessageBusRequest::allow_missing].
3661 ///
3662 /// # Example
3663 /// ```ignore,no_run
3664 /// # use google_cloud_eventarc_v1::model::DeleteMessageBusRequest;
3665 /// let x = DeleteMessageBusRequest::new().set_allow_missing(true);
3666 /// ```
3667 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3668 self.allow_missing = v.into();
3669 self
3670 }
3671
3672 /// Sets the value of [validate_only][crate::model::DeleteMessageBusRequest::validate_only].
3673 ///
3674 /// # Example
3675 /// ```ignore,no_run
3676 /// # use google_cloud_eventarc_v1::model::DeleteMessageBusRequest;
3677 /// let x = DeleteMessageBusRequest::new().set_validate_only(true);
3678 /// ```
3679 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3680 self.validate_only = v.into();
3681 self
3682 }
3683}
3684
3685impl wkt::message::Message for DeleteMessageBusRequest {
3686 fn typename() -> &'static str {
3687 "type.googleapis.com/google.cloud.eventarc.v1.DeleteMessageBusRequest"
3688 }
3689}
3690
3691/// The request message for the GetEnrollment method.
3692#[derive(Clone, Default, PartialEq)]
3693#[non_exhaustive]
3694pub struct GetEnrollmentRequest {
3695 /// Required. The name of the Enrollment to get.
3696 pub name: std::string::String,
3697
3698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3699}
3700
3701impl GetEnrollmentRequest {
3702 /// Creates a new default instance.
3703 pub fn new() -> Self {
3704 std::default::Default::default()
3705 }
3706
3707 /// Sets the value of [name][crate::model::GetEnrollmentRequest::name].
3708 ///
3709 /// # Example
3710 /// ```ignore,no_run
3711 /// # use google_cloud_eventarc_v1::model::GetEnrollmentRequest;
3712 /// # let project_id = "project_id";
3713 /// # let location_id = "location_id";
3714 /// # let enrollment_id = "enrollment_id";
3715 /// let x = GetEnrollmentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/enrollments/{enrollment_id}"));
3716 /// ```
3717 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3718 self.name = v.into();
3719 self
3720 }
3721}
3722
3723impl wkt::message::Message for GetEnrollmentRequest {
3724 fn typename() -> &'static str {
3725 "type.googleapis.com/google.cloud.eventarc.v1.GetEnrollmentRequest"
3726 }
3727}
3728
3729/// The request message for the ListEnrollments method.
3730#[derive(Clone, Default, PartialEq)]
3731#[non_exhaustive]
3732pub struct ListEnrollmentsRequest {
3733 /// Required. The parent collection to list triggers on.
3734 pub parent: std::string::String,
3735
3736 /// Optional. The maximum number of results to return on each page.
3737 ///
3738 /// Note: The service may send fewer.
3739 pub page_size: i32,
3740
3741 /// Optional. The page token; provide the value from the `next_page_token`
3742 /// field in a previous call to retrieve the subsequent page.
3743 ///
3744 /// When paginating, all other parameters provided must match
3745 /// the previous call that provided the page token.
3746 pub page_token: std::string::String,
3747
3748 /// Optional. The sorting order of the resources returned. Value should be a
3749 /// comma-separated list of fields. The default sorting order is ascending. To
3750 /// specify descending order for a field, append a `desc` suffix; for example:
3751 /// `name desc, update_time`.
3752 pub order_by: std::string::String,
3753
3754 /// Optional. The filter field that the list request will filter on.
3755 /// Possible filtersare described in <https://google.aip.dev/160>.
3756 pub filter: std::string::String,
3757
3758 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3759}
3760
3761impl ListEnrollmentsRequest {
3762 /// Creates a new default instance.
3763 pub fn new() -> Self {
3764 std::default::Default::default()
3765 }
3766
3767 /// Sets the value of [parent][crate::model::ListEnrollmentsRequest::parent].
3768 ///
3769 /// # Example
3770 /// ```ignore,no_run
3771 /// # use google_cloud_eventarc_v1::model::ListEnrollmentsRequest;
3772 /// # let project_id = "project_id";
3773 /// # let location_id = "location_id";
3774 /// let x = ListEnrollmentsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3775 /// ```
3776 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3777 self.parent = v.into();
3778 self
3779 }
3780
3781 /// Sets the value of [page_size][crate::model::ListEnrollmentsRequest::page_size].
3782 ///
3783 /// # Example
3784 /// ```ignore,no_run
3785 /// # use google_cloud_eventarc_v1::model::ListEnrollmentsRequest;
3786 /// let x = ListEnrollmentsRequest::new().set_page_size(42);
3787 /// ```
3788 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3789 self.page_size = v.into();
3790 self
3791 }
3792
3793 /// Sets the value of [page_token][crate::model::ListEnrollmentsRequest::page_token].
3794 ///
3795 /// # Example
3796 /// ```ignore,no_run
3797 /// # use google_cloud_eventarc_v1::model::ListEnrollmentsRequest;
3798 /// let x = ListEnrollmentsRequest::new().set_page_token("example");
3799 /// ```
3800 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3801 self.page_token = v.into();
3802 self
3803 }
3804
3805 /// Sets the value of [order_by][crate::model::ListEnrollmentsRequest::order_by].
3806 ///
3807 /// # Example
3808 /// ```ignore,no_run
3809 /// # use google_cloud_eventarc_v1::model::ListEnrollmentsRequest;
3810 /// let x = ListEnrollmentsRequest::new().set_order_by("example");
3811 /// ```
3812 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3813 self.order_by = v.into();
3814 self
3815 }
3816
3817 /// Sets the value of [filter][crate::model::ListEnrollmentsRequest::filter].
3818 ///
3819 /// # Example
3820 /// ```ignore,no_run
3821 /// # use google_cloud_eventarc_v1::model::ListEnrollmentsRequest;
3822 /// let x = ListEnrollmentsRequest::new().set_filter("example");
3823 /// ```
3824 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3825 self.filter = v.into();
3826 self
3827 }
3828}
3829
3830impl wkt::message::Message for ListEnrollmentsRequest {
3831 fn typename() -> &'static str {
3832 "type.googleapis.com/google.cloud.eventarc.v1.ListEnrollmentsRequest"
3833 }
3834}
3835
3836/// The response message for the `ListEnrollments` method.
3837#[derive(Clone, Default, PartialEq)]
3838#[non_exhaustive]
3839pub struct ListEnrollmentsResponse {
3840 /// The requested Enrollments, up to the number specified in `page_size`.
3841 pub enrollments: std::vec::Vec<crate::model::Enrollment>,
3842
3843 /// A page token that can be sent to `ListEnrollments` to request the next
3844 /// page. If this is empty, then there are no more pages.
3845 pub next_page_token: std::string::String,
3846
3847 /// Unreachable resources, if any.
3848 pub unreachable: std::vec::Vec<std::string::String>,
3849
3850 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3851}
3852
3853impl ListEnrollmentsResponse {
3854 /// Creates a new default instance.
3855 pub fn new() -> Self {
3856 std::default::Default::default()
3857 }
3858
3859 /// Sets the value of [enrollments][crate::model::ListEnrollmentsResponse::enrollments].
3860 ///
3861 /// # Example
3862 /// ```ignore,no_run
3863 /// # use google_cloud_eventarc_v1::model::ListEnrollmentsResponse;
3864 /// use google_cloud_eventarc_v1::model::Enrollment;
3865 /// let x = ListEnrollmentsResponse::new()
3866 /// .set_enrollments([
3867 /// Enrollment::default()/* use setters */,
3868 /// Enrollment::default()/* use (different) setters */,
3869 /// ]);
3870 /// ```
3871 pub fn set_enrollments<T, V>(mut self, v: T) -> Self
3872 where
3873 T: std::iter::IntoIterator<Item = V>,
3874 V: std::convert::Into<crate::model::Enrollment>,
3875 {
3876 use std::iter::Iterator;
3877 self.enrollments = v.into_iter().map(|i| i.into()).collect();
3878 self
3879 }
3880
3881 /// Sets the value of [next_page_token][crate::model::ListEnrollmentsResponse::next_page_token].
3882 ///
3883 /// # Example
3884 /// ```ignore,no_run
3885 /// # use google_cloud_eventarc_v1::model::ListEnrollmentsResponse;
3886 /// let x = ListEnrollmentsResponse::new().set_next_page_token("example");
3887 /// ```
3888 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3889 self.next_page_token = v.into();
3890 self
3891 }
3892
3893 /// Sets the value of [unreachable][crate::model::ListEnrollmentsResponse::unreachable].
3894 ///
3895 /// # Example
3896 /// ```ignore,no_run
3897 /// # use google_cloud_eventarc_v1::model::ListEnrollmentsResponse;
3898 /// let x = ListEnrollmentsResponse::new().set_unreachable(["a", "b", "c"]);
3899 /// ```
3900 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3901 where
3902 T: std::iter::IntoIterator<Item = V>,
3903 V: std::convert::Into<std::string::String>,
3904 {
3905 use std::iter::Iterator;
3906 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3907 self
3908 }
3909}
3910
3911impl wkt::message::Message for ListEnrollmentsResponse {
3912 fn typename() -> &'static str {
3913 "type.googleapis.com/google.cloud.eventarc.v1.ListEnrollmentsResponse"
3914 }
3915}
3916
3917#[doc(hidden)]
3918impl google_cloud_gax::paginator::internal::PageableResponse for ListEnrollmentsResponse {
3919 type PageItem = crate::model::Enrollment;
3920
3921 fn items(self) -> std::vec::Vec<Self::PageItem> {
3922 self.enrollments
3923 }
3924
3925 fn next_page_token(&self) -> std::string::String {
3926 use std::clone::Clone;
3927 self.next_page_token.clone()
3928 }
3929}
3930
3931/// The request message for the CreateEnrollment method.
3932#[derive(Clone, Default, PartialEq)]
3933#[non_exhaustive]
3934pub struct CreateEnrollmentRequest {
3935 /// Required. The parent collection in which to add this enrollment.
3936 pub parent: std::string::String,
3937
3938 /// Required. The enrollment to create.
3939 pub enrollment: std::option::Option<crate::model::Enrollment>,
3940
3941 /// Required. The user-provided ID to be assigned to the Enrollment. It should
3942 /// match the format `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
3943 pub enrollment_id: std::string::String,
3944
3945 /// Optional. If set, validate the request and preview the review, but do not
3946 /// post it.
3947 pub validate_only: bool,
3948
3949 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3950}
3951
3952impl CreateEnrollmentRequest {
3953 /// Creates a new default instance.
3954 pub fn new() -> Self {
3955 std::default::Default::default()
3956 }
3957
3958 /// Sets the value of [parent][crate::model::CreateEnrollmentRequest::parent].
3959 ///
3960 /// # Example
3961 /// ```ignore,no_run
3962 /// # use google_cloud_eventarc_v1::model::CreateEnrollmentRequest;
3963 /// # let project_id = "project_id";
3964 /// # let location_id = "location_id";
3965 /// let x = CreateEnrollmentRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3966 /// ```
3967 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3968 self.parent = v.into();
3969 self
3970 }
3971
3972 /// Sets the value of [enrollment][crate::model::CreateEnrollmentRequest::enrollment].
3973 ///
3974 /// # Example
3975 /// ```ignore,no_run
3976 /// # use google_cloud_eventarc_v1::model::CreateEnrollmentRequest;
3977 /// use google_cloud_eventarc_v1::model::Enrollment;
3978 /// let x = CreateEnrollmentRequest::new().set_enrollment(Enrollment::default()/* use setters */);
3979 /// ```
3980 pub fn set_enrollment<T>(mut self, v: T) -> Self
3981 where
3982 T: std::convert::Into<crate::model::Enrollment>,
3983 {
3984 self.enrollment = std::option::Option::Some(v.into());
3985 self
3986 }
3987
3988 /// Sets or clears the value of [enrollment][crate::model::CreateEnrollmentRequest::enrollment].
3989 ///
3990 /// # Example
3991 /// ```ignore,no_run
3992 /// # use google_cloud_eventarc_v1::model::CreateEnrollmentRequest;
3993 /// use google_cloud_eventarc_v1::model::Enrollment;
3994 /// let x = CreateEnrollmentRequest::new().set_or_clear_enrollment(Some(Enrollment::default()/* use setters */));
3995 /// let x = CreateEnrollmentRequest::new().set_or_clear_enrollment(None::<Enrollment>);
3996 /// ```
3997 pub fn set_or_clear_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
3998 where
3999 T: std::convert::Into<crate::model::Enrollment>,
4000 {
4001 self.enrollment = v.map(|x| x.into());
4002 self
4003 }
4004
4005 /// Sets the value of [enrollment_id][crate::model::CreateEnrollmentRequest::enrollment_id].
4006 ///
4007 /// # Example
4008 /// ```ignore,no_run
4009 /// # use google_cloud_eventarc_v1::model::CreateEnrollmentRequest;
4010 /// let x = CreateEnrollmentRequest::new().set_enrollment_id("example");
4011 /// ```
4012 pub fn set_enrollment_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4013 self.enrollment_id = v.into();
4014 self
4015 }
4016
4017 /// Sets the value of [validate_only][crate::model::CreateEnrollmentRequest::validate_only].
4018 ///
4019 /// # Example
4020 /// ```ignore,no_run
4021 /// # use google_cloud_eventarc_v1::model::CreateEnrollmentRequest;
4022 /// let x = CreateEnrollmentRequest::new().set_validate_only(true);
4023 /// ```
4024 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4025 self.validate_only = v.into();
4026 self
4027 }
4028}
4029
4030impl wkt::message::Message for CreateEnrollmentRequest {
4031 fn typename() -> &'static str {
4032 "type.googleapis.com/google.cloud.eventarc.v1.CreateEnrollmentRequest"
4033 }
4034}
4035
4036/// The request message for the UpdateEnrollment method.
4037#[derive(Clone, Default, PartialEq)]
4038#[non_exhaustive]
4039pub struct UpdateEnrollmentRequest {
4040 /// Required. The Enrollment to be updated.
4041 pub enrollment: std::option::Option<crate::model::Enrollment>,
4042
4043 /// Optional. The fields to be updated; only fields explicitly provided are
4044 /// updated. If no field mask is provided, all provided fields in the request
4045 /// are updated. To update all fields, provide a field mask of "*".
4046 pub update_mask: std::option::Option<wkt::FieldMask>,
4047
4048 /// Optional. If set to true, and the Enrollment is not found, a new Enrollment
4049 /// will be created. In this situation, `update_mask` is ignored.
4050 pub allow_missing: bool,
4051
4052 /// Optional. If set, validate the request and preview the review, but do not
4053 /// post it.
4054 pub validate_only: bool,
4055
4056 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4057}
4058
4059impl UpdateEnrollmentRequest {
4060 /// Creates a new default instance.
4061 pub fn new() -> Self {
4062 std::default::Default::default()
4063 }
4064
4065 /// Sets the value of [enrollment][crate::model::UpdateEnrollmentRequest::enrollment].
4066 ///
4067 /// # Example
4068 /// ```ignore,no_run
4069 /// # use google_cloud_eventarc_v1::model::UpdateEnrollmentRequest;
4070 /// use google_cloud_eventarc_v1::model::Enrollment;
4071 /// let x = UpdateEnrollmentRequest::new().set_enrollment(Enrollment::default()/* use setters */);
4072 /// ```
4073 pub fn set_enrollment<T>(mut self, v: T) -> Self
4074 where
4075 T: std::convert::Into<crate::model::Enrollment>,
4076 {
4077 self.enrollment = std::option::Option::Some(v.into());
4078 self
4079 }
4080
4081 /// Sets or clears the value of [enrollment][crate::model::UpdateEnrollmentRequest::enrollment].
4082 ///
4083 /// # Example
4084 /// ```ignore,no_run
4085 /// # use google_cloud_eventarc_v1::model::UpdateEnrollmentRequest;
4086 /// use google_cloud_eventarc_v1::model::Enrollment;
4087 /// let x = UpdateEnrollmentRequest::new().set_or_clear_enrollment(Some(Enrollment::default()/* use setters */));
4088 /// let x = UpdateEnrollmentRequest::new().set_or_clear_enrollment(None::<Enrollment>);
4089 /// ```
4090 pub fn set_or_clear_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
4091 where
4092 T: std::convert::Into<crate::model::Enrollment>,
4093 {
4094 self.enrollment = v.map(|x| x.into());
4095 self
4096 }
4097
4098 /// Sets the value of [update_mask][crate::model::UpdateEnrollmentRequest::update_mask].
4099 ///
4100 /// # Example
4101 /// ```ignore,no_run
4102 /// # use google_cloud_eventarc_v1::model::UpdateEnrollmentRequest;
4103 /// use wkt::FieldMask;
4104 /// let x = UpdateEnrollmentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4105 /// ```
4106 pub fn set_update_mask<T>(mut self, v: T) -> Self
4107 where
4108 T: std::convert::Into<wkt::FieldMask>,
4109 {
4110 self.update_mask = std::option::Option::Some(v.into());
4111 self
4112 }
4113
4114 /// Sets or clears the value of [update_mask][crate::model::UpdateEnrollmentRequest::update_mask].
4115 ///
4116 /// # Example
4117 /// ```ignore,no_run
4118 /// # use google_cloud_eventarc_v1::model::UpdateEnrollmentRequest;
4119 /// use wkt::FieldMask;
4120 /// let x = UpdateEnrollmentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4121 /// let x = UpdateEnrollmentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4122 /// ```
4123 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4124 where
4125 T: std::convert::Into<wkt::FieldMask>,
4126 {
4127 self.update_mask = v.map(|x| x.into());
4128 self
4129 }
4130
4131 /// Sets the value of [allow_missing][crate::model::UpdateEnrollmentRequest::allow_missing].
4132 ///
4133 /// # Example
4134 /// ```ignore,no_run
4135 /// # use google_cloud_eventarc_v1::model::UpdateEnrollmentRequest;
4136 /// let x = UpdateEnrollmentRequest::new().set_allow_missing(true);
4137 /// ```
4138 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4139 self.allow_missing = v.into();
4140 self
4141 }
4142
4143 /// Sets the value of [validate_only][crate::model::UpdateEnrollmentRequest::validate_only].
4144 ///
4145 /// # Example
4146 /// ```ignore,no_run
4147 /// # use google_cloud_eventarc_v1::model::UpdateEnrollmentRequest;
4148 /// let x = UpdateEnrollmentRequest::new().set_validate_only(true);
4149 /// ```
4150 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4151 self.validate_only = v.into();
4152 self
4153 }
4154}
4155
4156impl wkt::message::Message for UpdateEnrollmentRequest {
4157 fn typename() -> &'static str {
4158 "type.googleapis.com/google.cloud.eventarc.v1.UpdateEnrollmentRequest"
4159 }
4160}
4161
4162/// The request message for the DeleteEnrollment method.
4163#[derive(Clone, Default, PartialEq)]
4164#[non_exhaustive]
4165pub struct DeleteEnrollmentRequest {
4166 /// Required. The name of the Enrollment to be deleted.
4167 pub name: std::string::String,
4168
4169 /// Optional. If provided, the Enrollment will only be deleted if the etag
4170 /// matches the current etag on the resource.
4171 pub etag: std::string::String,
4172
4173 /// Optional. If set to true, and the Enrollment is not found, the request will
4174 /// succeed but no action will be taken on the server.
4175 pub allow_missing: bool,
4176
4177 /// Optional. If set, validate the request and preview the review, but do not
4178 /// post it.
4179 pub validate_only: bool,
4180
4181 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4182}
4183
4184impl DeleteEnrollmentRequest {
4185 /// Creates a new default instance.
4186 pub fn new() -> Self {
4187 std::default::Default::default()
4188 }
4189
4190 /// Sets the value of [name][crate::model::DeleteEnrollmentRequest::name].
4191 ///
4192 /// # Example
4193 /// ```ignore,no_run
4194 /// # use google_cloud_eventarc_v1::model::DeleteEnrollmentRequest;
4195 /// # let project_id = "project_id";
4196 /// # let location_id = "location_id";
4197 /// # let enrollment_id = "enrollment_id";
4198 /// let x = DeleteEnrollmentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/enrollments/{enrollment_id}"));
4199 /// ```
4200 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4201 self.name = v.into();
4202 self
4203 }
4204
4205 /// Sets the value of [etag][crate::model::DeleteEnrollmentRequest::etag].
4206 ///
4207 /// # Example
4208 /// ```ignore,no_run
4209 /// # use google_cloud_eventarc_v1::model::DeleteEnrollmentRequest;
4210 /// let x = DeleteEnrollmentRequest::new().set_etag("example");
4211 /// ```
4212 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4213 self.etag = v.into();
4214 self
4215 }
4216
4217 /// Sets the value of [allow_missing][crate::model::DeleteEnrollmentRequest::allow_missing].
4218 ///
4219 /// # Example
4220 /// ```ignore,no_run
4221 /// # use google_cloud_eventarc_v1::model::DeleteEnrollmentRequest;
4222 /// let x = DeleteEnrollmentRequest::new().set_allow_missing(true);
4223 /// ```
4224 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4225 self.allow_missing = v.into();
4226 self
4227 }
4228
4229 /// Sets the value of [validate_only][crate::model::DeleteEnrollmentRequest::validate_only].
4230 ///
4231 /// # Example
4232 /// ```ignore,no_run
4233 /// # use google_cloud_eventarc_v1::model::DeleteEnrollmentRequest;
4234 /// let x = DeleteEnrollmentRequest::new().set_validate_only(true);
4235 /// ```
4236 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4237 self.validate_only = v.into();
4238 self
4239 }
4240}
4241
4242impl wkt::message::Message for DeleteEnrollmentRequest {
4243 fn typename() -> &'static str {
4244 "type.googleapis.com/google.cloud.eventarc.v1.DeleteEnrollmentRequest"
4245 }
4246}
4247
4248/// The request message for the GetPipeline method.
4249#[derive(Clone, Default, PartialEq)]
4250#[non_exhaustive]
4251pub struct GetPipelineRequest {
4252 /// Required. The name of the pipeline to get.
4253 pub name: std::string::String,
4254
4255 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4256}
4257
4258impl GetPipelineRequest {
4259 /// Creates a new default instance.
4260 pub fn new() -> Self {
4261 std::default::Default::default()
4262 }
4263
4264 /// Sets the value of [name][crate::model::GetPipelineRequest::name].
4265 ///
4266 /// # Example
4267 /// ```ignore,no_run
4268 /// # use google_cloud_eventarc_v1::model::GetPipelineRequest;
4269 /// # let project_id = "project_id";
4270 /// # let location_id = "location_id";
4271 /// # let pipeline_id = "pipeline_id";
4272 /// let x = GetPipelineRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/pipelines/{pipeline_id}"));
4273 /// ```
4274 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4275 self.name = v.into();
4276 self
4277 }
4278}
4279
4280impl wkt::message::Message for GetPipelineRequest {
4281 fn typename() -> &'static str {
4282 "type.googleapis.com/google.cloud.eventarc.v1.GetPipelineRequest"
4283 }
4284}
4285
4286/// The request message for the ListPipelines method.
4287#[derive(Clone, Default, PartialEq)]
4288#[non_exhaustive]
4289pub struct ListPipelinesRequest {
4290 /// Required. The parent collection to list pipelines on.
4291 pub parent: std::string::String,
4292
4293 /// Optional. The maximum number of results to return on each page.
4294 ///
4295 /// Note: The service may send fewer.
4296 pub page_size: i32,
4297
4298 /// Optional. The page token; provide the value from the `next_page_token`
4299 /// field in a previous call to retrieve the subsequent page.
4300 ///
4301 /// When paginating, all other parameters provided must match
4302 /// the previous call that provided the page token.
4303 pub page_token: std::string::String,
4304
4305 /// Optional. The sorting order of the resources returned. Value should be a
4306 /// comma-separated list of fields. The default sorting order is ascending. To
4307 /// specify descending order for a field, append a `desc` suffix; for example:
4308 /// `name desc, update_time`.
4309 pub order_by: std::string::String,
4310
4311 /// Optional. The filter field that the list request will filter on.
4312 /// Possible filters are described in <https://google.aip.dev/160>.
4313 pub filter: std::string::String,
4314
4315 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4316}
4317
4318impl ListPipelinesRequest {
4319 /// Creates a new default instance.
4320 pub fn new() -> Self {
4321 std::default::Default::default()
4322 }
4323
4324 /// Sets the value of [parent][crate::model::ListPipelinesRequest::parent].
4325 ///
4326 /// # Example
4327 /// ```ignore,no_run
4328 /// # use google_cloud_eventarc_v1::model::ListPipelinesRequest;
4329 /// # let project_id = "project_id";
4330 /// # let location_id = "location_id";
4331 /// let x = ListPipelinesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4332 /// ```
4333 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4334 self.parent = v.into();
4335 self
4336 }
4337
4338 /// Sets the value of [page_size][crate::model::ListPipelinesRequest::page_size].
4339 ///
4340 /// # Example
4341 /// ```ignore,no_run
4342 /// # use google_cloud_eventarc_v1::model::ListPipelinesRequest;
4343 /// let x = ListPipelinesRequest::new().set_page_size(42);
4344 /// ```
4345 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4346 self.page_size = v.into();
4347 self
4348 }
4349
4350 /// Sets the value of [page_token][crate::model::ListPipelinesRequest::page_token].
4351 ///
4352 /// # Example
4353 /// ```ignore,no_run
4354 /// # use google_cloud_eventarc_v1::model::ListPipelinesRequest;
4355 /// let x = ListPipelinesRequest::new().set_page_token("example");
4356 /// ```
4357 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4358 self.page_token = v.into();
4359 self
4360 }
4361
4362 /// Sets the value of [order_by][crate::model::ListPipelinesRequest::order_by].
4363 ///
4364 /// # Example
4365 /// ```ignore,no_run
4366 /// # use google_cloud_eventarc_v1::model::ListPipelinesRequest;
4367 /// let x = ListPipelinesRequest::new().set_order_by("example");
4368 /// ```
4369 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4370 self.order_by = v.into();
4371 self
4372 }
4373
4374 /// Sets the value of [filter][crate::model::ListPipelinesRequest::filter].
4375 ///
4376 /// # Example
4377 /// ```ignore,no_run
4378 /// # use google_cloud_eventarc_v1::model::ListPipelinesRequest;
4379 /// let x = ListPipelinesRequest::new().set_filter("example");
4380 /// ```
4381 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4382 self.filter = v.into();
4383 self
4384 }
4385}
4386
4387impl wkt::message::Message for ListPipelinesRequest {
4388 fn typename() -> &'static str {
4389 "type.googleapis.com/google.cloud.eventarc.v1.ListPipelinesRequest"
4390 }
4391}
4392
4393/// The response message for the ListPipelines method.
4394#[derive(Clone, Default, PartialEq)]
4395#[non_exhaustive]
4396pub struct ListPipelinesResponse {
4397 /// The requested pipelines, up to the number specified in `page_size`.
4398 pub pipelines: std::vec::Vec<crate::model::Pipeline>,
4399
4400 /// A page token that can be sent to `ListPipelines` to request the next
4401 /// page. If this is empty, then there are no more pages.
4402 pub next_page_token: std::string::String,
4403
4404 /// Unreachable resources, if any.
4405 pub unreachable: std::vec::Vec<std::string::String>,
4406
4407 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4408}
4409
4410impl ListPipelinesResponse {
4411 /// Creates a new default instance.
4412 pub fn new() -> Self {
4413 std::default::Default::default()
4414 }
4415
4416 /// Sets the value of [pipelines][crate::model::ListPipelinesResponse::pipelines].
4417 ///
4418 /// # Example
4419 /// ```ignore,no_run
4420 /// # use google_cloud_eventarc_v1::model::ListPipelinesResponse;
4421 /// use google_cloud_eventarc_v1::model::Pipeline;
4422 /// let x = ListPipelinesResponse::new()
4423 /// .set_pipelines([
4424 /// Pipeline::default()/* use setters */,
4425 /// Pipeline::default()/* use (different) setters */,
4426 /// ]);
4427 /// ```
4428 pub fn set_pipelines<T, V>(mut self, v: T) -> Self
4429 where
4430 T: std::iter::IntoIterator<Item = V>,
4431 V: std::convert::Into<crate::model::Pipeline>,
4432 {
4433 use std::iter::Iterator;
4434 self.pipelines = v.into_iter().map(|i| i.into()).collect();
4435 self
4436 }
4437
4438 /// Sets the value of [next_page_token][crate::model::ListPipelinesResponse::next_page_token].
4439 ///
4440 /// # Example
4441 /// ```ignore,no_run
4442 /// # use google_cloud_eventarc_v1::model::ListPipelinesResponse;
4443 /// let x = ListPipelinesResponse::new().set_next_page_token("example");
4444 /// ```
4445 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4446 self.next_page_token = v.into();
4447 self
4448 }
4449
4450 /// Sets the value of [unreachable][crate::model::ListPipelinesResponse::unreachable].
4451 ///
4452 /// # Example
4453 /// ```ignore,no_run
4454 /// # use google_cloud_eventarc_v1::model::ListPipelinesResponse;
4455 /// let x = ListPipelinesResponse::new().set_unreachable(["a", "b", "c"]);
4456 /// ```
4457 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4458 where
4459 T: std::iter::IntoIterator<Item = V>,
4460 V: std::convert::Into<std::string::String>,
4461 {
4462 use std::iter::Iterator;
4463 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4464 self
4465 }
4466}
4467
4468impl wkt::message::Message for ListPipelinesResponse {
4469 fn typename() -> &'static str {
4470 "type.googleapis.com/google.cloud.eventarc.v1.ListPipelinesResponse"
4471 }
4472}
4473
4474#[doc(hidden)]
4475impl google_cloud_gax::paginator::internal::PageableResponse for ListPipelinesResponse {
4476 type PageItem = crate::model::Pipeline;
4477
4478 fn items(self) -> std::vec::Vec<Self::PageItem> {
4479 self.pipelines
4480 }
4481
4482 fn next_page_token(&self) -> std::string::String {
4483 use std::clone::Clone;
4484 self.next_page_token.clone()
4485 }
4486}
4487
4488/// The request message for the CreatePipeline method.
4489#[derive(Clone, Default, PartialEq)]
4490#[non_exhaustive]
4491pub struct CreatePipelineRequest {
4492 /// Required. The parent collection in which to add this pipeline.
4493 pub parent: std::string::String,
4494
4495 /// Required. The pipeline to create.
4496 pub pipeline: std::option::Option<crate::model::Pipeline>,
4497
4498 /// Required. The user-provided ID to be assigned to the Pipeline. It should
4499 /// match the format `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
4500 pub pipeline_id: std::string::String,
4501
4502 /// Optional. If set, validate the request and preview the review, but do not
4503 /// post it.
4504 pub validate_only: bool,
4505
4506 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4507}
4508
4509impl CreatePipelineRequest {
4510 /// Creates a new default instance.
4511 pub fn new() -> Self {
4512 std::default::Default::default()
4513 }
4514
4515 /// Sets the value of [parent][crate::model::CreatePipelineRequest::parent].
4516 ///
4517 /// # Example
4518 /// ```ignore,no_run
4519 /// # use google_cloud_eventarc_v1::model::CreatePipelineRequest;
4520 /// # let project_id = "project_id";
4521 /// # let location_id = "location_id";
4522 /// let x = CreatePipelineRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4523 /// ```
4524 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4525 self.parent = v.into();
4526 self
4527 }
4528
4529 /// Sets the value of [pipeline][crate::model::CreatePipelineRequest::pipeline].
4530 ///
4531 /// # Example
4532 /// ```ignore,no_run
4533 /// # use google_cloud_eventarc_v1::model::CreatePipelineRequest;
4534 /// use google_cloud_eventarc_v1::model::Pipeline;
4535 /// let x = CreatePipelineRequest::new().set_pipeline(Pipeline::default()/* use setters */);
4536 /// ```
4537 pub fn set_pipeline<T>(mut self, v: T) -> Self
4538 where
4539 T: std::convert::Into<crate::model::Pipeline>,
4540 {
4541 self.pipeline = std::option::Option::Some(v.into());
4542 self
4543 }
4544
4545 /// Sets or clears the value of [pipeline][crate::model::CreatePipelineRequest::pipeline].
4546 ///
4547 /// # Example
4548 /// ```ignore,no_run
4549 /// # use google_cloud_eventarc_v1::model::CreatePipelineRequest;
4550 /// use google_cloud_eventarc_v1::model::Pipeline;
4551 /// let x = CreatePipelineRequest::new().set_or_clear_pipeline(Some(Pipeline::default()/* use setters */));
4552 /// let x = CreatePipelineRequest::new().set_or_clear_pipeline(None::<Pipeline>);
4553 /// ```
4554 pub fn set_or_clear_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
4555 where
4556 T: std::convert::Into<crate::model::Pipeline>,
4557 {
4558 self.pipeline = v.map(|x| x.into());
4559 self
4560 }
4561
4562 /// Sets the value of [pipeline_id][crate::model::CreatePipelineRequest::pipeline_id].
4563 ///
4564 /// # Example
4565 /// ```ignore,no_run
4566 /// # use google_cloud_eventarc_v1::model::CreatePipelineRequest;
4567 /// let x = CreatePipelineRequest::new().set_pipeline_id("example");
4568 /// ```
4569 pub fn set_pipeline_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4570 self.pipeline_id = v.into();
4571 self
4572 }
4573
4574 /// Sets the value of [validate_only][crate::model::CreatePipelineRequest::validate_only].
4575 ///
4576 /// # Example
4577 /// ```ignore,no_run
4578 /// # use google_cloud_eventarc_v1::model::CreatePipelineRequest;
4579 /// let x = CreatePipelineRequest::new().set_validate_only(true);
4580 /// ```
4581 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4582 self.validate_only = v.into();
4583 self
4584 }
4585}
4586
4587impl wkt::message::Message for CreatePipelineRequest {
4588 fn typename() -> &'static str {
4589 "type.googleapis.com/google.cloud.eventarc.v1.CreatePipelineRequest"
4590 }
4591}
4592
4593/// The request message for the UpdatePipeline method.
4594#[derive(Clone, Default, PartialEq)]
4595#[non_exhaustive]
4596pub struct UpdatePipelineRequest {
4597 /// Required. The Pipeline to be updated.
4598 pub pipeline: std::option::Option<crate::model::Pipeline>,
4599
4600 /// Optional. The fields to be updated; only fields explicitly provided are
4601 /// updated. If no field mask is provided, all provided fields in the request
4602 /// are updated. To update all fields, provide a field mask of "*".
4603 pub update_mask: std::option::Option<wkt::FieldMask>,
4604
4605 /// Optional. If set to true, and the Pipeline is not found, a new Pipeline
4606 /// will be created. In this situation, `update_mask` is ignored.
4607 pub allow_missing: bool,
4608
4609 /// Optional. If set, validate the request and preview the review, but do not
4610 /// post it.
4611 pub validate_only: bool,
4612
4613 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4614}
4615
4616impl UpdatePipelineRequest {
4617 /// Creates a new default instance.
4618 pub fn new() -> Self {
4619 std::default::Default::default()
4620 }
4621
4622 /// Sets the value of [pipeline][crate::model::UpdatePipelineRequest::pipeline].
4623 ///
4624 /// # Example
4625 /// ```ignore,no_run
4626 /// # use google_cloud_eventarc_v1::model::UpdatePipelineRequest;
4627 /// use google_cloud_eventarc_v1::model::Pipeline;
4628 /// let x = UpdatePipelineRequest::new().set_pipeline(Pipeline::default()/* use setters */);
4629 /// ```
4630 pub fn set_pipeline<T>(mut self, v: T) -> Self
4631 where
4632 T: std::convert::Into<crate::model::Pipeline>,
4633 {
4634 self.pipeline = std::option::Option::Some(v.into());
4635 self
4636 }
4637
4638 /// Sets or clears the value of [pipeline][crate::model::UpdatePipelineRequest::pipeline].
4639 ///
4640 /// # Example
4641 /// ```ignore,no_run
4642 /// # use google_cloud_eventarc_v1::model::UpdatePipelineRequest;
4643 /// use google_cloud_eventarc_v1::model::Pipeline;
4644 /// let x = UpdatePipelineRequest::new().set_or_clear_pipeline(Some(Pipeline::default()/* use setters */));
4645 /// let x = UpdatePipelineRequest::new().set_or_clear_pipeline(None::<Pipeline>);
4646 /// ```
4647 pub fn set_or_clear_pipeline<T>(mut self, v: std::option::Option<T>) -> Self
4648 where
4649 T: std::convert::Into<crate::model::Pipeline>,
4650 {
4651 self.pipeline = v.map(|x| x.into());
4652 self
4653 }
4654
4655 /// Sets the value of [update_mask][crate::model::UpdatePipelineRequest::update_mask].
4656 ///
4657 /// # Example
4658 /// ```ignore,no_run
4659 /// # use google_cloud_eventarc_v1::model::UpdatePipelineRequest;
4660 /// use wkt::FieldMask;
4661 /// let x = UpdatePipelineRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4662 /// ```
4663 pub fn set_update_mask<T>(mut self, v: T) -> Self
4664 where
4665 T: std::convert::Into<wkt::FieldMask>,
4666 {
4667 self.update_mask = std::option::Option::Some(v.into());
4668 self
4669 }
4670
4671 /// Sets or clears the value of [update_mask][crate::model::UpdatePipelineRequest::update_mask].
4672 ///
4673 /// # Example
4674 /// ```ignore,no_run
4675 /// # use google_cloud_eventarc_v1::model::UpdatePipelineRequest;
4676 /// use wkt::FieldMask;
4677 /// let x = UpdatePipelineRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4678 /// let x = UpdatePipelineRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4679 /// ```
4680 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4681 where
4682 T: std::convert::Into<wkt::FieldMask>,
4683 {
4684 self.update_mask = v.map(|x| x.into());
4685 self
4686 }
4687
4688 /// Sets the value of [allow_missing][crate::model::UpdatePipelineRequest::allow_missing].
4689 ///
4690 /// # Example
4691 /// ```ignore,no_run
4692 /// # use google_cloud_eventarc_v1::model::UpdatePipelineRequest;
4693 /// let x = UpdatePipelineRequest::new().set_allow_missing(true);
4694 /// ```
4695 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4696 self.allow_missing = v.into();
4697 self
4698 }
4699
4700 /// Sets the value of [validate_only][crate::model::UpdatePipelineRequest::validate_only].
4701 ///
4702 /// # Example
4703 /// ```ignore,no_run
4704 /// # use google_cloud_eventarc_v1::model::UpdatePipelineRequest;
4705 /// let x = UpdatePipelineRequest::new().set_validate_only(true);
4706 /// ```
4707 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4708 self.validate_only = v.into();
4709 self
4710 }
4711}
4712
4713impl wkt::message::Message for UpdatePipelineRequest {
4714 fn typename() -> &'static str {
4715 "type.googleapis.com/google.cloud.eventarc.v1.UpdatePipelineRequest"
4716 }
4717}
4718
4719/// The request message for the DeletePipeline method.
4720#[derive(Clone, Default, PartialEq)]
4721#[non_exhaustive]
4722pub struct DeletePipelineRequest {
4723 /// Required. The name of the Pipeline to be deleted.
4724 pub name: std::string::String,
4725
4726 /// Optional. If provided, the Pipeline will only be deleted if the etag
4727 /// matches the current etag on the resource.
4728 pub etag: std::string::String,
4729
4730 /// Optional. If set to true, and the Pipeline is not found, the request will
4731 /// succeed but no action will be taken on the server.
4732 pub allow_missing: bool,
4733
4734 /// Optional. If set, validate the request and preview the review, but do not
4735 /// post it.
4736 pub validate_only: bool,
4737
4738 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4739}
4740
4741impl DeletePipelineRequest {
4742 /// Creates a new default instance.
4743 pub fn new() -> Self {
4744 std::default::Default::default()
4745 }
4746
4747 /// Sets the value of [name][crate::model::DeletePipelineRequest::name].
4748 ///
4749 /// # Example
4750 /// ```ignore,no_run
4751 /// # use google_cloud_eventarc_v1::model::DeletePipelineRequest;
4752 /// # let project_id = "project_id";
4753 /// # let location_id = "location_id";
4754 /// # let pipeline_id = "pipeline_id";
4755 /// let x = DeletePipelineRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/pipelines/{pipeline_id}"));
4756 /// ```
4757 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4758 self.name = v.into();
4759 self
4760 }
4761
4762 /// Sets the value of [etag][crate::model::DeletePipelineRequest::etag].
4763 ///
4764 /// # Example
4765 /// ```ignore,no_run
4766 /// # use google_cloud_eventarc_v1::model::DeletePipelineRequest;
4767 /// let x = DeletePipelineRequest::new().set_etag("example");
4768 /// ```
4769 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4770 self.etag = v.into();
4771 self
4772 }
4773
4774 /// Sets the value of [allow_missing][crate::model::DeletePipelineRequest::allow_missing].
4775 ///
4776 /// # Example
4777 /// ```ignore,no_run
4778 /// # use google_cloud_eventarc_v1::model::DeletePipelineRequest;
4779 /// let x = DeletePipelineRequest::new().set_allow_missing(true);
4780 /// ```
4781 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4782 self.allow_missing = v.into();
4783 self
4784 }
4785
4786 /// Sets the value of [validate_only][crate::model::DeletePipelineRequest::validate_only].
4787 ///
4788 /// # Example
4789 /// ```ignore,no_run
4790 /// # use google_cloud_eventarc_v1::model::DeletePipelineRequest;
4791 /// let x = DeletePipelineRequest::new().set_validate_only(true);
4792 /// ```
4793 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4794 self.validate_only = v.into();
4795 self
4796 }
4797}
4798
4799impl wkt::message::Message for DeletePipelineRequest {
4800 fn typename() -> &'static str {
4801 "type.googleapis.com/google.cloud.eventarc.v1.DeletePipelineRequest"
4802 }
4803}
4804
4805/// The request message for the GetGoogleApiSource method.
4806#[derive(Clone, Default, PartialEq)]
4807#[non_exhaustive]
4808pub struct GetGoogleApiSourceRequest {
4809 /// Required. The name of the google api source to get.
4810 pub name: std::string::String,
4811
4812 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4813}
4814
4815impl GetGoogleApiSourceRequest {
4816 /// Creates a new default instance.
4817 pub fn new() -> Self {
4818 std::default::Default::default()
4819 }
4820
4821 /// Sets the value of [name][crate::model::GetGoogleApiSourceRequest::name].
4822 ///
4823 /// # Example
4824 /// ```ignore,no_run
4825 /// # use google_cloud_eventarc_v1::model::GetGoogleApiSourceRequest;
4826 /// # let project_id = "project_id";
4827 /// # let location_id = "location_id";
4828 /// # let google_api_source_id = "google_api_source_id";
4829 /// let x = GetGoogleApiSourceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/googleApiSources/{google_api_source_id}"));
4830 /// ```
4831 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4832 self.name = v.into();
4833 self
4834 }
4835}
4836
4837impl wkt::message::Message for GetGoogleApiSourceRequest {
4838 fn typename() -> &'static str {
4839 "type.googleapis.com/google.cloud.eventarc.v1.GetGoogleApiSourceRequest"
4840 }
4841}
4842
4843/// The request message for the ListGoogleApiSources method.
4844#[derive(Clone, Default, PartialEq)]
4845#[non_exhaustive]
4846pub struct ListGoogleApiSourcesRequest {
4847 /// Required. The parent collection to list GoogleApiSources on.
4848 pub parent: std::string::String,
4849
4850 /// Optional. The maximum number of results to return on each page.
4851 ///
4852 /// Note: The service may send fewer.
4853 pub page_size: i32,
4854
4855 /// Optional. The page token; provide the value from the `next_page_token`
4856 /// field in a previous call to retrieve the subsequent page.
4857 ///
4858 /// When paginating, all other parameters provided must match
4859 /// the previous call that provided the page token.
4860 pub page_token: std::string::String,
4861
4862 /// Optional. The sorting order of the resources returned. Value should be a
4863 /// comma-separated list of fields. The default sorting order is ascending. To
4864 /// specify descending order for a field, append a `desc` suffix; for example:
4865 /// `name desc, update_time`.
4866 pub order_by: std::string::String,
4867
4868 /// Optional. The filter field that the list request will filter on.
4869 /// Possible filtersare described in <https://google.aip.dev/160>.
4870 pub filter: std::string::String,
4871
4872 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4873}
4874
4875impl ListGoogleApiSourcesRequest {
4876 /// Creates a new default instance.
4877 pub fn new() -> Self {
4878 std::default::Default::default()
4879 }
4880
4881 /// Sets the value of [parent][crate::model::ListGoogleApiSourcesRequest::parent].
4882 ///
4883 /// # Example
4884 /// ```ignore,no_run
4885 /// # use google_cloud_eventarc_v1::model::ListGoogleApiSourcesRequest;
4886 /// # let project_id = "project_id";
4887 /// # let location_id = "location_id";
4888 /// let x = ListGoogleApiSourcesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4889 /// ```
4890 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4891 self.parent = v.into();
4892 self
4893 }
4894
4895 /// Sets the value of [page_size][crate::model::ListGoogleApiSourcesRequest::page_size].
4896 ///
4897 /// # Example
4898 /// ```ignore,no_run
4899 /// # use google_cloud_eventarc_v1::model::ListGoogleApiSourcesRequest;
4900 /// let x = ListGoogleApiSourcesRequest::new().set_page_size(42);
4901 /// ```
4902 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4903 self.page_size = v.into();
4904 self
4905 }
4906
4907 /// Sets the value of [page_token][crate::model::ListGoogleApiSourcesRequest::page_token].
4908 ///
4909 /// # Example
4910 /// ```ignore,no_run
4911 /// # use google_cloud_eventarc_v1::model::ListGoogleApiSourcesRequest;
4912 /// let x = ListGoogleApiSourcesRequest::new().set_page_token("example");
4913 /// ```
4914 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4915 self.page_token = v.into();
4916 self
4917 }
4918
4919 /// Sets the value of [order_by][crate::model::ListGoogleApiSourcesRequest::order_by].
4920 ///
4921 /// # Example
4922 /// ```ignore,no_run
4923 /// # use google_cloud_eventarc_v1::model::ListGoogleApiSourcesRequest;
4924 /// let x = ListGoogleApiSourcesRequest::new().set_order_by("example");
4925 /// ```
4926 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4927 self.order_by = v.into();
4928 self
4929 }
4930
4931 /// Sets the value of [filter][crate::model::ListGoogleApiSourcesRequest::filter].
4932 ///
4933 /// # Example
4934 /// ```ignore,no_run
4935 /// # use google_cloud_eventarc_v1::model::ListGoogleApiSourcesRequest;
4936 /// let x = ListGoogleApiSourcesRequest::new().set_filter("example");
4937 /// ```
4938 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4939 self.filter = v.into();
4940 self
4941 }
4942}
4943
4944impl wkt::message::Message for ListGoogleApiSourcesRequest {
4945 fn typename() -> &'static str {
4946 "type.googleapis.com/google.cloud.eventarc.v1.ListGoogleApiSourcesRequest"
4947 }
4948}
4949
4950/// The response message for the `ListGoogleApiSources` method.
4951#[derive(Clone, Default, PartialEq)]
4952#[non_exhaustive]
4953pub struct ListGoogleApiSourcesResponse {
4954 /// The requested GoogleApiSources, up to the number specified in `page_size`.
4955 pub google_api_sources: std::vec::Vec<crate::model::GoogleApiSource>,
4956
4957 /// A page token that can be sent to `ListMessageBusEnrollments` to request the
4958 /// next page. If this is empty, then there are no more pages.
4959 pub next_page_token: std::string::String,
4960
4961 /// Unreachable resources, if any.
4962 pub unreachable: std::vec::Vec<std::string::String>,
4963
4964 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4965}
4966
4967impl ListGoogleApiSourcesResponse {
4968 /// Creates a new default instance.
4969 pub fn new() -> Self {
4970 std::default::Default::default()
4971 }
4972
4973 /// Sets the value of [google_api_sources][crate::model::ListGoogleApiSourcesResponse::google_api_sources].
4974 ///
4975 /// # Example
4976 /// ```ignore,no_run
4977 /// # use google_cloud_eventarc_v1::model::ListGoogleApiSourcesResponse;
4978 /// use google_cloud_eventarc_v1::model::GoogleApiSource;
4979 /// let x = ListGoogleApiSourcesResponse::new()
4980 /// .set_google_api_sources([
4981 /// GoogleApiSource::default()/* use setters */,
4982 /// GoogleApiSource::default()/* use (different) setters */,
4983 /// ]);
4984 /// ```
4985 pub fn set_google_api_sources<T, V>(mut self, v: T) -> Self
4986 where
4987 T: std::iter::IntoIterator<Item = V>,
4988 V: std::convert::Into<crate::model::GoogleApiSource>,
4989 {
4990 use std::iter::Iterator;
4991 self.google_api_sources = v.into_iter().map(|i| i.into()).collect();
4992 self
4993 }
4994
4995 /// Sets the value of [next_page_token][crate::model::ListGoogleApiSourcesResponse::next_page_token].
4996 ///
4997 /// # Example
4998 /// ```ignore,no_run
4999 /// # use google_cloud_eventarc_v1::model::ListGoogleApiSourcesResponse;
5000 /// let x = ListGoogleApiSourcesResponse::new().set_next_page_token("example");
5001 /// ```
5002 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5003 self.next_page_token = v.into();
5004 self
5005 }
5006
5007 /// Sets the value of [unreachable][crate::model::ListGoogleApiSourcesResponse::unreachable].
5008 ///
5009 /// # Example
5010 /// ```ignore,no_run
5011 /// # use google_cloud_eventarc_v1::model::ListGoogleApiSourcesResponse;
5012 /// let x = ListGoogleApiSourcesResponse::new().set_unreachable(["a", "b", "c"]);
5013 /// ```
5014 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5015 where
5016 T: std::iter::IntoIterator<Item = V>,
5017 V: std::convert::Into<std::string::String>,
5018 {
5019 use std::iter::Iterator;
5020 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5021 self
5022 }
5023}
5024
5025impl wkt::message::Message for ListGoogleApiSourcesResponse {
5026 fn typename() -> &'static str {
5027 "type.googleapis.com/google.cloud.eventarc.v1.ListGoogleApiSourcesResponse"
5028 }
5029}
5030
5031#[doc(hidden)]
5032impl google_cloud_gax::paginator::internal::PageableResponse for ListGoogleApiSourcesResponse {
5033 type PageItem = crate::model::GoogleApiSource;
5034
5035 fn items(self) -> std::vec::Vec<Self::PageItem> {
5036 self.google_api_sources
5037 }
5038
5039 fn next_page_token(&self) -> std::string::String {
5040 use std::clone::Clone;
5041 self.next_page_token.clone()
5042 }
5043}
5044
5045/// The request message for the CreateGoogleApiSource method.
5046#[derive(Clone, Default, PartialEq)]
5047#[non_exhaustive]
5048pub struct CreateGoogleApiSourceRequest {
5049 /// Required. The parent collection in which to add this google api source.
5050 pub parent: std::string::String,
5051
5052 /// Required. The google api source to create.
5053 pub google_api_source: std::option::Option<crate::model::GoogleApiSource>,
5054
5055 /// Required. The user-provided ID to be assigned to the GoogleApiSource. It
5056 /// should match the format `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
5057 pub google_api_source_id: std::string::String,
5058
5059 /// Optional. If set, validate the request and preview the review, but do not
5060 /// post it.
5061 pub validate_only: bool,
5062
5063 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5064}
5065
5066impl CreateGoogleApiSourceRequest {
5067 /// Creates a new default instance.
5068 pub fn new() -> Self {
5069 std::default::Default::default()
5070 }
5071
5072 /// Sets the value of [parent][crate::model::CreateGoogleApiSourceRequest::parent].
5073 ///
5074 /// # Example
5075 /// ```ignore,no_run
5076 /// # use google_cloud_eventarc_v1::model::CreateGoogleApiSourceRequest;
5077 /// # let project_id = "project_id";
5078 /// # let location_id = "location_id";
5079 /// let x = CreateGoogleApiSourceRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5080 /// ```
5081 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5082 self.parent = v.into();
5083 self
5084 }
5085
5086 /// Sets the value of [google_api_source][crate::model::CreateGoogleApiSourceRequest::google_api_source].
5087 ///
5088 /// # Example
5089 /// ```ignore,no_run
5090 /// # use google_cloud_eventarc_v1::model::CreateGoogleApiSourceRequest;
5091 /// use google_cloud_eventarc_v1::model::GoogleApiSource;
5092 /// let x = CreateGoogleApiSourceRequest::new().set_google_api_source(GoogleApiSource::default()/* use setters */);
5093 /// ```
5094 pub fn set_google_api_source<T>(mut self, v: T) -> Self
5095 where
5096 T: std::convert::Into<crate::model::GoogleApiSource>,
5097 {
5098 self.google_api_source = std::option::Option::Some(v.into());
5099 self
5100 }
5101
5102 /// Sets or clears the value of [google_api_source][crate::model::CreateGoogleApiSourceRequest::google_api_source].
5103 ///
5104 /// # Example
5105 /// ```ignore,no_run
5106 /// # use google_cloud_eventarc_v1::model::CreateGoogleApiSourceRequest;
5107 /// use google_cloud_eventarc_v1::model::GoogleApiSource;
5108 /// let x = CreateGoogleApiSourceRequest::new().set_or_clear_google_api_source(Some(GoogleApiSource::default()/* use setters */));
5109 /// let x = CreateGoogleApiSourceRequest::new().set_or_clear_google_api_source(None::<GoogleApiSource>);
5110 /// ```
5111 pub fn set_or_clear_google_api_source<T>(mut self, v: std::option::Option<T>) -> Self
5112 where
5113 T: std::convert::Into<crate::model::GoogleApiSource>,
5114 {
5115 self.google_api_source = v.map(|x| x.into());
5116 self
5117 }
5118
5119 /// Sets the value of [google_api_source_id][crate::model::CreateGoogleApiSourceRequest::google_api_source_id].
5120 ///
5121 /// # Example
5122 /// ```ignore,no_run
5123 /// # use google_cloud_eventarc_v1::model::CreateGoogleApiSourceRequest;
5124 /// let x = CreateGoogleApiSourceRequest::new().set_google_api_source_id("example");
5125 /// ```
5126 pub fn set_google_api_source_id<T: std::convert::Into<std::string::String>>(
5127 mut self,
5128 v: T,
5129 ) -> Self {
5130 self.google_api_source_id = v.into();
5131 self
5132 }
5133
5134 /// Sets the value of [validate_only][crate::model::CreateGoogleApiSourceRequest::validate_only].
5135 ///
5136 /// # Example
5137 /// ```ignore,no_run
5138 /// # use google_cloud_eventarc_v1::model::CreateGoogleApiSourceRequest;
5139 /// let x = CreateGoogleApiSourceRequest::new().set_validate_only(true);
5140 /// ```
5141 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5142 self.validate_only = v.into();
5143 self
5144 }
5145}
5146
5147impl wkt::message::Message for CreateGoogleApiSourceRequest {
5148 fn typename() -> &'static str {
5149 "type.googleapis.com/google.cloud.eventarc.v1.CreateGoogleApiSourceRequest"
5150 }
5151}
5152
5153/// The request message for the UpdateGoogleApiSource method.
5154#[derive(Clone, Default, PartialEq)]
5155#[non_exhaustive]
5156pub struct UpdateGoogleApiSourceRequest {
5157 /// Required. The GoogleApiSource to be updated.
5158 pub google_api_source: std::option::Option<crate::model::GoogleApiSource>,
5159
5160 /// Optional. The fields to be updated; only fields explicitly provided are
5161 /// updated. If no field mask is provided, all provided fields in the request
5162 /// are updated. To update all fields, provide a field mask of "*".
5163 pub update_mask: std::option::Option<wkt::FieldMask>,
5164
5165 /// Optional. If set to true, and the GoogleApiSource is not found, a new
5166 /// GoogleApiSource will be created. In this situation, `update_mask` is
5167 /// ignored.
5168 pub allow_missing: bool,
5169
5170 /// Optional. If set, validate the request and preview the review, but do not
5171 /// post it.
5172 pub validate_only: bool,
5173
5174 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5175}
5176
5177impl UpdateGoogleApiSourceRequest {
5178 /// Creates a new default instance.
5179 pub fn new() -> Self {
5180 std::default::Default::default()
5181 }
5182
5183 /// Sets the value of [google_api_source][crate::model::UpdateGoogleApiSourceRequest::google_api_source].
5184 ///
5185 /// # Example
5186 /// ```ignore,no_run
5187 /// # use google_cloud_eventarc_v1::model::UpdateGoogleApiSourceRequest;
5188 /// use google_cloud_eventarc_v1::model::GoogleApiSource;
5189 /// let x = UpdateGoogleApiSourceRequest::new().set_google_api_source(GoogleApiSource::default()/* use setters */);
5190 /// ```
5191 pub fn set_google_api_source<T>(mut self, v: T) -> Self
5192 where
5193 T: std::convert::Into<crate::model::GoogleApiSource>,
5194 {
5195 self.google_api_source = std::option::Option::Some(v.into());
5196 self
5197 }
5198
5199 /// Sets or clears the value of [google_api_source][crate::model::UpdateGoogleApiSourceRequest::google_api_source].
5200 ///
5201 /// # Example
5202 /// ```ignore,no_run
5203 /// # use google_cloud_eventarc_v1::model::UpdateGoogleApiSourceRequest;
5204 /// use google_cloud_eventarc_v1::model::GoogleApiSource;
5205 /// let x = UpdateGoogleApiSourceRequest::new().set_or_clear_google_api_source(Some(GoogleApiSource::default()/* use setters */));
5206 /// let x = UpdateGoogleApiSourceRequest::new().set_or_clear_google_api_source(None::<GoogleApiSource>);
5207 /// ```
5208 pub fn set_or_clear_google_api_source<T>(mut self, v: std::option::Option<T>) -> Self
5209 where
5210 T: std::convert::Into<crate::model::GoogleApiSource>,
5211 {
5212 self.google_api_source = v.map(|x| x.into());
5213 self
5214 }
5215
5216 /// Sets the value of [update_mask][crate::model::UpdateGoogleApiSourceRequest::update_mask].
5217 ///
5218 /// # Example
5219 /// ```ignore,no_run
5220 /// # use google_cloud_eventarc_v1::model::UpdateGoogleApiSourceRequest;
5221 /// use wkt::FieldMask;
5222 /// let x = UpdateGoogleApiSourceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5223 /// ```
5224 pub fn set_update_mask<T>(mut self, v: T) -> Self
5225 where
5226 T: std::convert::Into<wkt::FieldMask>,
5227 {
5228 self.update_mask = std::option::Option::Some(v.into());
5229 self
5230 }
5231
5232 /// Sets or clears the value of [update_mask][crate::model::UpdateGoogleApiSourceRequest::update_mask].
5233 ///
5234 /// # Example
5235 /// ```ignore,no_run
5236 /// # use google_cloud_eventarc_v1::model::UpdateGoogleApiSourceRequest;
5237 /// use wkt::FieldMask;
5238 /// let x = UpdateGoogleApiSourceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5239 /// let x = UpdateGoogleApiSourceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5240 /// ```
5241 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5242 where
5243 T: std::convert::Into<wkt::FieldMask>,
5244 {
5245 self.update_mask = v.map(|x| x.into());
5246 self
5247 }
5248
5249 /// Sets the value of [allow_missing][crate::model::UpdateGoogleApiSourceRequest::allow_missing].
5250 ///
5251 /// # Example
5252 /// ```ignore,no_run
5253 /// # use google_cloud_eventarc_v1::model::UpdateGoogleApiSourceRequest;
5254 /// let x = UpdateGoogleApiSourceRequest::new().set_allow_missing(true);
5255 /// ```
5256 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5257 self.allow_missing = v.into();
5258 self
5259 }
5260
5261 /// Sets the value of [validate_only][crate::model::UpdateGoogleApiSourceRequest::validate_only].
5262 ///
5263 /// # Example
5264 /// ```ignore,no_run
5265 /// # use google_cloud_eventarc_v1::model::UpdateGoogleApiSourceRequest;
5266 /// let x = UpdateGoogleApiSourceRequest::new().set_validate_only(true);
5267 /// ```
5268 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5269 self.validate_only = v.into();
5270 self
5271 }
5272}
5273
5274impl wkt::message::Message for UpdateGoogleApiSourceRequest {
5275 fn typename() -> &'static str {
5276 "type.googleapis.com/google.cloud.eventarc.v1.UpdateGoogleApiSourceRequest"
5277 }
5278}
5279
5280/// The request message for the DeleteGoogleApiSource method.
5281#[derive(Clone, Default, PartialEq)]
5282#[non_exhaustive]
5283pub struct DeleteGoogleApiSourceRequest {
5284 /// Required. The name of the GoogleApiSource to be deleted.
5285 pub name: std::string::String,
5286
5287 /// Optional. If provided, the MessageBus will only be deleted if the etag
5288 /// matches the current etag on the resource.
5289 pub etag: std::string::String,
5290
5291 /// Optional. If set to true, and the MessageBus is not found, the request will
5292 /// succeed but no action will be taken on the server.
5293 pub allow_missing: bool,
5294
5295 /// Optional. If set, validate the request and preview the review, but do not
5296 /// post it.
5297 pub validate_only: bool,
5298
5299 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5300}
5301
5302impl DeleteGoogleApiSourceRequest {
5303 /// Creates a new default instance.
5304 pub fn new() -> Self {
5305 std::default::Default::default()
5306 }
5307
5308 /// Sets the value of [name][crate::model::DeleteGoogleApiSourceRequest::name].
5309 ///
5310 /// # Example
5311 /// ```ignore,no_run
5312 /// # use google_cloud_eventarc_v1::model::DeleteGoogleApiSourceRequest;
5313 /// # let project_id = "project_id";
5314 /// # let location_id = "location_id";
5315 /// # let google_api_source_id = "google_api_source_id";
5316 /// let x = DeleteGoogleApiSourceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/googleApiSources/{google_api_source_id}"));
5317 /// ```
5318 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5319 self.name = v.into();
5320 self
5321 }
5322
5323 /// Sets the value of [etag][crate::model::DeleteGoogleApiSourceRequest::etag].
5324 ///
5325 /// # Example
5326 /// ```ignore,no_run
5327 /// # use google_cloud_eventarc_v1::model::DeleteGoogleApiSourceRequest;
5328 /// let x = DeleteGoogleApiSourceRequest::new().set_etag("example");
5329 /// ```
5330 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5331 self.etag = v.into();
5332 self
5333 }
5334
5335 /// Sets the value of [allow_missing][crate::model::DeleteGoogleApiSourceRequest::allow_missing].
5336 ///
5337 /// # Example
5338 /// ```ignore,no_run
5339 /// # use google_cloud_eventarc_v1::model::DeleteGoogleApiSourceRequest;
5340 /// let x = DeleteGoogleApiSourceRequest::new().set_allow_missing(true);
5341 /// ```
5342 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5343 self.allow_missing = v.into();
5344 self
5345 }
5346
5347 /// Sets the value of [validate_only][crate::model::DeleteGoogleApiSourceRequest::validate_only].
5348 ///
5349 /// # Example
5350 /// ```ignore,no_run
5351 /// # use google_cloud_eventarc_v1::model::DeleteGoogleApiSourceRequest;
5352 /// let x = DeleteGoogleApiSourceRequest::new().set_validate_only(true);
5353 /// ```
5354 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5355 self.validate_only = v.into();
5356 self
5357 }
5358}
5359
5360impl wkt::message::Message for DeleteGoogleApiSourceRequest {
5361 fn typename() -> &'static str {
5362 "type.googleapis.com/google.cloud.eventarc.v1.DeleteGoogleApiSourceRequest"
5363 }
5364}
5365
5366/// Represents the metadata of the long-running operation.
5367#[derive(Clone, Default, PartialEq)]
5368#[non_exhaustive]
5369pub struct OperationMetadata {
5370 /// Output only. The time the operation was created.
5371 pub create_time: std::option::Option<wkt::Timestamp>,
5372
5373 /// Output only. The time the operation finished running.
5374 pub end_time: std::option::Option<wkt::Timestamp>,
5375
5376 /// Output only. Server-defined resource path for the target of the operation.
5377 pub target: std::string::String,
5378
5379 /// Output only. Name of the verb executed by the operation.
5380 pub verb: std::string::String,
5381
5382 /// Output only. Human-readable status of the operation, if any.
5383 pub status_message: std::string::String,
5384
5385 /// Output only. Identifies whether the user has requested cancellation
5386 /// of the operation. Operations that have successfully been cancelled
5387 /// have [Operation.error][] value with a
5388 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
5389 /// `Code.CANCELLED`.
5390 pub requested_cancellation: bool,
5391
5392 /// Output only. API version used to start the operation.
5393 pub api_version: std::string::String,
5394
5395 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5396}
5397
5398impl OperationMetadata {
5399 /// Creates a new default instance.
5400 pub fn new() -> Self {
5401 std::default::Default::default()
5402 }
5403
5404 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
5405 ///
5406 /// # Example
5407 /// ```ignore,no_run
5408 /// # use google_cloud_eventarc_v1::model::OperationMetadata;
5409 /// use wkt::Timestamp;
5410 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
5411 /// ```
5412 pub fn set_create_time<T>(mut self, v: T) -> Self
5413 where
5414 T: std::convert::Into<wkt::Timestamp>,
5415 {
5416 self.create_time = std::option::Option::Some(v.into());
5417 self
5418 }
5419
5420 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
5421 ///
5422 /// # Example
5423 /// ```ignore,no_run
5424 /// # use google_cloud_eventarc_v1::model::OperationMetadata;
5425 /// use wkt::Timestamp;
5426 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5427 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
5428 /// ```
5429 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5430 where
5431 T: std::convert::Into<wkt::Timestamp>,
5432 {
5433 self.create_time = v.map(|x| x.into());
5434 self
5435 }
5436
5437 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
5438 ///
5439 /// # Example
5440 /// ```ignore,no_run
5441 /// # use google_cloud_eventarc_v1::model::OperationMetadata;
5442 /// use wkt::Timestamp;
5443 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
5444 /// ```
5445 pub fn set_end_time<T>(mut self, v: T) -> Self
5446 where
5447 T: std::convert::Into<wkt::Timestamp>,
5448 {
5449 self.end_time = std::option::Option::Some(v.into());
5450 self
5451 }
5452
5453 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
5454 ///
5455 /// # Example
5456 /// ```ignore,no_run
5457 /// # use google_cloud_eventarc_v1::model::OperationMetadata;
5458 /// use wkt::Timestamp;
5459 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
5460 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
5461 /// ```
5462 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5463 where
5464 T: std::convert::Into<wkt::Timestamp>,
5465 {
5466 self.end_time = v.map(|x| x.into());
5467 self
5468 }
5469
5470 /// Sets the value of [target][crate::model::OperationMetadata::target].
5471 ///
5472 /// # Example
5473 /// ```ignore,no_run
5474 /// # use google_cloud_eventarc_v1::model::OperationMetadata;
5475 /// let x = OperationMetadata::new().set_target("example");
5476 /// ```
5477 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5478 self.target = v.into();
5479 self
5480 }
5481
5482 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
5483 ///
5484 /// # Example
5485 /// ```ignore,no_run
5486 /// # use google_cloud_eventarc_v1::model::OperationMetadata;
5487 /// let x = OperationMetadata::new().set_verb("example");
5488 /// ```
5489 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5490 self.verb = v.into();
5491 self
5492 }
5493
5494 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
5495 ///
5496 /// # Example
5497 /// ```ignore,no_run
5498 /// # use google_cloud_eventarc_v1::model::OperationMetadata;
5499 /// let x = OperationMetadata::new().set_status_message("example");
5500 /// ```
5501 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5502 self.status_message = v.into();
5503 self
5504 }
5505
5506 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
5507 ///
5508 /// # Example
5509 /// ```ignore,no_run
5510 /// # use google_cloud_eventarc_v1::model::OperationMetadata;
5511 /// let x = OperationMetadata::new().set_requested_cancellation(true);
5512 /// ```
5513 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5514 self.requested_cancellation = v.into();
5515 self
5516 }
5517
5518 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
5519 ///
5520 /// # Example
5521 /// ```ignore,no_run
5522 /// # use google_cloud_eventarc_v1::model::OperationMetadata;
5523 /// let x = OperationMetadata::new().set_api_version("example");
5524 /// ```
5525 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5526 self.api_version = v.into();
5527 self
5528 }
5529}
5530
5531impl wkt::message::Message for OperationMetadata {
5532 fn typename() -> &'static str {
5533 "type.googleapis.com/google.cloud.eventarc.v1.OperationMetadata"
5534 }
5535}
5536
5537/// A GoogleApiSource represents a subscription of 1P events from a MessageBus.
5538#[derive(Clone, Default, PartialEq)]
5539#[non_exhaustive]
5540pub struct GoogleApiSource {
5541 /// Identifier. Resource name of the form
5542 /// projects/{project}/locations/{location}/googleApiSources/{google_api_source}
5543 pub name: std::string::String,
5544
5545 /// Output only. Server assigned unique identifier for the channel. The value
5546 /// is a UUID4 string and guaranteed to remain unchanged until the resource is
5547 /// deleted.
5548 pub uid: std::string::String,
5549
5550 /// Output only. This checksum is computed by the server based on the value of
5551 /// other fields, and might be sent only on update and delete requests to
5552 /// ensure that the client has an up-to-date value before proceeding.
5553 pub etag: std::string::String,
5554
5555 /// Output only. The creation time.
5556 pub create_time: std::option::Option<wkt::Timestamp>,
5557
5558 /// Output only. The last-modified time.
5559 pub update_time: std::option::Option<wkt::Timestamp>,
5560
5561 /// Optional. Resource labels.
5562 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5563
5564 /// Optional. Resource annotations.
5565 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5566
5567 /// Optional. Resource display name.
5568 pub display_name: std::string::String,
5569
5570 /// Required. Destination is the message bus that the GoogleApiSource is
5571 /// delivering to. It must be point to the full resource name of a MessageBus.
5572 /// Format:
5573 /// "projects/{PROJECT_ID}/locations/{region}/messagesBuses/{MESSAGE_BUS_ID)
5574 pub destination: std::string::String,
5575
5576 /// Optional. Resource name of a KMS crypto key (managed by the user) used to
5577 /// encrypt/decrypt their event data.
5578 ///
5579 /// It must match the pattern
5580 /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
5581 pub crypto_key_name: std::string::String,
5582
5583 /// Optional. Config to control Platform logging for the GoogleApiSource.
5584 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
5585
5586 /// Config to enabled subscribing to events from other projects in the org.
5587 ///
5588 /// Users need the eventarc.googleApiSource.create permission on the entire org
5589 /// in order to create a resource with these settings.
5590 pub wide_scope_subscription:
5591 std::option::Option<crate::model::google_api_source::WideScopeSubscription>,
5592
5593 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5594}
5595
5596impl GoogleApiSource {
5597 /// Creates a new default instance.
5598 pub fn new() -> Self {
5599 std::default::Default::default()
5600 }
5601
5602 /// Sets the value of [name][crate::model::GoogleApiSource::name].
5603 ///
5604 /// # Example
5605 /// ```ignore,no_run
5606 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5607 /// # let project_id = "project_id";
5608 /// # let location_id = "location_id";
5609 /// # let google_api_source_id = "google_api_source_id";
5610 /// let x = GoogleApiSource::new().set_name(format!("projects/{project_id}/locations/{location_id}/googleApiSources/{google_api_source_id}"));
5611 /// ```
5612 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5613 self.name = v.into();
5614 self
5615 }
5616
5617 /// Sets the value of [uid][crate::model::GoogleApiSource::uid].
5618 ///
5619 /// # Example
5620 /// ```ignore,no_run
5621 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5622 /// let x = GoogleApiSource::new().set_uid("example");
5623 /// ```
5624 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5625 self.uid = v.into();
5626 self
5627 }
5628
5629 /// Sets the value of [etag][crate::model::GoogleApiSource::etag].
5630 ///
5631 /// # Example
5632 /// ```ignore,no_run
5633 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5634 /// let x = GoogleApiSource::new().set_etag("example");
5635 /// ```
5636 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5637 self.etag = v.into();
5638 self
5639 }
5640
5641 /// Sets the value of [create_time][crate::model::GoogleApiSource::create_time].
5642 ///
5643 /// # Example
5644 /// ```ignore,no_run
5645 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5646 /// use wkt::Timestamp;
5647 /// let x = GoogleApiSource::new().set_create_time(Timestamp::default()/* use setters */);
5648 /// ```
5649 pub fn set_create_time<T>(mut self, v: T) -> Self
5650 where
5651 T: std::convert::Into<wkt::Timestamp>,
5652 {
5653 self.create_time = std::option::Option::Some(v.into());
5654 self
5655 }
5656
5657 /// Sets or clears the value of [create_time][crate::model::GoogleApiSource::create_time].
5658 ///
5659 /// # Example
5660 /// ```ignore,no_run
5661 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5662 /// use wkt::Timestamp;
5663 /// let x = GoogleApiSource::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5664 /// let x = GoogleApiSource::new().set_or_clear_create_time(None::<Timestamp>);
5665 /// ```
5666 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5667 where
5668 T: std::convert::Into<wkt::Timestamp>,
5669 {
5670 self.create_time = v.map(|x| x.into());
5671 self
5672 }
5673
5674 /// Sets the value of [update_time][crate::model::GoogleApiSource::update_time].
5675 ///
5676 /// # Example
5677 /// ```ignore,no_run
5678 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5679 /// use wkt::Timestamp;
5680 /// let x = GoogleApiSource::new().set_update_time(Timestamp::default()/* use setters */);
5681 /// ```
5682 pub fn set_update_time<T>(mut self, v: T) -> Self
5683 where
5684 T: std::convert::Into<wkt::Timestamp>,
5685 {
5686 self.update_time = std::option::Option::Some(v.into());
5687 self
5688 }
5689
5690 /// Sets or clears the value of [update_time][crate::model::GoogleApiSource::update_time].
5691 ///
5692 /// # Example
5693 /// ```ignore,no_run
5694 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5695 /// use wkt::Timestamp;
5696 /// let x = GoogleApiSource::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5697 /// let x = GoogleApiSource::new().set_or_clear_update_time(None::<Timestamp>);
5698 /// ```
5699 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5700 where
5701 T: std::convert::Into<wkt::Timestamp>,
5702 {
5703 self.update_time = v.map(|x| x.into());
5704 self
5705 }
5706
5707 /// Sets the value of [labels][crate::model::GoogleApiSource::labels].
5708 ///
5709 /// # Example
5710 /// ```ignore,no_run
5711 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5712 /// let x = GoogleApiSource::new().set_labels([
5713 /// ("key0", "abc"),
5714 /// ("key1", "xyz"),
5715 /// ]);
5716 /// ```
5717 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5718 where
5719 T: std::iter::IntoIterator<Item = (K, V)>,
5720 K: std::convert::Into<std::string::String>,
5721 V: std::convert::Into<std::string::String>,
5722 {
5723 use std::iter::Iterator;
5724 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5725 self
5726 }
5727
5728 /// Sets the value of [annotations][crate::model::GoogleApiSource::annotations].
5729 ///
5730 /// # Example
5731 /// ```ignore,no_run
5732 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5733 /// let x = GoogleApiSource::new().set_annotations([
5734 /// ("key0", "abc"),
5735 /// ("key1", "xyz"),
5736 /// ]);
5737 /// ```
5738 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
5739 where
5740 T: std::iter::IntoIterator<Item = (K, V)>,
5741 K: std::convert::Into<std::string::String>,
5742 V: std::convert::Into<std::string::String>,
5743 {
5744 use std::iter::Iterator;
5745 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5746 self
5747 }
5748
5749 /// Sets the value of [display_name][crate::model::GoogleApiSource::display_name].
5750 ///
5751 /// # Example
5752 /// ```ignore,no_run
5753 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5754 /// let x = GoogleApiSource::new().set_display_name("example");
5755 /// ```
5756 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5757 self.display_name = v.into();
5758 self
5759 }
5760
5761 /// Sets the value of [destination][crate::model::GoogleApiSource::destination].
5762 ///
5763 /// # Example
5764 /// ```ignore,no_run
5765 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5766 /// # let project_id = "project_id";
5767 /// # let location_id = "location_id";
5768 /// # let message_bus_id = "message_bus_id";
5769 /// let x = GoogleApiSource::new().set_destination(format!("projects/{project_id}/locations/{location_id}/messageBuses/{message_bus_id}"));
5770 /// ```
5771 pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5772 self.destination = v.into();
5773 self
5774 }
5775
5776 /// Sets the value of [crypto_key_name][crate::model::GoogleApiSource::crypto_key_name].
5777 ///
5778 /// # Example
5779 /// ```ignore,no_run
5780 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5781 /// let x = GoogleApiSource::new().set_crypto_key_name("example");
5782 /// ```
5783 pub fn set_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5784 self.crypto_key_name = v.into();
5785 self
5786 }
5787
5788 /// Sets the value of [logging_config][crate::model::GoogleApiSource::logging_config].
5789 ///
5790 /// # Example
5791 /// ```ignore,no_run
5792 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5793 /// use google_cloud_eventarc_v1::model::LoggingConfig;
5794 /// let x = GoogleApiSource::new().set_logging_config(LoggingConfig::default()/* use setters */);
5795 /// ```
5796 pub fn set_logging_config<T>(mut self, v: T) -> Self
5797 where
5798 T: std::convert::Into<crate::model::LoggingConfig>,
5799 {
5800 self.logging_config = std::option::Option::Some(v.into());
5801 self
5802 }
5803
5804 /// Sets or clears the value of [logging_config][crate::model::GoogleApiSource::logging_config].
5805 ///
5806 /// # Example
5807 /// ```ignore,no_run
5808 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5809 /// use google_cloud_eventarc_v1::model::LoggingConfig;
5810 /// let x = GoogleApiSource::new().set_or_clear_logging_config(Some(LoggingConfig::default()/* use setters */));
5811 /// let x = GoogleApiSource::new().set_or_clear_logging_config(None::<LoggingConfig>);
5812 /// ```
5813 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
5814 where
5815 T: std::convert::Into<crate::model::LoggingConfig>,
5816 {
5817 self.logging_config = v.map(|x| x.into());
5818 self
5819 }
5820
5821 /// Sets the value of [wide_scope_subscription][crate::model::GoogleApiSource::wide_scope_subscription].
5822 ///
5823 /// Note that all the setters affecting `wide_scope_subscription` are mutually
5824 /// exclusive.
5825 ///
5826 /// # Example
5827 /// ```ignore,no_run
5828 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5829 /// use google_cloud_eventarc_v1::model::google_api_source::OrganizationSubscription;
5830 /// let x = GoogleApiSource::new().set_wide_scope_subscription(Some(
5831 /// google_cloud_eventarc_v1::model::google_api_source::WideScopeSubscription::OrganizationSubscription(OrganizationSubscription::default().into())));
5832 /// ```
5833 pub fn set_wide_scope_subscription<
5834 T: std::convert::Into<
5835 std::option::Option<crate::model::google_api_source::WideScopeSubscription>,
5836 >,
5837 >(
5838 mut self,
5839 v: T,
5840 ) -> Self {
5841 self.wide_scope_subscription = v.into();
5842 self
5843 }
5844
5845 /// The value of [wide_scope_subscription][crate::model::GoogleApiSource::wide_scope_subscription]
5846 /// if it holds a `OrganizationSubscription`, `None` if the field is not set or
5847 /// holds a different branch.
5848 pub fn organization_subscription(
5849 &self,
5850 ) -> std::option::Option<
5851 &std::boxed::Box<crate::model::google_api_source::OrganizationSubscription>,
5852 > {
5853 #[allow(unreachable_patterns)]
5854 self.wide_scope_subscription.as_ref().and_then(|v| match v {
5855 crate::model::google_api_source::WideScopeSubscription::OrganizationSubscription(v) => {
5856 std::option::Option::Some(v)
5857 }
5858 _ => std::option::Option::None,
5859 })
5860 }
5861
5862 /// Sets the value of [wide_scope_subscription][crate::model::GoogleApiSource::wide_scope_subscription]
5863 /// to hold a `OrganizationSubscription`.
5864 ///
5865 /// Note that all the setters affecting `wide_scope_subscription` are
5866 /// mutually exclusive.
5867 ///
5868 /// # Example
5869 /// ```ignore,no_run
5870 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5871 /// use google_cloud_eventarc_v1::model::google_api_source::OrganizationSubscription;
5872 /// let x = GoogleApiSource::new().set_organization_subscription(OrganizationSubscription::default()/* use setters */);
5873 /// assert!(x.organization_subscription().is_some());
5874 /// assert!(x.project_subscriptions().is_none());
5875 /// ```
5876 pub fn set_organization_subscription<
5877 T: std::convert::Into<
5878 std::boxed::Box<crate::model::google_api_source::OrganizationSubscription>,
5879 >,
5880 >(
5881 mut self,
5882 v: T,
5883 ) -> Self {
5884 self.wide_scope_subscription = std::option::Option::Some(
5885 crate::model::google_api_source::WideScopeSubscription::OrganizationSubscription(
5886 v.into(),
5887 ),
5888 );
5889 self
5890 }
5891
5892 /// The value of [wide_scope_subscription][crate::model::GoogleApiSource::wide_scope_subscription]
5893 /// if it holds a `ProjectSubscriptions`, `None` if the field is not set or
5894 /// holds a different branch.
5895 pub fn project_subscriptions(
5896 &self,
5897 ) -> std::option::Option<&std::boxed::Box<crate::model::google_api_source::ProjectSubscriptions>>
5898 {
5899 #[allow(unreachable_patterns)]
5900 self.wide_scope_subscription.as_ref().and_then(|v| match v {
5901 crate::model::google_api_source::WideScopeSubscription::ProjectSubscriptions(v) => {
5902 std::option::Option::Some(v)
5903 }
5904 _ => std::option::Option::None,
5905 })
5906 }
5907
5908 /// Sets the value of [wide_scope_subscription][crate::model::GoogleApiSource::wide_scope_subscription]
5909 /// to hold a `ProjectSubscriptions`.
5910 ///
5911 /// Note that all the setters affecting `wide_scope_subscription` are
5912 /// mutually exclusive.
5913 ///
5914 /// # Example
5915 /// ```ignore,no_run
5916 /// # use google_cloud_eventarc_v1::model::GoogleApiSource;
5917 /// use google_cloud_eventarc_v1::model::google_api_source::ProjectSubscriptions;
5918 /// let x = GoogleApiSource::new().set_project_subscriptions(ProjectSubscriptions::default()/* use setters */);
5919 /// assert!(x.project_subscriptions().is_some());
5920 /// assert!(x.organization_subscription().is_none());
5921 /// ```
5922 pub fn set_project_subscriptions<
5923 T: std::convert::Into<std::boxed::Box<crate::model::google_api_source::ProjectSubscriptions>>,
5924 >(
5925 mut self,
5926 v: T,
5927 ) -> Self {
5928 self.wide_scope_subscription = std::option::Option::Some(
5929 crate::model::google_api_source::WideScopeSubscription::ProjectSubscriptions(v.into()),
5930 );
5931 self
5932 }
5933}
5934
5935impl wkt::message::Message for GoogleApiSource {
5936 fn typename() -> &'static str {
5937 "type.googleapis.com/google.cloud.eventarc.v1.GoogleApiSource"
5938 }
5939}
5940
5941/// Defines additional types related to [GoogleApiSource].
5942pub mod google_api_source {
5943 #[allow(unused_imports)]
5944 use super::*;
5945
5946 /// Config to enable subscribing to all events from a list of projects.
5947 #[derive(Clone, Default, PartialEq)]
5948 #[non_exhaustive]
5949 pub struct ProjectSubscriptions {
5950 /// Required. A list of projects to receive events from.
5951 ///
5952 /// All the projects must be in the same org. The listed projects should have
5953 /// the format project/{identifier} where identifier can be either the
5954 /// project id for project number. A single list may contain both formats. At
5955 /// most 100 projects can be listed.
5956 pub list: std::vec::Vec<std::string::String>,
5957
5958 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5959 }
5960
5961 impl ProjectSubscriptions {
5962 /// Creates a new default instance.
5963 pub fn new() -> Self {
5964 std::default::Default::default()
5965 }
5966
5967 /// Sets the value of [list][crate::model::google_api_source::ProjectSubscriptions::list].
5968 ///
5969 /// # Example
5970 /// ```ignore,no_run
5971 /// # use google_cloud_eventarc_v1::model::google_api_source::ProjectSubscriptions;
5972 /// let x = ProjectSubscriptions::new().set_list(["a", "b", "c"]);
5973 /// ```
5974 pub fn set_list<T, V>(mut self, v: T) -> Self
5975 where
5976 T: std::iter::IntoIterator<Item = V>,
5977 V: std::convert::Into<std::string::String>,
5978 {
5979 use std::iter::Iterator;
5980 self.list = v.into_iter().map(|i| i.into()).collect();
5981 self
5982 }
5983 }
5984
5985 impl wkt::message::Message for ProjectSubscriptions {
5986 fn typename() -> &'static str {
5987 "type.googleapis.com/google.cloud.eventarc.v1.GoogleApiSource.ProjectSubscriptions"
5988 }
5989 }
5990
5991 /// Config to enabled subscribing to events from other projects in the org.
5992 #[derive(Clone, Default, PartialEq)]
5993 #[non_exhaustive]
5994 pub struct OrganizationSubscription {
5995 /// Required. Enable org level subscription.
5996 pub enabled: bool,
5997
5998 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5999 }
6000
6001 impl OrganizationSubscription {
6002 /// Creates a new default instance.
6003 pub fn new() -> Self {
6004 std::default::Default::default()
6005 }
6006
6007 /// Sets the value of [enabled][crate::model::google_api_source::OrganizationSubscription::enabled].
6008 ///
6009 /// # Example
6010 /// ```ignore,no_run
6011 /// # use google_cloud_eventarc_v1::model::google_api_source::OrganizationSubscription;
6012 /// let x = OrganizationSubscription::new().set_enabled(true);
6013 /// ```
6014 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6015 self.enabled = v.into();
6016 self
6017 }
6018 }
6019
6020 impl wkt::message::Message for OrganizationSubscription {
6021 fn typename() -> &'static str {
6022 "type.googleapis.com/google.cloud.eventarc.v1.GoogleApiSource.OrganizationSubscription"
6023 }
6024 }
6025
6026 /// Config to enabled subscribing to events from other projects in the org.
6027 ///
6028 /// Users need the eventarc.googleApiSource.create permission on the entire org
6029 /// in order to create a resource with these settings.
6030 #[derive(Clone, Debug, PartialEq)]
6031 #[non_exhaustive]
6032 pub enum WideScopeSubscription {
6033 /// Optional. Config to enable subscribing to events from all projects in the
6034 /// GoogleApiSource's org.
6035 OrganizationSubscription(
6036 std::boxed::Box<crate::model::google_api_source::OrganizationSubscription>,
6037 ),
6038 /// Optional. Config to enable subscribing to all events from a list of
6039 /// projects.
6040 ///
6041 /// All the projects must be in the same org as the GoogleApiSource.
6042 ProjectSubscriptions(
6043 std::boxed::Box<crate::model::google_api_source::ProjectSubscriptions>,
6044 ),
6045 }
6046}
6047
6048/// A GoogleChannelConfig is a resource that stores the custom settings
6049/// respected by Eventarc first-party triggers in the matching region.
6050/// Once configured, first-party event data will be protected
6051/// using the specified custom managed encryption key instead of Google-managed
6052/// encryption keys.
6053#[derive(Clone, Default, PartialEq)]
6054#[non_exhaustive]
6055pub struct GoogleChannelConfig {
6056 /// Required. The resource name of the config. Must be in the format of,
6057 /// `projects/{project}/locations/{location}/googleChannelConfig`.
6058 /// In API responses, the config name always includes the projectID, regardless
6059 /// of whether the projectID or projectNumber was provided.
6060 pub name: std::string::String,
6061
6062 /// Output only. The last-modified time.
6063 pub update_time: std::option::Option<wkt::Timestamp>,
6064
6065 /// Optional. Resource name of a KMS crypto key (managed by the user) used to
6066 /// encrypt/decrypt their event data.
6067 ///
6068 /// It must match the pattern
6069 /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
6070 pub crypto_key_name: std::string::String,
6071
6072 /// Optional. Resource labels.
6073 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6074
6075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6076}
6077
6078impl GoogleChannelConfig {
6079 /// Creates a new default instance.
6080 pub fn new() -> Self {
6081 std::default::Default::default()
6082 }
6083
6084 /// Sets the value of [name][crate::model::GoogleChannelConfig::name].
6085 ///
6086 /// # Example
6087 /// ```ignore,no_run
6088 /// # use google_cloud_eventarc_v1::model::GoogleChannelConfig;
6089 /// # let project_id = "project_id";
6090 /// # let location_id = "location_id";
6091 /// let x = GoogleChannelConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/googleChannelConfig"));
6092 /// ```
6093 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6094 self.name = v.into();
6095 self
6096 }
6097
6098 /// Sets the value of [update_time][crate::model::GoogleChannelConfig::update_time].
6099 ///
6100 /// # Example
6101 /// ```ignore,no_run
6102 /// # use google_cloud_eventarc_v1::model::GoogleChannelConfig;
6103 /// use wkt::Timestamp;
6104 /// let x = GoogleChannelConfig::new().set_update_time(Timestamp::default()/* use setters */);
6105 /// ```
6106 pub fn set_update_time<T>(mut self, v: T) -> Self
6107 where
6108 T: std::convert::Into<wkt::Timestamp>,
6109 {
6110 self.update_time = std::option::Option::Some(v.into());
6111 self
6112 }
6113
6114 /// Sets or clears the value of [update_time][crate::model::GoogleChannelConfig::update_time].
6115 ///
6116 /// # Example
6117 /// ```ignore,no_run
6118 /// # use google_cloud_eventarc_v1::model::GoogleChannelConfig;
6119 /// use wkt::Timestamp;
6120 /// let x = GoogleChannelConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6121 /// let x = GoogleChannelConfig::new().set_or_clear_update_time(None::<Timestamp>);
6122 /// ```
6123 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6124 where
6125 T: std::convert::Into<wkt::Timestamp>,
6126 {
6127 self.update_time = v.map(|x| x.into());
6128 self
6129 }
6130
6131 /// Sets the value of [crypto_key_name][crate::model::GoogleChannelConfig::crypto_key_name].
6132 ///
6133 /// # Example
6134 /// ```ignore,no_run
6135 /// # use google_cloud_eventarc_v1::model::GoogleChannelConfig;
6136 /// let x = GoogleChannelConfig::new().set_crypto_key_name("example");
6137 /// ```
6138 pub fn set_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6139 self.crypto_key_name = v.into();
6140 self
6141 }
6142
6143 /// Sets the value of [labels][crate::model::GoogleChannelConfig::labels].
6144 ///
6145 /// # Example
6146 /// ```ignore,no_run
6147 /// # use google_cloud_eventarc_v1::model::GoogleChannelConfig;
6148 /// let x = GoogleChannelConfig::new().set_labels([
6149 /// ("key0", "abc"),
6150 /// ("key1", "xyz"),
6151 /// ]);
6152 /// ```
6153 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6154 where
6155 T: std::iter::IntoIterator<Item = (K, V)>,
6156 K: std::convert::Into<std::string::String>,
6157 V: std::convert::Into<std::string::String>,
6158 {
6159 use std::iter::Iterator;
6160 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6161 self
6162 }
6163}
6164
6165impl wkt::message::Message for GoogleChannelConfig {
6166 fn typename() -> &'static str {
6167 "type.googleapis.com/google.cloud.eventarc.v1.GoogleChannelConfig"
6168 }
6169}
6170
6171/// The configuration for Platform Telemetry logging for Eventarc Advanced
6172/// resources.
6173#[derive(Clone, Default, PartialEq)]
6174#[non_exhaustive]
6175pub struct LoggingConfig {
6176 /// Optional. The minimum severity of logs that will be sent to
6177 /// Stackdriver/Platform Telemetry. Logs at severitiy ≥ this value will be
6178 /// sent, unless it is NONE.
6179 pub log_severity: crate::model::logging_config::LogSeverity,
6180
6181 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6182}
6183
6184impl LoggingConfig {
6185 /// Creates a new default instance.
6186 pub fn new() -> Self {
6187 std::default::Default::default()
6188 }
6189
6190 /// Sets the value of [log_severity][crate::model::LoggingConfig::log_severity].
6191 ///
6192 /// # Example
6193 /// ```ignore,no_run
6194 /// # use google_cloud_eventarc_v1::model::LoggingConfig;
6195 /// use google_cloud_eventarc_v1::model::logging_config::LogSeverity;
6196 /// let x0 = LoggingConfig::new().set_log_severity(LogSeverity::None);
6197 /// let x1 = LoggingConfig::new().set_log_severity(LogSeverity::Debug);
6198 /// let x2 = LoggingConfig::new().set_log_severity(LogSeverity::Info);
6199 /// ```
6200 pub fn set_log_severity<T: std::convert::Into<crate::model::logging_config::LogSeverity>>(
6201 mut self,
6202 v: T,
6203 ) -> Self {
6204 self.log_severity = v.into();
6205 self
6206 }
6207}
6208
6209impl wkt::message::Message for LoggingConfig {
6210 fn typename() -> &'static str {
6211 "type.googleapis.com/google.cloud.eventarc.v1.LoggingConfig"
6212 }
6213}
6214
6215/// Defines additional types related to [LoggingConfig].
6216pub mod logging_config {
6217 #[allow(unused_imports)]
6218 use super::*;
6219
6220 /// The different severities for logging supported by Eventarc Advanced
6221 /// resources.
6222 /// This enum is an exhaustive list of log severities and is FROZEN. Do not
6223 /// expect new values to be added.
6224 ///
6225 /// # Working with unknown values
6226 ///
6227 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6228 /// additional enum variants at any time. Adding new variants is not considered
6229 /// a breaking change. Applications should write their code in anticipation of:
6230 ///
6231 /// - New values appearing in future releases of the client library, **and**
6232 /// - New values received dynamically, without application changes.
6233 ///
6234 /// Please consult the [Working with enums] section in the user guide for some
6235 /// guidelines.
6236 ///
6237 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6238 #[derive(Clone, Debug, PartialEq)]
6239 #[non_exhaustive]
6240 pub enum LogSeverity {
6241 /// Log severity is not specified. This value is treated the same as NONE,
6242 /// but is used to distinguish between no update and update to NONE in
6243 /// update_masks.
6244 Unspecified,
6245 /// Default value at resource creation, presence of this value must be
6246 /// treated as no logging/disable logging.
6247 None,
6248 /// Debug or trace level logging.
6249 Debug,
6250 /// Routine information, such as ongoing status or performance.
6251 Info,
6252 /// Normal but significant events, such as start up, shut down, or a
6253 /// configuration change.
6254 Notice,
6255 /// Warning events might cause problems.
6256 Warning,
6257 /// Error events are likely to cause problems.
6258 Error,
6259 /// Critical events cause more severe problems or outages.
6260 Critical,
6261 /// A person must take action immediately.
6262 Alert,
6263 /// One or more systems are unusable.
6264 Emergency,
6265 /// If set, the enum was initialized with an unknown value.
6266 ///
6267 /// Applications can examine the value using [LogSeverity::value] or
6268 /// [LogSeverity::name].
6269 UnknownValue(log_severity::UnknownValue),
6270 }
6271
6272 #[doc(hidden)]
6273 pub mod log_severity {
6274 #[allow(unused_imports)]
6275 use super::*;
6276 #[derive(Clone, Debug, PartialEq)]
6277 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6278 }
6279
6280 impl LogSeverity {
6281 /// Gets the enum value.
6282 ///
6283 /// Returns `None` if the enum contains an unknown value deserialized from
6284 /// the string representation of enums.
6285 pub fn value(&self) -> std::option::Option<i32> {
6286 match self {
6287 Self::Unspecified => std::option::Option::Some(0),
6288 Self::None => std::option::Option::Some(1),
6289 Self::Debug => std::option::Option::Some(2),
6290 Self::Info => std::option::Option::Some(3),
6291 Self::Notice => std::option::Option::Some(4),
6292 Self::Warning => std::option::Option::Some(5),
6293 Self::Error => std::option::Option::Some(6),
6294 Self::Critical => std::option::Option::Some(7),
6295 Self::Alert => std::option::Option::Some(8),
6296 Self::Emergency => std::option::Option::Some(9),
6297 Self::UnknownValue(u) => u.0.value(),
6298 }
6299 }
6300
6301 /// Gets the enum value as a string.
6302 ///
6303 /// Returns `None` if the enum contains an unknown value deserialized from
6304 /// the integer representation of enums.
6305 pub fn name(&self) -> std::option::Option<&str> {
6306 match self {
6307 Self::Unspecified => std::option::Option::Some("LOG_SEVERITY_UNSPECIFIED"),
6308 Self::None => std::option::Option::Some("NONE"),
6309 Self::Debug => std::option::Option::Some("DEBUG"),
6310 Self::Info => std::option::Option::Some("INFO"),
6311 Self::Notice => std::option::Option::Some("NOTICE"),
6312 Self::Warning => std::option::Option::Some("WARNING"),
6313 Self::Error => std::option::Option::Some("ERROR"),
6314 Self::Critical => std::option::Option::Some("CRITICAL"),
6315 Self::Alert => std::option::Option::Some("ALERT"),
6316 Self::Emergency => std::option::Option::Some("EMERGENCY"),
6317 Self::UnknownValue(u) => u.0.name(),
6318 }
6319 }
6320 }
6321
6322 impl std::default::Default for LogSeverity {
6323 fn default() -> Self {
6324 use std::convert::From;
6325 Self::from(0)
6326 }
6327 }
6328
6329 impl std::fmt::Display for LogSeverity {
6330 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6331 wkt::internal::display_enum(f, self.name(), self.value())
6332 }
6333 }
6334
6335 impl std::convert::From<i32> for LogSeverity {
6336 fn from(value: i32) -> Self {
6337 match value {
6338 0 => Self::Unspecified,
6339 1 => Self::None,
6340 2 => Self::Debug,
6341 3 => Self::Info,
6342 4 => Self::Notice,
6343 5 => Self::Warning,
6344 6 => Self::Error,
6345 7 => Self::Critical,
6346 8 => Self::Alert,
6347 9 => Self::Emergency,
6348 _ => Self::UnknownValue(log_severity::UnknownValue(
6349 wkt::internal::UnknownEnumValue::Integer(value),
6350 )),
6351 }
6352 }
6353 }
6354
6355 impl std::convert::From<&str> for LogSeverity {
6356 fn from(value: &str) -> Self {
6357 use std::string::ToString;
6358 match value {
6359 "LOG_SEVERITY_UNSPECIFIED" => Self::Unspecified,
6360 "NONE" => Self::None,
6361 "DEBUG" => Self::Debug,
6362 "INFO" => Self::Info,
6363 "NOTICE" => Self::Notice,
6364 "WARNING" => Self::Warning,
6365 "ERROR" => Self::Error,
6366 "CRITICAL" => Self::Critical,
6367 "ALERT" => Self::Alert,
6368 "EMERGENCY" => Self::Emergency,
6369 _ => Self::UnknownValue(log_severity::UnknownValue(
6370 wkt::internal::UnknownEnumValue::String(value.to_string()),
6371 )),
6372 }
6373 }
6374 }
6375
6376 impl serde::ser::Serialize for LogSeverity {
6377 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6378 where
6379 S: serde::Serializer,
6380 {
6381 match self {
6382 Self::Unspecified => serializer.serialize_i32(0),
6383 Self::None => serializer.serialize_i32(1),
6384 Self::Debug => serializer.serialize_i32(2),
6385 Self::Info => serializer.serialize_i32(3),
6386 Self::Notice => serializer.serialize_i32(4),
6387 Self::Warning => serializer.serialize_i32(5),
6388 Self::Error => serializer.serialize_i32(6),
6389 Self::Critical => serializer.serialize_i32(7),
6390 Self::Alert => serializer.serialize_i32(8),
6391 Self::Emergency => serializer.serialize_i32(9),
6392 Self::UnknownValue(u) => u.0.serialize(serializer),
6393 }
6394 }
6395 }
6396
6397 impl<'de> serde::de::Deserialize<'de> for LogSeverity {
6398 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6399 where
6400 D: serde::Deserializer<'de>,
6401 {
6402 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LogSeverity>::new(
6403 ".google.cloud.eventarc.v1.LoggingConfig.LogSeverity",
6404 ))
6405 }
6406 }
6407}
6408
6409/// MessageBus for the messages flowing through the system. The admin has
6410/// visibility and control over the messages being published and consumed and can
6411/// restrict publishers and subscribers to only a subset of data available in the
6412/// system by defining authorization policies.
6413#[derive(Clone, Default, PartialEq)]
6414#[non_exhaustive]
6415pub struct MessageBus {
6416 /// Identifier. Resource name of the form
6417 /// projects/{project}/locations/{location}/messageBuses/{message_bus}
6418 pub name: std::string::String,
6419
6420 /// Output only. Server assigned unique identifier for the channel. The value
6421 /// is a UUID4 string and guaranteed to remain unchanged until the resource is
6422 /// deleted.
6423 pub uid: std::string::String,
6424
6425 /// Output only. This checksum is computed by the server based on the value of
6426 /// other fields, and might be sent only on update and delete requests to
6427 /// ensure that the client has an up-to-date value before proceeding.
6428 pub etag: std::string::String,
6429
6430 /// Output only. The creation time.
6431 pub create_time: std::option::Option<wkt::Timestamp>,
6432
6433 /// Output only. The last-modified time.
6434 pub update_time: std::option::Option<wkt::Timestamp>,
6435
6436 /// Optional. Resource labels.
6437 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6438
6439 /// Optional. Resource annotations.
6440 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
6441
6442 /// Optional. Resource display name.
6443 pub display_name: std::string::String,
6444
6445 /// Optional. Resource name of a KMS crypto key (managed by the user) used to
6446 /// encrypt/decrypt their event data.
6447 ///
6448 /// It must match the pattern
6449 /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
6450 pub crypto_key_name: std::string::String,
6451
6452 /// Optional. Config to control Platform logging for the Message Bus. This log
6453 /// configuration is applied to the Message Bus itself, and all the Enrollments
6454 /// attached to it.
6455 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
6456
6457 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6458}
6459
6460impl MessageBus {
6461 /// Creates a new default instance.
6462 pub fn new() -> Self {
6463 std::default::Default::default()
6464 }
6465
6466 /// Sets the value of [name][crate::model::MessageBus::name].
6467 ///
6468 /// # Example
6469 /// ```ignore,no_run
6470 /// # use google_cloud_eventarc_v1::model::MessageBus;
6471 /// # let project_id = "project_id";
6472 /// # let location_id = "location_id";
6473 /// # let message_bus_id = "message_bus_id";
6474 /// let x = MessageBus::new().set_name(format!("projects/{project_id}/locations/{location_id}/messageBuses/{message_bus_id}"));
6475 /// ```
6476 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6477 self.name = v.into();
6478 self
6479 }
6480
6481 /// Sets the value of [uid][crate::model::MessageBus::uid].
6482 ///
6483 /// # Example
6484 /// ```ignore,no_run
6485 /// # use google_cloud_eventarc_v1::model::MessageBus;
6486 /// let x = MessageBus::new().set_uid("example");
6487 /// ```
6488 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6489 self.uid = v.into();
6490 self
6491 }
6492
6493 /// Sets the value of [etag][crate::model::MessageBus::etag].
6494 ///
6495 /// # Example
6496 /// ```ignore,no_run
6497 /// # use google_cloud_eventarc_v1::model::MessageBus;
6498 /// let x = MessageBus::new().set_etag("example");
6499 /// ```
6500 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6501 self.etag = v.into();
6502 self
6503 }
6504
6505 /// Sets the value of [create_time][crate::model::MessageBus::create_time].
6506 ///
6507 /// # Example
6508 /// ```ignore,no_run
6509 /// # use google_cloud_eventarc_v1::model::MessageBus;
6510 /// use wkt::Timestamp;
6511 /// let x = MessageBus::new().set_create_time(Timestamp::default()/* use setters */);
6512 /// ```
6513 pub fn set_create_time<T>(mut self, v: T) -> Self
6514 where
6515 T: std::convert::Into<wkt::Timestamp>,
6516 {
6517 self.create_time = std::option::Option::Some(v.into());
6518 self
6519 }
6520
6521 /// Sets or clears the value of [create_time][crate::model::MessageBus::create_time].
6522 ///
6523 /// # Example
6524 /// ```ignore,no_run
6525 /// # use google_cloud_eventarc_v1::model::MessageBus;
6526 /// use wkt::Timestamp;
6527 /// let x = MessageBus::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6528 /// let x = MessageBus::new().set_or_clear_create_time(None::<Timestamp>);
6529 /// ```
6530 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6531 where
6532 T: std::convert::Into<wkt::Timestamp>,
6533 {
6534 self.create_time = v.map(|x| x.into());
6535 self
6536 }
6537
6538 /// Sets the value of [update_time][crate::model::MessageBus::update_time].
6539 ///
6540 /// # Example
6541 /// ```ignore,no_run
6542 /// # use google_cloud_eventarc_v1::model::MessageBus;
6543 /// use wkt::Timestamp;
6544 /// let x = MessageBus::new().set_update_time(Timestamp::default()/* use setters */);
6545 /// ```
6546 pub fn set_update_time<T>(mut self, v: T) -> Self
6547 where
6548 T: std::convert::Into<wkt::Timestamp>,
6549 {
6550 self.update_time = std::option::Option::Some(v.into());
6551 self
6552 }
6553
6554 /// Sets or clears the value of [update_time][crate::model::MessageBus::update_time].
6555 ///
6556 /// # Example
6557 /// ```ignore,no_run
6558 /// # use google_cloud_eventarc_v1::model::MessageBus;
6559 /// use wkt::Timestamp;
6560 /// let x = MessageBus::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6561 /// let x = MessageBus::new().set_or_clear_update_time(None::<Timestamp>);
6562 /// ```
6563 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6564 where
6565 T: std::convert::Into<wkt::Timestamp>,
6566 {
6567 self.update_time = v.map(|x| x.into());
6568 self
6569 }
6570
6571 /// Sets the value of [labels][crate::model::MessageBus::labels].
6572 ///
6573 /// # Example
6574 /// ```ignore,no_run
6575 /// # use google_cloud_eventarc_v1::model::MessageBus;
6576 /// let x = MessageBus::new().set_labels([
6577 /// ("key0", "abc"),
6578 /// ("key1", "xyz"),
6579 /// ]);
6580 /// ```
6581 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6582 where
6583 T: std::iter::IntoIterator<Item = (K, V)>,
6584 K: std::convert::Into<std::string::String>,
6585 V: std::convert::Into<std::string::String>,
6586 {
6587 use std::iter::Iterator;
6588 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6589 self
6590 }
6591
6592 /// Sets the value of [annotations][crate::model::MessageBus::annotations].
6593 ///
6594 /// # Example
6595 /// ```ignore,no_run
6596 /// # use google_cloud_eventarc_v1::model::MessageBus;
6597 /// let x = MessageBus::new().set_annotations([
6598 /// ("key0", "abc"),
6599 /// ("key1", "xyz"),
6600 /// ]);
6601 /// ```
6602 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
6603 where
6604 T: std::iter::IntoIterator<Item = (K, V)>,
6605 K: std::convert::Into<std::string::String>,
6606 V: std::convert::Into<std::string::String>,
6607 {
6608 use std::iter::Iterator;
6609 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6610 self
6611 }
6612
6613 /// Sets the value of [display_name][crate::model::MessageBus::display_name].
6614 ///
6615 /// # Example
6616 /// ```ignore,no_run
6617 /// # use google_cloud_eventarc_v1::model::MessageBus;
6618 /// let x = MessageBus::new().set_display_name("example");
6619 /// ```
6620 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6621 self.display_name = v.into();
6622 self
6623 }
6624
6625 /// Sets the value of [crypto_key_name][crate::model::MessageBus::crypto_key_name].
6626 ///
6627 /// # Example
6628 /// ```ignore,no_run
6629 /// # use google_cloud_eventarc_v1::model::MessageBus;
6630 /// let x = MessageBus::new().set_crypto_key_name("example");
6631 /// ```
6632 pub fn set_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6633 self.crypto_key_name = v.into();
6634 self
6635 }
6636
6637 /// Sets the value of [logging_config][crate::model::MessageBus::logging_config].
6638 ///
6639 /// # Example
6640 /// ```ignore,no_run
6641 /// # use google_cloud_eventarc_v1::model::MessageBus;
6642 /// use google_cloud_eventarc_v1::model::LoggingConfig;
6643 /// let x = MessageBus::new().set_logging_config(LoggingConfig::default()/* use setters */);
6644 /// ```
6645 pub fn set_logging_config<T>(mut self, v: T) -> Self
6646 where
6647 T: std::convert::Into<crate::model::LoggingConfig>,
6648 {
6649 self.logging_config = std::option::Option::Some(v.into());
6650 self
6651 }
6652
6653 /// Sets or clears the value of [logging_config][crate::model::MessageBus::logging_config].
6654 ///
6655 /// # Example
6656 /// ```ignore,no_run
6657 /// # use google_cloud_eventarc_v1::model::MessageBus;
6658 /// use google_cloud_eventarc_v1::model::LoggingConfig;
6659 /// let x = MessageBus::new().set_or_clear_logging_config(Some(LoggingConfig::default()/* use setters */));
6660 /// let x = MessageBus::new().set_or_clear_logging_config(None::<LoggingConfig>);
6661 /// ```
6662 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
6663 where
6664 T: std::convert::Into<crate::model::LoggingConfig>,
6665 {
6666 self.logging_config = v.map(|x| x.into());
6667 self
6668 }
6669}
6670
6671impl wkt::message::Message for MessageBus {
6672 fn typename() -> &'static str {
6673 "type.googleapis.com/google.cloud.eventarc.v1.MessageBus"
6674 }
6675}
6676
6677/// Network Configuration that can be inherited by other protos.
6678#[derive(Clone, Default, PartialEq)]
6679#[non_exhaustive]
6680pub struct NetworkConfig {
6681 /// Required. Name of the NetworkAttachment that allows access to the
6682 /// customer's VPC. Format:
6683 /// `projects/{PROJECT_ID}/regions/{REGION}/networkAttachments/{NETWORK_ATTACHMENT_NAME}`
6684 pub network_attachment: std::string::String,
6685
6686 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6687}
6688
6689impl NetworkConfig {
6690 /// Creates a new default instance.
6691 pub fn new() -> Self {
6692 std::default::Default::default()
6693 }
6694
6695 /// Sets the value of [network_attachment][crate::model::NetworkConfig::network_attachment].
6696 ///
6697 /// # Example
6698 /// ```ignore,no_run
6699 /// # use google_cloud_eventarc_v1::model::NetworkConfig;
6700 /// let x = NetworkConfig::new().set_network_attachment("example");
6701 /// ```
6702 pub fn set_network_attachment<T: std::convert::Into<std::string::String>>(
6703 mut self,
6704 v: T,
6705 ) -> Self {
6706 self.network_attachment = v.into();
6707 self
6708 }
6709}
6710
6711impl wkt::message::Message for NetworkConfig {
6712 fn typename() -> &'static str {
6713 "type.googleapis.com/google.cloud.eventarc.v1.NetworkConfig"
6714 }
6715}
6716
6717/// A representation of the Pipeline resource.
6718#[derive(Clone, Default, PartialEq)]
6719#[non_exhaustive]
6720pub struct Pipeline {
6721 /// Identifier. The resource name of the Pipeline. Must be unique within the
6722 /// location of the project and must be in
6723 /// `projects/{project}/locations/{location}/pipelines/{pipeline}` format.
6724 pub name: std::string::String,
6725
6726 /// Output only. The creation time.
6727 /// A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up
6728 /// to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and
6729 /// "2014-10-02T15:01:23.045123456Z".
6730 pub create_time: std::option::Option<wkt::Timestamp>,
6731
6732 /// Output only. The last-modified time.
6733 /// A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up
6734 /// to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and
6735 /// "2014-10-02T15:01:23.045123456Z".
6736 pub update_time: std::option::Option<wkt::Timestamp>,
6737
6738 /// Optional. User labels attached to the Pipeline that can be used to group
6739 /// resources. An object containing a list of "key": value pairs. Example: {
6740 /// "name": "wrench", "mass": "1.3kg", "count": "3" }.
6741 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6742
6743 /// Output only. Server-assigned unique identifier for the Pipeline. The value
6744 /// is a UUID4 string and guaranteed to remain unchanged until the resource is
6745 /// deleted.
6746 pub uid: std::string::String,
6747
6748 /// Optional. User-defined annotations. See
6749 /// <https://google.aip.dev/128#annotations>.
6750 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
6751
6752 /// Optional. Display name of resource.
6753 pub display_name: std::string::String,
6754
6755 /// Required. List of destinations to which messages will be forwarded.
6756 /// Currently, exactly one destination is supported per Pipeline.
6757 pub destinations: std::vec::Vec<crate::model::pipeline::Destination>,
6758
6759 /// Optional. List of mediation operations to be performed on the message.
6760 /// Currently, only one Transformation operation is allowed in each Pipeline.
6761 pub mediations: std::vec::Vec<crate::model::pipeline::Mediation>,
6762
6763 /// Optional. Resource name of a KMS crypto key (managed by the user) used to
6764 /// encrypt/decrypt the event data. If not set, an internal Google-owned key
6765 /// will be used to encrypt messages. It must match the pattern
6766 /// "projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}".
6767 pub crypto_key_name: std::string::String,
6768
6769 /// Optional. The payload format expected for the messages received by the
6770 /// Pipeline. If input_payload_format is set then any messages not matching
6771 /// this format will be treated as persistent errors. If input_payload_format
6772 /// is not set, then the message data will be treated as an opaque binary and
6773 /// no output format can be set on the Pipeline through the
6774 /// Pipeline.Destination.output_payload_format field. Any Mediations on the
6775 /// Pipeline that involve access to the data field will fail as persistent
6776 /// errors.
6777 pub input_payload_format: std::option::Option<crate::model::pipeline::MessagePayloadFormat>,
6778
6779 /// Optional. Config to control Platform Logging for Pipelines.
6780 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
6781
6782 /// Optional. The retry policy to use in the pipeline.
6783 pub retry_policy: std::option::Option<crate::model::pipeline::RetryPolicy>,
6784
6785 /// Output only. This checksum is computed by the server based on the value of
6786 /// other fields, and might be sent only on create requests to ensure that the
6787 /// client has an up-to-date value before proceeding.
6788 pub etag: std::string::String,
6789
6790 /// Output only. Whether or not this Pipeline satisfies the requirements of
6791 /// physical zone separation
6792 pub satisfies_pzs: bool,
6793
6794 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6795}
6796
6797impl Pipeline {
6798 /// Creates a new default instance.
6799 pub fn new() -> Self {
6800 std::default::Default::default()
6801 }
6802
6803 /// Sets the value of [name][crate::model::Pipeline::name].
6804 ///
6805 /// # Example
6806 /// ```ignore,no_run
6807 /// # use google_cloud_eventarc_v1::model::Pipeline;
6808 /// # let project_id = "project_id";
6809 /// # let location_id = "location_id";
6810 /// # let pipeline_id = "pipeline_id";
6811 /// let x = Pipeline::new().set_name(format!("projects/{project_id}/locations/{location_id}/pipelines/{pipeline_id}"));
6812 /// ```
6813 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6814 self.name = v.into();
6815 self
6816 }
6817
6818 /// Sets the value of [create_time][crate::model::Pipeline::create_time].
6819 ///
6820 /// # Example
6821 /// ```ignore,no_run
6822 /// # use google_cloud_eventarc_v1::model::Pipeline;
6823 /// use wkt::Timestamp;
6824 /// let x = Pipeline::new().set_create_time(Timestamp::default()/* use setters */);
6825 /// ```
6826 pub fn set_create_time<T>(mut self, v: T) -> Self
6827 where
6828 T: std::convert::Into<wkt::Timestamp>,
6829 {
6830 self.create_time = std::option::Option::Some(v.into());
6831 self
6832 }
6833
6834 /// Sets or clears the value of [create_time][crate::model::Pipeline::create_time].
6835 ///
6836 /// # Example
6837 /// ```ignore,no_run
6838 /// # use google_cloud_eventarc_v1::model::Pipeline;
6839 /// use wkt::Timestamp;
6840 /// let x = Pipeline::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6841 /// let x = Pipeline::new().set_or_clear_create_time(None::<Timestamp>);
6842 /// ```
6843 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6844 where
6845 T: std::convert::Into<wkt::Timestamp>,
6846 {
6847 self.create_time = v.map(|x| x.into());
6848 self
6849 }
6850
6851 /// Sets the value of [update_time][crate::model::Pipeline::update_time].
6852 ///
6853 /// # Example
6854 /// ```ignore,no_run
6855 /// # use google_cloud_eventarc_v1::model::Pipeline;
6856 /// use wkt::Timestamp;
6857 /// let x = Pipeline::new().set_update_time(Timestamp::default()/* use setters */);
6858 /// ```
6859 pub fn set_update_time<T>(mut self, v: T) -> Self
6860 where
6861 T: std::convert::Into<wkt::Timestamp>,
6862 {
6863 self.update_time = std::option::Option::Some(v.into());
6864 self
6865 }
6866
6867 /// Sets or clears the value of [update_time][crate::model::Pipeline::update_time].
6868 ///
6869 /// # Example
6870 /// ```ignore,no_run
6871 /// # use google_cloud_eventarc_v1::model::Pipeline;
6872 /// use wkt::Timestamp;
6873 /// let x = Pipeline::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6874 /// let x = Pipeline::new().set_or_clear_update_time(None::<Timestamp>);
6875 /// ```
6876 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6877 where
6878 T: std::convert::Into<wkt::Timestamp>,
6879 {
6880 self.update_time = v.map(|x| x.into());
6881 self
6882 }
6883
6884 /// Sets the value of [labels][crate::model::Pipeline::labels].
6885 ///
6886 /// # Example
6887 /// ```ignore,no_run
6888 /// # use google_cloud_eventarc_v1::model::Pipeline;
6889 /// let x = Pipeline::new().set_labels([
6890 /// ("key0", "abc"),
6891 /// ("key1", "xyz"),
6892 /// ]);
6893 /// ```
6894 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6895 where
6896 T: std::iter::IntoIterator<Item = (K, V)>,
6897 K: std::convert::Into<std::string::String>,
6898 V: std::convert::Into<std::string::String>,
6899 {
6900 use std::iter::Iterator;
6901 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6902 self
6903 }
6904
6905 /// Sets the value of [uid][crate::model::Pipeline::uid].
6906 ///
6907 /// # Example
6908 /// ```ignore,no_run
6909 /// # use google_cloud_eventarc_v1::model::Pipeline;
6910 /// let x = Pipeline::new().set_uid("example");
6911 /// ```
6912 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6913 self.uid = v.into();
6914 self
6915 }
6916
6917 /// Sets the value of [annotations][crate::model::Pipeline::annotations].
6918 ///
6919 /// # Example
6920 /// ```ignore,no_run
6921 /// # use google_cloud_eventarc_v1::model::Pipeline;
6922 /// let x = Pipeline::new().set_annotations([
6923 /// ("key0", "abc"),
6924 /// ("key1", "xyz"),
6925 /// ]);
6926 /// ```
6927 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
6928 where
6929 T: std::iter::IntoIterator<Item = (K, V)>,
6930 K: std::convert::Into<std::string::String>,
6931 V: std::convert::Into<std::string::String>,
6932 {
6933 use std::iter::Iterator;
6934 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6935 self
6936 }
6937
6938 /// Sets the value of [display_name][crate::model::Pipeline::display_name].
6939 ///
6940 /// # Example
6941 /// ```ignore,no_run
6942 /// # use google_cloud_eventarc_v1::model::Pipeline;
6943 /// let x = Pipeline::new().set_display_name("example");
6944 /// ```
6945 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6946 self.display_name = v.into();
6947 self
6948 }
6949
6950 /// Sets the value of [destinations][crate::model::Pipeline::destinations].
6951 ///
6952 /// # Example
6953 /// ```ignore,no_run
6954 /// # use google_cloud_eventarc_v1::model::Pipeline;
6955 /// use google_cloud_eventarc_v1::model::pipeline::Destination;
6956 /// let x = Pipeline::new()
6957 /// .set_destinations([
6958 /// Destination::default()/* use setters */,
6959 /// Destination::default()/* use (different) setters */,
6960 /// ]);
6961 /// ```
6962 pub fn set_destinations<T, V>(mut self, v: T) -> Self
6963 where
6964 T: std::iter::IntoIterator<Item = V>,
6965 V: std::convert::Into<crate::model::pipeline::Destination>,
6966 {
6967 use std::iter::Iterator;
6968 self.destinations = v.into_iter().map(|i| i.into()).collect();
6969 self
6970 }
6971
6972 /// Sets the value of [mediations][crate::model::Pipeline::mediations].
6973 ///
6974 /// # Example
6975 /// ```ignore,no_run
6976 /// # use google_cloud_eventarc_v1::model::Pipeline;
6977 /// use google_cloud_eventarc_v1::model::pipeline::Mediation;
6978 /// let x = Pipeline::new()
6979 /// .set_mediations([
6980 /// Mediation::default()/* use setters */,
6981 /// Mediation::default()/* use (different) setters */,
6982 /// ]);
6983 /// ```
6984 pub fn set_mediations<T, V>(mut self, v: T) -> Self
6985 where
6986 T: std::iter::IntoIterator<Item = V>,
6987 V: std::convert::Into<crate::model::pipeline::Mediation>,
6988 {
6989 use std::iter::Iterator;
6990 self.mediations = v.into_iter().map(|i| i.into()).collect();
6991 self
6992 }
6993
6994 /// Sets the value of [crypto_key_name][crate::model::Pipeline::crypto_key_name].
6995 ///
6996 /// # Example
6997 /// ```ignore,no_run
6998 /// # use google_cloud_eventarc_v1::model::Pipeline;
6999 /// let x = Pipeline::new().set_crypto_key_name("example");
7000 /// ```
7001 pub fn set_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7002 self.crypto_key_name = v.into();
7003 self
7004 }
7005
7006 /// Sets the value of [input_payload_format][crate::model::Pipeline::input_payload_format].
7007 ///
7008 /// # Example
7009 /// ```ignore,no_run
7010 /// # use google_cloud_eventarc_v1::model::Pipeline;
7011 /// use google_cloud_eventarc_v1::model::pipeline::MessagePayloadFormat;
7012 /// let x = Pipeline::new().set_input_payload_format(MessagePayloadFormat::default()/* use setters */);
7013 /// ```
7014 pub fn set_input_payload_format<T>(mut self, v: T) -> Self
7015 where
7016 T: std::convert::Into<crate::model::pipeline::MessagePayloadFormat>,
7017 {
7018 self.input_payload_format = std::option::Option::Some(v.into());
7019 self
7020 }
7021
7022 /// Sets or clears the value of [input_payload_format][crate::model::Pipeline::input_payload_format].
7023 ///
7024 /// # Example
7025 /// ```ignore,no_run
7026 /// # use google_cloud_eventarc_v1::model::Pipeline;
7027 /// use google_cloud_eventarc_v1::model::pipeline::MessagePayloadFormat;
7028 /// let x = Pipeline::new().set_or_clear_input_payload_format(Some(MessagePayloadFormat::default()/* use setters */));
7029 /// let x = Pipeline::new().set_or_clear_input_payload_format(None::<MessagePayloadFormat>);
7030 /// ```
7031 pub fn set_or_clear_input_payload_format<T>(mut self, v: std::option::Option<T>) -> Self
7032 where
7033 T: std::convert::Into<crate::model::pipeline::MessagePayloadFormat>,
7034 {
7035 self.input_payload_format = v.map(|x| x.into());
7036 self
7037 }
7038
7039 /// Sets the value of [logging_config][crate::model::Pipeline::logging_config].
7040 ///
7041 /// # Example
7042 /// ```ignore,no_run
7043 /// # use google_cloud_eventarc_v1::model::Pipeline;
7044 /// use google_cloud_eventarc_v1::model::LoggingConfig;
7045 /// let x = Pipeline::new().set_logging_config(LoggingConfig::default()/* use setters */);
7046 /// ```
7047 pub fn set_logging_config<T>(mut self, v: T) -> Self
7048 where
7049 T: std::convert::Into<crate::model::LoggingConfig>,
7050 {
7051 self.logging_config = std::option::Option::Some(v.into());
7052 self
7053 }
7054
7055 /// Sets or clears the value of [logging_config][crate::model::Pipeline::logging_config].
7056 ///
7057 /// # Example
7058 /// ```ignore,no_run
7059 /// # use google_cloud_eventarc_v1::model::Pipeline;
7060 /// use google_cloud_eventarc_v1::model::LoggingConfig;
7061 /// let x = Pipeline::new().set_or_clear_logging_config(Some(LoggingConfig::default()/* use setters */));
7062 /// let x = Pipeline::new().set_or_clear_logging_config(None::<LoggingConfig>);
7063 /// ```
7064 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
7065 where
7066 T: std::convert::Into<crate::model::LoggingConfig>,
7067 {
7068 self.logging_config = v.map(|x| x.into());
7069 self
7070 }
7071
7072 /// Sets the value of [retry_policy][crate::model::Pipeline::retry_policy].
7073 ///
7074 /// # Example
7075 /// ```ignore,no_run
7076 /// # use google_cloud_eventarc_v1::model::Pipeline;
7077 /// use google_cloud_eventarc_v1::model::pipeline::RetryPolicy;
7078 /// let x = Pipeline::new().set_retry_policy(RetryPolicy::default()/* use setters */);
7079 /// ```
7080 pub fn set_retry_policy<T>(mut self, v: T) -> Self
7081 where
7082 T: std::convert::Into<crate::model::pipeline::RetryPolicy>,
7083 {
7084 self.retry_policy = std::option::Option::Some(v.into());
7085 self
7086 }
7087
7088 /// Sets or clears the value of [retry_policy][crate::model::Pipeline::retry_policy].
7089 ///
7090 /// # Example
7091 /// ```ignore,no_run
7092 /// # use google_cloud_eventarc_v1::model::Pipeline;
7093 /// use google_cloud_eventarc_v1::model::pipeline::RetryPolicy;
7094 /// let x = Pipeline::new().set_or_clear_retry_policy(Some(RetryPolicy::default()/* use setters */));
7095 /// let x = Pipeline::new().set_or_clear_retry_policy(None::<RetryPolicy>);
7096 /// ```
7097 pub fn set_or_clear_retry_policy<T>(mut self, v: std::option::Option<T>) -> Self
7098 where
7099 T: std::convert::Into<crate::model::pipeline::RetryPolicy>,
7100 {
7101 self.retry_policy = v.map(|x| x.into());
7102 self
7103 }
7104
7105 /// Sets the value of [etag][crate::model::Pipeline::etag].
7106 ///
7107 /// # Example
7108 /// ```ignore,no_run
7109 /// # use google_cloud_eventarc_v1::model::Pipeline;
7110 /// let x = Pipeline::new().set_etag("example");
7111 /// ```
7112 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7113 self.etag = v.into();
7114 self
7115 }
7116
7117 /// Sets the value of [satisfies_pzs][crate::model::Pipeline::satisfies_pzs].
7118 ///
7119 /// # Example
7120 /// ```ignore,no_run
7121 /// # use google_cloud_eventarc_v1::model::Pipeline;
7122 /// let x = Pipeline::new().set_satisfies_pzs(true);
7123 /// ```
7124 pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7125 self.satisfies_pzs = v.into();
7126 self
7127 }
7128}
7129
7130impl wkt::message::Message for Pipeline {
7131 fn typename() -> &'static str {
7132 "type.googleapis.com/google.cloud.eventarc.v1.Pipeline"
7133 }
7134}
7135
7136/// Defines additional types related to [Pipeline].
7137pub mod pipeline {
7138 #[allow(unused_imports)]
7139 use super::*;
7140
7141 /// Represents the format of message data.
7142 #[derive(Clone, Default, PartialEq)]
7143 #[non_exhaustive]
7144 pub struct MessagePayloadFormat {
7145 /// The kind of message format.
7146 /// One of Protobuf, Avro, and JSON supported.
7147 /// This allows specification of what specific format
7148 /// messages are sent and received.
7149 pub kind: std::option::Option<crate::model::pipeline::message_payload_format::Kind>,
7150
7151 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7152 }
7153
7154 impl MessagePayloadFormat {
7155 /// Creates a new default instance.
7156 pub fn new() -> Self {
7157 std::default::Default::default()
7158 }
7159
7160 /// Sets the value of [kind][crate::model::pipeline::MessagePayloadFormat::kind].
7161 ///
7162 /// Note that all the setters affecting `kind` are mutually
7163 /// exclusive.
7164 ///
7165 /// # Example
7166 /// ```ignore,no_run
7167 /// # use google_cloud_eventarc_v1::model::pipeline::MessagePayloadFormat;
7168 /// use google_cloud_eventarc_v1::model::pipeline::message_payload_format::ProtobufFormat;
7169 /// let x = MessagePayloadFormat::new().set_kind(Some(
7170 /// google_cloud_eventarc_v1::model::pipeline::message_payload_format::Kind::Protobuf(ProtobufFormat::default().into())));
7171 /// ```
7172 pub fn set_kind<
7173 T: std::convert::Into<
7174 std::option::Option<crate::model::pipeline::message_payload_format::Kind>,
7175 >,
7176 >(
7177 mut self,
7178 v: T,
7179 ) -> Self {
7180 self.kind = v.into();
7181 self
7182 }
7183
7184 /// The value of [kind][crate::model::pipeline::MessagePayloadFormat::kind]
7185 /// if it holds a `Protobuf`, `None` if the field is not set or
7186 /// holds a different branch.
7187 pub fn protobuf(
7188 &self,
7189 ) -> std::option::Option<
7190 &std::boxed::Box<crate::model::pipeline::message_payload_format::ProtobufFormat>,
7191 > {
7192 #[allow(unreachable_patterns)]
7193 self.kind.as_ref().and_then(|v| match v {
7194 crate::model::pipeline::message_payload_format::Kind::Protobuf(v) => {
7195 std::option::Option::Some(v)
7196 }
7197 _ => std::option::Option::None,
7198 })
7199 }
7200
7201 /// Sets the value of [kind][crate::model::pipeline::MessagePayloadFormat::kind]
7202 /// to hold a `Protobuf`.
7203 ///
7204 /// Note that all the setters affecting `kind` are
7205 /// mutually exclusive.
7206 ///
7207 /// # Example
7208 /// ```ignore,no_run
7209 /// # use google_cloud_eventarc_v1::model::pipeline::MessagePayloadFormat;
7210 /// use google_cloud_eventarc_v1::model::pipeline::message_payload_format::ProtobufFormat;
7211 /// let x = MessagePayloadFormat::new().set_protobuf(ProtobufFormat::default()/* use setters */);
7212 /// assert!(x.protobuf().is_some());
7213 /// assert!(x.avro().is_none());
7214 /// assert!(x.json().is_none());
7215 /// ```
7216 pub fn set_protobuf<
7217 T: std::convert::Into<
7218 std::boxed::Box<crate::model::pipeline::message_payload_format::ProtobufFormat>,
7219 >,
7220 >(
7221 mut self,
7222 v: T,
7223 ) -> Self {
7224 self.kind = std::option::Option::Some(
7225 crate::model::pipeline::message_payload_format::Kind::Protobuf(v.into()),
7226 );
7227 self
7228 }
7229
7230 /// The value of [kind][crate::model::pipeline::MessagePayloadFormat::kind]
7231 /// if it holds a `Avro`, `None` if the field is not set or
7232 /// holds a different branch.
7233 pub fn avro(
7234 &self,
7235 ) -> std::option::Option<
7236 &std::boxed::Box<crate::model::pipeline::message_payload_format::AvroFormat>,
7237 > {
7238 #[allow(unreachable_patterns)]
7239 self.kind.as_ref().and_then(|v| match v {
7240 crate::model::pipeline::message_payload_format::Kind::Avro(v) => {
7241 std::option::Option::Some(v)
7242 }
7243 _ => std::option::Option::None,
7244 })
7245 }
7246
7247 /// Sets the value of [kind][crate::model::pipeline::MessagePayloadFormat::kind]
7248 /// to hold a `Avro`.
7249 ///
7250 /// Note that all the setters affecting `kind` are
7251 /// mutually exclusive.
7252 ///
7253 /// # Example
7254 /// ```ignore,no_run
7255 /// # use google_cloud_eventarc_v1::model::pipeline::MessagePayloadFormat;
7256 /// use google_cloud_eventarc_v1::model::pipeline::message_payload_format::AvroFormat;
7257 /// let x = MessagePayloadFormat::new().set_avro(AvroFormat::default()/* use setters */);
7258 /// assert!(x.avro().is_some());
7259 /// assert!(x.protobuf().is_none());
7260 /// assert!(x.json().is_none());
7261 /// ```
7262 pub fn set_avro<
7263 T: std::convert::Into<
7264 std::boxed::Box<crate::model::pipeline::message_payload_format::AvroFormat>,
7265 >,
7266 >(
7267 mut self,
7268 v: T,
7269 ) -> Self {
7270 self.kind = std::option::Option::Some(
7271 crate::model::pipeline::message_payload_format::Kind::Avro(v.into()),
7272 );
7273 self
7274 }
7275
7276 /// The value of [kind][crate::model::pipeline::MessagePayloadFormat::kind]
7277 /// if it holds a `Json`, `None` if the field is not set or
7278 /// holds a different branch.
7279 pub fn json(
7280 &self,
7281 ) -> std::option::Option<
7282 &std::boxed::Box<crate::model::pipeline::message_payload_format::JsonFormat>,
7283 > {
7284 #[allow(unreachable_patterns)]
7285 self.kind.as_ref().and_then(|v| match v {
7286 crate::model::pipeline::message_payload_format::Kind::Json(v) => {
7287 std::option::Option::Some(v)
7288 }
7289 _ => std::option::Option::None,
7290 })
7291 }
7292
7293 /// Sets the value of [kind][crate::model::pipeline::MessagePayloadFormat::kind]
7294 /// to hold a `Json`.
7295 ///
7296 /// Note that all the setters affecting `kind` are
7297 /// mutually exclusive.
7298 ///
7299 /// # Example
7300 /// ```ignore,no_run
7301 /// # use google_cloud_eventarc_v1::model::pipeline::MessagePayloadFormat;
7302 /// use google_cloud_eventarc_v1::model::pipeline::message_payload_format::JsonFormat;
7303 /// let x = MessagePayloadFormat::new().set_json(JsonFormat::default()/* use setters */);
7304 /// assert!(x.json().is_some());
7305 /// assert!(x.protobuf().is_none());
7306 /// assert!(x.avro().is_none());
7307 /// ```
7308 pub fn set_json<
7309 T: std::convert::Into<
7310 std::boxed::Box<crate::model::pipeline::message_payload_format::JsonFormat>,
7311 >,
7312 >(
7313 mut self,
7314 v: T,
7315 ) -> Self {
7316 self.kind = std::option::Option::Some(
7317 crate::model::pipeline::message_payload_format::Kind::Json(v.into()),
7318 );
7319 self
7320 }
7321 }
7322
7323 impl wkt::message::Message for MessagePayloadFormat {
7324 fn typename() -> &'static str {
7325 "type.googleapis.com/google.cloud.eventarc.v1.Pipeline.MessagePayloadFormat"
7326 }
7327 }
7328
7329 /// Defines additional types related to [MessagePayloadFormat].
7330 pub mod message_payload_format {
7331 #[allow(unused_imports)]
7332 use super::*;
7333
7334 /// The format of a JSON message payload.
7335 #[derive(Clone, Default, PartialEq)]
7336 #[non_exhaustive]
7337 pub struct JsonFormat {
7338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7339 }
7340
7341 impl JsonFormat {
7342 /// Creates a new default instance.
7343 pub fn new() -> Self {
7344 std::default::Default::default()
7345 }
7346 }
7347
7348 impl wkt::message::Message for JsonFormat {
7349 fn typename() -> &'static str {
7350 "type.googleapis.com/google.cloud.eventarc.v1.Pipeline.MessagePayloadFormat.JsonFormat"
7351 }
7352 }
7353
7354 /// The format of a Protobuf message payload.
7355 #[derive(Clone, Default, PartialEq)]
7356 #[non_exhaustive]
7357 pub struct ProtobufFormat {
7358 /// Optional. The entire schema definition is stored in this field.
7359 pub schema_definition: std::string::String,
7360
7361 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7362 }
7363
7364 impl ProtobufFormat {
7365 /// Creates a new default instance.
7366 pub fn new() -> Self {
7367 std::default::Default::default()
7368 }
7369
7370 /// Sets the value of [schema_definition][crate::model::pipeline::message_payload_format::ProtobufFormat::schema_definition].
7371 ///
7372 /// # Example
7373 /// ```ignore,no_run
7374 /// # use google_cloud_eventarc_v1::model::pipeline::message_payload_format::ProtobufFormat;
7375 /// let x = ProtobufFormat::new().set_schema_definition("example");
7376 /// ```
7377 pub fn set_schema_definition<T: std::convert::Into<std::string::String>>(
7378 mut self,
7379 v: T,
7380 ) -> Self {
7381 self.schema_definition = v.into();
7382 self
7383 }
7384 }
7385
7386 impl wkt::message::Message for ProtobufFormat {
7387 fn typename() -> &'static str {
7388 "type.googleapis.com/google.cloud.eventarc.v1.Pipeline.MessagePayloadFormat.ProtobufFormat"
7389 }
7390 }
7391
7392 /// The format of an AVRO message payload.
7393 #[derive(Clone, Default, PartialEq)]
7394 #[non_exhaustive]
7395 pub struct AvroFormat {
7396 /// Optional. The entire schema definition is stored in this field.
7397 pub schema_definition: std::string::String,
7398
7399 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7400 }
7401
7402 impl AvroFormat {
7403 /// Creates a new default instance.
7404 pub fn new() -> Self {
7405 std::default::Default::default()
7406 }
7407
7408 /// Sets the value of [schema_definition][crate::model::pipeline::message_payload_format::AvroFormat::schema_definition].
7409 ///
7410 /// # Example
7411 /// ```ignore,no_run
7412 /// # use google_cloud_eventarc_v1::model::pipeline::message_payload_format::AvroFormat;
7413 /// let x = AvroFormat::new().set_schema_definition("example");
7414 /// ```
7415 pub fn set_schema_definition<T: std::convert::Into<std::string::String>>(
7416 mut self,
7417 v: T,
7418 ) -> Self {
7419 self.schema_definition = v.into();
7420 self
7421 }
7422 }
7423
7424 impl wkt::message::Message for AvroFormat {
7425 fn typename() -> &'static str {
7426 "type.googleapis.com/google.cloud.eventarc.v1.Pipeline.MessagePayloadFormat.AvroFormat"
7427 }
7428 }
7429
7430 /// The kind of message format.
7431 /// One of Protobuf, Avro, and JSON supported.
7432 /// This allows specification of what specific format
7433 /// messages are sent and received.
7434 #[derive(Clone, Debug, PartialEq)]
7435 #[non_exhaustive]
7436 pub enum Kind {
7437 /// Optional. Protobuf format.
7438 Protobuf(
7439 std::boxed::Box<crate::model::pipeline::message_payload_format::ProtobufFormat>,
7440 ),
7441 /// Optional. Avro format.
7442 Avro(std::boxed::Box<crate::model::pipeline::message_payload_format::AvroFormat>),
7443 /// Optional. JSON format.
7444 Json(std::boxed::Box<crate::model::pipeline::message_payload_format::JsonFormat>),
7445 }
7446 }
7447
7448 /// Represents a target of an invocation over HTTP.
7449 #[derive(Clone, Default, PartialEq)]
7450 #[non_exhaustive]
7451 pub struct Destination {
7452 /// Optional. Network config is used to configure how Pipeline resolves and
7453 /// connects to a destination.
7454 pub network_config: std::option::Option<crate::model::pipeline::destination::NetworkConfig>,
7455
7456 /// Optional. An authentication config used to authenticate message requests,
7457 /// such that destinations can verify the source. For example, this can be
7458 /// used with private Google Cloud destinations that require Google Cloud
7459 /// credentials for access like Cloud Run. This field is optional and should
7460 /// be set only by users interested in authenticated push.
7461 pub authentication_config:
7462 std::option::Option<crate::model::pipeline::destination::AuthenticationConfig>,
7463
7464 /// Optional. The message format before it is delivered to the destination.
7465 /// If not set, the message will be delivered in the format it was originally
7466 /// delivered to the Pipeline. This field can only be set if
7467 /// Pipeline.input_payload_format is also set.
7468 pub output_payload_format:
7469 std::option::Option<crate::model::pipeline::MessagePayloadFormat>,
7470
7471 /// The destination identifier to which the request should be routed to.
7472 pub destination_descriptor:
7473 std::option::Option<crate::model::pipeline::destination::DestinationDescriptor>,
7474
7475 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7476 }
7477
7478 impl Destination {
7479 /// Creates a new default instance.
7480 pub fn new() -> Self {
7481 std::default::Default::default()
7482 }
7483
7484 /// Sets the value of [network_config][crate::model::pipeline::Destination::network_config].
7485 ///
7486 /// # Example
7487 /// ```ignore,no_run
7488 /// # use google_cloud_eventarc_v1::model::pipeline::Destination;
7489 /// use google_cloud_eventarc_v1::model::pipeline::destination::NetworkConfig;
7490 /// let x = Destination::new().set_network_config(NetworkConfig::default()/* use setters */);
7491 /// ```
7492 pub fn set_network_config<T>(mut self, v: T) -> Self
7493 where
7494 T: std::convert::Into<crate::model::pipeline::destination::NetworkConfig>,
7495 {
7496 self.network_config = std::option::Option::Some(v.into());
7497 self
7498 }
7499
7500 /// Sets or clears the value of [network_config][crate::model::pipeline::Destination::network_config].
7501 ///
7502 /// # Example
7503 /// ```ignore,no_run
7504 /// # use google_cloud_eventarc_v1::model::pipeline::Destination;
7505 /// use google_cloud_eventarc_v1::model::pipeline::destination::NetworkConfig;
7506 /// let x = Destination::new().set_or_clear_network_config(Some(NetworkConfig::default()/* use setters */));
7507 /// let x = Destination::new().set_or_clear_network_config(None::<NetworkConfig>);
7508 /// ```
7509 pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
7510 where
7511 T: std::convert::Into<crate::model::pipeline::destination::NetworkConfig>,
7512 {
7513 self.network_config = v.map(|x| x.into());
7514 self
7515 }
7516
7517 /// Sets the value of [authentication_config][crate::model::pipeline::Destination::authentication_config].
7518 ///
7519 /// # Example
7520 /// ```ignore,no_run
7521 /// # use google_cloud_eventarc_v1::model::pipeline::Destination;
7522 /// use google_cloud_eventarc_v1::model::pipeline::destination::AuthenticationConfig;
7523 /// let x = Destination::new().set_authentication_config(AuthenticationConfig::default()/* use setters */);
7524 /// ```
7525 pub fn set_authentication_config<T>(mut self, v: T) -> Self
7526 where
7527 T: std::convert::Into<crate::model::pipeline::destination::AuthenticationConfig>,
7528 {
7529 self.authentication_config = std::option::Option::Some(v.into());
7530 self
7531 }
7532
7533 /// Sets or clears the value of [authentication_config][crate::model::pipeline::Destination::authentication_config].
7534 ///
7535 /// # Example
7536 /// ```ignore,no_run
7537 /// # use google_cloud_eventarc_v1::model::pipeline::Destination;
7538 /// use google_cloud_eventarc_v1::model::pipeline::destination::AuthenticationConfig;
7539 /// let x = Destination::new().set_or_clear_authentication_config(Some(AuthenticationConfig::default()/* use setters */));
7540 /// let x = Destination::new().set_or_clear_authentication_config(None::<AuthenticationConfig>);
7541 /// ```
7542 pub fn set_or_clear_authentication_config<T>(mut self, v: std::option::Option<T>) -> Self
7543 where
7544 T: std::convert::Into<crate::model::pipeline::destination::AuthenticationConfig>,
7545 {
7546 self.authentication_config = v.map(|x| x.into());
7547 self
7548 }
7549
7550 /// Sets the value of [output_payload_format][crate::model::pipeline::Destination::output_payload_format].
7551 ///
7552 /// # Example
7553 /// ```ignore,no_run
7554 /// # use google_cloud_eventarc_v1::model::pipeline::Destination;
7555 /// use google_cloud_eventarc_v1::model::pipeline::MessagePayloadFormat;
7556 /// let x = Destination::new().set_output_payload_format(MessagePayloadFormat::default()/* use setters */);
7557 /// ```
7558 pub fn set_output_payload_format<T>(mut self, v: T) -> Self
7559 where
7560 T: std::convert::Into<crate::model::pipeline::MessagePayloadFormat>,
7561 {
7562 self.output_payload_format = std::option::Option::Some(v.into());
7563 self
7564 }
7565
7566 /// Sets or clears the value of [output_payload_format][crate::model::pipeline::Destination::output_payload_format].
7567 ///
7568 /// # Example
7569 /// ```ignore,no_run
7570 /// # use google_cloud_eventarc_v1::model::pipeline::Destination;
7571 /// use google_cloud_eventarc_v1::model::pipeline::MessagePayloadFormat;
7572 /// let x = Destination::new().set_or_clear_output_payload_format(Some(MessagePayloadFormat::default()/* use setters */));
7573 /// let x = Destination::new().set_or_clear_output_payload_format(None::<MessagePayloadFormat>);
7574 /// ```
7575 pub fn set_or_clear_output_payload_format<T>(mut self, v: std::option::Option<T>) -> Self
7576 where
7577 T: std::convert::Into<crate::model::pipeline::MessagePayloadFormat>,
7578 {
7579 self.output_payload_format = v.map(|x| x.into());
7580 self
7581 }
7582
7583 /// Sets the value of [destination_descriptor][crate::model::pipeline::Destination::destination_descriptor].
7584 ///
7585 /// Note that all the setters affecting `destination_descriptor` are mutually
7586 /// exclusive.
7587 ///
7588 /// # Example
7589 /// ```ignore,no_run
7590 /// # use google_cloud_eventarc_v1::model::pipeline::Destination;
7591 /// use google_cloud_eventarc_v1::model::pipeline::destination::DestinationDescriptor;
7592 /// let x = Destination::new().set_destination_descriptor(Some(DestinationDescriptor::Workflow("example".to_string())));
7593 /// ```
7594 pub fn set_destination_descriptor<
7595 T: std::convert::Into<
7596 std::option::Option<crate::model::pipeline::destination::DestinationDescriptor>,
7597 >,
7598 >(
7599 mut self,
7600 v: T,
7601 ) -> Self {
7602 self.destination_descriptor = v.into();
7603 self
7604 }
7605
7606 /// The value of [destination_descriptor][crate::model::pipeline::Destination::destination_descriptor]
7607 /// if it holds a `HttpEndpoint`, `None` if the field is not set or
7608 /// holds a different branch.
7609 pub fn http_endpoint(
7610 &self,
7611 ) -> std::option::Option<&std::boxed::Box<crate::model::pipeline::destination::HttpEndpoint>>
7612 {
7613 #[allow(unreachable_patterns)]
7614 self.destination_descriptor.as_ref().and_then(|v| match v {
7615 crate::model::pipeline::destination::DestinationDescriptor::HttpEndpoint(v) => {
7616 std::option::Option::Some(v)
7617 }
7618 _ => std::option::Option::None,
7619 })
7620 }
7621
7622 /// Sets the value of [destination_descriptor][crate::model::pipeline::Destination::destination_descriptor]
7623 /// to hold a `HttpEndpoint`.
7624 ///
7625 /// Note that all the setters affecting `destination_descriptor` are
7626 /// mutually exclusive.
7627 ///
7628 /// # Example
7629 /// ```ignore,no_run
7630 /// # use google_cloud_eventarc_v1::model::pipeline::Destination;
7631 /// use google_cloud_eventarc_v1::model::pipeline::destination::HttpEndpoint;
7632 /// let x = Destination::new().set_http_endpoint(HttpEndpoint::default()/* use setters */);
7633 /// assert!(x.http_endpoint().is_some());
7634 /// assert!(x.workflow().is_none());
7635 /// assert!(x.message_bus().is_none());
7636 /// assert!(x.topic().is_none());
7637 /// ```
7638 pub fn set_http_endpoint<
7639 T: std::convert::Into<std::boxed::Box<crate::model::pipeline::destination::HttpEndpoint>>,
7640 >(
7641 mut self,
7642 v: T,
7643 ) -> Self {
7644 self.destination_descriptor = std::option::Option::Some(
7645 crate::model::pipeline::destination::DestinationDescriptor::HttpEndpoint(v.into()),
7646 );
7647 self
7648 }
7649
7650 /// The value of [destination_descriptor][crate::model::pipeline::Destination::destination_descriptor]
7651 /// if it holds a `Workflow`, `None` if the field is not set or
7652 /// holds a different branch.
7653 pub fn workflow(&self) -> std::option::Option<&std::string::String> {
7654 #[allow(unreachable_patterns)]
7655 self.destination_descriptor.as_ref().and_then(|v| match v {
7656 crate::model::pipeline::destination::DestinationDescriptor::Workflow(v) => {
7657 std::option::Option::Some(v)
7658 }
7659 _ => std::option::Option::None,
7660 })
7661 }
7662
7663 /// Sets the value of [destination_descriptor][crate::model::pipeline::Destination::destination_descriptor]
7664 /// to hold a `Workflow`.
7665 ///
7666 /// Note that all the setters affecting `destination_descriptor` are
7667 /// mutually exclusive.
7668 ///
7669 /// # Example
7670 /// ```ignore,no_run
7671 /// # use google_cloud_eventarc_v1::model::pipeline::Destination;
7672 /// let x = Destination::new().set_workflow("example");
7673 /// assert!(x.workflow().is_some());
7674 /// assert!(x.http_endpoint().is_none());
7675 /// assert!(x.message_bus().is_none());
7676 /// assert!(x.topic().is_none());
7677 /// ```
7678 pub fn set_workflow<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7679 self.destination_descriptor = std::option::Option::Some(
7680 crate::model::pipeline::destination::DestinationDescriptor::Workflow(v.into()),
7681 );
7682 self
7683 }
7684
7685 /// The value of [destination_descriptor][crate::model::pipeline::Destination::destination_descriptor]
7686 /// if it holds a `MessageBus`, `None` if the field is not set or
7687 /// holds a different branch.
7688 pub fn message_bus(&self) -> std::option::Option<&std::string::String> {
7689 #[allow(unreachable_patterns)]
7690 self.destination_descriptor.as_ref().and_then(|v| match v {
7691 crate::model::pipeline::destination::DestinationDescriptor::MessageBus(v) => {
7692 std::option::Option::Some(v)
7693 }
7694 _ => std::option::Option::None,
7695 })
7696 }
7697
7698 /// Sets the value of [destination_descriptor][crate::model::pipeline::Destination::destination_descriptor]
7699 /// to hold a `MessageBus`.
7700 ///
7701 /// Note that all the setters affecting `destination_descriptor` are
7702 /// mutually exclusive.
7703 ///
7704 /// # Example
7705 /// ```ignore,no_run
7706 /// # use google_cloud_eventarc_v1::model::pipeline::Destination;
7707 /// # let project_id = "project_id";
7708 /// # let location_id = "location_id";
7709 /// # let message_bus_id = "message_bus_id";
7710 /// let x = Destination::new().set_message_bus(format!("projects/{project_id}/locations/{location_id}/messageBuses/{message_bus_id}"));
7711 /// assert!(x.message_bus().is_some());
7712 /// assert!(x.http_endpoint().is_none());
7713 /// assert!(x.workflow().is_none());
7714 /// assert!(x.topic().is_none());
7715 /// ```
7716 pub fn set_message_bus<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7717 self.destination_descriptor = std::option::Option::Some(
7718 crate::model::pipeline::destination::DestinationDescriptor::MessageBus(v.into()),
7719 );
7720 self
7721 }
7722
7723 /// The value of [destination_descriptor][crate::model::pipeline::Destination::destination_descriptor]
7724 /// if it holds a `Topic`, `None` if the field is not set or
7725 /// holds a different branch.
7726 pub fn topic(&self) -> std::option::Option<&std::string::String> {
7727 #[allow(unreachable_patterns)]
7728 self.destination_descriptor.as_ref().and_then(|v| match v {
7729 crate::model::pipeline::destination::DestinationDescriptor::Topic(v) => {
7730 std::option::Option::Some(v)
7731 }
7732 _ => std::option::Option::None,
7733 })
7734 }
7735
7736 /// Sets the value of [destination_descriptor][crate::model::pipeline::Destination::destination_descriptor]
7737 /// to hold a `Topic`.
7738 ///
7739 /// Note that all the setters affecting `destination_descriptor` are
7740 /// mutually exclusive.
7741 ///
7742 /// # Example
7743 /// ```ignore,no_run
7744 /// # use google_cloud_eventarc_v1::model::pipeline::Destination;
7745 /// let x = Destination::new().set_topic("example");
7746 /// assert!(x.topic().is_some());
7747 /// assert!(x.http_endpoint().is_none());
7748 /// assert!(x.workflow().is_none());
7749 /// assert!(x.message_bus().is_none());
7750 /// ```
7751 pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7752 self.destination_descriptor = std::option::Option::Some(
7753 crate::model::pipeline::destination::DestinationDescriptor::Topic(v.into()),
7754 );
7755 self
7756 }
7757 }
7758
7759 impl wkt::message::Message for Destination {
7760 fn typename() -> &'static str {
7761 "type.googleapis.com/google.cloud.eventarc.v1.Pipeline.Destination"
7762 }
7763 }
7764
7765 /// Defines additional types related to [Destination].
7766 pub mod destination {
7767 #[allow(unused_imports)]
7768 use super::*;
7769
7770 /// Represents a network config to be used for destination resolution and
7771 /// connectivity.
7772 #[derive(Clone, Default, PartialEq)]
7773 #[non_exhaustive]
7774 pub struct NetworkConfig {
7775 /// Required. Name of the NetworkAttachment that allows access to the
7776 /// consumer VPC. Format:
7777 /// `projects/{PROJECT_ID}/regions/{REGION}/networkAttachments/{NETWORK_ATTACHMENT_NAME}`
7778 pub network_attachment: std::string::String,
7779
7780 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7781 }
7782
7783 impl NetworkConfig {
7784 /// Creates a new default instance.
7785 pub fn new() -> Self {
7786 std::default::Default::default()
7787 }
7788
7789 /// Sets the value of [network_attachment][crate::model::pipeline::destination::NetworkConfig::network_attachment].
7790 ///
7791 /// # Example
7792 /// ```ignore,no_run
7793 /// # use google_cloud_eventarc_v1::model::pipeline::destination::NetworkConfig;
7794 /// let x = NetworkConfig::new().set_network_attachment("example");
7795 /// ```
7796 pub fn set_network_attachment<T: std::convert::Into<std::string::String>>(
7797 mut self,
7798 v: T,
7799 ) -> Self {
7800 self.network_attachment = v.into();
7801 self
7802 }
7803 }
7804
7805 impl wkt::message::Message for NetworkConfig {
7806 fn typename() -> &'static str {
7807 "type.googleapis.com/google.cloud.eventarc.v1.Pipeline.Destination.NetworkConfig"
7808 }
7809 }
7810
7811 /// Represents a HTTP endpoint destination.
7812 #[derive(Clone, Default, PartialEq)]
7813 #[non_exhaustive]
7814 pub struct HttpEndpoint {
7815 /// Required. The URI of the HTTP endpoint.
7816 ///
7817 /// The value must be a RFC2396 URI string.
7818 /// Examples: `<https://svc.us-central1.p.local>:8080/route`.
7819 /// Only the HTTPS protocol is supported.
7820 pub uri: std::string::String,
7821
7822 /// Optional. The CEL expression used to modify how the destination-bound
7823 /// HTTP request is constructed.
7824 ///
7825 /// If a binding expression is not specified here, the message
7826 /// is treated as a CloudEvent and is mapped to the HTTP request according
7827 /// to the CloudEvent HTTP Protocol Binding Binary Content Mode
7828 /// (<https://github.com/cloudevents/spec/blob/main/cloudevents/bindings/http-protocol-binding.md#31-binary-content-mode>).
7829 /// In this representation, all fields except the `data` and
7830 /// `datacontenttype` field on the message are mapped to HTTP request
7831 /// headers with a prefix of `ce-`.
7832 ///
7833 /// To construct the HTTP request payload and the value of the content-type
7834 /// HTTP header, the payload format is defined as follows:
7835 ///
7836 /// 1. Use the output_payload_format_type on the Pipeline.Destination if it
7837 /// is set, else:
7838 /// 1. Use the input_payload_format_type on the Pipeline if it is set,
7839 /// else:
7840 /// 1. Treat the payload as opaque binary data.
7841 ///
7842 /// The `data` field of the message is converted to the payload format or
7843 /// left as-is for case 3) and then attached as the payload of the HTTP
7844 /// request. The `content-type` header on the HTTP request is set to the
7845 /// payload format type or left empty for case 3). However, if a mediation
7846 /// has updated the `datacontenttype` field on the message so that it is
7847 /// not the same as the payload format type but it is still a prefix of the
7848 /// payload format type, then the `content-type` header on the HTTP request
7849 /// is set to this `datacontenttype` value. For example, if the
7850 /// `datacontenttype` is "application/json" and the payload format type is
7851 /// "application/json; charset=utf-8", then the `content-type` header on
7852 /// the HTTP request is set to "application/json; charset=utf-8".
7853 ///
7854 /// If a non-empty binding expression is specified then this expression is
7855 /// used to modify the default CloudEvent HTTP Protocol Binding Binary
7856 /// Content representation.
7857 /// The result of the CEL expression must be a map of key/value pairs
7858 /// which is used as follows:
7859 ///
7860 /// - If a map named `headers` exists on the result of the expression,
7861 /// then its key/value pairs are directly mapped to the HTTP request
7862 /// headers. The headers values are constructed from the corresponding
7863 /// value type's canonical representation. If the `headers` field doesn't
7864 /// exist then the resulting HTTP request will be the headers of the
7865 /// CloudEvent HTTP Binding Binary Content Mode representation of the final
7866 /// message. Note: If the specified binding expression, has updated the
7867 /// `datacontenttype` field on the message so that it is not the same as
7868 /// the payload format type but it is still a prefix of the payload format
7869 /// type, then the `content-type` header in the `headers` map is set to
7870 /// this `datacontenttype` value.
7871 /// - If a field named `body` exists on the result of the expression then
7872 /// its value is directly mapped to the body of the request. If the value
7873 /// of the `body` field is of type bytes or string then it is used for
7874 /// the HTTP request body as-is, with no conversion. If the body field is
7875 /// of any other type then it is converted to a JSON string. If the body
7876 /// field does not exist then the resulting payload of the HTTP request
7877 /// will be data value of the CloudEvent HTTP Binding Binary Content Mode
7878 /// representation of the final message as described earlier.
7879 /// - Any other fields in the resulting expression will be ignored.
7880 ///
7881 /// The CEL expression may access the incoming CloudEvent message in its
7882 /// definition, as follows:
7883 ///
7884 /// - The `data` field of the incoming CloudEvent message can be accessed
7885 /// using the `message.data` value. Subfields of `message.data` may also be
7886 /// accessed if an input_payload_format has been specified on the Pipeline.
7887 /// - Each attribute of the incoming CloudEvent message can be accessed
7888 /// using the `message.\<key\>` value, where \<key\> is replaced with the
7889 /// name of the attribute.
7890 /// - Existing headers can be accessed in the CEL expression using the
7891 /// `headers` variable. The `headers` variable defines a map of key/value
7892 /// pairs corresponding to the HTTP headers of the CloudEvent HTTP Binding
7893 /// Binary Content Mode representation of the final message as described
7894 /// earlier. For example, the following CEL expression can be used to
7895 /// construct an HTTP request by adding an additional header to the HTTP
7896 /// headers of the CloudEvent HTTP Binding Binary Content Mode
7897 /// representation of the final message and by overwriting the body of the
7898 /// request:
7899 ///
7900 /// ```norust
7901 /// {
7902 /// "headers": headers.merge({"new-header-key": "new-header-value"}),
7903 /// "body": "new-body"
7904 /// }
7905 /// ```
7906 ///
7907 /// - The default binding for the message payload can be accessed using the
7908 /// `body` variable. It conatins a string representation of the message
7909 /// payload in the format specified by the `output_payload_format` field.
7910 /// If the `input_payload_format` field is not set, the `body`
7911 /// variable contains the same message payload bytes that were published.
7912 ///
7913 /// Additionally, the following CEL extension functions are provided for
7914 /// use in this CEL expression:
7915 ///
7916 /// - toBase64Url:
7917 /// map.toBase64Url() -> string
7918 /// - Converts a CelValue to a base64url encoded string
7919 /// - toJsonString: map.toJsonString() -> string
7920 /// - Converts a CelValue to a JSON string
7921 /// - merge:
7922 /// map1.merge(map2) -> map3
7923 /// - Merges the passed CEL map with the existing CEL map the
7924 /// function is applied to.
7925 /// - If the same key exists in both maps, if the key's value is type
7926 /// map both maps are merged else the value from the passed map is
7927 /// used.
7928 /// - denormalize:
7929 /// map.denormalize() -> map
7930 /// - Denormalizes a CEL map such that every value of type map or key
7931 /// in the map is expanded to return a single level map.
7932 /// - The resulting keys are "." separated indices of the map keys.
7933 /// - For example:
7934 /// {
7935 /// "a": 1,
7936 /// "b": {
7937 /// "c": 2,
7938 /// "d": 3
7939 /// }
7940 /// "e": [4, 5]
7941 /// }
7942 /// .denormalize()
7943 /// -> {
7944 /// "a": 1,
7945 /// "b.c": 2,
7946 /// "b.d": 3,
7947 /// "e.0": 4,
7948 /// "e.1": 5
7949 /// }
7950 /// - setField:
7951 /// map.setField(key, value) -> message
7952 /// - Sets the field of the message with the given key to the
7953 /// given value.
7954 /// - If the field is not present it will be added.
7955 /// - If the field is present it will be overwritten.
7956 /// - The key can be a dot separated path to set a field in a nested
7957 /// message.
7958 /// - Key must be of type string.
7959 /// - Value may be any valid type.
7960 /// - removeFields:
7961 /// map.removeFields([key1, key2, ...]) -> message
7962 /// - Removes the fields of the map with the given keys.
7963 /// - The keys can be a dot separated path to remove a field in a
7964 /// nested message.
7965 /// - If a key is not found it will be ignored.
7966 /// - Keys must be of type string.
7967 /// - toMap:
7968 /// [map1, map2, ...].toMap() -> map
7969 /// - Converts a CEL list of CEL maps to a single CEL map
7970 /// - toCloudEventJsonWithPayloadFormat:
7971 /// message.toCloudEventJsonWithPayloadFormat() -> map
7972 /// - Converts a message to the corresponding structure of JSON
7973 /// format for CloudEvents.
7974 /// - It converts `data` to destination payload format
7975 /// specified in `output_payload_format`. If `output_payload_format` is
7976 /// not set, the data will remain unchanged.
7977 /// - It also sets the corresponding datacontenttype of
7978 /// the CloudEvent, as indicated by
7979 /// `output_payload_format`. If no
7980 /// `output_payload_format` is set it will use the value of the
7981 /// "datacontenttype" attribute on the CloudEvent if present, else
7982 /// remove "datacontenttype" attribute.
7983 /// - This function expects that the content of the message will
7984 /// adhere to the standard CloudEvent format. If it doesn't then this
7985 /// function will fail.
7986 /// - The result is a CEL map that corresponds to the JSON
7987 /// representation of the CloudEvent. To convert that data to a JSON
7988 /// string it can be chained with the toJsonString function.
7989 ///
7990 /// The Pipeline expects that the message it receives adheres to the
7991 /// standard CloudEvent format. If it doesn't then the outgoing message
7992 /// request may fail with a persistent error.
7993 pub message_binding_template: std::string::String,
7994
7995 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7996 }
7997
7998 impl HttpEndpoint {
7999 /// Creates a new default instance.
8000 pub fn new() -> Self {
8001 std::default::Default::default()
8002 }
8003
8004 /// Sets the value of [uri][crate::model::pipeline::destination::HttpEndpoint::uri].
8005 ///
8006 /// # Example
8007 /// ```ignore,no_run
8008 /// # use google_cloud_eventarc_v1::model::pipeline::destination::HttpEndpoint;
8009 /// let x = HttpEndpoint::new().set_uri("example");
8010 /// ```
8011 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8012 self.uri = v.into();
8013 self
8014 }
8015
8016 /// Sets the value of [message_binding_template][crate::model::pipeline::destination::HttpEndpoint::message_binding_template].
8017 ///
8018 /// # Example
8019 /// ```ignore,no_run
8020 /// # use google_cloud_eventarc_v1::model::pipeline::destination::HttpEndpoint;
8021 /// let x = HttpEndpoint::new().set_message_binding_template("example");
8022 /// ```
8023 pub fn set_message_binding_template<T: std::convert::Into<std::string::String>>(
8024 mut self,
8025 v: T,
8026 ) -> Self {
8027 self.message_binding_template = v.into();
8028 self
8029 }
8030 }
8031
8032 impl wkt::message::Message for HttpEndpoint {
8033 fn typename() -> &'static str {
8034 "type.googleapis.com/google.cloud.eventarc.v1.Pipeline.Destination.HttpEndpoint"
8035 }
8036 }
8037
8038 /// Represents a config used to authenticate message requests.
8039 #[derive(Clone, Default, PartialEq)]
8040 #[non_exhaustive]
8041 pub struct AuthenticationConfig {
8042
8043 /// The type of authentication method.
8044 pub authentication_method_descriptor: std::option::Option<crate::model::pipeline::destination::authentication_config::AuthenticationMethodDescriptor>,
8045
8046 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8047 }
8048
8049 impl AuthenticationConfig {
8050 /// Creates a new default instance.
8051 pub fn new() -> Self {
8052 std::default::Default::default()
8053 }
8054
8055 /// Sets the value of [authentication_method_descriptor][crate::model::pipeline::destination::AuthenticationConfig::authentication_method_descriptor].
8056 ///
8057 /// Note that all the setters affecting `authentication_method_descriptor` are mutually
8058 /// exclusive.
8059 ///
8060 /// # Example
8061 /// ```ignore,no_run
8062 /// # use google_cloud_eventarc_v1::model::pipeline::destination::AuthenticationConfig;
8063 /// use google_cloud_eventarc_v1::model::pipeline::destination::authentication_config::OidcToken;
8064 /// let x = AuthenticationConfig::new().set_authentication_method_descriptor(Some(
8065 /// google_cloud_eventarc_v1::model::pipeline::destination::authentication_config::AuthenticationMethodDescriptor::GoogleOidc(OidcToken::default().into())));
8066 /// ```
8067 pub fn set_authentication_method_descriptor<T: std::convert::Into<std::option::Option<crate::model::pipeline::destination::authentication_config::AuthenticationMethodDescriptor>>>(mut self, v: T) -> Self
8068 {
8069 self.authentication_method_descriptor = v.into();
8070 self
8071 }
8072
8073 /// The value of [authentication_method_descriptor][crate::model::pipeline::destination::AuthenticationConfig::authentication_method_descriptor]
8074 /// if it holds a `GoogleOidc`, `None` if the field is not set or
8075 /// holds a different branch.
8076 pub fn google_oidc(
8077 &self,
8078 ) -> std::option::Option<
8079 &std::boxed::Box<
8080 crate::model::pipeline::destination::authentication_config::OidcToken,
8081 >,
8082 > {
8083 #[allow(unreachable_patterns)]
8084 self.authentication_method_descriptor.as_ref().and_then(|v| match v {
8085 crate::model::pipeline::destination::authentication_config::AuthenticationMethodDescriptor::GoogleOidc(v) => std::option::Option::Some(v),
8086 _ => std::option::Option::None,
8087 })
8088 }
8089
8090 /// Sets the value of [authentication_method_descriptor][crate::model::pipeline::destination::AuthenticationConfig::authentication_method_descriptor]
8091 /// to hold a `GoogleOidc`.
8092 ///
8093 /// Note that all the setters affecting `authentication_method_descriptor` are
8094 /// mutually exclusive.
8095 ///
8096 /// # Example
8097 /// ```ignore,no_run
8098 /// # use google_cloud_eventarc_v1::model::pipeline::destination::AuthenticationConfig;
8099 /// use google_cloud_eventarc_v1::model::pipeline::destination::authentication_config::OidcToken;
8100 /// let x = AuthenticationConfig::new().set_google_oidc(OidcToken::default()/* use setters */);
8101 /// assert!(x.google_oidc().is_some());
8102 /// assert!(x.oauth_token().is_none());
8103 /// ```
8104 pub fn set_google_oidc<
8105 T: std::convert::Into<
8106 std::boxed::Box<
8107 crate::model::pipeline::destination::authentication_config::OidcToken,
8108 >,
8109 >,
8110 >(
8111 mut self,
8112 v: T,
8113 ) -> Self {
8114 self.authentication_method_descriptor = std::option::Option::Some(
8115 crate::model::pipeline::destination::authentication_config::AuthenticationMethodDescriptor::GoogleOidc(
8116 v.into()
8117 )
8118 );
8119 self
8120 }
8121
8122 /// The value of [authentication_method_descriptor][crate::model::pipeline::destination::AuthenticationConfig::authentication_method_descriptor]
8123 /// if it holds a `OauthToken`, `None` if the field is not set or
8124 /// holds a different branch.
8125 pub fn oauth_token(
8126 &self,
8127 ) -> std::option::Option<
8128 &std::boxed::Box<
8129 crate::model::pipeline::destination::authentication_config::OAuthToken,
8130 >,
8131 > {
8132 #[allow(unreachable_patterns)]
8133 self.authentication_method_descriptor.as_ref().and_then(|v| match v {
8134 crate::model::pipeline::destination::authentication_config::AuthenticationMethodDescriptor::OauthToken(v) => std::option::Option::Some(v),
8135 _ => std::option::Option::None,
8136 })
8137 }
8138
8139 /// Sets the value of [authentication_method_descriptor][crate::model::pipeline::destination::AuthenticationConfig::authentication_method_descriptor]
8140 /// to hold a `OauthToken`.
8141 ///
8142 /// Note that all the setters affecting `authentication_method_descriptor` are
8143 /// mutually exclusive.
8144 ///
8145 /// # Example
8146 /// ```ignore,no_run
8147 /// # use google_cloud_eventarc_v1::model::pipeline::destination::AuthenticationConfig;
8148 /// use google_cloud_eventarc_v1::model::pipeline::destination::authentication_config::OAuthToken;
8149 /// let x = AuthenticationConfig::new().set_oauth_token(OAuthToken::default()/* use setters */);
8150 /// assert!(x.oauth_token().is_some());
8151 /// assert!(x.google_oidc().is_none());
8152 /// ```
8153 pub fn set_oauth_token<
8154 T: std::convert::Into<
8155 std::boxed::Box<
8156 crate::model::pipeline::destination::authentication_config::OAuthToken,
8157 >,
8158 >,
8159 >(
8160 mut self,
8161 v: T,
8162 ) -> Self {
8163 self.authentication_method_descriptor = std::option::Option::Some(
8164 crate::model::pipeline::destination::authentication_config::AuthenticationMethodDescriptor::OauthToken(
8165 v.into()
8166 )
8167 );
8168 self
8169 }
8170 }
8171
8172 impl wkt::message::Message for AuthenticationConfig {
8173 fn typename() -> &'static str {
8174 "type.googleapis.com/google.cloud.eventarc.v1.Pipeline.Destination.AuthenticationConfig"
8175 }
8176 }
8177
8178 /// Defines additional types related to [AuthenticationConfig].
8179 pub mod authentication_config {
8180 #[allow(unused_imports)]
8181 use super::*;
8182
8183 /// Represents a config used to authenticate with a Google OIDC token using
8184 /// a Google Cloud service account. Use this authentication method to
8185 /// invoke your Cloud Run and Cloud Functions destinations or HTTP
8186 /// endpoints that support Google OIDC.
8187 #[derive(Clone, Default, PartialEq)]
8188 #[non_exhaustive]
8189 pub struct OidcToken {
8190 /// Required. Service account email used to generate the OIDC Token.
8191 /// The principal who calls this API must have
8192 /// iam.serviceAccounts.actAs permission in the service account. See
8193 /// <https://cloud.google.com/iam/docs/understanding-service-accounts>
8194 /// for more information. Eventarc service agents must have
8195 /// roles/roles/iam.serviceAccountTokenCreator role to allow the
8196 /// Pipeline to create OpenID tokens for authenticated requests.
8197 pub service_account: std::string::String,
8198
8199 /// Optional. Audience to be used to generate the OIDC Token. The
8200 /// audience claim identifies the recipient that the JWT is intended for.
8201 /// If unspecified, the destination URI will be used.
8202 pub audience: std::string::String,
8203
8204 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8205 }
8206
8207 impl OidcToken {
8208 /// Creates a new default instance.
8209 pub fn new() -> Self {
8210 std::default::Default::default()
8211 }
8212
8213 /// Sets the value of [service_account][crate::model::pipeline::destination::authentication_config::OidcToken::service_account].
8214 ///
8215 /// # Example
8216 /// ```ignore,no_run
8217 /// # use google_cloud_eventarc_v1::model::pipeline::destination::authentication_config::OidcToken;
8218 /// let x = OidcToken::new().set_service_account("example");
8219 /// ```
8220 pub fn set_service_account<T: std::convert::Into<std::string::String>>(
8221 mut self,
8222 v: T,
8223 ) -> Self {
8224 self.service_account = v.into();
8225 self
8226 }
8227
8228 /// Sets the value of [audience][crate::model::pipeline::destination::authentication_config::OidcToken::audience].
8229 ///
8230 /// # Example
8231 /// ```ignore,no_run
8232 /// # use google_cloud_eventarc_v1::model::pipeline::destination::authentication_config::OidcToken;
8233 /// let x = OidcToken::new().set_audience("example");
8234 /// ```
8235 pub fn set_audience<T: std::convert::Into<std::string::String>>(
8236 mut self,
8237 v: T,
8238 ) -> Self {
8239 self.audience = v.into();
8240 self
8241 }
8242 }
8243
8244 impl wkt::message::Message for OidcToken {
8245 fn typename() -> &'static str {
8246 "type.googleapis.com/google.cloud.eventarc.v1.Pipeline.Destination.AuthenticationConfig.OidcToken"
8247 }
8248 }
8249
8250 /// Contains information needed for generating an
8251 /// [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
8252 /// This type of authorization should generally only be used when calling
8253 /// Google APIs hosted on *.googleapis.com.
8254 #[derive(Clone, Default, PartialEq)]
8255 #[non_exhaustive]
8256 pub struct OAuthToken {
8257 /// Required. Service account email used to generate the [OAuth
8258 /// token](https://developers.google.com/identity/protocols/OAuth2).
8259 /// The principal who calls this API must have
8260 /// iam.serviceAccounts.actAs permission in the service account. See
8261 /// <https://cloud.google.com/iam/docs/understanding-service-accounts>
8262 /// for more information. Eventarc service agents must have
8263 /// roles/roles/iam.serviceAccountTokenCreator role to allow Pipeline
8264 /// to create OAuth2 tokens for authenticated requests.
8265 pub service_account: std::string::String,
8266
8267 /// Optional. OAuth scope to be used for generating OAuth access token.
8268 /// If not specified, `https://www.googleapis.com/auth/cloud-platform`
8269 /// will be used.
8270 pub scope: std::string::String,
8271
8272 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8273 }
8274
8275 impl OAuthToken {
8276 /// Creates a new default instance.
8277 pub fn new() -> Self {
8278 std::default::Default::default()
8279 }
8280
8281 /// Sets the value of [service_account][crate::model::pipeline::destination::authentication_config::OAuthToken::service_account].
8282 ///
8283 /// # Example
8284 /// ```ignore,no_run
8285 /// # use google_cloud_eventarc_v1::model::pipeline::destination::authentication_config::OAuthToken;
8286 /// let x = OAuthToken::new().set_service_account("example");
8287 /// ```
8288 pub fn set_service_account<T: std::convert::Into<std::string::String>>(
8289 mut self,
8290 v: T,
8291 ) -> Self {
8292 self.service_account = v.into();
8293 self
8294 }
8295
8296 /// Sets the value of [scope][crate::model::pipeline::destination::authentication_config::OAuthToken::scope].
8297 ///
8298 /// # Example
8299 /// ```ignore,no_run
8300 /// # use google_cloud_eventarc_v1::model::pipeline::destination::authentication_config::OAuthToken;
8301 /// let x = OAuthToken::new().set_scope("example");
8302 /// ```
8303 pub fn set_scope<T: std::convert::Into<std::string::String>>(
8304 mut self,
8305 v: T,
8306 ) -> Self {
8307 self.scope = v.into();
8308 self
8309 }
8310 }
8311
8312 impl wkt::message::Message for OAuthToken {
8313 fn typename() -> &'static str {
8314 "type.googleapis.com/google.cloud.eventarc.v1.Pipeline.Destination.AuthenticationConfig.OAuthToken"
8315 }
8316 }
8317
8318 /// The type of authentication method.
8319 #[derive(Clone, Debug, PartialEq)]
8320 #[non_exhaustive]
8321 pub enum AuthenticationMethodDescriptor {
8322 /// Optional. This authenticate method will apply Google OIDC tokens
8323 /// signed by a Google Cloud service account to the requests.
8324 GoogleOidc(
8325 std::boxed::Box<
8326 crate::model::pipeline::destination::authentication_config::OidcToken,
8327 >,
8328 ),
8329 /// Optional. If specified, an [OAuth
8330 /// token](https://developers.google.com/identity/protocols/OAuth2) will
8331 /// be generated and attached as an `Authorization` header in the HTTP
8332 /// request.
8333 ///
8334 /// This type of authorization should generally only be used when calling
8335 /// Google APIs hosted on *.googleapis.com.
8336 OauthToken(
8337 std::boxed::Box<
8338 crate::model::pipeline::destination::authentication_config::OAuthToken,
8339 >,
8340 ),
8341 }
8342 }
8343
8344 /// The destination identifier to which the request should be routed to.
8345 #[derive(Clone, Debug, PartialEq)]
8346 #[non_exhaustive]
8347 pub enum DestinationDescriptor {
8348 /// Optional. An HTTP endpoint destination described by an URI.
8349 /// If a DNS FQDN is provided as the endpoint, Pipeline will create a
8350 /// peering zone to the consumer VPC and forward DNS requests to the VPC
8351 /// specified by network config to resolve the service endpoint. See:
8352 /// <https://cloud.google.com/dns/docs/zones/zones-overview#peering_zones>
8353 HttpEndpoint(std::boxed::Box<crate::model::pipeline::destination::HttpEndpoint>),
8354 /// Optional. The resource name of the Workflow whose Executions are
8355 /// triggered by the events. The Workflow resource should be deployed in
8356 /// the same project as the Pipeline. Format:
8357 /// `projects/{project}/locations/{location}/workflows/{workflow}`
8358 Workflow(std::string::String),
8359 /// Optional. The resource name of the Message Bus to which events should
8360 /// be published. The Message Bus resource should exist in the same project
8361 /// as the Pipeline. Format:
8362 /// `projects/{project}/locations/{location}/messageBuses/{message_bus}`
8363 MessageBus(std::string::String),
8364 /// Optional. The resource name of the Pub/Sub topic to which events should
8365 /// be published. Format:
8366 /// `projects/{project}/locations/{location}/topics/{topic}`
8367 Topic(std::string::String),
8368 }
8369 }
8370
8371 /// Mediation defines different ways to modify the Pipeline.
8372 #[derive(Clone, Default, PartialEq)]
8373 #[non_exhaustive]
8374 pub struct Mediation {
8375 /// The config of mediation.
8376 pub mediation_descriptor:
8377 std::option::Option<crate::model::pipeline::mediation::MediationDescriptor>,
8378
8379 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8380 }
8381
8382 impl Mediation {
8383 /// Creates a new default instance.
8384 pub fn new() -> Self {
8385 std::default::Default::default()
8386 }
8387
8388 /// Sets the value of [mediation_descriptor][crate::model::pipeline::Mediation::mediation_descriptor].
8389 ///
8390 /// Note that all the setters affecting `mediation_descriptor` are mutually
8391 /// exclusive.
8392 ///
8393 /// # Example
8394 /// ```ignore,no_run
8395 /// # use google_cloud_eventarc_v1::model::pipeline::Mediation;
8396 /// use google_cloud_eventarc_v1::model::pipeline::mediation::Transformation;
8397 /// let x = Mediation::new().set_mediation_descriptor(Some(
8398 /// google_cloud_eventarc_v1::model::pipeline::mediation::MediationDescriptor::Transformation(Transformation::default().into())));
8399 /// ```
8400 pub fn set_mediation_descriptor<
8401 T: std::convert::Into<
8402 std::option::Option<crate::model::pipeline::mediation::MediationDescriptor>,
8403 >,
8404 >(
8405 mut self,
8406 v: T,
8407 ) -> Self {
8408 self.mediation_descriptor = v.into();
8409 self
8410 }
8411
8412 /// The value of [mediation_descriptor][crate::model::pipeline::Mediation::mediation_descriptor]
8413 /// if it holds a `Transformation`, `None` if the field is not set or
8414 /// holds a different branch.
8415 pub fn transformation(
8416 &self,
8417 ) -> std::option::Option<&std::boxed::Box<crate::model::pipeline::mediation::Transformation>>
8418 {
8419 #[allow(unreachable_patterns)]
8420 self.mediation_descriptor.as_ref().and_then(|v| match v {
8421 crate::model::pipeline::mediation::MediationDescriptor::Transformation(v) => {
8422 std::option::Option::Some(v)
8423 }
8424 _ => std::option::Option::None,
8425 })
8426 }
8427
8428 /// Sets the value of [mediation_descriptor][crate::model::pipeline::Mediation::mediation_descriptor]
8429 /// to hold a `Transformation`.
8430 ///
8431 /// Note that all the setters affecting `mediation_descriptor` are
8432 /// mutually exclusive.
8433 ///
8434 /// # Example
8435 /// ```ignore,no_run
8436 /// # use google_cloud_eventarc_v1::model::pipeline::Mediation;
8437 /// use google_cloud_eventarc_v1::model::pipeline::mediation::Transformation;
8438 /// let x = Mediation::new().set_transformation(Transformation::default()/* use setters */);
8439 /// assert!(x.transformation().is_some());
8440 /// ```
8441 pub fn set_transformation<
8442 T: std::convert::Into<std::boxed::Box<crate::model::pipeline::mediation::Transformation>>,
8443 >(
8444 mut self,
8445 v: T,
8446 ) -> Self {
8447 self.mediation_descriptor = std::option::Option::Some(
8448 crate::model::pipeline::mediation::MediationDescriptor::Transformation(v.into()),
8449 );
8450 self
8451 }
8452 }
8453
8454 impl wkt::message::Message for Mediation {
8455 fn typename() -> &'static str {
8456 "type.googleapis.com/google.cloud.eventarc.v1.Pipeline.Mediation"
8457 }
8458 }
8459
8460 /// Defines additional types related to [Mediation].
8461 pub mod mediation {
8462 #[allow(unused_imports)]
8463 use super::*;
8464
8465 /// Transformation defines the way to transform an incoming message.
8466 #[derive(Clone, Default, PartialEq)]
8467 #[non_exhaustive]
8468 pub struct Transformation {
8469 /// Optional. The CEL expression template to apply to transform messages.
8470 /// The following CEL extension functions are provided for
8471 /// use in this CEL expression:
8472 ///
8473 /// - merge:
8474 /// map1.merge(map2) -> map3
8475 /// - Merges the passed CEL map with the existing CEL map the
8476 /// function is applied to.
8477 /// - If the same key exists in both maps, if the key's value is type
8478 /// map both maps are merged else the value from the passed map is
8479 /// used.
8480 /// - denormalize:
8481 /// map.denormalize() -> map
8482 /// - Denormalizes a CEL map such that every value of type map or key
8483 /// in the map is expanded to return a single level map.
8484 /// - The resulting keys are "." separated indices of the map keys.
8485 /// - For example:
8486 /// {
8487 /// "a": 1,
8488 /// "b": {
8489 /// "c": 2,
8490 /// "d": 3
8491 /// }
8492 /// "e": [4, 5]
8493 /// }
8494 /// .denormalize()
8495 /// -> {
8496 /// "a": 1,
8497 /// "b.c": 2,
8498 /// "b.d": 3,
8499 /// "e.0": 4,
8500 /// "e.1": 5
8501 /// }
8502 /// - setField:
8503 /// map.setField(key, value) -> message
8504 /// - Sets the field of the message with the given key to the
8505 /// given value.
8506 /// - If the field is not present it will be added.
8507 /// - If the field is present it will be overwritten.
8508 /// - The key can be a dot separated path to set a field in a nested
8509 /// message.
8510 /// - Key must be of type string.
8511 /// - Value may be any valid type.
8512 /// - removeFields:
8513 /// map.removeFields([key1, key2, ...]) -> message
8514 /// - Removes the fields of the map with the given keys.
8515 /// - The keys can be a dot separated path to remove a field in a
8516 /// nested message.
8517 /// - If a key is not found it will be ignored.
8518 /// - Keys must be of type string.
8519 /// - toMap:
8520 /// [map1, map2, ...].toMap() -> map
8521 /// - Converts a CEL list of CEL maps to a single CEL map
8522 /// - toDestinationPayloadFormat():
8523 /// message.data.toDestinationPayloadFormat() -> string or bytes
8524 /// - Converts the message data to the destination payload format
8525 /// specified in Pipeline.Destination.output_payload_format
8526 /// - This function is meant to be applied to the message.data field.
8527 /// - If the destination payload format is not set, the function will
8528 /// return the message data unchanged.
8529 /// - toCloudEventJsonWithPayloadFormat:
8530 /// message.toCloudEventJsonWithPayloadFormat() -> map
8531 /// - Converts a message to the corresponding structure of JSON
8532 /// format for CloudEvents
8533 /// - This function applies toDestinationPayloadFormat() to the
8534 /// message data. It also sets the corresponding datacontenttype of
8535 /// the CloudEvent, as indicated by
8536 /// Pipeline.Destination.output_payload_format. If no
8537 /// output_payload_format is set it will use the existing
8538 /// datacontenttype on the CloudEvent if present, else leave
8539 /// datacontenttype absent.
8540 /// - This function expects that the content of the message will
8541 /// adhere to the standard CloudEvent format. If it doesn't then this
8542 /// function will fail.
8543 /// - The result is a CEL map that corresponds to the JSON
8544 /// representation of the CloudEvent. To convert that data to a JSON
8545 /// string it can be chained with the toJsonString function.
8546 pub transformation_template: std::string::String,
8547
8548 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8549 }
8550
8551 impl Transformation {
8552 /// Creates a new default instance.
8553 pub fn new() -> Self {
8554 std::default::Default::default()
8555 }
8556
8557 /// Sets the value of [transformation_template][crate::model::pipeline::mediation::Transformation::transformation_template].
8558 ///
8559 /// # Example
8560 /// ```ignore,no_run
8561 /// # use google_cloud_eventarc_v1::model::pipeline::mediation::Transformation;
8562 /// let x = Transformation::new().set_transformation_template("example");
8563 /// ```
8564 pub fn set_transformation_template<T: std::convert::Into<std::string::String>>(
8565 mut self,
8566 v: T,
8567 ) -> Self {
8568 self.transformation_template = v.into();
8569 self
8570 }
8571 }
8572
8573 impl wkt::message::Message for Transformation {
8574 fn typename() -> &'static str {
8575 "type.googleapis.com/google.cloud.eventarc.v1.Pipeline.Mediation.Transformation"
8576 }
8577 }
8578
8579 /// The config of mediation.
8580 #[derive(Clone, Debug, PartialEq)]
8581 #[non_exhaustive]
8582 pub enum MediationDescriptor {
8583 /// Optional. How the Pipeline is to transform messages
8584 Transformation(std::boxed::Box<crate::model::pipeline::mediation::Transformation>),
8585 }
8586 }
8587
8588 /// The retry policy configuration for the Pipeline. The pipeline
8589 /// exponentially backs off in case the destination is non responsive or
8590 /// returns a retryable error code. The default semantics are as follows:
8591 /// The backoff starts with a 5 second delay and doubles the
8592 /// delay after each failed attempt (10 seconds, 20 seconds, 40 seconds, etc.).
8593 /// The delay is capped at 60 seconds by default.
8594 /// Please note that if you set the min_retry_delay and max_retry_delay fields
8595 /// to the same value this will make the duration between retries constant.
8596 #[derive(Clone, Default, PartialEq)]
8597 #[non_exhaustive]
8598 pub struct RetryPolicy {
8599 /// Optional. The maximum number of delivery attempts for any message. The
8600 /// value must be between 1 and 100. The default value for this field is 5.
8601 pub max_attempts: i32,
8602
8603 /// Optional. The minimum amount of seconds to wait between retry attempts.
8604 /// The value must be between 1 and 600. The default value for this field
8605 /// is 5.
8606 pub min_retry_delay: std::option::Option<wkt::Duration>,
8607
8608 /// Optional. The maximum amount of seconds to wait between retry attempts.
8609 /// The value must be between 1 and 600. The default value for this field
8610 /// is 60.
8611 pub max_retry_delay: std::option::Option<wkt::Duration>,
8612
8613 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8614 }
8615
8616 impl RetryPolicy {
8617 /// Creates a new default instance.
8618 pub fn new() -> Self {
8619 std::default::Default::default()
8620 }
8621
8622 /// Sets the value of [max_attempts][crate::model::pipeline::RetryPolicy::max_attempts].
8623 ///
8624 /// # Example
8625 /// ```ignore,no_run
8626 /// # use google_cloud_eventarc_v1::model::pipeline::RetryPolicy;
8627 /// let x = RetryPolicy::new().set_max_attempts(42);
8628 /// ```
8629 pub fn set_max_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8630 self.max_attempts = v.into();
8631 self
8632 }
8633
8634 /// Sets the value of [min_retry_delay][crate::model::pipeline::RetryPolicy::min_retry_delay].
8635 ///
8636 /// # Example
8637 /// ```ignore,no_run
8638 /// # use google_cloud_eventarc_v1::model::pipeline::RetryPolicy;
8639 /// use wkt::Duration;
8640 /// let x = RetryPolicy::new().set_min_retry_delay(Duration::default()/* use setters */);
8641 /// ```
8642 pub fn set_min_retry_delay<T>(mut self, v: T) -> Self
8643 where
8644 T: std::convert::Into<wkt::Duration>,
8645 {
8646 self.min_retry_delay = std::option::Option::Some(v.into());
8647 self
8648 }
8649
8650 /// Sets or clears the value of [min_retry_delay][crate::model::pipeline::RetryPolicy::min_retry_delay].
8651 ///
8652 /// # Example
8653 /// ```ignore,no_run
8654 /// # use google_cloud_eventarc_v1::model::pipeline::RetryPolicy;
8655 /// use wkt::Duration;
8656 /// let x = RetryPolicy::new().set_or_clear_min_retry_delay(Some(Duration::default()/* use setters */));
8657 /// let x = RetryPolicy::new().set_or_clear_min_retry_delay(None::<Duration>);
8658 /// ```
8659 pub fn set_or_clear_min_retry_delay<T>(mut self, v: std::option::Option<T>) -> Self
8660 where
8661 T: std::convert::Into<wkt::Duration>,
8662 {
8663 self.min_retry_delay = v.map(|x| x.into());
8664 self
8665 }
8666
8667 /// Sets the value of [max_retry_delay][crate::model::pipeline::RetryPolicy::max_retry_delay].
8668 ///
8669 /// # Example
8670 /// ```ignore,no_run
8671 /// # use google_cloud_eventarc_v1::model::pipeline::RetryPolicy;
8672 /// use wkt::Duration;
8673 /// let x = RetryPolicy::new().set_max_retry_delay(Duration::default()/* use setters */);
8674 /// ```
8675 pub fn set_max_retry_delay<T>(mut self, v: T) -> Self
8676 where
8677 T: std::convert::Into<wkt::Duration>,
8678 {
8679 self.max_retry_delay = std::option::Option::Some(v.into());
8680 self
8681 }
8682
8683 /// Sets or clears the value of [max_retry_delay][crate::model::pipeline::RetryPolicy::max_retry_delay].
8684 ///
8685 /// # Example
8686 /// ```ignore,no_run
8687 /// # use google_cloud_eventarc_v1::model::pipeline::RetryPolicy;
8688 /// use wkt::Duration;
8689 /// let x = RetryPolicy::new().set_or_clear_max_retry_delay(Some(Duration::default()/* use setters */));
8690 /// let x = RetryPolicy::new().set_or_clear_max_retry_delay(None::<Duration>);
8691 /// ```
8692 pub fn set_or_clear_max_retry_delay<T>(mut self, v: std::option::Option<T>) -> Self
8693 where
8694 T: std::convert::Into<wkt::Duration>,
8695 {
8696 self.max_retry_delay = v.map(|x| x.into());
8697 self
8698 }
8699 }
8700
8701 impl wkt::message::Message for RetryPolicy {
8702 fn typename() -> &'static str {
8703 "type.googleapis.com/google.cloud.eventarc.v1.Pipeline.RetryPolicy"
8704 }
8705 }
8706}
8707
8708/// A representation of the trigger resource.
8709#[derive(Clone, Default, PartialEq)]
8710#[non_exhaustive]
8711pub struct Trigger {
8712 /// Required. The resource name of the trigger. Must be unique within the
8713 /// location of the project and must be in
8714 /// `projects/{project}/locations/{location}/triggers/{trigger}` format.
8715 pub name: std::string::String,
8716
8717 /// Output only. Server-assigned unique identifier for the trigger. The value
8718 /// is a UUID4 string and guaranteed to remain unchanged until the resource is
8719 /// deleted.
8720 pub uid: std::string::String,
8721
8722 /// Output only. The creation time.
8723 pub create_time: std::option::Option<wkt::Timestamp>,
8724
8725 /// Output only. The last-modified time.
8726 pub update_time: std::option::Option<wkt::Timestamp>,
8727
8728 /// Required. Unordered list. The list of filters that applies to event
8729 /// attributes. Only events that match all the provided filters are sent to the
8730 /// destination.
8731 pub event_filters: std::vec::Vec<crate::model::EventFilter>,
8732
8733 /// Optional. The IAM service account email associated with the trigger. The
8734 /// service account represents the identity of the trigger.
8735 ///
8736 /// The `iam.serviceAccounts.actAs` permission must be granted on the service
8737 /// account to allow a principal to impersonate the service account. For more
8738 /// information, see the
8739 /// [Roles and permissions](/eventarc/docs/all-roles-permissions) page specific
8740 /// to the trigger destination.
8741 pub service_account: std::string::String,
8742
8743 /// Required. Destination specifies where the events should be sent to.
8744 pub destination: std::option::Option<crate::model::Destination>,
8745
8746 /// Optional. To deliver messages, Eventarc might use other Google Cloud
8747 /// products as a transport intermediary. This field contains a reference to
8748 /// that transport intermediary. This information can be used for debugging
8749 /// purposes.
8750 pub transport: std::option::Option<crate::model::Transport>,
8751
8752 /// Optional. User labels attached to the triggers that can be used to group
8753 /// resources.
8754 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8755
8756 /// Optional. The name of the channel associated with the trigger in
8757 /// `projects/{project}/locations/{location}/channels/{channel}` format.
8758 /// You must provide a channel to receive events from Eventarc SaaS partners.
8759 pub channel: std::string::String,
8760
8761 /// Output only. The reason(s) why a trigger is in FAILED state.
8762 pub conditions: std::collections::HashMap<std::string::String, crate::model::StateCondition>,
8763
8764 /// Optional. EventDataContentType specifies the type of payload in MIME
8765 /// format that is expected from the CloudEvent data field. This is set to
8766 /// `application/json` if the value is not defined.
8767 pub event_data_content_type: std::string::String,
8768
8769 /// Output only. Whether or not this Trigger satisfies the requirements of
8770 /// physical zone separation
8771 pub satisfies_pzs: bool,
8772
8773 /// Optional. The retry policy to use in the Trigger.
8774 ///
8775 /// If unset, event delivery will be retried for up to 24 hours by default:
8776 /// <https://cloud.google.com/eventarc/docs/retry-events>
8777 pub retry_policy: std::option::Option<crate::model::trigger::RetryPolicy>,
8778
8779 /// Output only. This checksum is computed by the server based on the value of
8780 /// other fields, and might be sent only on create requests to ensure that the
8781 /// client has an up-to-date value before proceeding.
8782 pub etag: std::string::String,
8783
8784 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8785}
8786
8787impl Trigger {
8788 /// Creates a new default instance.
8789 pub fn new() -> Self {
8790 std::default::Default::default()
8791 }
8792
8793 /// Sets the value of [name][crate::model::Trigger::name].
8794 ///
8795 /// # Example
8796 /// ```ignore,no_run
8797 /// # use google_cloud_eventarc_v1::model::Trigger;
8798 /// # let project_id = "project_id";
8799 /// # let location_id = "location_id";
8800 /// # let trigger_id = "trigger_id";
8801 /// let x = Trigger::new().set_name(format!("projects/{project_id}/locations/{location_id}/triggers/{trigger_id}"));
8802 /// ```
8803 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8804 self.name = v.into();
8805 self
8806 }
8807
8808 /// Sets the value of [uid][crate::model::Trigger::uid].
8809 ///
8810 /// # Example
8811 /// ```ignore,no_run
8812 /// # use google_cloud_eventarc_v1::model::Trigger;
8813 /// let x = Trigger::new().set_uid("example");
8814 /// ```
8815 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8816 self.uid = v.into();
8817 self
8818 }
8819
8820 /// Sets the value of [create_time][crate::model::Trigger::create_time].
8821 ///
8822 /// # Example
8823 /// ```ignore,no_run
8824 /// # use google_cloud_eventarc_v1::model::Trigger;
8825 /// use wkt::Timestamp;
8826 /// let x = Trigger::new().set_create_time(Timestamp::default()/* use setters */);
8827 /// ```
8828 pub fn set_create_time<T>(mut self, v: T) -> Self
8829 where
8830 T: std::convert::Into<wkt::Timestamp>,
8831 {
8832 self.create_time = std::option::Option::Some(v.into());
8833 self
8834 }
8835
8836 /// Sets or clears the value of [create_time][crate::model::Trigger::create_time].
8837 ///
8838 /// # Example
8839 /// ```ignore,no_run
8840 /// # use google_cloud_eventarc_v1::model::Trigger;
8841 /// use wkt::Timestamp;
8842 /// let x = Trigger::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8843 /// let x = Trigger::new().set_or_clear_create_time(None::<Timestamp>);
8844 /// ```
8845 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8846 where
8847 T: std::convert::Into<wkt::Timestamp>,
8848 {
8849 self.create_time = v.map(|x| x.into());
8850 self
8851 }
8852
8853 /// Sets the value of [update_time][crate::model::Trigger::update_time].
8854 ///
8855 /// # Example
8856 /// ```ignore,no_run
8857 /// # use google_cloud_eventarc_v1::model::Trigger;
8858 /// use wkt::Timestamp;
8859 /// let x = Trigger::new().set_update_time(Timestamp::default()/* use setters */);
8860 /// ```
8861 pub fn set_update_time<T>(mut self, v: T) -> Self
8862 where
8863 T: std::convert::Into<wkt::Timestamp>,
8864 {
8865 self.update_time = std::option::Option::Some(v.into());
8866 self
8867 }
8868
8869 /// Sets or clears the value of [update_time][crate::model::Trigger::update_time].
8870 ///
8871 /// # Example
8872 /// ```ignore,no_run
8873 /// # use google_cloud_eventarc_v1::model::Trigger;
8874 /// use wkt::Timestamp;
8875 /// let x = Trigger::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8876 /// let x = Trigger::new().set_or_clear_update_time(None::<Timestamp>);
8877 /// ```
8878 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8879 where
8880 T: std::convert::Into<wkt::Timestamp>,
8881 {
8882 self.update_time = v.map(|x| x.into());
8883 self
8884 }
8885
8886 /// Sets the value of [event_filters][crate::model::Trigger::event_filters].
8887 ///
8888 /// # Example
8889 /// ```ignore,no_run
8890 /// # use google_cloud_eventarc_v1::model::Trigger;
8891 /// use google_cloud_eventarc_v1::model::EventFilter;
8892 /// let x = Trigger::new()
8893 /// .set_event_filters([
8894 /// EventFilter::default()/* use setters */,
8895 /// EventFilter::default()/* use (different) setters */,
8896 /// ]);
8897 /// ```
8898 pub fn set_event_filters<T, V>(mut self, v: T) -> Self
8899 where
8900 T: std::iter::IntoIterator<Item = V>,
8901 V: std::convert::Into<crate::model::EventFilter>,
8902 {
8903 use std::iter::Iterator;
8904 self.event_filters = v.into_iter().map(|i| i.into()).collect();
8905 self
8906 }
8907
8908 /// Sets the value of [service_account][crate::model::Trigger::service_account].
8909 ///
8910 /// # Example
8911 /// ```ignore,no_run
8912 /// # use google_cloud_eventarc_v1::model::Trigger;
8913 /// let x = Trigger::new().set_service_account("example");
8914 /// ```
8915 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8916 self.service_account = v.into();
8917 self
8918 }
8919
8920 /// Sets the value of [destination][crate::model::Trigger::destination].
8921 ///
8922 /// # Example
8923 /// ```ignore,no_run
8924 /// # use google_cloud_eventarc_v1::model::Trigger;
8925 /// use google_cloud_eventarc_v1::model::Destination;
8926 /// let x = Trigger::new().set_destination(Destination::default()/* use setters */);
8927 /// ```
8928 pub fn set_destination<T>(mut self, v: T) -> Self
8929 where
8930 T: std::convert::Into<crate::model::Destination>,
8931 {
8932 self.destination = std::option::Option::Some(v.into());
8933 self
8934 }
8935
8936 /// Sets or clears the value of [destination][crate::model::Trigger::destination].
8937 ///
8938 /// # Example
8939 /// ```ignore,no_run
8940 /// # use google_cloud_eventarc_v1::model::Trigger;
8941 /// use google_cloud_eventarc_v1::model::Destination;
8942 /// let x = Trigger::new().set_or_clear_destination(Some(Destination::default()/* use setters */));
8943 /// let x = Trigger::new().set_or_clear_destination(None::<Destination>);
8944 /// ```
8945 pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
8946 where
8947 T: std::convert::Into<crate::model::Destination>,
8948 {
8949 self.destination = v.map(|x| x.into());
8950 self
8951 }
8952
8953 /// Sets the value of [transport][crate::model::Trigger::transport].
8954 ///
8955 /// # Example
8956 /// ```ignore,no_run
8957 /// # use google_cloud_eventarc_v1::model::Trigger;
8958 /// use google_cloud_eventarc_v1::model::Transport;
8959 /// let x = Trigger::new().set_transport(Transport::default()/* use setters */);
8960 /// ```
8961 pub fn set_transport<T>(mut self, v: T) -> Self
8962 where
8963 T: std::convert::Into<crate::model::Transport>,
8964 {
8965 self.transport = std::option::Option::Some(v.into());
8966 self
8967 }
8968
8969 /// Sets or clears the value of [transport][crate::model::Trigger::transport].
8970 ///
8971 /// # Example
8972 /// ```ignore,no_run
8973 /// # use google_cloud_eventarc_v1::model::Trigger;
8974 /// use google_cloud_eventarc_v1::model::Transport;
8975 /// let x = Trigger::new().set_or_clear_transport(Some(Transport::default()/* use setters */));
8976 /// let x = Trigger::new().set_or_clear_transport(None::<Transport>);
8977 /// ```
8978 pub fn set_or_clear_transport<T>(mut self, v: std::option::Option<T>) -> Self
8979 where
8980 T: std::convert::Into<crate::model::Transport>,
8981 {
8982 self.transport = v.map(|x| x.into());
8983 self
8984 }
8985
8986 /// Sets the value of [labels][crate::model::Trigger::labels].
8987 ///
8988 /// # Example
8989 /// ```ignore,no_run
8990 /// # use google_cloud_eventarc_v1::model::Trigger;
8991 /// let x = Trigger::new().set_labels([
8992 /// ("key0", "abc"),
8993 /// ("key1", "xyz"),
8994 /// ]);
8995 /// ```
8996 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8997 where
8998 T: std::iter::IntoIterator<Item = (K, V)>,
8999 K: std::convert::Into<std::string::String>,
9000 V: std::convert::Into<std::string::String>,
9001 {
9002 use std::iter::Iterator;
9003 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9004 self
9005 }
9006
9007 /// Sets the value of [channel][crate::model::Trigger::channel].
9008 ///
9009 /// # Example
9010 /// ```ignore,no_run
9011 /// # use google_cloud_eventarc_v1::model::Trigger;
9012 /// let x = Trigger::new().set_channel("example");
9013 /// ```
9014 pub fn set_channel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9015 self.channel = v.into();
9016 self
9017 }
9018
9019 /// Sets the value of [conditions][crate::model::Trigger::conditions].
9020 ///
9021 /// # Example
9022 /// ```ignore,no_run
9023 /// # use google_cloud_eventarc_v1::model::Trigger;
9024 /// use google_cloud_eventarc_v1::model::StateCondition;
9025 /// let x = Trigger::new().set_conditions([
9026 /// ("key0", StateCondition::default()/* use setters */),
9027 /// ("key1", StateCondition::default()/* use (different) setters */),
9028 /// ]);
9029 /// ```
9030 pub fn set_conditions<T, K, V>(mut self, v: T) -> Self
9031 where
9032 T: std::iter::IntoIterator<Item = (K, V)>,
9033 K: std::convert::Into<std::string::String>,
9034 V: std::convert::Into<crate::model::StateCondition>,
9035 {
9036 use std::iter::Iterator;
9037 self.conditions = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9038 self
9039 }
9040
9041 /// Sets the value of [event_data_content_type][crate::model::Trigger::event_data_content_type].
9042 ///
9043 /// # Example
9044 /// ```ignore,no_run
9045 /// # use google_cloud_eventarc_v1::model::Trigger;
9046 /// let x = Trigger::new().set_event_data_content_type("example");
9047 /// ```
9048 pub fn set_event_data_content_type<T: std::convert::Into<std::string::String>>(
9049 mut self,
9050 v: T,
9051 ) -> Self {
9052 self.event_data_content_type = v.into();
9053 self
9054 }
9055
9056 /// Sets the value of [satisfies_pzs][crate::model::Trigger::satisfies_pzs].
9057 ///
9058 /// # Example
9059 /// ```ignore,no_run
9060 /// # use google_cloud_eventarc_v1::model::Trigger;
9061 /// let x = Trigger::new().set_satisfies_pzs(true);
9062 /// ```
9063 pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9064 self.satisfies_pzs = v.into();
9065 self
9066 }
9067
9068 /// Sets the value of [retry_policy][crate::model::Trigger::retry_policy].
9069 ///
9070 /// # Example
9071 /// ```ignore,no_run
9072 /// # use google_cloud_eventarc_v1::model::Trigger;
9073 /// use google_cloud_eventarc_v1::model::trigger::RetryPolicy;
9074 /// let x = Trigger::new().set_retry_policy(RetryPolicy::default()/* use setters */);
9075 /// ```
9076 pub fn set_retry_policy<T>(mut self, v: T) -> Self
9077 where
9078 T: std::convert::Into<crate::model::trigger::RetryPolicy>,
9079 {
9080 self.retry_policy = std::option::Option::Some(v.into());
9081 self
9082 }
9083
9084 /// Sets or clears the value of [retry_policy][crate::model::Trigger::retry_policy].
9085 ///
9086 /// # Example
9087 /// ```ignore,no_run
9088 /// # use google_cloud_eventarc_v1::model::Trigger;
9089 /// use google_cloud_eventarc_v1::model::trigger::RetryPolicy;
9090 /// let x = Trigger::new().set_or_clear_retry_policy(Some(RetryPolicy::default()/* use setters */));
9091 /// let x = Trigger::new().set_or_clear_retry_policy(None::<RetryPolicy>);
9092 /// ```
9093 pub fn set_or_clear_retry_policy<T>(mut self, v: std::option::Option<T>) -> Self
9094 where
9095 T: std::convert::Into<crate::model::trigger::RetryPolicy>,
9096 {
9097 self.retry_policy = v.map(|x| x.into());
9098 self
9099 }
9100
9101 /// Sets the value of [etag][crate::model::Trigger::etag].
9102 ///
9103 /// # Example
9104 /// ```ignore,no_run
9105 /// # use google_cloud_eventarc_v1::model::Trigger;
9106 /// let x = Trigger::new().set_etag("example");
9107 /// ```
9108 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9109 self.etag = v.into();
9110 self
9111 }
9112}
9113
9114impl wkt::message::Message for Trigger {
9115 fn typename() -> &'static str {
9116 "type.googleapis.com/google.cloud.eventarc.v1.Trigger"
9117 }
9118}
9119
9120/// Defines additional types related to [Trigger].
9121pub mod trigger {
9122 #[allow(unused_imports)]
9123 use super::*;
9124
9125 /// The retry policy configuration for the Trigger.
9126 ///
9127 /// Can only be set with Cloud Run destinations.
9128 #[derive(Clone, Default, PartialEq)]
9129 #[non_exhaustive]
9130 pub struct RetryPolicy {
9131 /// Optional. The maximum number of delivery attempts for any message. The
9132 /// only valid value is 1.
9133 pub max_attempts: i32,
9134
9135 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9136 }
9137
9138 impl RetryPolicy {
9139 /// Creates a new default instance.
9140 pub fn new() -> Self {
9141 std::default::Default::default()
9142 }
9143
9144 /// Sets the value of [max_attempts][crate::model::trigger::RetryPolicy::max_attempts].
9145 ///
9146 /// # Example
9147 /// ```ignore,no_run
9148 /// # use google_cloud_eventarc_v1::model::trigger::RetryPolicy;
9149 /// let x = RetryPolicy::new().set_max_attempts(42);
9150 /// ```
9151 pub fn set_max_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9152 self.max_attempts = v.into();
9153 self
9154 }
9155 }
9156
9157 impl wkt::message::Message for RetryPolicy {
9158 fn typename() -> &'static str {
9159 "type.googleapis.com/google.cloud.eventarc.v1.Trigger.RetryPolicy"
9160 }
9161 }
9162}
9163
9164/// Filters events based on exact matches on the CloudEvents attributes.
9165#[derive(Clone, Default, PartialEq)]
9166#[non_exhaustive]
9167pub struct EventFilter {
9168 /// Required. The name of a CloudEvents attribute. Currently, only a subset of
9169 /// attributes are supported for filtering. You can [retrieve a specific
9170 /// provider's supported event
9171 /// types](/eventarc/docs/list-providers#describe-provider).
9172 ///
9173 /// All triggers MUST provide a filter for the 'type' attribute.
9174 pub attribute: std::string::String,
9175
9176 /// Required. The value for the attribute.
9177 pub value: std::string::String,
9178
9179 /// Optional. The operator used for matching the events with the value of the
9180 /// filter. If not specified, only events that have an exact key-value pair
9181 /// specified in the filter are matched. The allowed values are `path_pattern`
9182 /// and `match-path-pattern`. `path_pattern` is only allowed for GCFv1
9183 /// triggers.
9184 pub operator: std::string::String,
9185
9186 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9187}
9188
9189impl EventFilter {
9190 /// Creates a new default instance.
9191 pub fn new() -> Self {
9192 std::default::Default::default()
9193 }
9194
9195 /// Sets the value of [attribute][crate::model::EventFilter::attribute].
9196 ///
9197 /// # Example
9198 /// ```ignore,no_run
9199 /// # use google_cloud_eventarc_v1::model::EventFilter;
9200 /// let x = EventFilter::new().set_attribute("example");
9201 /// ```
9202 pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9203 self.attribute = v.into();
9204 self
9205 }
9206
9207 /// Sets the value of [value][crate::model::EventFilter::value].
9208 ///
9209 /// # Example
9210 /// ```ignore,no_run
9211 /// # use google_cloud_eventarc_v1::model::EventFilter;
9212 /// let x = EventFilter::new().set_value("example");
9213 /// ```
9214 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9215 self.value = v.into();
9216 self
9217 }
9218
9219 /// Sets the value of [operator][crate::model::EventFilter::operator].
9220 ///
9221 /// # Example
9222 /// ```ignore,no_run
9223 /// # use google_cloud_eventarc_v1::model::EventFilter;
9224 /// let x = EventFilter::new().set_operator("example");
9225 /// ```
9226 pub fn set_operator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9227 self.operator = v.into();
9228 self
9229 }
9230}
9231
9232impl wkt::message::Message for EventFilter {
9233 fn typename() -> &'static str {
9234 "type.googleapis.com/google.cloud.eventarc.v1.EventFilter"
9235 }
9236}
9237
9238/// A condition that is part of the trigger state computation.
9239#[derive(Clone, Default, PartialEq)]
9240#[non_exhaustive]
9241pub struct StateCondition {
9242 /// The canonical code of the condition.
9243 pub code: google_cloud_rpc::model::Code,
9244
9245 /// Human-readable message.
9246 pub message: std::string::String,
9247
9248 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9249}
9250
9251impl StateCondition {
9252 /// Creates a new default instance.
9253 pub fn new() -> Self {
9254 std::default::Default::default()
9255 }
9256
9257 /// Sets the value of [code][crate::model::StateCondition::code].
9258 ///
9259 /// # Example
9260 /// ```ignore,no_run
9261 /// # use google_cloud_eventarc_v1::model::StateCondition;
9262 /// use google_cloud_rpc::model::Code;
9263 /// let x0 = StateCondition::new().set_code(Code::Cancelled);
9264 /// let x1 = StateCondition::new().set_code(Code::Unknown);
9265 /// let x2 = StateCondition::new().set_code(Code::InvalidArgument);
9266 /// ```
9267 pub fn set_code<T: std::convert::Into<google_cloud_rpc::model::Code>>(mut self, v: T) -> Self {
9268 self.code = v.into();
9269 self
9270 }
9271
9272 /// Sets the value of [message][crate::model::StateCondition::message].
9273 ///
9274 /// # Example
9275 /// ```ignore,no_run
9276 /// # use google_cloud_eventarc_v1::model::StateCondition;
9277 /// let x = StateCondition::new().set_message("example");
9278 /// ```
9279 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9280 self.message = v.into();
9281 self
9282 }
9283}
9284
9285impl wkt::message::Message for StateCondition {
9286 fn typename() -> &'static str {
9287 "type.googleapis.com/google.cloud.eventarc.v1.StateCondition"
9288 }
9289}
9290
9291/// Represents a target of an invocation over HTTP.
9292#[derive(Clone, Default, PartialEq)]
9293#[non_exhaustive]
9294pub struct Destination {
9295 /// Optional. Network config is used to configure how Eventarc resolves and
9296 /// connect to a destination.
9297 /// This should only be used with HttpEndpoint destination type.
9298 pub network_config: std::option::Option<crate::model::NetworkConfig>,
9299
9300 #[allow(missing_docs)]
9301 pub descriptor: std::option::Option<crate::model::destination::Descriptor>,
9302
9303 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9304}
9305
9306impl Destination {
9307 /// Creates a new default instance.
9308 pub fn new() -> Self {
9309 std::default::Default::default()
9310 }
9311
9312 /// Sets the value of [network_config][crate::model::Destination::network_config].
9313 ///
9314 /// # Example
9315 /// ```ignore,no_run
9316 /// # use google_cloud_eventarc_v1::model::Destination;
9317 /// use google_cloud_eventarc_v1::model::NetworkConfig;
9318 /// let x = Destination::new().set_network_config(NetworkConfig::default()/* use setters */);
9319 /// ```
9320 pub fn set_network_config<T>(mut self, v: T) -> Self
9321 where
9322 T: std::convert::Into<crate::model::NetworkConfig>,
9323 {
9324 self.network_config = std::option::Option::Some(v.into());
9325 self
9326 }
9327
9328 /// Sets or clears the value of [network_config][crate::model::Destination::network_config].
9329 ///
9330 /// # Example
9331 /// ```ignore,no_run
9332 /// # use google_cloud_eventarc_v1::model::Destination;
9333 /// use google_cloud_eventarc_v1::model::NetworkConfig;
9334 /// let x = Destination::new().set_or_clear_network_config(Some(NetworkConfig::default()/* use setters */));
9335 /// let x = Destination::new().set_or_clear_network_config(None::<NetworkConfig>);
9336 /// ```
9337 pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
9338 where
9339 T: std::convert::Into<crate::model::NetworkConfig>,
9340 {
9341 self.network_config = v.map(|x| x.into());
9342 self
9343 }
9344
9345 /// Sets the value of [descriptor][crate::model::Destination::descriptor].
9346 ///
9347 /// Note that all the setters affecting `descriptor` are mutually
9348 /// exclusive.
9349 ///
9350 /// # Example
9351 /// ```ignore,no_run
9352 /// # use google_cloud_eventarc_v1::model::Destination;
9353 /// use google_cloud_eventarc_v1::model::destination::Descriptor;
9354 /// let x = Destination::new().set_descriptor(Some(Descriptor::CloudFunction("example".to_string())));
9355 /// ```
9356 pub fn set_descriptor<
9357 T: std::convert::Into<std::option::Option<crate::model::destination::Descriptor>>,
9358 >(
9359 mut self,
9360 v: T,
9361 ) -> Self {
9362 self.descriptor = v.into();
9363 self
9364 }
9365
9366 /// The value of [descriptor][crate::model::Destination::descriptor]
9367 /// if it holds a `CloudRun`, `None` if the field is not set or
9368 /// holds a different branch.
9369 pub fn cloud_run(&self) -> std::option::Option<&std::boxed::Box<crate::model::CloudRun>> {
9370 #[allow(unreachable_patterns)]
9371 self.descriptor.as_ref().and_then(|v| match v {
9372 crate::model::destination::Descriptor::CloudRun(v) => std::option::Option::Some(v),
9373 _ => std::option::Option::None,
9374 })
9375 }
9376
9377 /// Sets the value of [descriptor][crate::model::Destination::descriptor]
9378 /// to hold a `CloudRun`.
9379 ///
9380 /// Note that all the setters affecting `descriptor` are
9381 /// mutually exclusive.
9382 ///
9383 /// # Example
9384 /// ```ignore,no_run
9385 /// # use google_cloud_eventarc_v1::model::Destination;
9386 /// use google_cloud_eventarc_v1::model::CloudRun;
9387 /// let x = Destination::new().set_cloud_run(CloudRun::default()/* use setters */);
9388 /// assert!(x.cloud_run().is_some());
9389 /// assert!(x.cloud_function().is_none());
9390 /// assert!(x.gke().is_none());
9391 /// assert!(x.workflow().is_none());
9392 /// assert!(x.http_endpoint().is_none());
9393 /// ```
9394 pub fn set_cloud_run<T: std::convert::Into<std::boxed::Box<crate::model::CloudRun>>>(
9395 mut self,
9396 v: T,
9397 ) -> Self {
9398 self.descriptor =
9399 std::option::Option::Some(crate::model::destination::Descriptor::CloudRun(v.into()));
9400 self
9401 }
9402
9403 /// The value of [descriptor][crate::model::Destination::descriptor]
9404 /// if it holds a `CloudFunction`, `None` if the field is not set or
9405 /// holds a different branch.
9406 pub fn cloud_function(&self) -> std::option::Option<&std::string::String> {
9407 #[allow(unreachable_patterns)]
9408 self.descriptor.as_ref().and_then(|v| match v {
9409 crate::model::destination::Descriptor::CloudFunction(v) => std::option::Option::Some(v),
9410 _ => std::option::Option::None,
9411 })
9412 }
9413
9414 /// Sets the value of [descriptor][crate::model::Destination::descriptor]
9415 /// to hold a `CloudFunction`.
9416 ///
9417 /// Note that all the setters affecting `descriptor` are
9418 /// mutually exclusive.
9419 ///
9420 /// # Example
9421 /// ```ignore,no_run
9422 /// # use google_cloud_eventarc_v1::model::Destination;
9423 /// let x = Destination::new().set_cloud_function("example");
9424 /// assert!(x.cloud_function().is_some());
9425 /// assert!(x.cloud_run().is_none());
9426 /// assert!(x.gke().is_none());
9427 /// assert!(x.workflow().is_none());
9428 /// assert!(x.http_endpoint().is_none());
9429 /// ```
9430 pub fn set_cloud_function<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9431 self.descriptor = std::option::Option::Some(
9432 crate::model::destination::Descriptor::CloudFunction(v.into()),
9433 );
9434 self
9435 }
9436
9437 /// The value of [descriptor][crate::model::Destination::descriptor]
9438 /// if it holds a `Gke`, `None` if the field is not set or
9439 /// holds a different branch.
9440 pub fn gke(&self) -> std::option::Option<&std::boxed::Box<crate::model::Gke>> {
9441 #[allow(unreachable_patterns)]
9442 self.descriptor.as_ref().and_then(|v| match v {
9443 crate::model::destination::Descriptor::Gke(v) => std::option::Option::Some(v),
9444 _ => std::option::Option::None,
9445 })
9446 }
9447
9448 /// Sets the value of [descriptor][crate::model::Destination::descriptor]
9449 /// to hold a `Gke`.
9450 ///
9451 /// Note that all the setters affecting `descriptor` are
9452 /// mutually exclusive.
9453 ///
9454 /// # Example
9455 /// ```ignore,no_run
9456 /// # use google_cloud_eventarc_v1::model::Destination;
9457 /// use google_cloud_eventarc_v1::model::Gke;
9458 /// let x = Destination::new().set_gke(Gke::default()/* use setters */);
9459 /// assert!(x.gke().is_some());
9460 /// assert!(x.cloud_run().is_none());
9461 /// assert!(x.cloud_function().is_none());
9462 /// assert!(x.workflow().is_none());
9463 /// assert!(x.http_endpoint().is_none());
9464 /// ```
9465 pub fn set_gke<T: std::convert::Into<std::boxed::Box<crate::model::Gke>>>(
9466 mut self,
9467 v: T,
9468 ) -> Self {
9469 self.descriptor =
9470 std::option::Option::Some(crate::model::destination::Descriptor::Gke(v.into()));
9471 self
9472 }
9473
9474 /// The value of [descriptor][crate::model::Destination::descriptor]
9475 /// if it holds a `Workflow`, `None` if the field is not set or
9476 /// holds a different branch.
9477 pub fn workflow(&self) -> std::option::Option<&std::string::String> {
9478 #[allow(unreachable_patterns)]
9479 self.descriptor.as_ref().and_then(|v| match v {
9480 crate::model::destination::Descriptor::Workflow(v) => std::option::Option::Some(v),
9481 _ => std::option::Option::None,
9482 })
9483 }
9484
9485 /// Sets the value of [descriptor][crate::model::Destination::descriptor]
9486 /// to hold a `Workflow`.
9487 ///
9488 /// Note that all the setters affecting `descriptor` are
9489 /// mutually exclusive.
9490 ///
9491 /// # Example
9492 /// ```ignore,no_run
9493 /// # use google_cloud_eventarc_v1::model::Destination;
9494 /// let x = Destination::new().set_workflow("example");
9495 /// assert!(x.workflow().is_some());
9496 /// assert!(x.cloud_run().is_none());
9497 /// assert!(x.cloud_function().is_none());
9498 /// assert!(x.gke().is_none());
9499 /// assert!(x.http_endpoint().is_none());
9500 /// ```
9501 pub fn set_workflow<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9502 self.descriptor =
9503 std::option::Option::Some(crate::model::destination::Descriptor::Workflow(v.into()));
9504 self
9505 }
9506
9507 /// The value of [descriptor][crate::model::Destination::descriptor]
9508 /// if it holds a `HttpEndpoint`, `None` if the field is not set or
9509 /// holds a different branch.
9510 pub fn http_endpoint(
9511 &self,
9512 ) -> std::option::Option<&std::boxed::Box<crate::model::HttpEndpoint>> {
9513 #[allow(unreachable_patterns)]
9514 self.descriptor.as_ref().and_then(|v| match v {
9515 crate::model::destination::Descriptor::HttpEndpoint(v) => std::option::Option::Some(v),
9516 _ => std::option::Option::None,
9517 })
9518 }
9519
9520 /// Sets the value of [descriptor][crate::model::Destination::descriptor]
9521 /// to hold a `HttpEndpoint`.
9522 ///
9523 /// Note that all the setters affecting `descriptor` are
9524 /// mutually exclusive.
9525 ///
9526 /// # Example
9527 /// ```ignore,no_run
9528 /// # use google_cloud_eventarc_v1::model::Destination;
9529 /// use google_cloud_eventarc_v1::model::HttpEndpoint;
9530 /// let x = Destination::new().set_http_endpoint(HttpEndpoint::default()/* use setters */);
9531 /// assert!(x.http_endpoint().is_some());
9532 /// assert!(x.cloud_run().is_none());
9533 /// assert!(x.cloud_function().is_none());
9534 /// assert!(x.gke().is_none());
9535 /// assert!(x.workflow().is_none());
9536 /// ```
9537 pub fn set_http_endpoint<T: std::convert::Into<std::boxed::Box<crate::model::HttpEndpoint>>>(
9538 mut self,
9539 v: T,
9540 ) -> Self {
9541 self.descriptor = std::option::Option::Some(
9542 crate::model::destination::Descriptor::HttpEndpoint(v.into()),
9543 );
9544 self
9545 }
9546}
9547
9548impl wkt::message::Message for Destination {
9549 fn typename() -> &'static str {
9550 "type.googleapis.com/google.cloud.eventarc.v1.Destination"
9551 }
9552}
9553
9554/// Defines additional types related to [Destination].
9555pub mod destination {
9556 #[allow(unused_imports)]
9557 use super::*;
9558
9559 #[allow(missing_docs)]
9560 #[derive(Clone, Debug, PartialEq)]
9561 #[non_exhaustive]
9562 pub enum Descriptor {
9563 /// Cloud Run fully-managed resource that receives the events. The resource
9564 /// should be in the same project as the trigger.
9565 CloudRun(std::boxed::Box<crate::model::CloudRun>),
9566 /// The Cloud Function resource name. Cloud Functions V1 and V2 are
9567 /// supported.
9568 /// Format: `projects/{project}/locations/{location}/functions/{function}`
9569 ///
9570 /// This is a read-only field. Creating Cloud Functions V1/V2 triggers is
9571 /// only supported via the Cloud Functions product. An error will be returned
9572 /// if the user sets this value.
9573 CloudFunction(std::string::String),
9574 /// A GKE service capable of receiving events. The service should be running
9575 /// in the same project as the trigger.
9576 Gke(std::boxed::Box<crate::model::Gke>),
9577 /// The resource name of the Workflow whose Executions are triggered by
9578 /// the events. The Workflow resource should be deployed in the same project
9579 /// as the trigger.
9580 /// Format: `projects/{project}/locations/{location}/workflows/{workflow}`
9581 Workflow(std::string::String),
9582 /// An HTTP endpoint destination described by an URI.
9583 HttpEndpoint(std::boxed::Box<crate::model::HttpEndpoint>),
9584 }
9585}
9586
9587/// Represents the transport intermediaries created for the trigger to
9588/// deliver events.
9589#[derive(Clone, Default, PartialEq)]
9590#[non_exhaustive]
9591pub struct Transport {
9592 #[allow(missing_docs)]
9593 pub intermediary: std::option::Option<crate::model::transport::Intermediary>,
9594
9595 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9596}
9597
9598impl Transport {
9599 /// Creates a new default instance.
9600 pub fn new() -> Self {
9601 std::default::Default::default()
9602 }
9603
9604 /// Sets the value of [intermediary][crate::model::Transport::intermediary].
9605 ///
9606 /// Note that all the setters affecting `intermediary` are mutually
9607 /// exclusive.
9608 ///
9609 /// # Example
9610 /// ```ignore,no_run
9611 /// # use google_cloud_eventarc_v1::model::Transport;
9612 /// use google_cloud_eventarc_v1::model::Pubsub;
9613 /// let x = Transport::new().set_intermediary(Some(
9614 /// google_cloud_eventarc_v1::model::transport::Intermediary::Pubsub(Pubsub::default().into())));
9615 /// ```
9616 pub fn set_intermediary<
9617 T: std::convert::Into<std::option::Option<crate::model::transport::Intermediary>>,
9618 >(
9619 mut self,
9620 v: T,
9621 ) -> Self {
9622 self.intermediary = v.into();
9623 self
9624 }
9625
9626 /// The value of [intermediary][crate::model::Transport::intermediary]
9627 /// if it holds a `Pubsub`, `None` if the field is not set or
9628 /// holds a different branch.
9629 pub fn pubsub(&self) -> std::option::Option<&std::boxed::Box<crate::model::Pubsub>> {
9630 #[allow(unreachable_patterns)]
9631 self.intermediary.as_ref().and_then(|v| match v {
9632 crate::model::transport::Intermediary::Pubsub(v) => std::option::Option::Some(v),
9633 _ => std::option::Option::None,
9634 })
9635 }
9636
9637 /// Sets the value of [intermediary][crate::model::Transport::intermediary]
9638 /// to hold a `Pubsub`.
9639 ///
9640 /// Note that all the setters affecting `intermediary` are
9641 /// mutually exclusive.
9642 ///
9643 /// # Example
9644 /// ```ignore,no_run
9645 /// # use google_cloud_eventarc_v1::model::Transport;
9646 /// use google_cloud_eventarc_v1::model::Pubsub;
9647 /// let x = Transport::new().set_pubsub(Pubsub::default()/* use setters */);
9648 /// assert!(x.pubsub().is_some());
9649 /// ```
9650 pub fn set_pubsub<T: std::convert::Into<std::boxed::Box<crate::model::Pubsub>>>(
9651 mut self,
9652 v: T,
9653 ) -> Self {
9654 self.intermediary =
9655 std::option::Option::Some(crate::model::transport::Intermediary::Pubsub(v.into()));
9656 self
9657 }
9658}
9659
9660impl wkt::message::Message for Transport {
9661 fn typename() -> &'static str {
9662 "type.googleapis.com/google.cloud.eventarc.v1.Transport"
9663 }
9664}
9665
9666/// Defines additional types related to [Transport].
9667pub mod transport {
9668 #[allow(unused_imports)]
9669 use super::*;
9670
9671 #[allow(missing_docs)]
9672 #[derive(Clone, Debug, PartialEq)]
9673 #[non_exhaustive]
9674 pub enum Intermediary {
9675 /// The Pub/Sub topic and subscription used by Eventarc as a transport
9676 /// intermediary.
9677 Pubsub(std::boxed::Box<crate::model::Pubsub>),
9678 }
9679}
9680
9681/// Represents a Cloud Run destination.
9682#[derive(Clone, Default, PartialEq)]
9683#[non_exhaustive]
9684pub struct CloudRun {
9685 /// Required. The name of the Cloud Run service being addressed. See
9686 /// <https://cloud.google.com/run/docs/reference/rest/v1/namespaces.services>.
9687 ///
9688 /// Only services located in the same project as the trigger object
9689 /// can be addressed.
9690 pub service: std::string::String,
9691
9692 /// Optional. The relative path on the Cloud Run service the events should be
9693 /// sent to.
9694 ///
9695 /// The value must conform to the definition of a URI path segment (section 3.3
9696 /// of RFC2396). Examples: "/route", "route", "route/subroute".
9697 pub path: std::string::String,
9698
9699 /// Required. The region the Cloud Run service is deployed in.
9700 pub region: std::string::String,
9701
9702 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9703}
9704
9705impl CloudRun {
9706 /// Creates a new default instance.
9707 pub fn new() -> Self {
9708 std::default::Default::default()
9709 }
9710
9711 /// Sets the value of [service][crate::model::CloudRun::service].
9712 ///
9713 /// # Example
9714 /// ```ignore,no_run
9715 /// # use google_cloud_eventarc_v1::model::CloudRun;
9716 /// let x = CloudRun::new().set_service("example");
9717 /// ```
9718 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9719 self.service = v.into();
9720 self
9721 }
9722
9723 /// Sets the value of [path][crate::model::CloudRun::path].
9724 ///
9725 /// # Example
9726 /// ```ignore,no_run
9727 /// # use google_cloud_eventarc_v1::model::CloudRun;
9728 /// let x = CloudRun::new().set_path("example");
9729 /// ```
9730 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9731 self.path = v.into();
9732 self
9733 }
9734
9735 /// Sets the value of [region][crate::model::CloudRun::region].
9736 ///
9737 /// # Example
9738 /// ```ignore,no_run
9739 /// # use google_cloud_eventarc_v1::model::CloudRun;
9740 /// let x = CloudRun::new().set_region("example");
9741 /// ```
9742 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9743 self.region = v.into();
9744 self
9745 }
9746}
9747
9748impl wkt::message::Message for CloudRun {
9749 fn typename() -> &'static str {
9750 "type.googleapis.com/google.cloud.eventarc.v1.CloudRun"
9751 }
9752}
9753
9754/// Represents a GKE destination.
9755#[derive(Clone, Default, PartialEq)]
9756#[non_exhaustive]
9757pub struct Gke {
9758 /// Required. The name of the cluster the GKE service is running in. The
9759 /// cluster must be running in the same project as the trigger being created.
9760 pub cluster: std::string::String,
9761
9762 /// Required. The name of the Google Compute Engine in which the cluster
9763 /// resides, which can either be compute zone (for example, us-central1-a) for
9764 /// the zonal clusters or region (for example, us-central1) for regional
9765 /// clusters.
9766 pub location: std::string::String,
9767
9768 /// Required. The namespace the GKE service is running in.
9769 pub namespace: std::string::String,
9770
9771 /// Required. Name of the GKE service.
9772 pub service: std::string::String,
9773
9774 /// Optional. The relative path on the GKE service the events should be sent
9775 /// to.
9776 ///
9777 /// The value must conform to the definition of a URI path segment (section 3.3
9778 /// of RFC2396). Examples: "/route", "route", "route/subroute".
9779 pub path: std::string::String,
9780
9781 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9782}
9783
9784impl Gke {
9785 /// Creates a new default instance.
9786 pub fn new() -> Self {
9787 std::default::Default::default()
9788 }
9789
9790 /// Sets the value of [cluster][crate::model::Gke::cluster].
9791 ///
9792 /// # Example
9793 /// ```ignore,no_run
9794 /// # use google_cloud_eventarc_v1::model::Gke;
9795 /// let x = Gke::new().set_cluster("example");
9796 /// ```
9797 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9798 self.cluster = v.into();
9799 self
9800 }
9801
9802 /// Sets the value of [location][crate::model::Gke::location].
9803 ///
9804 /// # Example
9805 /// ```ignore,no_run
9806 /// # use google_cloud_eventarc_v1::model::Gke;
9807 /// let x = Gke::new().set_location("example");
9808 /// ```
9809 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9810 self.location = v.into();
9811 self
9812 }
9813
9814 /// Sets the value of [namespace][crate::model::Gke::namespace].
9815 ///
9816 /// # Example
9817 /// ```ignore,no_run
9818 /// # use google_cloud_eventarc_v1::model::Gke;
9819 /// let x = Gke::new().set_namespace("example");
9820 /// ```
9821 pub fn set_namespace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9822 self.namespace = v.into();
9823 self
9824 }
9825
9826 /// Sets the value of [service][crate::model::Gke::service].
9827 ///
9828 /// # Example
9829 /// ```ignore,no_run
9830 /// # use google_cloud_eventarc_v1::model::Gke;
9831 /// let x = Gke::new().set_service("example");
9832 /// ```
9833 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9834 self.service = v.into();
9835 self
9836 }
9837
9838 /// Sets the value of [path][crate::model::Gke::path].
9839 ///
9840 /// # Example
9841 /// ```ignore,no_run
9842 /// # use google_cloud_eventarc_v1::model::Gke;
9843 /// let x = Gke::new().set_path("example");
9844 /// ```
9845 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9846 self.path = v.into();
9847 self
9848 }
9849}
9850
9851impl wkt::message::Message for Gke {
9852 fn typename() -> &'static str {
9853 "type.googleapis.com/google.cloud.eventarc.v1.GKE"
9854 }
9855}
9856
9857/// Represents a Pub/Sub transport.
9858#[derive(Clone, Default, PartialEq)]
9859#[non_exhaustive]
9860pub struct Pubsub {
9861 /// Optional. The name of the Pub/Sub topic created and managed by Eventarc as
9862 /// a transport for the event delivery. Format:
9863 /// `projects/{PROJECT_ID}/topics/{TOPIC_NAME}`.
9864 ///
9865 /// You can set an existing topic for triggers of the type
9866 /// `google.cloud.pubsub.topic.v1.messagePublished`. The topic you provide
9867 /// here is not deleted by Eventarc at trigger deletion.
9868 pub topic: std::string::String,
9869
9870 /// Output only. The name of the Pub/Sub subscription created and managed by
9871 /// Eventarc as a transport for the event delivery. Format:
9872 /// `projects/{PROJECT_ID}/subscriptions/{SUBSCRIPTION_NAME}`.
9873 pub subscription: std::string::String,
9874
9875 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9876}
9877
9878impl Pubsub {
9879 /// Creates a new default instance.
9880 pub fn new() -> Self {
9881 std::default::Default::default()
9882 }
9883
9884 /// Sets the value of [topic][crate::model::Pubsub::topic].
9885 ///
9886 /// # Example
9887 /// ```ignore,no_run
9888 /// # use google_cloud_eventarc_v1::model::Pubsub;
9889 /// let x = Pubsub::new().set_topic("example");
9890 /// ```
9891 pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9892 self.topic = v.into();
9893 self
9894 }
9895
9896 /// Sets the value of [subscription][crate::model::Pubsub::subscription].
9897 ///
9898 /// # Example
9899 /// ```ignore,no_run
9900 /// # use google_cloud_eventarc_v1::model::Pubsub;
9901 /// let x = Pubsub::new().set_subscription("example");
9902 /// ```
9903 pub fn set_subscription<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9904 self.subscription = v.into();
9905 self
9906 }
9907}
9908
9909impl wkt::message::Message for Pubsub {
9910 fn typename() -> &'static str {
9911 "type.googleapis.com/google.cloud.eventarc.v1.Pubsub"
9912 }
9913}
9914
9915/// Represents a HTTP endpoint destination.
9916#[derive(Clone, Default, PartialEq)]
9917#[non_exhaustive]
9918pub struct HttpEndpoint {
9919 /// Required. The URI of the HTTP endpoint.
9920 ///
9921 /// The value must be a RFC2396 URI string.
9922 /// Examples: `http://10.10.10.8:80/route`,
9923 /// `<http://svc.us-central1.p.local>:8080/`.
9924 /// Only HTTP and HTTPS protocols are supported. The host can be either a
9925 /// static IP addressable from the VPC specified by the network config, or
9926 /// an internal DNS hostname of the service resolvable via Cloud DNS.
9927 pub uri: std::string::String,
9928
9929 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9930}
9931
9932impl HttpEndpoint {
9933 /// Creates a new default instance.
9934 pub fn new() -> Self {
9935 std::default::Default::default()
9936 }
9937
9938 /// Sets the value of [uri][crate::model::HttpEndpoint::uri].
9939 ///
9940 /// # Example
9941 /// ```ignore,no_run
9942 /// # use google_cloud_eventarc_v1::model::HttpEndpoint;
9943 /// let x = HttpEndpoint::new().set_uri("example");
9944 /// ```
9945 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9946 self.uri = v.into();
9947 self
9948 }
9949}
9950
9951impl wkt::message::Message for HttpEndpoint {
9952 fn typename() -> &'static str {
9953 "type.googleapis.com/google.cloud.eventarc.v1.HttpEndpoint"
9954 }
9955}