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