google_cloud_build_v2/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_api;
26extern crate google_cloud_gax;
27extern crate google_cloud_iam_v1;
28extern crate google_cloud_longrunning;
29extern crate google_cloud_lro;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// Represents the metadata of the long-running operation.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct OperationMetadata {
45 /// Output only. The time the operation was created.
46 pub create_time: std::option::Option<wkt::Timestamp>,
47
48 /// Output only. The time the operation finished running.
49 pub end_time: std::option::Option<wkt::Timestamp>,
50
51 /// Output only. Server-defined resource path for the target of the operation.
52 pub target: std::string::String,
53
54 /// Output only. Name of the verb executed by the operation.
55 pub verb: std::string::String,
56
57 /// Output only. Human-readable status of the operation, if any.
58 pub status_message: std::string::String,
59
60 /// Output only. Identifies whether the user has requested cancellation
61 /// of the operation. Operations that have successfully been cancelled
62 /// have [Operation.error][] value with a
63 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
64 /// `Code.CANCELLED`.
65 pub requested_cancellation: bool,
66
67 /// Output only. API version used to start the operation.
68 pub api_version: std::string::String,
69
70 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
71}
72
73impl OperationMetadata {
74 /// Creates a new default instance.
75 pub fn new() -> Self {
76 std::default::Default::default()
77 }
78
79 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
80 ///
81 /// # Example
82 /// ```ignore,no_run
83 /// # use google_cloud_build_v2::model::OperationMetadata;
84 /// use wkt::Timestamp;
85 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
86 /// ```
87 pub fn set_create_time<T>(mut self, v: T) -> Self
88 where
89 T: std::convert::Into<wkt::Timestamp>,
90 {
91 self.create_time = std::option::Option::Some(v.into());
92 self
93 }
94
95 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
96 ///
97 /// # Example
98 /// ```ignore,no_run
99 /// # use google_cloud_build_v2::model::OperationMetadata;
100 /// use wkt::Timestamp;
101 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
102 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
103 /// ```
104 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
105 where
106 T: std::convert::Into<wkt::Timestamp>,
107 {
108 self.create_time = v.map(|x| x.into());
109 self
110 }
111
112 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
113 ///
114 /// # Example
115 /// ```ignore,no_run
116 /// # use google_cloud_build_v2::model::OperationMetadata;
117 /// use wkt::Timestamp;
118 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
119 /// ```
120 pub fn set_end_time<T>(mut self, v: T) -> Self
121 where
122 T: std::convert::Into<wkt::Timestamp>,
123 {
124 self.end_time = std::option::Option::Some(v.into());
125 self
126 }
127
128 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
129 ///
130 /// # Example
131 /// ```ignore,no_run
132 /// # use google_cloud_build_v2::model::OperationMetadata;
133 /// use wkt::Timestamp;
134 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
135 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
136 /// ```
137 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
138 where
139 T: std::convert::Into<wkt::Timestamp>,
140 {
141 self.end_time = v.map(|x| x.into());
142 self
143 }
144
145 /// Sets the value of [target][crate::model::OperationMetadata::target].
146 ///
147 /// # Example
148 /// ```ignore,no_run
149 /// # use google_cloud_build_v2::model::OperationMetadata;
150 /// let x = OperationMetadata::new().set_target("example");
151 /// ```
152 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
153 self.target = v.into();
154 self
155 }
156
157 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
158 ///
159 /// # Example
160 /// ```ignore,no_run
161 /// # use google_cloud_build_v2::model::OperationMetadata;
162 /// let x = OperationMetadata::new().set_verb("example");
163 /// ```
164 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
165 self.verb = v.into();
166 self
167 }
168
169 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
170 ///
171 /// # Example
172 /// ```ignore,no_run
173 /// # use google_cloud_build_v2::model::OperationMetadata;
174 /// let x = OperationMetadata::new().set_status_message("example");
175 /// ```
176 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
177 self.status_message = v.into();
178 self
179 }
180
181 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
182 ///
183 /// # Example
184 /// ```ignore,no_run
185 /// # use google_cloud_build_v2::model::OperationMetadata;
186 /// let x = OperationMetadata::new().set_requested_cancellation(true);
187 /// ```
188 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
189 self.requested_cancellation = v.into();
190 self
191 }
192
193 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
194 ///
195 /// # Example
196 /// ```ignore,no_run
197 /// # use google_cloud_build_v2::model::OperationMetadata;
198 /// let x = OperationMetadata::new().set_api_version("example");
199 /// ```
200 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
201 self.api_version = v.into();
202 self
203 }
204}
205
206impl wkt::message::Message for OperationMetadata {
207 fn typename() -> &'static str {
208 "type.googleapis.com/google.devtools.cloudbuild.v2.OperationMetadata"
209 }
210}
211
212/// Represents the custom metadata of the RunWorkflow long-running operation.
213#[derive(Clone, Default, PartialEq)]
214#[non_exhaustive]
215pub struct RunWorkflowCustomOperationMetadata {
216 /// Output only. The time the operation was created.
217 pub create_time: std::option::Option<wkt::Timestamp>,
218
219 /// Output only. The time the operation finished running.
220 pub end_time: std::option::Option<wkt::Timestamp>,
221
222 /// Output only. Name of the verb executed by the operation.
223 pub verb: std::string::String,
224
225 /// Output only. Identifies whether the user has requested cancellation
226 /// of the operation. Operations that have successfully been cancelled
227 /// have [Operation.error][] value with a
228 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
229 /// `Code.CANCELLED`.
230 pub requested_cancellation: bool,
231
232 /// Output only. API version used to start the operation.
233 pub api_version: std::string::String,
234
235 /// Output only. Server-defined resource path for the target of the operation.
236 pub target: std::string::String,
237
238 /// Output only. ID of the pipeline run created by RunWorkflow.
239 pub pipeline_run_id: std::string::String,
240
241 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
242}
243
244impl RunWorkflowCustomOperationMetadata {
245 /// Creates a new default instance.
246 pub fn new() -> Self {
247 std::default::Default::default()
248 }
249
250 /// Sets the value of [create_time][crate::model::RunWorkflowCustomOperationMetadata::create_time].
251 ///
252 /// # Example
253 /// ```ignore,no_run
254 /// # use google_cloud_build_v2::model::RunWorkflowCustomOperationMetadata;
255 /// use wkt::Timestamp;
256 /// let x = RunWorkflowCustomOperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
257 /// ```
258 pub fn set_create_time<T>(mut self, v: T) -> Self
259 where
260 T: std::convert::Into<wkt::Timestamp>,
261 {
262 self.create_time = std::option::Option::Some(v.into());
263 self
264 }
265
266 /// Sets or clears the value of [create_time][crate::model::RunWorkflowCustomOperationMetadata::create_time].
267 ///
268 /// # Example
269 /// ```ignore,no_run
270 /// # use google_cloud_build_v2::model::RunWorkflowCustomOperationMetadata;
271 /// use wkt::Timestamp;
272 /// let x = RunWorkflowCustomOperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
273 /// let x = RunWorkflowCustomOperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
274 /// ```
275 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
276 where
277 T: std::convert::Into<wkt::Timestamp>,
278 {
279 self.create_time = v.map(|x| x.into());
280 self
281 }
282
283 /// Sets the value of [end_time][crate::model::RunWorkflowCustomOperationMetadata::end_time].
284 ///
285 /// # Example
286 /// ```ignore,no_run
287 /// # use google_cloud_build_v2::model::RunWorkflowCustomOperationMetadata;
288 /// use wkt::Timestamp;
289 /// let x = RunWorkflowCustomOperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
290 /// ```
291 pub fn set_end_time<T>(mut self, v: T) -> Self
292 where
293 T: std::convert::Into<wkt::Timestamp>,
294 {
295 self.end_time = std::option::Option::Some(v.into());
296 self
297 }
298
299 /// Sets or clears the value of [end_time][crate::model::RunWorkflowCustomOperationMetadata::end_time].
300 ///
301 /// # Example
302 /// ```ignore,no_run
303 /// # use google_cloud_build_v2::model::RunWorkflowCustomOperationMetadata;
304 /// use wkt::Timestamp;
305 /// let x = RunWorkflowCustomOperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
306 /// let x = RunWorkflowCustomOperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
307 /// ```
308 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
309 where
310 T: std::convert::Into<wkt::Timestamp>,
311 {
312 self.end_time = v.map(|x| x.into());
313 self
314 }
315
316 /// Sets the value of [verb][crate::model::RunWorkflowCustomOperationMetadata::verb].
317 ///
318 /// # Example
319 /// ```ignore,no_run
320 /// # use google_cloud_build_v2::model::RunWorkflowCustomOperationMetadata;
321 /// let x = RunWorkflowCustomOperationMetadata::new().set_verb("example");
322 /// ```
323 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
324 self.verb = v.into();
325 self
326 }
327
328 /// Sets the value of [requested_cancellation][crate::model::RunWorkflowCustomOperationMetadata::requested_cancellation].
329 ///
330 /// # Example
331 /// ```ignore,no_run
332 /// # use google_cloud_build_v2::model::RunWorkflowCustomOperationMetadata;
333 /// let x = RunWorkflowCustomOperationMetadata::new().set_requested_cancellation(true);
334 /// ```
335 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
336 self.requested_cancellation = v.into();
337 self
338 }
339
340 /// Sets the value of [api_version][crate::model::RunWorkflowCustomOperationMetadata::api_version].
341 ///
342 /// # Example
343 /// ```ignore,no_run
344 /// # use google_cloud_build_v2::model::RunWorkflowCustomOperationMetadata;
345 /// let x = RunWorkflowCustomOperationMetadata::new().set_api_version("example");
346 /// ```
347 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
348 self.api_version = v.into();
349 self
350 }
351
352 /// Sets the value of [target][crate::model::RunWorkflowCustomOperationMetadata::target].
353 ///
354 /// # Example
355 /// ```ignore,no_run
356 /// # use google_cloud_build_v2::model::RunWorkflowCustomOperationMetadata;
357 /// let x = RunWorkflowCustomOperationMetadata::new().set_target("example");
358 /// ```
359 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
360 self.target = v.into();
361 self
362 }
363
364 /// Sets the value of [pipeline_run_id][crate::model::RunWorkflowCustomOperationMetadata::pipeline_run_id].
365 ///
366 /// # Example
367 /// ```ignore,no_run
368 /// # use google_cloud_build_v2::model::RunWorkflowCustomOperationMetadata;
369 /// let x = RunWorkflowCustomOperationMetadata::new().set_pipeline_run_id("example");
370 /// ```
371 pub fn set_pipeline_run_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
372 self.pipeline_run_id = v.into();
373 self
374 }
375}
376
377impl wkt::message::Message for RunWorkflowCustomOperationMetadata {
378 fn typename() -> &'static str {
379 "type.googleapis.com/google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata"
380 }
381}
382
383/// A connection to a SCM like GitHub, GitHub Enterprise, Bitbucket Data Center,
384/// Bitbucket Cloud or GitLab.
385#[derive(Clone, Default, PartialEq)]
386#[non_exhaustive]
387pub struct Connection {
388 /// Immutable. The resource name of the connection, in the format
389 /// `projects/{project}/locations/{location}/connections/{connection_id}`.
390 pub name: std::string::String,
391
392 /// Output only. Server assigned timestamp for when the connection was created.
393 pub create_time: std::option::Option<wkt::Timestamp>,
394
395 /// Output only. Server assigned timestamp for when the connection was updated.
396 pub update_time: std::option::Option<wkt::Timestamp>,
397
398 /// Output only. Installation state of the Connection.
399 pub installation_state: std::option::Option<crate::model::InstallationState>,
400
401 /// If disabled is set to true, functionality is disabled for this connection.
402 /// Repository based API methods and webhooks processing for repositories in
403 /// this connection will be disabled.
404 pub disabled: bool,
405
406 /// Output only. Set to true when the connection is being set up or updated in
407 /// the background.
408 pub reconciling: bool,
409
410 /// Allows clients to store small amounts of arbitrary data.
411 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
412
413 /// This checksum is computed by the server based on the value of other
414 /// fields, and may be sent on update and delete requests to ensure the
415 /// client has an up-to-date value before proceeding.
416 pub etag: std::string::String,
417
418 /// Configuration for the connection depending on the type of provider.
419 pub connection_config: std::option::Option<crate::model::connection::ConnectionConfig>,
420
421 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
422}
423
424impl Connection {
425 /// Creates a new default instance.
426 pub fn new() -> Self {
427 std::default::Default::default()
428 }
429
430 /// Sets the value of [name][crate::model::Connection::name].
431 ///
432 /// # Example
433 /// ```ignore,no_run
434 /// # use google_cloud_build_v2::model::Connection;
435 /// # let project_id = "project_id";
436 /// # let location_id = "location_id";
437 /// # let connection_id = "connection_id";
438 /// let x = Connection::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
439 /// ```
440 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
441 self.name = v.into();
442 self
443 }
444
445 /// Sets the value of [create_time][crate::model::Connection::create_time].
446 ///
447 /// # Example
448 /// ```ignore,no_run
449 /// # use google_cloud_build_v2::model::Connection;
450 /// use wkt::Timestamp;
451 /// let x = Connection::new().set_create_time(Timestamp::default()/* use setters */);
452 /// ```
453 pub fn set_create_time<T>(mut self, v: T) -> Self
454 where
455 T: std::convert::Into<wkt::Timestamp>,
456 {
457 self.create_time = std::option::Option::Some(v.into());
458 self
459 }
460
461 /// Sets or clears the value of [create_time][crate::model::Connection::create_time].
462 ///
463 /// # Example
464 /// ```ignore,no_run
465 /// # use google_cloud_build_v2::model::Connection;
466 /// use wkt::Timestamp;
467 /// let x = Connection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
468 /// let x = Connection::new().set_or_clear_create_time(None::<Timestamp>);
469 /// ```
470 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
471 where
472 T: std::convert::Into<wkt::Timestamp>,
473 {
474 self.create_time = v.map(|x| x.into());
475 self
476 }
477
478 /// Sets the value of [update_time][crate::model::Connection::update_time].
479 ///
480 /// # Example
481 /// ```ignore,no_run
482 /// # use google_cloud_build_v2::model::Connection;
483 /// use wkt::Timestamp;
484 /// let x = Connection::new().set_update_time(Timestamp::default()/* use setters */);
485 /// ```
486 pub fn set_update_time<T>(mut self, v: T) -> Self
487 where
488 T: std::convert::Into<wkt::Timestamp>,
489 {
490 self.update_time = std::option::Option::Some(v.into());
491 self
492 }
493
494 /// Sets or clears the value of [update_time][crate::model::Connection::update_time].
495 ///
496 /// # Example
497 /// ```ignore,no_run
498 /// # use google_cloud_build_v2::model::Connection;
499 /// use wkt::Timestamp;
500 /// let x = Connection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
501 /// let x = Connection::new().set_or_clear_update_time(None::<Timestamp>);
502 /// ```
503 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
504 where
505 T: std::convert::Into<wkt::Timestamp>,
506 {
507 self.update_time = v.map(|x| x.into());
508 self
509 }
510
511 /// Sets the value of [installation_state][crate::model::Connection::installation_state].
512 ///
513 /// # Example
514 /// ```ignore,no_run
515 /// # use google_cloud_build_v2::model::Connection;
516 /// use google_cloud_build_v2::model::InstallationState;
517 /// let x = Connection::new().set_installation_state(InstallationState::default()/* use setters */);
518 /// ```
519 pub fn set_installation_state<T>(mut self, v: T) -> Self
520 where
521 T: std::convert::Into<crate::model::InstallationState>,
522 {
523 self.installation_state = std::option::Option::Some(v.into());
524 self
525 }
526
527 /// Sets or clears the value of [installation_state][crate::model::Connection::installation_state].
528 ///
529 /// # Example
530 /// ```ignore,no_run
531 /// # use google_cloud_build_v2::model::Connection;
532 /// use google_cloud_build_v2::model::InstallationState;
533 /// let x = Connection::new().set_or_clear_installation_state(Some(InstallationState::default()/* use setters */));
534 /// let x = Connection::new().set_or_clear_installation_state(None::<InstallationState>);
535 /// ```
536 pub fn set_or_clear_installation_state<T>(mut self, v: std::option::Option<T>) -> Self
537 where
538 T: std::convert::Into<crate::model::InstallationState>,
539 {
540 self.installation_state = v.map(|x| x.into());
541 self
542 }
543
544 /// Sets the value of [disabled][crate::model::Connection::disabled].
545 ///
546 /// # Example
547 /// ```ignore,no_run
548 /// # use google_cloud_build_v2::model::Connection;
549 /// let x = Connection::new().set_disabled(true);
550 /// ```
551 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
552 self.disabled = v.into();
553 self
554 }
555
556 /// Sets the value of [reconciling][crate::model::Connection::reconciling].
557 ///
558 /// # Example
559 /// ```ignore,no_run
560 /// # use google_cloud_build_v2::model::Connection;
561 /// let x = Connection::new().set_reconciling(true);
562 /// ```
563 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
564 self.reconciling = v.into();
565 self
566 }
567
568 /// Sets the value of [annotations][crate::model::Connection::annotations].
569 ///
570 /// # Example
571 /// ```ignore,no_run
572 /// # use google_cloud_build_v2::model::Connection;
573 /// let x = Connection::new().set_annotations([
574 /// ("key0", "abc"),
575 /// ("key1", "xyz"),
576 /// ]);
577 /// ```
578 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
579 where
580 T: std::iter::IntoIterator<Item = (K, V)>,
581 K: std::convert::Into<std::string::String>,
582 V: std::convert::Into<std::string::String>,
583 {
584 use std::iter::Iterator;
585 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
586 self
587 }
588
589 /// Sets the value of [etag][crate::model::Connection::etag].
590 ///
591 /// # Example
592 /// ```ignore,no_run
593 /// # use google_cloud_build_v2::model::Connection;
594 /// let x = Connection::new().set_etag("example");
595 /// ```
596 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
597 self.etag = v.into();
598 self
599 }
600
601 /// Sets the value of [connection_config][crate::model::Connection::connection_config].
602 ///
603 /// Note that all the setters affecting `connection_config` are mutually
604 /// exclusive.
605 ///
606 /// # Example
607 /// ```ignore,no_run
608 /// # use google_cloud_build_v2::model::Connection;
609 /// use google_cloud_build_v2::model::GitHubConfig;
610 /// let x = Connection::new().set_connection_config(Some(
611 /// google_cloud_build_v2::model::connection::ConnectionConfig::GithubConfig(GitHubConfig::default().into())));
612 /// ```
613 pub fn set_connection_config<
614 T: std::convert::Into<std::option::Option<crate::model::connection::ConnectionConfig>>,
615 >(
616 mut self,
617 v: T,
618 ) -> Self {
619 self.connection_config = v.into();
620 self
621 }
622
623 /// The value of [connection_config][crate::model::Connection::connection_config]
624 /// if it holds a `GithubConfig`, `None` if the field is not set or
625 /// holds a different branch.
626 pub fn github_config(
627 &self,
628 ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubConfig>> {
629 #[allow(unreachable_patterns)]
630 self.connection_config.as_ref().and_then(|v| match v {
631 crate::model::connection::ConnectionConfig::GithubConfig(v) => {
632 std::option::Option::Some(v)
633 }
634 _ => std::option::Option::None,
635 })
636 }
637
638 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
639 /// to hold a `GithubConfig`.
640 ///
641 /// Note that all the setters affecting `connection_config` are
642 /// mutually exclusive.
643 ///
644 /// # Example
645 /// ```ignore,no_run
646 /// # use google_cloud_build_v2::model::Connection;
647 /// use google_cloud_build_v2::model::GitHubConfig;
648 /// let x = Connection::new().set_github_config(GitHubConfig::default()/* use setters */);
649 /// assert!(x.github_config().is_some());
650 /// assert!(x.github_enterprise_config().is_none());
651 /// assert!(x.gitlab_config().is_none());
652 /// assert!(x.bitbucket_data_center_config().is_none());
653 /// assert!(x.bitbucket_cloud_config().is_none());
654 /// ```
655 pub fn set_github_config<T: std::convert::Into<std::boxed::Box<crate::model::GitHubConfig>>>(
656 mut self,
657 v: T,
658 ) -> Self {
659 self.connection_config = std::option::Option::Some(
660 crate::model::connection::ConnectionConfig::GithubConfig(v.into()),
661 );
662 self
663 }
664
665 /// The value of [connection_config][crate::model::Connection::connection_config]
666 /// if it holds a `GithubEnterpriseConfig`, `None` if the field is not set or
667 /// holds a different branch.
668 pub fn github_enterprise_config(
669 &self,
670 ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubEnterpriseConfig>> {
671 #[allow(unreachable_patterns)]
672 self.connection_config.as_ref().and_then(|v| match v {
673 crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v) => {
674 std::option::Option::Some(v)
675 }
676 _ => std::option::Option::None,
677 })
678 }
679
680 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
681 /// to hold a `GithubEnterpriseConfig`.
682 ///
683 /// Note that all the setters affecting `connection_config` are
684 /// mutually exclusive.
685 ///
686 /// # Example
687 /// ```ignore,no_run
688 /// # use google_cloud_build_v2::model::Connection;
689 /// use google_cloud_build_v2::model::GitHubEnterpriseConfig;
690 /// let x = Connection::new().set_github_enterprise_config(GitHubEnterpriseConfig::default()/* use setters */);
691 /// assert!(x.github_enterprise_config().is_some());
692 /// assert!(x.github_config().is_none());
693 /// assert!(x.gitlab_config().is_none());
694 /// assert!(x.bitbucket_data_center_config().is_none());
695 /// assert!(x.bitbucket_cloud_config().is_none());
696 /// ```
697 pub fn set_github_enterprise_config<
698 T: std::convert::Into<std::boxed::Box<crate::model::GitHubEnterpriseConfig>>,
699 >(
700 mut self,
701 v: T,
702 ) -> Self {
703 self.connection_config = std::option::Option::Some(
704 crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v.into()),
705 );
706 self
707 }
708
709 /// The value of [connection_config][crate::model::Connection::connection_config]
710 /// if it holds a `GitlabConfig`, `None` if the field is not set or
711 /// holds a different branch.
712 pub fn gitlab_config(
713 &self,
714 ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabConfig>> {
715 #[allow(unreachable_patterns)]
716 self.connection_config.as_ref().and_then(|v| match v {
717 crate::model::connection::ConnectionConfig::GitlabConfig(v) => {
718 std::option::Option::Some(v)
719 }
720 _ => std::option::Option::None,
721 })
722 }
723
724 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
725 /// to hold a `GitlabConfig`.
726 ///
727 /// Note that all the setters affecting `connection_config` are
728 /// mutually exclusive.
729 ///
730 /// # Example
731 /// ```ignore,no_run
732 /// # use google_cloud_build_v2::model::Connection;
733 /// use google_cloud_build_v2::model::GitLabConfig;
734 /// let x = Connection::new().set_gitlab_config(GitLabConfig::default()/* use setters */);
735 /// assert!(x.gitlab_config().is_some());
736 /// assert!(x.github_config().is_none());
737 /// assert!(x.github_enterprise_config().is_none());
738 /// assert!(x.bitbucket_data_center_config().is_none());
739 /// assert!(x.bitbucket_cloud_config().is_none());
740 /// ```
741 pub fn set_gitlab_config<T: std::convert::Into<std::boxed::Box<crate::model::GitLabConfig>>>(
742 mut self,
743 v: T,
744 ) -> Self {
745 self.connection_config = std::option::Option::Some(
746 crate::model::connection::ConnectionConfig::GitlabConfig(v.into()),
747 );
748 self
749 }
750
751 /// The value of [connection_config][crate::model::Connection::connection_config]
752 /// if it holds a `BitbucketDataCenterConfig`, `None` if the field is not set or
753 /// holds a different branch.
754 pub fn bitbucket_data_center_config(
755 &self,
756 ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketDataCenterConfig>> {
757 #[allow(unreachable_patterns)]
758 self.connection_config.as_ref().and_then(|v| match v {
759 crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v) => {
760 std::option::Option::Some(v)
761 }
762 _ => std::option::Option::None,
763 })
764 }
765
766 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
767 /// to hold a `BitbucketDataCenterConfig`.
768 ///
769 /// Note that all the setters affecting `connection_config` are
770 /// mutually exclusive.
771 ///
772 /// # Example
773 /// ```ignore,no_run
774 /// # use google_cloud_build_v2::model::Connection;
775 /// use google_cloud_build_v2::model::BitbucketDataCenterConfig;
776 /// let x = Connection::new().set_bitbucket_data_center_config(BitbucketDataCenterConfig::default()/* use setters */);
777 /// assert!(x.bitbucket_data_center_config().is_some());
778 /// assert!(x.github_config().is_none());
779 /// assert!(x.github_enterprise_config().is_none());
780 /// assert!(x.gitlab_config().is_none());
781 /// assert!(x.bitbucket_cloud_config().is_none());
782 /// ```
783 pub fn set_bitbucket_data_center_config<
784 T: std::convert::Into<std::boxed::Box<crate::model::BitbucketDataCenterConfig>>,
785 >(
786 mut self,
787 v: T,
788 ) -> Self {
789 self.connection_config = std::option::Option::Some(
790 crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v.into()),
791 );
792 self
793 }
794
795 /// The value of [connection_config][crate::model::Connection::connection_config]
796 /// if it holds a `BitbucketCloudConfig`, `None` if the field is not set or
797 /// holds a different branch.
798 pub fn bitbucket_cloud_config(
799 &self,
800 ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketCloudConfig>> {
801 #[allow(unreachable_patterns)]
802 self.connection_config.as_ref().and_then(|v| match v {
803 crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v) => {
804 std::option::Option::Some(v)
805 }
806 _ => std::option::Option::None,
807 })
808 }
809
810 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
811 /// to hold a `BitbucketCloudConfig`.
812 ///
813 /// Note that all the setters affecting `connection_config` are
814 /// mutually exclusive.
815 ///
816 /// # Example
817 /// ```ignore,no_run
818 /// # use google_cloud_build_v2::model::Connection;
819 /// use google_cloud_build_v2::model::BitbucketCloudConfig;
820 /// let x = Connection::new().set_bitbucket_cloud_config(BitbucketCloudConfig::default()/* use setters */);
821 /// assert!(x.bitbucket_cloud_config().is_some());
822 /// assert!(x.github_config().is_none());
823 /// assert!(x.github_enterprise_config().is_none());
824 /// assert!(x.gitlab_config().is_none());
825 /// assert!(x.bitbucket_data_center_config().is_none());
826 /// ```
827 pub fn set_bitbucket_cloud_config<
828 T: std::convert::Into<std::boxed::Box<crate::model::BitbucketCloudConfig>>,
829 >(
830 mut self,
831 v: T,
832 ) -> Self {
833 self.connection_config = std::option::Option::Some(
834 crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v.into()),
835 );
836 self
837 }
838}
839
840impl wkt::message::Message for Connection {
841 fn typename() -> &'static str {
842 "type.googleapis.com/google.devtools.cloudbuild.v2.Connection"
843 }
844}
845
846/// Defines additional types related to [Connection].
847pub mod connection {
848 #[allow(unused_imports)]
849 use super::*;
850
851 /// Configuration for the connection depending on the type of provider.
852 #[derive(Clone, Debug, PartialEq)]
853 #[non_exhaustive]
854 pub enum ConnectionConfig {
855 /// Configuration for connections to github.com.
856 GithubConfig(std::boxed::Box<crate::model::GitHubConfig>),
857 /// Configuration for connections to an instance of GitHub Enterprise.
858 GithubEnterpriseConfig(std::boxed::Box<crate::model::GitHubEnterpriseConfig>),
859 /// Configuration for connections to gitlab.com or an instance of GitLab
860 /// Enterprise.
861 GitlabConfig(std::boxed::Box<crate::model::GitLabConfig>),
862 /// Configuration for connections to Bitbucket Data Center.
863 BitbucketDataCenterConfig(std::boxed::Box<crate::model::BitbucketDataCenterConfig>),
864 /// Configuration for connections to Bitbucket Cloud.
865 BitbucketCloudConfig(std::boxed::Box<crate::model::BitbucketCloudConfig>),
866 }
867}
868
869/// Describes stage and necessary actions to be taken by the
870/// user to complete the installation. Used for GitHub and GitHub Enterprise
871/// based connections.
872#[derive(Clone, Default, PartialEq)]
873#[non_exhaustive]
874pub struct InstallationState {
875 /// Output only. Current step of the installation process.
876 pub stage: crate::model::installation_state::Stage,
877
878 /// Output only. Message of what the user should do next to continue the
879 /// installation. Empty string if the installation is already complete.
880 pub message: std::string::String,
881
882 /// Output only. Link to follow for next action. Empty string if the
883 /// installation is already complete.
884 pub action_uri: std::string::String,
885
886 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
887}
888
889impl InstallationState {
890 /// Creates a new default instance.
891 pub fn new() -> Self {
892 std::default::Default::default()
893 }
894
895 /// Sets the value of [stage][crate::model::InstallationState::stage].
896 ///
897 /// # Example
898 /// ```ignore,no_run
899 /// # use google_cloud_build_v2::model::InstallationState;
900 /// use google_cloud_build_v2::model::installation_state::Stage;
901 /// let x0 = InstallationState::new().set_stage(Stage::PendingCreateApp);
902 /// let x1 = InstallationState::new().set_stage(Stage::PendingUserOauth);
903 /// let x2 = InstallationState::new().set_stage(Stage::PendingInstallApp);
904 /// ```
905 pub fn set_stage<T: std::convert::Into<crate::model::installation_state::Stage>>(
906 mut self,
907 v: T,
908 ) -> Self {
909 self.stage = v.into();
910 self
911 }
912
913 /// Sets the value of [message][crate::model::InstallationState::message].
914 ///
915 /// # Example
916 /// ```ignore,no_run
917 /// # use google_cloud_build_v2::model::InstallationState;
918 /// let x = InstallationState::new().set_message("example");
919 /// ```
920 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
921 self.message = v.into();
922 self
923 }
924
925 /// Sets the value of [action_uri][crate::model::InstallationState::action_uri].
926 ///
927 /// # Example
928 /// ```ignore,no_run
929 /// # use google_cloud_build_v2::model::InstallationState;
930 /// let x = InstallationState::new().set_action_uri("example");
931 /// ```
932 pub fn set_action_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
933 self.action_uri = v.into();
934 self
935 }
936}
937
938impl wkt::message::Message for InstallationState {
939 fn typename() -> &'static str {
940 "type.googleapis.com/google.devtools.cloudbuild.v2.InstallationState"
941 }
942}
943
944/// Defines additional types related to [InstallationState].
945pub mod installation_state {
946 #[allow(unused_imports)]
947 use super::*;
948
949 /// Stage of the installation process.
950 ///
951 /// # Working with unknown values
952 ///
953 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
954 /// additional enum variants at any time. Adding new variants is not considered
955 /// a breaking change. Applications should write their code in anticipation of:
956 ///
957 /// - New values appearing in future releases of the client library, **and**
958 /// - New values received dynamically, without application changes.
959 ///
960 /// Please consult the [Working with enums] section in the user guide for some
961 /// guidelines.
962 ///
963 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
964 #[derive(Clone, Debug, PartialEq)]
965 #[non_exhaustive]
966 pub enum Stage {
967 /// No stage specified.
968 Unspecified,
969 /// Only for GitHub Enterprise. An App creation has been requested.
970 /// The user needs to confirm the creation in their GitHub enterprise host.
971 PendingCreateApp,
972 /// User needs to authorize the GitHub (or Enterprise) App via OAuth.
973 PendingUserOauth,
974 /// User needs to follow the link to install the GitHub (or Enterprise) App.
975 PendingInstallApp,
976 /// Installation process has been completed.
977 Complete,
978 /// If set, the enum was initialized with an unknown value.
979 ///
980 /// Applications can examine the value using [Stage::value] or
981 /// [Stage::name].
982 UnknownValue(stage::UnknownValue),
983 }
984
985 #[doc(hidden)]
986 pub mod stage {
987 #[allow(unused_imports)]
988 use super::*;
989 #[derive(Clone, Debug, PartialEq)]
990 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
991 }
992
993 impl Stage {
994 /// Gets the enum value.
995 ///
996 /// Returns `None` if the enum contains an unknown value deserialized from
997 /// the string representation of enums.
998 pub fn value(&self) -> std::option::Option<i32> {
999 match self {
1000 Self::Unspecified => std::option::Option::Some(0),
1001 Self::PendingCreateApp => std::option::Option::Some(1),
1002 Self::PendingUserOauth => std::option::Option::Some(2),
1003 Self::PendingInstallApp => std::option::Option::Some(3),
1004 Self::Complete => std::option::Option::Some(10),
1005 Self::UnknownValue(u) => u.0.value(),
1006 }
1007 }
1008
1009 /// Gets the enum value as a string.
1010 ///
1011 /// Returns `None` if the enum contains an unknown value deserialized from
1012 /// the integer representation of enums.
1013 pub fn name(&self) -> std::option::Option<&str> {
1014 match self {
1015 Self::Unspecified => std::option::Option::Some("STAGE_UNSPECIFIED"),
1016 Self::PendingCreateApp => std::option::Option::Some("PENDING_CREATE_APP"),
1017 Self::PendingUserOauth => std::option::Option::Some("PENDING_USER_OAUTH"),
1018 Self::PendingInstallApp => std::option::Option::Some("PENDING_INSTALL_APP"),
1019 Self::Complete => std::option::Option::Some("COMPLETE"),
1020 Self::UnknownValue(u) => u.0.name(),
1021 }
1022 }
1023 }
1024
1025 impl std::default::Default for Stage {
1026 fn default() -> Self {
1027 use std::convert::From;
1028 Self::from(0)
1029 }
1030 }
1031
1032 impl std::fmt::Display for Stage {
1033 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1034 wkt::internal::display_enum(f, self.name(), self.value())
1035 }
1036 }
1037
1038 impl std::convert::From<i32> for Stage {
1039 fn from(value: i32) -> Self {
1040 match value {
1041 0 => Self::Unspecified,
1042 1 => Self::PendingCreateApp,
1043 2 => Self::PendingUserOauth,
1044 3 => Self::PendingInstallApp,
1045 10 => Self::Complete,
1046 _ => Self::UnknownValue(stage::UnknownValue(
1047 wkt::internal::UnknownEnumValue::Integer(value),
1048 )),
1049 }
1050 }
1051 }
1052
1053 impl std::convert::From<&str> for Stage {
1054 fn from(value: &str) -> Self {
1055 use std::string::ToString;
1056 match value {
1057 "STAGE_UNSPECIFIED" => Self::Unspecified,
1058 "PENDING_CREATE_APP" => Self::PendingCreateApp,
1059 "PENDING_USER_OAUTH" => Self::PendingUserOauth,
1060 "PENDING_INSTALL_APP" => Self::PendingInstallApp,
1061 "COMPLETE" => Self::Complete,
1062 _ => Self::UnknownValue(stage::UnknownValue(
1063 wkt::internal::UnknownEnumValue::String(value.to_string()),
1064 )),
1065 }
1066 }
1067 }
1068
1069 impl serde::ser::Serialize for Stage {
1070 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1071 where
1072 S: serde::Serializer,
1073 {
1074 match self {
1075 Self::Unspecified => serializer.serialize_i32(0),
1076 Self::PendingCreateApp => serializer.serialize_i32(1),
1077 Self::PendingUserOauth => serializer.serialize_i32(2),
1078 Self::PendingInstallApp => serializer.serialize_i32(3),
1079 Self::Complete => serializer.serialize_i32(10),
1080 Self::UnknownValue(u) => u.0.serialize(serializer),
1081 }
1082 }
1083 }
1084
1085 impl<'de> serde::de::Deserialize<'de> for Stage {
1086 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1087 where
1088 D: serde::Deserializer<'de>,
1089 {
1090 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Stage>::new(
1091 ".google.devtools.cloudbuild.v2.InstallationState.Stage",
1092 ))
1093 }
1094 }
1095}
1096
1097/// Request message for FetchLinkableRepositories.
1098#[derive(Clone, Default, PartialEq)]
1099#[non_exhaustive]
1100pub struct FetchLinkableRepositoriesRequest {
1101 /// Required. The name of the Connection.
1102 /// Format: `projects/*/locations/*/connections/*`.
1103 pub connection: std::string::String,
1104
1105 /// Number of results to return in the list. Default to 20.
1106 pub page_size: i32,
1107
1108 /// Page start.
1109 pub page_token: std::string::String,
1110
1111 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1112}
1113
1114impl FetchLinkableRepositoriesRequest {
1115 /// Creates a new default instance.
1116 pub fn new() -> Self {
1117 std::default::Default::default()
1118 }
1119
1120 /// Sets the value of [connection][crate::model::FetchLinkableRepositoriesRequest::connection].
1121 ///
1122 /// # Example
1123 /// ```ignore,no_run
1124 /// # use google_cloud_build_v2::model::FetchLinkableRepositoriesRequest;
1125 /// # let project_id = "project_id";
1126 /// # let location_id = "location_id";
1127 /// # let connection_id = "connection_id";
1128 /// let x = FetchLinkableRepositoriesRequest::new().set_connection(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
1129 /// ```
1130 pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1131 self.connection = v.into();
1132 self
1133 }
1134
1135 /// Sets the value of [page_size][crate::model::FetchLinkableRepositoriesRequest::page_size].
1136 ///
1137 /// # Example
1138 /// ```ignore,no_run
1139 /// # use google_cloud_build_v2::model::FetchLinkableRepositoriesRequest;
1140 /// let x = FetchLinkableRepositoriesRequest::new().set_page_size(42);
1141 /// ```
1142 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1143 self.page_size = v.into();
1144 self
1145 }
1146
1147 /// Sets the value of [page_token][crate::model::FetchLinkableRepositoriesRequest::page_token].
1148 ///
1149 /// # Example
1150 /// ```ignore,no_run
1151 /// # use google_cloud_build_v2::model::FetchLinkableRepositoriesRequest;
1152 /// let x = FetchLinkableRepositoriesRequest::new().set_page_token("example");
1153 /// ```
1154 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1155 self.page_token = v.into();
1156 self
1157 }
1158}
1159
1160impl wkt::message::Message for FetchLinkableRepositoriesRequest {
1161 fn typename() -> &'static str {
1162 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest"
1163 }
1164}
1165
1166/// Response message for FetchLinkableRepositories.
1167#[derive(Clone, Default, PartialEq)]
1168#[non_exhaustive]
1169pub struct FetchLinkableRepositoriesResponse {
1170 /// repositories ready to be created.
1171 pub repositories: std::vec::Vec<crate::model::Repository>,
1172
1173 /// A token identifying a page of results the server should return.
1174 pub next_page_token: std::string::String,
1175
1176 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1177}
1178
1179impl FetchLinkableRepositoriesResponse {
1180 /// Creates a new default instance.
1181 pub fn new() -> Self {
1182 std::default::Default::default()
1183 }
1184
1185 /// Sets the value of [repositories][crate::model::FetchLinkableRepositoriesResponse::repositories].
1186 ///
1187 /// # Example
1188 /// ```ignore,no_run
1189 /// # use google_cloud_build_v2::model::FetchLinkableRepositoriesResponse;
1190 /// use google_cloud_build_v2::model::Repository;
1191 /// let x = FetchLinkableRepositoriesResponse::new()
1192 /// .set_repositories([
1193 /// Repository::default()/* use setters */,
1194 /// Repository::default()/* use (different) setters */,
1195 /// ]);
1196 /// ```
1197 pub fn set_repositories<T, V>(mut self, v: T) -> Self
1198 where
1199 T: std::iter::IntoIterator<Item = V>,
1200 V: std::convert::Into<crate::model::Repository>,
1201 {
1202 use std::iter::Iterator;
1203 self.repositories = v.into_iter().map(|i| i.into()).collect();
1204 self
1205 }
1206
1207 /// Sets the value of [next_page_token][crate::model::FetchLinkableRepositoriesResponse::next_page_token].
1208 ///
1209 /// # Example
1210 /// ```ignore,no_run
1211 /// # use google_cloud_build_v2::model::FetchLinkableRepositoriesResponse;
1212 /// let x = FetchLinkableRepositoriesResponse::new().set_next_page_token("example");
1213 /// ```
1214 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1215 self.next_page_token = v.into();
1216 self
1217 }
1218}
1219
1220impl wkt::message::Message for FetchLinkableRepositoriesResponse {
1221 fn typename() -> &'static str {
1222 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse"
1223 }
1224}
1225
1226#[doc(hidden)]
1227impl google_cloud_gax::paginator::internal::PageableResponse for FetchLinkableRepositoriesResponse {
1228 type PageItem = crate::model::Repository;
1229
1230 fn items(self) -> std::vec::Vec<Self::PageItem> {
1231 self.repositories
1232 }
1233
1234 fn next_page_token(&self) -> std::string::String {
1235 use std::clone::Clone;
1236 self.next_page_token.clone()
1237 }
1238}
1239
1240/// Configuration for connections to github.com.
1241#[derive(Clone, Default, PartialEq)]
1242#[non_exhaustive]
1243pub struct GitHubConfig {
1244 /// OAuth credential of the account that authorized the Cloud Build GitHub App.
1245 /// It is recommended to use a robot account instead of a human user account.
1246 /// The OAuth token must be tied to the Cloud Build GitHub App.
1247 pub authorizer_credential: std::option::Option<crate::model::OAuthCredential>,
1248
1249 /// GitHub App installation id.
1250 pub app_installation_id: i64,
1251
1252 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1253}
1254
1255impl GitHubConfig {
1256 /// Creates a new default instance.
1257 pub fn new() -> Self {
1258 std::default::Default::default()
1259 }
1260
1261 /// Sets the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
1262 ///
1263 /// # Example
1264 /// ```ignore,no_run
1265 /// # use google_cloud_build_v2::model::GitHubConfig;
1266 /// use google_cloud_build_v2::model::OAuthCredential;
1267 /// let x = GitHubConfig::new().set_authorizer_credential(OAuthCredential::default()/* use setters */);
1268 /// ```
1269 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1270 where
1271 T: std::convert::Into<crate::model::OAuthCredential>,
1272 {
1273 self.authorizer_credential = std::option::Option::Some(v.into());
1274 self
1275 }
1276
1277 /// Sets or clears the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
1278 ///
1279 /// # Example
1280 /// ```ignore,no_run
1281 /// # use google_cloud_build_v2::model::GitHubConfig;
1282 /// use google_cloud_build_v2::model::OAuthCredential;
1283 /// let x = GitHubConfig::new().set_or_clear_authorizer_credential(Some(OAuthCredential::default()/* use setters */));
1284 /// let x = GitHubConfig::new().set_or_clear_authorizer_credential(None::<OAuthCredential>);
1285 /// ```
1286 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1287 where
1288 T: std::convert::Into<crate::model::OAuthCredential>,
1289 {
1290 self.authorizer_credential = v.map(|x| x.into());
1291 self
1292 }
1293
1294 /// Sets the value of [app_installation_id][crate::model::GitHubConfig::app_installation_id].
1295 ///
1296 /// # Example
1297 /// ```ignore,no_run
1298 /// # use google_cloud_build_v2::model::GitHubConfig;
1299 /// let x = GitHubConfig::new().set_app_installation_id(42);
1300 /// ```
1301 pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1302 self.app_installation_id = v.into();
1303 self
1304 }
1305}
1306
1307impl wkt::message::Message for GitHubConfig {
1308 fn typename() -> &'static str {
1309 "type.googleapis.com/google.devtools.cloudbuild.v2.GitHubConfig"
1310 }
1311}
1312
1313/// Configuration for connections to an instance of GitHub Enterprise.
1314#[derive(Clone, Default, PartialEq)]
1315#[non_exhaustive]
1316pub struct GitHubEnterpriseConfig {
1317 /// Required. The URI of the GitHub Enterprise host this connection is for.
1318 pub host_uri: std::string::String,
1319
1320 /// Required. API Key used for authentication of webhook events.
1321 pub api_key: std::string::String,
1322
1323 /// Id of the GitHub App created from the manifest.
1324 pub app_id: i64,
1325
1326 /// The URL-friendly name of the GitHub App.
1327 pub app_slug: std::string::String,
1328
1329 /// SecretManager resource containing the private key of the GitHub App,
1330 /// formatted as `projects/*/secrets/*/versions/*`.
1331 pub private_key_secret_version: std::string::String,
1332
1333 /// SecretManager resource containing the webhook secret of the GitHub App,
1334 /// formatted as `projects/*/secrets/*/versions/*`.
1335 pub webhook_secret_secret_version: std::string::String,
1336
1337 /// ID of the installation of the GitHub App.
1338 pub app_installation_id: i64,
1339
1340 /// Configuration for using Service Directory to privately connect to a GitHub
1341 /// Enterprise server. This should only be set if the GitHub Enterprise server
1342 /// is hosted on-premises and not reachable by public internet. If this field
1343 /// is left empty, calls to the GitHub Enterprise server will be made over the
1344 /// public internet.
1345 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1346
1347 /// SSL certificate to use for requests to GitHub Enterprise.
1348 pub ssl_ca: std::string::String,
1349
1350 /// Output only. GitHub Enterprise version installed at the host_uri.
1351 pub server_version: std::string::String,
1352
1353 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1354}
1355
1356impl GitHubEnterpriseConfig {
1357 /// Creates a new default instance.
1358 pub fn new() -> Self {
1359 std::default::Default::default()
1360 }
1361
1362 /// Sets the value of [host_uri][crate::model::GitHubEnterpriseConfig::host_uri].
1363 ///
1364 /// # Example
1365 /// ```ignore,no_run
1366 /// # use google_cloud_build_v2::model::GitHubEnterpriseConfig;
1367 /// let x = GitHubEnterpriseConfig::new().set_host_uri("example");
1368 /// ```
1369 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1370 self.host_uri = v.into();
1371 self
1372 }
1373
1374 /// Sets the value of [api_key][crate::model::GitHubEnterpriseConfig::api_key].
1375 ///
1376 /// # Example
1377 /// ```ignore,no_run
1378 /// # use google_cloud_build_v2::model::GitHubEnterpriseConfig;
1379 /// let x = GitHubEnterpriseConfig::new().set_api_key("example");
1380 /// ```
1381 pub fn set_api_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1382 self.api_key = v.into();
1383 self
1384 }
1385
1386 /// Sets the value of [app_id][crate::model::GitHubEnterpriseConfig::app_id].
1387 ///
1388 /// # Example
1389 /// ```ignore,no_run
1390 /// # use google_cloud_build_v2::model::GitHubEnterpriseConfig;
1391 /// let x = GitHubEnterpriseConfig::new().set_app_id(42);
1392 /// ```
1393 pub fn set_app_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1394 self.app_id = v.into();
1395 self
1396 }
1397
1398 /// Sets the value of [app_slug][crate::model::GitHubEnterpriseConfig::app_slug].
1399 ///
1400 /// # Example
1401 /// ```ignore,no_run
1402 /// # use google_cloud_build_v2::model::GitHubEnterpriseConfig;
1403 /// let x = GitHubEnterpriseConfig::new().set_app_slug("example");
1404 /// ```
1405 pub fn set_app_slug<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1406 self.app_slug = v.into();
1407 self
1408 }
1409
1410 /// Sets the value of [private_key_secret_version][crate::model::GitHubEnterpriseConfig::private_key_secret_version].
1411 ///
1412 /// # Example
1413 /// ```ignore,no_run
1414 /// # use google_cloud_build_v2::model::GitHubEnterpriseConfig;
1415 /// let x = GitHubEnterpriseConfig::new().set_private_key_secret_version("example");
1416 /// ```
1417 pub fn set_private_key_secret_version<T: std::convert::Into<std::string::String>>(
1418 mut self,
1419 v: T,
1420 ) -> Self {
1421 self.private_key_secret_version = v.into();
1422 self
1423 }
1424
1425 /// Sets the value of [webhook_secret_secret_version][crate::model::GitHubEnterpriseConfig::webhook_secret_secret_version].
1426 ///
1427 /// # Example
1428 /// ```ignore,no_run
1429 /// # use google_cloud_build_v2::model::GitHubEnterpriseConfig;
1430 /// let x = GitHubEnterpriseConfig::new().set_webhook_secret_secret_version("example");
1431 /// ```
1432 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1433 mut self,
1434 v: T,
1435 ) -> Self {
1436 self.webhook_secret_secret_version = v.into();
1437 self
1438 }
1439
1440 /// Sets the value of [app_installation_id][crate::model::GitHubEnterpriseConfig::app_installation_id].
1441 ///
1442 /// # Example
1443 /// ```ignore,no_run
1444 /// # use google_cloud_build_v2::model::GitHubEnterpriseConfig;
1445 /// let x = GitHubEnterpriseConfig::new().set_app_installation_id(42);
1446 /// ```
1447 pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1448 self.app_installation_id = v.into();
1449 self
1450 }
1451
1452 /// Sets the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
1453 ///
1454 /// # Example
1455 /// ```ignore,no_run
1456 /// # use google_cloud_build_v2::model::GitHubEnterpriseConfig;
1457 /// use google_cloud_build_v2::model::ServiceDirectoryConfig;
1458 /// let x = GitHubEnterpriseConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
1459 /// ```
1460 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
1461 where
1462 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1463 {
1464 self.service_directory_config = std::option::Option::Some(v.into());
1465 self
1466 }
1467
1468 /// Sets or clears the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
1469 ///
1470 /// # Example
1471 /// ```ignore,no_run
1472 /// # use google_cloud_build_v2::model::GitHubEnterpriseConfig;
1473 /// use google_cloud_build_v2::model::ServiceDirectoryConfig;
1474 /// let x = GitHubEnterpriseConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
1475 /// let x = GitHubEnterpriseConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
1476 /// ```
1477 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
1478 where
1479 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1480 {
1481 self.service_directory_config = v.map(|x| x.into());
1482 self
1483 }
1484
1485 /// Sets the value of [ssl_ca][crate::model::GitHubEnterpriseConfig::ssl_ca].
1486 ///
1487 /// # Example
1488 /// ```ignore,no_run
1489 /// # use google_cloud_build_v2::model::GitHubEnterpriseConfig;
1490 /// let x = GitHubEnterpriseConfig::new().set_ssl_ca("example");
1491 /// ```
1492 pub fn set_ssl_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1493 self.ssl_ca = v.into();
1494 self
1495 }
1496
1497 /// Sets the value of [server_version][crate::model::GitHubEnterpriseConfig::server_version].
1498 ///
1499 /// # Example
1500 /// ```ignore,no_run
1501 /// # use google_cloud_build_v2::model::GitHubEnterpriseConfig;
1502 /// let x = GitHubEnterpriseConfig::new().set_server_version("example");
1503 /// ```
1504 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1505 self.server_version = v.into();
1506 self
1507 }
1508}
1509
1510impl wkt::message::Message for GitHubEnterpriseConfig {
1511 fn typename() -> &'static str {
1512 "type.googleapis.com/google.devtools.cloudbuild.v2.GitHubEnterpriseConfig"
1513 }
1514}
1515
1516/// Configuration for connections to gitlab.com or an instance of GitLab
1517/// Enterprise.
1518#[derive(Clone, Default, PartialEq)]
1519#[non_exhaustive]
1520pub struct GitLabConfig {
1521 /// The URI of the GitLab Enterprise host this connection is for.
1522 /// If not specified, the default value is <https://gitlab.com>.
1523 pub host_uri: std::string::String,
1524
1525 /// Required. Immutable. SecretManager resource containing the webhook secret
1526 /// of a GitLab Enterprise project, formatted as
1527 /// `projects/*/secrets/*/versions/*`.
1528 pub webhook_secret_secret_version: std::string::String,
1529
1530 /// Required. A GitLab personal access token with the minimum `read_api` scope
1531 /// access.
1532 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
1533
1534 /// Required. A GitLab personal access token with the `api` scope access.
1535 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
1536
1537 /// Configuration for using Service Directory to privately connect to a GitLab
1538 /// Enterprise server. This should only be set if the GitLab Enterprise server
1539 /// is hosted on-premises and not reachable by public internet. If this field
1540 /// is left empty, calls to the GitLab Enterprise server will be made over the
1541 /// public internet.
1542 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1543
1544 /// SSL certificate to use for requests to GitLab Enterprise.
1545 pub ssl_ca: std::string::String,
1546
1547 /// Output only. Version of the GitLab Enterprise server running on the
1548 /// `host_uri`.
1549 pub server_version: std::string::String,
1550
1551 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1552}
1553
1554impl GitLabConfig {
1555 /// Creates a new default instance.
1556 pub fn new() -> Self {
1557 std::default::Default::default()
1558 }
1559
1560 /// Sets the value of [host_uri][crate::model::GitLabConfig::host_uri].
1561 ///
1562 /// # Example
1563 /// ```ignore,no_run
1564 /// # use google_cloud_build_v2::model::GitLabConfig;
1565 /// let x = GitLabConfig::new().set_host_uri("example");
1566 /// ```
1567 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1568 self.host_uri = v.into();
1569 self
1570 }
1571
1572 /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabConfig::webhook_secret_secret_version].
1573 ///
1574 /// # Example
1575 /// ```ignore,no_run
1576 /// # use google_cloud_build_v2::model::GitLabConfig;
1577 /// let x = GitLabConfig::new().set_webhook_secret_secret_version("example");
1578 /// ```
1579 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1580 mut self,
1581 v: T,
1582 ) -> Self {
1583 self.webhook_secret_secret_version = v.into();
1584 self
1585 }
1586
1587 /// Sets the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
1588 ///
1589 /// # Example
1590 /// ```ignore,no_run
1591 /// # use google_cloud_build_v2::model::GitLabConfig;
1592 /// use google_cloud_build_v2::model::UserCredential;
1593 /// let x = GitLabConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
1594 /// ```
1595 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
1596 where
1597 T: std::convert::Into<crate::model::UserCredential>,
1598 {
1599 self.read_authorizer_credential = std::option::Option::Some(v.into());
1600 self
1601 }
1602
1603 /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
1604 ///
1605 /// # Example
1606 /// ```ignore,no_run
1607 /// # use google_cloud_build_v2::model::GitLabConfig;
1608 /// use google_cloud_build_v2::model::UserCredential;
1609 /// let x = GitLabConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
1610 /// let x = GitLabConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
1611 /// ```
1612 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1613 where
1614 T: std::convert::Into<crate::model::UserCredential>,
1615 {
1616 self.read_authorizer_credential = v.map(|x| x.into());
1617 self
1618 }
1619
1620 /// Sets the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
1621 ///
1622 /// # Example
1623 /// ```ignore,no_run
1624 /// # use google_cloud_build_v2::model::GitLabConfig;
1625 /// use google_cloud_build_v2::model::UserCredential;
1626 /// let x = GitLabConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
1627 /// ```
1628 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1629 where
1630 T: std::convert::Into<crate::model::UserCredential>,
1631 {
1632 self.authorizer_credential = std::option::Option::Some(v.into());
1633 self
1634 }
1635
1636 /// Sets or clears the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
1637 ///
1638 /// # Example
1639 /// ```ignore,no_run
1640 /// # use google_cloud_build_v2::model::GitLabConfig;
1641 /// use google_cloud_build_v2::model::UserCredential;
1642 /// let x = GitLabConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
1643 /// let x = GitLabConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
1644 /// ```
1645 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1646 where
1647 T: std::convert::Into<crate::model::UserCredential>,
1648 {
1649 self.authorizer_credential = v.map(|x| x.into());
1650 self
1651 }
1652
1653 /// Sets the value of [service_directory_config][crate::model::GitLabConfig::service_directory_config].
1654 ///
1655 /// # Example
1656 /// ```ignore,no_run
1657 /// # use google_cloud_build_v2::model::GitLabConfig;
1658 /// use google_cloud_build_v2::model::ServiceDirectoryConfig;
1659 /// let x = GitLabConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
1660 /// ```
1661 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
1662 where
1663 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1664 {
1665 self.service_directory_config = std::option::Option::Some(v.into());
1666 self
1667 }
1668
1669 /// Sets or clears the value of [service_directory_config][crate::model::GitLabConfig::service_directory_config].
1670 ///
1671 /// # Example
1672 /// ```ignore,no_run
1673 /// # use google_cloud_build_v2::model::GitLabConfig;
1674 /// use google_cloud_build_v2::model::ServiceDirectoryConfig;
1675 /// let x = GitLabConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
1676 /// let x = GitLabConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
1677 /// ```
1678 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
1679 where
1680 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1681 {
1682 self.service_directory_config = v.map(|x| x.into());
1683 self
1684 }
1685
1686 /// Sets the value of [ssl_ca][crate::model::GitLabConfig::ssl_ca].
1687 ///
1688 /// # Example
1689 /// ```ignore,no_run
1690 /// # use google_cloud_build_v2::model::GitLabConfig;
1691 /// let x = GitLabConfig::new().set_ssl_ca("example");
1692 /// ```
1693 pub fn set_ssl_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1694 self.ssl_ca = v.into();
1695 self
1696 }
1697
1698 /// Sets the value of [server_version][crate::model::GitLabConfig::server_version].
1699 ///
1700 /// # Example
1701 /// ```ignore,no_run
1702 /// # use google_cloud_build_v2::model::GitLabConfig;
1703 /// let x = GitLabConfig::new().set_server_version("example");
1704 /// ```
1705 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1706 self.server_version = v.into();
1707 self
1708 }
1709}
1710
1711impl wkt::message::Message for GitLabConfig {
1712 fn typename() -> &'static str {
1713 "type.googleapis.com/google.devtools.cloudbuild.v2.GitLabConfig"
1714 }
1715}
1716
1717/// Configuration for connections to Bitbucket Data Center.
1718#[derive(Clone, Default, PartialEq)]
1719#[non_exhaustive]
1720pub struct BitbucketDataCenterConfig {
1721 /// Required. The URI of the Bitbucket Data Center instance or cluster this
1722 /// connection is for.
1723 pub host_uri: std::string::String,
1724
1725 /// Required. Immutable. SecretManager resource containing the webhook secret
1726 /// used to verify webhook events, formatted as
1727 /// `projects/*/secrets/*/versions/*`.
1728 pub webhook_secret_secret_version: std::string::String,
1729
1730 /// Required. A http access token with the `REPO_READ` access.
1731 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
1732
1733 /// Required. A http access token with the `REPO_ADMIN` scope access.
1734 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
1735
1736 /// Optional. Configuration for using Service Directory to privately connect to
1737 /// a Bitbucket Data Center. This should only be set if the Bitbucket Data
1738 /// Center is hosted on-premises and not reachable by public internet. If this
1739 /// field is left empty, calls to the Bitbucket Data Center will be made over
1740 /// the public internet.
1741 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1742
1743 /// Optional. SSL certificate to use for requests to the Bitbucket Data Center.
1744 pub ssl_ca: std::string::String,
1745
1746 /// Output only. Version of the Bitbucket Data Center running on the
1747 /// `host_uri`.
1748 pub server_version: std::string::String,
1749
1750 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1751}
1752
1753impl BitbucketDataCenterConfig {
1754 /// Creates a new default instance.
1755 pub fn new() -> Self {
1756 std::default::Default::default()
1757 }
1758
1759 /// Sets the value of [host_uri][crate::model::BitbucketDataCenterConfig::host_uri].
1760 ///
1761 /// # Example
1762 /// ```ignore,no_run
1763 /// # use google_cloud_build_v2::model::BitbucketDataCenterConfig;
1764 /// let x = BitbucketDataCenterConfig::new().set_host_uri("example");
1765 /// ```
1766 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1767 self.host_uri = v.into();
1768 self
1769 }
1770
1771 /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketDataCenterConfig::webhook_secret_secret_version].
1772 ///
1773 /// # Example
1774 /// ```ignore,no_run
1775 /// # use google_cloud_build_v2::model::BitbucketDataCenterConfig;
1776 /// let x = BitbucketDataCenterConfig::new().set_webhook_secret_secret_version("example");
1777 /// ```
1778 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1779 mut self,
1780 v: T,
1781 ) -> Self {
1782 self.webhook_secret_secret_version = v.into();
1783 self
1784 }
1785
1786 /// Sets the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
1787 ///
1788 /// # Example
1789 /// ```ignore,no_run
1790 /// # use google_cloud_build_v2::model::BitbucketDataCenterConfig;
1791 /// use google_cloud_build_v2::model::UserCredential;
1792 /// let x = BitbucketDataCenterConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
1793 /// ```
1794 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
1795 where
1796 T: std::convert::Into<crate::model::UserCredential>,
1797 {
1798 self.read_authorizer_credential = std::option::Option::Some(v.into());
1799 self
1800 }
1801
1802 /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
1803 ///
1804 /// # Example
1805 /// ```ignore,no_run
1806 /// # use google_cloud_build_v2::model::BitbucketDataCenterConfig;
1807 /// use google_cloud_build_v2::model::UserCredential;
1808 /// let x = BitbucketDataCenterConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
1809 /// let x = BitbucketDataCenterConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
1810 /// ```
1811 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1812 where
1813 T: std::convert::Into<crate::model::UserCredential>,
1814 {
1815 self.read_authorizer_credential = v.map(|x| x.into());
1816 self
1817 }
1818
1819 /// Sets the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
1820 ///
1821 /// # Example
1822 /// ```ignore,no_run
1823 /// # use google_cloud_build_v2::model::BitbucketDataCenterConfig;
1824 /// use google_cloud_build_v2::model::UserCredential;
1825 /// let x = BitbucketDataCenterConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
1826 /// ```
1827 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1828 where
1829 T: std::convert::Into<crate::model::UserCredential>,
1830 {
1831 self.authorizer_credential = std::option::Option::Some(v.into());
1832 self
1833 }
1834
1835 /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
1836 ///
1837 /// # Example
1838 /// ```ignore,no_run
1839 /// # use google_cloud_build_v2::model::BitbucketDataCenterConfig;
1840 /// use google_cloud_build_v2::model::UserCredential;
1841 /// let x = BitbucketDataCenterConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
1842 /// let x = BitbucketDataCenterConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
1843 /// ```
1844 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1845 where
1846 T: std::convert::Into<crate::model::UserCredential>,
1847 {
1848 self.authorizer_credential = v.map(|x| x.into());
1849 self
1850 }
1851
1852 /// Sets the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
1853 ///
1854 /// # Example
1855 /// ```ignore,no_run
1856 /// # use google_cloud_build_v2::model::BitbucketDataCenterConfig;
1857 /// use google_cloud_build_v2::model::ServiceDirectoryConfig;
1858 /// let x = BitbucketDataCenterConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
1859 /// ```
1860 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
1861 where
1862 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1863 {
1864 self.service_directory_config = std::option::Option::Some(v.into());
1865 self
1866 }
1867
1868 /// Sets or clears the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
1869 ///
1870 /// # Example
1871 /// ```ignore,no_run
1872 /// # use google_cloud_build_v2::model::BitbucketDataCenterConfig;
1873 /// use google_cloud_build_v2::model::ServiceDirectoryConfig;
1874 /// let x = BitbucketDataCenterConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
1875 /// let x = BitbucketDataCenterConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
1876 /// ```
1877 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
1878 where
1879 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1880 {
1881 self.service_directory_config = v.map(|x| x.into());
1882 self
1883 }
1884
1885 /// Sets the value of [ssl_ca][crate::model::BitbucketDataCenterConfig::ssl_ca].
1886 ///
1887 /// # Example
1888 /// ```ignore,no_run
1889 /// # use google_cloud_build_v2::model::BitbucketDataCenterConfig;
1890 /// let x = BitbucketDataCenterConfig::new().set_ssl_ca("example");
1891 /// ```
1892 pub fn set_ssl_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1893 self.ssl_ca = v.into();
1894 self
1895 }
1896
1897 /// Sets the value of [server_version][crate::model::BitbucketDataCenterConfig::server_version].
1898 ///
1899 /// # Example
1900 /// ```ignore,no_run
1901 /// # use google_cloud_build_v2::model::BitbucketDataCenterConfig;
1902 /// let x = BitbucketDataCenterConfig::new().set_server_version("example");
1903 /// ```
1904 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1905 self.server_version = v.into();
1906 self
1907 }
1908}
1909
1910impl wkt::message::Message for BitbucketDataCenterConfig {
1911 fn typename() -> &'static str {
1912 "type.googleapis.com/google.devtools.cloudbuild.v2.BitbucketDataCenterConfig"
1913 }
1914}
1915
1916/// Configuration for connections to Bitbucket Cloud.
1917#[derive(Clone, Default, PartialEq)]
1918#[non_exhaustive]
1919pub struct BitbucketCloudConfig {
1920 /// Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud
1921 /// Platform.
1922 pub workspace: std::string::String,
1923
1924 /// Required. SecretManager resource containing the webhook secret used to
1925 /// verify webhook events, formatted as `projects/*/secrets/*/versions/*`.
1926 pub webhook_secret_secret_version: std::string::String,
1927
1928 /// Required. An access token with the `repository` access. It can be either a
1929 /// workspace, project or repository access token. It's recommended to use a
1930 /// system account to generate the credentials.
1931 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
1932
1933 /// Required. An access token with the `webhook`, `repository`,
1934 /// `repository:admin` and `pullrequest` scope access. It can be either a
1935 /// workspace, project or repository access token. It's recommended to use a
1936 /// system account to generate these credentials.
1937 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
1938
1939 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1940}
1941
1942impl BitbucketCloudConfig {
1943 /// Creates a new default instance.
1944 pub fn new() -> Self {
1945 std::default::Default::default()
1946 }
1947
1948 /// Sets the value of [workspace][crate::model::BitbucketCloudConfig::workspace].
1949 ///
1950 /// # Example
1951 /// ```ignore,no_run
1952 /// # use google_cloud_build_v2::model::BitbucketCloudConfig;
1953 /// let x = BitbucketCloudConfig::new().set_workspace("example");
1954 /// ```
1955 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1956 self.workspace = v.into();
1957 self
1958 }
1959
1960 /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketCloudConfig::webhook_secret_secret_version].
1961 ///
1962 /// # Example
1963 /// ```ignore,no_run
1964 /// # use google_cloud_build_v2::model::BitbucketCloudConfig;
1965 /// let x = BitbucketCloudConfig::new().set_webhook_secret_secret_version("example");
1966 /// ```
1967 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1968 mut self,
1969 v: T,
1970 ) -> Self {
1971 self.webhook_secret_secret_version = v.into();
1972 self
1973 }
1974
1975 /// Sets the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
1976 ///
1977 /// # Example
1978 /// ```ignore,no_run
1979 /// # use google_cloud_build_v2::model::BitbucketCloudConfig;
1980 /// use google_cloud_build_v2::model::UserCredential;
1981 /// let x = BitbucketCloudConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
1982 /// ```
1983 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
1984 where
1985 T: std::convert::Into<crate::model::UserCredential>,
1986 {
1987 self.read_authorizer_credential = std::option::Option::Some(v.into());
1988 self
1989 }
1990
1991 /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
1992 ///
1993 /// # Example
1994 /// ```ignore,no_run
1995 /// # use google_cloud_build_v2::model::BitbucketCloudConfig;
1996 /// use google_cloud_build_v2::model::UserCredential;
1997 /// let x = BitbucketCloudConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
1998 /// let x = BitbucketCloudConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
1999 /// ```
2000 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2001 where
2002 T: std::convert::Into<crate::model::UserCredential>,
2003 {
2004 self.read_authorizer_credential = v.map(|x| x.into());
2005 self
2006 }
2007
2008 /// Sets the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
2009 ///
2010 /// # Example
2011 /// ```ignore,no_run
2012 /// # use google_cloud_build_v2::model::BitbucketCloudConfig;
2013 /// use google_cloud_build_v2::model::UserCredential;
2014 /// let x = BitbucketCloudConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2015 /// ```
2016 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2017 where
2018 T: std::convert::Into<crate::model::UserCredential>,
2019 {
2020 self.authorizer_credential = std::option::Option::Some(v.into());
2021 self
2022 }
2023
2024 /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
2025 ///
2026 /// # Example
2027 /// ```ignore,no_run
2028 /// # use google_cloud_build_v2::model::BitbucketCloudConfig;
2029 /// use google_cloud_build_v2::model::UserCredential;
2030 /// let x = BitbucketCloudConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2031 /// let x = BitbucketCloudConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2032 /// ```
2033 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2034 where
2035 T: std::convert::Into<crate::model::UserCredential>,
2036 {
2037 self.authorizer_credential = v.map(|x| x.into());
2038 self
2039 }
2040}
2041
2042impl wkt::message::Message for BitbucketCloudConfig {
2043 fn typename() -> &'static str {
2044 "type.googleapis.com/google.devtools.cloudbuild.v2.BitbucketCloudConfig"
2045 }
2046}
2047
2048/// ServiceDirectoryConfig represents Service Directory configuration for a
2049/// connection.
2050#[derive(Clone, Default, PartialEq)]
2051#[non_exhaustive]
2052pub struct ServiceDirectoryConfig {
2053 /// Required. The Service Directory service name.
2054 /// Format:
2055 /// projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
2056 pub service: std::string::String,
2057
2058 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2059}
2060
2061impl ServiceDirectoryConfig {
2062 /// Creates a new default instance.
2063 pub fn new() -> Self {
2064 std::default::Default::default()
2065 }
2066
2067 /// Sets the value of [service][crate::model::ServiceDirectoryConfig::service].
2068 ///
2069 /// # Example
2070 /// ```ignore,no_run
2071 /// # use google_cloud_build_v2::model::ServiceDirectoryConfig;
2072 /// let x = ServiceDirectoryConfig::new().set_service("example");
2073 /// ```
2074 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2075 self.service = v.into();
2076 self
2077 }
2078}
2079
2080impl wkt::message::Message for ServiceDirectoryConfig {
2081 fn typename() -> &'static str {
2082 "type.googleapis.com/google.devtools.cloudbuild.v2.ServiceDirectoryConfig"
2083 }
2084}
2085
2086/// A repository associated to a parent connection.
2087#[derive(Clone, Default, PartialEq)]
2088#[non_exhaustive]
2089pub struct Repository {
2090 /// Immutable. Resource name of the repository, in the format
2091 /// `projects/*/locations/*/connections/*/repositories/*`.
2092 pub name: std::string::String,
2093
2094 /// Required. Git Clone HTTPS URI.
2095 pub remote_uri: std::string::String,
2096
2097 /// Output only. Server assigned timestamp for when the connection was created.
2098 pub create_time: std::option::Option<wkt::Timestamp>,
2099
2100 /// Output only. Server assigned timestamp for when the connection was updated.
2101 pub update_time: std::option::Option<wkt::Timestamp>,
2102
2103 /// Allows clients to store small amounts of arbitrary data.
2104 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
2105
2106 /// This checksum is computed by the server based on the value of other
2107 /// fields, and may be sent on update and delete requests to ensure the
2108 /// client has an up-to-date value before proceeding.
2109 pub etag: std::string::String,
2110
2111 /// Output only. External ID of the webhook created for the repository.
2112 pub webhook_id: std::string::String,
2113
2114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2115}
2116
2117impl Repository {
2118 /// Creates a new default instance.
2119 pub fn new() -> Self {
2120 std::default::Default::default()
2121 }
2122
2123 /// Sets the value of [name][crate::model::Repository::name].
2124 ///
2125 /// # Example
2126 /// ```ignore,no_run
2127 /// # use google_cloud_build_v2::model::Repository;
2128 /// # let project_id = "project_id";
2129 /// # let location_id = "location_id";
2130 /// # let connection_id = "connection_id";
2131 /// # let repository_id = "repository_id";
2132 /// let x = Repository::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/repositories/{repository_id}"));
2133 /// ```
2134 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2135 self.name = v.into();
2136 self
2137 }
2138
2139 /// Sets the value of [remote_uri][crate::model::Repository::remote_uri].
2140 ///
2141 /// # Example
2142 /// ```ignore,no_run
2143 /// # use google_cloud_build_v2::model::Repository;
2144 /// let x = Repository::new().set_remote_uri("example");
2145 /// ```
2146 pub fn set_remote_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2147 self.remote_uri = v.into();
2148 self
2149 }
2150
2151 /// Sets the value of [create_time][crate::model::Repository::create_time].
2152 ///
2153 /// # Example
2154 /// ```ignore,no_run
2155 /// # use google_cloud_build_v2::model::Repository;
2156 /// use wkt::Timestamp;
2157 /// let x = Repository::new().set_create_time(Timestamp::default()/* use setters */);
2158 /// ```
2159 pub fn set_create_time<T>(mut self, v: T) -> Self
2160 where
2161 T: std::convert::Into<wkt::Timestamp>,
2162 {
2163 self.create_time = std::option::Option::Some(v.into());
2164 self
2165 }
2166
2167 /// Sets or clears the value of [create_time][crate::model::Repository::create_time].
2168 ///
2169 /// # Example
2170 /// ```ignore,no_run
2171 /// # use google_cloud_build_v2::model::Repository;
2172 /// use wkt::Timestamp;
2173 /// let x = Repository::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2174 /// let x = Repository::new().set_or_clear_create_time(None::<Timestamp>);
2175 /// ```
2176 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2177 where
2178 T: std::convert::Into<wkt::Timestamp>,
2179 {
2180 self.create_time = v.map(|x| x.into());
2181 self
2182 }
2183
2184 /// Sets the value of [update_time][crate::model::Repository::update_time].
2185 ///
2186 /// # Example
2187 /// ```ignore,no_run
2188 /// # use google_cloud_build_v2::model::Repository;
2189 /// use wkt::Timestamp;
2190 /// let x = Repository::new().set_update_time(Timestamp::default()/* use setters */);
2191 /// ```
2192 pub fn set_update_time<T>(mut self, v: T) -> Self
2193 where
2194 T: std::convert::Into<wkt::Timestamp>,
2195 {
2196 self.update_time = std::option::Option::Some(v.into());
2197 self
2198 }
2199
2200 /// Sets or clears the value of [update_time][crate::model::Repository::update_time].
2201 ///
2202 /// # Example
2203 /// ```ignore,no_run
2204 /// # use google_cloud_build_v2::model::Repository;
2205 /// use wkt::Timestamp;
2206 /// let x = Repository::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2207 /// let x = Repository::new().set_or_clear_update_time(None::<Timestamp>);
2208 /// ```
2209 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2210 where
2211 T: std::convert::Into<wkt::Timestamp>,
2212 {
2213 self.update_time = v.map(|x| x.into());
2214 self
2215 }
2216
2217 /// Sets the value of [annotations][crate::model::Repository::annotations].
2218 ///
2219 /// # Example
2220 /// ```ignore,no_run
2221 /// # use google_cloud_build_v2::model::Repository;
2222 /// let x = Repository::new().set_annotations([
2223 /// ("key0", "abc"),
2224 /// ("key1", "xyz"),
2225 /// ]);
2226 /// ```
2227 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
2228 where
2229 T: std::iter::IntoIterator<Item = (K, V)>,
2230 K: std::convert::Into<std::string::String>,
2231 V: std::convert::Into<std::string::String>,
2232 {
2233 use std::iter::Iterator;
2234 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2235 self
2236 }
2237
2238 /// Sets the value of [etag][crate::model::Repository::etag].
2239 ///
2240 /// # Example
2241 /// ```ignore,no_run
2242 /// # use google_cloud_build_v2::model::Repository;
2243 /// let x = Repository::new().set_etag("example");
2244 /// ```
2245 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2246 self.etag = v.into();
2247 self
2248 }
2249
2250 /// Sets the value of [webhook_id][crate::model::Repository::webhook_id].
2251 ///
2252 /// # Example
2253 /// ```ignore,no_run
2254 /// # use google_cloud_build_v2::model::Repository;
2255 /// let x = Repository::new().set_webhook_id("example");
2256 /// ```
2257 pub fn set_webhook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2258 self.webhook_id = v.into();
2259 self
2260 }
2261}
2262
2263impl wkt::message::Message for Repository {
2264 fn typename() -> &'static str {
2265 "type.googleapis.com/google.devtools.cloudbuild.v2.Repository"
2266 }
2267}
2268
2269/// Represents an OAuth token of the account that authorized the Connection,
2270/// and associated metadata.
2271#[derive(Clone, Default, PartialEq)]
2272#[non_exhaustive]
2273pub struct OAuthCredential {
2274 /// A SecretManager resource containing the OAuth token that authorizes
2275 /// the Cloud Build connection. Format: `projects/*/secrets/*/versions/*`.
2276 pub oauth_token_secret_version: std::string::String,
2277
2278 /// Output only. The username associated to this token.
2279 pub username: std::string::String,
2280
2281 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2282}
2283
2284impl OAuthCredential {
2285 /// Creates a new default instance.
2286 pub fn new() -> Self {
2287 std::default::Default::default()
2288 }
2289
2290 /// Sets the value of [oauth_token_secret_version][crate::model::OAuthCredential::oauth_token_secret_version].
2291 ///
2292 /// # Example
2293 /// ```ignore,no_run
2294 /// # use google_cloud_build_v2::model::OAuthCredential;
2295 /// let x = OAuthCredential::new().set_oauth_token_secret_version("example");
2296 /// ```
2297 pub fn set_oauth_token_secret_version<T: std::convert::Into<std::string::String>>(
2298 mut self,
2299 v: T,
2300 ) -> Self {
2301 self.oauth_token_secret_version = v.into();
2302 self
2303 }
2304
2305 /// Sets the value of [username][crate::model::OAuthCredential::username].
2306 ///
2307 /// # Example
2308 /// ```ignore,no_run
2309 /// # use google_cloud_build_v2::model::OAuthCredential;
2310 /// let x = OAuthCredential::new().set_username("example");
2311 /// ```
2312 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2313 self.username = v.into();
2314 self
2315 }
2316}
2317
2318impl wkt::message::Message for OAuthCredential {
2319 fn typename() -> &'static str {
2320 "type.googleapis.com/google.devtools.cloudbuild.v2.OAuthCredential"
2321 }
2322}
2323
2324/// Represents a personal access token that authorized the Connection,
2325/// and associated metadata.
2326#[derive(Clone, Default, PartialEq)]
2327#[non_exhaustive]
2328pub struct UserCredential {
2329 /// Required. A SecretManager resource containing the user token that
2330 /// authorizes the Cloud Build connection. Format:
2331 /// `projects/*/secrets/*/versions/*`.
2332 pub user_token_secret_version: std::string::String,
2333
2334 /// Output only. The username associated to this token.
2335 pub username: std::string::String,
2336
2337 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2338}
2339
2340impl UserCredential {
2341 /// Creates a new default instance.
2342 pub fn new() -> Self {
2343 std::default::Default::default()
2344 }
2345
2346 /// Sets the value of [user_token_secret_version][crate::model::UserCredential::user_token_secret_version].
2347 ///
2348 /// # Example
2349 /// ```ignore,no_run
2350 /// # use google_cloud_build_v2::model::UserCredential;
2351 /// let x = UserCredential::new().set_user_token_secret_version("example");
2352 /// ```
2353 pub fn set_user_token_secret_version<T: std::convert::Into<std::string::String>>(
2354 mut self,
2355 v: T,
2356 ) -> Self {
2357 self.user_token_secret_version = v.into();
2358 self
2359 }
2360
2361 /// Sets the value of [username][crate::model::UserCredential::username].
2362 ///
2363 /// # Example
2364 /// ```ignore,no_run
2365 /// # use google_cloud_build_v2::model::UserCredential;
2366 /// let x = UserCredential::new().set_username("example");
2367 /// ```
2368 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2369 self.username = v.into();
2370 self
2371 }
2372}
2373
2374impl wkt::message::Message for UserCredential {
2375 fn typename() -> &'static str {
2376 "type.googleapis.com/google.devtools.cloudbuild.v2.UserCredential"
2377 }
2378}
2379
2380/// Message for creating a Connection
2381#[derive(Clone, Default, PartialEq)]
2382#[non_exhaustive]
2383pub struct CreateConnectionRequest {
2384 /// Required. Project and location where the connection will be created.
2385 /// Format: `projects/*/locations/*`.
2386 pub parent: std::string::String,
2387
2388 /// Required. The Connection to create.
2389 pub connection: std::option::Option<crate::model::Connection>,
2390
2391 /// Required. The ID to use for the Connection, which will become the final
2392 /// component of the Connection's resource name. Names must be unique
2393 /// per-project per-location. Allows alphanumeric characters and any of
2394 /// -._~%!$&'()*+,;=@.
2395 pub connection_id: std::string::String,
2396
2397 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2398}
2399
2400impl CreateConnectionRequest {
2401 /// Creates a new default instance.
2402 pub fn new() -> Self {
2403 std::default::Default::default()
2404 }
2405
2406 /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
2407 ///
2408 /// # Example
2409 /// ```ignore,no_run
2410 /// # use google_cloud_build_v2::model::CreateConnectionRequest;
2411 /// # let project_id = "project_id";
2412 /// # let location_id = "location_id";
2413 /// let x = CreateConnectionRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
2414 /// ```
2415 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2416 self.parent = v.into();
2417 self
2418 }
2419
2420 /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
2421 ///
2422 /// # Example
2423 /// ```ignore,no_run
2424 /// # use google_cloud_build_v2::model::CreateConnectionRequest;
2425 /// use google_cloud_build_v2::model::Connection;
2426 /// let x = CreateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
2427 /// ```
2428 pub fn set_connection<T>(mut self, v: T) -> Self
2429 where
2430 T: std::convert::Into<crate::model::Connection>,
2431 {
2432 self.connection = std::option::Option::Some(v.into());
2433 self
2434 }
2435
2436 /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
2437 ///
2438 /// # Example
2439 /// ```ignore,no_run
2440 /// # use google_cloud_build_v2::model::CreateConnectionRequest;
2441 /// use google_cloud_build_v2::model::Connection;
2442 /// let x = CreateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
2443 /// let x = CreateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
2444 /// ```
2445 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
2446 where
2447 T: std::convert::Into<crate::model::Connection>,
2448 {
2449 self.connection = v.map(|x| x.into());
2450 self
2451 }
2452
2453 /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
2454 ///
2455 /// # Example
2456 /// ```ignore,no_run
2457 /// # use google_cloud_build_v2::model::CreateConnectionRequest;
2458 /// let x = CreateConnectionRequest::new().set_connection_id("example");
2459 /// ```
2460 pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2461 self.connection_id = v.into();
2462 self
2463 }
2464}
2465
2466impl wkt::message::Message for CreateConnectionRequest {
2467 fn typename() -> &'static str {
2468 "type.googleapis.com/google.devtools.cloudbuild.v2.CreateConnectionRequest"
2469 }
2470}
2471
2472/// Message for getting the details of a Connection.
2473#[derive(Clone, Default, PartialEq)]
2474#[non_exhaustive]
2475pub struct GetConnectionRequest {
2476 /// Required. The name of the Connection to retrieve.
2477 /// Format: `projects/*/locations/*/connections/*`.
2478 pub name: std::string::String,
2479
2480 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2481}
2482
2483impl GetConnectionRequest {
2484 /// Creates a new default instance.
2485 pub fn new() -> Self {
2486 std::default::Default::default()
2487 }
2488
2489 /// Sets the value of [name][crate::model::GetConnectionRequest::name].
2490 ///
2491 /// # Example
2492 /// ```ignore,no_run
2493 /// # use google_cloud_build_v2::model::GetConnectionRequest;
2494 /// # let project_id = "project_id";
2495 /// # let location_id = "location_id";
2496 /// # let connection_id = "connection_id";
2497 /// let x = GetConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
2498 /// ```
2499 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2500 self.name = v.into();
2501 self
2502 }
2503}
2504
2505impl wkt::message::Message for GetConnectionRequest {
2506 fn typename() -> &'static str {
2507 "type.googleapis.com/google.devtools.cloudbuild.v2.GetConnectionRequest"
2508 }
2509}
2510
2511/// Message for requesting list of Connections.
2512#[derive(Clone, Default, PartialEq)]
2513#[non_exhaustive]
2514pub struct ListConnectionsRequest {
2515 /// Required. The parent, which owns this collection of Connections.
2516 /// Format: `projects/*/locations/*`.
2517 pub parent: std::string::String,
2518
2519 /// Number of results to return in the list.
2520 pub page_size: i32,
2521
2522 /// Page start.
2523 pub page_token: std::string::String,
2524
2525 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2526}
2527
2528impl ListConnectionsRequest {
2529 /// Creates a new default instance.
2530 pub fn new() -> Self {
2531 std::default::Default::default()
2532 }
2533
2534 /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
2535 ///
2536 /// # Example
2537 /// ```ignore,no_run
2538 /// # use google_cloud_build_v2::model::ListConnectionsRequest;
2539 /// # let project_id = "project_id";
2540 /// # let location_id = "location_id";
2541 /// let x = ListConnectionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
2542 /// ```
2543 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2544 self.parent = v.into();
2545 self
2546 }
2547
2548 /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
2549 ///
2550 /// # Example
2551 /// ```ignore,no_run
2552 /// # use google_cloud_build_v2::model::ListConnectionsRequest;
2553 /// let x = ListConnectionsRequest::new().set_page_size(42);
2554 /// ```
2555 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2556 self.page_size = v.into();
2557 self
2558 }
2559
2560 /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
2561 ///
2562 /// # Example
2563 /// ```ignore,no_run
2564 /// # use google_cloud_build_v2::model::ListConnectionsRequest;
2565 /// let x = ListConnectionsRequest::new().set_page_token("example");
2566 /// ```
2567 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2568 self.page_token = v.into();
2569 self
2570 }
2571}
2572
2573impl wkt::message::Message for ListConnectionsRequest {
2574 fn typename() -> &'static str {
2575 "type.googleapis.com/google.devtools.cloudbuild.v2.ListConnectionsRequest"
2576 }
2577}
2578
2579/// Message for response to listing Connections.
2580#[derive(Clone, Default, PartialEq)]
2581#[non_exhaustive]
2582pub struct ListConnectionsResponse {
2583 /// The list of Connections.
2584 pub connections: std::vec::Vec<crate::model::Connection>,
2585
2586 /// A token identifying a page of results the server should return.
2587 pub next_page_token: std::string::String,
2588
2589 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2590}
2591
2592impl ListConnectionsResponse {
2593 /// Creates a new default instance.
2594 pub fn new() -> Self {
2595 std::default::Default::default()
2596 }
2597
2598 /// Sets the value of [connections][crate::model::ListConnectionsResponse::connections].
2599 ///
2600 /// # Example
2601 /// ```ignore,no_run
2602 /// # use google_cloud_build_v2::model::ListConnectionsResponse;
2603 /// use google_cloud_build_v2::model::Connection;
2604 /// let x = ListConnectionsResponse::new()
2605 /// .set_connections([
2606 /// Connection::default()/* use setters */,
2607 /// Connection::default()/* use (different) setters */,
2608 /// ]);
2609 /// ```
2610 pub fn set_connections<T, V>(mut self, v: T) -> Self
2611 where
2612 T: std::iter::IntoIterator<Item = V>,
2613 V: std::convert::Into<crate::model::Connection>,
2614 {
2615 use std::iter::Iterator;
2616 self.connections = v.into_iter().map(|i| i.into()).collect();
2617 self
2618 }
2619
2620 /// Sets the value of [next_page_token][crate::model::ListConnectionsResponse::next_page_token].
2621 ///
2622 /// # Example
2623 /// ```ignore,no_run
2624 /// # use google_cloud_build_v2::model::ListConnectionsResponse;
2625 /// let x = ListConnectionsResponse::new().set_next_page_token("example");
2626 /// ```
2627 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2628 self.next_page_token = v.into();
2629 self
2630 }
2631}
2632
2633impl wkt::message::Message for ListConnectionsResponse {
2634 fn typename() -> &'static str {
2635 "type.googleapis.com/google.devtools.cloudbuild.v2.ListConnectionsResponse"
2636 }
2637}
2638
2639#[doc(hidden)]
2640impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionsResponse {
2641 type PageItem = crate::model::Connection;
2642
2643 fn items(self) -> std::vec::Vec<Self::PageItem> {
2644 self.connections
2645 }
2646
2647 fn next_page_token(&self) -> std::string::String {
2648 use std::clone::Clone;
2649 self.next_page_token.clone()
2650 }
2651}
2652
2653/// Message for updating a Connection.
2654#[derive(Clone, Default, PartialEq)]
2655#[non_exhaustive]
2656pub struct UpdateConnectionRequest {
2657 /// Required. The Connection to update.
2658 pub connection: std::option::Option<crate::model::Connection>,
2659
2660 /// The list of fields to be updated.
2661 pub update_mask: std::option::Option<wkt::FieldMask>,
2662
2663 /// If set to true, and the connection is not found a new connection
2664 /// will be created. In this situation `update_mask` is ignored.
2665 /// The creation will succeed only if the input connection has all the
2666 /// necessary information (e.g a github_config with both user_oauth_token and
2667 /// installation_id properties).
2668 pub allow_missing: bool,
2669
2670 /// The current etag of the connection.
2671 /// If an etag is provided and does not match the current etag of the
2672 /// connection, update will be blocked and an ABORTED error will be returned.
2673 pub etag: std::string::String,
2674
2675 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2676}
2677
2678impl UpdateConnectionRequest {
2679 /// Creates a new default instance.
2680 pub fn new() -> Self {
2681 std::default::Default::default()
2682 }
2683
2684 /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
2685 ///
2686 /// # Example
2687 /// ```ignore,no_run
2688 /// # use google_cloud_build_v2::model::UpdateConnectionRequest;
2689 /// use google_cloud_build_v2::model::Connection;
2690 /// let x = UpdateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
2691 /// ```
2692 pub fn set_connection<T>(mut self, v: T) -> Self
2693 where
2694 T: std::convert::Into<crate::model::Connection>,
2695 {
2696 self.connection = std::option::Option::Some(v.into());
2697 self
2698 }
2699
2700 /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
2701 ///
2702 /// # Example
2703 /// ```ignore,no_run
2704 /// # use google_cloud_build_v2::model::UpdateConnectionRequest;
2705 /// use google_cloud_build_v2::model::Connection;
2706 /// let x = UpdateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
2707 /// let x = UpdateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
2708 /// ```
2709 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
2710 where
2711 T: std::convert::Into<crate::model::Connection>,
2712 {
2713 self.connection = v.map(|x| x.into());
2714 self
2715 }
2716
2717 /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
2718 ///
2719 /// # Example
2720 /// ```ignore,no_run
2721 /// # use google_cloud_build_v2::model::UpdateConnectionRequest;
2722 /// use wkt::FieldMask;
2723 /// let x = UpdateConnectionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2724 /// ```
2725 pub fn set_update_mask<T>(mut self, v: T) -> Self
2726 where
2727 T: std::convert::Into<wkt::FieldMask>,
2728 {
2729 self.update_mask = std::option::Option::Some(v.into());
2730 self
2731 }
2732
2733 /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
2734 ///
2735 /// # Example
2736 /// ```ignore,no_run
2737 /// # use google_cloud_build_v2::model::UpdateConnectionRequest;
2738 /// use wkt::FieldMask;
2739 /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2740 /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2741 /// ```
2742 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2743 where
2744 T: std::convert::Into<wkt::FieldMask>,
2745 {
2746 self.update_mask = v.map(|x| x.into());
2747 self
2748 }
2749
2750 /// Sets the value of [allow_missing][crate::model::UpdateConnectionRequest::allow_missing].
2751 ///
2752 /// # Example
2753 /// ```ignore,no_run
2754 /// # use google_cloud_build_v2::model::UpdateConnectionRequest;
2755 /// let x = UpdateConnectionRequest::new().set_allow_missing(true);
2756 /// ```
2757 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2758 self.allow_missing = v.into();
2759 self
2760 }
2761
2762 /// Sets the value of [etag][crate::model::UpdateConnectionRequest::etag].
2763 ///
2764 /// # Example
2765 /// ```ignore,no_run
2766 /// # use google_cloud_build_v2::model::UpdateConnectionRequest;
2767 /// let x = UpdateConnectionRequest::new().set_etag("example");
2768 /// ```
2769 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2770 self.etag = v.into();
2771 self
2772 }
2773}
2774
2775impl wkt::message::Message for UpdateConnectionRequest {
2776 fn typename() -> &'static str {
2777 "type.googleapis.com/google.devtools.cloudbuild.v2.UpdateConnectionRequest"
2778 }
2779}
2780
2781/// Message for deleting a Connection.
2782#[derive(Clone, Default, PartialEq)]
2783#[non_exhaustive]
2784pub struct DeleteConnectionRequest {
2785 /// Required. The name of the Connection to delete.
2786 /// Format: `projects/*/locations/*/connections/*`.
2787 pub name: std::string::String,
2788
2789 /// The current etag of the connection.
2790 /// If an etag is provided and does not match the current etag of the
2791 /// connection, deletion will be blocked and an ABORTED error will be returned.
2792 pub etag: std::string::String,
2793
2794 /// If set, validate the request, but do not actually post it.
2795 pub validate_only: bool,
2796
2797 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2798}
2799
2800impl DeleteConnectionRequest {
2801 /// Creates a new default instance.
2802 pub fn new() -> Self {
2803 std::default::Default::default()
2804 }
2805
2806 /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
2807 ///
2808 /// # Example
2809 /// ```ignore,no_run
2810 /// # use google_cloud_build_v2::model::DeleteConnectionRequest;
2811 /// # let project_id = "project_id";
2812 /// # let location_id = "location_id";
2813 /// # let connection_id = "connection_id";
2814 /// let x = DeleteConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
2815 /// ```
2816 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2817 self.name = v.into();
2818 self
2819 }
2820
2821 /// Sets the value of [etag][crate::model::DeleteConnectionRequest::etag].
2822 ///
2823 /// # Example
2824 /// ```ignore,no_run
2825 /// # use google_cloud_build_v2::model::DeleteConnectionRequest;
2826 /// let x = DeleteConnectionRequest::new().set_etag("example");
2827 /// ```
2828 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2829 self.etag = v.into();
2830 self
2831 }
2832
2833 /// Sets the value of [validate_only][crate::model::DeleteConnectionRequest::validate_only].
2834 ///
2835 /// # Example
2836 /// ```ignore,no_run
2837 /// # use google_cloud_build_v2::model::DeleteConnectionRequest;
2838 /// let x = DeleteConnectionRequest::new().set_validate_only(true);
2839 /// ```
2840 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2841 self.validate_only = v.into();
2842 self
2843 }
2844}
2845
2846impl wkt::message::Message for DeleteConnectionRequest {
2847 fn typename() -> &'static str {
2848 "type.googleapis.com/google.devtools.cloudbuild.v2.DeleteConnectionRequest"
2849 }
2850}
2851
2852/// Message for creating a Repository.
2853#[derive(Clone, Default, PartialEq)]
2854#[non_exhaustive]
2855pub struct CreateRepositoryRequest {
2856 /// Required. The connection to contain the repository. If the request is part
2857 /// of a BatchCreateRepositoriesRequest, this field should be empty or match
2858 /// the parent specified there.
2859 pub parent: std::string::String,
2860
2861 /// Required. The repository to create.
2862 pub repository: std::option::Option<crate::model::Repository>,
2863
2864 /// Required. The ID to use for the repository, which will become the final
2865 /// component of the repository's resource name. This ID should be unique in
2866 /// the connection. Allows alphanumeric characters and any of
2867 /// -._~%!$&'()*+,;=@.
2868 pub repository_id: std::string::String,
2869
2870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2871}
2872
2873impl CreateRepositoryRequest {
2874 /// Creates a new default instance.
2875 pub fn new() -> Self {
2876 std::default::Default::default()
2877 }
2878
2879 /// Sets the value of [parent][crate::model::CreateRepositoryRequest::parent].
2880 ///
2881 /// # Example
2882 /// ```ignore,no_run
2883 /// # use google_cloud_build_v2::model::CreateRepositoryRequest;
2884 /// # let project_id = "project_id";
2885 /// # let location_id = "location_id";
2886 /// # let connection_id = "connection_id";
2887 /// let x = CreateRepositoryRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
2888 /// ```
2889 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2890 self.parent = v.into();
2891 self
2892 }
2893
2894 /// Sets the value of [repository][crate::model::CreateRepositoryRequest::repository].
2895 ///
2896 /// # Example
2897 /// ```ignore,no_run
2898 /// # use google_cloud_build_v2::model::CreateRepositoryRequest;
2899 /// use google_cloud_build_v2::model::Repository;
2900 /// let x = CreateRepositoryRequest::new().set_repository(Repository::default()/* use setters */);
2901 /// ```
2902 pub fn set_repository<T>(mut self, v: T) -> Self
2903 where
2904 T: std::convert::Into<crate::model::Repository>,
2905 {
2906 self.repository = std::option::Option::Some(v.into());
2907 self
2908 }
2909
2910 /// Sets or clears the value of [repository][crate::model::CreateRepositoryRequest::repository].
2911 ///
2912 /// # Example
2913 /// ```ignore,no_run
2914 /// # use google_cloud_build_v2::model::CreateRepositoryRequest;
2915 /// use google_cloud_build_v2::model::Repository;
2916 /// let x = CreateRepositoryRequest::new().set_or_clear_repository(Some(Repository::default()/* use setters */));
2917 /// let x = CreateRepositoryRequest::new().set_or_clear_repository(None::<Repository>);
2918 /// ```
2919 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
2920 where
2921 T: std::convert::Into<crate::model::Repository>,
2922 {
2923 self.repository = v.map(|x| x.into());
2924 self
2925 }
2926
2927 /// Sets the value of [repository_id][crate::model::CreateRepositoryRequest::repository_id].
2928 ///
2929 /// # Example
2930 /// ```ignore,no_run
2931 /// # use google_cloud_build_v2::model::CreateRepositoryRequest;
2932 /// let x = CreateRepositoryRequest::new().set_repository_id("example");
2933 /// ```
2934 pub fn set_repository_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2935 self.repository_id = v.into();
2936 self
2937 }
2938}
2939
2940impl wkt::message::Message for CreateRepositoryRequest {
2941 fn typename() -> &'static str {
2942 "type.googleapis.com/google.devtools.cloudbuild.v2.CreateRepositoryRequest"
2943 }
2944}
2945
2946/// Message for creating repositoritories in batch.
2947#[derive(Clone, Default, PartialEq)]
2948#[non_exhaustive]
2949pub struct BatchCreateRepositoriesRequest {
2950 /// Required. The connection to contain all the repositories being created.
2951 /// Format: projects/*/locations/*/connections/*
2952 /// The parent field in the CreateRepositoryRequest messages
2953 /// must either be empty or match this field.
2954 pub parent: std::string::String,
2955
2956 /// Required. The request messages specifying the repositories to create.
2957 pub requests: std::vec::Vec<crate::model::CreateRepositoryRequest>,
2958
2959 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2960}
2961
2962impl BatchCreateRepositoriesRequest {
2963 /// Creates a new default instance.
2964 pub fn new() -> Self {
2965 std::default::Default::default()
2966 }
2967
2968 /// Sets the value of [parent][crate::model::BatchCreateRepositoriesRequest::parent].
2969 ///
2970 /// # Example
2971 /// ```ignore,no_run
2972 /// # use google_cloud_build_v2::model::BatchCreateRepositoriesRequest;
2973 /// # let project_id = "project_id";
2974 /// # let location_id = "location_id";
2975 /// # let connection_id = "connection_id";
2976 /// let x = BatchCreateRepositoriesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
2977 /// ```
2978 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2979 self.parent = v.into();
2980 self
2981 }
2982
2983 /// Sets the value of [requests][crate::model::BatchCreateRepositoriesRequest::requests].
2984 ///
2985 /// # Example
2986 /// ```ignore,no_run
2987 /// # use google_cloud_build_v2::model::BatchCreateRepositoriesRequest;
2988 /// use google_cloud_build_v2::model::CreateRepositoryRequest;
2989 /// let x = BatchCreateRepositoriesRequest::new()
2990 /// .set_requests([
2991 /// CreateRepositoryRequest::default()/* use setters */,
2992 /// CreateRepositoryRequest::default()/* use (different) setters */,
2993 /// ]);
2994 /// ```
2995 pub fn set_requests<T, V>(mut self, v: T) -> Self
2996 where
2997 T: std::iter::IntoIterator<Item = V>,
2998 V: std::convert::Into<crate::model::CreateRepositoryRequest>,
2999 {
3000 use std::iter::Iterator;
3001 self.requests = v.into_iter().map(|i| i.into()).collect();
3002 self
3003 }
3004}
3005
3006impl wkt::message::Message for BatchCreateRepositoriesRequest {
3007 fn typename() -> &'static str {
3008 "type.googleapis.com/google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest"
3009 }
3010}
3011
3012/// Message for response of creating repositories in batch.
3013#[derive(Clone, Default, PartialEq)]
3014#[non_exhaustive]
3015pub struct BatchCreateRepositoriesResponse {
3016 /// Repository resources created.
3017 pub repositories: std::vec::Vec<crate::model::Repository>,
3018
3019 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3020}
3021
3022impl BatchCreateRepositoriesResponse {
3023 /// Creates a new default instance.
3024 pub fn new() -> Self {
3025 std::default::Default::default()
3026 }
3027
3028 /// Sets the value of [repositories][crate::model::BatchCreateRepositoriesResponse::repositories].
3029 ///
3030 /// # Example
3031 /// ```ignore,no_run
3032 /// # use google_cloud_build_v2::model::BatchCreateRepositoriesResponse;
3033 /// use google_cloud_build_v2::model::Repository;
3034 /// let x = BatchCreateRepositoriesResponse::new()
3035 /// .set_repositories([
3036 /// Repository::default()/* use setters */,
3037 /// Repository::default()/* use (different) setters */,
3038 /// ]);
3039 /// ```
3040 pub fn set_repositories<T, V>(mut self, v: T) -> Self
3041 where
3042 T: std::iter::IntoIterator<Item = V>,
3043 V: std::convert::Into<crate::model::Repository>,
3044 {
3045 use std::iter::Iterator;
3046 self.repositories = v.into_iter().map(|i| i.into()).collect();
3047 self
3048 }
3049}
3050
3051impl wkt::message::Message for BatchCreateRepositoriesResponse {
3052 fn typename() -> &'static str {
3053 "type.googleapis.com/google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse"
3054 }
3055}
3056
3057/// Message for getting the details of a Repository.
3058#[derive(Clone, Default, PartialEq)]
3059#[non_exhaustive]
3060pub struct GetRepositoryRequest {
3061 /// Required. The name of the Repository to retrieve.
3062 /// Format: `projects/*/locations/*/connections/*/repositories/*`.
3063 pub name: std::string::String,
3064
3065 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3066}
3067
3068impl GetRepositoryRequest {
3069 /// Creates a new default instance.
3070 pub fn new() -> Self {
3071 std::default::Default::default()
3072 }
3073
3074 /// Sets the value of [name][crate::model::GetRepositoryRequest::name].
3075 ///
3076 /// # Example
3077 /// ```ignore,no_run
3078 /// # use google_cloud_build_v2::model::GetRepositoryRequest;
3079 /// # let project_id = "project_id";
3080 /// # let location_id = "location_id";
3081 /// # let connection_id = "connection_id";
3082 /// # let repository_id = "repository_id";
3083 /// let x = GetRepositoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/repositories/{repository_id}"));
3084 /// ```
3085 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3086 self.name = v.into();
3087 self
3088 }
3089}
3090
3091impl wkt::message::Message for GetRepositoryRequest {
3092 fn typename() -> &'static str {
3093 "type.googleapis.com/google.devtools.cloudbuild.v2.GetRepositoryRequest"
3094 }
3095}
3096
3097/// Message for requesting list of Repositories.
3098#[derive(Clone, Default, PartialEq)]
3099#[non_exhaustive]
3100pub struct ListRepositoriesRequest {
3101 /// Required. The parent, which owns this collection of Repositories.
3102 /// Format: `projects/*/locations/*/connections/*`.
3103 pub parent: std::string::String,
3104
3105 /// Number of results to return in the list.
3106 pub page_size: i32,
3107
3108 /// Page start.
3109 pub page_token: std::string::String,
3110
3111 /// A filter expression that filters resources listed in the response.
3112 /// Expressions must follow API improvement proposal
3113 /// [AIP-160](https://google.aip.dev/160). e.g.
3114 /// `remote_uri:"<https://github.com>*"`.
3115 pub filter: std::string::String,
3116
3117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3118}
3119
3120impl ListRepositoriesRequest {
3121 /// Creates a new default instance.
3122 pub fn new() -> Self {
3123 std::default::Default::default()
3124 }
3125
3126 /// Sets the value of [parent][crate::model::ListRepositoriesRequest::parent].
3127 ///
3128 /// # Example
3129 /// ```ignore,no_run
3130 /// # use google_cloud_build_v2::model::ListRepositoriesRequest;
3131 /// # let project_id = "project_id";
3132 /// # let location_id = "location_id";
3133 /// # let connection_id = "connection_id";
3134 /// let x = ListRepositoriesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
3135 /// ```
3136 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3137 self.parent = v.into();
3138 self
3139 }
3140
3141 /// Sets the value of [page_size][crate::model::ListRepositoriesRequest::page_size].
3142 ///
3143 /// # Example
3144 /// ```ignore,no_run
3145 /// # use google_cloud_build_v2::model::ListRepositoriesRequest;
3146 /// let x = ListRepositoriesRequest::new().set_page_size(42);
3147 /// ```
3148 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3149 self.page_size = v.into();
3150 self
3151 }
3152
3153 /// Sets the value of [page_token][crate::model::ListRepositoriesRequest::page_token].
3154 ///
3155 /// # Example
3156 /// ```ignore,no_run
3157 /// # use google_cloud_build_v2::model::ListRepositoriesRequest;
3158 /// let x = ListRepositoriesRequest::new().set_page_token("example");
3159 /// ```
3160 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3161 self.page_token = v.into();
3162 self
3163 }
3164
3165 /// Sets the value of [filter][crate::model::ListRepositoriesRequest::filter].
3166 ///
3167 /// # Example
3168 /// ```ignore,no_run
3169 /// # use google_cloud_build_v2::model::ListRepositoriesRequest;
3170 /// let x = ListRepositoriesRequest::new().set_filter("example");
3171 /// ```
3172 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3173 self.filter = v.into();
3174 self
3175 }
3176}
3177
3178impl wkt::message::Message for ListRepositoriesRequest {
3179 fn typename() -> &'static str {
3180 "type.googleapis.com/google.devtools.cloudbuild.v2.ListRepositoriesRequest"
3181 }
3182}
3183
3184/// Message for response to listing Repositories.
3185#[derive(Clone, Default, PartialEq)]
3186#[non_exhaustive]
3187pub struct ListRepositoriesResponse {
3188 /// The list of Repositories.
3189 pub repositories: std::vec::Vec<crate::model::Repository>,
3190
3191 /// A token identifying a page of results the server should return.
3192 pub next_page_token: std::string::String,
3193
3194 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3195}
3196
3197impl ListRepositoriesResponse {
3198 /// Creates a new default instance.
3199 pub fn new() -> Self {
3200 std::default::Default::default()
3201 }
3202
3203 /// Sets the value of [repositories][crate::model::ListRepositoriesResponse::repositories].
3204 ///
3205 /// # Example
3206 /// ```ignore,no_run
3207 /// # use google_cloud_build_v2::model::ListRepositoriesResponse;
3208 /// use google_cloud_build_v2::model::Repository;
3209 /// let x = ListRepositoriesResponse::new()
3210 /// .set_repositories([
3211 /// Repository::default()/* use setters */,
3212 /// Repository::default()/* use (different) setters */,
3213 /// ]);
3214 /// ```
3215 pub fn set_repositories<T, V>(mut self, v: T) -> Self
3216 where
3217 T: std::iter::IntoIterator<Item = V>,
3218 V: std::convert::Into<crate::model::Repository>,
3219 {
3220 use std::iter::Iterator;
3221 self.repositories = v.into_iter().map(|i| i.into()).collect();
3222 self
3223 }
3224
3225 /// Sets the value of [next_page_token][crate::model::ListRepositoriesResponse::next_page_token].
3226 ///
3227 /// # Example
3228 /// ```ignore,no_run
3229 /// # use google_cloud_build_v2::model::ListRepositoriesResponse;
3230 /// let x = ListRepositoriesResponse::new().set_next_page_token("example");
3231 /// ```
3232 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3233 self.next_page_token = v.into();
3234 self
3235 }
3236}
3237
3238impl wkt::message::Message for ListRepositoriesResponse {
3239 fn typename() -> &'static str {
3240 "type.googleapis.com/google.devtools.cloudbuild.v2.ListRepositoriesResponse"
3241 }
3242}
3243
3244#[doc(hidden)]
3245impl google_cloud_gax::paginator::internal::PageableResponse for ListRepositoriesResponse {
3246 type PageItem = crate::model::Repository;
3247
3248 fn items(self) -> std::vec::Vec<Self::PageItem> {
3249 self.repositories
3250 }
3251
3252 fn next_page_token(&self) -> std::string::String {
3253 use std::clone::Clone;
3254 self.next_page_token.clone()
3255 }
3256}
3257
3258/// Message for deleting a Repository.
3259#[derive(Clone, Default, PartialEq)]
3260#[non_exhaustive]
3261pub struct DeleteRepositoryRequest {
3262 /// Required. The name of the Repository to delete.
3263 /// Format: `projects/*/locations/*/connections/*/repositories/*`.
3264 pub name: std::string::String,
3265
3266 /// The current etag of the repository.
3267 /// If an etag is provided and does not match the current etag of the
3268 /// repository, deletion will be blocked and an ABORTED error will be returned.
3269 pub etag: std::string::String,
3270
3271 /// If set, validate the request, but do not actually post it.
3272 pub validate_only: bool,
3273
3274 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3275}
3276
3277impl DeleteRepositoryRequest {
3278 /// Creates a new default instance.
3279 pub fn new() -> Self {
3280 std::default::Default::default()
3281 }
3282
3283 /// Sets the value of [name][crate::model::DeleteRepositoryRequest::name].
3284 ///
3285 /// # Example
3286 /// ```ignore,no_run
3287 /// # use google_cloud_build_v2::model::DeleteRepositoryRequest;
3288 /// # let project_id = "project_id";
3289 /// # let location_id = "location_id";
3290 /// # let connection_id = "connection_id";
3291 /// # let repository_id = "repository_id";
3292 /// let x = DeleteRepositoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/repositories/{repository_id}"));
3293 /// ```
3294 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3295 self.name = v.into();
3296 self
3297 }
3298
3299 /// Sets the value of [etag][crate::model::DeleteRepositoryRequest::etag].
3300 ///
3301 /// # Example
3302 /// ```ignore,no_run
3303 /// # use google_cloud_build_v2::model::DeleteRepositoryRequest;
3304 /// let x = DeleteRepositoryRequest::new().set_etag("example");
3305 /// ```
3306 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3307 self.etag = v.into();
3308 self
3309 }
3310
3311 /// Sets the value of [validate_only][crate::model::DeleteRepositoryRequest::validate_only].
3312 ///
3313 /// # Example
3314 /// ```ignore,no_run
3315 /// # use google_cloud_build_v2::model::DeleteRepositoryRequest;
3316 /// let x = DeleteRepositoryRequest::new().set_validate_only(true);
3317 /// ```
3318 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3319 self.validate_only = v.into();
3320 self
3321 }
3322}
3323
3324impl wkt::message::Message for DeleteRepositoryRequest {
3325 fn typename() -> &'static str {
3326 "type.googleapis.com/google.devtools.cloudbuild.v2.DeleteRepositoryRequest"
3327 }
3328}
3329
3330/// Message for fetching SCM read/write token.
3331#[derive(Clone, Default, PartialEq)]
3332#[non_exhaustive]
3333pub struct FetchReadWriteTokenRequest {
3334 /// Required. The resource name of the repository in the format
3335 /// `projects/*/locations/*/connections/*/repositories/*`.
3336 pub repository: std::string::String,
3337
3338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3339}
3340
3341impl FetchReadWriteTokenRequest {
3342 /// Creates a new default instance.
3343 pub fn new() -> Self {
3344 std::default::Default::default()
3345 }
3346
3347 /// Sets the value of [repository][crate::model::FetchReadWriteTokenRequest::repository].
3348 ///
3349 /// # Example
3350 /// ```ignore,no_run
3351 /// # use google_cloud_build_v2::model::FetchReadWriteTokenRequest;
3352 /// # let project_id = "project_id";
3353 /// # let location_id = "location_id";
3354 /// # let connection_id = "connection_id";
3355 /// # let repository_id = "repository_id";
3356 /// let x = FetchReadWriteTokenRequest::new().set_repository(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/repositories/{repository_id}"));
3357 /// ```
3358 pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3359 self.repository = v.into();
3360 self
3361 }
3362}
3363
3364impl wkt::message::Message for FetchReadWriteTokenRequest {
3365 fn typename() -> &'static str {
3366 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest"
3367 }
3368}
3369
3370/// Message for fetching SCM read token.
3371#[derive(Clone, Default, PartialEq)]
3372#[non_exhaustive]
3373pub struct FetchReadTokenRequest {
3374 /// Required. The resource name of the repository in the format
3375 /// `projects/*/locations/*/connections/*/repositories/*`.
3376 pub repository: std::string::String,
3377
3378 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3379}
3380
3381impl FetchReadTokenRequest {
3382 /// Creates a new default instance.
3383 pub fn new() -> Self {
3384 std::default::Default::default()
3385 }
3386
3387 /// Sets the value of [repository][crate::model::FetchReadTokenRequest::repository].
3388 ///
3389 /// # Example
3390 /// ```ignore,no_run
3391 /// # use google_cloud_build_v2::model::FetchReadTokenRequest;
3392 /// # let project_id = "project_id";
3393 /// # let location_id = "location_id";
3394 /// # let connection_id = "connection_id";
3395 /// # let repository_id = "repository_id";
3396 /// let x = FetchReadTokenRequest::new().set_repository(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/repositories/{repository_id}"));
3397 /// ```
3398 pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3399 self.repository = v.into();
3400 self
3401 }
3402}
3403
3404impl wkt::message::Message for FetchReadTokenRequest {
3405 fn typename() -> &'static str {
3406 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchReadTokenRequest"
3407 }
3408}
3409
3410/// Message for responding to get read token.
3411#[derive(Clone, Default, PartialEq)]
3412#[non_exhaustive]
3413pub struct FetchReadTokenResponse {
3414 /// The token content.
3415 pub token: std::string::String,
3416
3417 /// Expiration timestamp. Can be empty if unknown or non-expiring.
3418 pub expiration_time: std::option::Option<wkt::Timestamp>,
3419
3420 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3421}
3422
3423impl FetchReadTokenResponse {
3424 /// Creates a new default instance.
3425 pub fn new() -> Self {
3426 std::default::Default::default()
3427 }
3428
3429 /// Sets the value of [token][crate::model::FetchReadTokenResponse::token].
3430 ///
3431 /// # Example
3432 /// ```ignore,no_run
3433 /// # use google_cloud_build_v2::model::FetchReadTokenResponse;
3434 /// let x = FetchReadTokenResponse::new().set_token("example");
3435 /// ```
3436 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3437 self.token = v.into();
3438 self
3439 }
3440
3441 /// Sets the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
3442 ///
3443 /// # Example
3444 /// ```ignore,no_run
3445 /// # use google_cloud_build_v2::model::FetchReadTokenResponse;
3446 /// use wkt::Timestamp;
3447 /// let x = FetchReadTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
3448 /// ```
3449 pub fn set_expiration_time<T>(mut self, v: T) -> Self
3450 where
3451 T: std::convert::Into<wkt::Timestamp>,
3452 {
3453 self.expiration_time = std::option::Option::Some(v.into());
3454 self
3455 }
3456
3457 /// Sets or clears the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
3458 ///
3459 /// # Example
3460 /// ```ignore,no_run
3461 /// # use google_cloud_build_v2::model::FetchReadTokenResponse;
3462 /// use wkt::Timestamp;
3463 /// let x = FetchReadTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
3464 /// let x = FetchReadTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
3465 /// ```
3466 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
3467 where
3468 T: std::convert::Into<wkt::Timestamp>,
3469 {
3470 self.expiration_time = v.map(|x| x.into());
3471 self
3472 }
3473}
3474
3475impl wkt::message::Message for FetchReadTokenResponse {
3476 fn typename() -> &'static str {
3477 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchReadTokenResponse"
3478 }
3479}
3480
3481/// Message for responding to get read/write token.
3482#[derive(Clone, Default, PartialEq)]
3483#[non_exhaustive]
3484pub struct FetchReadWriteTokenResponse {
3485 /// The token content.
3486 pub token: std::string::String,
3487
3488 /// Expiration timestamp. Can be empty if unknown or non-expiring.
3489 pub expiration_time: std::option::Option<wkt::Timestamp>,
3490
3491 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3492}
3493
3494impl FetchReadWriteTokenResponse {
3495 /// Creates a new default instance.
3496 pub fn new() -> Self {
3497 std::default::Default::default()
3498 }
3499
3500 /// Sets the value of [token][crate::model::FetchReadWriteTokenResponse::token].
3501 ///
3502 /// # Example
3503 /// ```ignore,no_run
3504 /// # use google_cloud_build_v2::model::FetchReadWriteTokenResponse;
3505 /// let x = FetchReadWriteTokenResponse::new().set_token("example");
3506 /// ```
3507 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3508 self.token = v.into();
3509 self
3510 }
3511
3512 /// Sets the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
3513 ///
3514 /// # Example
3515 /// ```ignore,no_run
3516 /// # use google_cloud_build_v2::model::FetchReadWriteTokenResponse;
3517 /// use wkt::Timestamp;
3518 /// let x = FetchReadWriteTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
3519 /// ```
3520 pub fn set_expiration_time<T>(mut self, v: T) -> Self
3521 where
3522 T: std::convert::Into<wkt::Timestamp>,
3523 {
3524 self.expiration_time = std::option::Option::Some(v.into());
3525 self
3526 }
3527
3528 /// Sets or clears the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
3529 ///
3530 /// # Example
3531 /// ```ignore,no_run
3532 /// # use google_cloud_build_v2::model::FetchReadWriteTokenResponse;
3533 /// use wkt::Timestamp;
3534 /// let x = FetchReadWriteTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
3535 /// let x = FetchReadWriteTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
3536 /// ```
3537 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
3538 where
3539 T: std::convert::Into<wkt::Timestamp>,
3540 {
3541 self.expiration_time = v.map(|x| x.into());
3542 self
3543 }
3544}
3545
3546impl wkt::message::Message for FetchReadWriteTokenResponse {
3547 fn typename() -> &'static str {
3548 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse"
3549 }
3550}
3551
3552/// RPC request object accepted by the ProcessWebhook RPC method.
3553#[derive(Clone, Default, PartialEq)]
3554#[non_exhaustive]
3555pub struct ProcessWebhookRequest {
3556 /// Required. Project and location where the webhook will be received.
3557 /// Format: `projects/*/locations/*`.
3558 pub parent: std::string::String,
3559
3560 /// HTTP request body.
3561 pub body: std::option::Option<google_cloud_api::model::HttpBody>,
3562
3563 /// Arbitrary additional key to find the maching repository for a webhook event
3564 /// if needed.
3565 pub webhook_key: std::string::String,
3566
3567 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3568}
3569
3570impl ProcessWebhookRequest {
3571 /// Creates a new default instance.
3572 pub fn new() -> Self {
3573 std::default::Default::default()
3574 }
3575
3576 /// Sets the value of [parent][crate::model::ProcessWebhookRequest::parent].
3577 ///
3578 /// # Example
3579 /// ```ignore,no_run
3580 /// # use google_cloud_build_v2::model::ProcessWebhookRequest;
3581 /// # let project_id = "project_id";
3582 /// # let location_id = "location_id";
3583 /// let x = ProcessWebhookRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3584 /// ```
3585 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3586 self.parent = v.into();
3587 self
3588 }
3589
3590 /// Sets the value of [body][crate::model::ProcessWebhookRequest::body].
3591 ///
3592 /// # Example
3593 /// ```ignore,no_run
3594 /// # use google_cloud_build_v2::model::ProcessWebhookRequest;
3595 /// use google_cloud_api::model::HttpBody;
3596 /// let x = ProcessWebhookRequest::new().set_body(HttpBody::default()/* use setters */);
3597 /// ```
3598 pub fn set_body<T>(mut self, v: T) -> Self
3599 where
3600 T: std::convert::Into<google_cloud_api::model::HttpBody>,
3601 {
3602 self.body = std::option::Option::Some(v.into());
3603 self
3604 }
3605
3606 /// Sets or clears the value of [body][crate::model::ProcessWebhookRequest::body].
3607 ///
3608 /// # Example
3609 /// ```ignore,no_run
3610 /// # use google_cloud_build_v2::model::ProcessWebhookRequest;
3611 /// use google_cloud_api::model::HttpBody;
3612 /// let x = ProcessWebhookRequest::new().set_or_clear_body(Some(HttpBody::default()/* use setters */));
3613 /// let x = ProcessWebhookRequest::new().set_or_clear_body(None::<HttpBody>);
3614 /// ```
3615 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3616 where
3617 T: std::convert::Into<google_cloud_api::model::HttpBody>,
3618 {
3619 self.body = v.map(|x| x.into());
3620 self
3621 }
3622
3623 /// Sets the value of [webhook_key][crate::model::ProcessWebhookRequest::webhook_key].
3624 ///
3625 /// # Example
3626 /// ```ignore,no_run
3627 /// # use google_cloud_build_v2::model::ProcessWebhookRequest;
3628 /// let x = ProcessWebhookRequest::new().set_webhook_key("example");
3629 /// ```
3630 pub fn set_webhook_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3631 self.webhook_key = v.into();
3632 self
3633 }
3634}
3635
3636impl wkt::message::Message for ProcessWebhookRequest {
3637 fn typename() -> &'static str {
3638 "type.googleapis.com/google.devtools.cloudbuild.v2.ProcessWebhookRequest"
3639 }
3640}
3641
3642/// Request for fetching git refs
3643#[derive(Clone, Default, PartialEq)]
3644#[non_exhaustive]
3645pub struct FetchGitRefsRequest {
3646 /// Required. The resource name of the repository in the format
3647 /// `projects/*/locations/*/connections/*/repositories/*`.
3648 pub repository: std::string::String,
3649
3650 /// Type of refs to fetch
3651 pub ref_type: crate::model::fetch_git_refs_request::RefType,
3652
3653 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3654}
3655
3656impl FetchGitRefsRequest {
3657 /// Creates a new default instance.
3658 pub fn new() -> Self {
3659 std::default::Default::default()
3660 }
3661
3662 /// Sets the value of [repository][crate::model::FetchGitRefsRequest::repository].
3663 ///
3664 /// # Example
3665 /// ```ignore,no_run
3666 /// # use google_cloud_build_v2::model::FetchGitRefsRequest;
3667 /// # let project_id = "project_id";
3668 /// # let location_id = "location_id";
3669 /// # let connection_id = "connection_id";
3670 /// # let repository_id = "repository_id";
3671 /// let x = FetchGitRefsRequest::new().set_repository(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/repositories/{repository_id}"));
3672 /// ```
3673 pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3674 self.repository = v.into();
3675 self
3676 }
3677
3678 /// Sets the value of [ref_type][crate::model::FetchGitRefsRequest::ref_type].
3679 ///
3680 /// # Example
3681 /// ```ignore,no_run
3682 /// # use google_cloud_build_v2::model::FetchGitRefsRequest;
3683 /// use google_cloud_build_v2::model::fetch_git_refs_request::RefType;
3684 /// let x0 = FetchGitRefsRequest::new().set_ref_type(RefType::Tag);
3685 /// let x1 = FetchGitRefsRequest::new().set_ref_type(RefType::Branch);
3686 /// ```
3687 pub fn set_ref_type<T: std::convert::Into<crate::model::fetch_git_refs_request::RefType>>(
3688 mut self,
3689 v: T,
3690 ) -> Self {
3691 self.ref_type = v.into();
3692 self
3693 }
3694}
3695
3696impl wkt::message::Message for FetchGitRefsRequest {
3697 fn typename() -> &'static str {
3698 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchGitRefsRequest"
3699 }
3700}
3701
3702/// Defines additional types related to [FetchGitRefsRequest].
3703pub mod fetch_git_refs_request {
3704 #[allow(unused_imports)]
3705 use super::*;
3706
3707 /// Type of refs
3708 ///
3709 /// # Working with unknown values
3710 ///
3711 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3712 /// additional enum variants at any time. Adding new variants is not considered
3713 /// a breaking change. Applications should write their code in anticipation of:
3714 ///
3715 /// - New values appearing in future releases of the client library, **and**
3716 /// - New values received dynamically, without application changes.
3717 ///
3718 /// Please consult the [Working with enums] section in the user guide for some
3719 /// guidelines.
3720 ///
3721 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3722 #[derive(Clone, Debug, PartialEq)]
3723 #[non_exhaustive]
3724 pub enum RefType {
3725 /// No type specified.
3726 Unspecified,
3727 /// To fetch tags.
3728 Tag,
3729 /// To fetch branches.
3730 Branch,
3731 /// If set, the enum was initialized with an unknown value.
3732 ///
3733 /// Applications can examine the value using [RefType::value] or
3734 /// [RefType::name].
3735 UnknownValue(ref_type::UnknownValue),
3736 }
3737
3738 #[doc(hidden)]
3739 pub mod ref_type {
3740 #[allow(unused_imports)]
3741 use super::*;
3742 #[derive(Clone, Debug, PartialEq)]
3743 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3744 }
3745
3746 impl RefType {
3747 /// Gets the enum value.
3748 ///
3749 /// Returns `None` if the enum contains an unknown value deserialized from
3750 /// the string representation of enums.
3751 pub fn value(&self) -> std::option::Option<i32> {
3752 match self {
3753 Self::Unspecified => std::option::Option::Some(0),
3754 Self::Tag => std::option::Option::Some(1),
3755 Self::Branch => std::option::Option::Some(2),
3756 Self::UnknownValue(u) => u.0.value(),
3757 }
3758 }
3759
3760 /// Gets the enum value as a string.
3761 ///
3762 /// Returns `None` if the enum contains an unknown value deserialized from
3763 /// the integer representation of enums.
3764 pub fn name(&self) -> std::option::Option<&str> {
3765 match self {
3766 Self::Unspecified => std::option::Option::Some("REF_TYPE_UNSPECIFIED"),
3767 Self::Tag => std::option::Option::Some("TAG"),
3768 Self::Branch => std::option::Option::Some("BRANCH"),
3769 Self::UnknownValue(u) => u.0.name(),
3770 }
3771 }
3772 }
3773
3774 impl std::default::Default for RefType {
3775 fn default() -> Self {
3776 use std::convert::From;
3777 Self::from(0)
3778 }
3779 }
3780
3781 impl std::fmt::Display for RefType {
3782 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3783 wkt::internal::display_enum(f, self.name(), self.value())
3784 }
3785 }
3786
3787 impl std::convert::From<i32> for RefType {
3788 fn from(value: i32) -> Self {
3789 match value {
3790 0 => Self::Unspecified,
3791 1 => Self::Tag,
3792 2 => Self::Branch,
3793 _ => Self::UnknownValue(ref_type::UnknownValue(
3794 wkt::internal::UnknownEnumValue::Integer(value),
3795 )),
3796 }
3797 }
3798 }
3799
3800 impl std::convert::From<&str> for RefType {
3801 fn from(value: &str) -> Self {
3802 use std::string::ToString;
3803 match value {
3804 "REF_TYPE_UNSPECIFIED" => Self::Unspecified,
3805 "TAG" => Self::Tag,
3806 "BRANCH" => Self::Branch,
3807 _ => Self::UnknownValue(ref_type::UnknownValue(
3808 wkt::internal::UnknownEnumValue::String(value.to_string()),
3809 )),
3810 }
3811 }
3812 }
3813
3814 impl serde::ser::Serialize for RefType {
3815 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3816 where
3817 S: serde::Serializer,
3818 {
3819 match self {
3820 Self::Unspecified => serializer.serialize_i32(0),
3821 Self::Tag => serializer.serialize_i32(1),
3822 Self::Branch => serializer.serialize_i32(2),
3823 Self::UnknownValue(u) => u.0.serialize(serializer),
3824 }
3825 }
3826 }
3827
3828 impl<'de> serde::de::Deserialize<'de> for RefType {
3829 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3830 where
3831 D: serde::Deserializer<'de>,
3832 {
3833 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RefType>::new(
3834 ".google.devtools.cloudbuild.v2.FetchGitRefsRequest.RefType",
3835 ))
3836 }
3837 }
3838}
3839
3840/// Response for fetching git refs
3841#[derive(Clone, Default, PartialEq)]
3842#[non_exhaustive]
3843pub struct FetchGitRefsResponse {
3844 /// Name of the refs fetched.
3845 pub ref_names: std::vec::Vec<std::string::String>,
3846
3847 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3848}
3849
3850impl FetchGitRefsResponse {
3851 /// Creates a new default instance.
3852 pub fn new() -> Self {
3853 std::default::Default::default()
3854 }
3855
3856 /// Sets the value of [ref_names][crate::model::FetchGitRefsResponse::ref_names].
3857 ///
3858 /// # Example
3859 /// ```ignore,no_run
3860 /// # use google_cloud_build_v2::model::FetchGitRefsResponse;
3861 /// let x = FetchGitRefsResponse::new().set_ref_names(["a", "b", "c"]);
3862 /// ```
3863 pub fn set_ref_names<T, V>(mut self, v: T) -> Self
3864 where
3865 T: std::iter::IntoIterator<Item = V>,
3866 V: std::convert::Into<std::string::String>,
3867 {
3868 use std::iter::Iterator;
3869 self.ref_names = v.into_iter().map(|i| i.into()).collect();
3870 self
3871 }
3872}
3873
3874impl wkt::message::Message for FetchGitRefsResponse {
3875 fn typename() -> &'static str {
3876 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchGitRefsResponse"
3877 }
3878}