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 api;
21extern crate async_trait;
22extern crate bytes;
23extern crate gax;
24extern crate gaxi;
25extern crate iam_v1;
26extern crate lazy_static;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// Represents the metadata of the long-running operation.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct OperationMetadata {
45    /// Output only. The time the operation was created.
46    pub create_time: std::option::Option<wkt::Timestamp>,
47
48    /// Output only. The time the operation finished running.
49    pub end_time: std::option::Option<wkt::Timestamp>,
50
51    /// Output only. Server-defined resource path for the target of the operation.
52    pub target: std::string::String,
53
54    /// Output only. Name of the verb executed by the operation.
55    pub verb: std::string::String,
56
57    /// Output only. Human-readable status of the operation, if any.
58    pub status_message: std::string::String,
59
60    /// Output only. Identifies whether the user has requested cancellation
61    /// of the operation. Operations that have successfully been cancelled
62    /// have [Operation.error][] value with a
63    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
64    /// `Code.CANCELLED`.
65    ///
66    /// [google.rpc.Status.code]: rpc::model::Status::code
67    pub requested_cancellation: bool,
68
69    /// Output only. API version used to start the operation.
70    pub api_version: std::string::String,
71
72    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
73}
74
75impl OperationMetadata {
76    pub fn new() -> Self {
77        std::default::Default::default()
78    }
79
80    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
81    pub fn set_create_time<T>(mut self, v: T) -> Self
82    where
83        T: std::convert::Into<wkt::Timestamp>,
84    {
85        self.create_time = std::option::Option::Some(v.into());
86        self
87    }
88
89    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
90    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
91    where
92        T: std::convert::Into<wkt::Timestamp>,
93    {
94        self.create_time = v.map(|x| x.into());
95        self
96    }
97
98    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
99    pub fn set_end_time<T>(mut self, v: T) -> Self
100    where
101        T: std::convert::Into<wkt::Timestamp>,
102    {
103        self.end_time = std::option::Option::Some(v.into());
104        self
105    }
106
107    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
108    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
109    where
110        T: std::convert::Into<wkt::Timestamp>,
111    {
112        self.end_time = v.map(|x| x.into());
113        self
114    }
115
116    /// Sets the value of [target][crate::model::OperationMetadata::target].
117    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
118        self.target = v.into();
119        self
120    }
121
122    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
123    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
124        self.verb = v.into();
125        self
126    }
127
128    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
129    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
130        self.status_message = v.into();
131        self
132    }
133
134    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
135    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
136        self.requested_cancellation = v.into();
137        self
138    }
139
140    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
141    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
142        self.api_version = v.into();
143        self
144    }
145}
146
147impl wkt::message::Message for OperationMetadata {
148    fn typename() -> &'static str {
149        "type.googleapis.com/google.devtools.cloudbuild.v2.OperationMetadata"
150    }
151}
152
153/// Represents the custom metadata of the RunWorkflow long-running operation.
154#[derive(Clone, Default, PartialEq)]
155#[non_exhaustive]
156pub struct RunWorkflowCustomOperationMetadata {
157    /// Output only. The time the operation was created.
158    pub create_time: std::option::Option<wkt::Timestamp>,
159
160    /// Output only. The time the operation finished running.
161    pub end_time: std::option::Option<wkt::Timestamp>,
162
163    /// Output only. Name of the verb executed by the operation.
164    pub verb: std::string::String,
165
166    /// Output only. Identifies whether the user has requested cancellation
167    /// of the operation. Operations that have successfully been cancelled
168    /// have [Operation.error][] value with a
169    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
170    /// `Code.CANCELLED`.
171    ///
172    /// [google.rpc.Status.code]: rpc::model::Status::code
173    pub requested_cancellation: bool,
174
175    /// Output only. API version used to start the operation.
176    pub api_version: std::string::String,
177
178    /// Output only. Server-defined resource path for the target of the operation.
179    pub target: std::string::String,
180
181    /// Output only. ID of the pipeline run created by RunWorkflow.
182    pub pipeline_run_id: std::string::String,
183
184    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
185}
186
187impl RunWorkflowCustomOperationMetadata {
188    pub fn new() -> Self {
189        std::default::Default::default()
190    }
191
192    /// Sets the value of [create_time][crate::model::RunWorkflowCustomOperationMetadata::create_time].
193    pub fn set_create_time<T>(mut self, v: T) -> Self
194    where
195        T: std::convert::Into<wkt::Timestamp>,
196    {
197        self.create_time = std::option::Option::Some(v.into());
198        self
199    }
200
201    /// Sets or clears the value of [create_time][crate::model::RunWorkflowCustomOperationMetadata::create_time].
202    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
203    where
204        T: std::convert::Into<wkt::Timestamp>,
205    {
206        self.create_time = v.map(|x| x.into());
207        self
208    }
209
210    /// Sets the value of [end_time][crate::model::RunWorkflowCustomOperationMetadata::end_time].
211    pub fn set_end_time<T>(mut self, v: T) -> Self
212    where
213        T: std::convert::Into<wkt::Timestamp>,
214    {
215        self.end_time = std::option::Option::Some(v.into());
216        self
217    }
218
219    /// Sets or clears the value of [end_time][crate::model::RunWorkflowCustomOperationMetadata::end_time].
220    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
221    where
222        T: std::convert::Into<wkt::Timestamp>,
223    {
224        self.end_time = v.map(|x| x.into());
225        self
226    }
227
228    /// Sets the value of [verb][crate::model::RunWorkflowCustomOperationMetadata::verb].
229    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
230        self.verb = v.into();
231        self
232    }
233
234    /// Sets the value of [requested_cancellation][crate::model::RunWorkflowCustomOperationMetadata::requested_cancellation].
235    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
236        self.requested_cancellation = v.into();
237        self
238    }
239
240    /// Sets the value of [api_version][crate::model::RunWorkflowCustomOperationMetadata::api_version].
241    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
242        self.api_version = v.into();
243        self
244    }
245
246    /// Sets the value of [target][crate::model::RunWorkflowCustomOperationMetadata::target].
247    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
248        self.target = v.into();
249        self
250    }
251
252    /// Sets the value of [pipeline_run_id][crate::model::RunWorkflowCustomOperationMetadata::pipeline_run_id].
253    pub fn set_pipeline_run_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
254        self.pipeline_run_id = v.into();
255        self
256    }
257}
258
259impl wkt::message::Message for RunWorkflowCustomOperationMetadata {
260    fn typename() -> &'static str {
261        "type.googleapis.com/google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata"
262    }
263}
264
265/// A connection to a SCM like GitHub, GitHub Enterprise, Bitbucket Data Center,
266/// Bitbucket Cloud or GitLab.
267#[derive(Clone, Default, PartialEq)]
268#[non_exhaustive]
269pub struct Connection {
270    /// Immutable. The resource name of the connection, in the format
271    /// `projects/{project}/locations/{location}/connections/{connection_id}`.
272    pub name: std::string::String,
273
274    /// Output only. Server assigned timestamp for when the connection was created.
275    pub create_time: std::option::Option<wkt::Timestamp>,
276
277    /// Output only. Server assigned timestamp for when the connection was updated.
278    pub update_time: std::option::Option<wkt::Timestamp>,
279
280    /// Output only. Installation state of the Connection.
281    pub installation_state: std::option::Option<crate::model::InstallationState>,
282
283    /// If disabled is set to true, functionality is disabled for this connection.
284    /// Repository based API methods and webhooks processing for repositories in
285    /// this connection will be disabled.
286    pub disabled: bool,
287
288    /// Output only. Set to true when the connection is being set up or updated in
289    /// the background.
290    pub reconciling: bool,
291
292    /// Allows clients to store small amounts of arbitrary data.
293    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
294
295    /// This checksum is computed by the server based on the value of other
296    /// fields, and may be sent on update and delete requests to ensure the
297    /// client has an up-to-date value before proceeding.
298    pub etag: std::string::String,
299
300    /// Configuration for the connection depending on the type of provider.
301    pub connection_config: std::option::Option<crate::model::connection::ConnectionConfig>,
302
303    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
304}
305
306impl Connection {
307    pub fn new() -> Self {
308        std::default::Default::default()
309    }
310
311    /// Sets the value of [name][crate::model::Connection::name].
312    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
313        self.name = v.into();
314        self
315    }
316
317    /// Sets the value of [create_time][crate::model::Connection::create_time].
318    pub fn set_create_time<T>(mut self, v: T) -> Self
319    where
320        T: std::convert::Into<wkt::Timestamp>,
321    {
322        self.create_time = std::option::Option::Some(v.into());
323        self
324    }
325
326    /// Sets or clears the value of [create_time][crate::model::Connection::create_time].
327    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
328    where
329        T: std::convert::Into<wkt::Timestamp>,
330    {
331        self.create_time = v.map(|x| x.into());
332        self
333    }
334
335    /// Sets the value of [update_time][crate::model::Connection::update_time].
336    pub fn set_update_time<T>(mut self, v: T) -> Self
337    where
338        T: std::convert::Into<wkt::Timestamp>,
339    {
340        self.update_time = std::option::Option::Some(v.into());
341        self
342    }
343
344    /// Sets or clears the value of [update_time][crate::model::Connection::update_time].
345    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
346    where
347        T: std::convert::Into<wkt::Timestamp>,
348    {
349        self.update_time = v.map(|x| x.into());
350        self
351    }
352
353    /// Sets the value of [installation_state][crate::model::Connection::installation_state].
354    pub fn set_installation_state<T>(mut self, v: T) -> Self
355    where
356        T: std::convert::Into<crate::model::InstallationState>,
357    {
358        self.installation_state = std::option::Option::Some(v.into());
359        self
360    }
361
362    /// Sets or clears the value of [installation_state][crate::model::Connection::installation_state].
363    pub fn set_or_clear_installation_state<T>(mut self, v: std::option::Option<T>) -> Self
364    where
365        T: std::convert::Into<crate::model::InstallationState>,
366    {
367        self.installation_state = v.map(|x| x.into());
368        self
369    }
370
371    /// Sets the value of [disabled][crate::model::Connection::disabled].
372    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
373        self.disabled = v.into();
374        self
375    }
376
377    /// Sets the value of [reconciling][crate::model::Connection::reconciling].
378    pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
379        self.reconciling = v.into();
380        self
381    }
382
383    /// Sets the value of [annotations][crate::model::Connection::annotations].
384    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
385    where
386        T: std::iter::IntoIterator<Item = (K, V)>,
387        K: std::convert::Into<std::string::String>,
388        V: std::convert::Into<std::string::String>,
389    {
390        use std::iter::Iterator;
391        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
392        self
393    }
394
395    /// Sets the value of [etag][crate::model::Connection::etag].
396    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
397        self.etag = v.into();
398        self
399    }
400
401    /// Sets the value of [connection_config][crate::model::Connection::connection_config].
402    ///
403    /// Note that all the setters affecting `connection_config` are mutually
404    /// exclusive.
405    pub fn set_connection_config<
406        T: std::convert::Into<std::option::Option<crate::model::connection::ConnectionConfig>>,
407    >(
408        mut self,
409        v: T,
410    ) -> Self {
411        self.connection_config = v.into();
412        self
413    }
414
415    /// The value of [connection_config][crate::model::Connection::connection_config]
416    /// if it holds a `GithubConfig`, `None` if the field is not set or
417    /// holds a different branch.
418    pub fn github_config(
419        &self,
420    ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubConfig>> {
421        #[allow(unreachable_patterns)]
422        self.connection_config.as_ref().and_then(|v| match v {
423            crate::model::connection::ConnectionConfig::GithubConfig(v) => {
424                std::option::Option::Some(v)
425            }
426            _ => std::option::Option::None,
427        })
428    }
429
430    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
431    /// to hold a `GithubConfig`.
432    ///
433    /// Note that all the setters affecting `connection_config` are
434    /// mutually exclusive.
435    pub fn set_github_config<T: std::convert::Into<std::boxed::Box<crate::model::GitHubConfig>>>(
436        mut self,
437        v: T,
438    ) -> Self {
439        self.connection_config = std::option::Option::Some(
440            crate::model::connection::ConnectionConfig::GithubConfig(v.into()),
441        );
442        self
443    }
444
445    /// The value of [connection_config][crate::model::Connection::connection_config]
446    /// if it holds a `GithubEnterpriseConfig`, `None` if the field is not set or
447    /// holds a different branch.
448    pub fn github_enterprise_config(
449        &self,
450    ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubEnterpriseConfig>> {
451        #[allow(unreachable_patterns)]
452        self.connection_config.as_ref().and_then(|v| match v {
453            crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v) => {
454                std::option::Option::Some(v)
455            }
456            _ => std::option::Option::None,
457        })
458    }
459
460    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
461    /// to hold a `GithubEnterpriseConfig`.
462    ///
463    /// Note that all the setters affecting `connection_config` are
464    /// mutually exclusive.
465    pub fn set_github_enterprise_config<
466        T: std::convert::Into<std::boxed::Box<crate::model::GitHubEnterpriseConfig>>,
467    >(
468        mut self,
469        v: T,
470    ) -> Self {
471        self.connection_config = std::option::Option::Some(
472            crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v.into()),
473        );
474        self
475    }
476
477    /// The value of [connection_config][crate::model::Connection::connection_config]
478    /// if it holds a `GitlabConfig`, `None` if the field is not set or
479    /// holds a different branch.
480    pub fn gitlab_config(
481        &self,
482    ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabConfig>> {
483        #[allow(unreachable_patterns)]
484        self.connection_config.as_ref().and_then(|v| match v {
485            crate::model::connection::ConnectionConfig::GitlabConfig(v) => {
486                std::option::Option::Some(v)
487            }
488            _ => std::option::Option::None,
489        })
490    }
491
492    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
493    /// to hold a `GitlabConfig`.
494    ///
495    /// Note that all the setters affecting `connection_config` are
496    /// mutually exclusive.
497    pub fn set_gitlab_config<T: std::convert::Into<std::boxed::Box<crate::model::GitLabConfig>>>(
498        mut self,
499        v: T,
500    ) -> Self {
501        self.connection_config = std::option::Option::Some(
502            crate::model::connection::ConnectionConfig::GitlabConfig(v.into()),
503        );
504        self
505    }
506
507    /// The value of [connection_config][crate::model::Connection::connection_config]
508    /// if it holds a `BitbucketDataCenterConfig`, `None` if the field is not set or
509    /// holds a different branch.
510    pub fn bitbucket_data_center_config(
511        &self,
512    ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketDataCenterConfig>> {
513        #[allow(unreachable_patterns)]
514        self.connection_config.as_ref().and_then(|v| match v {
515            crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v) => {
516                std::option::Option::Some(v)
517            }
518            _ => std::option::Option::None,
519        })
520    }
521
522    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
523    /// to hold a `BitbucketDataCenterConfig`.
524    ///
525    /// Note that all the setters affecting `connection_config` are
526    /// mutually exclusive.
527    pub fn set_bitbucket_data_center_config<
528        T: std::convert::Into<std::boxed::Box<crate::model::BitbucketDataCenterConfig>>,
529    >(
530        mut self,
531        v: T,
532    ) -> Self {
533        self.connection_config = std::option::Option::Some(
534            crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v.into()),
535        );
536        self
537    }
538
539    /// The value of [connection_config][crate::model::Connection::connection_config]
540    /// if it holds a `BitbucketCloudConfig`, `None` if the field is not set or
541    /// holds a different branch.
542    pub fn bitbucket_cloud_config(
543        &self,
544    ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketCloudConfig>> {
545        #[allow(unreachable_patterns)]
546        self.connection_config.as_ref().and_then(|v| match v {
547            crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v) => {
548                std::option::Option::Some(v)
549            }
550            _ => std::option::Option::None,
551        })
552    }
553
554    /// Sets the value of [connection_config][crate::model::Connection::connection_config]
555    /// to hold a `BitbucketCloudConfig`.
556    ///
557    /// Note that all the setters affecting `connection_config` are
558    /// mutually exclusive.
559    pub fn set_bitbucket_cloud_config<
560        T: std::convert::Into<std::boxed::Box<crate::model::BitbucketCloudConfig>>,
561    >(
562        mut self,
563        v: T,
564    ) -> Self {
565        self.connection_config = std::option::Option::Some(
566            crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v.into()),
567        );
568        self
569    }
570}
571
572impl wkt::message::Message for Connection {
573    fn typename() -> &'static str {
574        "type.googleapis.com/google.devtools.cloudbuild.v2.Connection"
575    }
576}
577
578/// Defines additional types related to [Connection].
579pub mod connection {
580    #[allow(unused_imports)]
581    use super::*;
582
583    /// Configuration for the connection depending on the type of provider.
584    #[derive(Clone, Debug, PartialEq)]
585    #[non_exhaustive]
586    pub enum ConnectionConfig {
587        /// Configuration for connections to github.com.
588        GithubConfig(std::boxed::Box<crate::model::GitHubConfig>),
589        /// Configuration for connections to an instance of GitHub Enterprise.
590        GithubEnterpriseConfig(std::boxed::Box<crate::model::GitHubEnterpriseConfig>),
591        /// Configuration for connections to gitlab.com or an instance of GitLab
592        /// Enterprise.
593        GitlabConfig(std::boxed::Box<crate::model::GitLabConfig>),
594        /// Configuration for connections to Bitbucket Data Center.
595        BitbucketDataCenterConfig(std::boxed::Box<crate::model::BitbucketDataCenterConfig>),
596        /// Configuration for connections to Bitbucket Cloud.
597        BitbucketCloudConfig(std::boxed::Box<crate::model::BitbucketCloudConfig>),
598    }
599}
600
601/// Describes stage and necessary actions to be taken by the
602/// user to complete the installation. Used for GitHub and GitHub Enterprise
603/// based connections.
604#[derive(Clone, Default, PartialEq)]
605#[non_exhaustive]
606pub struct InstallationState {
607    /// Output only. Current step of the installation process.
608    pub stage: crate::model::installation_state::Stage,
609
610    /// Output only. Message of what the user should do next to continue the
611    /// installation. Empty string if the installation is already complete.
612    pub message: std::string::String,
613
614    /// Output only. Link to follow for next action. Empty string if the
615    /// installation is already complete.
616    pub action_uri: std::string::String,
617
618    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
619}
620
621impl InstallationState {
622    pub fn new() -> Self {
623        std::default::Default::default()
624    }
625
626    /// Sets the value of [stage][crate::model::InstallationState::stage].
627    pub fn set_stage<T: std::convert::Into<crate::model::installation_state::Stage>>(
628        mut self,
629        v: T,
630    ) -> Self {
631        self.stage = v.into();
632        self
633    }
634
635    /// Sets the value of [message][crate::model::InstallationState::message].
636    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
637        self.message = v.into();
638        self
639    }
640
641    /// Sets the value of [action_uri][crate::model::InstallationState::action_uri].
642    pub fn set_action_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
643        self.action_uri = v.into();
644        self
645    }
646}
647
648impl wkt::message::Message for InstallationState {
649    fn typename() -> &'static str {
650        "type.googleapis.com/google.devtools.cloudbuild.v2.InstallationState"
651    }
652}
653
654/// Defines additional types related to [InstallationState].
655pub mod installation_state {
656    #[allow(unused_imports)]
657    use super::*;
658
659    /// Stage of the installation process.
660    ///
661    /// # Working with unknown values
662    ///
663    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
664    /// additional enum variants at any time. Adding new variants is not considered
665    /// a breaking change. Applications should write their code in anticipation of:
666    ///
667    /// - New values appearing in future releases of the client library, **and**
668    /// - New values received dynamically, without application changes.
669    ///
670    /// Please consult the [Working with enums] section in the user guide for some
671    /// guidelines.
672    ///
673    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
674    #[derive(Clone, Debug, PartialEq)]
675    #[non_exhaustive]
676    pub enum Stage {
677        /// No stage specified.
678        Unspecified,
679        /// Only for GitHub Enterprise. An App creation has been requested.
680        /// The user needs to confirm the creation in their GitHub enterprise host.
681        PendingCreateApp,
682        /// User needs to authorize the GitHub (or Enterprise) App via OAuth.
683        PendingUserOauth,
684        /// User needs to follow the link to install the GitHub (or Enterprise) App.
685        PendingInstallApp,
686        /// Installation process has been completed.
687        Complete,
688        /// If set, the enum was initialized with an unknown value.
689        ///
690        /// Applications can examine the value using [Stage::value] or
691        /// [Stage::name].
692        UnknownValue(stage::UnknownValue),
693    }
694
695    #[doc(hidden)]
696    pub mod stage {
697        #[allow(unused_imports)]
698        use super::*;
699        #[derive(Clone, Debug, PartialEq)]
700        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
701    }
702
703    impl Stage {
704        /// Gets the enum value.
705        ///
706        /// Returns `None` if the enum contains an unknown value deserialized from
707        /// the string representation of enums.
708        pub fn value(&self) -> std::option::Option<i32> {
709            match self {
710                Self::Unspecified => std::option::Option::Some(0),
711                Self::PendingCreateApp => std::option::Option::Some(1),
712                Self::PendingUserOauth => std::option::Option::Some(2),
713                Self::PendingInstallApp => std::option::Option::Some(3),
714                Self::Complete => std::option::Option::Some(10),
715                Self::UnknownValue(u) => u.0.value(),
716            }
717        }
718
719        /// Gets the enum value as a string.
720        ///
721        /// Returns `None` if the enum contains an unknown value deserialized from
722        /// the integer representation of enums.
723        pub fn name(&self) -> std::option::Option<&str> {
724            match self {
725                Self::Unspecified => std::option::Option::Some("STAGE_UNSPECIFIED"),
726                Self::PendingCreateApp => std::option::Option::Some("PENDING_CREATE_APP"),
727                Self::PendingUserOauth => std::option::Option::Some("PENDING_USER_OAUTH"),
728                Self::PendingInstallApp => std::option::Option::Some("PENDING_INSTALL_APP"),
729                Self::Complete => std::option::Option::Some("COMPLETE"),
730                Self::UnknownValue(u) => u.0.name(),
731            }
732        }
733    }
734
735    impl std::default::Default for Stage {
736        fn default() -> Self {
737            use std::convert::From;
738            Self::from(0)
739        }
740    }
741
742    impl std::fmt::Display for Stage {
743        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
744            wkt::internal::display_enum(f, self.name(), self.value())
745        }
746    }
747
748    impl std::convert::From<i32> for Stage {
749        fn from(value: i32) -> Self {
750            match value {
751                0 => Self::Unspecified,
752                1 => Self::PendingCreateApp,
753                2 => Self::PendingUserOauth,
754                3 => Self::PendingInstallApp,
755                10 => Self::Complete,
756                _ => Self::UnknownValue(stage::UnknownValue(
757                    wkt::internal::UnknownEnumValue::Integer(value),
758                )),
759            }
760        }
761    }
762
763    impl std::convert::From<&str> for Stage {
764        fn from(value: &str) -> Self {
765            use std::string::ToString;
766            match value {
767                "STAGE_UNSPECIFIED" => Self::Unspecified,
768                "PENDING_CREATE_APP" => Self::PendingCreateApp,
769                "PENDING_USER_OAUTH" => Self::PendingUserOauth,
770                "PENDING_INSTALL_APP" => Self::PendingInstallApp,
771                "COMPLETE" => Self::Complete,
772                _ => Self::UnknownValue(stage::UnknownValue(
773                    wkt::internal::UnknownEnumValue::String(value.to_string()),
774                )),
775            }
776        }
777    }
778
779    impl serde::ser::Serialize for Stage {
780        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
781        where
782            S: serde::Serializer,
783        {
784            match self {
785                Self::Unspecified => serializer.serialize_i32(0),
786                Self::PendingCreateApp => serializer.serialize_i32(1),
787                Self::PendingUserOauth => serializer.serialize_i32(2),
788                Self::PendingInstallApp => serializer.serialize_i32(3),
789                Self::Complete => serializer.serialize_i32(10),
790                Self::UnknownValue(u) => u.0.serialize(serializer),
791            }
792        }
793    }
794
795    impl<'de> serde::de::Deserialize<'de> for Stage {
796        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
797        where
798            D: serde::Deserializer<'de>,
799        {
800            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Stage>::new(
801                ".google.devtools.cloudbuild.v2.InstallationState.Stage",
802            ))
803        }
804    }
805}
806
807/// Request message for FetchLinkableRepositories.
808#[derive(Clone, Default, PartialEq)]
809#[non_exhaustive]
810pub struct FetchLinkableRepositoriesRequest {
811    /// Required. The name of the Connection.
812    /// Format: `projects/*/locations/*/connections/*`.
813    pub connection: std::string::String,
814
815    /// Number of results to return in the list. Default to 20.
816    pub page_size: i32,
817
818    /// Page start.
819    pub page_token: std::string::String,
820
821    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
822}
823
824impl FetchLinkableRepositoriesRequest {
825    pub fn new() -> Self {
826        std::default::Default::default()
827    }
828
829    /// Sets the value of [connection][crate::model::FetchLinkableRepositoriesRequest::connection].
830    pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
831        self.connection = v.into();
832        self
833    }
834
835    /// Sets the value of [page_size][crate::model::FetchLinkableRepositoriesRequest::page_size].
836    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
837        self.page_size = v.into();
838        self
839    }
840
841    /// Sets the value of [page_token][crate::model::FetchLinkableRepositoriesRequest::page_token].
842    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
843        self.page_token = v.into();
844        self
845    }
846}
847
848impl wkt::message::Message for FetchLinkableRepositoriesRequest {
849    fn typename() -> &'static str {
850        "type.googleapis.com/google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest"
851    }
852}
853
854/// Response message for FetchLinkableRepositories.
855#[derive(Clone, Default, PartialEq)]
856#[non_exhaustive]
857pub struct FetchLinkableRepositoriesResponse {
858    /// repositories ready to be created.
859    pub repositories: std::vec::Vec<crate::model::Repository>,
860
861    /// A token identifying a page of results the server should return.
862    pub next_page_token: std::string::String,
863
864    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
865}
866
867impl FetchLinkableRepositoriesResponse {
868    pub fn new() -> Self {
869        std::default::Default::default()
870    }
871
872    /// Sets the value of [repositories][crate::model::FetchLinkableRepositoriesResponse::repositories].
873    pub fn set_repositories<T, V>(mut self, v: T) -> Self
874    where
875        T: std::iter::IntoIterator<Item = V>,
876        V: std::convert::Into<crate::model::Repository>,
877    {
878        use std::iter::Iterator;
879        self.repositories = v.into_iter().map(|i| i.into()).collect();
880        self
881    }
882
883    /// Sets the value of [next_page_token][crate::model::FetchLinkableRepositoriesResponse::next_page_token].
884    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
885        self.next_page_token = v.into();
886        self
887    }
888}
889
890impl wkt::message::Message for FetchLinkableRepositoriesResponse {
891    fn typename() -> &'static str {
892        "type.googleapis.com/google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse"
893    }
894}
895
896#[doc(hidden)]
897impl gax::paginator::internal::PageableResponse for FetchLinkableRepositoriesResponse {
898    type PageItem = crate::model::Repository;
899
900    fn items(self) -> std::vec::Vec<Self::PageItem> {
901        self.repositories
902    }
903
904    fn next_page_token(&self) -> std::string::String {
905        use std::clone::Clone;
906        self.next_page_token.clone()
907    }
908}
909
910/// Configuration for connections to github.com.
911#[derive(Clone, Default, PartialEq)]
912#[non_exhaustive]
913pub struct GitHubConfig {
914    /// OAuth credential of the account that authorized the Cloud Build GitHub App.
915    /// It is recommended to use a robot account instead of a human user account.
916    /// The OAuth token must be tied to the Cloud Build GitHub App.
917    pub authorizer_credential: std::option::Option<crate::model::OAuthCredential>,
918
919    /// GitHub App installation id.
920    pub app_installation_id: i64,
921
922    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
923}
924
925impl GitHubConfig {
926    pub fn new() -> Self {
927        std::default::Default::default()
928    }
929
930    /// Sets the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
931    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
932    where
933        T: std::convert::Into<crate::model::OAuthCredential>,
934    {
935        self.authorizer_credential = std::option::Option::Some(v.into());
936        self
937    }
938
939    /// Sets or clears the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
940    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
941    where
942        T: std::convert::Into<crate::model::OAuthCredential>,
943    {
944        self.authorizer_credential = v.map(|x| x.into());
945        self
946    }
947
948    /// Sets the value of [app_installation_id][crate::model::GitHubConfig::app_installation_id].
949    pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
950        self.app_installation_id = v.into();
951        self
952    }
953}
954
955impl wkt::message::Message for GitHubConfig {
956    fn typename() -> &'static str {
957        "type.googleapis.com/google.devtools.cloudbuild.v2.GitHubConfig"
958    }
959}
960
961/// Configuration for connections to an instance of GitHub Enterprise.
962#[derive(Clone, Default, PartialEq)]
963#[non_exhaustive]
964pub struct GitHubEnterpriseConfig {
965    /// Required. The URI of the GitHub Enterprise host this connection is for.
966    pub host_uri: std::string::String,
967
968    /// Required. API Key used for authentication of webhook events.
969    pub api_key: std::string::String,
970
971    /// Id of the GitHub App created from the manifest.
972    pub app_id: i64,
973
974    /// The URL-friendly name of the GitHub App.
975    pub app_slug: std::string::String,
976
977    /// SecretManager resource containing the private key of the GitHub App,
978    /// formatted as `projects/*/secrets/*/versions/*`.
979    pub private_key_secret_version: std::string::String,
980
981    /// SecretManager resource containing the webhook secret of the GitHub App,
982    /// formatted as `projects/*/secrets/*/versions/*`.
983    pub webhook_secret_secret_version: std::string::String,
984
985    /// ID of the installation of the GitHub App.
986    pub app_installation_id: i64,
987
988    /// Configuration for using Service Directory to privately connect to a GitHub
989    /// Enterprise server. This should only be set if the GitHub Enterprise server
990    /// is hosted on-premises and not reachable by public internet. If this field
991    /// is left empty, calls to the GitHub Enterprise server will be made over the
992    /// public internet.
993    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
994
995    /// SSL certificate to use for requests to GitHub Enterprise.
996    pub ssl_ca: std::string::String,
997
998    /// Output only. GitHub Enterprise version installed at the host_uri.
999    pub server_version: std::string::String,
1000
1001    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1002}
1003
1004impl GitHubEnterpriseConfig {
1005    pub fn new() -> Self {
1006        std::default::Default::default()
1007    }
1008
1009    /// Sets the value of [host_uri][crate::model::GitHubEnterpriseConfig::host_uri].
1010    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1011        self.host_uri = v.into();
1012        self
1013    }
1014
1015    /// Sets the value of [api_key][crate::model::GitHubEnterpriseConfig::api_key].
1016    pub fn set_api_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1017        self.api_key = v.into();
1018        self
1019    }
1020
1021    /// Sets the value of [app_id][crate::model::GitHubEnterpriseConfig::app_id].
1022    pub fn set_app_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1023        self.app_id = v.into();
1024        self
1025    }
1026
1027    /// Sets the value of [app_slug][crate::model::GitHubEnterpriseConfig::app_slug].
1028    pub fn set_app_slug<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1029        self.app_slug = v.into();
1030        self
1031    }
1032
1033    /// Sets the value of [private_key_secret_version][crate::model::GitHubEnterpriseConfig::private_key_secret_version].
1034    pub fn set_private_key_secret_version<T: std::convert::Into<std::string::String>>(
1035        mut self,
1036        v: T,
1037    ) -> Self {
1038        self.private_key_secret_version = v.into();
1039        self
1040    }
1041
1042    /// Sets the value of [webhook_secret_secret_version][crate::model::GitHubEnterpriseConfig::webhook_secret_secret_version].
1043    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1044        mut self,
1045        v: T,
1046    ) -> Self {
1047        self.webhook_secret_secret_version = v.into();
1048        self
1049    }
1050
1051    /// Sets the value of [app_installation_id][crate::model::GitHubEnterpriseConfig::app_installation_id].
1052    pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1053        self.app_installation_id = v.into();
1054        self
1055    }
1056
1057    /// Sets the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
1058    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
1059    where
1060        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1061    {
1062        self.service_directory_config = std::option::Option::Some(v.into());
1063        self
1064    }
1065
1066    /// Sets or clears the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
1067    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
1068    where
1069        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1070    {
1071        self.service_directory_config = v.map(|x| x.into());
1072        self
1073    }
1074
1075    /// Sets the value of [ssl_ca][crate::model::GitHubEnterpriseConfig::ssl_ca].
1076    pub fn set_ssl_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1077        self.ssl_ca = v.into();
1078        self
1079    }
1080
1081    /// Sets the value of [server_version][crate::model::GitHubEnterpriseConfig::server_version].
1082    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1083        self.server_version = v.into();
1084        self
1085    }
1086}
1087
1088impl wkt::message::Message for GitHubEnterpriseConfig {
1089    fn typename() -> &'static str {
1090        "type.googleapis.com/google.devtools.cloudbuild.v2.GitHubEnterpriseConfig"
1091    }
1092}
1093
1094/// Configuration for connections to gitlab.com or an instance of GitLab
1095/// Enterprise.
1096#[derive(Clone, Default, PartialEq)]
1097#[non_exhaustive]
1098pub struct GitLabConfig {
1099    /// The URI of the GitLab Enterprise host this connection is for.
1100    /// If not specified, the default value is <https://gitlab.com>.
1101    pub host_uri: std::string::String,
1102
1103    /// Required. Immutable. SecretManager resource containing the webhook secret
1104    /// of a GitLab Enterprise project, formatted as
1105    /// `projects/*/secrets/*/versions/*`.
1106    pub webhook_secret_secret_version: std::string::String,
1107
1108    /// Required. A GitLab personal access token with the minimum `read_api` scope
1109    /// access.
1110    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
1111
1112    /// Required. A GitLab personal access token with the `api` scope access.
1113    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
1114
1115    /// Configuration for using Service Directory to privately connect to a GitLab
1116    /// Enterprise server. This should only be set if the GitLab Enterprise server
1117    /// is hosted on-premises and not reachable by public internet. If this field
1118    /// is left empty, calls to the GitLab Enterprise server will be made over the
1119    /// public internet.
1120    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1121
1122    /// SSL certificate to use for requests to GitLab Enterprise.
1123    pub ssl_ca: std::string::String,
1124
1125    /// Output only. Version of the GitLab Enterprise server running on the
1126    /// `host_uri`.
1127    pub server_version: std::string::String,
1128
1129    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1130}
1131
1132impl GitLabConfig {
1133    pub fn new() -> Self {
1134        std::default::Default::default()
1135    }
1136
1137    /// Sets the value of [host_uri][crate::model::GitLabConfig::host_uri].
1138    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1139        self.host_uri = v.into();
1140        self
1141    }
1142
1143    /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabConfig::webhook_secret_secret_version].
1144    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1145        mut self,
1146        v: T,
1147    ) -> Self {
1148        self.webhook_secret_secret_version = v.into();
1149        self
1150    }
1151
1152    /// Sets the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
1153    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
1154    where
1155        T: std::convert::Into<crate::model::UserCredential>,
1156    {
1157        self.read_authorizer_credential = std::option::Option::Some(v.into());
1158        self
1159    }
1160
1161    /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
1162    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1163    where
1164        T: std::convert::Into<crate::model::UserCredential>,
1165    {
1166        self.read_authorizer_credential = v.map(|x| x.into());
1167        self
1168    }
1169
1170    /// Sets the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
1171    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1172    where
1173        T: std::convert::Into<crate::model::UserCredential>,
1174    {
1175        self.authorizer_credential = std::option::Option::Some(v.into());
1176        self
1177    }
1178
1179    /// Sets or clears the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
1180    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1181    where
1182        T: std::convert::Into<crate::model::UserCredential>,
1183    {
1184        self.authorizer_credential = v.map(|x| x.into());
1185        self
1186    }
1187
1188    /// Sets the value of [service_directory_config][crate::model::GitLabConfig::service_directory_config].
1189    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
1190    where
1191        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1192    {
1193        self.service_directory_config = std::option::Option::Some(v.into());
1194        self
1195    }
1196
1197    /// Sets or clears the value of [service_directory_config][crate::model::GitLabConfig::service_directory_config].
1198    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
1199    where
1200        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1201    {
1202        self.service_directory_config = v.map(|x| x.into());
1203        self
1204    }
1205
1206    /// Sets the value of [ssl_ca][crate::model::GitLabConfig::ssl_ca].
1207    pub fn set_ssl_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1208        self.ssl_ca = v.into();
1209        self
1210    }
1211
1212    /// Sets the value of [server_version][crate::model::GitLabConfig::server_version].
1213    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1214        self.server_version = v.into();
1215        self
1216    }
1217}
1218
1219impl wkt::message::Message for GitLabConfig {
1220    fn typename() -> &'static str {
1221        "type.googleapis.com/google.devtools.cloudbuild.v2.GitLabConfig"
1222    }
1223}
1224
1225/// Configuration for connections to Bitbucket Data Center.
1226#[derive(Clone, Default, PartialEq)]
1227#[non_exhaustive]
1228pub struct BitbucketDataCenterConfig {
1229    /// Required. The URI of the Bitbucket Data Center instance or cluster this
1230    /// connection is for.
1231    pub host_uri: std::string::String,
1232
1233    /// Required. Immutable. SecretManager resource containing the webhook secret
1234    /// used to verify webhook events, formatted as
1235    /// `projects/*/secrets/*/versions/*`.
1236    pub webhook_secret_secret_version: std::string::String,
1237
1238    /// Required. A http access token with the `REPO_READ` access.
1239    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
1240
1241    /// Required. A http access token with the `REPO_ADMIN` scope access.
1242    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
1243
1244    /// Optional. Configuration for using Service Directory to privately connect to
1245    /// a Bitbucket Data Center. This should only be set if the Bitbucket Data
1246    /// Center is hosted on-premises and not reachable by public internet. If this
1247    /// field is left empty, calls to the Bitbucket Data Center will be made over
1248    /// the public internet.
1249    pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1250
1251    /// Optional. SSL certificate to use for requests to the Bitbucket Data Center.
1252    pub ssl_ca: std::string::String,
1253
1254    /// Output only. Version of the Bitbucket Data Center running on the
1255    /// `host_uri`.
1256    pub server_version: std::string::String,
1257
1258    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1259}
1260
1261impl BitbucketDataCenterConfig {
1262    pub fn new() -> Self {
1263        std::default::Default::default()
1264    }
1265
1266    /// Sets the value of [host_uri][crate::model::BitbucketDataCenterConfig::host_uri].
1267    pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1268        self.host_uri = v.into();
1269        self
1270    }
1271
1272    /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketDataCenterConfig::webhook_secret_secret_version].
1273    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1274        mut self,
1275        v: T,
1276    ) -> Self {
1277        self.webhook_secret_secret_version = v.into();
1278        self
1279    }
1280
1281    /// Sets the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
1282    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
1283    where
1284        T: std::convert::Into<crate::model::UserCredential>,
1285    {
1286        self.read_authorizer_credential = std::option::Option::Some(v.into());
1287        self
1288    }
1289
1290    /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
1291    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1292    where
1293        T: std::convert::Into<crate::model::UserCredential>,
1294    {
1295        self.read_authorizer_credential = v.map(|x| x.into());
1296        self
1297    }
1298
1299    /// Sets the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
1300    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1301    where
1302        T: std::convert::Into<crate::model::UserCredential>,
1303    {
1304        self.authorizer_credential = std::option::Option::Some(v.into());
1305        self
1306    }
1307
1308    /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
1309    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1310    where
1311        T: std::convert::Into<crate::model::UserCredential>,
1312    {
1313        self.authorizer_credential = v.map(|x| x.into());
1314        self
1315    }
1316
1317    /// Sets the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
1318    pub fn set_service_directory_config<T>(mut self, v: T) -> Self
1319    where
1320        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1321    {
1322        self.service_directory_config = std::option::Option::Some(v.into());
1323        self
1324    }
1325
1326    /// Sets or clears the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
1327    pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
1328    where
1329        T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1330    {
1331        self.service_directory_config = v.map(|x| x.into());
1332        self
1333    }
1334
1335    /// Sets the value of [ssl_ca][crate::model::BitbucketDataCenterConfig::ssl_ca].
1336    pub fn set_ssl_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1337        self.ssl_ca = v.into();
1338        self
1339    }
1340
1341    /// Sets the value of [server_version][crate::model::BitbucketDataCenterConfig::server_version].
1342    pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1343        self.server_version = v.into();
1344        self
1345    }
1346}
1347
1348impl wkt::message::Message for BitbucketDataCenterConfig {
1349    fn typename() -> &'static str {
1350        "type.googleapis.com/google.devtools.cloudbuild.v2.BitbucketDataCenterConfig"
1351    }
1352}
1353
1354/// Configuration for connections to Bitbucket Cloud.
1355#[derive(Clone, Default, PartialEq)]
1356#[non_exhaustive]
1357pub struct BitbucketCloudConfig {
1358    /// Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud
1359    /// Platform.
1360    pub workspace: std::string::String,
1361
1362    /// Required. SecretManager resource containing the webhook secret used to
1363    /// verify webhook events, formatted as `projects/*/secrets/*/versions/*`.
1364    pub webhook_secret_secret_version: std::string::String,
1365
1366    /// Required. An access token with the `repository` access. It can be either a
1367    /// workspace, project or repository access token. It's recommended to use a
1368    /// system account to generate the credentials.
1369    pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
1370
1371    /// Required. An access token with the `webhook`, `repository`,
1372    /// `repository:admin` and `pullrequest` scope access. It can be either a
1373    /// workspace, project or repository access token. It's recommended to use a
1374    /// system account to generate these credentials.
1375    pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
1376
1377    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1378}
1379
1380impl BitbucketCloudConfig {
1381    pub fn new() -> Self {
1382        std::default::Default::default()
1383    }
1384
1385    /// Sets the value of [workspace][crate::model::BitbucketCloudConfig::workspace].
1386    pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1387        self.workspace = v.into();
1388        self
1389    }
1390
1391    /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketCloudConfig::webhook_secret_secret_version].
1392    pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1393        mut self,
1394        v: T,
1395    ) -> Self {
1396        self.webhook_secret_secret_version = v.into();
1397        self
1398    }
1399
1400    /// Sets the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
1401    pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
1402    where
1403        T: std::convert::Into<crate::model::UserCredential>,
1404    {
1405        self.read_authorizer_credential = std::option::Option::Some(v.into());
1406        self
1407    }
1408
1409    /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
1410    pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1411    where
1412        T: std::convert::Into<crate::model::UserCredential>,
1413    {
1414        self.read_authorizer_credential = v.map(|x| x.into());
1415        self
1416    }
1417
1418    /// Sets the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
1419    pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1420    where
1421        T: std::convert::Into<crate::model::UserCredential>,
1422    {
1423        self.authorizer_credential = std::option::Option::Some(v.into());
1424        self
1425    }
1426
1427    /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
1428    pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1429    where
1430        T: std::convert::Into<crate::model::UserCredential>,
1431    {
1432        self.authorizer_credential = v.map(|x| x.into());
1433        self
1434    }
1435}
1436
1437impl wkt::message::Message for BitbucketCloudConfig {
1438    fn typename() -> &'static str {
1439        "type.googleapis.com/google.devtools.cloudbuild.v2.BitbucketCloudConfig"
1440    }
1441}
1442
1443/// ServiceDirectoryConfig represents Service Directory configuration for a
1444/// connection.
1445#[derive(Clone, Default, PartialEq)]
1446#[non_exhaustive]
1447pub struct ServiceDirectoryConfig {
1448    /// Required. The Service Directory service name.
1449    /// Format:
1450    /// projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
1451    pub service: std::string::String,
1452
1453    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1454}
1455
1456impl ServiceDirectoryConfig {
1457    pub fn new() -> Self {
1458        std::default::Default::default()
1459    }
1460
1461    /// Sets the value of [service][crate::model::ServiceDirectoryConfig::service].
1462    pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1463        self.service = v.into();
1464        self
1465    }
1466}
1467
1468impl wkt::message::Message for ServiceDirectoryConfig {
1469    fn typename() -> &'static str {
1470        "type.googleapis.com/google.devtools.cloudbuild.v2.ServiceDirectoryConfig"
1471    }
1472}
1473
1474/// A repository associated to a parent connection.
1475#[derive(Clone, Default, PartialEq)]
1476#[non_exhaustive]
1477pub struct Repository {
1478    /// Immutable. Resource name of the repository, in the format
1479    /// `projects/*/locations/*/connections/*/repositories/*`.
1480    pub name: std::string::String,
1481
1482    /// Required. Git Clone HTTPS URI.
1483    pub remote_uri: std::string::String,
1484
1485    /// Output only. Server assigned timestamp for when the connection was created.
1486    pub create_time: std::option::Option<wkt::Timestamp>,
1487
1488    /// Output only. Server assigned timestamp for when the connection was updated.
1489    pub update_time: std::option::Option<wkt::Timestamp>,
1490
1491    /// Allows clients to store small amounts of arbitrary data.
1492    pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
1493
1494    /// This checksum is computed by the server based on the value of other
1495    /// fields, and may be sent on update and delete requests to ensure the
1496    /// client has an up-to-date value before proceeding.
1497    pub etag: std::string::String,
1498
1499    /// Output only. External ID of the webhook created for the repository.
1500    pub webhook_id: std::string::String,
1501
1502    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1503}
1504
1505impl Repository {
1506    pub fn new() -> Self {
1507        std::default::Default::default()
1508    }
1509
1510    /// Sets the value of [name][crate::model::Repository::name].
1511    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1512        self.name = v.into();
1513        self
1514    }
1515
1516    /// Sets the value of [remote_uri][crate::model::Repository::remote_uri].
1517    pub fn set_remote_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1518        self.remote_uri = v.into();
1519        self
1520    }
1521
1522    /// Sets the value of [create_time][crate::model::Repository::create_time].
1523    pub fn set_create_time<T>(mut self, v: T) -> Self
1524    where
1525        T: std::convert::Into<wkt::Timestamp>,
1526    {
1527        self.create_time = std::option::Option::Some(v.into());
1528        self
1529    }
1530
1531    /// Sets or clears the value of [create_time][crate::model::Repository::create_time].
1532    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1533    where
1534        T: std::convert::Into<wkt::Timestamp>,
1535    {
1536        self.create_time = v.map(|x| x.into());
1537        self
1538    }
1539
1540    /// Sets the value of [update_time][crate::model::Repository::update_time].
1541    pub fn set_update_time<T>(mut self, v: T) -> Self
1542    where
1543        T: std::convert::Into<wkt::Timestamp>,
1544    {
1545        self.update_time = std::option::Option::Some(v.into());
1546        self
1547    }
1548
1549    /// Sets or clears the value of [update_time][crate::model::Repository::update_time].
1550    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1551    where
1552        T: std::convert::Into<wkt::Timestamp>,
1553    {
1554        self.update_time = v.map(|x| x.into());
1555        self
1556    }
1557
1558    /// Sets the value of [annotations][crate::model::Repository::annotations].
1559    pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
1560    where
1561        T: std::iter::IntoIterator<Item = (K, V)>,
1562        K: std::convert::Into<std::string::String>,
1563        V: std::convert::Into<std::string::String>,
1564    {
1565        use std::iter::Iterator;
1566        self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1567        self
1568    }
1569
1570    /// Sets the value of [etag][crate::model::Repository::etag].
1571    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1572        self.etag = v.into();
1573        self
1574    }
1575
1576    /// Sets the value of [webhook_id][crate::model::Repository::webhook_id].
1577    pub fn set_webhook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1578        self.webhook_id = v.into();
1579        self
1580    }
1581}
1582
1583impl wkt::message::Message for Repository {
1584    fn typename() -> &'static str {
1585        "type.googleapis.com/google.devtools.cloudbuild.v2.Repository"
1586    }
1587}
1588
1589/// Represents an OAuth token of the account that authorized the Connection,
1590/// and associated metadata.
1591#[derive(Clone, Default, PartialEq)]
1592#[non_exhaustive]
1593pub struct OAuthCredential {
1594    /// A SecretManager resource containing the OAuth token that authorizes
1595    /// the Cloud Build connection. Format: `projects/*/secrets/*/versions/*`.
1596    pub oauth_token_secret_version: std::string::String,
1597
1598    /// Output only. The username associated to this token.
1599    pub username: std::string::String,
1600
1601    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1602}
1603
1604impl OAuthCredential {
1605    pub fn new() -> Self {
1606        std::default::Default::default()
1607    }
1608
1609    /// Sets the value of [oauth_token_secret_version][crate::model::OAuthCredential::oauth_token_secret_version].
1610    pub fn set_oauth_token_secret_version<T: std::convert::Into<std::string::String>>(
1611        mut self,
1612        v: T,
1613    ) -> Self {
1614        self.oauth_token_secret_version = v.into();
1615        self
1616    }
1617
1618    /// Sets the value of [username][crate::model::OAuthCredential::username].
1619    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1620        self.username = v.into();
1621        self
1622    }
1623}
1624
1625impl wkt::message::Message for OAuthCredential {
1626    fn typename() -> &'static str {
1627        "type.googleapis.com/google.devtools.cloudbuild.v2.OAuthCredential"
1628    }
1629}
1630
1631/// Represents a personal access token that authorized the Connection,
1632/// and associated metadata.
1633#[derive(Clone, Default, PartialEq)]
1634#[non_exhaustive]
1635pub struct UserCredential {
1636    /// Required. A SecretManager resource containing the user token that
1637    /// authorizes the Cloud Build connection. Format:
1638    /// `projects/*/secrets/*/versions/*`.
1639    pub user_token_secret_version: std::string::String,
1640
1641    /// Output only. The username associated to this token.
1642    pub username: std::string::String,
1643
1644    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1645}
1646
1647impl UserCredential {
1648    pub fn new() -> Self {
1649        std::default::Default::default()
1650    }
1651
1652    /// Sets the value of [user_token_secret_version][crate::model::UserCredential::user_token_secret_version].
1653    pub fn set_user_token_secret_version<T: std::convert::Into<std::string::String>>(
1654        mut self,
1655        v: T,
1656    ) -> Self {
1657        self.user_token_secret_version = v.into();
1658        self
1659    }
1660
1661    /// Sets the value of [username][crate::model::UserCredential::username].
1662    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1663        self.username = v.into();
1664        self
1665    }
1666}
1667
1668impl wkt::message::Message for UserCredential {
1669    fn typename() -> &'static str {
1670        "type.googleapis.com/google.devtools.cloudbuild.v2.UserCredential"
1671    }
1672}
1673
1674/// Message for creating a Connection
1675#[derive(Clone, Default, PartialEq)]
1676#[non_exhaustive]
1677pub struct CreateConnectionRequest {
1678    /// Required. Project and location where the connection will be created.
1679    /// Format: `projects/*/locations/*`.
1680    pub parent: std::string::String,
1681
1682    /// Required. The Connection to create.
1683    pub connection: std::option::Option<crate::model::Connection>,
1684
1685    /// Required. The ID to use for the Connection, which will become the final
1686    /// component of the Connection's resource name. Names must be unique
1687    /// per-project per-location. Allows alphanumeric characters and any of
1688    /// -._~%!$&'()*+,;=@.
1689    pub connection_id: std::string::String,
1690
1691    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1692}
1693
1694impl CreateConnectionRequest {
1695    pub fn new() -> Self {
1696        std::default::Default::default()
1697    }
1698
1699    /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
1700    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1701        self.parent = v.into();
1702        self
1703    }
1704
1705    /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
1706    pub fn set_connection<T>(mut self, v: T) -> Self
1707    where
1708        T: std::convert::Into<crate::model::Connection>,
1709    {
1710        self.connection = std::option::Option::Some(v.into());
1711        self
1712    }
1713
1714    /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
1715    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
1716    where
1717        T: std::convert::Into<crate::model::Connection>,
1718    {
1719        self.connection = v.map(|x| x.into());
1720        self
1721    }
1722
1723    /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
1724    pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1725        self.connection_id = v.into();
1726        self
1727    }
1728}
1729
1730impl wkt::message::Message for CreateConnectionRequest {
1731    fn typename() -> &'static str {
1732        "type.googleapis.com/google.devtools.cloudbuild.v2.CreateConnectionRequest"
1733    }
1734}
1735
1736/// Message for getting the details of a Connection.
1737#[derive(Clone, Default, PartialEq)]
1738#[non_exhaustive]
1739pub struct GetConnectionRequest {
1740    /// Required. The name of the Connection to retrieve.
1741    /// Format: `projects/*/locations/*/connections/*`.
1742    pub name: std::string::String,
1743
1744    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1745}
1746
1747impl GetConnectionRequest {
1748    pub fn new() -> Self {
1749        std::default::Default::default()
1750    }
1751
1752    /// Sets the value of [name][crate::model::GetConnectionRequest::name].
1753    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1754        self.name = v.into();
1755        self
1756    }
1757}
1758
1759impl wkt::message::Message for GetConnectionRequest {
1760    fn typename() -> &'static str {
1761        "type.googleapis.com/google.devtools.cloudbuild.v2.GetConnectionRequest"
1762    }
1763}
1764
1765/// Message for requesting list of Connections.
1766#[derive(Clone, Default, PartialEq)]
1767#[non_exhaustive]
1768pub struct ListConnectionsRequest {
1769    /// Required. The parent, which owns this collection of Connections.
1770    /// Format: `projects/*/locations/*`.
1771    pub parent: std::string::String,
1772
1773    /// Number of results to return in the list.
1774    pub page_size: i32,
1775
1776    /// Page start.
1777    pub page_token: std::string::String,
1778
1779    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1780}
1781
1782impl ListConnectionsRequest {
1783    pub fn new() -> Self {
1784        std::default::Default::default()
1785    }
1786
1787    /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
1788    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1789        self.parent = v.into();
1790        self
1791    }
1792
1793    /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
1794    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1795        self.page_size = v.into();
1796        self
1797    }
1798
1799    /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
1800    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1801        self.page_token = v.into();
1802        self
1803    }
1804}
1805
1806impl wkt::message::Message for ListConnectionsRequest {
1807    fn typename() -> &'static str {
1808        "type.googleapis.com/google.devtools.cloudbuild.v2.ListConnectionsRequest"
1809    }
1810}
1811
1812/// Message for response to listing Connections.
1813#[derive(Clone, Default, PartialEq)]
1814#[non_exhaustive]
1815pub struct ListConnectionsResponse {
1816    /// The list of Connections.
1817    pub connections: std::vec::Vec<crate::model::Connection>,
1818
1819    /// A token identifying a page of results the server should return.
1820    pub next_page_token: std::string::String,
1821
1822    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1823}
1824
1825impl ListConnectionsResponse {
1826    pub fn new() -> Self {
1827        std::default::Default::default()
1828    }
1829
1830    /// Sets the value of [connections][crate::model::ListConnectionsResponse::connections].
1831    pub fn set_connections<T, V>(mut self, v: T) -> Self
1832    where
1833        T: std::iter::IntoIterator<Item = V>,
1834        V: std::convert::Into<crate::model::Connection>,
1835    {
1836        use std::iter::Iterator;
1837        self.connections = v.into_iter().map(|i| i.into()).collect();
1838        self
1839    }
1840
1841    /// Sets the value of [next_page_token][crate::model::ListConnectionsResponse::next_page_token].
1842    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1843        self.next_page_token = v.into();
1844        self
1845    }
1846}
1847
1848impl wkt::message::Message for ListConnectionsResponse {
1849    fn typename() -> &'static str {
1850        "type.googleapis.com/google.devtools.cloudbuild.v2.ListConnectionsResponse"
1851    }
1852}
1853
1854#[doc(hidden)]
1855impl gax::paginator::internal::PageableResponse for ListConnectionsResponse {
1856    type PageItem = crate::model::Connection;
1857
1858    fn items(self) -> std::vec::Vec<Self::PageItem> {
1859        self.connections
1860    }
1861
1862    fn next_page_token(&self) -> std::string::String {
1863        use std::clone::Clone;
1864        self.next_page_token.clone()
1865    }
1866}
1867
1868/// Message for updating a Connection.
1869#[derive(Clone, Default, PartialEq)]
1870#[non_exhaustive]
1871pub struct UpdateConnectionRequest {
1872    /// Required. The Connection to update.
1873    pub connection: std::option::Option<crate::model::Connection>,
1874
1875    /// The list of fields to be updated.
1876    pub update_mask: std::option::Option<wkt::FieldMask>,
1877
1878    /// If set to true, and the connection is not found a new connection
1879    /// will be created. In this situation `update_mask` is ignored.
1880    /// The creation will succeed only if the input connection has all the
1881    /// necessary information (e.g a github_config with both  user_oauth_token and
1882    /// installation_id properties).
1883    pub allow_missing: bool,
1884
1885    /// The current etag of the connection.
1886    /// If an etag is provided and does not match the current etag of the
1887    /// connection, update will be blocked and an ABORTED error will be returned.
1888    pub etag: std::string::String,
1889
1890    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1891}
1892
1893impl UpdateConnectionRequest {
1894    pub fn new() -> Self {
1895        std::default::Default::default()
1896    }
1897
1898    /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
1899    pub fn set_connection<T>(mut self, v: T) -> Self
1900    where
1901        T: std::convert::Into<crate::model::Connection>,
1902    {
1903        self.connection = std::option::Option::Some(v.into());
1904        self
1905    }
1906
1907    /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
1908    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
1909    where
1910        T: std::convert::Into<crate::model::Connection>,
1911    {
1912        self.connection = v.map(|x| x.into());
1913        self
1914    }
1915
1916    /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
1917    pub fn set_update_mask<T>(mut self, v: T) -> Self
1918    where
1919        T: std::convert::Into<wkt::FieldMask>,
1920    {
1921        self.update_mask = std::option::Option::Some(v.into());
1922        self
1923    }
1924
1925    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
1926    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1927    where
1928        T: std::convert::Into<wkt::FieldMask>,
1929    {
1930        self.update_mask = v.map(|x| x.into());
1931        self
1932    }
1933
1934    /// Sets the value of [allow_missing][crate::model::UpdateConnectionRequest::allow_missing].
1935    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1936        self.allow_missing = v.into();
1937        self
1938    }
1939
1940    /// Sets the value of [etag][crate::model::UpdateConnectionRequest::etag].
1941    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1942        self.etag = v.into();
1943        self
1944    }
1945}
1946
1947impl wkt::message::Message for UpdateConnectionRequest {
1948    fn typename() -> &'static str {
1949        "type.googleapis.com/google.devtools.cloudbuild.v2.UpdateConnectionRequest"
1950    }
1951}
1952
1953/// Message for deleting a Connection.
1954#[derive(Clone, Default, PartialEq)]
1955#[non_exhaustive]
1956pub struct DeleteConnectionRequest {
1957    /// Required. The name of the Connection to delete.
1958    /// Format: `projects/*/locations/*/connections/*`.
1959    pub name: std::string::String,
1960
1961    /// The current etag of the connection.
1962    /// If an etag is provided and does not match the current etag of the
1963    /// connection, deletion will be blocked and an ABORTED error will be returned.
1964    pub etag: std::string::String,
1965
1966    /// If set, validate the request, but do not actually post it.
1967    pub validate_only: bool,
1968
1969    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1970}
1971
1972impl DeleteConnectionRequest {
1973    pub fn new() -> Self {
1974        std::default::Default::default()
1975    }
1976
1977    /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
1978    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1979        self.name = v.into();
1980        self
1981    }
1982
1983    /// Sets the value of [etag][crate::model::DeleteConnectionRequest::etag].
1984    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1985        self.etag = v.into();
1986        self
1987    }
1988
1989    /// Sets the value of [validate_only][crate::model::DeleteConnectionRequest::validate_only].
1990    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1991        self.validate_only = v.into();
1992        self
1993    }
1994}
1995
1996impl wkt::message::Message for DeleteConnectionRequest {
1997    fn typename() -> &'static str {
1998        "type.googleapis.com/google.devtools.cloudbuild.v2.DeleteConnectionRequest"
1999    }
2000}
2001
2002/// Message for creating a Repository.
2003#[derive(Clone, Default, PartialEq)]
2004#[non_exhaustive]
2005pub struct CreateRepositoryRequest {
2006    /// Required. The connection to contain the repository. If the request is part
2007    /// of a BatchCreateRepositoriesRequest, this field should be empty or match
2008    /// the parent specified there.
2009    pub parent: std::string::String,
2010
2011    /// Required. The repository to create.
2012    pub repository: std::option::Option<crate::model::Repository>,
2013
2014    /// Required. The ID to use for the repository, which will become the final
2015    /// component of the repository's resource name. This ID should be unique in
2016    /// the connection. Allows alphanumeric characters and any of
2017    /// -._~%!$&'()*+,;=@.
2018    pub repository_id: std::string::String,
2019
2020    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2021}
2022
2023impl CreateRepositoryRequest {
2024    pub fn new() -> Self {
2025        std::default::Default::default()
2026    }
2027
2028    /// Sets the value of [parent][crate::model::CreateRepositoryRequest::parent].
2029    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2030        self.parent = v.into();
2031        self
2032    }
2033
2034    /// Sets the value of [repository][crate::model::CreateRepositoryRequest::repository].
2035    pub fn set_repository<T>(mut self, v: T) -> Self
2036    where
2037        T: std::convert::Into<crate::model::Repository>,
2038    {
2039        self.repository = std::option::Option::Some(v.into());
2040        self
2041    }
2042
2043    /// Sets or clears the value of [repository][crate::model::CreateRepositoryRequest::repository].
2044    pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
2045    where
2046        T: std::convert::Into<crate::model::Repository>,
2047    {
2048        self.repository = v.map(|x| x.into());
2049        self
2050    }
2051
2052    /// Sets the value of [repository_id][crate::model::CreateRepositoryRequest::repository_id].
2053    pub fn set_repository_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2054        self.repository_id = v.into();
2055        self
2056    }
2057}
2058
2059impl wkt::message::Message for CreateRepositoryRequest {
2060    fn typename() -> &'static str {
2061        "type.googleapis.com/google.devtools.cloudbuild.v2.CreateRepositoryRequest"
2062    }
2063}
2064
2065/// Message for creating repositoritories in batch.
2066#[derive(Clone, Default, PartialEq)]
2067#[non_exhaustive]
2068pub struct BatchCreateRepositoriesRequest {
2069    /// Required. The connection to contain all the repositories being created.
2070    /// Format: projects/*/locations/*/connections/*
2071    /// The parent field in the CreateRepositoryRequest messages
2072    /// must either be empty or match this field.
2073    pub parent: std::string::String,
2074
2075    /// Required. The request messages specifying the repositories to create.
2076    pub requests: std::vec::Vec<crate::model::CreateRepositoryRequest>,
2077
2078    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2079}
2080
2081impl BatchCreateRepositoriesRequest {
2082    pub fn new() -> Self {
2083        std::default::Default::default()
2084    }
2085
2086    /// Sets the value of [parent][crate::model::BatchCreateRepositoriesRequest::parent].
2087    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2088        self.parent = v.into();
2089        self
2090    }
2091
2092    /// Sets the value of [requests][crate::model::BatchCreateRepositoriesRequest::requests].
2093    pub fn set_requests<T, V>(mut self, v: T) -> Self
2094    where
2095        T: std::iter::IntoIterator<Item = V>,
2096        V: std::convert::Into<crate::model::CreateRepositoryRequest>,
2097    {
2098        use std::iter::Iterator;
2099        self.requests = v.into_iter().map(|i| i.into()).collect();
2100        self
2101    }
2102}
2103
2104impl wkt::message::Message for BatchCreateRepositoriesRequest {
2105    fn typename() -> &'static str {
2106        "type.googleapis.com/google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest"
2107    }
2108}
2109
2110/// Message for response of creating repositories in batch.
2111#[derive(Clone, Default, PartialEq)]
2112#[non_exhaustive]
2113pub struct BatchCreateRepositoriesResponse {
2114    /// Repository resources created.
2115    pub repositories: std::vec::Vec<crate::model::Repository>,
2116
2117    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2118}
2119
2120impl BatchCreateRepositoriesResponse {
2121    pub fn new() -> Self {
2122        std::default::Default::default()
2123    }
2124
2125    /// Sets the value of [repositories][crate::model::BatchCreateRepositoriesResponse::repositories].
2126    pub fn set_repositories<T, V>(mut self, v: T) -> Self
2127    where
2128        T: std::iter::IntoIterator<Item = V>,
2129        V: std::convert::Into<crate::model::Repository>,
2130    {
2131        use std::iter::Iterator;
2132        self.repositories = v.into_iter().map(|i| i.into()).collect();
2133        self
2134    }
2135}
2136
2137impl wkt::message::Message for BatchCreateRepositoriesResponse {
2138    fn typename() -> &'static str {
2139        "type.googleapis.com/google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse"
2140    }
2141}
2142
2143/// Message for getting the details of a Repository.
2144#[derive(Clone, Default, PartialEq)]
2145#[non_exhaustive]
2146pub struct GetRepositoryRequest {
2147    /// Required. The name of the Repository to retrieve.
2148    /// Format: `projects/*/locations/*/connections/*/repositories/*`.
2149    pub name: std::string::String,
2150
2151    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2152}
2153
2154impl GetRepositoryRequest {
2155    pub fn new() -> Self {
2156        std::default::Default::default()
2157    }
2158
2159    /// Sets the value of [name][crate::model::GetRepositoryRequest::name].
2160    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2161        self.name = v.into();
2162        self
2163    }
2164}
2165
2166impl wkt::message::Message for GetRepositoryRequest {
2167    fn typename() -> &'static str {
2168        "type.googleapis.com/google.devtools.cloudbuild.v2.GetRepositoryRequest"
2169    }
2170}
2171
2172/// Message for requesting list of Repositories.
2173#[derive(Clone, Default, PartialEq)]
2174#[non_exhaustive]
2175pub struct ListRepositoriesRequest {
2176    /// Required. The parent, which owns this collection of Repositories.
2177    /// Format: `projects/*/locations/*/connections/*`.
2178    pub parent: std::string::String,
2179
2180    /// Number of results to return in the list.
2181    pub page_size: i32,
2182
2183    /// Page start.
2184    pub page_token: std::string::String,
2185
2186    /// A filter expression that filters resources listed in the response.
2187    /// Expressions must follow API improvement proposal
2188    /// [AIP-160](https://google.aip.dev/160). e.g.
2189    /// `remote_uri:"<https://github.com>*"`.
2190    pub filter: std::string::String,
2191
2192    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2193}
2194
2195impl ListRepositoriesRequest {
2196    pub fn new() -> Self {
2197        std::default::Default::default()
2198    }
2199
2200    /// Sets the value of [parent][crate::model::ListRepositoriesRequest::parent].
2201    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2202        self.parent = v.into();
2203        self
2204    }
2205
2206    /// Sets the value of [page_size][crate::model::ListRepositoriesRequest::page_size].
2207    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2208        self.page_size = v.into();
2209        self
2210    }
2211
2212    /// Sets the value of [page_token][crate::model::ListRepositoriesRequest::page_token].
2213    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2214        self.page_token = v.into();
2215        self
2216    }
2217
2218    /// Sets the value of [filter][crate::model::ListRepositoriesRequest::filter].
2219    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2220        self.filter = v.into();
2221        self
2222    }
2223}
2224
2225impl wkt::message::Message for ListRepositoriesRequest {
2226    fn typename() -> &'static str {
2227        "type.googleapis.com/google.devtools.cloudbuild.v2.ListRepositoriesRequest"
2228    }
2229}
2230
2231/// Message for response to listing Repositories.
2232#[derive(Clone, Default, PartialEq)]
2233#[non_exhaustive]
2234pub struct ListRepositoriesResponse {
2235    /// The list of Repositories.
2236    pub repositories: std::vec::Vec<crate::model::Repository>,
2237
2238    /// A token identifying a page of results the server should return.
2239    pub next_page_token: std::string::String,
2240
2241    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2242}
2243
2244impl ListRepositoriesResponse {
2245    pub fn new() -> Self {
2246        std::default::Default::default()
2247    }
2248
2249    /// Sets the value of [repositories][crate::model::ListRepositoriesResponse::repositories].
2250    pub fn set_repositories<T, V>(mut self, v: T) -> Self
2251    where
2252        T: std::iter::IntoIterator<Item = V>,
2253        V: std::convert::Into<crate::model::Repository>,
2254    {
2255        use std::iter::Iterator;
2256        self.repositories = v.into_iter().map(|i| i.into()).collect();
2257        self
2258    }
2259
2260    /// Sets the value of [next_page_token][crate::model::ListRepositoriesResponse::next_page_token].
2261    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2262        self.next_page_token = v.into();
2263        self
2264    }
2265}
2266
2267impl wkt::message::Message for ListRepositoriesResponse {
2268    fn typename() -> &'static str {
2269        "type.googleapis.com/google.devtools.cloudbuild.v2.ListRepositoriesResponse"
2270    }
2271}
2272
2273#[doc(hidden)]
2274impl gax::paginator::internal::PageableResponse for ListRepositoriesResponse {
2275    type PageItem = crate::model::Repository;
2276
2277    fn items(self) -> std::vec::Vec<Self::PageItem> {
2278        self.repositories
2279    }
2280
2281    fn next_page_token(&self) -> std::string::String {
2282        use std::clone::Clone;
2283        self.next_page_token.clone()
2284    }
2285}
2286
2287/// Message for deleting a Repository.
2288#[derive(Clone, Default, PartialEq)]
2289#[non_exhaustive]
2290pub struct DeleteRepositoryRequest {
2291    /// Required. The name of the Repository to delete.
2292    /// Format: `projects/*/locations/*/connections/*/repositories/*`.
2293    pub name: std::string::String,
2294
2295    /// The current etag of the repository.
2296    /// If an etag is provided and does not match the current etag of the
2297    /// repository, deletion will be blocked and an ABORTED error will be returned.
2298    pub etag: std::string::String,
2299
2300    /// If set, validate the request, but do not actually post it.
2301    pub validate_only: bool,
2302
2303    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2304}
2305
2306impl DeleteRepositoryRequest {
2307    pub fn new() -> Self {
2308        std::default::Default::default()
2309    }
2310
2311    /// Sets the value of [name][crate::model::DeleteRepositoryRequest::name].
2312    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2313        self.name = v.into();
2314        self
2315    }
2316
2317    /// Sets the value of [etag][crate::model::DeleteRepositoryRequest::etag].
2318    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2319        self.etag = v.into();
2320        self
2321    }
2322
2323    /// Sets the value of [validate_only][crate::model::DeleteRepositoryRequest::validate_only].
2324    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2325        self.validate_only = v.into();
2326        self
2327    }
2328}
2329
2330impl wkt::message::Message for DeleteRepositoryRequest {
2331    fn typename() -> &'static str {
2332        "type.googleapis.com/google.devtools.cloudbuild.v2.DeleteRepositoryRequest"
2333    }
2334}
2335
2336/// Message for fetching SCM read/write token.
2337#[derive(Clone, Default, PartialEq)]
2338#[non_exhaustive]
2339pub struct FetchReadWriteTokenRequest {
2340    /// Required. The resource name of the repository in the format
2341    /// `projects/*/locations/*/connections/*/repositories/*`.
2342    pub repository: std::string::String,
2343
2344    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2345}
2346
2347impl FetchReadWriteTokenRequest {
2348    pub fn new() -> Self {
2349        std::default::Default::default()
2350    }
2351
2352    /// Sets the value of [repository][crate::model::FetchReadWriteTokenRequest::repository].
2353    pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2354        self.repository = v.into();
2355        self
2356    }
2357}
2358
2359impl wkt::message::Message for FetchReadWriteTokenRequest {
2360    fn typename() -> &'static str {
2361        "type.googleapis.com/google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest"
2362    }
2363}
2364
2365/// Message for fetching SCM read token.
2366#[derive(Clone, Default, PartialEq)]
2367#[non_exhaustive]
2368pub struct FetchReadTokenRequest {
2369    /// Required. The resource name of the repository in the format
2370    /// `projects/*/locations/*/connections/*/repositories/*`.
2371    pub repository: std::string::String,
2372
2373    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2374}
2375
2376impl FetchReadTokenRequest {
2377    pub fn new() -> Self {
2378        std::default::Default::default()
2379    }
2380
2381    /// Sets the value of [repository][crate::model::FetchReadTokenRequest::repository].
2382    pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2383        self.repository = v.into();
2384        self
2385    }
2386}
2387
2388impl wkt::message::Message for FetchReadTokenRequest {
2389    fn typename() -> &'static str {
2390        "type.googleapis.com/google.devtools.cloudbuild.v2.FetchReadTokenRequest"
2391    }
2392}
2393
2394/// Message for responding to get read token.
2395#[derive(Clone, Default, PartialEq)]
2396#[non_exhaustive]
2397pub struct FetchReadTokenResponse {
2398    /// The token content.
2399    pub token: std::string::String,
2400
2401    /// Expiration timestamp. Can be empty if unknown or non-expiring.
2402    pub expiration_time: std::option::Option<wkt::Timestamp>,
2403
2404    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2405}
2406
2407impl FetchReadTokenResponse {
2408    pub fn new() -> Self {
2409        std::default::Default::default()
2410    }
2411
2412    /// Sets the value of [token][crate::model::FetchReadTokenResponse::token].
2413    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2414        self.token = v.into();
2415        self
2416    }
2417
2418    /// Sets the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
2419    pub fn set_expiration_time<T>(mut self, v: T) -> Self
2420    where
2421        T: std::convert::Into<wkt::Timestamp>,
2422    {
2423        self.expiration_time = std::option::Option::Some(v.into());
2424        self
2425    }
2426
2427    /// Sets or clears the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
2428    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
2429    where
2430        T: std::convert::Into<wkt::Timestamp>,
2431    {
2432        self.expiration_time = v.map(|x| x.into());
2433        self
2434    }
2435}
2436
2437impl wkt::message::Message for FetchReadTokenResponse {
2438    fn typename() -> &'static str {
2439        "type.googleapis.com/google.devtools.cloudbuild.v2.FetchReadTokenResponse"
2440    }
2441}
2442
2443/// Message for responding to get read/write token.
2444#[derive(Clone, Default, PartialEq)]
2445#[non_exhaustive]
2446pub struct FetchReadWriteTokenResponse {
2447    /// The token content.
2448    pub token: std::string::String,
2449
2450    /// Expiration timestamp. Can be empty if unknown or non-expiring.
2451    pub expiration_time: std::option::Option<wkt::Timestamp>,
2452
2453    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2454}
2455
2456impl FetchReadWriteTokenResponse {
2457    pub fn new() -> Self {
2458        std::default::Default::default()
2459    }
2460
2461    /// Sets the value of [token][crate::model::FetchReadWriteTokenResponse::token].
2462    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2463        self.token = v.into();
2464        self
2465    }
2466
2467    /// Sets the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
2468    pub fn set_expiration_time<T>(mut self, v: T) -> Self
2469    where
2470        T: std::convert::Into<wkt::Timestamp>,
2471    {
2472        self.expiration_time = std::option::Option::Some(v.into());
2473        self
2474    }
2475
2476    /// Sets or clears the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
2477    pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
2478    where
2479        T: std::convert::Into<wkt::Timestamp>,
2480    {
2481        self.expiration_time = v.map(|x| x.into());
2482        self
2483    }
2484}
2485
2486impl wkt::message::Message for FetchReadWriteTokenResponse {
2487    fn typename() -> &'static str {
2488        "type.googleapis.com/google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse"
2489    }
2490}
2491
2492/// RPC request object accepted by the ProcessWebhook RPC method.
2493#[derive(Clone, Default, PartialEq)]
2494#[non_exhaustive]
2495pub struct ProcessWebhookRequest {
2496    /// Required. Project and location where the webhook will be received.
2497    /// Format: `projects/*/locations/*`.
2498    pub parent: std::string::String,
2499
2500    /// HTTP request body.
2501    pub body: std::option::Option<api::model::HttpBody>,
2502
2503    /// Arbitrary additional key to find the maching repository for a webhook event
2504    /// if needed.
2505    pub webhook_key: std::string::String,
2506
2507    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2508}
2509
2510impl ProcessWebhookRequest {
2511    pub fn new() -> Self {
2512        std::default::Default::default()
2513    }
2514
2515    /// Sets the value of [parent][crate::model::ProcessWebhookRequest::parent].
2516    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2517        self.parent = v.into();
2518        self
2519    }
2520
2521    /// Sets the value of [body][crate::model::ProcessWebhookRequest::body].
2522    pub fn set_body<T>(mut self, v: T) -> Self
2523    where
2524        T: std::convert::Into<api::model::HttpBody>,
2525    {
2526        self.body = std::option::Option::Some(v.into());
2527        self
2528    }
2529
2530    /// Sets or clears the value of [body][crate::model::ProcessWebhookRequest::body].
2531    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2532    where
2533        T: std::convert::Into<api::model::HttpBody>,
2534    {
2535        self.body = v.map(|x| x.into());
2536        self
2537    }
2538
2539    /// Sets the value of [webhook_key][crate::model::ProcessWebhookRequest::webhook_key].
2540    pub fn set_webhook_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2541        self.webhook_key = v.into();
2542        self
2543    }
2544}
2545
2546impl wkt::message::Message for ProcessWebhookRequest {
2547    fn typename() -> &'static str {
2548        "type.googleapis.com/google.devtools.cloudbuild.v2.ProcessWebhookRequest"
2549    }
2550}
2551
2552/// Request for fetching git refs
2553#[derive(Clone, Default, PartialEq)]
2554#[non_exhaustive]
2555pub struct FetchGitRefsRequest {
2556    /// Required. The resource name of the repository in the format
2557    /// `projects/*/locations/*/connections/*/repositories/*`.
2558    pub repository: std::string::String,
2559
2560    /// Type of refs to fetch
2561    pub ref_type: crate::model::fetch_git_refs_request::RefType,
2562
2563    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2564}
2565
2566impl FetchGitRefsRequest {
2567    pub fn new() -> Self {
2568        std::default::Default::default()
2569    }
2570
2571    /// Sets the value of [repository][crate::model::FetchGitRefsRequest::repository].
2572    pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2573        self.repository = v.into();
2574        self
2575    }
2576
2577    /// Sets the value of [ref_type][crate::model::FetchGitRefsRequest::ref_type].
2578    pub fn set_ref_type<T: std::convert::Into<crate::model::fetch_git_refs_request::RefType>>(
2579        mut self,
2580        v: T,
2581    ) -> Self {
2582        self.ref_type = v.into();
2583        self
2584    }
2585}
2586
2587impl wkt::message::Message for FetchGitRefsRequest {
2588    fn typename() -> &'static str {
2589        "type.googleapis.com/google.devtools.cloudbuild.v2.FetchGitRefsRequest"
2590    }
2591}
2592
2593/// Defines additional types related to [FetchGitRefsRequest].
2594pub mod fetch_git_refs_request {
2595    #[allow(unused_imports)]
2596    use super::*;
2597
2598    /// Type of refs
2599    ///
2600    /// # Working with unknown values
2601    ///
2602    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2603    /// additional enum variants at any time. Adding new variants is not considered
2604    /// a breaking change. Applications should write their code in anticipation of:
2605    ///
2606    /// - New values appearing in future releases of the client library, **and**
2607    /// - New values received dynamically, without application changes.
2608    ///
2609    /// Please consult the [Working with enums] section in the user guide for some
2610    /// guidelines.
2611    ///
2612    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2613    #[derive(Clone, Debug, PartialEq)]
2614    #[non_exhaustive]
2615    pub enum RefType {
2616        /// No type specified.
2617        Unspecified,
2618        /// To fetch tags.
2619        Tag,
2620        /// To fetch branches.
2621        Branch,
2622        /// If set, the enum was initialized with an unknown value.
2623        ///
2624        /// Applications can examine the value using [RefType::value] or
2625        /// [RefType::name].
2626        UnknownValue(ref_type::UnknownValue),
2627    }
2628
2629    #[doc(hidden)]
2630    pub mod ref_type {
2631        #[allow(unused_imports)]
2632        use super::*;
2633        #[derive(Clone, Debug, PartialEq)]
2634        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2635    }
2636
2637    impl RefType {
2638        /// Gets the enum value.
2639        ///
2640        /// Returns `None` if the enum contains an unknown value deserialized from
2641        /// the string representation of enums.
2642        pub fn value(&self) -> std::option::Option<i32> {
2643            match self {
2644                Self::Unspecified => std::option::Option::Some(0),
2645                Self::Tag => std::option::Option::Some(1),
2646                Self::Branch => std::option::Option::Some(2),
2647                Self::UnknownValue(u) => u.0.value(),
2648            }
2649        }
2650
2651        /// Gets the enum value as a string.
2652        ///
2653        /// Returns `None` if the enum contains an unknown value deserialized from
2654        /// the integer representation of enums.
2655        pub fn name(&self) -> std::option::Option<&str> {
2656            match self {
2657                Self::Unspecified => std::option::Option::Some("REF_TYPE_UNSPECIFIED"),
2658                Self::Tag => std::option::Option::Some("TAG"),
2659                Self::Branch => std::option::Option::Some("BRANCH"),
2660                Self::UnknownValue(u) => u.0.name(),
2661            }
2662        }
2663    }
2664
2665    impl std::default::Default for RefType {
2666        fn default() -> Self {
2667            use std::convert::From;
2668            Self::from(0)
2669        }
2670    }
2671
2672    impl std::fmt::Display for RefType {
2673        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2674            wkt::internal::display_enum(f, self.name(), self.value())
2675        }
2676    }
2677
2678    impl std::convert::From<i32> for RefType {
2679        fn from(value: i32) -> Self {
2680            match value {
2681                0 => Self::Unspecified,
2682                1 => Self::Tag,
2683                2 => Self::Branch,
2684                _ => Self::UnknownValue(ref_type::UnknownValue(
2685                    wkt::internal::UnknownEnumValue::Integer(value),
2686                )),
2687            }
2688        }
2689    }
2690
2691    impl std::convert::From<&str> for RefType {
2692        fn from(value: &str) -> Self {
2693            use std::string::ToString;
2694            match value {
2695                "REF_TYPE_UNSPECIFIED" => Self::Unspecified,
2696                "TAG" => Self::Tag,
2697                "BRANCH" => Self::Branch,
2698                _ => Self::UnknownValue(ref_type::UnknownValue(
2699                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2700                )),
2701            }
2702        }
2703    }
2704
2705    impl serde::ser::Serialize for RefType {
2706        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2707        where
2708            S: serde::Serializer,
2709        {
2710            match self {
2711                Self::Unspecified => serializer.serialize_i32(0),
2712                Self::Tag => serializer.serialize_i32(1),
2713                Self::Branch => serializer.serialize_i32(2),
2714                Self::UnknownValue(u) => u.0.serialize(serializer),
2715            }
2716        }
2717    }
2718
2719    impl<'de> serde::de::Deserialize<'de> for RefType {
2720        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2721        where
2722            D: serde::Deserializer<'de>,
2723        {
2724            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RefType>::new(
2725                ".google.devtools.cloudbuild.v2.FetchGitRefsRequest.RefType",
2726            ))
2727        }
2728    }
2729}
2730
2731/// Response for fetching git refs
2732#[derive(Clone, Default, PartialEq)]
2733#[non_exhaustive]
2734pub struct FetchGitRefsResponse {
2735    /// Name of the refs fetched.
2736    pub ref_names: std::vec::Vec<std::string::String>,
2737
2738    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2739}
2740
2741impl FetchGitRefsResponse {
2742    pub fn new() -> Self {
2743        std::default::Default::default()
2744    }
2745
2746    /// Sets the value of [ref_names][crate::model::FetchGitRefsResponse::ref_names].
2747    pub fn set_ref_names<T, V>(mut self, v: T) -> Self
2748    where
2749        T: std::iter::IntoIterator<Item = V>,
2750        V: std::convert::Into<std::string::String>,
2751    {
2752        use std::iter::Iterator;
2753        self.ref_names = v.into_iter().map(|i| i.into()).collect();
2754        self
2755    }
2756}
2757
2758impl wkt::message::Message for FetchGitRefsResponse {
2759    fn typename() -> &'static str {
2760        "type.googleapis.com/google.devtools.cloudbuild.v2.FetchGitRefsResponse"
2761    }
2762}