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