google_cloud_developerconnect_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_location;
27extern crate google_cloud_longrunning;
28extern crate google_cloud_lro;
29extern crate google_cloud_rpc;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// Message for requesting a list of Users
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct ListUsersRequest {
45 /// Required. Parent value for ListUsersRequest
46 pub parent: std::string::String,
47
48 /// Optional. Requested page size. Server may return fewer items than
49 /// requested. If unspecified, server will pick an appropriate default.
50 pub page_size: i32,
51
52 /// Optional. A token identifying a page of results the server should return.
53 pub page_token: std::string::String,
54
55 /// Optional. Filtering results
56 pub filter: std::string::String,
57
58 /// Optional. Hint for how to order the results
59 pub order_by: std::string::String,
60
61 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
62}
63
64impl ListUsersRequest {
65 /// Creates a new default instance.
66 pub fn new() -> Self {
67 std::default::Default::default()
68 }
69
70 /// Sets the value of [parent][crate::model::ListUsersRequest::parent].
71 ///
72 /// # Example
73 /// ```ignore,no_run
74 /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
75 /// # let project_id = "project_id";
76 /// # let location_id = "location_id";
77 /// # let account_connector_id = "account_connector_id";
78 /// let x = ListUsersRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
79 /// ```
80 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
81 self.parent = v.into();
82 self
83 }
84
85 /// Sets the value of [page_size][crate::model::ListUsersRequest::page_size].
86 ///
87 /// # Example
88 /// ```ignore,no_run
89 /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
90 /// let x = ListUsersRequest::new().set_page_size(42);
91 /// ```
92 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
93 self.page_size = v.into();
94 self
95 }
96
97 /// Sets the value of [page_token][crate::model::ListUsersRequest::page_token].
98 ///
99 /// # Example
100 /// ```ignore,no_run
101 /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
102 /// let x = ListUsersRequest::new().set_page_token("example");
103 /// ```
104 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
105 self.page_token = v.into();
106 self
107 }
108
109 /// Sets the value of [filter][crate::model::ListUsersRequest::filter].
110 ///
111 /// # Example
112 /// ```ignore,no_run
113 /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
114 /// let x = ListUsersRequest::new().set_filter("example");
115 /// ```
116 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
117 self.filter = v.into();
118 self
119 }
120
121 /// Sets the value of [order_by][crate::model::ListUsersRequest::order_by].
122 ///
123 /// # Example
124 /// ```ignore,no_run
125 /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
126 /// let x = ListUsersRequest::new().set_order_by("example");
127 /// ```
128 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
129 self.order_by = v.into();
130 self
131 }
132}
133
134impl wkt::message::Message for ListUsersRequest {
135 fn typename() -> &'static str {
136 "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersRequest"
137 }
138}
139
140/// Message for response to listing Users
141#[derive(Clone, Default, PartialEq)]
142#[non_exhaustive]
143pub struct ListUsersResponse {
144 /// The list of Users
145 pub users: std::vec::Vec<crate::model::User>,
146
147 /// A token identifying a page of results the server should return.
148 pub next_page_token: std::string::String,
149
150 /// Locations that could not be reached.
151 pub unreachable: std::vec::Vec<std::string::String>,
152
153 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
154}
155
156impl ListUsersResponse {
157 /// Creates a new default instance.
158 pub fn new() -> Self {
159 std::default::Default::default()
160 }
161
162 /// Sets the value of [users][crate::model::ListUsersResponse::users].
163 ///
164 /// # Example
165 /// ```ignore,no_run
166 /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
167 /// use google_cloud_developerconnect_v1::model::User;
168 /// let x = ListUsersResponse::new()
169 /// .set_users([
170 /// User::default()/* use setters */,
171 /// User::default()/* use (different) setters */,
172 /// ]);
173 /// ```
174 pub fn set_users<T, V>(mut self, v: T) -> Self
175 where
176 T: std::iter::IntoIterator<Item = V>,
177 V: std::convert::Into<crate::model::User>,
178 {
179 use std::iter::Iterator;
180 self.users = v.into_iter().map(|i| i.into()).collect();
181 self
182 }
183
184 /// Sets the value of [next_page_token][crate::model::ListUsersResponse::next_page_token].
185 ///
186 /// # Example
187 /// ```ignore,no_run
188 /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
189 /// let x = ListUsersResponse::new().set_next_page_token("example");
190 /// ```
191 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
192 self.next_page_token = v.into();
193 self
194 }
195
196 /// Sets the value of [unreachable][crate::model::ListUsersResponse::unreachable].
197 ///
198 /// # Example
199 /// ```ignore,no_run
200 /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
201 /// let x = ListUsersResponse::new().set_unreachable(["a", "b", "c"]);
202 /// ```
203 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
204 where
205 T: std::iter::IntoIterator<Item = V>,
206 V: std::convert::Into<std::string::String>,
207 {
208 use std::iter::Iterator;
209 self.unreachable = v.into_iter().map(|i| i.into()).collect();
210 self
211 }
212}
213
214impl wkt::message::Message for ListUsersResponse {
215 fn typename() -> &'static str {
216 "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersResponse"
217 }
218}
219
220#[doc(hidden)]
221impl google_cloud_gax::paginator::internal::PageableResponse for ListUsersResponse {
222 type PageItem = crate::model::User;
223
224 fn items(self) -> std::vec::Vec<Self::PageItem> {
225 self.users
226 }
227
228 fn next_page_token(&self) -> std::string::String {
229 use std::clone::Clone;
230 self.next_page_token.clone()
231 }
232}
233
234/// Message describing Connection object
235#[derive(Clone, Default, PartialEq)]
236#[non_exhaustive]
237pub struct Connection {
238 /// Identifier. The resource name of the connection, in the format
239 /// `projects/{project}/locations/{location}/connections/{connection_id}`.
240 pub name: std::string::String,
241
242 /// Output only. [Output only] Create timestamp
243 pub create_time: std::option::Option<wkt::Timestamp>,
244
245 /// Output only. [Output only] Update timestamp
246 pub update_time: std::option::Option<wkt::Timestamp>,
247
248 /// Output only. [Output only] Delete timestamp
249 pub delete_time: std::option::Option<wkt::Timestamp>,
250
251 /// Optional. Labels as key value pairs
252 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
253
254 /// Output only. Installation state of the Connection.
255 pub installation_state: std::option::Option<crate::model::InstallationState>,
256
257 /// Optional. If disabled is set to true, functionality is disabled for this
258 /// connection. Repository based API methods and webhooks processing for
259 /// repositories in this connection will be disabled.
260 pub disabled: bool,
261
262 /// Output only. Set to true when the connection is being set up or updated in
263 /// the background.
264 pub reconciling: bool,
265
266 /// Optional. Allows clients to store small amounts of arbitrary data.
267 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
268
269 /// Optional. This checksum is computed by the server based on the value of
270 /// other fields, and may be sent on update and delete requests to ensure the
271 /// client has an up-to-date value before proceeding.
272 pub etag: std::string::String,
273
274 /// Output only. A system-assigned unique identifier for the Connection.
275 pub uid: std::string::String,
276
277 /// Optional. The crypto key configuration. This field is used by the
278 /// Customer-Managed Encryption Keys (CMEK) feature.
279 pub crypto_key_config: std::option::Option<crate::model::CryptoKeyConfig>,
280
281 /// Optional. Configuration for the git proxy feature. Enabling the git proxy
282 /// allows clients to perform git operations on the repositories linked in the
283 /// connection.
284 pub git_proxy_config: std::option::Option<crate::model::GitProxyConfig>,
285
286 /// Configuration for the connection depending on the type of provider.
287 pub connection_config: std::option::Option<crate::model::connection::ConnectionConfig>,
288
289 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
290}
291
292impl Connection {
293 /// Creates a new default instance.
294 pub fn new() -> Self {
295 std::default::Default::default()
296 }
297
298 /// Sets the value of [name][crate::model::Connection::name].
299 ///
300 /// # Example
301 /// ```ignore,no_run
302 /// # use google_cloud_developerconnect_v1::model::Connection;
303 /// # let project_id = "project_id";
304 /// # let location_id = "location_id";
305 /// # let connection_id = "connection_id";
306 /// let x = Connection::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
307 /// ```
308 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
309 self.name = v.into();
310 self
311 }
312
313 /// Sets the value of [create_time][crate::model::Connection::create_time].
314 ///
315 /// # Example
316 /// ```ignore,no_run
317 /// # use google_cloud_developerconnect_v1::model::Connection;
318 /// use wkt::Timestamp;
319 /// let x = Connection::new().set_create_time(Timestamp::default()/* use setters */);
320 /// ```
321 pub fn set_create_time<T>(mut self, v: T) -> Self
322 where
323 T: std::convert::Into<wkt::Timestamp>,
324 {
325 self.create_time = std::option::Option::Some(v.into());
326 self
327 }
328
329 /// Sets or clears the value of [create_time][crate::model::Connection::create_time].
330 ///
331 /// # Example
332 /// ```ignore,no_run
333 /// # use google_cloud_developerconnect_v1::model::Connection;
334 /// use wkt::Timestamp;
335 /// let x = Connection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
336 /// let x = Connection::new().set_or_clear_create_time(None::<Timestamp>);
337 /// ```
338 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
339 where
340 T: std::convert::Into<wkt::Timestamp>,
341 {
342 self.create_time = v.map(|x| x.into());
343 self
344 }
345
346 /// Sets the value of [update_time][crate::model::Connection::update_time].
347 ///
348 /// # Example
349 /// ```ignore,no_run
350 /// # use google_cloud_developerconnect_v1::model::Connection;
351 /// use wkt::Timestamp;
352 /// let x = Connection::new().set_update_time(Timestamp::default()/* use setters */);
353 /// ```
354 pub fn set_update_time<T>(mut self, v: T) -> Self
355 where
356 T: std::convert::Into<wkt::Timestamp>,
357 {
358 self.update_time = std::option::Option::Some(v.into());
359 self
360 }
361
362 /// Sets or clears the value of [update_time][crate::model::Connection::update_time].
363 ///
364 /// # Example
365 /// ```ignore,no_run
366 /// # use google_cloud_developerconnect_v1::model::Connection;
367 /// use wkt::Timestamp;
368 /// let x = Connection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
369 /// let x = Connection::new().set_or_clear_update_time(None::<Timestamp>);
370 /// ```
371 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
372 where
373 T: std::convert::Into<wkt::Timestamp>,
374 {
375 self.update_time = v.map(|x| x.into());
376 self
377 }
378
379 /// Sets the value of [delete_time][crate::model::Connection::delete_time].
380 ///
381 /// # Example
382 /// ```ignore,no_run
383 /// # use google_cloud_developerconnect_v1::model::Connection;
384 /// use wkt::Timestamp;
385 /// let x = Connection::new().set_delete_time(Timestamp::default()/* use setters */);
386 /// ```
387 pub fn set_delete_time<T>(mut self, v: T) -> Self
388 where
389 T: std::convert::Into<wkt::Timestamp>,
390 {
391 self.delete_time = std::option::Option::Some(v.into());
392 self
393 }
394
395 /// Sets or clears the value of [delete_time][crate::model::Connection::delete_time].
396 ///
397 /// # Example
398 /// ```ignore,no_run
399 /// # use google_cloud_developerconnect_v1::model::Connection;
400 /// use wkt::Timestamp;
401 /// let x = Connection::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
402 /// let x = Connection::new().set_or_clear_delete_time(None::<Timestamp>);
403 /// ```
404 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
405 where
406 T: std::convert::Into<wkt::Timestamp>,
407 {
408 self.delete_time = v.map(|x| x.into());
409 self
410 }
411
412 /// Sets the value of [labels][crate::model::Connection::labels].
413 ///
414 /// # Example
415 /// ```ignore,no_run
416 /// # use google_cloud_developerconnect_v1::model::Connection;
417 /// let x = Connection::new().set_labels([
418 /// ("key0", "abc"),
419 /// ("key1", "xyz"),
420 /// ]);
421 /// ```
422 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
423 where
424 T: std::iter::IntoIterator<Item = (K, V)>,
425 K: std::convert::Into<std::string::String>,
426 V: std::convert::Into<std::string::String>,
427 {
428 use std::iter::Iterator;
429 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
430 self
431 }
432
433 /// Sets the value of [installation_state][crate::model::Connection::installation_state].
434 ///
435 /// # Example
436 /// ```ignore,no_run
437 /// # use google_cloud_developerconnect_v1::model::Connection;
438 /// use google_cloud_developerconnect_v1::model::InstallationState;
439 /// let x = Connection::new().set_installation_state(InstallationState::default()/* use setters */);
440 /// ```
441 pub fn set_installation_state<T>(mut self, v: T) -> Self
442 where
443 T: std::convert::Into<crate::model::InstallationState>,
444 {
445 self.installation_state = std::option::Option::Some(v.into());
446 self
447 }
448
449 /// Sets or clears the value of [installation_state][crate::model::Connection::installation_state].
450 ///
451 /// # Example
452 /// ```ignore,no_run
453 /// # use google_cloud_developerconnect_v1::model::Connection;
454 /// use google_cloud_developerconnect_v1::model::InstallationState;
455 /// let x = Connection::new().set_or_clear_installation_state(Some(InstallationState::default()/* use setters */));
456 /// let x = Connection::new().set_or_clear_installation_state(None::<InstallationState>);
457 /// ```
458 pub fn set_or_clear_installation_state<T>(mut self, v: std::option::Option<T>) -> Self
459 where
460 T: std::convert::Into<crate::model::InstallationState>,
461 {
462 self.installation_state = v.map(|x| x.into());
463 self
464 }
465
466 /// Sets the value of [disabled][crate::model::Connection::disabled].
467 ///
468 /// # Example
469 /// ```ignore,no_run
470 /// # use google_cloud_developerconnect_v1::model::Connection;
471 /// let x = Connection::new().set_disabled(true);
472 /// ```
473 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
474 self.disabled = v.into();
475 self
476 }
477
478 /// Sets the value of [reconciling][crate::model::Connection::reconciling].
479 ///
480 /// # Example
481 /// ```ignore,no_run
482 /// # use google_cloud_developerconnect_v1::model::Connection;
483 /// let x = Connection::new().set_reconciling(true);
484 /// ```
485 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
486 self.reconciling = v.into();
487 self
488 }
489
490 /// Sets the value of [annotations][crate::model::Connection::annotations].
491 ///
492 /// # Example
493 /// ```ignore,no_run
494 /// # use google_cloud_developerconnect_v1::model::Connection;
495 /// let x = Connection::new().set_annotations([
496 /// ("key0", "abc"),
497 /// ("key1", "xyz"),
498 /// ]);
499 /// ```
500 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
501 where
502 T: std::iter::IntoIterator<Item = (K, V)>,
503 K: std::convert::Into<std::string::String>,
504 V: std::convert::Into<std::string::String>,
505 {
506 use std::iter::Iterator;
507 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
508 self
509 }
510
511 /// Sets the value of [etag][crate::model::Connection::etag].
512 ///
513 /// # Example
514 /// ```ignore,no_run
515 /// # use google_cloud_developerconnect_v1::model::Connection;
516 /// let x = Connection::new().set_etag("example");
517 /// ```
518 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
519 self.etag = v.into();
520 self
521 }
522
523 /// Sets the value of [uid][crate::model::Connection::uid].
524 ///
525 /// # Example
526 /// ```ignore,no_run
527 /// # use google_cloud_developerconnect_v1::model::Connection;
528 /// let x = Connection::new().set_uid("example");
529 /// ```
530 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
531 self.uid = v.into();
532 self
533 }
534
535 /// Sets the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
536 ///
537 /// # Example
538 /// ```ignore,no_run
539 /// # use google_cloud_developerconnect_v1::model::Connection;
540 /// use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
541 /// let x = Connection::new().set_crypto_key_config(CryptoKeyConfig::default()/* use setters */);
542 /// ```
543 pub fn set_crypto_key_config<T>(mut self, v: T) -> Self
544 where
545 T: std::convert::Into<crate::model::CryptoKeyConfig>,
546 {
547 self.crypto_key_config = std::option::Option::Some(v.into());
548 self
549 }
550
551 /// Sets or clears the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
552 ///
553 /// # Example
554 /// ```ignore,no_run
555 /// # use google_cloud_developerconnect_v1::model::Connection;
556 /// use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
557 /// let x = Connection::new().set_or_clear_crypto_key_config(Some(CryptoKeyConfig::default()/* use setters */));
558 /// let x = Connection::new().set_or_clear_crypto_key_config(None::<CryptoKeyConfig>);
559 /// ```
560 pub fn set_or_clear_crypto_key_config<T>(mut self, v: std::option::Option<T>) -> Self
561 where
562 T: std::convert::Into<crate::model::CryptoKeyConfig>,
563 {
564 self.crypto_key_config = v.map(|x| x.into());
565 self
566 }
567
568 /// Sets the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
569 ///
570 /// # Example
571 /// ```ignore,no_run
572 /// # use google_cloud_developerconnect_v1::model::Connection;
573 /// use google_cloud_developerconnect_v1::model::GitProxyConfig;
574 /// let x = Connection::new().set_git_proxy_config(GitProxyConfig::default()/* use setters */);
575 /// ```
576 pub fn set_git_proxy_config<T>(mut self, v: T) -> Self
577 where
578 T: std::convert::Into<crate::model::GitProxyConfig>,
579 {
580 self.git_proxy_config = std::option::Option::Some(v.into());
581 self
582 }
583
584 /// Sets or clears the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
585 ///
586 /// # Example
587 /// ```ignore,no_run
588 /// # use google_cloud_developerconnect_v1::model::Connection;
589 /// use google_cloud_developerconnect_v1::model::GitProxyConfig;
590 /// let x = Connection::new().set_or_clear_git_proxy_config(Some(GitProxyConfig::default()/* use setters */));
591 /// let x = Connection::new().set_or_clear_git_proxy_config(None::<GitProxyConfig>);
592 /// ```
593 pub fn set_or_clear_git_proxy_config<T>(mut self, v: std::option::Option<T>) -> Self
594 where
595 T: std::convert::Into<crate::model::GitProxyConfig>,
596 {
597 self.git_proxy_config = v.map(|x| x.into());
598 self
599 }
600
601 /// Sets the value of [connection_config][crate::model::Connection::connection_config].
602 ///
603 /// Note that all the setters affecting `connection_config` are mutually
604 /// exclusive.
605 ///
606 /// # Example
607 /// ```ignore,no_run
608 /// # use google_cloud_developerconnect_v1::model::Connection;
609 /// use google_cloud_developerconnect_v1::model::GitHubConfig;
610 /// let x = Connection::new().set_connection_config(Some(
611 /// google_cloud_developerconnect_v1::model::connection::ConnectionConfig::GithubConfig(GitHubConfig::default().into())));
612 /// ```
613 pub fn set_connection_config<
614 T: std::convert::Into<std::option::Option<crate::model::connection::ConnectionConfig>>,
615 >(
616 mut self,
617 v: T,
618 ) -> Self {
619 self.connection_config = v.into();
620 self
621 }
622
623 /// The value of [connection_config][crate::model::Connection::connection_config]
624 /// if it holds a `GithubConfig`, `None` if the field is not set or
625 /// holds a different branch.
626 pub fn github_config(
627 &self,
628 ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubConfig>> {
629 #[allow(unreachable_patterns)]
630 self.connection_config.as_ref().and_then(|v| match v {
631 crate::model::connection::ConnectionConfig::GithubConfig(v) => {
632 std::option::Option::Some(v)
633 }
634 _ => std::option::Option::None,
635 })
636 }
637
638 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
639 /// to hold a `GithubConfig`.
640 ///
641 /// Note that all the setters affecting `connection_config` are
642 /// mutually exclusive.
643 ///
644 /// # Example
645 /// ```ignore,no_run
646 /// # use google_cloud_developerconnect_v1::model::Connection;
647 /// use google_cloud_developerconnect_v1::model::GitHubConfig;
648 /// let x = Connection::new().set_github_config(GitHubConfig::default()/* use setters */);
649 /// assert!(x.github_config().is_some());
650 /// assert!(x.github_enterprise_config().is_none());
651 /// assert!(x.gitlab_config().is_none());
652 /// assert!(x.gitlab_enterprise_config().is_none());
653 /// assert!(x.bitbucket_data_center_config().is_none());
654 /// assert!(x.bitbucket_cloud_config().is_none());
655 /// assert!(x.secure_source_manager_instance_config().is_none());
656 /// assert!(x.http_config().is_none());
657 /// ```
658 pub fn set_github_config<T: std::convert::Into<std::boxed::Box<crate::model::GitHubConfig>>>(
659 mut self,
660 v: T,
661 ) -> Self {
662 self.connection_config = std::option::Option::Some(
663 crate::model::connection::ConnectionConfig::GithubConfig(v.into()),
664 );
665 self
666 }
667
668 /// The value of [connection_config][crate::model::Connection::connection_config]
669 /// if it holds a `GithubEnterpriseConfig`, `None` if the field is not set or
670 /// holds a different branch.
671 pub fn github_enterprise_config(
672 &self,
673 ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubEnterpriseConfig>> {
674 #[allow(unreachable_patterns)]
675 self.connection_config.as_ref().and_then(|v| match v {
676 crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v) => {
677 std::option::Option::Some(v)
678 }
679 _ => std::option::Option::None,
680 })
681 }
682
683 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
684 /// to hold a `GithubEnterpriseConfig`.
685 ///
686 /// Note that all the setters affecting `connection_config` are
687 /// mutually exclusive.
688 ///
689 /// # Example
690 /// ```ignore,no_run
691 /// # use google_cloud_developerconnect_v1::model::Connection;
692 /// use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
693 /// let x = Connection::new().set_github_enterprise_config(GitHubEnterpriseConfig::default()/* use setters */);
694 /// assert!(x.github_enterprise_config().is_some());
695 /// assert!(x.github_config().is_none());
696 /// assert!(x.gitlab_config().is_none());
697 /// assert!(x.gitlab_enterprise_config().is_none());
698 /// assert!(x.bitbucket_data_center_config().is_none());
699 /// assert!(x.bitbucket_cloud_config().is_none());
700 /// assert!(x.secure_source_manager_instance_config().is_none());
701 /// assert!(x.http_config().is_none());
702 /// ```
703 pub fn set_github_enterprise_config<
704 T: std::convert::Into<std::boxed::Box<crate::model::GitHubEnterpriseConfig>>,
705 >(
706 mut self,
707 v: T,
708 ) -> Self {
709 self.connection_config = std::option::Option::Some(
710 crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v.into()),
711 );
712 self
713 }
714
715 /// The value of [connection_config][crate::model::Connection::connection_config]
716 /// if it holds a `GitlabConfig`, `None` if the field is not set or
717 /// holds a different branch.
718 pub fn gitlab_config(
719 &self,
720 ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabConfig>> {
721 #[allow(unreachable_patterns)]
722 self.connection_config.as_ref().and_then(|v| match v {
723 crate::model::connection::ConnectionConfig::GitlabConfig(v) => {
724 std::option::Option::Some(v)
725 }
726 _ => std::option::Option::None,
727 })
728 }
729
730 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
731 /// to hold a `GitlabConfig`.
732 ///
733 /// Note that all the setters affecting `connection_config` are
734 /// mutually exclusive.
735 ///
736 /// # Example
737 /// ```ignore,no_run
738 /// # use google_cloud_developerconnect_v1::model::Connection;
739 /// use google_cloud_developerconnect_v1::model::GitLabConfig;
740 /// let x = Connection::new().set_gitlab_config(GitLabConfig::default()/* use setters */);
741 /// assert!(x.gitlab_config().is_some());
742 /// assert!(x.github_config().is_none());
743 /// assert!(x.github_enterprise_config().is_none());
744 /// assert!(x.gitlab_enterprise_config().is_none());
745 /// assert!(x.bitbucket_data_center_config().is_none());
746 /// assert!(x.bitbucket_cloud_config().is_none());
747 /// assert!(x.secure_source_manager_instance_config().is_none());
748 /// assert!(x.http_config().is_none());
749 /// ```
750 pub fn set_gitlab_config<T: std::convert::Into<std::boxed::Box<crate::model::GitLabConfig>>>(
751 mut self,
752 v: T,
753 ) -> Self {
754 self.connection_config = std::option::Option::Some(
755 crate::model::connection::ConnectionConfig::GitlabConfig(v.into()),
756 );
757 self
758 }
759
760 /// The value of [connection_config][crate::model::Connection::connection_config]
761 /// if it holds a `GitlabEnterpriseConfig`, `None` if the field is not set or
762 /// holds a different branch.
763 pub fn gitlab_enterprise_config(
764 &self,
765 ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabEnterpriseConfig>> {
766 #[allow(unreachable_patterns)]
767 self.connection_config.as_ref().and_then(|v| match v {
768 crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v) => {
769 std::option::Option::Some(v)
770 }
771 _ => std::option::Option::None,
772 })
773 }
774
775 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
776 /// to hold a `GitlabEnterpriseConfig`.
777 ///
778 /// Note that all the setters affecting `connection_config` are
779 /// mutually exclusive.
780 ///
781 /// # Example
782 /// ```ignore,no_run
783 /// # use google_cloud_developerconnect_v1::model::Connection;
784 /// use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
785 /// let x = Connection::new().set_gitlab_enterprise_config(GitLabEnterpriseConfig::default()/* use setters */);
786 /// assert!(x.gitlab_enterprise_config().is_some());
787 /// assert!(x.github_config().is_none());
788 /// assert!(x.github_enterprise_config().is_none());
789 /// assert!(x.gitlab_config().is_none());
790 /// assert!(x.bitbucket_data_center_config().is_none());
791 /// assert!(x.bitbucket_cloud_config().is_none());
792 /// assert!(x.secure_source_manager_instance_config().is_none());
793 /// assert!(x.http_config().is_none());
794 /// ```
795 pub fn set_gitlab_enterprise_config<
796 T: std::convert::Into<std::boxed::Box<crate::model::GitLabEnterpriseConfig>>,
797 >(
798 mut self,
799 v: T,
800 ) -> Self {
801 self.connection_config = std::option::Option::Some(
802 crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v.into()),
803 );
804 self
805 }
806
807 /// The value of [connection_config][crate::model::Connection::connection_config]
808 /// if it holds a `BitbucketDataCenterConfig`, `None` if the field is not set or
809 /// holds a different branch.
810 pub fn bitbucket_data_center_config(
811 &self,
812 ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketDataCenterConfig>> {
813 #[allow(unreachable_patterns)]
814 self.connection_config.as_ref().and_then(|v| match v {
815 crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v) => {
816 std::option::Option::Some(v)
817 }
818 _ => std::option::Option::None,
819 })
820 }
821
822 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
823 /// to hold a `BitbucketDataCenterConfig`.
824 ///
825 /// Note that all the setters affecting `connection_config` are
826 /// mutually exclusive.
827 ///
828 /// # Example
829 /// ```ignore,no_run
830 /// # use google_cloud_developerconnect_v1::model::Connection;
831 /// use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
832 /// let x = Connection::new().set_bitbucket_data_center_config(BitbucketDataCenterConfig::default()/* use setters */);
833 /// assert!(x.bitbucket_data_center_config().is_some());
834 /// assert!(x.github_config().is_none());
835 /// assert!(x.github_enterprise_config().is_none());
836 /// assert!(x.gitlab_config().is_none());
837 /// assert!(x.gitlab_enterprise_config().is_none());
838 /// assert!(x.bitbucket_cloud_config().is_none());
839 /// assert!(x.secure_source_manager_instance_config().is_none());
840 /// assert!(x.http_config().is_none());
841 /// ```
842 pub fn set_bitbucket_data_center_config<
843 T: std::convert::Into<std::boxed::Box<crate::model::BitbucketDataCenterConfig>>,
844 >(
845 mut self,
846 v: T,
847 ) -> Self {
848 self.connection_config = std::option::Option::Some(
849 crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v.into()),
850 );
851 self
852 }
853
854 /// The value of [connection_config][crate::model::Connection::connection_config]
855 /// if it holds a `BitbucketCloudConfig`, `None` if the field is not set or
856 /// holds a different branch.
857 pub fn bitbucket_cloud_config(
858 &self,
859 ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketCloudConfig>> {
860 #[allow(unreachable_patterns)]
861 self.connection_config.as_ref().and_then(|v| match v {
862 crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v) => {
863 std::option::Option::Some(v)
864 }
865 _ => std::option::Option::None,
866 })
867 }
868
869 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
870 /// to hold a `BitbucketCloudConfig`.
871 ///
872 /// Note that all the setters affecting `connection_config` are
873 /// mutually exclusive.
874 ///
875 /// # Example
876 /// ```ignore,no_run
877 /// # use google_cloud_developerconnect_v1::model::Connection;
878 /// use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
879 /// let x = Connection::new().set_bitbucket_cloud_config(BitbucketCloudConfig::default()/* use setters */);
880 /// assert!(x.bitbucket_cloud_config().is_some());
881 /// assert!(x.github_config().is_none());
882 /// assert!(x.github_enterprise_config().is_none());
883 /// assert!(x.gitlab_config().is_none());
884 /// assert!(x.gitlab_enterprise_config().is_none());
885 /// assert!(x.bitbucket_data_center_config().is_none());
886 /// assert!(x.secure_source_manager_instance_config().is_none());
887 /// assert!(x.http_config().is_none());
888 /// ```
889 pub fn set_bitbucket_cloud_config<
890 T: std::convert::Into<std::boxed::Box<crate::model::BitbucketCloudConfig>>,
891 >(
892 mut self,
893 v: T,
894 ) -> Self {
895 self.connection_config = std::option::Option::Some(
896 crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v.into()),
897 );
898 self
899 }
900
901 /// The value of [connection_config][crate::model::Connection::connection_config]
902 /// if it holds a `SecureSourceManagerInstanceConfig`, `None` if the field is not set or
903 /// holds a different branch.
904 pub fn secure_source_manager_instance_config(
905 &self,
906 ) -> std::option::Option<&std::boxed::Box<crate::model::SecureSourceManagerInstanceConfig>>
907 {
908 #[allow(unreachable_patterns)]
909 self.connection_config.as_ref().and_then(|v| match v {
910 crate::model::connection::ConnectionConfig::SecureSourceManagerInstanceConfig(v) => {
911 std::option::Option::Some(v)
912 }
913 _ => std::option::Option::None,
914 })
915 }
916
917 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
918 /// to hold a `SecureSourceManagerInstanceConfig`.
919 ///
920 /// Note that all the setters affecting `connection_config` are
921 /// mutually exclusive.
922 ///
923 /// # Example
924 /// ```ignore,no_run
925 /// # use google_cloud_developerconnect_v1::model::Connection;
926 /// use google_cloud_developerconnect_v1::model::SecureSourceManagerInstanceConfig;
927 /// let x = Connection::new().set_secure_source_manager_instance_config(SecureSourceManagerInstanceConfig::default()/* use setters */);
928 /// assert!(x.secure_source_manager_instance_config().is_some());
929 /// assert!(x.github_config().is_none());
930 /// assert!(x.github_enterprise_config().is_none());
931 /// assert!(x.gitlab_config().is_none());
932 /// assert!(x.gitlab_enterprise_config().is_none());
933 /// assert!(x.bitbucket_data_center_config().is_none());
934 /// assert!(x.bitbucket_cloud_config().is_none());
935 /// assert!(x.http_config().is_none());
936 /// ```
937 pub fn set_secure_source_manager_instance_config<
938 T: std::convert::Into<std::boxed::Box<crate::model::SecureSourceManagerInstanceConfig>>,
939 >(
940 mut self,
941 v: T,
942 ) -> Self {
943 self.connection_config = std::option::Option::Some(
944 crate::model::connection::ConnectionConfig::SecureSourceManagerInstanceConfig(v.into()),
945 );
946 self
947 }
948
949 /// The value of [connection_config][crate::model::Connection::connection_config]
950 /// if it holds a `HttpConfig`, `None` if the field is not set or
951 /// holds a different branch.
952 pub fn http_config(
953 &self,
954 ) -> std::option::Option<&std::boxed::Box<crate::model::GenericHTTPEndpointConfig>> {
955 #[allow(unreachable_patterns)]
956 self.connection_config.as_ref().and_then(|v| match v {
957 crate::model::connection::ConnectionConfig::HttpConfig(v) => {
958 std::option::Option::Some(v)
959 }
960 _ => std::option::Option::None,
961 })
962 }
963
964 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
965 /// to hold a `HttpConfig`.
966 ///
967 /// Note that all the setters affecting `connection_config` are
968 /// mutually exclusive.
969 ///
970 /// # Example
971 /// ```ignore,no_run
972 /// # use google_cloud_developerconnect_v1::model::Connection;
973 /// use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
974 /// let x = Connection::new().set_http_config(GenericHTTPEndpointConfig::default()/* use setters */);
975 /// assert!(x.http_config().is_some());
976 /// assert!(x.github_config().is_none());
977 /// assert!(x.github_enterprise_config().is_none());
978 /// assert!(x.gitlab_config().is_none());
979 /// assert!(x.gitlab_enterprise_config().is_none());
980 /// assert!(x.bitbucket_data_center_config().is_none());
981 /// assert!(x.bitbucket_cloud_config().is_none());
982 /// assert!(x.secure_source_manager_instance_config().is_none());
983 /// ```
984 pub fn set_http_config<
985 T: std::convert::Into<std::boxed::Box<crate::model::GenericHTTPEndpointConfig>>,
986 >(
987 mut self,
988 v: T,
989 ) -> Self {
990 self.connection_config = std::option::Option::Some(
991 crate::model::connection::ConnectionConfig::HttpConfig(v.into()),
992 );
993 self
994 }
995}
996
997impl wkt::message::Message for Connection {
998 fn typename() -> &'static str {
999 "type.googleapis.com/google.cloud.developerconnect.v1.Connection"
1000 }
1001}
1002
1003/// Defines additional types related to [Connection].
1004pub mod connection {
1005 #[allow(unused_imports)]
1006 use super::*;
1007
1008 /// Configuration for the connection depending on the type of provider.
1009 #[derive(Clone, Debug, PartialEq)]
1010 #[non_exhaustive]
1011 pub enum ConnectionConfig {
1012 /// Configuration for connections to github.com.
1013 GithubConfig(std::boxed::Box<crate::model::GitHubConfig>),
1014 /// Configuration for connections to an instance of GitHub Enterprise.
1015 GithubEnterpriseConfig(std::boxed::Box<crate::model::GitHubEnterpriseConfig>),
1016 /// Configuration for connections to gitlab.com.
1017 GitlabConfig(std::boxed::Box<crate::model::GitLabConfig>),
1018 /// Configuration for connections to an instance of GitLab Enterprise.
1019 GitlabEnterpriseConfig(std::boxed::Box<crate::model::GitLabEnterpriseConfig>),
1020 /// Configuration for connections to an instance of Bitbucket Data Center.
1021 BitbucketDataCenterConfig(std::boxed::Box<crate::model::BitbucketDataCenterConfig>),
1022 /// Configuration for connections to an instance of Bitbucket Clouds.
1023 BitbucketCloudConfig(std::boxed::Box<crate::model::BitbucketCloudConfig>),
1024 /// Configuration for connections to an instance of Secure Source Manager.
1025 SecureSourceManagerInstanceConfig(
1026 std::boxed::Box<crate::model::SecureSourceManagerInstanceConfig>,
1027 ),
1028 /// Optional. Configuration for connections to an HTTP service provider.
1029 HttpConfig(std::boxed::Box<crate::model::GenericHTTPEndpointConfig>),
1030 }
1031}
1032
1033/// The crypto key configuration. This field is used by the Customer-managed
1034/// encryption keys (CMEK) feature.
1035#[derive(Clone, Default, PartialEq)]
1036#[non_exhaustive]
1037pub struct CryptoKeyConfig {
1038 /// Required. The name of the key which is used to encrypt/decrypt customer
1039 /// data. For key in Cloud KMS, the key should be in the format of
1040 /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
1041 pub key_reference: std::string::String,
1042
1043 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1044}
1045
1046impl CryptoKeyConfig {
1047 /// Creates a new default instance.
1048 pub fn new() -> Self {
1049 std::default::Default::default()
1050 }
1051
1052 /// Sets the value of [key_reference][crate::model::CryptoKeyConfig::key_reference].
1053 ///
1054 /// # Example
1055 /// ```ignore,no_run
1056 /// # use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
1057 /// let x = CryptoKeyConfig::new().set_key_reference("example");
1058 /// ```
1059 pub fn set_key_reference<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1060 self.key_reference = v.into();
1061 self
1062 }
1063}
1064
1065impl wkt::message::Message for CryptoKeyConfig {
1066 fn typename() -> &'static str {
1067 "type.googleapis.com/google.cloud.developerconnect.v1.CryptoKeyConfig"
1068 }
1069}
1070
1071/// The git proxy configuration.
1072#[derive(Clone, Default, PartialEq)]
1073#[non_exhaustive]
1074pub struct GitProxyConfig {
1075 /// Optional. Setting this to true allows the git proxy to be used for
1076 /// performing git operations on the repositories linked in the connection.
1077 pub enabled: bool,
1078
1079 /// Output only. The base URI for the HTTP proxy endpoint. Has
1080 /// the format
1081 /// `https://{generatedID}-c-h-{shortRegion}.developerconnect.dev`
1082 /// Populated only when enabled is set to true.
1083 /// This endpoint is used by other Google services that integrate with
1084 /// Developer Connect.
1085 pub http_proxy_base_uri: std::string::String,
1086
1087 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1088}
1089
1090impl GitProxyConfig {
1091 /// Creates a new default instance.
1092 pub fn new() -> Self {
1093 std::default::Default::default()
1094 }
1095
1096 /// Sets the value of [enabled][crate::model::GitProxyConfig::enabled].
1097 ///
1098 /// # Example
1099 /// ```ignore,no_run
1100 /// # use google_cloud_developerconnect_v1::model::GitProxyConfig;
1101 /// let x = GitProxyConfig::new().set_enabled(true);
1102 /// ```
1103 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1104 self.enabled = v.into();
1105 self
1106 }
1107
1108 /// Sets the value of [http_proxy_base_uri][crate::model::GitProxyConfig::http_proxy_base_uri].
1109 ///
1110 /// # Example
1111 /// ```ignore,no_run
1112 /// # use google_cloud_developerconnect_v1::model::GitProxyConfig;
1113 /// let x = GitProxyConfig::new().set_http_proxy_base_uri("example");
1114 /// ```
1115 pub fn set_http_proxy_base_uri<T: std::convert::Into<std::string::String>>(
1116 mut self,
1117 v: T,
1118 ) -> Self {
1119 self.http_proxy_base_uri = v.into();
1120 self
1121 }
1122}
1123
1124impl wkt::message::Message for GitProxyConfig {
1125 fn typename() -> &'static str {
1126 "type.googleapis.com/google.cloud.developerconnect.v1.GitProxyConfig"
1127 }
1128}
1129
1130/// Describes stage and necessary actions to be taken by the
1131/// user to complete the installation. Used for GitHub and GitHub Enterprise
1132/// based connections.
1133#[derive(Clone, Default, PartialEq)]
1134#[non_exhaustive]
1135pub struct InstallationState {
1136 /// Output only. Current step of the installation process.
1137 pub stage: crate::model::installation_state::Stage,
1138
1139 /// Output only. Message of what the user should do next to continue the
1140 /// installation. Empty string if the installation is already complete.
1141 pub message: std::string::String,
1142
1143 /// Output only. Link to follow for next action. Empty string if the
1144 /// installation is already complete.
1145 pub action_uri: std::string::String,
1146
1147 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1148}
1149
1150impl InstallationState {
1151 /// Creates a new default instance.
1152 pub fn new() -> Self {
1153 std::default::Default::default()
1154 }
1155
1156 /// Sets the value of [stage][crate::model::InstallationState::stage].
1157 ///
1158 /// # Example
1159 /// ```ignore,no_run
1160 /// # use google_cloud_developerconnect_v1::model::InstallationState;
1161 /// use google_cloud_developerconnect_v1::model::installation_state::Stage;
1162 /// let x0 = InstallationState::new().set_stage(Stage::PendingCreateApp);
1163 /// let x1 = InstallationState::new().set_stage(Stage::PendingUserOauth);
1164 /// let x2 = InstallationState::new().set_stage(Stage::PendingInstallApp);
1165 /// ```
1166 pub fn set_stage<T: std::convert::Into<crate::model::installation_state::Stage>>(
1167 mut self,
1168 v: T,
1169 ) -> Self {
1170 self.stage = v.into();
1171 self
1172 }
1173
1174 /// Sets the value of [message][crate::model::InstallationState::message].
1175 ///
1176 /// # Example
1177 /// ```ignore,no_run
1178 /// # use google_cloud_developerconnect_v1::model::InstallationState;
1179 /// let x = InstallationState::new().set_message("example");
1180 /// ```
1181 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1182 self.message = v.into();
1183 self
1184 }
1185
1186 /// Sets the value of [action_uri][crate::model::InstallationState::action_uri].
1187 ///
1188 /// # Example
1189 /// ```ignore,no_run
1190 /// # use google_cloud_developerconnect_v1::model::InstallationState;
1191 /// let x = InstallationState::new().set_action_uri("example");
1192 /// ```
1193 pub fn set_action_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1194 self.action_uri = v.into();
1195 self
1196 }
1197}
1198
1199impl wkt::message::Message for InstallationState {
1200 fn typename() -> &'static str {
1201 "type.googleapis.com/google.cloud.developerconnect.v1.InstallationState"
1202 }
1203}
1204
1205/// Defines additional types related to [InstallationState].
1206pub mod installation_state {
1207 #[allow(unused_imports)]
1208 use super::*;
1209
1210 /// Stage of the installation process.
1211 ///
1212 /// # Working with unknown values
1213 ///
1214 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1215 /// additional enum variants at any time. Adding new variants is not considered
1216 /// a breaking change. Applications should write their code in anticipation of:
1217 ///
1218 /// - New values appearing in future releases of the client library, **and**
1219 /// - New values received dynamically, without application changes.
1220 ///
1221 /// Please consult the [Working with enums] section in the user guide for some
1222 /// guidelines.
1223 ///
1224 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1225 #[derive(Clone, Debug, PartialEq)]
1226 #[non_exhaustive]
1227 pub enum Stage {
1228 /// No stage specified.
1229 Unspecified,
1230 /// Only for GitHub Enterprise. An App creation has been requested.
1231 /// The user needs to confirm the creation in their GitHub enterprise host.
1232 PendingCreateApp,
1233 /// User needs to authorize the GitHub (or Enterprise) App via OAuth.
1234 PendingUserOauth,
1235 /// User needs to follow the link to install the GitHub (or Enterprise) App.
1236 PendingInstallApp,
1237 /// Installation process has been completed.
1238 Complete,
1239 /// If set, the enum was initialized with an unknown value.
1240 ///
1241 /// Applications can examine the value using [Stage::value] or
1242 /// [Stage::name].
1243 UnknownValue(stage::UnknownValue),
1244 }
1245
1246 #[doc(hidden)]
1247 pub mod stage {
1248 #[allow(unused_imports)]
1249 use super::*;
1250 #[derive(Clone, Debug, PartialEq)]
1251 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1252 }
1253
1254 impl Stage {
1255 /// Gets the enum value.
1256 ///
1257 /// Returns `None` if the enum contains an unknown value deserialized from
1258 /// the string representation of enums.
1259 pub fn value(&self) -> std::option::Option<i32> {
1260 match self {
1261 Self::Unspecified => std::option::Option::Some(0),
1262 Self::PendingCreateApp => std::option::Option::Some(1),
1263 Self::PendingUserOauth => std::option::Option::Some(2),
1264 Self::PendingInstallApp => std::option::Option::Some(3),
1265 Self::Complete => std::option::Option::Some(10),
1266 Self::UnknownValue(u) => u.0.value(),
1267 }
1268 }
1269
1270 /// Gets the enum value as a string.
1271 ///
1272 /// Returns `None` if the enum contains an unknown value deserialized from
1273 /// the integer representation of enums.
1274 pub fn name(&self) -> std::option::Option<&str> {
1275 match self {
1276 Self::Unspecified => std::option::Option::Some("STAGE_UNSPECIFIED"),
1277 Self::PendingCreateApp => std::option::Option::Some("PENDING_CREATE_APP"),
1278 Self::PendingUserOauth => std::option::Option::Some("PENDING_USER_OAUTH"),
1279 Self::PendingInstallApp => std::option::Option::Some("PENDING_INSTALL_APP"),
1280 Self::Complete => std::option::Option::Some("COMPLETE"),
1281 Self::UnknownValue(u) => u.0.name(),
1282 }
1283 }
1284 }
1285
1286 impl std::default::Default for Stage {
1287 fn default() -> Self {
1288 use std::convert::From;
1289 Self::from(0)
1290 }
1291 }
1292
1293 impl std::fmt::Display for Stage {
1294 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1295 wkt::internal::display_enum(f, self.name(), self.value())
1296 }
1297 }
1298
1299 impl std::convert::From<i32> for Stage {
1300 fn from(value: i32) -> Self {
1301 match value {
1302 0 => Self::Unspecified,
1303 1 => Self::PendingCreateApp,
1304 2 => Self::PendingUserOauth,
1305 3 => Self::PendingInstallApp,
1306 10 => Self::Complete,
1307 _ => Self::UnknownValue(stage::UnknownValue(
1308 wkt::internal::UnknownEnumValue::Integer(value),
1309 )),
1310 }
1311 }
1312 }
1313
1314 impl std::convert::From<&str> for Stage {
1315 fn from(value: &str) -> Self {
1316 use std::string::ToString;
1317 match value {
1318 "STAGE_UNSPECIFIED" => Self::Unspecified,
1319 "PENDING_CREATE_APP" => Self::PendingCreateApp,
1320 "PENDING_USER_OAUTH" => Self::PendingUserOauth,
1321 "PENDING_INSTALL_APP" => Self::PendingInstallApp,
1322 "COMPLETE" => Self::Complete,
1323 _ => Self::UnknownValue(stage::UnknownValue(
1324 wkt::internal::UnknownEnumValue::String(value.to_string()),
1325 )),
1326 }
1327 }
1328 }
1329
1330 impl serde::ser::Serialize for Stage {
1331 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1332 where
1333 S: serde::Serializer,
1334 {
1335 match self {
1336 Self::Unspecified => serializer.serialize_i32(0),
1337 Self::PendingCreateApp => serializer.serialize_i32(1),
1338 Self::PendingUserOauth => serializer.serialize_i32(2),
1339 Self::PendingInstallApp => serializer.serialize_i32(3),
1340 Self::Complete => serializer.serialize_i32(10),
1341 Self::UnknownValue(u) => u.0.serialize(serializer),
1342 }
1343 }
1344 }
1345
1346 impl<'de> serde::de::Deserialize<'de> for Stage {
1347 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1348 where
1349 D: serde::Deserializer<'de>,
1350 {
1351 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Stage>::new(
1352 ".google.cloud.developerconnect.v1.InstallationState.Stage",
1353 ))
1354 }
1355 }
1356}
1357
1358/// Defines the configuration for connections to an HTTP service provider.
1359#[derive(Clone, Default, PartialEq)]
1360#[non_exhaustive]
1361pub struct GenericHTTPEndpointConfig {
1362 /// Required. Immutable. The service provider's https endpoint.
1363 pub host_uri: std::string::String,
1364
1365 /// Optional. Configuration for using Service Directory to privately connect to
1366 /// a HTTP service provider. This should only be set if the Http service
1367 /// provider is hosted on-premises and not reachable by public internet. If
1368 /// this field is left empty, calls to the HTTP service provider will be made
1369 /// over the public internet.
1370 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1371
1372 /// Optional. The SSL certificate to use for requests to the HTTP service
1373 /// provider.
1374 pub ssl_ca_certificate: std::string::String,
1375
1376 /// The authentication mechanism to use for requests to the HTTP service
1377 /// provider.
1378 pub authentication:
1379 std::option::Option<crate::model::generic_http_endpoint_config::Authentication>,
1380
1381 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1382}
1383
1384impl GenericHTTPEndpointConfig {
1385 /// Creates a new default instance.
1386 pub fn new() -> Self {
1387 std::default::Default::default()
1388 }
1389
1390 /// Sets the value of [host_uri][crate::model::GenericHTTPEndpointConfig::host_uri].
1391 ///
1392 /// # Example
1393 /// ```ignore,no_run
1394 /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1395 /// let x = GenericHTTPEndpointConfig::new().set_host_uri("example");
1396 /// ```
1397 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1398 self.host_uri = v.into();
1399 self
1400 }
1401
1402 /// Sets the value of [service_directory_config][crate::model::GenericHTTPEndpointConfig::service_directory_config].
1403 ///
1404 /// # Example
1405 /// ```ignore,no_run
1406 /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1407 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
1408 /// let x = GenericHTTPEndpointConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
1409 /// ```
1410 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
1411 where
1412 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1413 {
1414 self.service_directory_config = std::option::Option::Some(v.into());
1415 self
1416 }
1417
1418 /// Sets or clears the value of [service_directory_config][crate::model::GenericHTTPEndpointConfig::service_directory_config].
1419 ///
1420 /// # Example
1421 /// ```ignore,no_run
1422 /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1423 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
1424 /// let x = GenericHTTPEndpointConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
1425 /// let x = GenericHTTPEndpointConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
1426 /// ```
1427 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
1428 where
1429 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1430 {
1431 self.service_directory_config = v.map(|x| x.into());
1432 self
1433 }
1434
1435 /// Sets the value of [ssl_ca_certificate][crate::model::GenericHTTPEndpointConfig::ssl_ca_certificate].
1436 ///
1437 /// # Example
1438 /// ```ignore,no_run
1439 /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1440 /// let x = GenericHTTPEndpointConfig::new().set_ssl_ca_certificate("example");
1441 /// ```
1442 pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
1443 mut self,
1444 v: T,
1445 ) -> Self {
1446 self.ssl_ca_certificate = v.into();
1447 self
1448 }
1449
1450 /// Sets the value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication].
1451 ///
1452 /// Note that all the setters affecting `authentication` are mutually
1453 /// exclusive.
1454 ///
1455 /// # Example
1456 /// ```ignore,no_run
1457 /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1458 /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1459 /// let x = GenericHTTPEndpointConfig::new().set_authentication(Some(
1460 /// google_cloud_developerconnect_v1::model::generic_http_endpoint_config::Authentication::BasicAuthentication(BasicAuthentication::default().into())));
1461 /// ```
1462 pub fn set_authentication<
1463 T: std::convert::Into<
1464 std::option::Option<crate::model::generic_http_endpoint_config::Authentication>,
1465 >,
1466 >(
1467 mut self,
1468 v: T,
1469 ) -> Self {
1470 self.authentication = v.into();
1471 self
1472 }
1473
1474 /// The value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1475 /// if it holds a `BasicAuthentication`, `None` if the field is not set or
1476 /// holds a different branch.
1477 pub fn basic_authentication(
1478 &self,
1479 ) -> std::option::Option<
1480 &std::boxed::Box<crate::model::generic_http_endpoint_config::BasicAuthentication>,
1481 > {
1482 #[allow(unreachable_patterns)]
1483 self.authentication.as_ref().and_then(|v| match v {
1484 crate::model::generic_http_endpoint_config::Authentication::BasicAuthentication(v) => {
1485 std::option::Option::Some(v)
1486 }
1487 _ => std::option::Option::None,
1488 })
1489 }
1490
1491 /// Sets the value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1492 /// to hold a `BasicAuthentication`.
1493 ///
1494 /// Note that all the setters affecting `authentication` are
1495 /// mutually exclusive.
1496 ///
1497 /// # Example
1498 /// ```ignore,no_run
1499 /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1500 /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1501 /// let x = GenericHTTPEndpointConfig::new().set_basic_authentication(BasicAuthentication::default()/* use setters */);
1502 /// assert!(x.basic_authentication().is_some());
1503 /// assert!(x.bearer_token_authentication().is_none());
1504 /// ```
1505 pub fn set_basic_authentication<
1506 T: std::convert::Into<
1507 std::boxed::Box<crate::model::generic_http_endpoint_config::BasicAuthentication>,
1508 >,
1509 >(
1510 mut self,
1511 v: T,
1512 ) -> Self {
1513 self.authentication = std::option::Option::Some(
1514 crate::model::generic_http_endpoint_config::Authentication::BasicAuthentication(
1515 v.into(),
1516 ),
1517 );
1518 self
1519 }
1520
1521 /// The value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1522 /// if it holds a `BearerTokenAuthentication`, `None` if the field is not set or
1523 /// holds a different branch.
1524 pub fn bearer_token_authentication(
1525 &self,
1526 ) -> std::option::Option<
1527 &std::boxed::Box<crate::model::generic_http_endpoint_config::BearerTokenAuthentication>,
1528 > {
1529 #[allow(unreachable_patterns)]
1530 self.authentication.as_ref().and_then(|v| match v {
1531 crate::model::generic_http_endpoint_config::Authentication::BearerTokenAuthentication(v) => std::option::Option::Some(v),
1532 _ => std::option::Option::None,
1533 })
1534 }
1535
1536 /// Sets the value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1537 /// to hold a `BearerTokenAuthentication`.
1538 ///
1539 /// Note that all the setters affecting `authentication` are
1540 /// mutually exclusive.
1541 ///
1542 /// # Example
1543 /// ```ignore,no_run
1544 /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1545 /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BearerTokenAuthentication;
1546 /// let x = GenericHTTPEndpointConfig::new().set_bearer_token_authentication(BearerTokenAuthentication::default()/* use setters */);
1547 /// assert!(x.bearer_token_authentication().is_some());
1548 /// assert!(x.basic_authentication().is_none());
1549 /// ```
1550 pub fn set_bearer_token_authentication<
1551 T: std::convert::Into<
1552 std::boxed::Box<
1553 crate::model::generic_http_endpoint_config::BearerTokenAuthentication,
1554 >,
1555 >,
1556 >(
1557 mut self,
1558 v: T,
1559 ) -> Self {
1560 self.authentication = std::option::Option::Some(
1561 crate::model::generic_http_endpoint_config::Authentication::BearerTokenAuthentication(
1562 v.into(),
1563 ),
1564 );
1565 self
1566 }
1567}
1568
1569impl wkt::message::Message for GenericHTTPEndpointConfig {
1570 fn typename() -> &'static str {
1571 "type.googleapis.com/google.cloud.developerconnect.v1.GenericHTTPEndpointConfig"
1572 }
1573}
1574
1575/// Defines additional types related to [GenericHTTPEndpointConfig].
1576pub mod generic_http_endpoint_config {
1577 #[allow(unused_imports)]
1578 use super::*;
1579
1580 /// Basic authentication with username and password.
1581 #[derive(Clone, Default, PartialEq)]
1582 #[non_exhaustive]
1583 pub struct BasicAuthentication {
1584 /// Required. The username to authenticate as.
1585 pub username: std::string::String,
1586
1587 /// The password to authenticate as.
1588 pub password: std::option::Option<
1589 crate::model::generic_http_endpoint_config::basic_authentication::Password,
1590 >,
1591
1592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1593 }
1594
1595 impl BasicAuthentication {
1596 /// Creates a new default instance.
1597 pub fn new() -> Self {
1598 std::default::Default::default()
1599 }
1600
1601 /// Sets the value of [username][crate::model::generic_http_endpoint_config::BasicAuthentication::username].
1602 ///
1603 /// # Example
1604 /// ```ignore,no_run
1605 /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1606 /// let x = BasicAuthentication::new().set_username("example");
1607 /// ```
1608 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1609 self.username = v.into();
1610 self
1611 }
1612
1613 /// Sets the value of [password][crate::model::generic_http_endpoint_config::BasicAuthentication::password].
1614 ///
1615 /// Note that all the setters affecting `password` are mutually
1616 /// exclusive.
1617 ///
1618 /// # Example
1619 /// ```ignore,no_run
1620 /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1621 /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::basic_authentication::Password;
1622 /// let x = BasicAuthentication::new().set_password(Some(Password::PasswordSecretVersion("example".to_string())));
1623 /// ```
1624 pub fn set_password<
1625 T: std::convert::Into<
1626 std::option::Option<
1627 crate::model::generic_http_endpoint_config::basic_authentication::Password,
1628 >,
1629 >,
1630 >(
1631 mut self,
1632 v: T,
1633 ) -> Self {
1634 self.password = v.into();
1635 self
1636 }
1637
1638 /// The value of [password][crate::model::generic_http_endpoint_config::BasicAuthentication::password]
1639 /// if it holds a `PasswordSecretVersion`, `None` if the field is not set or
1640 /// holds a different branch.
1641 pub fn password_secret_version(&self) -> std::option::Option<&std::string::String> {
1642 #[allow(unreachable_patterns)]
1643 self.password.as_ref().and_then(|v| match v {
1644 crate::model::generic_http_endpoint_config::basic_authentication::Password::PasswordSecretVersion(v) => std::option::Option::Some(v),
1645 _ => std::option::Option::None,
1646 })
1647 }
1648
1649 /// Sets the value of [password][crate::model::generic_http_endpoint_config::BasicAuthentication::password]
1650 /// to hold a `PasswordSecretVersion`.
1651 ///
1652 /// Note that all the setters affecting `password` are
1653 /// mutually exclusive.
1654 ///
1655 /// # Example
1656 /// ```ignore,no_run
1657 /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1658 /// let x = BasicAuthentication::new().set_password_secret_version("example");
1659 /// assert!(x.password_secret_version().is_some());
1660 /// ```
1661 pub fn set_password_secret_version<T: std::convert::Into<std::string::String>>(
1662 mut self,
1663 v: T,
1664 ) -> Self {
1665 self.password = std::option::Option::Some(
1666 crate::model::generic_http_endpoint_config::basic_authentication::Password::PasswordSecretVersion(
1667 v.into()
1668 )
1669 );
1670 self
1671 }
1672 }
1673
1674 impl wkt::message::Message for BasicAuthentication {
1675 fn typename() -> &'static str {
1676 "type.googleapis.com/google.cloud.developerconnect.v1.GenericHTTPEndpointConfig.BasicAuthentication"
1677 }
1678 }
1679
1680 /// Defines additional types related to [BasicAuthentication].
1681 pub mod basic_authentication {
1682 #[allow(unused_imports)]
1683 use super::*;
1684
1685 /// The password to authenticate as.
1686 #[derive(Clone, Debug, PartialEq)]
1687 #[non_exhaustive]
1688 pub enum Password {
1689 /// The password SecretManager secret version to authenticate as.
1690 PasswordSecretVersion(std::string::String),
1691 }
1692 }
1693
1694 /// Bearer token authentication with a token.
1695 #[derive(Clone, Default, PartialEq)]
1696 #[non_exhaustive]
1697 pub struct BearerTokenAuthentication {
1698 /// The token to authenticate as.
1699 pub token: std::option::Option<
1700 crate::model::generic_http_endpoint_config::bearer_token_authentication::Token,
1701 >,
1702
1703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1704 }
1705
1706 impl BearerTokenAuthentication {
1707 /// Creates a new default instance.
1708 pub fn new() -> Self {
1709 std::default::Default::default()
1710 }
1711
1712 /// Sets the value of [token][crate::model::generic_http_endpoint_config::BearerTokenAuthentication::token].
1713 ///
1714 /// Note that all the setters affecting `token` are mutually
1715 /// exclusive.
1716 ///
1717 /// # Example
1718 /// ```ignore,no_run
1719 /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BearerTokenAuthentication;
1720 /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::bearer_token_authentication::Token;
1721 /// let x = BearerTokenAuthentication::new().set_token(Some(Token::TokenSecretVersion("example".to_string())));
1722 /// ```
1723 pub fn set_token<T: std::convert::Into<std::option::Option<crate::model::generic_http_endpoint_config::bearer_token_authentication::Token>>>(mut self, v: T) -> Self
1724{
1725 self.token = v.into();
1726 self
1727 }
1728
1729 /// The value of [token][crate::model::generic_http_endpoint_config::BearerTokenAuthentication::token]
1730 /// if it holds a `TokenSecretVersion`, `None` if the field is not set or
1731 /// holds a different branch.
1732 pub fn token_secret_version(&self) -> std::option::Option<&std::string::String> {
1733 #[allow(unreachable_patterns)]
1734 self.token.as_ref().and_then(|v| match v {
1735 crate::model::generic_http_endpoint_config::bearer_token_authentication::Token::TokenSecretVersion(v) => std::option::Option::Some(v),
1736 _ => std::option::Option::None,
1737 })
1738 }
1739
1740 /// Sets the value of [token][crate::model::generic_http_endpoint_config::BearerTokenAuthentication::token]
1741 /// to hold a `TokenSecretVersion`.
1742 ///
1743 /// Note that all the setters affecting `token` are
1744 /// mutually exclusive.
1745 ///
1746 /// # Example
1747 /// ```ignore,no_run
1748 /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BearerTokenAuthentication;
1749 /// let x = BearerTokenAuthentication::new().set_token_secret_version("example");
1750 /// assert!(x.token_secret_version().is_some());
1751 /// ```
1752 pub fn set_token_secret_version<T: std::convert::Into<std::string::String>>(
1753 mut self,
1754 v: T,
1755 ) -> Self {
1756 self.token = std::option::Option::Some(
1757 crate::model::generic_http_endpoint_config::bearer_token_authentication::Token::TokenSecretVersion(
1758 v.into()
1759 )
1760 );
1761 self
1762 }
1763 }
1764
1765 impl wkt::message::Message for BearerTokenAuthentication {
1766 fn typename() -> &'static str {
1767 "type.googleapis.com/google.cloud.developerconnect.v1.GenericHTTPEndpointConfig.BearerTokenAuthentication"
1768 }
1769 }
1770
1771 /// Defines additional types related to [BearerTokenAuthentication].
1772 pub mod bearer_token_authentication {
1773 #[allow(unused_imports)]
1774 use super::*;
1775
1776 /// The token to authenticate as.
1777 #[derive(Clone, Debug, PartialEq)]
1778 #[non_exhaustive]
1779 pub enum Token {
1780 /// Optional. The token SecretManager secret version to authenticate as.
1781 TokenSecretVersion(std::string::String),
1782 }
1783 }
1784
1785 /// The authentication mechanism to use for requests to the HTTP service
1786 /// provider.
1787 #[derive(Clone, Debug, PartialEq)]
1788 #[non_exhaustive]
1789 pub enum Authentication {
1790 /// Optional. Basic authentication with username and password.
1791 BasicAuthentication(
1792 std::boxed::Box<crate::model::generic_http_endpoint_config::BasicAuthentication>,
1793 ),
1794 /// Optional. Bearer token authentication with a token.
1795 BearerTokenAuthentication(
1796 std::boxed::Box<crate::model::generic_http_endpoint_config::BearerTokenAuthentication>,
1797 ),
1798 }
1799}
1800
1801/// Configuration for connections to github.com.
1802#[derive(Clone, Default, PartialEq)]
1803#[non_exhaustive]
1804pub struct GitHubConfig {
1805 /// Required. Immutable. The GitHub Application that was installed to the
1806 /// GitHub user or organization.
1807 pub github_app: crate::model::git_hub_config::GitHubApp,
1808
1809 /// Optional. OAuth credential of the account that authorized the GitHub App.
1810 /// It is recommended to use a robot account instead of a human user account.
1811 /// The OAuth token must be tied to the GitHub App of this config.
1812 pub authorizer_credential: std::option::Option<crate::model::OAuthCredential>,
1813
1814 /// Optional. GitHub App installation id.
1815 pub app_installation_id: i64,
1816
1817 /// Output only. The URI to navigate to in order to manage the installation
1818 /// associated with this GitHubConfig.
1819 pub installation_uri: std::string::String,
1820
1821 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1822}
1823
1824impl GitHubConfig {
1825 /// Creates a new default instance.
1826 pub fn new() -> Self {
1827 std::default::Default::default()
1828 }
1829
1830 /// Sets the value of [github_app][crate::model::GitHubConfig::github_app].
1831 ///
1832 /// # Example
1833 /// ```ignore,no_run
1834 /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1835 /// use google_cloud_developerconnect_v1::model::git_hub_config::GitHubApp;
1836 /// let x0 = GitHubConfig::new().set_github_app(GitHubApp::DeveloperConnect);
1837 /// let x1 = GitHubConfig::new().set_github_app(GitHubApp::Firebase);
1838 /// let x2 = GitHubConfig::new().set_github_app(GitHubApp::GeminiCodeAssist);
1839 /// ```
1840 pub fn set_github_app<T: std::convert::Into<crate::model::git_hub_config::GitHubApp>>(
1841 mut self,
1842 v: T,
1843 ) -> Self {
1844 self.github_app = v.into();
1845 self
1846 }
1847
1848 /// Sets the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
1849 ///
1850 /// # Example
1851 /// ```ignore,no_run
1852 /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1853 /// use google_cloud_developerconnect_v1::model::OAuthCredential;
1854 /// let x = GitHubConfig::new().set_authorizer_credential(OAuthCredential::default()/* use setters */);
1855 /// ```
1856 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1857 where
1858 T: std::convert::Into<crate::model::OAuthCredential>,
1859 {
1860 self.authorizer_credential = std::option::Option::Some(v.into());
1861 self
1862 }
1863
1864 /// Sets or clears the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
1865 ///
1866 /// # Example
1867 /// ```ignore,no_run
1868 /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1869 /// use google_cloud_developerconnect_v1::model::OAuthCredential;
1870 /// let x = GitHubConfig::new().set_or_clear_authorizer_credential(Some(OAuthCredential::default()/* use setters */));
1871 /// let x = GitHubConfig::new().set_or_clear_authorizer_credential(None::<OAuthCredential>);
1872 /// ```
1873 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1874 where
1875 T: std::convert::Into<crate::model::OAuthCredential>,
1876 {
1877 self.authorizer_credential = v.map(|x| x.into());
1878 self
1879 }
1880
1881 /// Sets the value of [app_installation_id][crate::model::GitHubConfig::app_installation_id].
1882 ///
1883 /// # Example
1884 /// ```ignore,no_run
1885 /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1886 /// let x = GitHubConfig::new().set_app_installation_id(42);
1887 /// ```
1888 pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1889 self.app_installation_id = v.into();
1890 self
1891 }
1892
1893 /// Sets the value of [installation_uri][crate::model::GitHubConfig::installation_uri].
1894 ///
1895 /// # Example
1896 /// ```ignore,no_run
1897 /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1898 /// let x = GitHubConfig::new().set_installation_uri("example");
1899 /// ```
1900 pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
1901 mut self,
1902 v: T,
1903 ) -> Self {
1904 self.installation_uri = v.into();
1905 self
1906 }
1907}
1908
1909impl wkt::message::Message for GitHubConfig {
1910 fn typename() -> &'static str {
1911 "type.googleapis.com/google.cloud.developerconnect.v1.GitHubConfig"
1912 }
1913}
1914
1915/// Defines additional types related to [GitHubConfig].
1916pub mod git_hub_config {
1917 #[allow(unused_imports)]
1918 use super::*;
1919
1920 /// Represents the various GitHub Applications that can be installed to a
1921 /// GitHub user or organization and used with Developer Connect.
1922 ///
1923 /// # Working with unknown values
1924 ///
1925 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1926 /// additional enum variants at any time. Adding new variants is not considered
1927 /// a breaking change. Applications should write their code in anticipation of:
1928 ///
1929 /// - New values appearing in future releases of the client library, **and**
1930 /// - New values received dynamically, without application changes.
1931 ///
1932 /// Please consult the [Working with enums] section in the user guide for some
1933 /// guidelines.
1934 ///
1935 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1936 #[derive(Clone, Debug, PartialEq)]
1937 #[non_exhaustive]
1938 pub enum GitHubApp {
1939 /// GitHub App not specified.
1940 Unspecified,
1941 /// The Developer Connect GitHub Application.
1942 DeveloperConnect,
1943 /// The Firebase GitHub Application.
1944 Firebase,
1945 /// The Gemini Code Assist Application.
1946 GeminiCodeAssist,
1947 /// If set, the enum was initialized with an unknown value.
1948 ///
1949 /// Applications can examine the value using [GitHubApp::value] or
1950 /// [GitHubApp::name].
1951 UnknownValue(git_hub_app::UnknownValue),
1952 }
1953
1954 #[doc(hidden)]
1955 pub mod git_hub_app {
1956 #[allow(unused_imports)]
1957 use super::*;
1958 #[derive(Clone, Debug, PartialEq)]
1959 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1960 }
1961
1962 impl GitHubApp {
1963 /// Gets the enum value.
1964 ///
1965 /// Returns `None` if the enum contains an unknown value deserialized from
1966 /// the string representation of enums.
1967 pub fn value(&self) -> std::option::Option<i32> {
1968 match self {
1969 Self::Unspecified => std::option::Option::Some(0),
1970 Self::DeveloperConnect => std::option::Option::Some(1),
1971 Self::Firebase => std::option::Option::Some(2),
1972 Self::GeminiCodeAssist => std::option::Option::Some(3),
1973 Self::UnknownValue(u) => u.0.value(),
1974 }
1975 }
1976
1977 /// Gets the enum value as a string.
1978 ///
1979 /// Returns `None` if the enum contains an unknown value deserialized from
1980 /// the integer representation of enums.
1981 pub fn name(&self) -> std::option::Option<&str> {
1982 match self {
1983 Self::Unspecified => std::option::Option::Some("GIT_HUB_APP_UNSPECIFIED"),
1984 Self::DeveloperConnect => std::option::Option::Some("DEVELOPER_CONNECT"),
1985 Self::Firebase => std::option::Option::Some("FIREBASE"),
1986 Self::GeminiCodeAssist => std::option::Option::Some("GEMINI_CODE_ASSIST"),
1987 Self::UnknownValue(u) => u.0.name(),
1988 }
1989 }
1990 }
1991
1992 impl std::default::Default for GitHubApp {
1993 fn default() -> Self {
1994 use std::convert::From;
1995 Self::from(0)
1996 }
1997 }
1998
1999 impl std::fmt::Display for GitHubApp {
2000 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2001 wkt::internal::display_enum(f, self.name(), self.value())
2002 }
2003 }
2004
2005 impl std::convert::From<i32> for GitHubApp {
2006 fn from(value: i32) -> Self {
2007 match value {
2008 0 => Self::Unspecified,
2009 1 => Self::DeveloperConnect,
2010 2 => Self::Firebase,
2011 3 => Self::GeminiCodeAssist,
2012 _ => Self::UnknownValue(git_hub_app::UnknownValue(
2013 wkt::internal::UnknownEnumValue::Integer(value),
2014 )),
2015 }
2016 }
2017 }
2018
2019 impl std::convert::From<&str> for GitHubApp {
2020 fn from(value: &str) -> Self {
2021 use std::string::ToString;
2022 match value {
2023 "GIT_HUB_APP_UNSPECIFIED" => Self::Unspecified,
2024 "DEVELOPER_CONNECT" => Self::DeveloperConnect,
2025 "FIREBASE" => Self::Firebase,
2026 "GEMINI_CODE_ASSIST" => Self::GeminiCodeAssist,
2027 _ => Self::UnknownValue(git_hub_app::UnknownValue(
2028 wkt::internal::UnknownEnumValue::String(value.to_string()),
2029 )),
2030 }
2031 }
2032 }
2033
2034 impl serde::ser::Serialize for GitHubApp {
2035 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2036 where
2037 S: serde::Serializer,
2038 {
2039 match self {
2040 Self::Unspecified => serializer.serialize_i32(0),
2041 Self::DeveloperConnect => serializer.serialize_i32(1),
2042 Self::Firebase => serializer.serialize_i32(2),
2043 Self::GeminiCodeAssist => serializer.serialize_i32(3),
2044 Self::UnknownValue(u) => u.0.serialize(serializer),
2045 }
2046 }
2047 }
2048
2049 impl<'de> serde::de::Deserialize<'de> for GitHubApp {
2050 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2051 where
2052 D: serde::Deserializer<'de>,
2053 {
2054 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GitHubApp>::new(
2055 ".google.cloud.developerconnect.v1.GitHubConfig.GitHubApp",
2056 ))
2057 }
2058 }
2059}
2060
2061/// Configuration for connections to an instance of GitHub Enterprise.
2062#[derive(Clone, Default, PartialEq)]
2063#[non_exhaustive]
2064pub struct GitHubEnterpriseConfig {
2065 /// Required. The URI of the GitHub Enterprise host this connection is for.
2066 pub host_uri: std::string::String,
2067
2068 /// Optional. ID of the GitHub App created from the manifest.
2069 pub app_id: i64,
2070
2071 /// Output only. The URL-friendly name of the GitHub App.
2072 pub app_slug: std::string::String,
2073
2074 /// Optional. SecretManager resource containing the private key of the GitHub
2075 /// App, formatted as `projects/*/secrets/*/versions/*` or
2076 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2077 /// supported in that location).
2078 pub private_key_secret_version: std::string::String,
2079
2080 /// Optional. SecretManager resource containing the webhook secret of the
2081 /// GitHub App, formatted as `projects/*/secrets/*/versions/*` or
2082 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2083 /// supported in that location).
2084 pub webhook_secret_secret_version: std::string::String,
2085
2086 /// Optional. ID of the installation of the GitHub App.
2087 pub app_installation_id: i64,
2088
2089 /// Output only. The URI to navigate to in order to manage the installation
2090 /// associated with this GitHubEnterpriseConfig.
2091 pub installation_uri: std::string::String,
2092
2093 /// Optional. Configuration for using Service Directory to privately connect to
2094 /// a GitHub Enterprise server. This should only be set if the GitHub
2095 /// Enterprise server is hosted on-premises and not reachable by public
2096 /// internet. If this field is left empty, calls to the GitHub Enterprise
2097 /// server will be made over the public internet.
2098 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2099
2100 /// Output only. GitHub Enterprise version installed at the host_uri.
2101 pub server_version: std::string::String,
2102
2103 /// Optional. SSL certificate to use for requests to GitHub Enterprise.
2104 pub ssl_ca_certificate: std::string::String,
2105
2106 /// Optional. Immutable. GitHub Enterprise organization in which the GitHub App
2107 /// is created.
2108 pub organization: std::string::String,
2109
2110 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2111}
2112
2113impl GitHubEnterpriseConfig {
2114 /// Creates a new default instance.
2115 pub fn new() -> Self {
2116 std::default::Default::default()
2117 }
2118
2119 /// Sets the value of [host_uri][crate::model::GitHubEnterpriseConfig::host_uri].
2120 ///
2121 /// # Example
2122 /// ```ignore,no_run
2123 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2124 /// let x = GitHubEnterpriseConfig::new().set_host_uri("example");
2125 /// ```
2126 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2127 self.host_uri = v.into();
2128 self
2129 }
2130
2131 /// Sets the value of [app_id][crate::model::GitHubEnterpriseConfig::app_id].
2132 ///
2133 /// # Example
2134 /// ```ignore,no_run
2135 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2136 /// let x = GitHubEnterpriseConfig::new().set_app_id(42);
2137 /// ```
2138 pub fn set_app_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2139 self.app_id = v.into();
2140 self
2141 }
2142
2143 /// Sets the value of [app_slug][crate::model::GitHubEnterpriseConfig::app_slug].
2144 ///
2145 /// # Example
2146 /// ```ignore,no_run
2147 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2148 /// let x = GitHubEnterpriseConfig::new().set_app_slug("example");
2149 /// ```
2150 pub fn set_app_slug<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2151 self.app_slug = v.into();
2152 self
2153 }
2154
2155 /// Sets the value of [private_key_secret_version][crate::model::GitHubEnterpriseConfig::private_key_secret_version].
2156 ///
2157 /// # Example
2158 /// ```ignore,no_run
2159 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2160 /// let x = GitHubEnterpriseConfig::new().set_private_key_secret_version("example");
2161 /// ```
2162 pub fn set_private_key_secret_version<T: std::convert::Into<std::string::String>>(
2163 mut self,
2164 v: T,
2165 ) -> Self {
2166 self.private_key_secret_version = v.into();
2167 self
2168 }
2169
2170 /// Sets the value of [webhook_secret_secret_version][crate::model::GitHubEnterpriseConfig::webhook_secret_secret_version].
2171 ///
2172 /// # Example
2173 /// ```ignore,no_run
2174 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2175 /// let x = GitHubEnterpriseConfig::new().set_webhook_secret_secret_version("example");
2176 /// ```
2177 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2178 mut self,
2179 v: T,
2180 ) -> Self {
2181 self.webhook_secret_secret_version = v.into();
2182 self
2183 }
2184
2185 /// Sets the value of [app_installation_id][crate::model::GitHubEnterpriseConfig::app_installation_id].
2186 ///
2187 /// # Example
2188 /// ```ignore,no_run
2189 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2190 /// let x = GitHubEnterpriseConfig::new().set_app_installation_id(42);
2191 /// ```
2192 pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2193 self.app_installation_id = v.into();
2194 self
2195 }
2196
2197 /// Sets the value of [installation_uri][crate::model::GitHubEnterpriseConfig::installation_uri].
2198 ///
2199 /// # Example
2200 /// ```ignore,no_run
2201 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2202 /// let x = GitHubEnterpriseConfig::new().set_installation_uri("example");
2203 /// ```
2204 pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
2205 mut self,
2206 v: T,
2207 ) -> Self {
2208 self.installation_uri = v.into();
2209 self
2210 }
2211
2212 /// Sets the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
2213 ///
2214 /// # Example
2215 /// ```ignore,no_run
2216 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2217 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2218 /// let x = GitHubEnterpriseConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2219 /// ```
2220 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2221 where
2222 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2223 {
2224 self.service_directory_config = std::option::Option::Some(v.into());
2225 self
2226 }
2227
2228 /// Sets or clears the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
2229 ///
2230 /// # Example
2231 /// ```ignore,no_run
2232 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2233 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2234 /// let x = GitHubEnterpriseConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2235 /// let x = GitHubEnterpriseConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2236 /// ```
2237 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2238 where
2239 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2240 {
2241 self.service_directory_config = v.map(|x| x.into());
2242 self
2243 }
2244
2245 /// Sets the value of [server_version][crate::model::GitHubEnterpriseConfig::server_version].
2246 ///
2247 /// # Example
2248 /// ```ignore,no_run
2249 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2250 /// let x = GitHubEnterpriseConfig::new().set_server_version("example");
2251 /// ```
2252 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2253 self.server_version = v.into();
2254 self
2255 }
2256
2257 /// Sets the value of [ssl_ca_certificate][crate::model::GitHubEnterpriseConfig::ssl_ca_certificate].
2258 ///
2259 /// # Example
2260 /// ```ignore,no_run
2261 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2262 /// let x = GitHubEnterpriseConfig::new().set_ssl_ca_certificate("example");
2263 /// ```
2264 pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2265 mut self,
2266 v: T,
2267 ) -> Self {
2268 self.ssl_ca_certificate = v.into();
2269 self
2270 }
2271
2272 /// Sets the value of [organization][crate::model::GitHubEnterpriseConfig::organization].
2273 ///
2274 /// # Example
2275 /// ```ignore,no_run
2276 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2277 /// let x = GitHubEnterpriseConfig::new().set_organization("example");
2278 /// ```
2279 pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2280 self.organization = v.into();
2281 self
2282 }
2283}
2284
2285impl wkt::message::Message for GitHubEnterpriseConfig {
2286 fn typename() -> &'static str {
2287 "type.googleapis.com/google.cloud.developerconnect.v1.GitHubEnterpriseConfig"
2288 }
2289}
2290
2291/// ServiceDirectoryConfig represents Service Directory configuration for a
2292/// connection.
2293#[derive(Clone, Default, PartialEq)]
2294#[non_exhaustive]
2295pub struct ServiceDirectoryConfig {
2296 /// Required. The Service Directory service name.
2297 /// Format:
2298 /// projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
2299 pub service: std::string::String,
2300
2301 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2302}
2303
2304impl ServiceDirectoryConfig {
2305 /// Creates a new default instance.
2306 pub fn new() -> Self {
2307 std::default::Default::default()
2308 }
2309
2310 /// Sets the value of [service][crate::model::ServiceDirectoryConfig::service].
2311 ///
2312 /// # Example
2313 /// ```ignore,no_run
2314 /// # use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2315 /// let x = ServiceDirectoryConfig::new().set_service("example");
2316 /// ```
2317 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2318 self.service = v.into();
2319 self
2320 }
2321}
2322
2323impl wkt::message::Message for ServiceDirectoryConfig {
2324 fn typename() -> &'static str {
2325 "type.googleapis.com/google.cloud.developerconnect.v1.ServiceDirectoryConfig"
2326 }
2327}
2328
2329/// Represents an OAuth token of the account that authorized the Connection,
2330/// and associated metadata.
2331#[derive(Clone, Default, PartialEq)]
2332#[non_exhaustive]
2333pub struct OAuthCredential {
2334 /// Required. A SecretManager resource containing the OAuth token that
2335 /// authorizes the connection. Format: `projects/*/secrets/*/versions/*` or
2336 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2337 /// supported in that location).
2338 pub oauth_token_secret_version: std::string::String,
2339
2340 /// Output only. The username associated with this token.
2341 pub username: std::string::String,
2342
2343 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2344}
2345
2346impl OAuthCredential {
2347 /// Creates a new default instance.
2348 pub fn new() -> Self {
2349 std::default::Default::default()
2350 }
2351
2352 /// Sets the value of [oauth_token_secret_version][crate::model::OAuthCredential::oauth_token_secret_version].
2353 ///
2354 /// # Example
2355 /// ```ignore,no_run
2356 /// # use google_cloud_developerconnect_v1::model::OAuthCredential;
2357 /// let x = OAuthCredential::new().set_oauth_token_secret_version("example");
2358 /// ```
2359 pub fn set_oauth_token_secret_version<T: std::convert::Into<std::string::String>>(
2360 mut self,
2361 v: T,
2362 ) -> Self {
2363 self.oauth_token_secret_version = v.into();
2364 self
2365 }
2366
2367 /// Sets the value of [username][crate::model::OAuthCredential::username].
2368 ///
2369 /// # Example
2370 /// ```ignore,no_run
2371 /// # use google_cloud_developerconnect_v1::model::OAuthCredential;
2372 /// let x = OAuthCredential::new().set_username("example");
2373 /// ```
2374 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2375 self.username = v.into();
2376 self
2377 }
2378}
2379
2380impl wkt::message::Message for OAuthCredential {
2381 fn typename() -> &'static str {
2382 "type.googleapis.com/google.cloud.developerconnect.v1.OAuthCredential"
2383 }
2384}
2385
2386/// Configuration for connections to gitlab.com.
2387#[derive(Clone, Default, PartialEq)]
2388#[non_exhaustive]
2389pub struct GitLabConfig {
2390 /// Required. Immutable. SecretManager resource containing the webhook secret
2391 /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*` or
2392 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2393 /// supported in that location). This is used to validate webhooks.
2394 pub webhook_secret_secret_version: std::string::String,
2395
2396 /// Required. A GitLab personal access token with the minimum `read_api` scope
2397 /// access and a minimum role of `reporter`. The GitLab Projects visible to
2398 /// this Personal Access Token will control which Projects Developer Connect
2399 /// has access to.
2400 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2401
2402 /// Required. A GitLab personal access token with the minimum `api` scope
2403 /// access and a minimum role of `maintainer`. The GitLab Projects visible to
2404 /// this Personal Access Token will control which Projects Developer Connect
2405 /// has access to.
2406 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2407
2408 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2409}
2410
2411impl GitLabConfig {
2412 /// Creates a new default instance.
2413 pub fn new() -> Self {
2414 std::default::Default::default()
2415 }
2416
2417 /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabConfig::webhook_secret_secret_version].
2418 ///
2419 /// # Example
2420 /// ```ignore,no_run
2421 /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2422 /// let x = GitLabConfig::new().set_webhook_secret_secret_version("example");
2423 /// ```
2424 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2425 mut self,
2426 v: T,
2427 ) -> Self {
2428 self.webhook_secret_secret_version = v.into();
2429 self
2430 }
2431
2432 /// Sets the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
2433 ///
2434 /// # Example
2435 /// ```ignore,no_run
2436 /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2437 /// use google_cloud_developerconnect_v1::model::UserCredential;
2438 /// let x = GitLabConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2439 /// ```
2440 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2441 where
2442 T: std::convert::Into<crate::model::UserCredential>,
2443 {
2444 self.read_authorizer_credential = std::option::Option::Some(v.into());
2445 self
2446 }
2447
2448 /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
2449 ///
2450 /// # Example
2451 /// ```ignore,no_run
2452 /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2453 /// use google_cloud_developerconnect_v1::model::UserCredential;
2454 /// let x = GitLabConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2455 /// let x = GitLabConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2456 /// ```
2457 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2458 where
2459 T: std::convert::Into<crate::model::UserCredential>,
2460 {
2461 self.read_authorizer_credential = v.map(|x| x.into());
2462 self
2463 }
2464
2465 /// Sets the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
2466 ///
2467 /// # Example
2468 /// ```ignore,no_run
2469 /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2470 /// use google_cloud_developerconnect_v1::model::UserCredential;
2471 /// let x = GitLabConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2472 /// ```
2473 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2474 where
2475 T: std::convert::Into<crate::model::UserCredential>,
2476 {
2477 self.authorizer_credential = std::option::Option::Some(v.into());
2478 self
2479 }
2480
2481 /// Sets or clears the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
2482 ///
2483 /// # Example
2484 /// ```ignore,no_run
2485 /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2486 /// use google_cloud_developerconnect_v1::model::UserCredential;
2487 /// let x = GitLabConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2488 /// let x = GitLabConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2489 /// ```
2490 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2491 where
2492 T: std::convert::Into<crate::model::UserCredential>,
2493 {
2494 self.authorizer_credential = v.map(|x| x.into());
2495 self
2496 }
2497}
2498
2499impl wkt::message::Message for GitLabConfig {
2500 fn typename() -> &'static str {
2501 "type.googleapis.com/google.cloud.developerconnect.v1.GitLabConfig"
2502 }
2503}
2504
2505/// Represents a personal access token that authorized the Connection,
2506/// and associated metadata.
2507#[derive(Clone, Default, PartialEq)]
2508#[non_exhaustive]
2509pub struct UserCredential {
2510 /// Required. A SecretManager resource containing the user token that
2511 /// authorizes the Developer Connect connection. Format:
2512 /// `projects/*/secrets/*/versions/*` or
2513 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2514 /// supported in that location).
2515 pub user_token_secret_version: std::string::String,
2516
2517 /// Output only. The username associated with this token.
2518 pub username: std::string::String,
2519
2520 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2521}
2522
2523impl UserCredential {
2524 /// Creates a new default instance.
2525 pub fn new() -> Self {
2526 std::default::Default::default()
2527 }
2528
2529 /// Sets the value of [user_token_secret_version][crate::model::UserCredential::user_token_secret_version].
2530 ///
2531 /// # Example
2532 /// ```ignore,no_run
2533 /// # use google_cloud_developerconnect_v1::model::UserCredential;
2534 /// let x = UserCredential::new().set_user_token_secret_version("example");
2535 /// ```
2536 pub fn set_user_token_secret_version<T: std::convert::Into<std::string::String>>(
2537 mut self,
2538 v: T,
2539 ) -> Self {
2540 self.user_token_secret_version = v.into();
2541 self
2542 }
2543
2544 /// Sets the value of [username][crate::model::UserCredential::username].
2545 ///
2546 /// # Example
2547 /// ```ignore,no_run
2548 /// # use google_cloud_developerconnect_v1::model::UserCredential;
2549 /// let x = UserCredential::new().set_username("example");
2550 /// ```
2551 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2552 self.username = v.into();
2553 self
2554 }
2555}
2556
2557impl wkt::message::Message for UserCredential {
2558 fn typename() -> &'static str {
2559 "type.googleapis.com/google.cloud.developerconnect.v1.UserCredential"
2560 }
2561}
2562
2563/// Configuration for connections to an instance of GitLab Enterprise.
2564#[derive(Clone, Default, PartialEq)]
2565#[non_exhaustive]
2566pub struct GitLabEnterpriseConfig {
2567 /// Required. The URI of the GitLab Enterprise host this connection is for.
2568 pub host_uri: std::string::String,
2569
2570 /// Required. Immutable. SecretManager resource containing the webhook secret
2571 /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*` or
2572 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2573 /// supported in that location). This is used to validate webhooks.
2574 pub webhook_secret_secret_version: std::string::String,
2575
2576 /// Required. A GitLab personal access token with the minimum `read_api` scope
2577 /// access and a minimum role of `reporter`. The GitLab Projects visible to
2578 /// this Personal Access Token will control which Projects Developer Connect
2579 /// has access to.
2580 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2581
2582 /// Required. A GitLab personal access token with the minimum `api` scope
2583 /// access and a minimum role of `maintainer`. The GitLab Projects visible to
2584 /// this Personal Access Token will control which Projects Developer Connect
2585 /// has access to.
2586 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2587
2588 /// Optional. Configuration for using Service Directory to privately connect to
2589 /// a GitLab Enterprise instance. This should only be set if the GitLab
2590 /// Enterprise server is hosted on-premises and not reachable by public
2591 /// internet. If this field is left empty, calls to the GitLab Enterprise
2592 /// server will be made over the public internet.
2593 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2594
2595 /// Optional. SSL Certificate Authority certificate to use for requests to
2596 /// GitLab Enterprise instance.
2597 pub ssl_ca_certificate: std::string::String,
2598
2599 /// Output only. Version of the GitLab Enterprise server running on the
2600 /// `host_uri`.
2601 pub server_version: std::string::String,
2602
2603 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2604}
2605
2606impl GitLabEnterpriseConfig {
2607 /// Creates a new default instance.
2608 pub fn new() -> Self {
2609 std::default::Default::default()
2610 }
2611
2612 /// Sets the value of [host_uri][crate::model::GitLabEnterpriseConfig::host_uri].
2613 ///
2614 /// # Example
2615 /// ```ignore,no_run
2616 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2617 /// let x = GitLabEnterpriseConfig::new().set_host_uri("example");
2618 /// ```
2619 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2620 self.host_uri = v.into();
2621 self
2622 }
2623
2624 /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabEnterpriseConfig::webhook_secret_secret_version].
2625 ///
2626 /// # Example
2627 /// ```ignore,no_run
2628 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2629 /// let x = GitLabEnterpriseConfig::new().set_webhook_secret_secret_version("example");
2630 /// ```
2631 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2632 mut self,
2633 v: T,
2634 ) -> Self {
2635 self.webhook_secret_secret_version = v.into();
2636 self
2637 }
2638
2639 /// Sets the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
2640 ///
2641 /// # Example
2642 /// ```ignore,no_run
2643 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2644 /// use google_cloud_developerconnect_v1::model::UserCredential;
2645 /// let x = GitLabEnterpriseConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2646 /// ```
2647 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2648 where
2649 T: std::convert::Into<crate::model::UserCredential>,
2650 {
2651 self.read_authorizer_credential = std::option::Option::Some(v.into());
2652 self
2653 }
2654
2655 /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
2656 ///
2657 /// # Example
2658 /// ```ignore,no_run
2659 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2660 /// use google_cloud_developerconnect_v1::model::UserCredential;
2661 /// let x = GitLabEnterpriseConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2662 /// let x = GitLabEnterpriseConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2663 /// ```
2664 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2665 where
2666 T: std::convert::Into<crate::model::UserCredential>,
2667 {
2668 self.read_authorizer_credential = v.map(|x| x.into());
2669 self
2670 }
2671
2672 /// Sets the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
2673 ///
2674 /// # Example
2675 /// ```ignore,no_run
2676 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2677 /// use google_cloud_developerconnect_v1::model::UserCredential;
2678 /// let x = GitLabEnterpriseConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2679 /// ```
2680 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2681 where
2682 T: std::convert::Into<crate::model::UserCredential>,
2683 {
2684 self.authorizer_credential = std::option::Option::Some(v.into());
2685 self
2686 }
2687
2688 /// Sets or clears the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
2689 ///
2690 /// # Example
2691 /// ```ignore,no_run
2692 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2693 /// use google_cloud_developerconnect_v1::model::UserCredential;
2694 /// let x = GitLabEnterpriseConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2695 /// let x = GitLabEnterpriseConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2696 /// ```
2697 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2698 where
2699 T: std::convert::Into<crate::model::UserCredential>,
2700 {
2701 self.authorizer_credential = v.map(|x| x.into());
2702 self
2703 }
2704
2705 /// Sets the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
2706 ///
2707 /// # Example
2708 /// ```ignore,no_run
2709 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2710 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2711 /// let x = GitLabEnterpriseConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2712 /// ```
2713 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2714 where
2715 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2716 {
2717 self.service_directory_config = std::option::Option::Some(v.into());
2718 self
2719 }
2720
2721 /// Sets or clears the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
2722 ///
2723 /// # Example
2724 /// ```ignore,no_run
2725 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2726 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2727 /// let x = GitLabEnterpriseConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2728 /// let x = GitLabEnterpriseConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2729 /// ```
2730 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2731 where
2732 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2733 {
2734 self.service_directory_config = v.map(|x| x.into());
2735 self
2736 }
2737
2738 /// Sets the value of [ssl_ca_certificate][crate::model::GitLabEnterpriseConfig::ssl_ca_certificate].
2739 ///
2740 /// # Example
2741 /// ```ignore,no_run
2742 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2743 /// let x = GitLabEnterpriseConfig::new().set_ssl_ca_certificate("example");
2744 /// ```
2745 pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2746 mut self,
2747 v: T,
2748 ) -> Self {
2749 self.ssl_ca_certificate = v.into();
2750 self
2751 }
2752
2753 /// Sets the value of [server_version][crate::model::GitLabEnterpriseConfig::server_version].
2754 ///
2755 /// # Example
2756 /// ```ignore,no_run
2757 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2758 /// let x = GitLabEnterpriseConfig::new().set_server_version("example");
2759 /// ```
2760 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2761 self.server_version = v.into();
2762 self
2763 }
2764}
2765
2766impl wkt::message::Message for GitLabEnterpriseConfig {
2767 fn typename() -> &'static str {
2768 "type.googleapis.com/google.cloud.developerconnect.v1.GitLabEnterpriseConfig"
2769 }
2770}
2771
2772/// Configuration for connections to an instance of Bitbucket Data Center.
2773#[derive(Clone, Default, PartialEq)]
2774#[non_exhaustive]
2775pub struct BitbucketDataCenterConfig {
2776 /// Required. The URI of the Bitbucket Data Center host this connection is for.
2777 pub host_uri: std::string::String,
2778
2779 /// Required. Immutable. SecretManager resource containing the webhook secret
2780 /// used to verify webhook events, formatted as
2781 /// `projects/*/secrets/*/versions/*` or
2782 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2783 /// supported in that location). This is used to validate webhooks.
2784 pub webhook_secret_secret_version: std::string::String,
2785
2786 /// Required. An http access token with the minimum `Repository read` access.
2787 /// It's recommended to use a system account to generate the credentials.
2788 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2789
2790 /// Required. An http access token with the minimum `Repository admin` scope
2791 /// access. This is needed to create webhooks. It's recommended to use a system
2792 /// account to generate these credentials.
2793 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2794
2795 /// Optional. Configuration for using Service Directory to privately connect to
2796 /// a Bitbucket Data Center instance. This should only be set if the Bitbucket
2797 /// Data Center is hosted on-premises and not reachable by public internet. If
2798 /// this field is left empty, calls to the Bitbucket Data Center will be made
2799 /// over the public internet.
2800 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2801
2802 /// Optional. SSL certificate authority to trust when making requests to
2803 /// Bitbucket Data Center.
2804 pub ssl_ca_certificate: std::string::String,
2805
2806 /// Output only. Version of the Bitbucket Data Center server running on the
2807 /// `host_uri`.
2808 pub server_version: std::string::String,
2809
2810 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2811}
2812
2813impl BitbucketDataCenterConfig {
2814 /// Creates a new default instance.
2815 pub fn new() -> Self {
2816 std::default::Default::default()
2817 }
2818
2819 /// Sets the value of [host_uri][crate::model::BitbucketDataCenterConfig::host_uri].
2820 ///
2821 /// # Example
2822 /// ```ignore,no_run
2823 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2824 /// let x = BitbucketDataCenterConfig::new().set_host_uri("example");
2825 /// ```
2826 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2827 self.host_uri = v.into();
2828 self
2829 }
2830
2831 /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketDataCenterConfig::webhook_secret_secret_version].
2832 ///
2833 /// # Example
2834 /// ```ignore,no_run
2835 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2836 /// let x = BitbucketDataCenterConfig::new().set_webhook_secret_secret_version("example");
2837 /// ```
2838 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2839 mut self,
2840 v: T,
2841 ) -> Self {
2842 self.webhook_secret_secret_version = v.into();
2843 self
2844 }
2845
2846 /// Sets the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
2847 ///
2848 /// # Example
2849 /// ```ignore,no_run
2850 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2851 /// use google_cloud_developerconnect_v1::model::UserCredential;
2852 /// let x = BitbucketDataCenterConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2853 /// ```
2854 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2855 where
2856 T: std::convert::Into<crate::model::UserCredential>,
2857 {
2858 self.read_authorizer_credential = std::option::Option::Some(v.into());
2859 self
2860 }
2861
2862 /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
2863 ///
2864 /// # Example
2865 /// ```ignore,no_run
2866 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2867 /// use google_cloud_developerconnect_v1::model::UserCredential;
2868 /// let x = BitbucketDataCenterConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2869 /// let x = BitbucketDataCenterConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2870 /// ```
2871 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2872 where
2873 T: std::convert::Into<crate::model::UserCredential>,
2874 {
2875 self.read_authorizer_credential = v.map(|x| x.into());
2876 self
2877 }
2878
2879 /// Sets the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
2880 ///
2881 /// # Example
2882 /// ```ignore,no_run
2883 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2884 /// use google_cloud_developerconnect_v1::model::UserCredential;
2885 /// let x = BitbucketDataCenterConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2886 /// ```
2887 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2888 where
2889 T: std::convert::Into<crate::model::UserCredential>,
2890 {
2891 self.authorizer_credential = std::option::Option::Some(v.into());
2892 self
2893 }
2894
2895 /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
2896 ///
2897 /// # Example
2898 /// ```ignore,no_run
2899 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2900 /// use google_cloud_developerconnect_v1::model::UserCredential;
2901 /// let x = BitbucketDataCenterConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2902 /// let x = BitbucketDataCenterConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2903 /// ```
2904 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2905 where
2906 T: std::convert::Into<crate::model::UserCredential>,
2907 {
2908 self.authorizer_credential = v.map(|x| x.into());
2909 self
2910 }
2911
2912 /// Sets the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
2913 ///
2914 /// # Example
2915 /// ```ignore,no_run
2916 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2917 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2918 /// let x = BitbucketDataCenterConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2919 /// ```
2920 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2921 where
2922 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2923 {
2924 self.service_directory_config = std::option::Option::Some(v.into());
2925 self
2926 }
2927
2928 /// Sets or clears the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
2929 ///
2930 /// # Example
2931 /// ```ignore,no_run
2932 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2933 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2934 /// let x = BitbucketDataCenterConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2935 /// let x = BitbucketDataCenterConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2936 /// ```
2937 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2938 where
2939 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2940 {
2941 self.service_directory_config = v.map(|x| x.into());
2942 self
2943 }
2944
2945 /// Sets the value of [ssl_ca_certificate][crate::model::BitbucketDataCenterConfig::ssl_ca_certificate].
2946 ///
2947 /// # Example
2948 /// ```ignore,no_run
2949 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2950 /// let x = BitbucketDataCenterConfig::new().set_ssl_ca_certificate("example");
2951 /// ```
2952 pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2953 mut self,
2954 v: T,
2955 ) -> Self {
2956 self.ssl_ca_certificate = v.into();
2957 self
2958 }
2959
2960 /// Sets the value of [server_version][crate::model::BitbucketDataCenterConfig::server_version].
2961 ///
2962 /// # Example
2963 /// ```ignore,no_run
2964 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2965 /// let x = BitbucketDataCenterConfig::new().set_server_version("example");
2966 /// ```
2967 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2968 self.server_version = v.into();
2969 self
2970 }
2971}
2972
2973impl wkt::message::Message for BitbucketDataCenterConfig {
2974 fn typename() -> &'static str {
2975 "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketDataCenterConfig"
2976 }
2977}
2978
2979/// Configuration for connections to an instance of Bitbucket Cloud.
2980#[derive(Clone, Default, PartialEq)]
2981#[non_exhaustive]
2982pub struct BitbucketCloudConfig {
2983 /// Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud
2984 /// Platform.
2985 pub workspace: std::string::String,
2986
2987 /// Required. Immutable. SecretManager resource containing the webhook secret
2988 /// used to verify webhook events, formatted as
2989 /// `projects/*/secrets/*/versions/*` or
2990 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2991 /// supported in that location). This is used to validate and create webhooks.
2992 pub webhook_secret_secret_version: std::string::String,
2993
2994 /// Required. An access token with the minimum `repository` access.
2995 /// It can either be a workspace, project or repository access token.
2996 /// It's recommended to use a system account to generate the credentials.
2997 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2998
2999 /// Required. An access token with the minimum `repository`, `pullrequest` and
3000 /// `webhook` scope access. It can either be a workspace, project or repository
3001 /// access token. This is needed to create webhooks. It's recommended to use a
3002 /// system account to generate these credentials.
3003 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
3004
3005 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3006}
3007
3008impl BitbucketCloudConfig {
3009 /// Creates a new default instance.
3010 pub fn new() -> Self {
3011 std::default::Default::default()
3012 }
3013
3014 /// Sets the value of [workspace][crate::model::BitbucketCloudConfig::workspace].
3015 ///
3016 /// # Example
3017 /// ```ignore,no_run
3018 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3019 /// let x = BitbucketCloudConfig::new().set_workspace("example");
3020 /// ```
3021 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3022 self.workspace = v.into();
3023 self
3024 }
3025
3026 /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketCloudConfig::webhook_secret_secret_version].
3027 ///
3028 /// # Example
3029 /// ```ignore,no_run
3030 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3031 /// let x = BitbucketCloudConfig::new().set_webhook_secret_secret_version("example");
3032 /// ```
3033 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
3034 mut self,
3035 v: T,
3036 ) -> Self {
3037 self.webhook_secret_secret_version = v.into();
3038 self
3039 }
3040
3041 /// Sets the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
3042 ///
3043 /// # Example
3044 /// ```ignore,no_run
3045 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3046 /// use google_cloud_developerconnect_v1::model::UserCredential;
3047 /// let x = BitbucketCloudConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
3048 /// ```
3049 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
3050 where
3051 T: std::convert::Into<crate::model::UserCredential>,
3052 {
3053 self.read_authorizer_credential = std::option::Option::Some(v.into());
3054 self
3055 }
3056
3057 /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
3058 ///
3059 /// # Example
3060 /// ```ignore,no_run
3061 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3062 /// use google_cloud_developerconnect_v1::model::UserCredential;
3063 /// let x = BitbucketCloudConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
3064 /// let x = BitbucketCloudConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
3065 /// ```
3066 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3067 where
3068 T: std::convert::Into<crate::model::UserCredential>,
3069 {
3070 self.read_authorizer_credential = v.map(|x| x.into());
3071 self
3072 }
3073
3074 /// Sets the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
3075 ///
3076 /// # Example
3077 /// ```ignore,no_run
3078 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3079 /// use google_cloud_developerconnect_v1::model::UserCredential;
3080 /// let x = BitbucketCloudConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
3081 /// ```
3082 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
3083 where
3084 T: std::convert::Into<crate::model::UserCredential>,
3085 {
3086 self.authorizer_credential = std::option::Option::Some(v.into());
3087 self
3088 }
3089
3090 /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
3091 ///
3092 /// # Example
3093 /// ```ignore,no_run
3094 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3095 /// use google_cloud_developerconnect_v1::model::UserCredential;
3096 /// let x = BitbucketCloudConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
3097 /// let x = BitbucketCloudConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
3098 /// ```
3099 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3100 where
3101 T: std::convert::Into<crate::model::UserCredential>,
3102 {
3103 self.authorizer_credential = v.map(|x| x.into());
3104 self
3105 }
3106}
3107
3108impl wkt::message::Message for BitbucketCloudConfig {
3109 fn typename() -> &'static str {
3110 "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketCloudConfig"
3111 }
3112}
3113
3114/// Configuration for connections to Secure Source Manager instance
3115#[derive(Clone, Default, PartialEq)]
3116#[non_exhaustive]
3117pub struct SecureSourceManagerInstanceConfig {
3118 /// Required. Immutable. Secure Source Manager instance resource, formatted as
3119 /// `projects/*/locations/*/instances/*`
3120 pub instance: std::string::String,
3121
3122 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3123}
3124
3125impl SecureSourceManagerInstanceConfig {
3126 /// Creates a new default instance.
3127 pub fn new() -> Self {
3128 std::default::Default::default()
3129 }
3130
3131 /// Sets the value of [instance][crate::model::SecureSourceManagerInstanceConfig::instance].
3132 ///
3133 /// # Example
3134 /// ```ignore,no_run
3135 /// # use google_cloud_developerconnect_v1::model::SecureSourceManagerInstanceConfig;
3136 /// let x = SecureSourceManagerInstanceConfig::new().set_instance("example");
3137 /// ```
3138 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3139 self.instance = v.into();
3140 self
3141 }
3142}
3143
3144impl wkt::message::Message for SecureSourceManagerInstanceConfig {
3145 fn typename() -> &'static str {
3146 "type.googleapis.com/google.cloud.developerconnect.v1.SecureSourceManagerInstanceConfig"
3147 }
3148}
3149
3150/// Message for requesting list of Connections
3151#[derive(Clone, Default, PartialEq)]
3152#[non_exhaustive]
3153pub struct ListConnectionsRequest {
3154 /// Required. Parent value for ListConnectionsRequest
3155 pub parent: std::string::String,
3156
3157 /// Optional. Requested page size. Server may return fewer items than
3158 /// requested. If unspecified, server will pick an appropriate default.
3159 pub page_size: i32,
3160
3161 /// Optional. A token identifying a page of results the server should return.
3162 pub page_token: std::string::String,
3163
3164 /// Optional. Filtering results
3165 pub filter: std::string::String,
3166
3167 /// Optional. Hint for how to order the results
3168 pub order_by: std::string::String,
3169
3170 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3171}
3172
3173impl ListConnectionsRequest {
3174 /// Creates a new default instance.
3175 pub fn new() -> Self {
3176 std::default::Default::default()
3177 }
3178
3179 /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
3180 ///
3181 /// # Example
3182 /// ```ignore,no_run
3183 /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3184 /// # let project_id = "project_id";
3185 /// # let location_id = "location_id";
3186 /// let x = ListConnectionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3187 /// ```
3188 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3189 self.parent = v.into();
3190 self
3191 }
3192
3193 /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
3194 ///
3195 /// # Example
3196 /// ```ignore,no_run
3197 /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3198 /// let x = ListConnectionsRequest::new().set_page_size(42);
3199 /// ```
3200 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3201 self.page_size = v.into();
3202 self
3203 }
3204
3205 /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
3206 ///
3207 /// # Example
3208 /// ```ignore,no_run
3209 /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3210 /// let x = ListConnectionsRequest::new().set_page_token("example");
3211 /// ```
3212 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3213 self.page_token = v.into();
3214 self
3215 }
3216
3217 /// Sets the value of [filter][crate::model::ListConnectionsRequest::filter].
3218 ///
3219 /// # Example
3220 /// ```ignore,no_run
3221 /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3222 /// let x = ListConnectionsRequest::new().set_filter("example");
3223 /// ```
3224 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3225 self.filter = v.into();
3226 self
3227 }
3228
3229 /// Sets the value of [order_by][crate::model::ListConnectionsRequest::order_by].
3230 ///
3231 /// # Example
3232 /// ```ignore,no_run
3233 /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3234 /// let x = ListConnectionsRequest::new().set_order_by("example");
3235 /// ```
3236 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3237 self.order_by = v.into();
3238 self
3239 }
3240}
3241
3242impl wkt::message::Message for ListConnectionsRequest {
3243 fn typename() -> &'static str {
3244 "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsRequest"
3245 }
3246}
3247
3248/// Message for response to listing Connections
3249#[derive(Clone, Default, PartialEq)]
3250#[non_exhaustive]
3251pub struct ListConnectionsResponse {
3252 /// The list of Connection
3253 pub connections: std::vec::Vec<crate::model::Connection>,
3254
3255 /// A token identifying a page of results the server should return.
3256 pub next_page_token: std::string::String,
3257
3258 /// Locations that could not be reached.
3259 pub unreachable: std::vec::Vec<std::string::String>,
3260
3261 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3262}
3263
3264impl ListConnectionsResponse {
3265 /// Creates a new default instance.
3266 pub fn new() -> Self {
3267 std::default::Default::default()
3268 }
3269
3270 /// Sets the value of [connections][crate::model::ListConnectionsResponse::connections].
3271 ///
3272 /// # Example
3273 /// ```ignore,no_run
3274 /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
3275 /// use google_cloud_developerconnect_v1::model::Connection;
3276 /// let x = ListConnectionsResponse::new()
3277 /// .set_connections([
3278 /// Connection::default()/* use setters */,
3279 /// Connection::default()/* use (different) setters */,
3280 /// ]);
3281 /// ```
3282 pub fn set_connections<T, V>(mut self, v: T) -> Self
3283 where
3284 T: std::iter::IntoIterator<Item = V>,
3285 V: std::convert::Into<crate::model::Connection>,
3286 {
3287 use std::iter::Iterator;
3288 self.connections = v.into_iter().map(|i| i.into()).collect();
3289 self
3290 }
3291
3292 /// Sets the value of [next_page_token][crate::model::ListConnectionsResponse::next_page_token].
3293 ///
3294 /// # Example
3295 /// ```ignore,no_run
3296 /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
3297 /// let x = ListConnectionsResponse::new().set_next_page_token("example");
3298 /// ```
3299 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3300 self.next_page_token = v.into();
3301 self
3302 }
3303
3304 /// Sets the value of [unreachable][crate::model::ListConnectionsResponse::unreachable].
3305 ///
3306 /// # Example
3307 /// ```ignore,no_run
3308 /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
3309 /// let x = ListConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
3310 /// ```
3311 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3312 where
3313 T: std::iter::IntoIterator<Item = V>,
3314 V: std::convert::Into<std::string::String>,
3315 {
3316 use std::iter::Iterator;
3317 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3318 self
3319 }
3320}
3321
3322impl wkt::message::Message for ListConnectionsResponse {
3323 fn typename() -> &'static str {
3324 "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsResponse"
3325 }
3326}
3327
3328#[doc(hidden)]
3329impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionsResponse {
3330 type PageItem = crate::model::Connection;
3331
3332 fn items(self) -> std::vec::Vec<Self::PageItem> {
3333 self.connections
3334 }
3335
3336 fn next_page_token(&self) -> std::string::String {
3337 use std::clone::Clone;
3338 self.next_page_token.clone()
3339 }
3340}
3341
3342/// Message for getting a Connection
3343#[derive(Clone, Default, PartialEq)]
3344#[non_exhaustive]
3345pub struct GetConnectionRequest {
3346 /// Required. Name of the resource
3347 pub name: std::string::String,
3348
3349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3350}
3351
3352impl GetConnectionRequest {
3353 /// Creates a new default instance.
3354 pub fn new() -> Self {
3355 std::default::Default::default()
3356 }
3357
3358 /// Sets the value of [name][crate::model::GetConnectionRequest::name].
3359 ///
3360 /// # Example
3361 /// ```ignore,no_run
3362 /// # use google_cloud_developerconnect_v1::model::GetConnectionRequest;
3363 /// # let project_id = "project_id";
3364 /// # let location_id = "location_id";
3365 /// # let connection_id = "connection_id";
3366 /// let x = GetConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
3367 /// ```
3368 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3369 self.name = v.into();
3370 self
3371 }
3372}
3373
3374impl wkt::message::Message for GetConnectionRequest {
3375 fn typename() -> &'static str {
3376 "type.googleapis.com/google.cloud.developerconnect.v1.GetConnectionRequest"
3377 }
3378}
3379
3380/// Message for creating a Connection
3381#[derive(Clone, Default, PartialEq)]
3382#[non_exhaustive]
3383pub struct CreateConnectionRequest {
3384 /// Required. Value for parent.
3385 pub parent: std::string::String,
3386
3387 /// Required. Id of the requesting object
3388 /// If auto-generating Id server-side, remove this field and
3389 /// connection_id from the method_signature of Create RPC
3390 pub connection_id: std::string::String,
3391
3392 /// Required. The resource being created
3393 pub connection: std::option::Option<crate::model::Connection>,
3394
3395 /// Optional. An optional request ID to identify requests. Specify a unique
3396 /// request ID so that if you must retry your request, the server will know to
3397 /// ignore the request if it has already been completed. The server will
3398 /// guarantee that for at least 60 minutes since the first request.
3399 ///
3400 /// For example, consider a situation where you make an initial request and the
3401 /// request times out. If you make the request again with the same request
3402 /// ID, the server can check if original operation with the same request ID
3403 /// was received, and if so, will ignore the second request. This prevents
3404 /// clients from accidentally creating duplicate commitments.
3405 ///
3406 /// The request ID must be a valid UUID with the exception that zero UUID is
3407 /// not supported (00000000-0000-0000-0000-000000000000).
3408 pub request_id: std::string::String,
3409
3410 /// Optional. If set, validate the request, but do not actually post it.
3411 pub validate_only: bool,
3412
3413 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3414}
3415
3416impl CreateConnectionRequest {
3417 /// Creates a new default instance.
3418 pub fn new() -> Self {
3419 std::default::Default::default()
3420 }
3421
3422 /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
3423 ///
3424 /// # Example
3425 /// ```ignore,no_run
3426 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3427 /// # let project_id = "project_id";
3428 /// # let location_id = "location_id";
3429 /// let x = CreateConnectionRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3430 /// ```
3431 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3432 self.parent = v.into();
3433 self
3434 }
3435
3436 /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
3437 ///
3438 /// # Example
3439 /// ```ignore,no_run
3440 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3441 /// let x = CreateConnectionRequest::new().set_connection_id("example");
3442 /// ```
3443 pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3444 self.connection_id = v.into();
3445 self
3446 }
3447
3448 /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
3449 ///
3450 /// # Example
3451 /// ```ignore,no_run
3452 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3453 /// use google_cloud_developerconnect_v1::model::Connection;
3454 /// let x = CreateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
3455 /// ```
3456 pub fn set_connection<T>(mut self, v: T) -> Self
3457 where
3458 T: std::convert::Into<crate::model::Connection>,
3459 {
3460 self.connection = std::option::Option::Some(v.into());
3461 self
3462 }
3463
3464 /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
3465 ///
3466 /// # Example
3467 /// ```ignore,no_run
3468 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3469 /// use google_cloud_developerconnect_v1::model::Connection;
3470 /// let x = CreateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
3471 /// let x = CreateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
3472 /// ```
3473 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
3474 where
3475 T: std::convert::Into<crate::model::Connection>,
3476 {
3477 self.connection = v.map(|x| x.into());
3478 self
3479 }
3480
3481 /// Sets the value of [request_id][crate::model::CreateConnectionRequest::request_id].
3482 ///
3483 /// # Example
3484 /// ```ignore,no_run
3485 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3486 /// let x = CreateConnectionRequest::new().set_request_id("example");
3487 /// ```
3488 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3489 self.request_id = v.into();
3490 self
3491 }
3492
3493 /// Sets the value of [validate_only][crate::model::CreateConnectionRequest::validate_only].
3494 ///
3495 /// # Example
3496 /// ```ignore,no_run
3497 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3498 /// let x = CreateConnectionRequest::new().set_validate_only(true);
3499 /// ```
3500 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3501 self.validate_only = v.into();
3502 self
3503 }
3504}
3505
3506impl wkt::message::Message for CreateConnectionRequest {
3507 fn typename() -> &'static str {
3508 "type.googleapis.com/google.cloud.developerconnect.v1.CreateConnectionRequest"
3509 }
3510}
3511
3512/// Message for updating a Connection
3513#[derive(Clone, Default, PartialEq)]
3514#[non_exhaustive]
3515pub struct UpdateConnectionRequest {
3516 /// Required. Field mask is used to specify the fields to be overwritten in the
3517 /// Connection resource by the update.
3518 /// The fields specified in the update_mask are relative to the resource, not
3519 /// the full request. A field will be overwritten if it is in the mask. If the
3520 /// user does not provide a mask then all fields will be overwritten.
3521 pub update_mask: std::option::Option<wkt::FieldMask>,
3522
3523 /// Required. The resource being updated
3524 pub connection: std::option::Option<crate::model::Connection>,
3525
3526 /// Optional. An optional request ID to identify requests. Specify a unique
3527 /// request ID so that if you must retry your request, the server will know to
3528 /// ignore the request if it has already been completed. The server will
3529 /// guarantee that for at least 60 minutes since the first request.
3530 ///
3531 /// For example, consider a situation where you make an initial request and the
3532 /// request times out. If you make the request again with the same request
3533 /// ID, the server can check if original operation with the same request ID
3534 /// was received, and if so, will ignore the second request. This prevents
3535 /// clients from accidentally creating duplicate commitments.
3536 ///
3537 /// The request ID must be a valid UUID with the exception that zero UUID is
3538 /// not supported (00000000-0000-0000-0000-000000000000).
3539 pub request_id: std::string::String,
3540
3541 /// Optional. If set to true, and the connection is not found a new connection
3542 /// will be created. In this situation `update_mask` is ignored.
3543 /// The creation will succeed only if the input connection has all the
3544 /// necessary information (e.g a github_config with both user_oauth_token and
3545 /// installation_id properties).
3546 pub allow_missing: bool,
3547
3548 /// Optional. If set, validate the request, but do not actually post it.
3549 pub validate_only: bool,
3550
3551 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3552}
3553
3554impl UpdateConnectionRequest {
3555 /// Creates a new default instance.
3556 pub fn new() -> Self {
3557 std::default::Default::default()
3558 }
3559
3560 /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
3561 ///
3562 /// # Example
3563 /// ```ignore,no_run
3564 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3565 /// use wkt::FieldMask;
3566 /// let x = UpdateConnectionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3567 /// ```
3568 pub fn set_update_mask<T>(mut self, v: T) -> Self
3569 where
3570 T: std::convert::Into<wkt::FieldMask>,
3571 {
3572 self.update_mask = std::option::Option::Some(v.into());
3573 self
3574 }
3575
3576 /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
3577 ///
3578 /// # Example
3579 /// ```ignore,no_run
3580 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3581 /// use wkt::FieldMask;
3582 /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3583 /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3584 /// ```
3585 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3586 where
3587 T: std::convert::Into<wkt::FieldMask>,
3588 {
3589 self.update_mask = v.map(|x| x.into());
3590 self
3591 }
3592
3593 /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
3594 ///
3595 /// # Example
3596 /// ```ignore,no_run
3597 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3598 /// use google_cloud_developerconnect_v1::model::Connection;
3599 /// let x = UpdateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
3600 /// ```
3601 pub fn set_connection<T>(mut self, v: T) -> Self
3602 where
3603 T: std::convert::Into<crate::model::Connection>,
3604 {
3605 self.connection = std::option::Option::Some(v.into());
3606 self
3607 }
3608
3609 /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
3610 ///
3611 /// # Example
3612 /// ```ignore,no_run
3613 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3614 /// use google_cloud_developerconnect_v1::model::Connection;
3615 /// let x = UpdateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
3616 /// let x = UpdateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
3617 /// ```
3618 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
3619 where
3620 T: std::convert::Into<crate::model::Connection>,
3621 {
3622 self.connection = v.map(|x| x.into());
3623 self
3624 }
3625
3626 /// Sets the value of [request_id][crate::model::UpdateConnectionRequest::request_id].
3627 ///
3628 /// # Example
3629 /// ```ignore,no_run
3630 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3631 /// let x = UpdateConnectionRequest::new().set_request_id("example");
3632 /// ```
3633 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3634 self.request_id = v.into();
3635 self
3636 }
3637
3638 /// Sets the value of [allow_missing][crate::model::UpdateConnectionRequest::allow_missing].
3639 ///
3640 /// # Example
3641 /// ```ignore,no_run
3642 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3643 /// let x = UpdateConnectionRequest::new().set_allow_missing(true);
3644 /// ```
3645 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3646 self.allow_missing = v.into();
3647 self
3648 }
3649
3650 /// Sets the value of [validate_only][crate::model::UpdateConnectionRequest::validate_only].
3651 ///
3652 /// # Example
3653 /// ```ignore,no_run
3654 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3655 /// let x = UpdateConnectionRequest::new().set_validate_only(true);
3656 /// ```
3657 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3658 self.validate_only = v.into();
3659 self
3660 }
3661}
3662
3663impl wkt::message::Message for UpdateConnectionRequest {
3664 fn typename() -> &'static str {
3665 "type.googleapis.com/google.cloud.developerconnect.v1.UpdateConnectionRequest"
3666 }
3667}
3668
3669/// Message for deleting a Connection
3670#[derive(Clone, Default, PartialEq)]
3671#[non_exhaustive]
3672pub struct DeleteConnectionRequest {
3673 /// Required. Name of the resource
3674 pub name: std::string::String,
3675
3676 /// Optional. An optional request ID to identify requests. Specify a unique
3677 /// request ID so that if you must retry your request, the server will know to
3678 /// ignore the request if it has already been completed. The server will
3679 /// guarantee that for at least 60 minutes after the first request.
3680 ///
3681 /// For example, consider a situation where you make an initial request and the
3682 /// request times out. If you make the request again with the same request
3683 /// ID, the server can check if original operation with the same request ID
3684 /// was received, and if so, will ignore the second request. This prevents
3685 /// clients from accidentally creating duplicate commitments.
3686 ///
3687 /// The request ID must be a valid UUID with the exception that zero UUID is
3688 /// not supported (00000000-0000-0000-0000-000000000000).
3689 pub request_id: std::string::String,
3690
3691 /// Optional. If set, validate the request, but do not actually post it.
3692 pub validate_only: bool,
3693
3694 /// Optional. The current etag of the Connection.
3695 /// If an etag is provided and does not match the current etag of the
3696 /// Connection, deletion will be blocked and an ABORTED error will be returned.
3697 pub etag: std::string::String,
3698
3699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3700}
3701
3702impl DeleteConnectionRequest {
3703 /// Creates a new default instance.
3704 pub fn new() -> Self {
3705 std::default::Default::default()
3706 }
3707
3708 /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
3709 ///
3710 /// # Example
3711 /// ```ignore,no_run
3712 /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3713 /// # let project_id = "project_id";
3714 /// # let location_id = "location_id";
3715 /// # let connection_id = "connection_id";
3716 /// let x = DeleteConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
3717 /// ```
3718 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3719 self.name = v.into();
3720 self
3721 }
3722
3723 /// Sets the value of [request_id][crate::model::DeleteConnectionRequest::request_id].
3724 ///
3725 /// # Example
3726 /// ```ignore,no_run
3727 /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3728 /// let x = DeleteConnectionRequest::new().set_request_id("example");
3729 /// ```
3730 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3731 self.request_id = v.into();
3732 self
3733 }
3734
3735 /// Sets the value of [validate_only][crate::model::DeleteConnectionRequest::validate_only].
3736 ///
3737 /// # Example
3738 /// ```ignore,no_run
3739 /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3740 /// let x = DeleteConnectionRequest::new().set_validate_only(true);
3741 /// ```
3742 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3743 self.validate_only = v.into();
3744 self
3745 }
3746
3747 /// Sets the value of [etag][crate::model::DeleteConnectionRequest::etag].
3748 ///
3749 /// # Example
3750 /// ```ignore,no_run
3751 /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3752 /// let x = DeleteConnectionRequest::new().set_etag("example");
3753 /// ```
3754 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3755 self.etag = v.into();
3756 self
3757 }
3758}
3759
3760impl wkt::message::Message for DeleteConnectionRequest {
3761 fn typename() -> &'static str {
3762 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteConnectionRequest"
3763 }
3764}
3765
3766/// Message for requesting list of AccountConnectors
3767#[derive(Clone, Default, PartialEq)]
3768#[non_exhaustive]
3769pub struct ListAccountConnectorsRequest {
3770 /// Required. Parent value for ListAccountConnectorsRequest
3771 pub parent: std::string::String,
3772
3773 /// Optional. Requested page size. Server may return fewer items than
3774 /// requested. If unspecified, server will pick an appropriate default.
3775 pub page_size: i32,
3776
3777 /// Optional. A token identifying a page of results the server should return.
3778 pub page_token: std::string::String,
3779
3780 /// Optional. Filtering results
3781 pub filter: std::string::String,
3782
3783 /// Optional. Hint for how to order the results
3784 pub order_by: std::string::String,
3785
3786 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3787}
3788
3789impl ListAccountConnectorsRequest {
3790 /// Creates a new default instance.
3791 pub fn new() -> Self {
3792 std::default::Default::default()
3793 }
3794
3795 /// Sets the value of [parent][crate::model::ListAccountConnectorsRequest::parent].
3796 ///
3797 /// # Example
3798 /// ```ignore,no_run
3799 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3800 /// # let project_id = "project_id";
3801 /// # let location_id = "location_id";
3802 /// let x = ListAccountConnectorsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3803 /// ```
3804 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3805 self.parent = v.into();
3806 self
3807 }
3808
3809 /// Sets the value of [page_size][crate::model::ListAccountConnectorsRequest::page_size].
3810 ///
3811 /// # Example
3812 /// ```ignore,no_run
3813 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3814 /// let x = ListAccountConnectorsRequest::new().set_page_size(42);
3815 /// ```
3816 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3817 self.page_size = v.into();
3818 self
3819 }
3820
3821 /// Sets the value of [page_token][crate::model::ListAccountConnectorsRequest::page_token].
3822 ///
3823 /// # Example
3824 /// ```ignore,no_run
3825 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3826 /// let x = ListAccountConnectorsRequest::new().set_page_token("example");
3827 /// ```
3828 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3829 self.page_token = v.into();
3830 self
3831 }
3832
3833 /// Sets the value of [filter][crate::model::ListAccountConnectorsRequest::filter].
3834 ///
3835 /// # Example
3836 /// ```ignore,no_run
3837 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3838 /// let x = ListAccountConnectorsRequest::new().set_filter("example");
3839 /// ```
3840 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3841 self.filter = v.into();
3842 self
3843 }
3844
3845 /// Sets the value of [order_by][crate::model::ListAccountConnectorsRequest::order_by].
3846 ///
3847 /// # Example
3848 /// ```ignore,no_run
3849 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3850 /// let x = ListAccountConnectorsRequest::new().set_order_by("example");
3851 /// ```
3852 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3853 self.order_by = v.into();
3854 self
3855 }
3856}
3857
3858impl wkt::message::Message for ListAccountConnectorsRequest {
3859 fn typename() -> &'static str {
3860 "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsRequest"
3861 }
3862}
3863
3864/// Message for response to listing AccountConnectors
3865#[derive(Clone, Default, PartialEq)]
3866#[non_exhaustive]
3867pub struct ListAccountConnectorsResponse {
3868 /// The list of AccountConnectors
3869 pub account_connectors: std::vec::Vec<crate::model::AccountConnector>,
3870
3871 /// A token identifying a page of results the server should return.
3872 pub next_page_token: std::string::String,
3873
3874 /// Locations that could not be reached.
3875 pub unreachable: std::vec::Vec<std::string::String>,
3876
3877 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3878}
3879
3880impl ListAccountConnectorsResponse {
3881 /// Creates a new default instance.
3882 pub fn new() -> Self {
3883 std::default::Default::default()
3884 }
3885
3886 /// Sets the value of [account_connectors][crate::model::ListAccountConnectorsResponse::account_connectors].
3887 ///
3888 /// # Example
3889 /// ```ignore,no_run
3890 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3891 /// use google_cloud_developerconnect_v1::model::AccountConnector;
3892 /// let x = ListAccountConnectorsResponse::new()
3893 /// .set_account_connectors([
3894 /// AccountConnector::default()/* use setters */,
3895 /// AccountConnector::default()/* use (different) setters */,
3896 /// ]);
3897 /// ```
3898 pub fn set_account_connectors<T, V>(mut self, v: T) -> Self
3899 where
3900 T: std::iter::IntoIterator<Item = V>,
3901 V: std::convert::Into<crate::model::AccountConnector>,
3902 {
3903 use std::iter::Iterator;
3904 self.account_connectors = v.into_iter().map(|i| i.into()).collect();
3905 self
3906 }
3907
3908 /// Sets the value of [next_page_token][crate::model::ListAccountConnectorsResponse::next_page_token].
3909 ///
3910 /// # Example
3911 /// ```ignore,no_run
3912 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3913 /// let x = ListAccountConnectorsResponse::new().set_next_page_token("example");
3914 /// ```
3915 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3916 self.next_page_token = v.into();
3917 self
3918 }
3919
3920 /// Sets the value of [unreachable][crate::model::ListAccountConnectorsResponse::unreachable].
3921 ///
3922 /// # Example
3923 /// ```ignore,no_run
3924 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3925 /// let x = ListAccountConnectorsResponse::new().set_unreachable(["a", "b", "c"]);
3926 /// ```
3927 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3928 where
3929 T: std::iter::IntoIterator<Item = V>,
3930 V: std::convert::Into<std::string::String>,
3931 {
3932 use std::iter::Iterator;
3933 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3934 self
3935 }
3936}
3937
3938impl wkt::message::Message for ListAccountConnectorsResponse {
3939 fn typename() -> &'static str {
3940 "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsResponse"
3941 }
3942}
3943
3944#[doc(hidden)]
3945impl google_cloud_gax::paginator::internal::PageableResponse for ListAccountConnectorsResponse {
3946 type PageItem = crate::model::AccountConnector;
3947
3948 fn items(self) -> std::vec::Vec<Self::PageItem> {
3949 self.account_connectors
3950 }
3951
3952 fn next_page_token(&self) -> std::string::String {
3953 use std::clone::Clone;
3954 self.next_page_token.clone()
3955 }
3956}
3957
3958/// Message for getting a AccountConnector
3959#[derive(Clone, Default, PartialEq)]
3960#[non_exhaustive]
3961pub struct GetAccountConnectorRequest {
3962 /// Required. Name of the resource
3963 pub name: std::string::String,
3964
3965 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3966}
3967
3968impl GetAccountConnectorRequest {
3969 /// Creates a new default instance.
3970 pub fn new() -> Self {
3971 std::default::Default::default()
3972 }
3973
3974 /// Sets the value of [name][crate::model::GetAccountConnectorRequest::name].
3975 ///
3976 /// # Example
3977 /// ```ignore,no_run
3978 /// # use google_cloud_developerconnect_v1::model::GetAccountConnectorRequest;
3979 /// # let project_id = "project_id";
3980 /// # let location_id = "location_id";
3981 /// # let account_connector_id = "account_connector_id";
3982 /// let x = GetAccountConnectorRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
3983 /// ```
3984 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3985 self.name = v.into();
3986 self
3987 }
3988}
3989
3990impl wkt::message::Message for GetAccountConnectorRequest {
3991 fn typename() -> &'static str {
3992 "type.googleapis.com/google.cloud.developerconnect.v1.GetAccountConnectorRequest"
3993 }
3994}
3995
3996#[allow(missing_docs)]
3997#[derive(Clone, Default, PartialEq)]
3998#[non_exhaustive]
3999pub struct CreateAccountConnectorRequest {
4000 /// Required. Location resource name as the account_connector’s parent.
4001 pub parent: std::string::String,
4002
4003 /// Required. The ID to use for the AccountConnector, which will become the
4004 /// final component of the AccountConnector's resource name. Its format should
4005 /// adhere to <https://google.aip.dev/122#resource-id-segments> Names must be
4006 /// unique per-project per-location.
4007 pub account_connector_id: std::string::String,
4008
4009 /// Required. The AccountConnector to create.
4010 pub account_connector: std::option::Option<crate::model::AccountConnector>,
4011
4012 /// Optional. An optional request ID to identify requests. Specify a unique
4013 /// request ID so that if you must retry your request, the server will know to
4014 /// ignore the request if it has already been completed. The server will
4015 /// guarantee that for at least 60 minutes since the first request.
4016 ///
4017 /// For example, consider a situation where you make an initial request and the
4018 /// request times out. If you make the request again with the same request
4019 /// ID, the server can check if original operation with the same request ID
4020 /// was received, and if so, will ignore the second request. This prevents
4021 /// clients from accidentally creating duplicate commitments.
4022 ///
4023 /// The request ID must be a valid UUID with the exception that zero UUID is
4024 /// not supported (00000000-0000-0000-0000-000000000000).
4025 pub request_id: std::string::String,
4026
4027 /// Optional. If set, validate the request, but do not actually post it.
4028 pub validate_only: bool,
4029
4030 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4031}
4032
4033impl CreateAccountConnectorRequest {
4034 /// Creates a new default instance.
4035 pub fn new() -> Self {
4036 std::default::Default::default()
4037 }
4038
4039 /// Sets the value of [parent][crate::model::CreateAccountConnectorRequest::parent].
4040 ///
4041 /// # Example
4042 /// ```ignore,no_run
4043 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4044 /// # let project_id = "project_id";
4045 /// # let location_id = "location_id";
4046 /// let x = CreateAccountConnectorRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4047 /// ```
4048 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4049 self.parent = v.into();
4050 self
4051 }
4052
4053 /// Sets the value of [account_connector_id][crate::model::CreateAccountConnectorRequest::account_connector_id].
4054 ///
4055 /// # Example
4056 /// ```ignore,no_run
4057 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4058 /// let x = CreateAccountConnectorRequest::new().set_account_connector_id("example");
4059 /// ```
4060 pub fn set_account_connector_id<T: std::convert::Into<std::string::String>>(
4061 mut self,
4062 v: T,
4063 ) -> Self {
4064 self.account_connector_id = v.into();
4065 self
4066 }
4067
4068 /// Sets the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
4069 ///
4070 /// # Example
4071 /// ```ignore,no_run
4072 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4073 /// use google_cloud_developerconnect_v1::model::AccountConnector;
4074 /// let x = CreateAccountConnectorRequest::new().set_account_connector(AccountConnector::default()/* use setters */);
4075 /// ```
4076 pub fn set_account_connector<T>(mut self, v: T) -> Self
4077 where
4078 T: std::convert::Into<crate::model::AccountConnector>,
4079 {
4080 self.account_connector = std::option::Option::Some(v.into());
4081 self
4082 }
4083
4084 /// Sets or clears the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
4085 ///
4086 /// # Example
4087 /// ```ignore,no_run
4088 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4089 /// use google_cloud_developerconnect_v1::model::AccountConnector;
4090 /// let x = CreateAccountConnectorRequest::new().set_or_clear_account_connector(Some(AccountConnector::default()/* use setters */));
4091 /// let x = CreateAccountConnectorRequest::new().set_or_clear_account_connector(None::<AccountConnector>);
4092 /// ```
4093 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
4094 where
4095 T: std::convert::Into<crate::model::AccountConnector>,
4096 {
4097 self.account_connector = v.map(|x| x.into());
4098 self
4099 }
4100
4101 /// Sets the value of [request_id][crate::model::CreateAccountConnectorRequest::request_id].
4102 ///
4103 /// # Example
4104 /// ```ignore,no_run
4105 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4106 /// let x = CreateAccountConnectorRequest::new().set_request_id("example");
4107 /// ```
4108 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4109 self.request_id = v.into();
4110 self
4111 }
4112
4113 /// Sets the value of [validate_only][crate::model::CreateAccountConnectorRequest::validate_only].
4114 ///
4115 /// # Example
4116 /// ```ignore,no_run
4117 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4118 /// let x = CreateAccountConnectorRequest::new().set_validate_only(true);
4119 /// ```
4120 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4121 self.validate_only = v.into();
4122 self
4123 }
4124}
4125
4126impl wkt::message::Message for CreateAccountConnectorRequest {
4127 fn typename() -> &'static str {
4128 "type.googleapis.com/google.cloud.developerconnect.v1.CreateAccountConnectorRequest"
4129 }
4130}
4131
4132/// Message for updating a AccountConnector
4133#[derive(Clone, Default, PartialEq)]
4134#[non_exhaustive]
4135pub struct UpdateAccountConnectorRequest {
4136 /// Optional. The list of fields to be updated.
4137 pub update_mask: std::option::Option<wkt::FieldMask>,
4138
4139 /// Required. The AccountConnector to update.
4140 pub account_connector: std::option::Option<crate::model::AccountConnector>,
4141
4142 /// Optional. An optional request ID to identify requests. Specify a unique
4143 /// request ID so that if you must retry your request, the server will know to
4144 /// ignore the request if it has already been completed. The server will
4145 /// guarantee that for at least 60 minutes since the first request.
4146 ///
4147 /// For example, consider a situation where you make an initial request and the
4148 /// request times out. If you make the request again with the same request
4149 /// ID, the server can check if original operation with the same request ID
4150 /// was received, and if so, will ignore the second request. This prevents
4151 /// clients from accidentally creating duplicate commitments.
4152 ///
4153 /// The request ID must be a valid UUID with the exception that zero UUID is
4154 /// not supported (00000000-0000-0000-0000-000000000000).
4155 pub request_id: std::string::String,
4156
4157 /// Optional. If set to true, and the accountConnector is not found a new
4158 /// accountConnector will be created. In this situation `update_mask` is
4159 /// ignored. The creation will succeed only if the input accountConnector has
4160 /// all the necessary
4161 pub allow_missing: bool,
4162
4163 /// Optional. If set, validate the request, but do not actually post it.
4164 pub validate_only: bool,
4165
4166 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4167}
4168
4169impl UpdateAccountConnectorRequest {
4170 /// Creates a new default instance.
4171 pub fn new() -> Self {
4172 std::default::Default::default()
4173 }
4174
4175 /// Sets the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
4176 ///
4177 /// # Example
4178 /// ```ignore,no_run
4179 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4180 /// use wkt::FieldMask;
4181 /// let x = UpdateAccountConnectorRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4182 /// ```
4183 pub fn set_update_mask<T>(mut self, v: T) -> Self
4184 where
4185 T: std::convert::Into<wkt::FieldMask>,
4186 {
4187 self.update_mask = std::option::Option::Some(v.into());
4188 self
4189 }
4190
4191 /// Sets or clears the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
4192 ///
4193 /// # Example
4194 /// ```ignore,no_run
4195 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4196 /// use wkt::FieldMask;
4197 /// let x = UpdateAccountConnectorRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4198 /// let x = UpdateAccountConnectorRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4199 /// ```
4200 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4201 where
4202 T: std::convert::Into<wkt::FieldMask>,
4203 {
4204 self.update_mask = v.map(|x| x.into());
4205 self
4206 }
4207
4208 /// Sets the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
4209 ///
4210 /// # Example
4211 /// ```ignore,no_run
4212 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4213 /// use google_cloud_developerconnect_v1::model::AccountConnector;
4214 /// let x = UpdateAccountConnectorRequest::new().set_account_connector(AccountConnector::default()/* use setters */);
4215 /// ```
4216 pub fn set_account_connector<T>(mut self, v: T) -> Self
4217 where
4218 T: std::convert::Into<crate::model::AccountConnector>,
4219 {
4220 self.account_connector = std::option::Option::Some(v.into());
4221 self
4222 }
4223
4224 /// Sets or clears the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
4225 ///
4226 /// # Example
4227 /// ```ignore,no_run
4228 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4229 /// use google_cloud_developerconnect_v1::model::AccountConnector;
4230 /// let x = UpdateAccountConnectorRequest::new().set_or_clear_account_connector(Some(AccountConnector::default()/* use setters */));
4231 /// let x = UpdateAccountConnectorRequest::new().set_or_clear_account_connector(None::<AccountConnector>);
4232 /// ```
4233 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
4234 where
4235 T: std::convert::Into<crate::model::AccountConnector>,
4236 {
4237 self.account_connector = v.map(|x| x.into());
4238 self
4239 }
4240
4241 /// Sets the value of [request_id][crate::model::UpdateAccountConnectorRequest::request_id].
4242 ///
4243 /// # Example
4244 /// ```ignore,no_run
4245 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4246 /// let x = UpdateAccountConnectorRequest::new().set_request_id("example");
4247 /// ```
4248 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4249 self.request_id = v.into();
4250 self
4251 }
4252
4253 /// Sets the value of [allow_missing][crate::model::UpdateAccountConnectorRequest::allow_missing].
4254 ///
4255 /// # Example
4256 /// ```ignore,no_run
4257 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4258 /// let x = UpdateAccountConnectorRequest::new().set_allow_missing(true);
4259 /// ```
4260 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4261 self.allow_missing = v.into();
4262 self
4263 }
4264
4265 /// Sets the value of [validate_only][crate::model::UpdateAccountConnectorRequest::validate_only].
4266 ///
4267 /// # Example
4268 /// ```ignore,no_run
4269 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4270 /// let x = UpdateAccountConnectorRequest::new().set_validate_only(true);
4271 /// ```
4272 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4273 self.validate_only = v.into();
4274 self
4275 }
4276}
4277
4278impl wkt::message::Message for UpdateAccountConnectorRequest {
4279 fn typename() -> &'static str {
4280 "type.googleapis.com/google.cloud.developerconnect.v1.UpdateAccountConnectorRequest"
4281 }
4282}
4283
4284/// Message for deleting a AccountConnector
4285#[derive(Clone, Default, PartialEq)]
4286#[non_exhaustive]
4287pub struct DeleteAccountConnectorRequest {
4288 /// Required. Name of the resource
4289 pub name: std::string::String,
4290
4291 /// Optional. An optional request ID to identify requests. Specify a unique
4292 /// request ID so that if you must retry your request, the server will know to
4293 /// ignore the request if it has already been completed. The server will
4294 /// guarantee that for at least 60 minutes after the first request.
4295 ///
4296 /// For example, consider a situation where you make an initial request and the
4297 /// request times out. If you make the request again with the same request
4298 /// ID, the server can check if original operation with the same request ID
4299 /// was received, and if so, will ignore the second request. This prevents
4300 /// clients from accidentally creating duplicate commitments.
4301 ///
4302 /// The request ID must be a valid UUID with the exception that zero UUID is
4303 /// not supported (00000000-0000-0000-0000-000000000000).
4304 pub request_id: std::string::String,
4305
4306 /// Optional. If set, validate the request, but do not actually post it.
4307 pub validate_only: bool,
4308
4309 /// Optional. The current etag of the AccountConnectorn.
4310 /// If an etag is provided and does not match the current etag of the
4311 /// AccountConnector, deletion will be blocked and an ABORTED error will be
4312 /// returned.
4313 pub etag: std::string::String,
4314
4315 /// Optional. If set to true, any Users from this AccountConnector will also
4316 /// be deleted. (Otherwise, the request will only work if the AccountConnector
4317 /// has no Users.)
4318 pub force: bool,
4319
4320 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4321}
4322
4323impl DeleteAccountConnectorRequest {
4324 /// Creates a new default instance.
4325 pub fn new() -> Self {
4326 std::default::Default::default()
4327 }
4328
4329 /// Sets the value of [name][crate::model::DeleteAccountConnectorRequest::name].
4330 ///
4331 /// # Example
4332 /// ```ignore,no_run
4333 /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4334 /// # let project_id = "project_id";
4335 /// # let location_id = "location_id";
4336 /// # let account_connector_id = "account_connector_id";
4337 /// let x = DeleteAccountConnectorRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
4338 /// ```
4339 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4340 self.name = v.into();
4341 self
4342 }
4343
4344 /// Sets the value of [request_id][crate::model::DeleteAccountConnectorRequest::request_id].
4345 ///
4346 /// # Example
4347 /// ```ignore,no_run
4348 /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4349 /// let x = DeleteAccountConnectorRequest::new().set_request_id("example");
4350 /// ```
4351 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4352 self.request_id = v.into();
4353 self
4354 }
4355
4356 /// Sets the value of [validate_only][crate::model::DeleteAccountConnectorRequest::validate_only].
4357 ///
4358 /// # Example
4359 /// ```ignore,no_run
4360 /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4361 /// let x = DeleteAccountConnectorRequest::new().set_validate_only(true);
4362 /// ```
4363 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4364 self.validate_only = v.into();
4365 self
4366 }
4367
4368 /// Sets the value of [etag][crate::model::DeleteAccountConnectorRequest::etag].
4369 ///
4370 /// # Example
4371 /// ```ignore,no_run
4372 /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4373 /// let x = DeleteAccountConnectorRequest::new().set_etag("example");
4374 /// ```
4375 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4376 self.etag = v.into();
4377 self
4378 }
4379
4380 /// Sets the value of [force][crate::model::DeleteAccountConnectorRequest::force].
4381 ///
4382 /// # Example
4383 /// ```ignore,no_run
4384 /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4385 /// let x = DeleteAccountConnectorRequest::new().set_force(true);
4386 /// ```
4387 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4388 self.force = v.into();
4389 self
4390 }
4391}
4392
4393impl wkt::message::Message for DeleteAccountConnectorRequest {
4394 fn typename() -> &'static str {
4395 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteAccountConnectorRequest"
4396 }
4397}
4398
4399/// Message for deleting a User
4400#[derive(Clone, Default, PartialEq)]
4401#[non_exhaustive]
4402pub struct DeleteUserRequest {
4403 /// Required. Name of the resource
4404 pub name: std::string::String,
4405
4406 /// Optional. An optional request ID to identify requests. Specify a unique
4407 /// request ID so that if you must retry your request, the server will know to
4408 /// ignore the request if it has already been completed. The server will
4409 /// guarantee that for at least 60 minutes after the first request.
4410 ///
4411 /// For example, consider a situation where you make an initial request and the
4412 /// request times out. If you make the request again with the same request
4413 /// ID, the server can check if original operation with the same request ID
4414 /// was received, and if so, will ignore the second request. This prevents
4415 /// clients from accidentally creating duplicate commitments.
4416 ///
4417 /// The request ID must be a valid UUID with the exception that zero UUID is
4418 /// not supported (00000000-0000-0000-0000-000000000000).
4419 pub request_id: std::string::String,
4420
4421 /// Optional. If set, validate the request, but do not actually post it.
4422 pub validate_only: bool,
4423
4424 /// Optional. This checksum is computed by the server based on the value of
4425 /// other fields, and may be sent on update and delete requests to ensure the
4426 /// client has an up-to-date value before proceeding.
4427 pub etag: std::string::String,
4428
4429 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4430}
4431
4432impl DeleteUserRequest {
4433 /// Creates a new default instance.
4434 pub fn new() -> Self {
4435 std::default::Default::default()
4436 }
4437
4438 /// Sets the value of [name][crate::model::DeleteUserRequest::name].
4439 ///
4440 /// # Example
4441 /// ```ignore,no_run
4442 /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4443 /// # let project_id = "project_id";
4444 /// # let location_id = "location_id";
4445 /// # let account_connector_id = "account_connector_id";
4446 /// # let user_id = "user_id";
4447 /// let x = DeleteUserRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}/users/{user_id}"));
4448 /// ```
4449 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4450 self.name = v.into();
4451 self
4452 }
4453
4454 /// Sets the value of [request_id][crate::model::DeleteUserRequest::request_id].
4455 ///
4456 /// # Example
4457 /// ```ignore,no_run
4458 /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4459 /// let x = DeleteUserRequest::new().set_request_id("example");
4460 /// ```
4461 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4462 self.request_id = v.into();
4463 self
4464 }
4465
4466 /// Sets the value of [validate_only][crate::model::DeleteUserRequest::validate_only].
4467 ///
4468 /// # Example
4469 /// ```ignore,no_run
4470 /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4471 /// let x = DeleteUserRequest::new().set_validate_only(true);
4472 /// ```
4473 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4474 self.validate_only = v.into();
4475 self
4476 }
4477
4478 /// Sets the value of [etag][crate::model::DeleteUserRequest::etag].
4479 ///
4480 /// # Example
4481 /// ```ignore,no_run
4482 /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4483 /// let x = DeleteUserRequest::new().set_etag("example");
4484 /// ```
4485 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4486 self.etag = v.into();
4487 self
4488 }
4489}
4490
4491impl wkt::message::Message for DeleteUserRequest {
4492 fn typename() -> &'static str {
4493 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteUserRequest"
4494 }
4495}
4496
4497/// Represents the metadata of the long-running operation.
4498#[derive(Clone, Default, PartialEq)]
4499#[non_exhaustive]
4500pub struct OperationMetadata {
4501 /// Output only. The time the operation was created.
4502 pub create_time: std::option::Option<wkt::Timestamp>,
4503
4504 /// Output only. The time the operation finished running.
4505 pub end_time: std::option::Option<wkt::Timestamp>,
4506
4507 /// Output only. Server-defined resource path for the target of the operation.
4508 pub target: std::string::String,
4509
4510 /// Output only. Name of the verb executed by the operation.
4511 pub verb: std::string::String,
4512
4513 /// Output only. Human-readable status of the operation, if any.
4514 pub status_message: std::string::String,
4515
4516 /// Output only. Identifies whether the user has requested cancellation
4517 /// of the operation. Operations that have been cancelled successfully
4518 /// have
4519 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
4520 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
4521 /// corresponding to `Code.CANCELLED`.
4522 ///
4523 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
4524 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
4525 pub requested_cancellation: bool,
4526
4527 /// Output only. API version used to start the operation.
4528 pub api_version: std::string::String,
4529
4530 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4531}
4532
4533impl OperationMetadata {
4534 /// Creates a new default instance.
4535 pub fn new() -> Self {
4536 std::default::Default::default()
4537 }
4538
4539 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4540 ///
4541 /// # Example
4542 /// ```ignore,no_run
4543 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4544 /// use wkt::Timestamp;
4545 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4546 /// ```
4547 pub fn set_create_time<T>(mut self, v: T) -> Self
4548 where
4549 T: std::convert::Into<wkt::Timestamp>,
4550 {
4551 self.create_time = std::option::Option::Some(v.into());
4552 self
4553 }
4554
4555 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4556 ///
4557 /// # Example
4558 /// ```ignore,no_run
4559 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4560 /// use wkt::Timestamp;
4561 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4562 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4563 /// ```
4564 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4565 where
4566 T: std::convert::Into<wkt::Timestamp>,
4567 {
4568 self.create_time = v.map(|x| x.into());
4569 self
4570 }
4571
4572 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4573 ///
4574 /// # Example
4575 /// ```ignore,no_run
4576 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4577 /// use wkt::Timestamp;
4578 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4579 /// ```
4580 pub fn set_end_time<T>(mut self, v: T) -> Self
4581 where
4582 T: std::convert::Into<wkt::Timestamp>,
4583 {
4584 self.end_time = std::option::Option::Some(v.into());
4585 self
4586 }
4587
4588 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4589 ///
4590 /// # Example
4591 /// ```ignore,no_run
4592 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4593 /// use wkt::Timestamp;
4594 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4595 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4596 /// ```
4597 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4598 where
4599 T: std::convert::Into<wkt::Timestamp>,
4600 {
4601 self.end_time = v.map(|x| x.into());
4602 self
4603 }
4604
4605 /// Sets the value of [target][crate::model::OperationMetadata::target].
4606 ///
4607 /// # Example
4608 /// ```ignore,no_run
4609 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4610 /// let x = OperationMetadata::new().set_target("example");
4611 /// ```
4612 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4613 self.target = v.into();
4614 self
4615 }
4616
4617 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4618 ///
4619 /// # Example
4620 /// ```ignore,no_run
4621 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4622 /// let x = OperationMetadata::new().set_verb("example");
4623 /// ```
4624 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4625 self.verb = v.into();
4626 self
4627 }
4628
4629 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4630 ///
4631 /// # Example
4632 /// ```ignore,no_run
4633 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4634 /// let x = OperationMetadata::new().set_status_message("example");
4635 /// ```
4636 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4637 self.status_message = v.into();
4638 self
4639 }
4640
4641 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4642 ///
4643 /// # Example
4644 /// ```ignore,no_run
4645 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4646 /// let x = OperationMetadata::new().set_requested_cancellation(true);
4647 /// ```
4648 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4649 self.requested_cancellation = v.into();
4650 self
4651 }
4652
4653 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4654 ///
4655 /// # Example
4656 /// ```ignore,no_run
4657 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4658 /// let x = OperationMetadata::new().set_api_version("example");
4659 /// ```
4660 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4661 self.api_version = v.into();
4662 self
4663 }
4664}
4665
4666impl wkt::message::Message for OperationMetadata {
4667 fn typename() -> &'static str {
4668 "type.googleapis.com/google.cloud.developerconnect.v1.OperationMetadata"
4669 }
4670}
4671
4672/// Message for fetching a User of the user themselves.
4673#[derive(Clone, Default, PartialEq)]
4674#[non_exhaustive]
4675pub struct FetchSelfRequest {
4676 /// Required. Name of the AccountConnector resource
4677 pub name: std::string::String,
4678
4679 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4680}
4681
4682impl FetchSelfRequest {
4683 /// Creates a new default instance.
4684 pub fn new() -> Self {
4685 std::default::Default::default()
4686 }
4687
4688 /// Sets the value of [name][crate::model::FetchSelfRequest::name].
4689 ///
4690 /// # Example
4691 /// ```ignore,no_run
4692 /// # use google_cloud_developerconnect_v1::model::FetchSelfRequest;
4693 /// # let project_id = "project_id";
4694 /// # let location_id = "location_id";
4695 /// # let account_connector_id = "account_connector_id";
4696 /// let x = FetchSelfRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
4697 /// ```
4698 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4699 self.name = v.into();
4700 self
4701 }
4702}
4703
4704impl wkt::message::Message for FetchSelfRequest {
4705 fn typename() -> &'static str {
4706 "type.googleapis.com/google.cloud.developerconnect.v1.FetchSelfRequest"
4707 }
4708}
4709
4710/// Message for deleting a User of the user themselves.
4711#[derive(Clone, Default, PartialEq)]
4712#[non_exhaustive]
4713pub struct DeleteSelfRequest {
4714 /// Required. Name of the AccountConnector resource
4715 pub name: std::string::String,
4716
4717 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4718}
4719
4720impl DeleteSelfRequest {
4721 /// Creates a new default instance.
4722 pub fn new() -> Self {
4723 std::default::Default::default()
4724 }
4725
4726 /// Sets the value of [name][crate::model::DeleteSelfRequest::name].
4727 ///
4728 /// # Example
4729 /// ```ignore,no_run
4730 /// # use google_cloud_developerconnect_v1::model::DeleteSelfRequest;
4731 /// # let project_id = "project_id";
4732 /// # let location_id = "location_id";
4733 /// # let account_connector_id = "account_connector_id";
4734 /// let x = DeleteSelfRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
4735 /// ```
4736 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4737 self.name = v.into();
4738 self
4739 }
4740}
4741
4742impl wkt::message::Message for DeleteSelfRequest {
4743 fn typename() -> &'static str {
4744 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteSelfRequest"
4745 }
4746}
4747
4748/// Message for fetching an OAuth access token.
4749#[derive(Clone, Default, PartialEq)]
4750#[non_exhaustive]
4751pub struct FetchAccessTokenRequest {
4752 /// Required. The resource name of the AccountConnector in the format
4753 /// `projects/*/locations/*/accountConnectors/*`.
4754 pub account_connector: std::string::String,
4755
4756 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4757}
4758
4759impl FetchAccessTokenRequest {
4760 /// Creates a new default instance.
4761 pub fn new() -> Self {
4762 std::default::Default::default()
4763 }
4764
4765 /// Sets the value of [account_connector][crate::model::FetchAccessTokenRequest::account_connector].
4766 ///
4767 /// # Example
4768 /// ```ignore,no_run
4769 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenRequest;
4770 /// # let project_id = "project_id";
4771 /// # let location_id = "location_id";
4772 /// # let account_connector_id = "account_connector_id";
4773 /// let x = FetchAccessTokenRequest::new().set_account_connector(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
4774 /// ```
4775 pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
4776 mut self,
4777 v: T,
4778 ) -> Self {
4779 self.account_connector = v.into();
4780 self
4781 }
4782}
4783
4784impl wkt::message::Message for FetchAccessTokenRequest {
4785 fn typename() -> &'static str {
4786 "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenRequest"
4787 }
4788}
4789
4790/// Message for responding to getting an OAuth access token.
4791#[derive(Clone, Default, PartialEq)]
4792#[non_exhaustive]
4793pub struct FetchAccessTokenResponse {
4794 /// The token content.
4795 pub token: std::string::String,
4796
4797 /// Expiration timestamp. Can be empty if unknown or non-expiring.
4798 pub expiration_time: std::option::Option<wkt::Timestamp>,
4799
4800 /// The scopes of the access token.
4801 pub scopes: std::vec::Vec<std::string::String>,
4802
4803 /// The error resulted from exchanging OAuth tokens from the service provider.
4804 pub exchange_error: std::option::Option<crate::model::ExchangeError>,
4805
4806 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4807}
4808
4809impl FetchAccessTokenResponse {
4810 /// Creates a new default instance.
4811 pub fn new() -> Self {
4812 std::default::Default::default()
4813 }
4814
4815 /// Sets the value of [token][crate::model::FetchAccessTokenResponse::token].
4816 ///
4817 /// # Example
4818 /// ```ignore,no_run
4819 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4820 /// let x = FetchAccessTokenResponse::new().set_token("example");
4821 /// ```
4822 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4823 self.token = v.into();
4824 self
4825 }
4826
4827 /// Sets the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
4828 ///
4829 /// # Example
4830 /// ```ignore,no_run
4831 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4832 /// use wkt::Timestamp;
4833 /// let x = FetchAccessTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
4834 /// ```
4835 pub fn set_expiration_time<T>(mut self, v: T) -> Self
4836 where
4837 T: std::convert::Into<wkt::Timestamp>,
4838 {
4839 self.expiration_time = std::option::Option::Some(v.into());
4840 self
4841 }
4842
4843 /// Sets or clears the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
4844 ///
4845 /// # Example
4846 /// ```ignore,no_run
4847 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4848 /// use wkt::Timestamp;
4849 /// let x = FetchAccessTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
4850 /// let x = FetchAccessTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
4851 /// ```
4852 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
4853 where
4854 T: std::convert::Into<wkt::Timestamp>,
4855 {
4856 self.expiration_time = v.map(|x| x.into());
4857 self
4858 }
4859
4860 /// Sets the value of [scopes][crate::model::FetchAccessTokenResponse::scopes].
4861 ///
4862 /// # Example
4863 /// ```ignore,no_run
4864 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4865 /// let x = FetchAccessTokenResponse::new().set_scopes(["a", "b", "c"]);
4866 /// ```
4867 pub fn set_scopes<T, V>(mut self, v: T) -> Self
4868 where
4869 T: std::iter::IntoIterator<Item = V>,
4870 V: std::convert::Into<std::string::String>,
4871 {
4872 use std::iter::Iterator;
4873 self.scopes = v.into_iter().map(|i| i.into()).collect();
4874 self
4875 }
4876
4877 /// Sets the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
4878 ///
4879 /// # Example
4880 /// ```ignore,no_run
4881 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4882 /// use google_cloud_developerconnect_v1::model::ExchangeError;
4883 /// let x = FetchAccessTokenResponse::new().set_exchange_error(ExchangeError::default()/* use setters */);
4884 /// ```
4885 pub fn set_exchange_error<T>(mut self, v: T) -> Self
4886 where
4887 T: std::convert::Into<crate::model::ExchangeError>,
4888 {
4889 self.exchange_error = std::option::Option::Some(v.into());
4890 self
4891 }
4892
4893 /// Sets or clears the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
4894 ///
4895 /// # Example
4896 /// ```ignore,no_run
4897 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4898 /// use google_cloud_developerconnect_v1::model::ExchangeError;
4899 /// let x = FetchAccessTokenResponse::new().set_or_clear_exchange_error(Some(ExchangeError::default()/* use setters */));
4900 /// let x = FetchAccessTokenResponse::new().set_or_clear_exchange_error(None::<ExchangeError>);
4901 /// ```
4902 pub fn set_or_clear_exchange_error<T>(mut self, v: std::option::Option<T>) -> Self
4903 where
4904 T: std::convert::Into<crate::model::ExchangeError>,
4905 {
4906 self.exchange_error = v.map(|x| x.into());
4907 self
4908 }
4909}
4910
4911impl wkt::message::Message for FetchAccessTokenResponse {
4912 fn typename() -> &'static str {
4913 "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenResponse"
4914 }
4915}
4916
4917/// Request message for DiffGitRepositoryLinkCommit.
4918#[derive(Clone, Default, PartialEq)]
4919#[non_exhaustive]
4920pub struct DiffGitRepositoryLinkCommitRequest {
4921 /// Required. The resource name of the GitRepositoryLink.
4922 pub name: std::string::String,
4923
4924 /// Required. The base commit SHA or ref.
4925 pub base_sha: std::string::String,
4926
4927 /// Required. The head commit SHA or ref.
4928 pub head_sha: std::string::String,
4929
4930 /// Optional. Path patterns or exact paths to filter returned files.
4931 /// When `path_filters` is specified, `FileDiff.patch` is populated for all
4932 /// matching files (use `["**"]` to include patches for all changed files).
4933 /// When `path_filters` is omitted or empty, the full list of `FileDiff` is
4934 /// returned without patch diffs (`FileDiff.patch` is empty).
4935 pub path_filters: std::vec::Vec<std::string::String>,
4936
4937 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4938}
4939
4940impl DiffGitRepositoryLinkCommitRequest {
4941 /// Creates a new default instance.
4942 pub fn new() -> Self {
4943 std::default::Default::default()
4944 }
4945
4946 /// Sets the value of [name][crate::model::DiffGitRepositoryLinkCommitRequest::name].
4947 ///
4948 /// # Example
4949 /// ```ignore,no_run
4950 /// # use google_cloud_developerconnect_v1::model::DiffGitRepositoryLinkCommitRequest;
4951 /// # let project_id = "project_id";
4952 /// # let location_id = "location_id";
4953 /// # let connection_id = "connection_id";
4954 /// # let git_repository_link_id = "git_repository_link_id";
4955 /// let x = DiffGitRepositoryLinkCommitRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
4956 /// ```
4957 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4958 self.name = v.into();
4959 self
4960 }
4961
4962 /// Sets the value of [base_sha][crate::model::DiffGitRepositoryLinkCommitRequest::base_sha].
4963 ///
4964 /// # Example
4965 /// ```ignore,no_run
4966 /// # use google_cloud_developerconnect_v1::model::DiffGitRepositoryLinkCommitRequest;
4967 /// let x = DiffGitRepositoryLinkCommitRequest::new().set_base_sha("example");
4968 /// ```
4969 pub fn set_base_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4970 self.base_sha = v.into();
4971 self
4972 }
4973
4974 /// Sets the value of [head_sha][crate::model::DiffGitRepositoryLinkCommitRequest::head_sha].
4975 ///
4976 /// # Example
4977 /// ```ignore,no_run
4978 /// # use google_cloud_developerconnect_v1::model::DiffGitRepositoryLinkCommitRequest;
4979 /// let x = DiffGitRepositoryLinkCommitRequest::new().set_head_sha("example");
4980 /// ```
4981 pub fn set_head_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4982 self.head_sha = v.into();
4983 self
4984 }
4985
4986 /// Sets the value of [path_filters][crate::model::DiffGitRepositoryLinkCommitRequest::path_filters].
4987 ///
4988 /// # Example
4989 /// ```ignore,no_run
4990 /// # use google_cloud_developerconnect_v1::model::DiffGitRepositoryLinkCommitRequest;
4991 /// let x = DiffGitRepositoryLinkCommitRequest::new().set_path_filters(["a", "b", "c"]);
4992 /// ```
4993 pub fn set_path_filters<T, V>(mut self, v: T) -> Self
4994 where
4995 T: std::iter::IntoIterator<Item = V>,
4996 V: std::convert::Into<std::string::String>,
4997 {
4998 use std::iter::Iterator;
4999 self.path_filters = v.into_iter().map(|i| i.into()).collect();
5000 self
5001 }
5002}
5003
5004impl wkt::message::Message for DiffGitRepositoryLinkCommitRequest {
5005 fn typename() -> &'static str {
5006 "type.googleapis.com/google.cloud.developerconnect.v1.DiffGitRepositoryLinkCommitRequest"
5007 }
5008}
5009
5010/// Response message for DiffGitRepositoryLinkCommit.
5011#[derive(Clone, Default, PartialEq)]
5012#[non_exhaustive]
5013pub struct DiffGitRepositoryLinkCommitResponse {
5014 /// The file diff extracted from the unified diff.
5015 pub files: std::vec::Vec<crate::model::FileDiff>,
5016
5017 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5018}
5019
5020impl DiffGitRepositoryLinkCommitResponse {
5021 /// Creates a new default instance.
5022 pub fn new() -> Self {
5023 std::default::Default::default()
5024 }
5025
5026 /// Sets the value of [files][crate::model::DiffGitRepositoryLinkCommitResponse::files].
5027 ///
5028 /// # Example
5029 /// ```ignore,no_run
5030 /// # use google_cloud_developerconnect_v1::model::DiffGitRepositoryLinkCommitResponse;
5031 /// use google_cloud_developerconnect_v1::model::FileDiff;
5032 /// let x = DiffGitRepositoryLinkCommitResponse::new()
5033 /// .set_files([
5034 /// FileDiff::default()/* use setters */,
5035 /// FileDiff::default()/* use (different) setters */,
5036 /// ]);
5037 /// ```
5038 pub fn set_files<T, V>(mut self, v: T) -> Self
5039 where
5040 T: std::iter::IntoIterator<Item = V>,
5041 V: std::convert::Into<crate::model::FileDiff>,
5042 {
5043 use std::iter::Iterator;
5044 self.files = v.into_iter().map(|i| i.into()).collect();
5045 self
5046 }
5047}
5048
5049impl wkt::message::Message for DiffGitRepositoryLinkCommitResponse {
5050 fn typename() -> &'static str {
5051 "type.googleapis.com/google.cloud.developerconnect.v1.DiffGitRepositoryLinkCommitResponse"
5052 }
5053}
5054
5055/// Message for a file diff.
5056#[derive(Clone, Default, PartialEq)]
5057#[non_exhaustive]
5058pub struct FileDiff {
5059 /// Relative path to the file in the repository.
5060 pub path: std::string::String,
5061
5062 /// Status of change: "ADDED", "MODIFIED", "REMOVED", "RENAMED".
5063 pub status: std::string::String,
5064
5065 /// Standard unified diff patch hunk for the file. Only populated when
5066 /// `path_filters` is specified in the request; otherwise empty.
5067 pub patch: std::string::String,
5068
5069 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5070}
5071
5072impl FileDiff {
5073 /// Creates a new default instance.
5074 pub fn new() -> Self {
5075 std::default::Default::default()
5076 }
5077
5078 /// Sets the value of [path][crate::model::FileDiff::path].
5079 ///
5080 /// # Example
5081 /// ```ignore,no_run
5082 /// # use google_cloud_developerconnect_v1::model::FileDiff;
5083 /// let x = FileDiff::new().set_path("example");
5084 /// ```
5085 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5086 self.path = v.into();
5087 self
5088 }
5089
5090 /// Sets the value of [status][crate::model::FileDiff::status].
5091 ///
5092 /// # Example
5093 /// ```ignore,no_run
5094 /// # use google_cloud_developerconnect_v1::model::FileDiff;
5095 /// let x = FileDiff::new().set_status("example");
5096 /// ```
5097 pub fn set_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5098 self.status = v.into();
5099 self
5100 }
5101
5102 /// Sets the value of [patch][crate::model::FileDiff::patch].
5103 ///
5104 /// # Example
5105 /// ```ignore,no_run
5106 /// # use google_cloud_developerconnect_v1::model::FileDiff;
5107 /// let x = FileDiff::new().set_patch("example");
5108 /// ```
5109 pub fn set_patch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5110 self.patch = v.into();
5111 self
5112 }
5113}
5114
5115impl wkt::message::Message for FileDiff {
5116 fn typename() -> &'static str {
5117 "type.googleapis.com/google.cloud.developerconnect.v1.FileDiff"
5118 }
5119}
5120
5121/// Message for starting an OAuth flow.
5122#[derive(Clone, Default, PartialEq)]
5123#[non_exhaustive]
5124pub struct StartOAuthRequest {
5125 /// Required. The resource name of the AccountConnector in the format
5126 /// `projects/*/locations/*/accountConnectors/*`.
5127 pub account_connector: std::string::String,
5128
5129 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5130}
5131
5132impl StartOAuthRequest {
5133 /// Creates a new default instance.
5134 pub fn new() -> Self {
5135 std::default::Default::default()
5136 }
5137
5138 /// Sets the value of [account_connector][crate::model::StartOAuthRequest::account_connector].
5139 ///
5140 /// # Example
5141 /// ```ignore,no_run
5142 /// # use google_cloud_developerconnect_v1::model::StartOAuthRequest;
5143 /// # let project_id = "project_id";
5144 /// # let location_id = "location_id";
5145 /// # let account_connector_id = "account_connector_id";
5146 /// let x = StartOAuthRequest::new().set_account_connector(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
5147 /// ```
5148 pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
5149 mut self,
5150 v: T,
5151 ) -> Self {
5152 self.account_connector = v.into();
5153 self
5154 }
5155}
5156
5157impl wkt::message::Message for StartOAuthRequest {
5158 fn typename() -> &'static str {
5159 "type.googleapis.com/google.cloud.developerconnect.v1.StartOAuthRequest"
5160 }
5161}
5162
5163/// Message for responding to starting an OAuth flow.
5164#[derive(Clone, Default, PartialEq)]
5165#[non_exhaustive]
5166pub struct StartOAuthResponse {
5167 /// The ticket to be used for post processing the callback from the service
5168 /// provider.
5169 pub ticket: std::string::String,
5170
5171 /// Please refer to <https://datatracker.ietf.org/doc/html/rfc7636#section-4.1>
5172 pub code_challenge: std::string::String,
5173
5174 /// Please refer to <https://datatracker.ietf.org/doc/html/rfc7636#section-4.2>
5175 pub code_challenge_method: std::string::String,
5176
5177 /// The client ID to the OAuth App of the service provider.
5178 pub client_id: std::string::String,
5179
5180 /// The list of scopes requested by the application.
5181 pub scopes: std::vec::Vec<std::string::String>,
5182
5183 /// The authorization server URL to the OAuth flow of the service provider.
5184 pub auth_uri: std::string::String,
5185
5186 /// The ID of the service provider.
5187 pub id: std::option::Option<crate::model::start_o_auth_response::Id>,
5188
5189 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5190}
5191
5192impl StartOAuthResponse {
5193 /// Creates a new default instance.
5194 pub fn new() -> Self {
5195 std::default::Default::default()
5196 }
5197
5198 /// Sets the value of [ticket][crate::model::StartOAuthResponse::ticket].
5199 ///
5200 /// # Example
5201 /// ```ignore,no_run
5202 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5203 /// let x = StartOAuthResponse::new().set_ticket("example");
5204 /// ```
5205 pub fn set_ticket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5206 self.ticket = v.into();
5207 self
5208 }
5209
5210 /// Sets the value of [code_challenge][crate::model::StartOAuthResponse::code_challenge].
5211 ///
5212 /// # Example
5213 /// ```ignore,no_run
5214 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5215 /// let x = StartOAuthResponse::new().set_code_challenge("example");
5216 /// ```
5217 pub fn set_code_challenge<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5218 self.code_challenge = v.into();
5219 self
5220 }
5221
5222 /// Sets the value of [code_challenge_method][crate::model::StartOAuthResponse::code_challenge_method].
5223 ///
5224 /// # Example
5225 /// ```ignore,no_run
5226 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5227 /// let x = StartOAuthResponse::new().set_code_challenge_method("example");
5228 /// ```
5229 pub fn set_code_challenge_method<T: std::convert::Into<std::string::String>>(
5230 mut self,
5231 v: T,
5232 ) -> Self {
5233 self.code_challenge_method = v.into();
5234 self
5235 }
5236
5237 /// Sets the value of [client_id][crate::model::StartOAuthResponse::client_id].
5238 ///
5239 /// # Example
5240 /// ```ignore,no_run
5241 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5242 /// let x = StartOAuthResponse::new().set_client_id("example");
5243 /// ```
5244 pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5245 self.client_id = v.into();
5246 self
5247 }
5248
5249 /// Sets the value of [scopes][crate::model::StartOAuthResponse::scopes].
5250 ///
5251 /// # Example
5252 /// ```ignore,no_run
5253 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5254 /// let x = StartOAuthResponse::new().set_scopes(["a", "b", "c"]);
5255 /// ```
5256 pub fn set_scopes<T, V>(mut self, v: T) -> Self
5257 where
5258 T: std::iter::IntoIterator<Item = V>,
5259 V: std::convert::Into<std::string::String>,
5260 {
5261 use std::iter::Iterator;
5262 self.scopes = v.into_iter().map(|i| i.into()).collect();
5263 self
5264 }
5265
5266 /// Sets the value of [auth_uri][crate::model::StartOAuthResponse::auth_uri].
5267 ///
5268 /// # Example
5269 /// ```ignore,no_run
5270 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5271 /// let x = StartOAuthResponse::new().set_auth_uri("example");
5272 /// ```
5273 pub fn set_auth_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5274 self.auth_uri = v.into();
5275 self
5276 }
5277
5278 /// Sets the value of [id][crate::model::StartOAuthResponse::id].
5279 ///
5280 /// Note that all the setters affecting `id` are mutually
5281 /// exclusive.
5282 ///
5283 /// # Example
5284 /// ```ignore,no_run
5285 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5286 /// use google_cloud_developerconnect_v1::model::SystemProvider;
5287 /// let x0 = StartOAuthResponse::new().set_id(Some(
5288 /// google_cloud_developerconnect_v1::model::start_o_auth_response::Id::SystemProviderId(SystemProvider::Github)));
5289 /// let x1 = StartOAuthResponse::new().set_id(Some(
5290 /// google_cloud_developerconnect_v1::model::start_o_auth_response::Id::SystemProviderId(SystemProvider::Gitlab)));
5291 /// let x2 = StartOAuthResponse::new().set_id(Some(
5292 /// google_cloud_developerconnect_v1::model::start_o_auth_response::Id::SystemProviderId(SystemProvider::Google)));
5293 /// ```
5294 pub fn set_id<
5295 T: std::convert::Into<std::option::Option<crate::model::start_o_auth_response::Id>>,
5296 >(
5297 mut self,
5298 v: T,
5299 ) -> Self {
5300 self.id = v.into();
5301 self
5302 }
5303
5304 /// The value of [id][crate::model::StartOAuthResponse::id]
5305 /// if it holds a `SystemProviderId`, `None` if the field is not set or
5306 /// holds a different branch.
5307 pub fn system_provider_id(&self) -> std::option::Option<&crate::model::SystemProvider> {
5308 #[allow(unreachable_patterns)]
5309 self.id.as_ref().and_then(|v| match v {
5310 crate::model::start_o_auth_response::Id::SystemProviderId(v) => {
5311 std::option::Option::Some(v)
5312 }
5313 _ => std::option::Option::None,
5314 })
5315 }
5316
5317 /// Sets the value of [id][crate::model::StartOAuthResponse::id]
5318 /// to hold a `SystemProviderId`.
5319 ///
5320 /// Note that all the setters affecting `id` are
5321 /// mutually exclusive.
5322 ///
5323 /// # Example
5324 /// ```ignore,no_run
5325 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5326 /// use google_cloud_developerconnect_v1::model::SystemProvider;
5327 /// let x0 = StartOAuthResponse::new().set_system_provider_id(SystemProvider::Github);
5328 /// let x1 = StartOAuthResponse::new().set_system_provider_id(SystemProvider::Gitlab);
5329 /// let x2 = StartOAuthResponse::new().set_system_provider_id(SystemProvider::Google);
5330 /// assert!(x0.system_provider_id().is_some());
5331 /// assert!(x1.system_provider_id().is_some());
5332 /// assert!(x2.system_provider_id().is_some());
5333 /// ```
5334 pub fn set_system_provider_id<T: std::convert::Into<crate::model::SystemProvider>>(
5335 mut self,
5336 v: T,
5337 ) -> Self {
5338 self.id = std::option::Option::Some(
5339 crate::model::start_o_auth_response::Id::SystemProviderId(v.into()),
5340 );
5341 self
5342 }
5343}
5344
5345impl wkt::message::Message for StartOAuthResponse {
5346 fn typename() -> &'static str {
5347 "type.googleapis.com/google.cloud.developerconnect.v1.StartOAuthResponse"
5348 }
5349}
5350
5351/// Defines additional types related to [StartOAuthResponse].
5352pub mod start_o_auth_response {
5353 #[allow(unused_imports)]
5354 use super::*;
5355
5356 /// The ID of the service provider.
5357 #[derive(Clone, Debug, PartialEq)]
5358 #[non_exhaustive]
5359 pub enum Id {
5360 /// The ID of the system provider.
5361 SystemProviderId(crate::model::SystemProvider),
5362 }
5363}
5364
5365/// Message for finishing an OAuth flow.
5366#[derive(Clone, Default, PartialEq)]
5367#[non_exhaustive]
5368pub struct FinishOAuthRequest {
5369 /// Required. The resource name of the AccountConnector in the format
5370 /// `projects/*/locations/*/accountConnectors/*`.
5371 pub account_connector: std::string::String,
5372
5373 /// The params returned by OAuth flow redirect.
5374 pub params: std::option::Option<crate::model::finish_o_auth_request::Params>,
5375
5376 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5377}
5378
5379impl FinishOAuthRequest {
5380 /// Creates a new default instance.
5381 pub fn new() -> Self {
5382 std::default::Default::default()
5383 }
5384
5385 /// Sets the value of [account_connector][crate::model::FinishOAuthRequest::account_connector].
5386 ///
5387 /// # Example
5388 /// ```ignore,no_run
5389 /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5390 /// # let project_id = "project_id";
5391 /// # let location_id = "location_id";
5392 /// # let account_connector_id = "account_connector_id";
5393 /// let x = FinishOAuthRequest::new().set_account_connector(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
5394 /// ```
5395 pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
5396 mut self,
5397 v: T,
5398 ) -> Self {
5399 self.account_connector = v.into();
5400 self
5401 }
5402
5403 /// Sets the value of [params][crate::model::FinishOAuthRequest::params].
5404 ///
5405 /// Note that all the setters affecting `params` are mutually
5406 /// exclusive.
5407 ///
5408 /// # Example
5409 /// ```ignore,no_run
5410 /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5411 /// use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5412 /// let x = FinishOAuthRequest::new().set_params(Some(
5413 /// google_cloud_developerconnect_v1::model::finish_o_auth_request::Params::OauthParams(OAuthParams::default().into())));
5414 /// ```
5415 pub fn set_params<
5416 T: std::convert::Into<std::option::Option<crate::model::finish_o_auth_request::Params>>,
5417 >(
5418 mut self,
5419 v: T,
5420 ) -> Self {
5421 self.params = v.into();
5422 self
5423 }
5424
5425 /// The value of [params][crate::model::FinishOAuthRequest::params]
5426 /// if it holds a `OauthParams`, `None` if the field is not set or
5427 /// holds a different branch.
5428 pub fn oauth_params(
5429 &self,
5430 ) -> std::option::Option<&std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>>
5431 {
5432 #[allow(unreachable_patterns)]
5433 self.params.as_ref().and_then(|v| match v {
5434 crate::model::finish_o_auth_request::Params::OauthParams(v) => {
5435 std::option::Option::Some(v)
5436 }
5437 _ => std::option::Option::None,
5438 })
5439 }
5440
5441 /// Sets the value of [params][crate::model::FinishOAuthRequest::params]
5442 /// to hold a `OauthParams`.
5443 ///
5444 /// Note that all the setters affecting `params` are
5445 /// mutually exclusive.
5446 ///
5447 /// # Example
5448 /// ```ignore,no_run
5449 /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5450 /// use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5451 /// let x = FinishOAuthRequest::new().set_oauth_params(OAuthParams::default()/* use setters */);
5452 /// assert!(x.oauth_params().is_some());
5453 /// assert!(x.google_oauth_params().is_none());
5454 /// ```
5455 pub fn set_oauth_params<
5456 T: std::convert::Into<std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>>,
5457 >(
5458 mut self,
5459 v: T,
5460 ) -> Self {
5461 self.params = std::option::Option::Some(
5462 crate::model::finish_o_auth_request::Params::OauthParams(v.into()),
5463 );
5464 self
5465 }
5466
5467 /// The value of [params][crate::model::FinishOAuthRequest::params]
5468 /// if it holds a `GoogleOauthParams`, `None` if the field is not set or
5469 /// holds a different branch.
5470 pub fn google_oauth_params(
5471 &self,
5472 ) -> std::option::Option<&std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>>
5473 {
5474 #[allow(unreachable_patterns)]
5475 self.params.as_ref().and_then(|v| match v {
5476 crate::model::finish_o_auth_request::Params::GoogleOauthParams(v) => {
5477 std::option::Option::Some(v)
5478 }
5479 _ => std::option::Option::None,
5480 })
5481 }
5482
5483 /// Sets the value of [params][crate::model::FinishOAuthRequest::params]
5484 /// to hold a `GoogleOauthParams`.
5485 ///
5486 /// Note that all the setters affecting `params` are
5487 /// mutually exclusive.
5488 ///
5489 /// # Example
5490 /// ```ignore,no_run
5491 /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5492 /// use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5493 /// let x = FinishOAuthRequest::new().set_google_oauth_params(GoogleOAuthParams::default()/* use setters */);
5494 /// assert!(x.google_oauth_params().is_some());
5495 /// assert!(x.oauth_params().is_none());
5496 /// ```
5497 pub fn set_google_oauth_params<
5498 T: std::convert::Into<std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>>,
5499 >(
5500 mut self,
5501 v: T,
5502 ) -> Self {
5503 self.params = std::option::Option::Some(
5504 crate::model::finish_o_auth_request::Params::GoogleOauthParams(v.into()),
5505 );
5506 self
5507 }
5508}
5509
5510impl wkt::message::Message for FinishOAuthRequest {
5511 fn typename() -> &'static str {
5512 "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthRequest"
5513 }
5514}
5515
5516/// Defines additional types related to [FinishOAuthRequest].
5517pub mod finish_o_auth_request {
5518 #[allow(unused_imports)]
5519 use super::*;
5520
5521 /// The params returned by non-Google OAuth 2.0 flow redirect.
5522 #[derive(Clone, Default, PartialEq)]
5523 #[non_exhaustive]
5524 pub struct OAuthParams {
5525 /// Required. The code to be used for getting the token from SCM provider.
5526 pub code: std::string::String,
5527
5528 /// Required. The ticket to be used for post processing the callback from SCM
5529 /// provider.
5530 pub ticket: std::string::String,
5531
5532 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5533 }
5534
5535 impl OAuthParams {
5536 /// Creates a new default instance.
5537 pub fn new() -> Self {
5538 std::default::Default::default()
5539 }
5540
5541 /// Sets the value of [code][crate::model::finish_o_auth_request::OAuthParams::code].
5542 ///
5543 /// # Example
5544 /// ```ignore,no_run
5545 /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5546 /// let x = OAuthParams::new().set_code("example");
5547 /// ```
5548 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5549 self.code = v.into();
5550 self
5551 }
5552
5553 /// Sets the value of [ticket][crate::model::finish_o_auth_request::OAuthParams::ticket].
5554 ///
5555 /// # Example
5556 /// ```ignore,no_run
5557 /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5558 /// let x = OAuthParams::new().set_ticket("example");
5559 /// ```
5560 pub fn set_ticket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5561 self.ticket = v.into();
5562 self
5563 }
5564 }
5565
5566 impl wkt::message::Message for OAuthParams {
5567 fn typename() -> &'static str {
5568 "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthRequest.OAuthParams"
5569 }
5570 }
5571
5572 /// The params returned by Google OAuth flow redirects.
5573 #[derive(Clone, Default, PartialEq)]
5574 #[non_exhaustive]
5575 pub struct GoogleOAuthParams {
5576 /// Required. The scopes returned by Google OAuth flow.
5577 pub scopes: std::vec::Vec<std::string::String>,
5578
5579 /// Optional. The version info returned by Google OAuth flow.
5580 pub version_info: std::string::String,
5581
5582 /// Required. The ticket to be used for post processing the callback from
5583 /// Google OAuth flow.
5584 pub ticket: std::string::String,
5585
5586 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5587 }
5588
5589 impl GoogleOAuthParams {
5590 /// Creates a new default instance.
5591 pub fn new() -> Self {
5592 std::default::Default::default()
5593 }
5594
5595 /// Sets the value of [scopes][crate::model::finish_o_auth_request::GoogleOAuthParams::scopes].
5596 ///
5597 /// # Example
5598 /// ```ignore,no_run
5599 /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5600 /// let x = GoogleOAuthParams::new().set_scopes(["a", "b", "c"]);
5601 /// ```
5602 pub fn set_scopes<T, V>(mut self, v: T) -> Self
5603 where
5604 T: std::iter::IntoIterator<Item = V>,
5605 V: std::convert::Into<std::string::String>,
5606 {
5607 use std::iter::Iterator;
5608 self.scopes = v.into_iter().map(|i| i.into()).collect();
5609 self
5610 }
5611
5612 /// Sets the value of [version_info][crate::model::finish_o_auth_request::GoogleOAuthParams::version_info].
5613 ///
5614 /// # Example
5615 /// ```ignore,no_run
5616 /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5617 /// let x = GoogleOAuthParams::new().set_version_info("example");
5618 /// ```
5619 pub fn set_version_info<T: std::convert::Into<std::string::String>>(
5620 mut self,
5621 v: T,
5622 ) -> Self {
5623 self.version_info = v.into();
5624 self
5625 }
5626
5627 /// Sets the value of [ticket][crate::model::finish_o_auth_request::GoogleOAuthParams::ticket].
5628 ///
5629 /// # Example
5630 /// ```ignore,no_run
5631 /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5632 /// let x = GoogleOAuthParams::new().set_ticket("example");
5633 /// ```
5634 pub fn set_ticket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5635 self.ticket = v.into();
5636 self
5637 }
5638 }
5639
5640 impl wkt::message::Message for GoogleOAuthParams {
5641 fn typename() -> &'static str {
5642 "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthRequest.GoogleOAuthParams"
5643 }
5644 }
5645
5646 /// The params returned by OAuth flow redirect.
5647 #[derive(Clone, Debug, PartialEq)]
5648 #[non_exhaustive]
5649 pub enum Params {
5650 /// The params returned by non-Google OAuth 2.0 flow redirect.
5651 OauthParams(std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>),
5652 /// The params returned by Google OAuth flow redirects.
5653 GoogleOauthParams(std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>),
5654 }
5655}
5656
5657/// Message for responding to finishing an OAuth flow.
5658#[derive(Clone, Default, PartialEq)]
5659#[non_exhaustive]
5660pub struct FinishOAuthResponse {
5661 /// The error resulted from exchanging OAuth tokens from the service provider.
5662 pub exchange_error: std::option::Option<crate::model::ExchangeError>,
5663
5664 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5665}
5666
5667impl FinishOAuthResponse {
5668 /// Creates a new default instance.
5669 pub fn new() -> Self {
5670 std::default::Default::default()
5671 }
5672
5673 /// Sets the value of [exchange_error][crate::model::FinishOAuthResponse::exchange_error].
5674 ///
5675 /// # Example
5676 /// ```ignore,no_run
5677 /// # use google_cloud_developerconnect_v1::model::FinishOAuthResponse;
5678 /// use google_cloud_developerconnect_v1::model::ExchangeError;
5679 /// let x = FinishOAuthResponse::new().set_exchange_error(ExchangeError::default()/* use setters */);
5680 /// ```
5681 pub fn set_exchange_error<T>(mut self, v: T) -> Self
5682 where
5683 T: std::convert::Into<crate::model::ExchangeError>,
5684 {
5685 self.exchange_error = std::option::Option::Some(v.into());
5686 self
5687 }
5688
5689 /// Sets or clears the value of [exchange_error][crate::model::FinishOAuthResponse::exchange_error].
5690 ///
5691 /// # Example
5692 /// ```ignore,no_run
5693 /// # use google_cloud_developerconnect_v1::model::FinishOAuthResponse;
5694 /// use google_cloud_developerconnect_v1::model::ExchangeError;
5695 /// let x = FinishOAuthResponse::new().set_or_clear_exchange_error(Some(ExchangeError::default()/* use setters */));
5696 /// let x = FinishOAuthResponse::new().set_or_clear_exchange_error(None::<ExchangeError>);
5697 /// ```
5698 pub fn set_or_clear_exchange_error<T>(mut self, v: std::option::Option<T>) -> Self
5699 where
5700 T: std::convert::Into<crate::model::ExchangeError>,
5701 {
5702 self.exchange_error = v.map(|x| x.into());
5703 self
5704 }
5705}
5706
5707impl wkt::message::Message for FinishOAuthResponse {
5708 fn typename() -> &'static str {
5709 "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthResponse"
5710 }
5711}
5712
5713/// Message for representing an error from exchanging OAuth tokens.
5714#[derive(Clone, Default, PartialEq)]
5715#[non_exhaustive]
5716pub struct ExchangeError {
5717 /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> - error
5718 pub code: std::string::String,
5719
5720 /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> -
5721 /// error_description
5722 pub description: std::string::String,
5723
5724 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5725}
5726
5727impl ExchangeError {
5728 /// Creates a new default instance.
5729 pub fn new() -> Self {
5730 std::default::Default::default()
5731 }
5732
5733 /// Sets the value of [code][crate::model::ExchangeError::code].
5734 ///
5735 /// # Example
5736 /// ```ignore,no_run
5737 /// # use google_cloud_developerconnect_v1::model::ExchangeError;
5738 /// let x = ExchangeError::new().set_code("example");
5739 /// ```
5740 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5741 self.code = v.into();
5742 self
5743 }
5744
5745 /// Sets the value of [description][crate::model::ExchangeError::description].
5746 ///
5747 /// # Example
5748 /// ```ignore,no_run
5749 /// # use google_cloud_developerconnect_v1::model::ExchangeError;
5750 /// let x = ExchangeError::new().set_description("example");
5751 /// ```
5752 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5753 self.description = v.into();
5754 self
5755 }
5756}
5757
5758impl wkt::message::Message for ExchangeError {
5759 fn typename() -> &'static str {
5760 "type.googleapis.com/google.cloud.developerconnect.v1.ExchangeError"
5761 }
5762}
5763
5764/// Message describing the GitRepositoryLink object
5765#[derive(Clone, Default, PartialEq)]
5766#[non_exhaustive]
5767pub struct GitRepositoryLink {
5768 /// Identifier. Resource name of the repository, in the format
5769 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
5770 pub name: std::string::String,
5771
5772 /// Required. Git Clone URI.
5773 pub clone_uri: std::string::String,
5774
5775 /// Output only. [Output only] Create timestamp
5776 pub create_time: std::option::Option<wkt::Timestamp>,
5777
5778 /// Output only. [Output only] Update timestamp
5779 pub update_time: std::option::Option<wkt::Timestamp>,
5780
5781 /// Output only. [Output only] Delete timestamp
5782 pub delete_time: std::option::Option<wkt::Timestamp>,
5783
5784 /// Optional. Labels as key value pairs
5785 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5786
5787 /// Optional. This checksum is computed by the server based on the value of
5788 /// other fields, and may be sent on update and delete requests to ensure the
5789 /// client has an up-to-date value before proceeding.
5790 pub etag: std::string::String,
5791
5792 /// Output only. Set to true when the connection is being set up or updated in
5793 /// the background.
5794 pub reconciling: bool,
5795
5796 /// Optional. Allows clients to store small amounts of arbitrary data.
5797 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5798
5799 /// Output only. A system-assigned unique identifier for the GitRepositoryLink.
5800 pub uid: std::string::String,
5801
5802 /// Output only. External ID of the webhook created for the repository.
5803 pub webhook_id: std::string::String,
5804
5805 /// Output only. URI to access the linked repository through the Git Proxy.
5806 /// This field is only populated if the git proxy is enabled for the
5807 /// connection.
5808 pub git_proxy_uri: std::string::String,
5809
5810 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5811}
5812
5813impl GitRepositoryLink {
5814 /// Creates a new default instance.
5815 pub fn new() -> Self {
5816 std::default::Default::default()
5817 }
5818
5819 /// Sets the value of [name][crate::model::GitRepositoryLink::name].
5820 ///
5821 /// # Example
5822 /// ```ignore,no_run
5823 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5824 /// # let project_id = "project_id";
5825 /// # let location_id = "location_id";
5826 /// # let connection_id = "connection_id";
5827 /// # let git_repository_link_id = "git_repository_link_id";
5828 /// let x = GitRepositoryLink::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
5829 /// ```
5830 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5831 self.name = v.into();
5832 self
5833 }
5834
5835 /// Sets the value of [clone_uri][crate::model::GitRepositoryLink::clone_uri].
5836 ///
5837 /// # Example
5838 /// ```ignore,no_run
5839 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5840 /// let x = GitRepositoryLink::new().set_clone_uri("example");
5841 /// ```
5842 pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5843 self.clone_uri = v.into();
5844 self
5845 }
5846
5847 /// Sets the value of [create_time][crate::model::GitRepositoryLink::create_time].
5848 ///
5849 /// # Example
5850 /// ```ignore,no_run
5851 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5852 /// use wkt::Timestamp;
5853 /// let x = GitRepositoryLink::new().set_create_time(Timestamp::default()/* use setters */);
5854 /// ```
5855 pub fn set_create_time<T>(mut self, v: T) -> Self
5856 where
5857 T: std::convert::Into<wkt::Timestamp>,
5858 {
5859 self.create_time = std::option::Option::Some(v.into());
5860 self
5861 }
5862
5863 /// Sets or clears the value of [create_time][crate::model::GitRepositoryLink::create_time].
5864 ///
5865 /// # Example
5866 /// ```ignore,no_run
5867 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5868 /// use wkt::Timestamp;
5869 /// let x = GitRepositoryLink::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5870 /// let x = GitRepositoryLink::new().set_or_clear_create_time(None::<Timestamp>);
5871 /// ```
5872 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5873 where
5874 T: std::convert::Into<wkt::Timestamp>,
5875 {
5876 self.create_time = v.map(|x| x.into());
5877 self
5878 }
5879
5880 /// Sets the value of [update_time][crate::model::GitRepositoryLink::update_time].
5881 ///
5882 /// # Example
5883 /// ```ignore,no_run
5884 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5885 /// use wkt::Timestamp;
5886 /// let x = GitRepositoryLink::new().set_update_time(Timestamp::default()/* use setters */);
5887 /// ```
5888 pub fn set_update_time<T>(mut self, v: T) -> Self
5889 where
5890 T: std::convert::Into<wkt::Timestamp>,
5891 {
5892 self.update_time = std::option::Option::Some(v.into());
5893 self
5894 }
5895
5896 /// Sets or clears the value of [update_time][crate::model::GitRepositoryLink::update_time].
5897 ///
5898 /// # Example
5899 /// ```ignore,no_run
5900 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5901 /// use wkt::Timestamp;
5902 /// let x = GitRepositoryLink::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5903 /// let x = GitRepositoryLink::new().set_or_clear_update_time(None::<Timestamp>);
5904 /// ```
5905 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5906 where
5907 T: std::convert::Into<wkt::Timestamp>,
5908 {
5909 self.update_time = v.map(|x| x.into());
5910 self
5911 }
5912
5913 /// Sets the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
5914 ///
5915 /// # Example
5916 /// ```ignore,no_run
5917 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5918 /// use wkt::Timestamp;
5919 /// let x = GitRepositoryLink::new().set_delete_time(Timestamp::default()/* use setters */);
5920 /// ```
5921 pub fn set_delete_time<T>(mut self, v: T) -> Self
5922 where
5923 T: std::convert::Into<wkt::Timestamp>,
5924 {
5925 self.delete_time = std::option::Option::Some(v.into());
5926 self
5927 }
5928
5929 /// Sets or clears the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
5930 ///
5931 /// # Example
5932 /// ```ignore,no_run
5933 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5934 /// use wkt::Timestamp;
5935 /// let x = GitRepositoryLink::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
5936 /// let x = GitRepositoryLink::new().set_or_clear_delete_time(None::<Timestamp>);
5937 /// ```
5938 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
5939 where
5940 T: std::convert::Into<wkt::Timestamp>,
5941 {
5942 self.delete_time = v.map(|x| x.into());
5943 self
5944 }
5945
5946 /// Sets the value of [labels][crate::model::GitRepositoryLink::labels].
5947 ///
5948 /// # Example
5949 /// ```ignore,no_run
5950 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5951 /// let x = GitRepositoryLink::new().set_labels([
5952 /// ("key0", "abc"),
5953 /// ("key1", "xyz"),
5954 /// ]);
5955 /// ```
5956 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5957 where
5958 T: std::iter::IntoIterator<Item = (K, V)>,
5959 K: std::convert::Into<std::string::String>,
5960 V: std::convert::Into<std::string::String>,
5961 {
5962 use std::iter::Iterator;
5963 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5964 self
5965 }
5966
5967 /// Sets the value of [etag][crate::model::GitRepositoryLink::etag].
5968 ///
5969 /// # Example
5970 /// ```ignore,no_run
5971 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5972 /// let x = GitRepositoryLink::new().set_etag("example");
5973 /// ```
5974 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5975 self.etag = v.into();
5976 self
5977 }
5978
5979 /// Sets the value of [reconciling][crate::model::GitRepositoryLink::reconciling].
5980 ///
5981 /// # Example
5982 /// ```ignore,no_run
5983 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5984 /// let x = GitRepositoryLink::new().set_reconciling(true);
5985 /// ```
5986 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5987 self.reconciling = v.into();
5988 self
5989 }
5990
5991 /// Sets the value of [annotations][crate::model::GitRepositoryLink::annotations].
5992 ///
5993 /// # Example
5994 /// ```ignore,no_run
5995 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5996 /// let x = GitRepositoryLink::new().set_annotations([
5997 /// ("key0", "abc"),
5998 /// ("key1", "xyz"),
5999 /// ]);
6000 /// ```
6001 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
6002 where
6003 T: std::iter::IntoIterator<Item = (K, V)>,
6004 K: std::convert::Into<std::string::String>,
6005 V: std::convert::Into<std::string::String>,
6006 {
6007 use std::iter::Iterator;
6008 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6009 self
6010 }
6011
6012 /// Sets the value of [uid][crate::model::GitRepositoryLink::uid].
6013 ///
6014 /// # Example
6015 /// ```ignore,no_run
6016 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
6017 /// let x = GitRepositoryLink::new().set_uid("example");
6018 /// ```
6019 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6020 self.uid = v.into();
6021 self
6022 }
6023
6024 /// Sets the value of [webhook_id][crate::model::GitRepositoryLink::webhook_id].
6025 ///
6026 /// # Example
6027 /// ```ignore,no_run
6028 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
6029 /// let x = GitRepositoryLink::new().set_webhook_id("example");
6030 /// ```
6031 pub fn set_webhook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6032 self.webhook_id = v.into();
6033 self
6034 }
6035
6036 /// Sets the value of [git_proxy_uri][crate::model::GitRepositoryLink::git_proxy_uri].
6037 ///
6038 /// # Example
6039 /// ```ignore,no_run
6040 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
6041 /// let x = GitRepositoryLink::new().set_git_proxy_uri("example");
6042 /// ```
6043 pub fn set_git_proxy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6044 self.git_proxy_uri = v.into();
6045 self
6046 }
6047}
6048
6049impl wkt::message::Message for GitRepositoryLink {
6050 fn typename() -> &'static str {
6051 "type.googleapis.com/google.cloud.developerconnect.v1.GitRepositoryLink"
6052 }
6053}
6054
6055/// Message for creating a GitRepositoryLink
6056#[derive(Clone, Default, PartialEq)]
6057#[non_exhaustive]
6058pub struct CreateGitRepositoryLinkRequest {
6059 /// Required. Value for parent.
6060 pub parent: std::string::String,
6061
6062 /// Required. The resource being created
6063 pub git_repository_link: std::option::Option<crate::model::GitRepositoryLink>,
6064
6065 /// Required. The ID to use for the repository, which will become the final
6066 /// component of the repository's resource name. This ID should be unique in
6067 /// the connection. Allows alphanumeric characters and any of
6068 /// -._~%!$&'()*+,;=@.
6069 pub git_repository_link_id: std::string::String,
6070
6071 /// Optional. An optional request ID to identify requests. Specify a unique
6072 /// request ID so that if you must retry your request, the server will know to
6073 /// ignore the request if it has already been completed. The server will
6074 /// guarantee that for at least 60 minutes since the first request.
6075 ///
6076 /// For example, consider a situation where you make an initial request and the
6077 /// request times out. If you make the request again with the same request
6078 /// ID, the server can check if original operation with the same request ID
6079 /// was received, and if so, will ignore the second request. This prevents
6080 /// clients from accidentally creating duplicate commitments.
6081 ///
6082 /// The request ID must be a valid UUID with the exception that zero UUID is
6083 /// not supported (00000000-0000-0000-0000-000000000000).
6084 pub request_id: std::string::String,
6085
6086 /// Optional. If set, validate the request, but do not actually post it.
6087 pub validate_only: bool,
6088
6089 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6090}
6091
6092impl CreateGitRepositoryLinkRequest {
6093 /// Creates a new default instance.
6094 pub fn new() -> Self {
6095 std::default::Default::default()
6096 }
6097
6098 /// Sets the value of [parent][crate::model::CreateGitRepositoryLinkRequest::parent].
6099 ///
6100 /// # Example
6101 /// ```ignore,no_run
6102 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
6103 /// # let project_id = "project_id";
6104 /// # let location_id = "location_id";
6105 /// # let connection_id = "connection_id";
6106 /// let x = CreateGitRepositoryLinkRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
6107 /// ```
6108 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6109 self.parent = v.into();
6110 self
6111 }
6112
6113 /// Sets the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
6114 ///
6115 /// # Example
6116 /// ```ignore,no_run
6117 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
6118 /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
6119 /// let x = CreateGitRepositoryLinkRequest::new().set_git_repository_link(GitRepositoryLink::default()/* use setters */);
6120 /// ```
6121 pub fn set_git_repository_link<T>(mut self, v: T) -> Self
6122 where
6123 T: std::convert::Into<crate::model::GitRepositoryLink>,
6124 {
6125 self.git_repository_link = std::option::Option::Some(v.into());
6126 self
6127 }
6128
6129 /// Sets or clears the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
6130 ///
6131 /// # Example
6132 /// ```ignore,no_run
6133 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
6134 /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
6135 /// let x = CreateGitRepositoryLinkRequest::new().set_or_clear_git_repository_link(Some(GitRepositoryLink::default()/* use setters */));
6136 /// let x = CreateGitRepositoryLinkRequest::new().set_or_clear_git_repository_link(None::<GitRepositoryLink>);
6137 /// ```
6138 pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
6139 where
6140 T: std::convert::Into<crate::model::GitRepositoryLink>,
6141 {
6142 self.git_repository_link = v.map(|x| x.into());
6143 self
6144 }
6145
6146 /// Sets the value of [git_repository_link_id][crate::model::CreateGitRepositoryLinkRequest::git_repository_link_id].
6147 ///
6148 /// # Example
6149 /// ```ignore,no_run
6150 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
6151 /// let x = CreateGitRepositoryLinkRequest::new().set_git_repository_link_id("example");
6152 /// ```
6153 pub fn set_git_repository_link_id<T: std::convert::Into<std::string::String>>(
6154 mut self,
6155 v: T,
6156 ) -> Self {
6157 self.git_repository_link_id = v.into();
6158 self
6159 }
6160
6161 /// Sets the value of [request_id][crate::model::CreateGitRepositoryLinkRequest::request_id].
6162 ///
6163 /// # Example
6164 /// ```ignore,no_run
6165 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
6166 /// let x = CreateGitRepositoryLinkRequest::new().set_request_id("example");
6167 /// ```
6168 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6169 self.request_id = v.into();
6170 self
6171 }
6172
6173 /// Sets the value of [validate_only][crate::model::CreateGitRepositoryLinkRequest::validate_only].
6174 ///
6175 /// # Example
6176 /// ```ignore,no_run
6177 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
6178 /// let x = CreateGitRepositoryLinkRequest::new().set_validate_only(true);
6179 /// ```
6180 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6181 self.validate_only = v.into();
6182 self
6183 }
6184}
6185
6186impl wkt::message::Message for CreateGitRepositoryLinkRequest {
6187 fn typename() -> &'static str {
6188 "type.googleapis.com/google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest"
6189 }
6190}
6191
6192/// Message for deleting a GitRepositoryLink
6193#[derive(Clone, Default, PartialEq)]
6194#[non_exhaustive]
6195pub struct DeleteGitRepositoryLinkRequest {
6196 /// Required. Name of the resource
6197 pub name: std::string::String,
6198
6199 /// Optional. An optional request ID to identify requests. Specify a unique
6200 /// request ID so that if you must retry your request, the server will know to
6201 /// ignore the request if it has already been completed. The server will
6202 /// guarantee that for at least 60 minutes after the first request.
6203 ///
6204 /// For example, consider a situation where you make an initial request and the
6205 /// request times out. If you make the request again with the same request
6206 /// ID, the server can check if original operation with the same request ID
6207 /// was received, and if so, will ignore the second request. This prevents
6208 /// clients from accidentally creating duplicate commitments.
6209 ///
6210 /// The request ID must be a valid UUID with the exception that zero UUID is
6211 /// not supported (00000000-0000-0000-0000-000000000000).
6212 pub request_id: std::string::String,
6213
6214 /// Optional. If set, validate the request, but do not actually post it.
6215 pub validate_only: bool,
6216
6217 /// Optional. This checksum is computed by the server based on the value of
6218 /// other fields, and may be sent on update and delete requests to ensure the
6219 /// client has an up-to-date value before proceeding.
6220 pub etag: std::string::String,
6221
6222 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6223}
6224
6225impl DeleteGitRepositoryLinkRequest {
6226 /// Creates a new default instance.
6227 pub fn new() -> Self {
6228 std::default::Default::default()
6229 }
6230
6231 /// Sets the value of [name][crate::model::DeleteGitRepositoryLinkRequest::name].
6232 ///
6233 /// # Example
6234 /// ```ignore,no_run
6235 /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
6236 /// # let project_id = "project_id";
6237 /// # let location_id = "location_id";
6238 /// # let connection_id = "connection_id";
6239 /// # let git_repository_link_id = "git_repository_link_id";
6240 /// let x = DeleteGitRepositoryLinkRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
6241 /// ```
6242 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6243 self.name = v.into();
6244 self
6245 }
6246
6247 /// Sets the value of [request_id][crate::model::DeleteGitRepositoryLinkRequest::request_id].
6248 ///
6249 /// # Example
6250 /// ```ignore,no_run
6251 /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
6252 /// let x = DeleteGitRepositoryLinkRequest::new().set_request_id("example");
6253 /// ```
6254 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6255 self.request_id = v.into();
6256 self
6257 }
6258
6259 /// Sets the value of [validate_only][crate::model::DeleteGitRepositoryLinkRequest::validate_only].
6260 ///
6261 /// # Example
6262 /// ```ignore,no_run
6263 /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
6264 /// let x = DeleteGitRepositoryLinkRequest::new().set_validate_only(true);
6265 /// ```
6266 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6267 self.validate_only = v.into();
6268 self
6269 }
6270
6271 /// Sets the value of [etag][crate::model::DeleteGitRepositoryLinkRequest::etag].
6272 ///
6273 /// # Example
6274 /// ```ignore,no_run
6275 /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
6276 /// let x = DeleteGitRepositoryLinkRequest::new().set_etag("example");
6277 /// ```
6278 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6279 self.etag = v.into();
6280 self
6281 }
6282}
6283
6284impl wkt::message::Message for DeleteGitRepositoryLinkRequest {
6285 fn typename() -> &'static str {
6286 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest"
6287 }
6288}
6289
6290/// Message for requesting a list of GitRepositoryLinks
6291#[derive(Clone, Default, PartialEq)]
6292#[non_exhaustive]
6293pub struct ListGitRepositoryLinksRequest {
6294 /// Required. Parent value for ListGitRepositoryLinksRequest
6295 pub parent: std::string::String,
6296
6297 /// Optional. Requested page size. Server may return fewer items than
6298 /// requested. If unspecified, server will pick an appropriate default.
6299 pub page_size: i32,
6300
6301 /// Optional. A token identifying a page of results the server should return.
6302 pub page_token: std::string::String,
6303
6304 /// Optional. Filtering results
6305 pub filter: std::string::String,
6306
6307 /// Optional. Hint for how to order the results
6308 pub order_by: std::string::String,
6309
6310 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6311}
6312
6313impl ListGitRepositoryLinksRequest {
6314 /// Creates a new default instance.
6315 pub fn new() -> Self {
6316 std::default::Default::default()
6317 }
6318
6319 /// Sets the value of [parent][crate::model::ListGitRepositoryLinksRequest::parent].
6320 ///
6321 /// # Example
6322 /// ```ignore,no_run
6323 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6324 /// # let project_id = "project_id";
6325 /// # let location_id = "location_id";
6326 /// # let connection_id = "connection_id";
6327 /// let x = ListGitRepositoryLinksRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
6328 /// ```
6329 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6330 self.parent = v.into();
6331 self
6332 }
6333
6334 /// Sets the value of [page_size][crate::model::ListGitRepositoryLinksRequest::page_size].
6335 ///
6336 /// # Example
6337 /// ```ignore,no_run
6338 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6339 /// let x = ListGitRepositoryLinksRequest::new().set_page_size(42);
6340 /// ```
6341 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6342 self.page_size = v.into();
6343 self
6344 }
6345
6346 /// Sets the value of [page_token][crate::model::ListGitRepositoryLinksRequest::page_token].
6347 ///
6348 /// # Example
6349 /// ```ignore,no_run
6350 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6351 /// let x = ListGitRepositoryLinksRequest::new().set_page_token("example");
6352 /// ```
6353 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6354 self.page_token = v.into();
6355 self
6356 }
6357
6358 /// Sets the value of [filter][crate::model::ListGitRepositoryLinksRequest::filter].
6359 ///
6360 /// # Example
6361 /// ```ignore,no_run
6362 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6363 /// let x = ListGitRepositoryLinksRequest::new().set_filter("example");
6364 /// ```
6365 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6366 self.filter = v.into();
6367 self
6368 }
6369
6370 /// Sets the value of [order_by][crate::model::ListGitRepositoryLinksRequest::order_by].
6371 ///
6372 /// # Example
6373 /// ```ignore,no_run
6374 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6375 /// let x = ListGitRepositoryLinksRequest::new().set_order_by("example");
6376 /// ```
6377 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6378 self.order_by = v.into();
6379 self
6380 }
6381}
6382
6383impl wkt::message::Message for ListGitRepositoryLinksRequest {
6384 fn typename() -> &'static str {
6385 "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest"
6386 }
6387}
6388
6389/// Message for response to listing GitRepositoryLinks
6390#[derive(Clone, Default, PartialEq)]
6391#[non_exhaustive]
6392pub struct ListGitRepositoryLinksResponse {
6393 /// The list of GitRepositoryLinks
6394 pub git_repository_links: std::vec::Vec<crate::model::GitRepositoryLink>,
6395
6396 /// A token identifying a page of results the server should return.
6397 pub next_page_token: std::string::String,
6398
6399 /// Locations that could not be reached.
6400 pub unreachable: std::vec::Vec<std::string::String>,
6401
6402 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6403}
6404
6405impl ListGitRepositoryLinksResponse {
6406 /// Creates a new default instance.
6407 pub fn new() -> Self {
6408 std::default::Default::default()
6409 }
6410
6411 /// Sets the value of [git_repository_links][crate::model::ListGitRepositoryLinksResponse::git_repository_links].
6412 ///
6413 /// # Example
6414 /// ```ignore,no_run
6415 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
6416 /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
6417 /// let x = ListGitRepositoryLinksResponse::new()
6418 /// .set_git_repository_links([
6419 /// GitRepositoryLink::default()/* use setters */,
6420 /// GitRepositoryLink::default()/* use (different) setters */,
6421 /// ]);
6422 /// ```
6423 pub fn set_git_repository_links<T, V>(mut self, v: T) -> Self
6424 where
6425 T: std::iter::IntoIterator<Item = V>,
6426 V: std::convert::Into<crate::model::GitRepositoryLink>,
6427 {
6428 use std::iter::Iterator;
6429 self.git_repository_links = v.into_iter().map(|i| i.into()).collect();
6430 self
6431 }
6432
6433 /// Sets the value of [next_page_token][crate::model::ListGitRepositoryLinksResponse::next_page_token].
6434 ///
6435 /// # Example
6436 /// ```ignore,no_run
6437 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
6438 /// let x = ListGitRepositoryLinksResponse::new().set_next_page_token("example");
6439 /// ```
6440 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6441 self.next_page_token = v.into();
6442 self
6443 }
6444
6445 /// Sets the value of [unreachable][crate::model::ListGitRepositoryLinksResponse::unreachable].
6446 ///
6447 /// # Example
6448 /// ```ignore,no_run
6449 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
6450 /// let x = ListGitRepositoryLinksResponse::new().set_unreachable(["a", "b", "c"]);
6451 /// ```
6452 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6453 where
6454 T: std::iter::IntoIterator<Item = V>,
6455 V: std::convert::Into<std::string::String>,
6456 {
6457 use std::iter::Iterator;
6458 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6459 self
6460 }
6461}
6462
6463impl wkt::message::Message for ListGitRepositoryLinksResponse {
6464 fn typename() -> &'static str {
6465 "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksResponse"
6466 }
6467}
6468
6469#[doc(hidden)]
6470impl google_cloud_gax::paginator::internal::PageableResponse for ListGitRepositoryLinksResponse {
6471 type PageItem = crate::model::GitRepositoryLink;
6472
6473 fn items(self) -> std::vec::Vec<Self::PageItem> {
6474 self.git_repository_links
6475 }
6476
6477 fn next_page_token(&self) -> std::string::String {
6478 use std::clone::Clone;
6479 self.next_page_token.clone()
6480 }
6481}
6482
6483/// Message for getting a GitRepositoryLink
6484#[derive(Clone, Default, PartialEq)]
6485#[non_exhaustive]
6486pub struct GetGitRepositoryLinkRequest {
6487 /// Required. Name of the resource
6488 pub name: std::string::String,
6489
6490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6491}
6492
6493impl GetGitRepositoryLinkRequest {
6494 /// Creates a new default instance.
6495 pub fn new() -> Self {
6496 std::default::Default::default()
6497 }
6498
6499 /// Sets the value of [name][crate::model::GetGitRepositoryLinkRequest::name].
6500 ///
6501 /// # Example
6502 /// ```ignore,no_run
6503 /// # use google_cloud_developerconnect_v1::model::GetGitRepositoryLinkRequest;
6504 /// # let project_id = "project_id";
6505 /// # let location_id = "location_id";
6506 /// # let connection_id = "connection_id";
6507 /// # let git_repository_link_id = "git_repository_link_id";
6508 /// let x = GetGitRepositoryLinkRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
6509 /// ```
6510 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6511 self.name = v.into();
6512 self
6513 }
6514}
6515
6516impl wkt::message::Message for GetGitRepositoryLinkRequest {
6517 fn typename() -> &'static str {
6518 "type.googleapis.com/google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest"
6519 }
6520}
6521
6522/// Message for fetching SCM read/write token.
6523#[derive(Clone, Default, PartialEq)]
6524#[non_exhaustive]
6525pub struct FetchReadWriteTokenRequest {
6526 /// Required. The resource name of the gitRepositoryLink in the format
6527 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
6528 pub git_repository_link: std::string::String,
6529
6530 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6531}
6532
6533impl FetchReadWriteTokenRequest {
6534 /// Creates a new default instance.
6535 pub fn new() -> Self {
6536 std::default::Default::default()
6537 }
6538
6539 /// Sets the value of [git_repository_link][crate::model::FetchReadWriteTokenRequest::git_repository_link].
6540 ///
6541 /// # Example
6542 /// ```ignore,no_run
6543 /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenRequest;
6544 /// # let project_id = "project_id";
6545 /// # let location_id = "location_id";
6546 /// # let connection_id = "connection_id";
6547 /// # let git_repository_link_id = "git_repository_link_id";
6548 /// let x = FetchReadWriteTokenRequest::new().set_git_repository_link(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
6549 /// ```
6550 pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
6551 mut self,
6552 v: T,
6553 ) -> Self {
6554 self.git_repository_link = v.into();
6555 self
6556 }
6557}
6558
6559impl wkt::message::Message for FetchReadWriteTokenRequest {
6560 fn typename() -> &'static str {
6561 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenRequest"
6562 }
6563}
6564
6565/// Message for fetching SCM read token.
6566#[derive(Clone, Default, PartialEq)]
6567#[non_exhaustive]
6568pub struct FetchReadTokenRequest {
6569 /// Required. The resource name of the gitRepositoryLink in the format
6570 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
6571 pub git_repository_link: std::string::String,
6572
6573 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6574}
6575
6576impl FetchReadTokenRequest {
6577 /// Creates a new default instance.
6578 pub fn new() -> Self {
6579 std::default::Default::default()
6580 }
6581
6582 /// Sets the value of [git_repository_link][crate::model::FetchReadTokenRequest::git_repository_link].
6583 ///
6584 /// # Example
6585 /// ```ignore,no_run
6586 /// # use google_cloud_developerconnect_v1::model::FetchReadTokenRequest;
6587 /// # let project_id = "project_id";
6588 /// # let location_id = "location_id";
6589 /// # let connection_id = "connection_id";
6590 /// # let git_repository_link_id = "git_repository_link_id";
6591 /// let x = FetchReadTokenRequest::new().set_git_repository_link(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
6592 /// ```
6593 pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
6594 mut self,
6595 v: T,
6596 ) -> Self {
6597 self.git_repository_link = v.into();
6598 self
6599 }
6600}
6601
6602impl wkt::message::Message for FetchReadTokenRequest {
6603 fn typename() -> &'static str {
6604 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenRequest"
6605 }
6606}
6607
6608/// Message for responding to get read token.
6609#[derive(Clone, Default, PartialEq)]
6610#[non_exhaustive]
6611pub struct FetchReadTokenResponse {
6612 /// The token content.
6613 pub token: std::string::String,
6614
6615 /// Expiration timestamp. Can be empty if unknown or non-expiring.
6616 pub expiration_time: std::option::Option<wkt::Timestamp>,
6617
6618 /// The git_username to specify when making a git clone with the
6619 /// token. For example, for GitHub GitRepositoryLinks, this would be
6620 /// "x-access-token"
6621 pub git_username: std::string::String,
6622
6623 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6624}
6625
6626impl FetchReadTokenResponse {
6627 /// Creates a new default instance.
6628 pub fn new() -> Self {
6629 std::default::Default::default()
6630 }
6631
6632 /// Sets the value of [token][crate::model::FetchReadTokenResponse::token].
6633 ///
6634 /// # Example
6635 /// ```ignore,no_run
6636 /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6637 /// let x = FetchReadTokenResponse::new().set_token("example");
6638 /// ```
6639 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6640 self.token = v.into();
6641 self
6642 }
6643
6644 /// Sets the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
6645 ///
6646 /// # Example
6647 /// ```ignore,no_run
6648 /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6649 /// use wkt::Timestamp;
6650 /// let x = FetchReadTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
6651 /// ```
6652 pub fn set_expiration_time<T>(mut self, v: T) -> Self
6653 where
6654 T: std::convert::Into<wkt::Timestamp>,
6655 {
6656 self.expiration_time = std::option::Option::Some(v.into());
6657 self
6658 }
6659
6660 /// Sets or clears the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
6661 ///
6662 /// # Example
6663 /// ```ignore,no_run
6664 /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6665 /// use wkt::Timestamp;
6666 /// let x = FetchReadTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
6667 /// let x = FetchReadTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
6668 /// ```
6669 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
6670 where
6671 T: std::convert::Into<wkt::Timestamp>,
6672 {
6673 self.expiration_time = v.map(|x| x.into());
6674 self
6675 }
6676
6677 /// Sets the value of [git_username][crate::model::FetchReadTokenResponse::git_username].
6678 ///
6679 /// # Example
6680 /// ```ignore,no_run
6681 /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6682 /// let x = FetchReadTokenResponse::new().set_git_username("example");
6683 /// ```
6684 pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6685 self.git_username = v.into();
6686 self
6687 }
6688}
6689
6690impl wkt::message::Message for FetchReadTokenResponse {
6691 fn typename() -> &'static str {
6692 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenResponse"
6693 }
6694}
6695
6696/// Message for responding to get read/write token.
6697#[derive(Clone, Default, PartialEq)]
6698#[non_exhaustive]
6699pub struct FetchReadWriteTokenResponse {
6700 /// The token content.
6701 pub token: std::string::String,
6702
6703 /// Expiration timestamp. Can be empty if unknown or non-expiring.
6704 pub expiration_time: std::option::Option<wkt::Timestamp>,
6705
6706 /// The git_username to specify when making a git clone with the
6707 /// token. For example, for GitHub GitRepositoryLinks, this would be
6708 /// "x-access-token"
6709 pub git_username: std::string::String,
6710
6711 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6712}
6713
6714impl FetchReadWriteTokenResponse {
6715 /// Creates a new default instance.
6716 pub fn new() -> Self {
6717 std::default::Default::default()
6718 }
6719
6720 /// Sets the value of [token][crate::model::FetchReadWriteTokenResponse::token].
6721 ///
6722 /// # Example
6723 /// ```ignore,no_run
6724 /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6725 /// let x = FetchReadWriteTokenResponse::new().set_token("example");
6726 /// ```
6727 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6728 self.token = v.into();
6729 self
6730 }
6731
6732 /// Sets the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
6733 ///
6734 /// # Example
6735 /// ```ignore,no_run
6736 /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6737 /// use wkt::Timestamp;
6738 /// let x = FetchReadWriteTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
6739 /// ```
6740 pub fn set_expiration_time<T>(mut self, v: T) -> Self
6741 where
6742 T: std::convert::Into<wkt::Timestamp>,
6743 {
6744 self.expiration_time = std::option::Option::Some(v.into());
6745 self
6746 }
6747
6748 /// Sets or clears the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
6749 ///
6750 /// # Example
6751 /// ```ignore,no_run
6752 /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6753 /// use wkt::Timestamp;
6754 /// let x = FetchReadWriteTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
6755 /// let x = FetchReadWriteTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
6756 /// ```
6757 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
6758 where
6759 T: std::convert::Into<wkt::Timestamp>,
6760 {
6761 self.expiration_time = v.map(|x| x.into());
6762 self
6763 }
6764
6765 /// Sets the value of [git_username][crate::model::FetchReadWriteTokenResponse::git_username].
6766 ///
6767 /// # Example
6768 /// ```ignore,no_run
6769 /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6770 /// let x = FetchReadWriteTokenResponse::new().set_git_username("example");
6771 /// ```
6772 pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6773 self.git_username = v.into();
6774 self
6775 }
6776}
6777
6778impl wkt::message::Message for FetchReadWriteTokenResponse {
6779 fn typename() -> &'static str {
6780 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenResponse"
6781 }
6782}
6783
6784/// Message for opening SCM Pull Request.
6785#[derive(Clone, Default, PartialEq)]
6786#[non_exhaustive]
6787pub struct OpenGitRepositoryLinkPullRequestRequest {
6788 /// Required. The GitRepositoryLink resource name in the format
6789 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
6790 pub name: std::string::String,
6791
6792 /// Required. The Pull Request details to open.
6793 /// Input fields used: title, body, head_ref, base_ref.
6794 pub pull_request: std::option::Option<crate::model::PullRequest>,
6795
6796 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6797}
6798
6799impl OpenGitRepositoryLinkPullRequestRequest {
6800 /// Creates a new default instance.
6801 pub fn new() -> Self {
6802 std::default::Default::default()
6803 }
6804
6805 /// Sets the value of [name][crate::model::OpenGitRepositoryLinkPullRequestRequest::name].
6806 ///
6807 /// # Example
6808 /// ```ignore,no_run
6809 /// # use google_cloud_developerconnect_v1::model::OpenGitRepositoryLinkPullRequestRequest;
6810 /// # let project_id = "project_id";
6811 /// # let location_id = "location_id";
6812 /// # let connection_id = "connection_id";
6813 /// # let git_repository_link_id = "git_repository_link_id";
6814 /// let x = OpenGitRepositoryLinkPullRequestRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
6815 /// ```
6816 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6817 self.name = v.into();
6818 self
6819 }
6820
6821 /// Sets the value of [pull_request][crate::model::OpenGitRepositoryLinkPullRequestRequest::pull_request].
6822 ///
6823 /// # Example
6824 /// ```ignore,no_run
6825 /// # use google_cloud_developerconnect_v1::model::OpenGitRepositoryLinkPullRequestRequest;
6826 /// use google_cloud_developerconnect_v1::model::PullRequest;
6827 /// let x = OpenGitRepositoryLinkPullRequestRequest::new().set_pull_request(PullRequest::default()/* use setters */);
6828 /// ```
6829 pub fn set_pull_request<T>(mut self, v: T) -> Self
6830 where
6831 T: std::convert::Into<crate::model::PullRequest>,
6832 {
6833 self.pull_request = std::option::Option::Some(v.into());
6834 self
6835 }
6836
6837 /// Sets or clears the value of [pull_request][crate::model::OpenGitRepositoryLinkPullRequestRequest::pull_request].
6838 ///
6839 /// # Example
6840 /// ```ignore,no_run
6841 /// # use google_cloud_developerconnect_v1::model::OpenGitRepositoryLinkPullRequestRequest;
6842 /// use google_cloud_developerconnect_v1::model::PullRequest;
6843 /// let x = OpenGitRepositoryLinkPullRequestRequest::new().set_or_clear_pull_request(Some(PullRequest::default()/* use setters */));
6844 /// let x = OpenGitRepositoryLinkPullRequestRequest::new().set_or_clear_pull_request(None::<PullRequest>);
6845 /// ```
6846 pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
6847 where
6848 T: std::convert::Into<crate::model::PullRequest>,
6849 {
6850 self.pull_request = v.map(|x| x.into());
6851 self
6852 }
6853}
6854
6855impl wkt::message::Message for OpenGitRepositoryLinkPullRequestRequest {
6856 fn typename() -> &'static str {
6857 "type.googleapis.com/google.cloud.developerconnect.v1.OpenGitRepositoryLinkPullRequestRequest"
6858 }
6859}
6860
6861/// Request message for FetchLinkableGitRepositoriesRequest.
6862#[derive(Clone, Default, PartialEq)]
6863#[non_exhaustive]
6864pub struct FetchLinkableGitRepositoriesRequest {
6865 /// Required. The name of the Connection.
6866 /// Format: `projects/*/locations/*/connections/*`.
6867 pub connection: std::string::String,
6868
6869 /// Optional. Number of results to return in the list. Defaults to 20.
6870 pub page_size: i32,
6871
6872 /// Optional. Page start.
6873 pub page_token: std::string::String,
6874
6875 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6876}
6877
6878impl FetchLinkableGitRepositoriesRequest {
6879 /// Creates a new default instance.
6880 pub fn new() -> Self {
6881 std::default::Default::default()
6882 }
6883
6884 /// Sets the value of [connection][crate::model::FetchLinkableGitRepositoriesRequest::connection].
6885 ///
6886 /// # Example
6887 /// ```ignore,no_run
6888 /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
6889 /// # let project_id = "project_id";
6890 /// # let location_id = "location_id";
6891 /// # let connection_id = "connection_id";
6892 /// let x = FetchLinkableGitRepositoriesRequest::new().set_connection(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
6893 /// ```
6894 pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6895 self.connection = v.into();
6896 self
6897 }
6898
6899 /// Sets the value of [page_size][crate::model::FetchLinkableGitRepositoriesRequest::page_size].
6900 ///
6901 /// # Example
6902 /// ```ignore,no_run
6903 /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
6904 /// let x = FetchLinkableGitRepositoriesRequest::new().set_page_size(42);
6905 /// ```
6906 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6907 self.page_size = v.into();
6908 self
6909 }
6910
6911 /// Sets the value of [page_token][crate::model::FetchLinkableGitRepositoriesRequest::page_token].
6912 ///
6913 /// # Example
6914 /// ```ignore,no_run
6915 /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
6916 /// let x = FetchLinkableGitRepositoriesRequest::new().set_page_token("example");
6917 /// ```
6918 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6919 self.page_token = v.into();
6920 self
6921 }
6922}
6923
6924impl wkt::message::Message for FetchLinkableGitRepositoriesRequest {
6925 fn typename() -> &'static str {
6926 "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest"
6927 }
6928}
6929
6930/// Response message for FetchLinkableGitRepositories.
6931#[derive(Clone, Default, PartialEq)]
6932#[non_exhaustive]
6933pub struct FetchLinkableGitRepositoriesResponse {
6934 /// The git repositories that can be linked to the connection.
6935 pub linkable_git_repositories: std::vec::Vec<crate::model::LinkableGitRepository>,
6936
6937 /// A token identifying a page of results the server should return.
6938 pub next_page_token: std::string::String,
6939
6940 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6941}
6942
6943impl FetchLinkableGitRepositoriesResponse {
6944 /// Creates a new default instance.
6945 pub fn new() -> Self {
6946 std::default::Default::default()
6947 }
6948
6949 /// Sets the value of [linkable_git_repositories][crate::model::FetchLinkableGitRepositoriesResponse::linkable_git_repositories].
6950 ///
6951 /// # Example
6952 /// ```ignore,no_run
6953 /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesResponse;
6954 /// use google_cloud_developerconnect_v1::model::LinkableGitRepository;
6955 /// let x = FetchLinkableGitRepositoriesResponse::new()
6956 /// .set_linkable_git_repositories([
6957 /// LinkableGitRepository::default()/* use setters */,
6958 /// LinkableGitRepository::default()/* use (different) setters */,
6959 /// ]);
6960 /// ```
6961 pub fn set_linkable_git_repositories<T, V>(mut self, v: T) -> Self
6962 where
6963 T: std::iter::IntoIterator<Item = V>,
6964 V: std::convert::Into<crate::model::LinkableGitRepository>,
6965 {
6966 use std::iter::Iterator;
6967 self.linkable_git_repositories = v.into_iter().map(|i| i.into()).collect();
6968 self
6969 }
6970
6971 /// Sets the value of [next_page_token][crate::model::FetchLinkableGitRepositoriesResponse::next_page_token].
6972 ///
6973 /// # Example
6974 /// ```ignore,no_run
6975 /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesResponse;
6976 /// let x = FetchLinkableGitRepositoriesResponse::new().set_next_page_token("example");
6977 /// ```
6978 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6979 self.next_page_token = v.into();
6980 self
6981 }
6982}
6983
6984impl wkt::message::Message for FetchLinkableGitRepositoriesResponse {
6985 fn typename() -> &'static str {
6986 "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesResponse"
6987 }
6988}
6989
6990#[doc(hidden)]
6991impl google_cloud_gax::paginator::internal::PageableResponse
6992 for FetchLinkableGitRepositoriesResponse
6993{
6994 type PageItem = crate::model::LinkableGitRepository;
6995
6996 fn items(self) -> std::vec::Vec<Self::PageItem> {
6997 self.linkable_git_repositories
6998 }
6999
7000 fn next_page_token(&self) -> std::string::String {
7001 use std::clone::Clone;
7002 self.next_page_token.clone()
7003 }
7004}
7005
7006/// LinkableGitRepository represents a git repository that can be linked to a
7007/// connection.
7008#[derive(Clone, Default, PartialEq)]
7009#[non_exhaustive]
7010pub struct LinkableGitRepository {
7011 /// The clone uri of the repository.
7012 pub clone_uri: std::string::String,
7013
7014 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7015}
7016
7017impl LinkableGitRepository {
7018 /// Creates a new default instance.
7019 pub fn new() -> Self {
7020 std::default::Default::default()
7021 }
7022
7023 /// Sets the value of [clone_uri][crate::model::LinkableGitRepository::clone_uri].
7024 ///
7025 /// # Example
7026 /// ```ignore,no_run
7027 /// # use google_cloud_developerconnect_v1::model::LinkableGitRepository;
7028 /// let x = LinkableGitRepository::new().set_clone_uri("example");
7029 /// ```
7030 pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7031 self.clone_uri = v.into();
7032 self
7033 }
7034}
7035
7036impl wkt::message::Message for LinkableGitRepository {
7037 fn typename() -> &'static str {
7038 "type.googleapis.com/google.cloud.developerconnect.v1.LinkableGitRepository"
7039 }
7040}
7041
7042/// Request for fetching github installations.
7043#[derive(Clone, Default, PartialEq)]
7044#[non_exhaustive]
7045pub struct FetchGitHubInstallationsRequest {
7046 /// Required. The resource name of the connection in the format
7047 /// `projects/*/locations/*/connections/*`.
7048 pub connection: std::string::String,
7049
7050 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7051}
7052
7053impl FetchGitHubInstallationsRequest {
7054 /// Creates a new default instance.
7055 pub fn new() -> Self {
7056 std::default::Default::default()
7057 }
7058
7059 /// Sets the value of [connection][crate::model::FetchGitHubInstallationsRequest::connection].
7060 ///
7061 /// # Example
7062 /// ```ignore,no_run
7063 /// # use google_cloud_developerconnect_v1::model::FetchGitHubInstallationsRequest;
7064 /// # let project_id = "project_id";
7065 /// # let location_id = "location_id";
7066 /// # let connection_id = "connection_id";
7067 /// let x = FetchGitHubInstallationsRequest::new().set_connection(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
7068 /// ```
7069 pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7070 self.connection = v.into();
7071 self
7072 }
7073}
7074
7075impl wkt::message::Message for FetchGitHubInstallationsRequest {
7076 fn typename() -> &'static str {
7077 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest"
7078 }
7079}
7080
7081/// Response of fetching github installations.
7082#[derive(Clone, Default, PartialEq)]
7083#[non_exhaustive]
7084pub struct FetchGitHubInstallationsResponse {
7085 /// List of installations available to the OAuth user (for github.com)
7086 /// or all the installations (for GitHub enterprise).
7087 pub installations:
7088 std::vec::Vec<crate::model::fetch_git_hub_installations_response::Installation>,
7089
7090 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7091}
7092
7093impl FetchGitHubInstallationsResponse {
7094 /// Creates a new default instance.
7095 pub fn new() -> Self {
7096 std::default::Default::default()
7097 }
7098
7099 /// Sets the value of [installations][crate::model::FetchGitHubInstallationsResponse::installations].
7100 ///
7101 /// # Example
7102 /// ```ignore,no_run
7103 /// # use google_cloud_developerconnect_v1::model::FetchGitHubInstallationsResponse;
7104 /// use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
7105 /// let x = FetchGitHubInstallationsResponse::new()
7106 /// .set_installations([
7107 /// Installation::default()/* use setters */,
7108 /// Installation::default()/* use (different) setters */,
7109 /// ]);
7110 /// ```
7111 pub fn set_installations<T, V>(mut self, v: T) -> Self
7112 where
7113 T: std::iter::IntoIterator<Item = V>,
7114 V: std::convert::Into<crate::model::fetch_git_hub_installations_response::Installation>,
7115 {
7116 use std::iter::Iterator;
7117 self.installations = v.into_iter().map(|i| i.into()).collect();
7118 self
7119 }
7120}
7121
7122impl wkt::message::Message for FetchGitHubInstallationsResponse {
7123 fn typename() -> &'static str {
7124 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse"
7125 }
7126}
7127
7128/// Defines additional types related to [FetchGitHubInstallationsResponse].
7129pub mod fetch_git_hub_installations_response {
7130 #[allow(unused_imports)]
7131 use super::*;
7132
7133 /// Represents an installation of the GitHub App.
7134 #[derive(Clone, Default, PartialEq)]
7135 #[non_exhaustive]
7136 pub struct Installation {
7137 /// ID of the installation in GitHub.
7138 pub id: i64,
7139
7140 /// Name of the GitHub user or organization that owns this installation.
7141 pub name: std::string::String,
7142
7143 /// Either "user" or "organization".
7144 pub r#type: std::string::String,
7145
7146 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7147 }
7148
7149 impl Installation {
7150 /// Creates a new default instance.
7151 pub fn new() -> Self {
7152 std::default::Default::default()
7153 }
7154
7155 /// Sets the value of [id][crate::model::fetch_git_hub_installations_response::Installation::id].
7156 ///
7157 /// # Example
7158 /// ```ignore,no_run
7159 /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
7160 /// let x = Installation::new().set_id(42);
7161 /// ```
7162 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7163 self.id = v.into();
7164 self
7165 }
7166
7167 /// Sets the value of [name][crate::model::fetch_git_hub_installations_response::Installation::name].
7168 ///
7169 /// # Example
7170 /// ```ignore,no_run
7171 /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
7172 /// let x = Installation::new().set_name("example");
7173 /// ```
7174 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7175 self.name = v.into();
7176 self
7177 }
7178
7179 /// Sets the value of [r#type][crate::model::fetch_git_hub_installations_response::Installation::type].
7180 ///
7181 /// # Example
7182 /// ```ignore,no_run
7183 /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
7184 /// let x = Installation::new().set_type("example");
7185 /// ```
7186 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7187 self.r#type = v.into();
7188 self
7189 }
7190 }
7191
7192 impl wkt::message::Message for Installation {
7193 fn typename() -> &'static str {
7194 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation"
7195 }
7196 }
7197}
7198
7199/// Request for fetching git refs.
7200#[derive(Clone, Default, PartialEq)]
7201#[non_exhaustive]
7202pub struct FetchGitRefsRequest {
7203 /// Required. The resource name of GitRepositoryLink in the format
7204 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
7205 pub git_repository_link: std::string::String,
7206
7207 /// Required. Type of refs to fetch.
7208 pub ref_type: crate::model::fetch_git_refs_request::RefType,
7209
7210 /// Optional. Number of results to return in the list. Default to 20.
7211 pub page_size: i32,
7212
7213 /// Optional. Page start.
7214 pub page_token: std::string::String,
7215
7216 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7217}
7218
7219impl FetchGitRefsRequest {
7220 /// Creates a new default instance.
7221 pub fn new() -> Self {
7222 std::default::Default::default()
7223 }
7224
7225 /// Sets the value of [git_repository_link][crate::model::FetchGitRefsRequest::git_repository_link].
7226 ///
7227 /// # Example
7228 /// ```ignore,no_run
7229 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
7230 /// # let project_id = "project_id";
7231 /// # let location_id = "location_id";
7232 /// # let connection_id = "connection_id";
7233 /// # let git_repository_link_id = "git_repository_link_id";
7234 /// let x = FetchGitRefsRequest::new().set_git_repository_link(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
7235 /// ```
7236 pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
7237 mut self,
7238 v: T,
7239 ) -> Self {
7240 self.git_repository_link = v.into();
7241 self
7242 }
7243
7244 /// Sets the value of [ref_type][crate::model::FetchGitRefsRequest::ref_type].
7245 ///
7246 /// # Example
7247 /// ```ignore,no_run
7248 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
7249 /// use google_cloud_developerconnect_v1::model::fetch_git_refs_request::RefType;
7250 /// let x0 = FetchGitRefsRequest::new().set_ref_type(RefType::Tag);
7251 /// let x1 = FetchGitRefsRequest::new().set_ref_type(RefType::Branch);
7252 /// ```
7253 pub fn set_ref_type<T: std::convert::Into<crate::model::fetch_git_refs_request::RefType>>(
7254 mut self,
7255 v: T,
7256 ) -> Self {
7257 self.ref_type = v.into();
7258 self
7259 }
7260
7261 /// Sets the value of [page_size][crate::model::FetchGitRefsRequest::page_size].
7262 ///
7263 /// # Example
7264 /// ```ignore,no_run
7265 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
7266 /// let x = FetchGitRefsRequest::new().set_page_size(42);
7267 /// ```
7268 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7269 self.page_size = v.into();
7270 self
7271 }
7272
7273 /// Sets the value of [page_token][crate::model::FetchGitRefsRequest::page_token].
7274 ///
7275 /// # Example
7276 /// ```ignore,no_run
7277 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
7278 /// let x = FetchGitRefsRequest::new().set_page_token("example");
7279 /// ```
7280 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7281 self.page_token = v.into();
7282 self
7283 }
7284}
7285
7286impl wkt::message::Message for FetchGitRefsRequest {
7287 fn typename() -> &'static str {
7288 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsRequest"
7289 }
7290}
7291
7292/// Defines additional types related to [FetchGitRefsRequest].
7293pub mod fetch_git_refs_request {
7294 #[allow(unused_imports)]
7295 use super::*;
7296
7297 /// Type of refs.
7298 ///
7299 /// # Working with unknown values
7300 ///
7301 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7302 /// additional enum variants at any time. Adding new variants is not considered
7303 /// a breaking change. Applications should write their code in anticipation of:
7304 ///
7305 /// - New values appearing in future releases of the client library, **and**
7306 /// - New values received dynamically, without application changes.
7307 ///
7308 /// Please consult the [Working with enums] section in the user guide for some
7309 /// guidelines.
7310 ///
7311 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7312 #[derive(Clone, Debug, PartialEq)]
7313 #[non_exhaustive]
7314 pub enum RefType {
7315 /// No type specified.
7316 Unspecified,
7317 /// To fetch tags.
7318 Tag,
7319 /// To fetch branches.
7320 Branch,
7321 /// If set, the enum was initialized with an unknown value.
7322 ///
7323 /// Applications can examine the value using [RefType::value] or
7324 /// [RefType::name].
7325 UnknownValue(ref_type::UnknownValue),
7326 }
7327
7328 #[doc(hidden)]
7329 pub mod ref_type {
7330 #[allow(unused_imports)]
7331 use super::*;
7332 #[derive(Clone, Debug, PartialEq)]
7333 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7334 }
7335
7336 impl RefType {
7337 /// Gets the enum value.
7338 ///
7339 /// Returns `None` if the enum contains an unknown value deserialized from
7340 /// the string representation of enums.
7341 pub fn value(&self) -> std::option::Option<i32> {
7342 match self {
7343 Self::Unspecified => std::option::Option::Some(0),
7344 Self::Tag => std::option::Option::Some(1),
7345 Self::Branch => std::option::Option::Some(2),
7346 Self::UnknownValue(u) => u.0.value(),
7347 }
7348 }
7349
7350 /// Gets the enum value as a string.
7351 ///
7352 /// Returns `None` if the enum contains an unknown value deserialized from
7353 /// the integer representation of enums.
7354 pub fn name(&self) -> std::option::Option<&str> {
7355 match self {
7356 Self::Unspecified => std::option::Option::Some("REF_TYPE_UNSPECIFIED"),
7357 Self::Tag => std::option::Option::Some("TAG"),
7358 Self::Branch => std::option::Option::Some("BRANCH"),
7359 Self::UnknownValue(u) => u.0.name(),
7360 }
7361 }
7362 }
7363
7364 impl std::default::Default for RefType {
7365 fn default() -> Self {
7366 use std::convert::From;
7367 Self::from(0)
7368 }
7369 }
7370
7371 impl std::fmt::Display for RefType {
7372 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7373 wkt::internal::display_enum(f, self.name(), self.value())
7374 }
7375 }
7376
7377 impl std::convert::From<i32> for RefType {
7378 fn from(value: i32) -> Self {
7379 match value {
7380 0 => Self::Unspecified,
7381 1 => Self::Tag,
7382 2 => Self::Branch,
7383 _ => Self::UnknownValue(ref_type::UnknownValue(
7384 wkt::internal::UnknownEnumValue::Integer(value),
7385 )),
7386 }
7387 }
7388 }
7389
7390 impl std::convert::From<&str> for RefType {
7391 fn from(value: &str) -> Self {
7392 use std::string::ToString;
7393 match value {
7394 "REF_TYPE_UNSPECIFIED" => Self::Unspecified,
7395 "TAG" => Self::Tag,
7396 "BRANCH" => Self::Branch,
7397 _ => Self::UnknownValue(ref_type::UnknownValue(
7398 wkt::internal::UnknownEnumValue::String(value.to_string()),
7399 )),
7400 }
7401 }
7402 }
7403
7404 impl serde::ser::Serialize for RefType {
7405 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7406 where
7407 S: serde::Serializer,
7408 {
7409 match self {
7410 Self::Unspecified => serializer.serialize_i32(0),
7411 Self::Tag => serializer.serialize_i32(1),
7412 Self::Branch => serializer.serialize_i32(2),
7413 Self::UnknownValue(u) => u.0.serialize(serializer),
7414 }
7415 }
7416 }
7417
7418 impl<'de> serde::de::Deserialize<'de> for RefType {
7419 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7420 where
7421 D: serde::Deserializer<'de>,
7422 {
7423 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RefType>::new(
7424 ".google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType",
7425 ))
7426 }
7427 }
7428}
7429
7430/// Response for fetching git refs.
7431#[derive(Clone, Default, PartialEq)]
7432#[non_exhaustive]
7433pub struct FetchGitRefsResponse {
7434 /// Name of the refs fetched.
7435 pub ref_names: std::vec::Vec<std::string::String>,
7436
7437 /// A token identifying a page of results the server should return.
7438 pub next_page_token: std::string::String,
7439
7440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7441}
7442
7443impl FetchGitRefsResponse {
7444 /// Creates a new default instance.
7445 pub fn new() -> Self {
7446 std::default::Default::default()
7447 }
7448
7449 /// Sets the value of [ref_names][crate::model::FetchGitRefsResponse::ref_names].
7450 ///
7451 /// # Example
7452 /// ```ignore,no_run
7453 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsResponse;
7454 /// let x = FetchGitRefsResponse::new().set_ref_names(["a", "b", "c"]);
7455 /// ```
7456 pub fn set_ref_names<T, V>(mut self, v: T) -> Self
7457 where
7458 T: std::iter::IntoIterator<Item = V>,
7459 V: std::convert::Into<std::string::String>,
7460 {
7461 use std::iter::Iterator;
7462 self.ref_names = v.into_iter().map(|i| i.into()).collect();
7463 self
7464 }
7465
7466 /// Sets the value of [next_page_token][crate::model::FetchGitRefsResponse::next_page_token].
7467 ///
7468 /// # Example
7469 /// ```ignore,no_run
7470 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsResponse;
7471 /// let x = FetchGitRefsResponse::new().set_next_page_token("example");
7472 /// ```
7473 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7474 self.next_page_token = v.into();
7475 self
7476 }
7477}
7478
7479impl wkt::message::Message for FetchGitRefsResponse {
7480 fn typename() -> &'static str {
7481 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsResponse"
7482 }
7483}
7484
7485/// Request message for FetchGitRepositoryLinkCommit.
7486#[derive(Clone, Default, PartialEq)]
7487#[non_exhaustive]
7488pub struct FetchGitRepositoryLinkCommitRequest {
7489 /// Required. The resource name of the GitRepositoryLink in the format
7490 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
7491 pub name: std::string::String,
7492
7493 /// Required. The commit SHA, or symbolic revision (e.g., branch name, tag, or
7494 /// Git reference).
7495 pub commit_sha: std::string::String,
7496
7497 /// Optional. The level of commit details to return in the response.
7498 /// Defaults to `FULL` if unspecified. In `FULL` view, `files` metadata (paths
7499 /// and statuses) are returned; `path_filters` must also be specified to
7500 /// populate line patch hunks.
7501 pub view: crate::model::CommitView,
7502
7503 /// Optional. Path patterns or exact paths to filter returned files (only
7504 /// applicable in `FULL` view).
7505 /// When `path_filters` is specified, `FileDiff.patch` is populated for all
7506 /// matching files (use `["**"]` to include patches for all changed files).
7507 /// When `path_filters` is omitted or empty, the full list of `FileDiff` is
7508 /// returned without patch diffs (`FileDiff.patch` is empty).
7509 pub path_filters: std::vec::Vec<std::string::String>,
7510
7511 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7512}
7513
7514impl FetchGitRepositoryLinkCommitRequest {
7515 /// Creates a new default instance.
7516 pub fn new() -> Self {
7517 std::default::Default::default()
7518 }
7519
7520 /// Sets the value of [name][crate::model::FetchGitRepositoryLinkCommitRequest::name].
7521 ///
7522 /// # Example
7523 /// ```ignore,no_run
7524 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkCommitRequest;
7525 /// # let project_id = "project_id";
7526 /// # let location_id = "location_id";
7527 /// # let connection_id = "connection_id";
7528 /// # let git_repository_link_id = "git_repository_link_id";
7529 /// let x = FetchGitRepositoryLinkCommitRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
7530 /// ```
7531 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7532 self.name = v.into();
7533 self
7534 }
7535
7536 /// Sets the value of [commit_sha][crate::model::FetchGitRepositoryLinkCommitRequest::commit_sha].
7537 ///
7538 /// # Example
7539 /// ```ignore,no_run
7540 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkCommitRequest;
7541 /// let x = FetchGitRepositoryLinkCommitRequest::new().set_commit_sha("example");
7542 /// ```
7543 pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7544 self.commit_sha = v.into();
7545 self
7546 }
7547
7548 /// Sets the value of [view][crate::model::FetchGitRepositoryLinkCommitRequest::view].
7549 ///
7550 /// # Example
7551 /// ```ignore,no_run
7552 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkCommitRequest;
7553 /// use google_cloud_developerconnect_v1::model::CommitView;
7554 /// let x0 = FetchGitRepositoryLinkCommitRequest::new().set_view(CommitView::Basic);
7555 /// let x1 = FetchGitRepositoryLinkCommitRequest::new().set_view(CommitView::Full);
7556 /// ```
7557 pub fn set_view<T: std::convert::Into<crate::model::CommitView>>(mut self, v: T) -> Self {
7558 self.view = v.into();
7559 self
7560 }
7561
7562 /// Sets the value of [path_filters][crate::model::FetchGitRepositoryLinkCommitRequest::path_filters].
7563 ///
7564 /// # Example
7565 /// ```ignore,no_run
7566 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkCommitRequest;
7567 /// let x = FetchGitRepositoryLinkCommitRequest::new().set_path_filters(["a", "b", "c"]);
7568 /// ```
7569 pub fn set_path_filters<T, V>(mut self, v: T) -> Self
7570 where
7571 T: std::iter::IntoIterator<Item = V>,
7572 V: std::convert::Into<std::string::String>,
7573 {
7574 use std::iter::Iterator;
7575 self.path_filters = v.into_iter().map(|i| i.into()).collect();
7576 self
7577 }
7578}
7579
7580impl wkt::message::Message for FetchGitRepositoryLinkCommitRequest {
7581 fn typename() -> &'static str {
7582 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRepositoryLinkCommitRequest"
7583 }
7584}
7585
7586/// Response message for FetchGitRepositoryLinkCommit.
7587#[derive(Clone, Default, PartialEq)]
7588#[non_exhaustive]
7589pub struct FetchGitRepositoryLinkCommitResponse {
7590 /// The commit metadata.
7591 pub commit: std::option::Option<crate::model::SCMCommit>,
7592
7593 /// List of file changes and patch diffs. Omitted when view is `BASIC`.
7594 /// Patch diffs (`FileDiff.patch`) are only populated when `path_filters` is
7595 /// specified in the request.
7596 pub files: std::vec::Vec<crate::model::FileDiff>,
7597
7598 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7599}
7600
7601impl FetchGitRepositoryLinkCommitResponse {
7602 /// Creates a new default instance.
7603 pub fn new() -> Self {
7604 std::default::Default::default()
7605 }
7606
7607 /// Sets the value of [commit][crate::model::FetchGitRepositoryLinkCommitResponse::commit].
7608 ///
7609 /// # Example
7610 /// ```ignore,no_run
7611 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkCommitResponse;
7612 /// use google_cloud_developerconnect_v1::model::SCMCommit;
7613 /// let x = FetchGitRepositoryLinkCommitResponse::new().set_commit(SCMCommit::default()/* use setters */);
7614 /// ```
7615 pub fn set_commit<T>(mut self, v: T) -> Self
7616 where
7617 T: std::convert::Into<crate::model::SCMCommit>,
7618 {
7619 self.commit = std::option::Option::Some(v.into());
7620 self
7621 }
7622
7623 /// Sets or clears the value of [commit][crate::model::FetchGitRepositoryLinkCommitResponse::commit].
7624 ///
7625 /// # Example
7626 /// ```ignore,no_run
7627 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkCommitResponse;
7628 /// use google_cloud_developerconnect_v1::model::SCMCommit;
7629 /// let x = FetchGitRepositoryLinkCommitResponse::new().set_or_clear_commit(Some(SCMCommit::default()/* use setters */));
7630 /// let x = FetchGitRepositoryLinkCommitResponse::new().set_or_clear_commit(None::<SCMCommit>);
7631 /// ```
7632 pub fn set_or_clear_commit<T>(mut self, v: std::option::Option<T>) -> Self
7633 where
7634 T: std::convert::Into<crate::model::SCMCommit>,
7635 {
7636 self.commit = v.map(|x| x.into());
7637 self
7638 }
7639
7640 /// Sets the value of [files][crate::model::FetchGitRepositoryLinkCommitResponse::files].
7641 ///
7642 /// # Example
7643 /// ```ignore,no_run
7644 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkCommitResponse;
7645 /// use google_cloud_developerconnect_v1::model::FileDiff;
7646 /// let x = FetchGitRepositoryLinkCommitResponse::new()
7647 /// .set_files([
7648 /// FileDiff::default()/* use setters */,
7649 /// FileDiff::default()/* use (different) setters */,
7650 /// ]);
7651 /// ```
7652 pub fn set_files<T, V>(mut self, v: T) -> Self
7653 where
7654 T: std::iter::IntoIterator<Item = V>,
7655 V: std::convert::Into<crate::model::FileDiff>,
7656 {
7657 use std::iter::Iterator;
7658 self.files = v.into_iter().map(|i| i.into()).collect();
7659 self
7660 }
7661}
7662
7663impl wkt::message::Message for FetchGitRepositoryLinkCommitResponse {
7664 fn typename() -> &'static str {
7665 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRepositoryLinkCommitResponse"
7666 }
7667}
7668
7669/// Request message for FetchGitRepositoryLinkCommitList.
7670#[derive(Clone, Default, PartialEq)]
7671#[non_exhaustive]
7672pub struct FetchGitRepositoryLinkCommitListRequest {
7673 /// Required. The resource name of the GitRepositoryLink in the format
7674 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
7675 pub name: std::string::String,
7676
7677 /// Optional. The commit SHA, or symbolic revision (e.g., branch name, tag, or
7678 /// Git reference) from which to start listing commits.
7679 pub r#ref: std::string::String,
7680
7681 /// Optional. Number of results to return in the list. Default is 50. Max is
7682 /// 100.
7683 pub page_size: i32,
7684
7685 /// Optional. A page token, received from a previous
7686 /// `FetchGitRepositoryLinkCommitList` call. Provide this to retrieve the
7687 /// subsequent page.
7688 ///
7689 /// When paginating, all other parameters provided to
7690 /// `FetchGitRepositoryLinkCommitList` must match the call that provided the
7691 /// page token.
7692 pub page_token: std::string::String,
7693
7694 /// Optional. The level of commit details to return in the response.
7695 /// Only `BASIC` is supported; `FULL` returns `INVALID_ARGUMENT`. Defaults to
7696 /// `BASIC` if unspecified. Use `FetchGitRepositoryLinkCommit` to get file
7697 /// diffs for a single commit.
7698 pub view: crate::model::CommitView,
7699
7700 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7701}
7702
7703impl FetchGitRepositoryLinkCommitListRequest {
7704 /// Creates a new default instance.
7705 pub fn new() -> Self {
7706 std::default::Default::default()
7707 }
7708
7709 /// Sets the value of [name][crate::model::FetchGitRepositoryLinkCommitListRequest::name].
7710 ///
7711 /// # Example
7712 /// ```ignore,no_run
7713 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkCommitListRequest;
7714 /// # let project_id = "project_id";
7715 /// # let location_id = "location_id";
7716 /// # let connection_id = "connection_id";
7717 /// # let git_repository_link_id = "git_repository_link_id";
7718 /// let x = FetchGitRepositoryLinkCommitListRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
7719 /// ```
7720 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7721 self.name = v.into();
7722 self
7723 }
7724
7725 /// Sets the value of [r#ref][crate::model::FetchGitRepositoryLinkCommitListRequest::ref].
7726 ///
7727 /// # Example
7728 /// ```ignore,no_run
7729 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkCommitListRequest;
7730 /// let x = FetchGitRepositoryLinkCommitListRequest::new().set_ref("example");
7731 /// ```
7732 pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7733 self.r#ref = v.into();
7734 self
7735 }
7736
7737 /// Sets the value of [page_size][crate::model::FetchGitRepositoryLinkCommitListRequest::page_size].
7738 ///
7739 /// # Example
7740 /// ```ignore,no_run
7741 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkCommitListRequest;
7742 /// let x = FetchGitRepositoryLinkCommitListRequest::new().set_page_size(42);
7743 /// ```
7744 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7745 self.page_size = v.into();
7746 self
7747 }
7748
7749 /// Sets the value of [page_token][crate::model::FetchGitRepositoryLinkCommitListRequest::page_token].
7750 ///
7751 /// # Example
7752 /// ```ignore,no_run
7753 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkCommitListRequest;
7754 /// let x = FetchGitRepositoryLinkCommitListRequest::new().set_page_token("example");
7755 /// ```
7756 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7757 self.page_token = v.into();
7758 self
7759 }
7760
7761 /// Sets the value of [view][crate::model::FetchGitRepositoryLinkCommitListRequest::view].
7762 ///
7763 /// # Example
7764 /// ```ignore,no_run
7765 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkCommitListRequest;
7766 /// use google_cloud_developerconnect_v1::model::CommitView;
7767 /// let x0 = FetchGitRepositoryLinkCommitListRequest::new().set_view(CommitView::Basic);
7768 /// let x1 = FetchGitRepositoryLinkCommitListRequest::new().set_view(CommitView::Full);
7769 /// ```
7770 pub fn set_view<T: std::convert::Into<crate::model::CommitView>>(mut self, v: T) -> Self {
7771 self.view = v.into();
7772 self
7773 }
7774}
7775
7776impl wkt::message::Message for FetchGitRepositoryLinkCommitListRequest {
7777 fn typename() -> &'static str {
7778 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRepositoryLinkCommitListRequest"
7779 }
7780}
7781
7782/// Response message for FetchGitRepositoryLinkCommitList.
7783#[derive(Clone, Default, PartialEq)]
7784#[non_exhaustive]
7785pub struct FetchGitRepositoryLinkCommitListResponse {
7786 /// The list of commit metadata.
7787 pub commits: std::vec::Vec<crate::model::SCMCommit>,
7788
7789 /// A token, which can be sent as `page_token` to retrieve the next page.
7790 /// If this field is omitted, there are no subsequent pages.
7791 pub next_page_token: std::string::String,
7792
7793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7794}
7795
7796impl FetchGitRepositoryLinkCommitListResponse {
7797 /// Creates a new default instance.
7798 pub fn new() -> Self {
7799 std::default::Default::default()
7800 }
7801
7802 /// Sets the value of [commits][crate::model::FetchGitRepositoryLinkCommitListResponse::commits].
7803 ///
7804 /// # Example
7805 /// ```ignore,no_run
7806 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkCommitListResponse;
7807 /// use google_cloud_developerconnect_v1::model::SCMCommit;
7808 /// let x = FetchGitRepositoryLinkCommitListResponse::new()
7809 /// .set_commits([
7810 /// SCMCommit::default()/* use setters */,
7811 /// SCMCommit::default()/* use (different) setters */,
7812 /// ]);
7813 /// ```
7814 pub fn set_commits<T, V>(mut self, v: T) -> Self
7815 where
7816 T: std::iter::IntoIterator<Item = V>,
7817 V: std::convert::Into<crate::model::SCMCommit>,
7818 {
7819 use std::iter::Iterator;
7820 self.commits = v.into_iter().map(|i| i.into()).collect();
7821 self
7822 }
7823
7824 /// Sets the value of [next_page_token][crate::model::FetchGitRepositoryLinkCommitListResponse::next_page_token].
7825 ///
7826 /// # Example
7827 /// ```ignore,no_run
7828 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkCommitListResponse;
7829 /// let x = FetchGitRepositoryLinkCommitListResponse::new().set_next_page_token("example");
7830 /// ```
7831 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7832 self.next_page_token = v.into();
7833 self
7834 }
7835}
7836
7837impl wkt::message::Message for FetchGitRepositoryLinkCommitListResponse {
7838 fn typename() -> &'static str {
7839 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRepositoryLinkCommitListResponse"
7840 }
7841}
7842
7843#[doc(hidden)]
7844impl google_cloud_gax::paginator::internal::PageableResponse
7845 for FetchGitRepositoryLinkCommitListResponse
7846{
7847 type PageItem = crate::model::SCMCommit;
7848
7849 fn items(self) -> std::vec::Vec<Self::PageItem> {
7850 self.commits
7851 }
7852
7853 fn next_page_token(&self) -> std::string::String {
7854 use std::clone::Clone;
7855 self.next_page_token.clone()
7856 }
7857}
7858
7859/// SCMCommit represents commit metadata.
7860#[derive(Clone, Default, PartialEq)]
7861#[non_exhaustive]
7862pub struct SCMCommit {
7863 /// Full 40-character SCM commit SHA.
7864 pub sha: std::string::String,
7865
7866 /// Commit message text.
7867 pub message: std::string::String,
7868
7869 /// The author's display name.
7870 pub author: std::string::String,
7871
7872 /// The author's email address.
7873 pub author_email: std::string::String,
7874
7875 /// Timestamp when the commit was authored.
7876 pub commit_time: std::option::Option<wkt::Timestamp>,
7877
7878 /// The SCM provider's HTML URL link for this commit.
7879 pub url: std::string::String,
7880
7881 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7882}
7883
7884impl SCMCommit {
7885 /// Creates a new default instance.
7886 pub fn new() -> Self {
7887 std::default::Default::default()
7888 }
7889
7890 /// Sets the value of [sha][crate::model::SCMCommit::sha].
7891 ///
7892 /// # Example
7893 /// ```ignore,no_run
7894 /// # use google_cloud_developerconnect_v1::model::SCMCommit;
7895 /// let x = SCMCommit::new().set_sha("example");
7896 /// ```
7897 pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7898 self.sha = v.into();
7899 self
7900 }
7901
7902 /// Sets the value of [message][crate::model::SCMCommit::message].
7903 ///
7904 /// # Example
7905 /// ```ignore,no_run
7906 /// # use google_cloud_developerconnect_v1::model::SCMCommit;
7907 /// let x = SCMCommit::new().set_message("example");
7908 /// ```
7909 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7910 self.message = v.into();
7911 self
7912 }
7913
7914 /// Sets the value of [author][crate::model::SCMCommit::author].
7915 ///
7916 /// # Example
7917 /// ```ignore,no_run
7918 /// # use google_cloud_developerconnect_v1::model::SCMCommit;
7919 /// let x = SCMCommit::new().set_author("example");
7920 /// ```
7921 pub fn set_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7922 self.author = v.into();
7923 self
7924 }
7925
7926 /// Sets the value of [author_email][crate::model::SCMCommit::author_email].
7927 ///
7928 /// # Example
7929 /// ```ignore,no_run
7930 /// # use google_cloud_developerconnect_v1::model::SCMCommit;
7931 /// let x = SCMCommit::new().set_author_email("example");
7932 /// ```
7933 pub fn set_author_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7934 self.author_email = v.into();
7935 self
7936 }
7937
7938 /// Sets the value of [commit_time][crate::model::SCMCommit::commit_time].
7939 ///
7940 /// # Example
7941 /// ```ignore,no_run
7942 /// # use google_cloud_developerconnect_v1::model::SCMCommit;
7943 /// use wkt::Timestamp;
7944 /// let x = SCMCommit::new().set_commit_time(Timestamp::default()/* use setters */);
7945 /// ```
7946 pub fn set_commit_time<T>(mut self, v: T) -> Self
7947 where
7948 T: std::convert::Into<wkt::Timestamp>,
7949 {
7950 self.commit_time = std::option::Option::Some(v.into());
7951 self
7952 }
7953
7954 /// Sets or clears the value of [commit_time][crate::model::SCMCommit::commit_time].
7955 ///
7956 /// # Example
7957 /// ```ignore,no_run
7958 /// # use google_cloud_developerconnect_v1::model::SCMCommit;
7959 /// use wkt::Timestamp;
7960 /// let x = SCMCommit::new().set_or_clear_commit_time(Some(Timestamp::default()/* use setters */));
7961 /// let x = SCMCommit::new().set_or_clear_commit_time(None::<Timestamp>);
7962 /// ```
7963 pub fn set_or_clear_commit_time<T>(mut self, v: std::option::Option<T>) -> Self
7964 where
7965 T: std::convert::Into<wkt::Timestamp>,
7966 {
7967 self.commit_time = v.map(|x| x.into());
7968 self
7969 }
7970
7971 /// Sets the value of [url][crate::model::SCMCommit::url].
7972 ///
7973 /// # Example
7974 /// ```ignore,no_run
7975 /// # use google_cloud_developerconnect_v1::model::SCMCommit;
7976 /// let x = SCMCommit::new().set_url("example");
7977 /// ```
7978 pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7979 self.url = v.into();
7980 self
7981 }
7982}
7983
7984impl wkt::message::Message for SCMCommit {
7985 fn typename() -> &'static str {
7986 "type.googleapis.com/google.cloud.developerconnect.v1.SCMCommit"
7987 }
7988}
7989
7990/// Request message for FetchGitRepositoryLinkFileBlame.
7991#[derive(Clone, Default, PartialEq)]
7992#[non_exhaustive]
7993pub struct FetchGitRepositoryLinkFileBlameRequest {
7994 /// Required. The resource name of the GitRepositoryLink in the format
7995 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
7996 pub name: std::string::String,
7997
7998 /// Required. The SCM commit SHA, or symbolic revision (e.g., branch name, tag)
7999 /// from which to fetch the blame.
8000 pub r#ref: std::string::String,
8001
8002 /// Required. The file path within the repository.
8003 pub path: std::string::String,
8004
8005 /// Optional. The 1-indexed starting line number of the range to blame
8006 /// (inclusive). If not specified, blame begins at line 1.
8007 pub first_line: i32,
8008
8009 /// Optional. The 1-indexed ending line number of the range to blame
8010 /// (inclusive). If not specified, blame extends to the end of the file.
8011 pub last_line: i32,
8012
8013 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8014}
8015
8016impl FetchGitRepositoryLinkFileBlameRequest {
8017 /// Creates a new default instance.
8018 pub fn new() -> Self {
8019 std::default::Default::default()
8020 }
8021
8022 /// Sets the value of [name][crate::model::FetchGitRepositoryLinkFileBlameRequest::name].
8023 ///
8024 /// # Example
8025 /// ```ignore,no_run
8026 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkFileBlameRequest;
8027 /// # let project_id = "project_id";
8028 /// # let location_id = "location_id";
8029 /// # let connection_id = "connection_id";
8030 /// # let git_repository_link_id = "git_repository_link_id";
8031 /// let x = FetchGitRepositoryLinkFileBlameRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
8032 /// ```
8033 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8034 self.name = v.into();
8035 self
8036 }
8037
8038 /// Sets the value of [r#ref][crate::model::FetchGitRepositoryLinkFileBlameRequest::ref].
8039 ///
8040 /// # Example
8041 /// ```ignore,no_run
8042 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkFileBlameRequest;
8043 /// let x = FetchGitRepositoryLinkFileBlameRequest::new().set_ref("example");
8044 /// ```
8045 pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8046 self.r#ref = v.into();
8047 self
8048 }
8049
8050 /// Sets the value of [path][crate::model::FetchGitRepositoryLinkFileBlameRequest::path].
8051 ///
8052 /// # Example
8053 /// ```ignore,no_run
8054 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkFileBlameRequest;
8055 /// let x = FetchGitRepositoryLinkFileBlameRequest::new().set_path("example");
8056 /// ```
8057 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8058 self.path = v.into();
8059 self
8060 }
8061
8062 /// Sets the value of [first_line][crate::model::FetchGitRepositoryLinkFileBlameRequest::first_line].
8063 ///
8064 /// # Example
8065 /// ```ignore,no_run
8066 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkFileBlameRequest;
8067 /// let x = FetchGitRepositoryLinkFileBlameRequest::new().set_first_line(42);
8068 /// ```
8069 pub fn set_first_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8070 self.first_line = v.into();
8071 self
8072 }
8073
8074 /// Sets the value of [last_line][crate::model::FetchGitRepositoryLinkFileBlameRequest::last_line].
8075 ///
8076 /// # Example
8077 /// ```ignore,no_run
8078 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkFileBlameRequest;
8079 /// let x = FetchGitRepositoryLinkFileBlameRequest::new().set_last_line(42);
8080 /// ```
8081 pub fn set_last_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8082 self.last_line = v.into();
8083 self
8084 }
8085}
8086
8087impl wkt::message::Message for FetchGitRepositoryLinkFileBlameRequest {
8088 fn typename() -> &'static str {
8089 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRepositoryLinkFileBlameRequest"
8090 }
8091}
8092
8093/// BlameRange represents blame information for a range of lines.
8094#[derive(Clone, Default, PartialEq)]
8095#[non_exhaustive]
8096pub struct BlameRange {
8097 /// The 1-indexed starting line number of the range (inclusive).
8098 pub first_line: i32,
8099
8100 /// The 1-indexed ending line number of the range (inclusive).
8101 pub last_line: i32,
8102
8103 /// The commit metadata for this line range.
8104 pub commit: std::option::Option<crate::model::SCMCommit>,
8105
8106 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8107}
8108
8109impl BlameRange {
8110 /// Creates a new default instance.
8111 pub fn new() -> Self {
8112 std::default::Default::default()
8113 }
8114
8115 /// Sets the value of [first_line][crate::model::BlameRange::first_line].
8116 ///
8117 /// # Example
8118 /// ```ignore,no_run
8119 /// # use google_cloud_developerconnect_v1::model::BlameRange;
8120 /// let x = BlameRange::new().set_first_line(42);
8121 /// ```
8122 pub fn set_first_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8123 self.first_line = v.into();
8124 self
8125 }
8126
8127 /// Sets the value of [last_line][crate::model::BlameRange::last_line].
8128 ///
8129 /// # Example
8130 /// ```ignore,no_run
8131 /// # use google_cloud_developerconnect_v1::model::BlameRange;
8132 /// let x = BlameRange::new().set_last_line(42);
8133 /// ```
8134 pub fn set_last_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8135 self.last_line = v.into();
8136 self
8137 }
8138
8139 /// Sets the value of [commit][crate::model::BlameRange::commit].
8140 ///
8141 /// # Example
8142 /// ```ignore,no_run
8143 /// # use google_cloud_developerconnect_v1::model::BlameRange;
8144 /// use google_cloud_developerconnect_v1::model::SCMCommit;
8145 /// let x = BlameRange::new().set_commit(SCMCommit::default()/* use setters */);
8146 /// ```
8147 pub fn set_commit<T>(mut self, v: T) -> Self
8148 where
8149 T: std::convert::Into<crate::model::SCMCommit>,
8150 {
8151 self.commit = std::option::Option::Some(v.into());
8152 self
8153 }
8154
8155 /// Sets or clears the value of [commit][crate::model::BlameRange::commit].
8156 ///
8157 /// # Example
8158 /// ```ignore,no_run
8159 /// # use google_cloud_developerconnect_v1::model::BlameRange;
8160 /// use google_cloud_developerconnect_v1::model::SCMCommit;
8161 /// let x = BlameRange::new().set_or_clear_commit(Some(SCMCommit::default()/* use setters */));
8162 /// let x = BlameRange::new().set_or_clear_commit(None::<SCMCommit>);
8163 /// ```
8164 pub fn set_or_clear_commit<T>(mut self, v: std::option::Option<T>) -> Self
8165 where
8166 T: std::convert::Into<crate::model::SCMCommit>,
8167 {
8168 self.commit = v.map(|x| x.into());
8169 self
8170 }
8171}
8172
8173impl wkt::message::Message for BlameRange {
8174 fn typename() -> &'static str {
8175 "type.googleapis.com/google.cloud.developerconnect.v1.BlameRange"
8176 }
8177}
8178
8179/// Response message for FetchGitRepositoryLinkFileBlame.
8180#[derive(Clone, Default, PartialEq)]
8181#[non_exhaustive]
8182pub struct FetchGitRepositoryLinkFileBlameResponse {
8183 /// The list of blame ranges for the file.
8184 pub ranges: std::vec::Vec<crate::model::BlameRange>,
8185
8186 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8187}
8188
8189impl FetchGitRepositoryLinkFileBlameResponse {
8190 /// Creates a new default instance.
8191 pub fn new() -> Self {
8192 std::default::Default::default()
8193 }
8194
8195 /// Sets the value of [ranges][crate::model::FetchGitRepositoryLinkFileBlameResponse::ranges].
8196 ///
8197 /// # Example
8198 /// ```ignore,no_run
8199 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkFileBlameResponse;
8200 /// use google_cloud_developerconnect_v1::model::BlameRange;
8201 /// let x = FetchGitRepositoryLinkFileBlameResponse::new()
8202 /// .set_ranges([
8203 /// BlameRange::default()/* use setters */,
8204 /// BlameRange::default()/* use (different) setters */,
8205 /// ]);
8206 /// ```
8207 pub fn set_ranges<T, V>(mut self, v: T) -> Self
8208 where
8209 T: std::iter::IntoIterator<Item = V>,
8210 V: std::convert::Into<crate::model::BlameRange>,
8211 {
8212 use std::iter::Iterator;
8213 self.ranges = v.into_iter().map(|i| i.into()).collect();
8214 self
8215 }
8216}
8217
8218impl wkt::message::Message for FetchGitRepositoryLinkFileBlameResponse {
8219 fn typename() -> &'static str {
8220 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRepositoryLinkFileBlameResponse"
8221 }
8222}
8223
8224/// Request message for FetchGitRepositoryLinkPullRequest.
8225#[derive(Clone, Default, PartialEq)]
8226#[non_exhaustive]
8227pub struct FetchGitRepositoryLinkPullRequestRequest {
8228 /// Required. The resource name of the GitRepositoryLink in the format
8229 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
8230 pub name: std::string::String,
8231
8232 /// Required. The ID of the Pull Request.
8233 pub pull_request_id: std::string::String,
8234
8235 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8236}
8237
8238impl FetchGitRepositoryLinkPullRequestRequest {
8239 /// Creates a new default instance.
8240 pub fn new() -> Self {
8241 std::default::Default::default()
8242 }
8243
8244 /// Sets the value of [name][crate::model::FetchGitRepositoryLinkPullRequestRequest::name].
8245 ///
8246 /// # Example
8247 /// ```ignore,no_run
8248 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkPullRequestRequest;
8249 /// # let project_id = "project_id";
8250 /// # let location_id = "location_id";
8251 /// # let connection_id = "connection_id";
8252 /// # let git_repository_link_id = "git_repository_link_id";
8253 /// let x = FetchGitRepositoryLinkPullRequestRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
8254 /// ```
8255 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8256 self.name = v.into();
8257 self
8258 }
8259
8260 /// Sets the value of [pull_request_id][crate::model::FetchGitRepositoryLinkPullRequestRequest::pull_request_id].
8261 ///
8262 /// # Example
8263 /// ```ignore,no_run
8264 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkPullRequestRequest;
8265 /// let x = FetchGitRepositoryLinkPullRequestRequest::new().set_pull_request_id("example");
8266 /// ```
8267 pub fn set_pull_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8268 self.pull_request_id = v.into();
8269 self
8270 }
8271}
8272
8273impl wkt::message::Message for FetchGitRepositoryLinkPullRequestRequest {
8274 fn typename() -> &'static str {
8275 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRepositoryLinkPullRequestRequest"
8276 }
8277}
8278
8279/// Message representing a SCM Pull Request.
8280#[derive(Clone, Default, PartialEq)]
8281#[non_exhaustive]
8282pub struct PullRequest {
8283 /// Required. The ID of the PR.
8284 pub id: std::string::String,
8285
8286 /// Required. The title of the PR.
8287 pub title: std::string::String,
8288
8289 /// Optional. The body description of the PR.
8290 pub body: std::string::String,
8291
8292 /// Required. The source commit SHA of the head branch.
8293 pub head_ref: std::string::String,
8294
8295 /// Required. The target commit SHA of the base branch.
8296 pub base_ref: std::string::String,
8297
8298 /// Output only. The username of the author.
8299 pub author: std::string::String,
8300
8301 /// Output only. When the PR was created.
8302 pub create_time: std::option::Option<wkt::Timestamp>,
8303
8304 /// Output only. When the PR was updated.
8305 pub update_time: std::option::Option<wkt::Timestamp>,
8306
8307 /// Output only. When the PR was merged.
8308 pub merge_time: std::option::Option<wkt::Timestamp>,
8309
8310 /// Output only. When the PR was closed.
8311 pub close_time: std::option::Option<wkt::Timestamp>,
8312
8313 /// Output only. When the PR was declined. Only set for SCM providers that
8314 /// support declining pull requests. Never set for GitHub, GitHub Enterprise,
8315 /// GitLab, or GitLab Enterprise, where a pull request closed without being
8316 /// merged is `CLOSED`.
8317 pub decline_time: std::option::Option<wkt::Timestamp>,
8318
8319 /// Output only. The current state of the PR.
8320 pub state: crate::model::pull_request::State,
8321
8322 /// Output only. The mergeability state of the pull request.
8323 pub mergeability: crate::model::pull_request::Mergeability,
8324
8325 /// Output only. The HTML URL of the pull request on the SCM provider.
8326 pub html_url: std::string::String,
8327
8328 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8329}
8330
8331impl PullRequest {
8332 /// Creates a new default instance.
8333 pub fn new() -> Self {
8334 std::default::Default::default()
8335 }
8336
8337 /// Sets the value of [id][crate::model::PullRequest::id].
8338 ///
8339 /// # Example
8340 /// ```ignore,no_run
8341 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8342 /// let x = PullRequest::new().set_id("example");
8343 /// ```
8344 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8345 self.id = v.into();
8346 self
8347 }
8348
8349 /// Sets the value of [title][crate::model::PullRequest::title].
8350 ///
8351 /// # Example
8352 /// ```ignore,no_run
8353 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8354 /// let x = PullRequest::new().set_title("example");
8355 /// ```
8356 pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8357 self.title = v.into();
8358 self
8359 }
8360
8361 /// Sets the value of [body][crate::model::PullRequest::body].
8362 ///
8363 /// # Example
8364 /// ```ignore,no_run
8365 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8366 /// let x = PullRequest::new().set_body("example");
8367 /// ```
8368 pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8369 self.body = v.into();
8370 self
8371 }
8372
8373 /// Sets the value of [head_ref][crate::model::PullRequest::head_ref].
8374 ///
8375 /// # Example
8376 /// ```ignore,no_run
8377 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8378 /// let x = PullRequest::new().set_head_ref("example");
8379 /// ```
8380 pub fn set_head_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8381 self.head_ref = v.into();
8382 self
8383 }
8384
8385 /// Sets the value of [base_ref][crate::model::PullRequest::base_ref].
8386 ///
8387 /// # Example
8388 /// ```ignore,no_run
8389 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8390 /// let x = PullRequest::new().set_base_ref("example");
8391 /// ```
8392 pub fn set_base_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8393 self.base_ref = v.into();
8394 self
8395 }
8396
8397 /// Sets the value of [author][crate::model::PullRequest::author].
8398 ///
8399 /// # Example
8400 /// ```ignore,no_run
8401 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8402 /// let x = PullRequest::new().set_author("example");
8403 /// ```
8404 pub fn set_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8405 self.author = v.into();
8406 self
8407 }
8408
8409 /// Sets the value of [create_time][crate::model::PullRequest::create_time].
8410 ///
8411 /// # Example
8412 /// ```ignore,no_run
8413 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8414 /// use wkt::Timestamp;
8415 /// let x = PullRequest::new().set_create_time(Timestamp::default()/* use setters */);
8416 /// ```
8417 pub fn set_create_time<T>(mut self, v: T) -> Self
8418 where
8419 T: std::convert::Into<wkt::Timestamp>,
8420 {
8421 self.create_time = std::option::Option::Some(v.into());
8422 self
8423 }
8424
8425 /// Sets or clears the value of [create_time][crate::model::PullRequest::create_time].
8426 ///
8427 /// # Example
8428 /// ```ignore,no_run
8429 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8430 /// use wkt::Timestamp;
8431 /// let x = PullRequest::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8432 /// let x = PullRequest::new().set_or_clear_create_time(None::<Timestamp>);
8433 /// ```
8434 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8435 where
8436 T: std::convert::Into<wkt::Timestamp>,
8437 {
8438 self.create_time = v.map(|x| x.into());
8439 self
8440 }
8441
8442 /// Sets the value of [update_time][crate::model::PullRequest::update_time].
8443 ///
8444 /// # Example
8445 /// ```ignore,no_run
8446 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8447 /// use wkt::Timestamp;
8448 /// let x = PullRequest::new().set_update_time(Timestamp::default()/* use setters */);
8449 /// ```
8450 pub fn set_update_time<T>(mut self, v: T) -> Self
8451 where
8452 T: std::convert::Into<wkt::Timestamp>,
8453 {
8454 self.update_time = std::option::Option::Some(v.into());
8455 self
8456 }
8457
8458 /// Sets or clears the value of [update_time][crate::model::PullRequest::update_time].
8459 ///
8460 /// # Example
8461 /// ```ignore,no_run
8462 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8463 /// use wkt::Timestamp;
8464 /// let x = PullRequest::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8465 /// let x = PullRequest::new().set_or_clear_update_time(None::<Timestamp>);
8466 /// ```
8467 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8468 where
8469 T: std::convert::Into<wkt::Timestamp>,
8470 {
8471 self.update_time = v.map(|x| x.into());
8472 self
8473 }
8474
8475 /// Sets the value of [merge_time][crate::model::PullRequest::merge_time].
8476 ///
8477 /// # Example
8478 /// ```ignore,no_run
8479 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8480 /// use wkt::Timestamp;
8481 /// let x = PullRequest::new().set_merge_time(Timestamp::default()/* use setters */);
8482 /// ```
8483 pub fn set_merge_time<T>(mut self, v: T) -> Self
8484 where
8485 T: std::convert::Into<wkt::Timestamp>,
8486 {
8487 self.merge_time = std::option::Option::Some(v.into());
8488 self
8489 }
8490
8491 /// Sets or clears the value of [merge_time][crate::model::PullRequest::merge_time].
8492 ///
8493 /// # Example
8494 /// ```ignore,no_run
8495 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8496 /// use wkt::Timestamp;
8497 /// let x = PullRequest::new().set_or_clear_merge_time(Some(Timestamp::default()/* use setters */));
8498 /// let x = PullRequest::new().set_or_clear_merge_time(None::<Timestamp>);
8499 /// ```
8500 pub fn set_or_clear_merge_time<T>(mut self, v: std::option::Option<T>) -> Self
8501 where
8502 T: std::convert::Into<wkt::Timestamp>,
8503 {
8504 self.merge_time = v.map(|x| x.into());
8505 self
8506 }
8507
8508 /// Sets the value of [close_time][crate::model::PullRequest::close_time].
8509 ///
8510 /// # Example
8511 /// ```ignore,no_run
8512 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8513 /// use wkt::Timestamp;
8514 /// let x = PullRequest::new().set_close_time(Timestamp::default()/* use setters */);
8515 /// ```
8516 pub fn set_close_time<T>(mut self, v: T) -> Self
8517 where
8518 T: std::convert::Into<wkt::Timestamp>,
8519 {
8520 self.close_time = std::option::Option::Some(v.into());
8521 self
8522 }
8523
8524 /// Sets or clears the value of [close_time][crate::model::PullRequest::close_time].
8525 ///
8526 /// # Example
8527 /// ```ignore,no_run
8528 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8529 /// use wkt::Timestamp;
8530 /// let x = PullRequest::new().set_or_clear_close_time(Some(Timestamp::default()/* use setters */));
8531 /// let x = PullRequest::new().set_or_clear_close_time(None::<Timestamp>);
8532 /// ```
8533 pub fn set_or_clear_close_time<T>(mut self, v: std::option::Option<T>) -> Self
8534 where
8535 T: std::convert::Into<wkt::Timestamp>,
8536 {
8537 self.close_time = v.map(|x| x.into());
8538 self
8539 }
8540
8541 /// Sets the value of [decline_time][crate::model::PullRequest::decline_time].
8542 ///
8543 /// # Example
8544 /// ```ignore,no_run
8545 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8546 /// use wkt::Timestamp;
8547 /// let x = PullRequest::new().set_decline_time(Timestamp::default()/* use setters */);
8548 /// ```
8549 pub fn set_decline_time<T>(mut self, v: T) -> Self
8550 where
8551 T: std::convert::Into<wkt::Timestamp>,
8552 {
8553 self.decline_time = std::option::Option::Some(v.into());
8554 self
8555 }
8556
8557 /// Sets or clears the value of [decline_time][crate::model::PullRequest::decline_time].
8558 ///
8559 /// # Example
8560 /// ```ignore,no_run
8561 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8562 /// use wkt::Timestamp;
8563 /// let x = PullRequest::new().set_or_clear_decline_time(Some(Timestamp::default()/* use setters */));
8564 /// let x = PullRequest::new().set_or_clear_decline_time(None::<Timestamp>);
8565 /// ```
8566 pub fn set_or_clear_decline_time<T>(mut self, v: std::option::Option<T>) -> Self
8567 where
8568 T: std::convert::Into<wkt::Timestamp>,
8569 {
8570 self.decline_time = v.map(|x| x.into());
8571 self
8572 }
8573
8574 /// Sets the value of [state][crate::model::PullRequest::state].
8575 ///
8576 /// # Example
8577 /// ```ignore,no_run
8578 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8579 /// use google_cloud_developerconnect_v1::model::pull_request::State;
8580 /// let x0 = PullRequest::new().set_state(State::Open);
8581 /// let x1 = PullRequest::new().set_state(State::Closed);
8582 /// let x2 = PullRequest::new().set_state(State::Merged);
8583 /// ```
8584 pub fn set_state<T: std::convert::Into<crate::model::pull_request::State>>(
8585 mut self,
8586 v: T,
8587 ) -> Self {
8588 self.state = v.into();
8589 self
8590 }
8591
8592 /// Sets the value of [mergeability][crate::model::PullRequest::mergeability].
8593 ///
8594 /// # Example
8595 /// ```ignore,no_run
8596 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8597 /// use google_cloud_developerconnect_v1::model::pull_request::Mergeability;
8598 /// let x0 = PullRequest::new().set_mergeability(Mergeability::Mergeable);
8599 /// let x1 = PullRequest::new().set_mergeability(Mergeability::Conflicting);
8600 /// let x2 = PullRequest::new().set_mergeability(Mergeability::Computing);
8601 /// ```
8602 pub fn set_mergeability<T: std::convert::Into<crate::model::pull_request::Mergeability>>(
8603 mut self,
8604 v: T,
8605 ) -> Self {
8606 self.mergeability = v.into();
8607 self
8608 }
8609
8610 /// Sets the value of [html_url][crate::model::PullRequest::html_url].
8611 ///
8612 /// # Example
8613 /// ```ignore,no_run
8614 /// # use google_cloud_developerconnect_v1::model::PullRequest;
8615 /// let x = PullRequest::new().set_html_url("example");
8616 /// ```
8617 pub fn set_html_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8618 self.html_url = v.into();
8619 self
8620 }
8621}
8622
8623impl wkt::message::Message for PullRequest {
8624 fn typename() -> &'static str {
8625 "type.googleapis.com/google.cloud.developerconnect.v1.PullRequest"
8626 }
8627}
8628
8629/// Defines additional types related to [PullRequest].
8630pub mod pull_request {
8631 #[allow(unused_imports)]
8632 use super::*;
8633
8634 /// The state of the PR.
8635 ///
8636 /// # Working with unknown values
8637 ///
8638 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8639 /// additional enum variants at any time. Adding new variants is not considered
8640 /// a breaking change. Applications should write their code in anticipation of:
8641 ///
8642 /// - New values appearing in future releases of the client library, **and**
8643 /// - New values received dynamically, without application changes.
8644 ///
8645 /// Please consult the [Working with enums] section in the user guide for some
8646 /// guidelines.
8647 ///
8648 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8649 #[derive(Clone, Debug, PartialEq)]
8650 #[non_exhaustive]
8651 pub enum State {
8652 /// Default value.
8653 Unspecified,
8654 /// The PR is open.
8655 Open,
8656 /// The PR is closed.
8657 Closed,
8658 /// The PR is merged.
8659 Merged,
8660 /// The PR is declined. Only used by SCM providers that support declining
8661 /// pull requests. Never used for GitHub, GitHub Enterprise, GitLab, or
8662 /// GitLab Enterprise, where a pull request closed without being merged is
8663 /// `CLOSED`.
8664 Declined,
8665 /// If set, the enum was initialized with an unknown value.
8666 ///
8667 /// Applications can examine the value using [State::value] or
8668 /// [State::name].
8669 UnknownValue(state::UnknownValue),
8670 }
8671
8672 #[doc(hidden)]
8673 pub mod state {
8674 #[allow(unused_imports)]
8675 use super::*;
8676 #[derive(Clone, Debug, PartialEq)]
8677 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8678 }
8679
8680 impl State {
8681 /// Gets the enum value.
8682 ///
8683 /// Returns `None` if the enum contains an unknown value deserialized from
8684 /// the string representation of enums.
8685 pub fn value(&self) -> std::option::Option<i32> {
8686 match self {
8687 Self::Unspecified => std::option::Option::Some(0),
8688 Self::Open => std::option::Option::Some(1),
8689 Self::Closed => std::option::Option::Some(2),
8690 Self::Merged => std::option::Option::Some(3),
8691 Self::Declined => std::option::Option::Some(4),
8692 Self::UnknownValue(u) => u.0.value(),
8693 }
8694 }
8695
8696 /// Gets the enum value as a string.
8697 ///
8698 /// Returns `None` if the enum contains an unknown value deserialized from
8699 /// the integer representation of enums.
8700 pub fn name(&self) -> std::option::Option<&str> {
8701 match self {
8702 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8703 Self::Open => std::option::Option::Some("OPEN"),
8704 Self::Closed => std::option::Option::Some("CLOSED"),
8705 Self::Merged => std::option::Option::Some("MERGED"),
8706 Self::Declined => std::option::Option::Some("DECLINED"),
8707 Self::UnknownValue(u) => u.0.name(),
8708 }
8709 }
8710 }
8711
8712 impl std::default::Default for State {
8713 fn default() -> Self {
8714 use std::convert::From;
8715 Self::from(0)
8716 }
8717 }
8718
8719 impl std::fmt::Display for State {
8720 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8721 wkt::internal::display_enum(f, self.name(), self.value())
8722 }
8723 }
8724
8725 impl std::convert::From<i32> for State {
8726 fn from(value: i32) -> Self {
8727 match value {
8728 0 => Self::Unspecified,
8729 1 => Self::Open,
8730 2 => Self::Closed,
8731 3 => Self::Merged,
8732 4 => Self::Declined,
8733 _ => Self::UnknownValue(state::UnknownValue(
8734 wkt::internal::UnknownEnumValue::Integer(value),
8735 )),
8736 }
8737 }
8738 }
8739
8740 impl std::convert::From<&str> for State {
8741 fn from(value: &str) -> Self {
8742 use std::string::ToString;
8743 match value {
8744 "STATE_UNSPECIFIED" => Self::Unspecified,
8745 "OPEN" => Self::Open,
8746 "CLOSED" => Self::Closed,
8747 "MERGED" => Self::Merged,
8748 "DECLINED" => Self::Declined,
8749 _ => Self::UnknownValue(state::UnknownValue(
8750 wkt::internal::UnknownEnumValue::String(value.to_string()),
8751 )),
8752 }
8753 }
8754 }
8755
8756 impl serde::ser::Serialize for State {
8757 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8758 where
8759 S: serde::Serializer,
8760 {
8761 match self {
8762 Self::Unspecified => serializer.serialize_i32(0),
8763 Self::Open => serializer.serialize_i32(1),
8764 Self::Closed => serializer.serialize_i32(2),
8765 Self::Merged => serializer.serialize_i32(3),
8766 Self::Declined => serializer.serialize_i32(4),
8767 Self::UnknownValue(u) => u.0.serialize(serializer),
8768 }
8769 }
8770 }
8771
8772 impl<'de> serde::de::Deserialize<'de> for State {
8773 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8774 where
8775 D: serde::Deserializer<'de>,
8776 {
8777 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8778 ".google.cloud.developerconnect.v1.PullRequest.State",
8779 ))
8780 }
8781 }
8782
8783 /// The mergeability state of a pull request.
8784 ///
8785 /// # Working with unknown values
8786 ///
8787 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8788 /// additional enum variants at any time. Adding new variants is not considered
8789 /// a breaking change. Applications should write their code in anticipation of:
8790 ///
8791 /// - New values appearing in future releases of the client library, **and**
8792 /// - New values received dynamically, without application changes.
8793 ///
8794 /// Please consult the [Working with enums] section in the user guide for some
8795 /// guidelines.
8796 ///
8797 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8798 #[derive(Clone, Debug, PartialEq)]
8799 #[non_exhaustive]
8800 pub enum Mergeability {
8801 /// Mergeability state is unspecified.
8802 Unspecified,
8803 /// The pull request can be merged cleanly without Git conflicts.
8804 Mergeable,
8805 /// The pull request has merge conflicts and cannot be merged cleanly.
8806 Conflicting,
8807 /// The mergeability state is currently being computed asynchronously
8808 /// by the upstream SCM provider.
8809 Computing,
8810 /// If set, the enum was initialized with an unknown value.
8811 ///
8812 /// Applications can examine the value using [Mergeability::value] or
8813 /// [Mergeability::name].
8814 UnknownValue(mergeability::UnknownValue),
8815 }
8816
8817 #[doc(hidden)]
8818 pub mod mergeability {
8819 #[allow(unused_imports)]
8820 use super::*;
8821 #[derive(Clone, Debug, PartialEq)]
8822 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8823 }
8824
8825 impl Mergeability {
8826 /// Gets the enum value.
8827 ///
8828 /// Returns `None` if the enum contains an unknown value deserialized from
8829 /// the string representation of enums.
8830 pub fn value(&self) -> std::option::Option<i32> {
8831 match self {
8832 Self::Unspecified => std::option::Option::Some(0),
8833 Self::Mergeable => std::option::Option::Some(1),
8834 Self::Conflicting => std::option::Option::Some(2),
8835 Self::Computing => std::option::Option::Some(3),
8836 Self::UnknownValue(u) => u.0.value(),
8837 }
8838 }
8839
8840 /// Gets the enum value as a string.
8841 ///
8842 /// Returns `None` if the enum contains an unknown value deserialized from
8843 /// the integer representation of enums.
8844 pub fn name(&self) -> std::option::Option<&str> {
8845 match self {
8846 Self::Unspecified => std::option::Option::Some("MERGEABILITY_UNSPECIFIED"),
8847 Self::Mergeable => std::option::Option::Some("MERGEABLE"),
8848 Self::Conflicting => std::option::Option::Some("CONFLICTING"),
8849 Self::Computing => std::option::Option::Some("COMPUTING"),
8850 Self::UnknownValue(u) => u.0.name(),
8851 }
8852 }
8853 }
8854
8855 impl std::default::Default for Mergeability {
8856 fn default() -> Self {
8857 use std::convert::From;
8858 Self::from(0)
8859 }
8860 }
8861
8862 impl std::fmt::Display for Mergeability {
8863 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8864 wkt::internal::display_enum(f, self.name(), self.value())
8865 }
8866 }
8867
8868 impl std::convert::From<i32> for Mergeability {
8869 fn from(value: i32) -> Self {
8870 match value {
8871 0 => Self::Unspecified,
8872 1 => Self::Mergeable,
8873 2 => Self::Conflicting,
8874 3 => Self::Computing,
8875 _ => Self::UnknownValue(mergeability::UnknownValue(
8876 wkt::internal::UnknownEnumValue::Integer(value),
8877 )),
8878 }
8879 }
8880 }
8881
8882 impl std::convert::From<&str> for Mergeability {
8883 fn from(value: &str) -> Self {
8884 use std::string::ToString;
8885 match value {
8886 "MERGEABILITY_UNSPECIFIED" => Self::Unspecified,
8887 "MERGEABLE" => Self::Mergeable,
8888 "CONFLICTING" => Self::Conflicting,
8889 "COMPUTING" => Self::Computing,
8890 _ => Self::UnknownValue(mergeability::UnknownValue(
8891 wkt::internal::UnknownEnumValue::String(value.to_string()),
8892 )),
8893 }
8894 }
8895 }
8896
8897 impl serde::ser::Serialize for Mergeability {
8898 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8899 where
8900 S: serde::Serializer,
8901 {
8902 match self {
8903 Self::Unspecified => serializer.serialize_i32(0),
8904 Self::Mergeable => serializer.serialize_i32(1),
8905 Self::Conflicting => serializer.serialize_i32(2),
8906 Self::Computing => serializer.serialize_i32(3),
8907 Self::UnknownValue(u) => u.0.serialize(serializer),
8908 }
8909 }
8910 }
8911
8912 impl<'de> serde::de::Deserialize<'de> for Mergeability {
8913 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8914 where
8915 D: serde::Deserializer<'de>,
8916 {
8917 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mergeability>::new(
8918 ".google.cloud.developerconnect.v1.PullRequest.Mergeability",
8919 ))
8920 }
8921 }
8922}
8923
8924/// Message representing a SCM Pull Request Comment.
8925#[derive(Clone, Default, PartialEq)]
8926#[non_exhaustive]
8927pub struct PullRequestComment {
8928 /// Output only. The ID of the comment.
8929 pub id: std::string::String,
8930
8931 /// Required. The body of the comment.
8932 pub body: std::string::String,
8933
8934 /// Output only. The username of the author.
8935 pub author: std::string::String,
8936
8937 /// Output only. When the comment was created.
8938 pub create_time: std::option::Option<wkt::Timestamp>,
8939
8940 /// Output only. When the comment was updated.
8941 pub update_time: std::option::Option<wkt::Timestamp>,
8942
8943 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8944}
8945
8946impl PullRequestComment {
8947 /// Creates a new default instance.
8948 pub fn new() -> Self {
8949 std::default::Default::default()
8950 }
8951
8952 /// Sets the value of [id][crate::model::PullRequestComment::id].
8953 ///
8954 /// # Example
8955 /// ```ignore,no_run
8956 /// # use google_cloud_developerconnect_v1::model::PullRequestComment;
8957 /// let x = PullRequestComment::new().set_id("example");
8958 /// ```
8959 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8960 self.id = v.into();
8961 self
8962 }
8963
8964 /// Sets the value of [body][crate::model::PullRequestComment::body].
8965 ///
8966 /// # Example
8967 /// ```ignore,no_run
8968 /// # use google_cloud_developerconnect_v1::model::PullRequestComment;
8969 /// let x = PullRequestComment::new().set_body("example");
8970 /// ```
8971 pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8972 self.body = v.into();
8973 self
8974 }
8975
8976 /// Sets the value of [author][crate::model::PullRequestComment::author].
8977 ///
8978 /// # Example
8979 /// ```ignore,no_run
8980 /// # use google_cloud_developerconnect_v1::model::PullRequestComment;
8981 /// let x = PullRequestComment::new().set_author("example");
8982 /// ```
8983 pub fn set_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8984 self.author = v.into();
8985 self
8986 }
8987
8988 /// Sets the value of [create_time][crate::model::PullRequestComment::create_time].
8989 ///
8990 /// # Example
8991 /// ```ignore,no_run
8992 /// # use google_cloud_developerconnect_v1::model::PullRequestComment;
8993 /// use wkt::Timestamp;
8994 /// let x = PullRequestComment::new().set_create_time(Timestamp::default()/* use setters */);
8995 /// ```
8996 pub fn set_create_time<T>(mut self, v: T) -> Self
8997 where
8998 T: std::convert::Into<wkt::Timestamp>,
8999 {
9000 self.create_time = std::option::Option::Some(v.into());
9001 self
9002 }
9003
9004 /// Sets or clears the value of [create_time][crate::model::PullRequestComment::create_time].
9005 ///
9006 /// # Example
9007 /// ```ignore,no_run
9008 /// # use google_cloud_developerconnect_v1::model::PullRequestComment;
9009 /// use wkt::Timestamp;
9010 /// let x = PullRequestComment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9011 /// let x = PullRequestComment::new().set_or_clear_create_time(None::<Timestamp>);
9012 /// ```
9013 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9014 where
9015 T: std::convert::Into<wkt::Timestamp>,
9016 {
9017 self.create_time = v.map(|x| x.into());
9018 self
9019 }
9020
9021 /// Sets the value of [update_time][crate::model::PullRequestComment::update_time].
9022 ///
9023 /// # Example
9024 /// ```ignore,no_run
9025 /// # use google_cloud_developerconnect_v1::model::PullRequestComment;
9026 /// use wkt::Timestamp;
9027 /// let x = PullRequestComment::new().set_update_time(Timestamp::default()/* use setters */);
9028 /// ```
9029 pub fn set_update_time<T>(mut self, v: T) -> Self
9030 where
9031 T: std::convert::Into<wkt::Timestamp>,
9032 {
9033 self.update_time = std::option::Option::Some(v.into());
9034 self
9035 }
9036
9037 /// Sets or clears the value of [update_time][crate::model::PullRequestComment::update_time].
9038 ///
9039 /// # Example
9040 /// ```ignore,no_run
9041 /// # use google_cloud_developerconnect_v1::model::PullRequestComment;
9042 /// use wkt::Timestamp;
9043 /// let x = PullRequestComment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9044 /// let x = PullRequestComment::new().set_or_clear_update_time(None::<Timestamp>);
9045 /// ```
9046 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9047 where
9048 T: std::convert::Into<wkt::Timestamp>,
9049 {
9050 self.update_time = v.map(|x| x.into());
9051 self
9052 }
9053}
9054
9055impl wkt::message::Message for PullRequestComment {
9056 fn typename() -> &'static str {
9057 "type.googleapis.com/google.cloud.developerconnect.v1.PullRequestComment"
9058 }
9059}
9060
9061/// Request message for AddGitRepositoryLinkPullRequestComment.
9062#[derive(Clone, Default, PartialEq)]
9063#[non_exhaustive]
9064pub struct AddGitRepositoryLinkPullRequestCommentRequest {
9065 /// Required. The resource name of the GitRepositoryLink in the format
9066 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
9067 pub name: std::string::String,
9068
9069 /// Required. The ID of the Pull Request.
9070 pub pull_request_id: std::string::String,
9071
9072 /// Required. The comment to add.
9073 pub comment: std::option::Option<crate::model::PullRequestComment>,
9074
9075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9076}
9077
9078impl AddGitRepositoryLinkPullRequestCommentRequest {
9079 /// Creates a new default instance.
9080 pub fn new() -> Self {
9081 std::default::Default::default()
9082 }
9083
9084 /// Sets the value of [name][crate::model::AddGitRepositoryLinkPullRequestCommentRequest::name].
9085 ///
9086 /// # Example
9087 /// ```ignore,no_run
9088 /// # use google_cloud_developerconnect_v1::model::AddGitRepositoryLinkPullRequestCommentRequest;
9089 /// # let project_id = "project_id";
9090 /// # let location_id = "location_id";
9091 /// # let connection_id = "connection_id";
9092 /// # let git_repository_link_id = "git_repository_link_id";
9093 /// let x = AddGitRepositoryLinkPullRequestCommentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
9094 /// ```
9095 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9096 self.name = v.into();
9097 self
9098 }
9099
9100 /// Sets the value of [pull_request_id][crate::model::AddGitRepositoryLinkPullRequestCommentRequest::pull_request_id].
9101 ///
9102 /// # Example
9103 /// ```ignore,no_run
9104 /// # use google_cloud_developerconnect_v1::model::AddGitRepositoryLinkPullRequestCommentRequest;
9105 /// let x = AddGitRepositoryLinkPullRequestCommentRequest::new().set_pull_request_id("example");
9106 /// ```
9107 pub fn set_pull_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9108 self.pull_request_id = v.into();
9109 self
9110 }
9111
9112 /// Sets the value of [comment][crate::model::AddGitRepositoryLinkPullRequestCommentRequest::comment].
9113 ///
9114 /// # Example
9115 /// ```ignore,no_run
9116 /// # use google_cloud_developerconnect_v1::model::AddGitRepositoryLinkPullRequestCommentRequest;
9117 /// use google_cloud_developerconnect_v1::model::PullRequestComment;
9118 /// let x = AddGitRepositoryLinkPullRequestCommentRequest::new().set_comment(PullRequestComment::default()/* use setters */);
9119 /// ```
9120 pub fn set_comment<T>(mut self, v: T) -> Self
9121 where
9122 T: std::convert::Into<crate::model::PullRequestComment>,
9123 {
9124 self.comment = std::option::Option::Some(v.into());
9125 self
9126 }
9127
9128 /// Sets or clears the value of [comment][crate::model::AddGitRepositoryLinkPullRequestCommentRequest::comment].
9129 ///
9130 /// # Example
9131 /// ```ignore,no_run
9132 /// # use google_cloud_developerconnect_v1::model::AddGitRepositoryLinkPullRequestCommentRequest;
9133 /// use google_cloud_developerconnect_v1::model::PullRequestComment;
9134 /// let x = AddGitRepositoryLinkPullRequestCommentRequest::new().set_or_clear_comment(Some(PullRequestComment::default()/* use setters */));
9135 /// let x = AddGitRepositoryLinkPullRequestCommentRequest::new().set_or_clear_comment(None::<PullRequestComment>);
9136 /// ```
9137 pub fn set_or_clear_comment<T>(mut self, v: std::option::Option<T>) -> Self
9138 where
9139 T: std::convert::Into<crate::model::PullRequestComment>,
9140 {
9141 self.comment = v.map(|x| x.into());
9142 self
9143 }
9144}
9145
9146impl wkt::message::Message for AddGitRepositoryLinkPullRequestCommentRequest {
9147 fn typename() -> &'static str {
9148 "type.googleapis.com/google.cloud.developerconnect.v1.AddGitRepositoryLinkPullRequestCommentRequest"
9149 }
9150}
9151
9152/// Message representing a SCM Pull Request Review Comment (inline on diff).
9153#[derive(Clone, Default, PartialEq)]
9154#[non_exhaustive]
9155pub struct PullRequestReviewComment {
9156 /// Output only. The ID of the comment.
9157 pub id: std::string::String,
9158
9159 /// Required. The body of the comment.
9160 pub body: std::string::String,
9161
9162 /// Required. The file path to comment on.
9163 pub path: std::string::String,
9164
9165 /// Optional. The first line of the comment range (inclusive). If not
9166 /// specified, the comment applies only to the `last_line`.
9167 pub first_line: i32,
9168
9169 /// Required. The last line of the comment range (inclusive). If `first_line`
9170 /// is not specified, the comment applies only to this line.
9171 pub last_line: i32,
9172
9173 /// Optional. The side of the diff to comment on. Defaults to HEAD.
9174 pub side: crate::model::pull_request_review_comment::DiffSide,
9175
9176 /// Output only. The username of the author.
9177 pub author: std::string::String,
9178
9179 /// Output only. When the comment was created.
9180 pub create_time: std::option::Option<wkt::Timestamp>,
9181
9182 /// Output only. When the comment was updated.
9183 pub update_time: std::option::Option<wkt::Timestamp>,
9184
9185 /// Output only. The commit SHA the comment was actually applied to.
9186 pub commit_id: std::string::String,
9187
9188 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9189}
9190
9191impl PullRequestReviewComment {
9192 /// Creates a new default instance.
9193 pub fn new() -> Self {
9194 std::default::Default::default()
9195 }
9196
9197 /// Sets the value of [id][crate::model::PullRequestReviewComment::id].
9198 ///
9199 /// # Example
9200 /// ```ignore,no_run
9201 /// # use google_cloud_developerconnect_v1::model::PullRequestReviewComment;
9202 /// let x = PullRequestReviewComment::new().set_id("example");
9203 /// ```
9204 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9205 self.id = v.into();
9206 self
9207 }
9208
9209 /// Sets the value of [body][crate::model::PullRequestReviewComment::body].
9210 ///
9211 /// # Example
9212 /// ```ignore,no_run
9213 /// # use google_cloud_developerconnect_v1::model::PullRequestReviewComment;
9214 /// let x = PullRequestReviewComment::new().set_body("example");
9215 /// ```
9216 pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9217 self.body = v.into();
9218 self
9219 }
9220
9221 /// Sets the value of [path][crate::model::PullRequestReviewComment::path].
9222 ///
9223 /// # Example
9224 /// ```ignore,no_run
9225 /// # use google_cloud_developerconnect_v1::model::PullRequestReviewComment;
9226 /// let x = PullRequestReviewComment::new().set_path("example");
9227 /// ```
9228 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9229 self.path = v.into();
9230 self
9231 }
9232
9233 /// Sets the value of [first_line][crate::model::PullRequestReviewComment::first_line].
9234 ///
9235 /// # Example
9236 /// ```ignore,no_run
9237 /// # use google_cloud_developerconnect_v1::model::PullRequestReviewComment;
9238 /// let x = PullRequestReviewComment::new().set_first_line(42);
9239 /// ```
9240 pub fn set_first_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9241 self.first_line = v.into();
9242 self
9243 }
9244
9245 /// Sets the value of [last_line][crate::model::PullRequestReviewComment::last_line].
9246 ///
9247 /// # Example
9248 /// ```ignore,no_run
9249 /// # use google_cloud_developerconnect_v1::model::PullRequestReviewComment;
9250 /// let x = PullRequestReviewComment::new().set_last_line(42);
9251 /// ```
9252 pub fn set_last_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9253 self.last_line = v.into();
9254 self
9255 }
9256
9257 /// Sets the value of [side][crate::model::PullRequestReviewComment::side].
9258 ///
9259 /// # Example
9260 /// ```ignore,no_run
9261 /// # use google_cloud_developerconnect_v1::model::PullRequestReviewComment;
9262 /// use google_cloud_developerconnect_v1::model::pull_request_review_comment::DiffSide;
9263 /// let x0 = PullRequestReviewComment::new().set_side(DiffSide::Base);
9264 /// let x1 = PullRequestReviewComment::new().set_side(DiffSide::Head);
9265 /// ```
9266 pub fn set_side<T: std::convert::Into<crate::model::pull_request_review_comment::DiffSide>>(
9267 mut self,
9268 v: T,
9269 ) -> Self {
9270 self.side = v.into();
9271 self
9272 }
9273
9274 /// Sets the value of [author][crate::model::PullRequestReviewComment::author].
9275 ///
9276 /// # Example
9277 /// ```ignore,no_run
9278 /// # use google_cloud_developerconnect_v1::model::PullRequestReviewComment;
9279 /// let x = PullRequestReviewComment::new().set_author("example");
9280 /// ```
9281 pub fn set_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9282 self.author = v.into();
9283 self
9284 }
9285
9286 /// Sets the value of [create_time][crate::model::PullRequestReviewComment::create_time].
9287 ///
9288 /// # Example
9289 /// ```ignore,no_run
9290 /// # use google_cloud_developerconnect_v1::model::PullRequestReviewComment;
9291 /// use wkt::Timestamp;
9292 /// let x = PullRequestReviewComment::new().set_create_time(Timestamp::default()/* use setters */);
9293 /// ```
9294 pub fn set_create_time<T>(mut self, v: T) -> Self
9295 where
9296 T: std::convert::Into<wkt::Timestamp>,
9297 {
9298 self.create_time = std::option::Option::Some(v.into());
9299 self
9300 }
9301
9302 /// Sets or clears the value of [create_time][crate::model::PullRequestReviewComment::create_time].
9303 ///
9304 /// # Example
9305 /// ```ignore,no_run
9306 /// # use google_cloud_developerconnect_v1::model::PullRequestReviewComment;
9307 /// use wkt::Timestamp;
9308 /// let x = PullRequestReviewComment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9309 /// let x = PullRequestReviewComment::new().set_or_clear_create_time(None::<Timestamp>);
9310 /// ```
9311 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9312 where
9313 T: std::convert::Into<wkt::Timestamp>,
9314 {
9315 self.create_time = v.map(|x| x.into());
9316 self
9317 }
9318
9319 /// Sets the value of [update_time][crate::model::PullRequestReviewComment::update_time].
9320 ///
9321 /// # Example
9322 /// ```ignore,no_run
9323 /// # use google_cloud_developerconnect_v1::model::PullRequestReviewComment;
9324 /// use wkt::Timestamp;
9325 /// let x = PullRequestReviewComment::new().set_update_time(Timestamp::default()/* use setters */);
9326 /// ```
9327 pub fn set_update_time<T>(mut self, v: T) -> Self
9328 where
9329 T: std::convert::Into<wkt::Timestamp>,
9330 {
9331 self.update_time = std::option::Option::Some(v.into());
9332 self
9333 }
9334
9335 /// Sets or clears the value of [update_time][crate::model::PullRequestReviewComment::update_time].
9336 ///
9337 /// # Example
9338 /// ```ignore,no_run
9339 /// # use google_cloud_developerconnect_v1::model::PullRequestReviewComment;
9340 /// use wkt::Timestamp;
9341 /// let x = PullRequestReviewComment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9342 /// let x = PullRequestReviewComment::new().set_or_clear_update_time(None::<Timestamp>);
9343 /// ```
9344 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9345 where
9346 T: std::convert::Into<wkt::Timestamp>,
9347 {
9348 self.update_time = v.map(|x| x.into());
9349 self
9350 }
9351
9352 /// Sets the value of [commit_id][crate::model::PullRequestReviewComment::commit_id].
9353 ///
9354 /// # Example
9355 /// ```ignore,no_run
9356 /// # use google_cloud_developerconnect_v1::model::PullRequestReviewComment;
9357 /// let x = PullRequestReviewComment::new().set_commit_id("example");
9358 /// ```
9359 pub fn set_commit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9360 self.commit_id = v.into();
9361 self
9362 }
9363}
9364
9365impl wkt::message::Message for PullRequestReviewComment {
9366 fn typename() -> &'static str {
9367 "type.googleapis.com/google.cloud.developerconnect.v1.PullRequestReviewComment"
9368 }
9369}
9370
9371/// Defines additional types related to [PullRequestReviewComment].
9372pub mod pull_request_review_comment {
9373 #[allow(unused_imports)]
9374 use super::*;
9375
9376 /// DiffSide represents which side of the diff the comment is on.
9377 ///
9378 /// # Working with unknown values
9379 ///
9380 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9381 /// additional enum variants at any time. Adding new variants is not considered
9382 /// a breaking change. Applications should write their code in anticipation of:
9383 ///
9384 /// - New values appearing in future releases of the client library, **and**
9385 /// - New values received dynamically, without application changes.
9386 ///
9387 /// Please consult the [Working with enums] section in the user guide for some
9388 /// guidelines.
9389 ///
9390 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9391 #[derive(Clone, Debug, PartialEq)]
9392 #[non_exhaustive]
9393 pub enum DiffSide {
9394 /// Default value. This value is unused.
9395 Unspecified,
9396 /// The side of the diff before changes (deleted or modified lines).
9397 Base,
9398 /// The side of the diff after changes (added or modified lines).
9399 Head,
9400 /// If set, the enum was initialized with an unknown value.
9401 ///
9402 /// Applications can examine the value using [DiffSide::value] or
9403 /// [DiffSide::name].
9404 UnknownValue(diff_side::UnknownValue),
9405 }
9406
9407 #[doc(hidden)]
9408 pub mod diff_side {
9409 #[allow(unused_imports)]
9410 use super::*;
9411 #[derive(Clone, Debug, PartialEq)]
9412 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9413 }
9414
9415 impl DiffSide {
9416 /// Gets the enum value.
9417 ///
9418 /// Returns `None` if the enum contains an unknown value deserialized from
9419 /// the string representation of enums.
9420 pub fn value(&self) -> std::option::Option<i32> {
9421 match self {
9422 Self::Unspecified => std::option::Option::Some(0),
9423 Self::Base => std::option::Option::Some(1),
9424 Self::Head => std::option::Option::Some(2),
9425 Self::UnknownValue(u) => u.0.value(),
9426 }
9427 }
9428
9429 /// Gets the enum value as a string.
9430 ///
9431 /// Returns `None` if the enum contains an unknown value deserialized from
9432 /// the integer representation of enums.
9433 pub fn name(&self) -> std::option::Option<&str> {
9434 match self {
9435 Self::Unspecified => std::option::Option::Some("DIFF_SIDE_UNSPECIFIED"),
9436 Self::Base => std::option::Option::Some("BASE"),
9437 Self::Head => std::option::Option::Some("HEAD"),
9438 Self::UnknownValue(u) => u.0.name(),
9439 }
9440 }
9441 }
9442
9443 impl std::default::Default for DiffSide {
9444 fn default() -> Self {
9445 use std::convert::From;
9446 Self::from(0)
9447 }
9448 }
9449
9450 impl std::fmt::Display for DiffSide {
9451 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9452 wkt::internal::display_enum(f, self.name(), self.value())
9453 }
9454 }
9455
9456 impl std::convert::From<i32> for DiffSide {
9457 fn from(value: i32) -> Self {
9458 match value {
9459 0 => Self::Unspecified,
9460 1 => Self::Base,
9461 2 => Self::Head,
9462 _ => Self::UnknownValue(diff_side::UnknownValue(
9463 wkt::internal::UnknownEnumValue::Integer(value),
9464 )),
9465 }
9466 }
9467 }
9468
9469 impl std::convert::From<&str> for DiffSide {
9470 fn from(value: &str) -> Self {
9471 use std::string::ToString;
9472 match value {
9473 "DIFF_SIDE_UNSPECIFIED" => Self::Unspecified,
9474 "BASE" => Self::Base,
9475 "HEAD" => Self::Head,
9476 _ => Self::UnknownValue(diff_side::UnknownValue(
9477 wkt::internal::UnknownEnumValue::String(value.to_string()),
9478 )),
9479 }
9480 }
9481 }
9482
9483 impl serde::ser::Serialize for DiffSide {
9484 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9485 where
9486 S: serde::Serializer,
9487 {
9488 match self {
9489 Self::Unspecified => serializer.serialize_i32(0),
9490 Self::Base => serializer.serialize_i32(1),
9491 Self::Head => serializer.serialize_i32(2),
9492 Self::UnknownValue(u) => u.0.serialize(serializer),
9493 }
9494 }
9495 }
9496
9497 impl<'de> serde::de::Deserialize<'de> for DiffSide {
9498 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9499 where
9500 D: serde::Deserializer<'de>,
9501 {
9502 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DiffSide>::new(
9503 ".google.cloud.developerconnect.v1.PullRequestReviewComment.DiffSide",
9504 ))
9505 }
9506 }
9507}
9508
9509/// Request message for AddGitRepositoryLinkPullRequestReviewComment.
9510#[derive(Clone, Default, PartialEq)]
9511#[non_exhaustive]
9512pub struct AddGitRepositoryLinkPullRequestReviewCommentRequest {
9513 /// Required. The resource name of the GitRepositoryLink in the format
9514 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
9515 pub name: std::string::String,
9516
9517 /// Required. The ID of the Pull Request.
9518 pub pull_request_id: std::string::String,
9519
9520 /// Required. The review comment to add.
9521 pub comment: std::option::Option<crate::model::PullRequestReviewComment>,
9522
9523 /// Optional. The commit SHA to comment on. If not specified, defaults to the
9524 /// HEAD commit of the Pull Request.
9525 pub commit_id: std::string::String,
9526
9527 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9528}
9529
9530impl AddGitRepositoryLinkPullRequestReviewCommentRequest {
9531 /// Creates a new default instance.
9532 pub fn new() -> Self {
9533 std::default::Default::default()
9534 }
9535
9536 /// Sets the value of [name][crate::model::AddGitRepositoryLinkPullRequestReviewCommentRequest::name].
9537 ///
9538 /// # Example
9539 /// ```ignore,no_run
9540 /// # use google_cloud_developerconnect_v1::model::AddGitRepositoryLinkPullRequestReviewCommentRequest;
9541 /// # let project_id = "project_id";
9542 /// # let location_id = "location_id";
9543 /// # let connection_id = "connection_id";
9544 /// # let git_repository_link_id = "git_repository_link_id";
9545 /// let x = AddGitRepositoryLinkPullRequestReviewCommentRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
9546 /// ```
9547 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9548 self.name = v.into();
9549 self
9550 }
9551
9552 /// Sets the value of [pull_request_id][crate::model::AddGitRepositoryLinkPullRequestReviewCommentRequest::pull_request_id].
9553 ///
9554 /// # Example
9555 /// ```ignore,no_run
9556 /// # use google_cloud_developerconnect_v1::model::AddGitRepositoryLinkPullRequestReviewCommentRequest;
9557 /// let x = AddGitRepositoryLinkPullRequestReviewCommentRequest::new().set_pull_request_id("example");
9558 /// ```
9559 pub fn set_pull_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9560 self.pull_request_id = v.into();
9561 self
9562 }
9563
9564 /// Sets the value of [comment][crate::model::AddGitRepositoryLinkPullRequestReviewCommentRequest::comment].
9565 ///
9566 /// # Example
9567 /// ```ignore,no_run
9568 /// # use google_cloud_developerconnect_v1::model::AddGitRepositoryLinkPullRequestReviewCommentRequest;
9569 /// use google_cloud_developerconnect_v1::model::PullRequestReviewComment;
9570 /// let x = AddGitRepositoryLinkPullRequestReviewCommentRequest::new().set_comment(PullRequestReviewComment::default()/* use setters */);
9571 /// ```
9572 pub fn set_comment<T>(mut self, v: T) -> Self
9573 where
9574 T: std::convert::Into<crate::model::PullRequestReviewComment>,
9575 {
9576 self.comment = std::option::Option::Some(v.into());
9577 self
9578 }
9579
9580 /// Sets or clears the value of [comment][crate::model::AddGitRepositoryLinkPullRequestReviewCommentRequest::comment].
9581 ///
9582 /// # Example
9583 /// ```ignore,no_run
9584 /// # use google_cloud_developerconnect_v1::model::AddGitRepositoryLinkPullRequestReviewCommentRequest;
9585 /// use google_cloud_developerconnect_v1::model::PullRequestReviewComment;
9586 /// let x = AddGitRepositoryLinkPullRequestReviewCommentRequest::new().set_or_clear_comment(Some(PullRequestReviewComment::default()/* use setters */));
9587 /// let x = AddGitRepositoryLinkPullRequestReviewCommentRequest::new().set_or_clear_comment(None::<PullRequestReviewComment>);
9588 /// ```
9589 pub fn set_or_clear_comment<T>(mut self, v: std::option::Option<T>) -> Self
9590 where
9591 T: std::convert::Into<crate::model::PullRequestReviewComment>,
9592 {
9593 self.comment = v.map(|x| x.into());
9594 self
9595 }
9596
9597 /// Sets the value of [commit_id][crate::model::AddGitRepositoryLinkPullRequestReviewCommentRequest::commit_id].
9598 ///
9599 /// # Example
9600 /// ```ignore,no_run
9601 /// # use google_cloud_developerconnect_v1::model::AddGitRepositoryLinkPullRequestReviewCommentRequest;
9602 /// let x = AddGitRepositoryLinkPullRequestReviewCommentRequest::new().set_commit_id("example");
9603 /// ```
9604 pub fn set_commit_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9605 self.commit_id = v.into();
9606 self
9607 }
9608}
9609
9610impl wkt::message::Message for AddGitRepositoryLinkPullRequestReviewCommentRequest {
9611 fn typename() -> &'static str {
9612 "type.googleapis.com/google.cloud.developerconnect.v1.AddGitRepositoryLinkPullRequestReviewCommentRequest"
9613 }
9614}
9615
9616/// Message for modifying SCM Pull Request.
9617#[derive(Clone, Default, PartialEq)]
9618#[non_exhaustive]
9619pub struct ModifyGitRepositoryLinkPullRequestRequest {
9620 /// Required. The GitRepositoryLink resource name in the format
9621 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
9622 pub name: std::string::String,
9623
9624 /// Required. The SCM-specific Pull Request identifier (e.g., "45").
9625 pub pull_request_id: std::string::String,
9626
9627 /// Optional. The title of the Pull Request.
9628 pub title: std::string::String,
9629
9630 /// Optional. The body description of the Pull Request.
9631 pub body: std::string::String,
9632
9633 /// Optional. The target branch to merge into.
9634 pub base_ref: std::string::String,
9635
9636 /// Optional. The state of the Pull Request.
9637 pub state: crate::model::modify_git_repository_link_pull_request_request::State,
9638
9639 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9640}
9641
9642impl ModifyGitRepositoryLinkPullRequestRequest {
9643 /// Creates a new default instance.
9644 pub fn new() -> Self {
9645 std::default::Default::default()
9646 }
9647
9648 /// Sets the value of [name][crate::model::ModifyGitRepositoryLinkPullRequestRequest::name].
9649 ///
9650 /// # Example
9651 /// ```ignore,no_run
9652 /// # use google_cloud_developerconnect_v1::model::ModifyGitRepositoryLinkPullRequestRequest;
9653 /// # let project_id = "project_id";
9654 /// # let location_id = "location_id";
9655 /// # let connection_id = "connection_id";
9656 /// # let git_repository_link_id = "git_repository_link_id";
9657 /// let x = ModifyGitRepositoryLinkPullRequestRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
9658 /// ```
9659 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9660 self.name = v.into();
9661 self
9662 }
9663
9664 /// Sets the value of [pull_request_id][crate::model::ModifyGitRepositoryLinkPullRequestRequest::pull_request_id].
9665 ///
9666 /// # Example
9667 /// ```ignore,no_run
9668 /// # use google_cloud_developerconnect_v1::model::ModifyGitRepositoryLinkPullRequestRequest;
9669 /// let x = ModifyGitRepositoryLinkPullRequestRequest::new().set_pull_request_id("example");
9670 /// ```
9671 pub fn set_pull_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9672 self.pull_request_id = v.into();
9673 self
9674 }
9675
9676 /// Sets the value of [title][crate::model::ModifyGitRepositoryLinkPullRequestRequest::title].
9677 ///
9678 /// # Example
9679 /// ```ignore,no_run
9680 /// # use google_cloud_developerconnect_v1::model::ModifyGitRepositoryLinkPullRequestRequest;
9681 /// let x = ModifyGitRepositoryLinkPullRequestRequest::new().set_title("example");
9682 /// ```
9683 pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9684 self.title = v.into();
9685 self
9686 }
9687
9688 /// Sets the value of [body][crate::model::ModifyGitRepositoryLinkPullRequestRequest::body].
9689 ///
9690 /// # Example
9691 /// ```ignore,no_run
9692 /// # use google_cloud_developerconnect_v1::model::ModifyGitRepositoryLinkPullRequestRequest;
9693 /// let x = ModifyGitRepositoryLinkPullRequestRequest::new().set_body("example");
9694 /// ```
9695 pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9696 self.body = v.into();
9697 self
9698 }
9699
9700 /// Sets the value of [base_ref][crate::model::ModifyGitRepositoryLinkPullRequestRequest::base_ref].
9701 ///
9702 /// # Example
9703 /// ```ignore,no_run
9704 /// # use google_cloud_developerconnect_v1::model::ModifyGitRepositoryLinkPullRequestRequest;
9705 /// let x = ModifyGitRepositoryLinkPullRequestRequest::new().set_base_ref("example");
9706 /// ```
9707 pub fn set_base_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9708 self.base_ref = v.into();
9709 self
9710 }
9711
9712 /// Sets the value of [state][crate::model::ModifyGitRepositoryLinkPullRequestRequest::state].
9713 ///
9714 /// # Example
9715 /// ```ignore,no_run
9716 /// # use google_cloud_developerconnect_v1::model::ModifyGitRepositoryLinkPullRequestRequest;
9717 /// use google_cloud_developerconnect_v1::model::modify_git_repository_link_pull_request_request::State;
9718 /// let x0 = ModifyGitRepositoryLinkPullRequestRequest::new().set_state(State::Open);
9719 /// let x1 = ModifyGitRepositoryLinkPullRequestRequest::new().set_state(State::Closed);
9720 /// ```
9721 pub fn set_state<
9722 T: std::convert::Into<crate::model::modify_git_repository_link_pull_request_request::State>,
9723 >(
9724 mut self,
9725 v: T,
9726 ) -> Self {
9727 self.state = v.into();
9728 self
9729 }
9730}
9731
9732impl wkt::message::Message for ModifyGitRepositoryLinkPullRequestRequest {
9733 fn typename() -> &'static str {
9734 "type.googleapis.com/google.cloud.developerconnect.v1.ModifyGitRepositoryLinkPullRequestRequest"
9735 }
9736}
9737
9738/// Defines additional types related to [ModifyGitRepositoryLinkPullRequestRequest].
9739pub mod modify_git_repository_link_pull_request_request {
9740 #[allow(unused_imports)]
9741 use super::*;
9742
9743 /// State represents the state of the pull request.
9744 ///
9745 /// # Working with unknown values
9746 ///
9747 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9748 /// additional enum variants at any time. Adding new variants is not considered
9749 /// a breaking change. Applications should write their code in anticipation of:
9750 ///
9751 /// - New values appearing in future releases of the client library, **and**
9752 /// - New values received dynamically, without application changes.
9753 ///
9754 /// Please consult the [Working with enums] section in the user guide for some
9755 /// guidelines.
9756 ///
9757 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9758 #[derive(Clone, Debug, PartialEq)]
9759 #[non_exhaustive]
9760 pub enum State {
9761 /// Default value. This value is unused.
9762 Unspecified,
9763 /// The pull request is open.
9764 Open,
9765 /// The pull request is closed.
9766 Closed,
9767 /// If set, the enum was initialized with an unknown value.
9768 ///
9769 /// Applications can examine the value using [State::value] or
9770 /// [State::name].
9771 UnknownValue(state::UnknownValue),
9772 }
9773
9774 #[doc(hidden)]
9775 pub mod state {
9776 #[allow(unused_imports)]
9777 use super::*;
9778 #[derive(Clone, Debug, PartialEq)]
9779 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9780 }
9781
9782 impl State {
9783 /// Gets the enum value.
9784 ///
9785 /// Returns `None` if the enum contains an unknown value deserialized from
9786 /// the string representation of enums.
9787 pub fn value(&self) -> std::option::Option<i32> {
9788 match self {
9789 Self::Unspecified => std::option::Option::Some(0),
9790 Self::Open => std::option::Option::Some(1),
9791 Self::Closed => std::option::Option::Some(2),
9792 Self::UnknownValue(u) => u.0.value(),
9793 }
9794 }
9795
9796 /// Gets the enum value as a string.
9797 ///
9798 /// Returns `None` if the enum contains an unknown value deserialized from
9799 /// the integer representation of enums.
9800 pub fn name(&self) -> std::option::Option<&str> {
9801 match self {
9802 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9803 Self::Open => std::option::Option::Some("OPEN"),
9804 Self::Closed => std::option::Option::Some("CLOSED"),
9805 Self::UnknownValue(u) => u.0.name(),
9806 }
9807 }
9808 }
9809
9810 impl std::default::Default for State {
9811 fn default() -> Self {
9812 use std::convert::From;
9813 Self::from(0)
9814 }
9815 }
9816
9817 impl std::fmt::Display for State {
9818 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9819 wkt::internal::display_enum(f, self.name(), self.value())
9820 }
9821 }
9822
9823 impl std::convert::From<i32> for State {
9824 fn from(value: i32) -> Self {
9825 match value {
9826 0 => Self::Unspecified,
9827 1 => Self::Open,
9828 2 => Self::Closed,
9829 _ => Self::UnknownValue(state::UnknownValue(
9830 wkt::internal::UnknownEnumValue::Integer(value),
9831 )),
9832 }
9833 }
9834 }
9835
9836 impl std::convert::From<&str> for State {
9837 fn from(value: &str) -> Self {
9838 use std::string::ToString;
9839 match value {
9840 "STATE_UNSPECIFIED" => Self::Unspecified,
9841 "OPEN" => Self::Open,
9842 "CLOSED" => Self::Closed,
9843 _ => Self::UnknownValue(state::UnknownValue(
9844 wkt::internal::UnknownEnumValue::String(value.to_string()),
9845 )),
9846 }
9847 }
9848 }
9849
9850 impl serde::ser::Serialize for State {
9851 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9852 where
9853 S: serde::Serializer,
9854 {
9855 match self {
9856 Self::Unspecified => serializer.serialize_i32(0),
9857 Self::Open => serializer.serialize_i32(1),
9858 Self::Closed => serializer.serialize_i32(2),
9859 Self::UnknownValue(u) => u.0.serialize(serializer),
9860 }
9861 }
9862 }
9863
9864 impl<'de> serde::de::Deserialize<'de> for State {
9865 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9866 where
9867 D: serde::Deserializer<'de>,
9868 {
9869 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9870 ".google.cloud.developerconnect.v1.ModifyGitRepositoryLinkPullRequestRequest.State",
9871 ))
9872 }
9873 }
9874}
9875
9876/// Request message for FetchGitRepositoryLinkPullRequestList.
9877#[derive(Clone, Default, PartialEq)]
9878#[non_exhaustive]
9879pub struct FetchGitRepositoryLinkPullRequestListRequest {
9880 /// Required. The GitRepositoryLink resource name in the format
9881 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
9882 pub name: std::string::String,
9883
9884 /// Optional. A filter expression that filters the pull requests returned in
9885 /// the response. Only a single equality comparison on `state` is supported,
9886 /// for example `state = "OPEN"`. Supported values are `OPEN`, `CLOSED`, and
9887 /// `MERGED`. `DECLINED` is only supported for SCM providers that support
9888 /// declining pull requests, and returns `INVALID_ARGUMENT` for GitHub, GitHub
9889 /// Enterprise, GitLab, and GitLab Enterprise. Other values or expressions
9890 /// return `INVALID_ARGUMENT`. Defaults to `state = "OPEN"` if unspecified.
9891 pub filter: std::string::String,
9892
9893 /// Optional. Number of results to return in the list. Default is 20. Max is
9894 /// 100. A page may contain fewer than `page_size` results even when more
9895 /// results are available; use `next_page_token` to check for more pages.
9896 pub page_size: i32,
9897
9898 /// Optional. A page token, received from a previous
9899 /// `FetchGitRepositoryLinkPullRequestList` call. Provide this to retrieve the
9900 /// subsequent page.
9901 pub page_token: std::string::String,
9902
9903 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9904}
9905
9906impl FetchGitRepositoryLinkPullRequestListRequest {
9907 /// Creates a new default instance.
9908 pub fn new() -> Self {
9909 std::default::Default::default()
9910 }
9911
9912 /// Sets the value of [name][crate::model::FetchGitRepositoryLinkPullRequestListRequest::name].
9913 ///
9914 /// # Example
9915 /// ```ignore,no_run
9916 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkPullRequestListRequest;
9917 /// # let project_id = "project_id";
9918 /// # let location_id = "location_id";
9919 /// # let connection_id = "connection_id";
9920 /// # let git_repository_link_id = "git_repository_link_id";
9921 /// let x = FetchGitRepositoryLinkPullRequestListRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
9922 /// ```
9923 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9924 self.name = v.into();
9925 self
9926 }
9927
9928 /// Sets the value of [filter][crate::model::FetchGitRepositoryLinkPullRequestListRequest::filter].
9929 ///
9930 /// # Example
9931 /// ```ignore,no_run
9932 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkPullRequestListRequest;
9933 /// let x = FetchGitRepositoryLinkPullRequestListRequest::new().set_filter("example");
9934 /// ```
9935 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9936 self.filter = v.into();
9937 self
9938 }
9939
9940 /// Sets the value of [page_size][crate::model::FetchGitRepositoryLinkPullRequestListRequest::page_size].
9941 ///
9942 /// # Example
9943 /// ```ignore,no_run
9944 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkPullRequestListRequest;
9945 /// let x = FetchGitRepositoryLinkPullRequestListRequest::new().set_page_size(42);
9946 /// ```
9947 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9948 self.page_size = v.into();
9949 self
9950 }
9951
9952 /// Sets the value of [page_token][crate::model::FetchGitRepositoryLinkPullRequestListRequest::page_token].
9953 ///
9954 /// # Example
9955 /// ```ignore,no_run
9956 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkPullRequestListRequest;
9957 /// let x = FetchGitRepositoryLinkPullRequestListRequest::new().set_page_token("example");
9958 /// ```
9959 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9960 self.page_token = v.into();
9961 self
9962 }
9963}
9964
9965impl wkt::message::Message for FetchGitRepositoryLinkPullRequestListRequest {
9966 fn typename() -> &'static str {
9967 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRepositoryLinkPullRequestListRequest"
9968 }
9969}
9970
9971/// Response message for FetchGitRepositoryLinkPullRequestList.
9972#[derive(Clone, Default, PartialEq)]
9973#[non_exhaustive]
9974pub struct FetchGitRepositoryLinkPullRequestListResponse {
9975 /// The list of Pull Requests.
9976 pub pull_requests: std::vec::Vec<crate::model::PullRequest>,
9977
9978 /// A token, which can be sent as `page_token` to retrieve the next page.
9979 /// If this field is omitted, there are no subsequent pages.
9980 pub next_page_token: std::string::String,
9981
9982 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9983}
9984
9985impl FetchGitRepositoryLinkPullRequestListResponse {
9986 /// Creates a new default instance.
9987 pub fn new() -> Self {
9988 std::default::Default::default()
9989 }
9990
9991 /// Sets the value of [pull_requests][crate::model::FetchGitRepositoryLinkPullRequestListResponse::pull_requests].
9992 ///
9993 /// # Example
9994 /// ```ignore,no_run
9995 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkPullRequestListResponse;
9996 /// use google_cloud_developerconnect_v1::model::PullRequest;
9997 /// let x = FetchGitRepositoryLinkPullRequestListResponse::new()
9998 /// .set_pull_requests([
9999 /// PullRequest::default()/* use setters */,
10000 /// PullRequest::default()/* use (different) setters */,
10001 /// ]);
10002 /// ```
10003 pub fn set_pull_requests<T, V>(mut self, v: T) -> Self
10004 where
10005 T: std::iter::IntoIterator<Item = V>,
10006 V: std::convert::Into<crate::model::PullRequest>,
10007 {
10008 use std::iter::Iterator;
10009 self.pull_requests = v.into_iter().map(|i| i.into()).collect();
10010 self
10011 }
10012
10013 /// Sets the value of [next_page_token][crate::model::FetchGitRepositoryLinkPullRequestListResponse::next_page_token].
10014 ///
10015 /// # Example
10016 /// ```ignore,no_run
10017 /// # use google_cloud_developerconnect_v1::model::FetchGitRepositoryLinkPullRequestListResponse;
10018 /// let x = FetchGitRepositoryLinkPullRequestListResponse::new().set_next_page_token("example");
10019 /// ```
10020 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10021 self.next_page_token = v.into();
10022 self
10023 }
10024}
10025
10026impl wkt::message::Message for FetchGitRepositoryLinkPullRequestListResponse {
10027 fn typename() -> &'static str {
10028 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRepositoryLinkPullRequestListResponse"
10029 }
10030}
10031
10032#[doc(hidden)]
10033impl google_cloud_gax::paginator::internal::PageableResponse
10034 for FetchGitRepositoryLinkPullRequestListResponse
10035{
10036 type PageItem = crate::model::PullRequest;
10037
10038 fn items(self) -> std::vec::Vec<Self::PageItem> {
10039 self.pull_requests
10040 }
10041
10042 fn next_page_token(&self) -> std::string::String {
10043 use std::clone::Clone;
10044 self.next_page_token.clone()
10045 }
10046}
10047
10048/// AccountConnector encapsulates what a platform administrator needs to
10049/// configure for users to connect to the service providers, which includes,
10050/// among other fields, the OAuth client ID, client secret, and authorization and
10051/// token endpoints.
10052#[derive(Clone, Default, PartialEq)]
10053#[non_exhaustive]
10054pub struct AccountConnector {
10055 /// Identifier. The resource name of the accountConnector, in the format
10056 /// `projects/{project}/locations/{location}/accountConnectors/{account_connector_id}`.
10057 pub name: std::string::String,
10058
10059 /// Output only. The timestamp when the accountConnector was created.
10060 pub create_time: std::option::Option<wkt::Timestamp>,
10061
10062 /// Output only. The timestamp when the accountConnector was updated.
10063 pub update_time: std::option::Option<wkt::Timestamp>,
10064
10065 /// Optional. Allows users to store small amounts of arbitrary data.
10066 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
10067
10068 /// Optional. This checksum is computed by the server based on the value of
10069 /// other fields, and may be sent on update and delete requests to ensure the
10070 /// client has an up-to-date value before proceeding.
10071 pub etag: std::string::String,
10072
10073 /// Optional. Labels as key value pairs
10074 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10075
10076 /// Output only. Start OAuth flow by clicking on this URL.
10077 pub oauth_start_uri: std::string::String,
10078
10079 /// The AccountConnector config.
10080 pub account_connector_config:
10081 std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
10082
10083 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10084}
10085
10086impl AccountConnector {
10087 /// Creates a new default instance.
10088 pub fn new() -> Self {
10089 std::default::Default::default()
10090 }
10091
10092 /// Sets the value of [name][crate::model::AccountConnector::name].
10093 ///
10094 /// # Example
10095 /// ```ignore,no_run
10096 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
10097 /// # let project_id = "project_id";
10098 /// # let location_id = "location_id";
10099 /// # let account_connector_id = "account_connector_id";
10100 /// let x = AccountConnector::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
10101 /// ```
10102 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10103 self.name = v.into();
10104 self
10105 }
10106
10107 /// Sets the value of [create_time][crate::model::AccountConnector::create_time].
10108 ///
10109 /// # Example
10110 /// ```ignore,no_run
10111 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
10112 /// use wkt::Timestamp;
10113 /// let x = AccountConnector::new().set_create_time(Timestamp::default()/* use setters */);
10114 /// ```
10115 pub fn set_create_time<T>(mut self, v: T) -> Self
10116 where
10117 T: std::convert::Into<wkt::Timestamp>,
10118 {
10119 self.create_time = std::option::Option::Some(v.into());
10120 self
10121 }
10122
10123 /// Sets or clears the value of [create_time][crate::model::AccountConnector::create_time].
10124 ///
10125 /// # Example
10126 /// ```ignore,no_run
10127 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
10128 /// use wkt::Timestamp;
10129 /// let x = AccountConnector::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10130 /// let x = AccountConnector::new().set_or_clear_create_time(None::<Timestamp>);
10131 /// ```
10132 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10133 where
10134 T: std::convert::Into<wkt::Timestamp>,
10135 {
10136 self.create_time = v.map(|x| x.into());
10137 self
10138 }
10139
10140 /// Sets the value of [update_time][crate::model::AccountConnector::update_time].
10141 ///
10142 /// # Example
10143 /// ```ignore,no_run
10144 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
10145 /// use wkt::Timestamp;
10146 /// let x = AccountConnector::new().set_update_time(Timestamp::default()/* use setters */);
10147 /// ```
10148 pub fn set_update_time<T>(mut self, v: T) -> Self
10149 where
10150 T: std::convert::Into<wkt::Timestamp>,
10151 {
10152 self.update_time = std::option::Option::Some(v.into());
10153 self
10154 }
10155
10156 /// Sets or clears the value of [update_time][crate::model::AccountConnector::update_time].
10157 ///
10158 /// # Example
10159 /// ```ignore,no_run
10160 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
10161 /// use wkt::Timestamp;
10162 /// let x = AccountConnector::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10163 /// let x = AccountConnector::new().set_or_clear_update_time(None::<Timestamp>);
10164 /// ```
10165 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10166 where
10167 T: std::convert::Into<wkt::Timestamp>,
10168 {
10169 self.update_time = v.map(|x| x.into());
10170 self
10171 }
10172
10173 /// Sets the value of [annotations][crate::model::AccountConnector::annotations].
10174 ///
10175 /// # Example
10176 /// ```ignore,no_run
10177 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
10178 /// let x = AccountConnector::new().set_annotations([
10179 /// ("key0", "abc"),
10180 /// ("key1", "xyz"),
10181 /// ]);
10182 /// ```
10183 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
10184 where
10185 T: std::iter::IntoIterator<Item = (K, V)>,
10186 K: std::convert::Into<std::string::String>,
10187 V: std::convert::Into<std::string::String>,
10188 {
10189 use std::iter::Iterator;
10190 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10191 self
10192 }
10193
10194 /// Sets the value of [etag][crate::model::AccountConnector::etag].
10195 ///
10196 /// # Example
10197 /// ```ignore,no_run
10198 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
10199 /// let x = AccountConnector::new().set_etag("example");
10200 /// ```
10201 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10202 self.etag = v.into();
10203 self
10204 }
10205
10206 /// Sets the value of [labels][crate::model::AccountConnector::labels].
10207 ///
10208 /// # Example
10209 /// ```ignore,no_run
10210 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
10211 /// let x = AccountConnector::new().set_labels([
10212 /// ("key0", "abc"),
10213 /// ("key1", "xyz"),
10214 /// ]);
10215 /// ```
10216 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10217 where
10218 T: std::iter::IntoIterator<Item = (K, V)>,
10219 K: std::convert::Into<std::string::String>,
10220 V: std::convert::Into<std::string::String>,
10221 {
10222 use std::iter::Iterator;
10223 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10224 self
10225 }
10226
10227 /// Sets the value of [oauth_start_uri][crate::model::AccountConnector::oauth_start_uri].
10228 ///
10229 /// # Example
10230 /// ```ignore,no_run
10231 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
10232 /// let x = AccountConnector::new().set_oauth_start_uri("example");
10233 /// ```
10234 pub fn set_oauth_start_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10235 self.oauth_start_uri = v.into();
10236 self
10237 }
10238
10239 /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config].
10240 ///
10241 /// Note that all the setters affecting `account_connector_config` are mutually
10242 /// exclusive.
10243 ///
10244 /// # Example
10245 /// ```ignore,no_run
10246 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
10247 /// use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
10248 /// let x = AccountConnector::new().set_account_connector_config(Some(
10249 /// google_cloud_developerconnect_v1::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(ProviderOAuthConfig::default().into())));
10250 /// ```
10251 pub fn set_account_connector_config<
10252 T: std::convert::Into<
10253 std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
10254 >,
10255 >(
10256 mut self,
10257 v: T,
10258 ) -> Self {
10259 self.account_connector_config = v.into();
10260 self
10261 }
10262
10263 /// The value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
10264 /// if it holds a `ProviderOauthConfig`, `None` if the field is not set or
10265 /// holds a different branch.
10266 pub fn provider_oauth_config(
10267 &self,
10268 ) -> std::option::Option<&std::boxed::Box<crate::model::ProviderOAuthConfig>> {
10269 #[allow(unreachable_patterns)]
10270 self.account_connector_config
10271 .as_ref()
10272 .and_then(|v| match v {
10273 crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v) => {
10274 std::option::Option::Some(v)
10275 }
10276 _ => std::option::Option::None,
10277 })
10278 }
10279
10280 /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
10281 /// to hold a `ProviderOauthConfig`.
10282 ///
10283 /// Note that all the setters affecting `account_connector_config` are
10284 /// mutually exclusive.
10285 ///
10286 /// # Example
10287 /// ```ignore,no_run
10288 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
10289 /// use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
10290 /// let x = AccountConnector::new().set_provider_oauth_config(ProviderOAuthConfig::default()/* use setters */);
10291 /// assert!(x.provider_oauth_config().is_some());
10292 /// ```
10293 pub fn set_provider_oauth_config<
10294 T: std::convert::Into<std::boxed::Box<crate::model::ProviderOAuthConfig>>,
10295 >(
10296 mut self,
10297 v: T,
10298 ) -> Self {
10299 self.account_connector_config = std::option::Option::Some(
10300 crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v.into()),
10301 );
10302 self
10303 }
10304}
10305
10306impl wkt::message::Message for AccountConnector {
10307 fn typename() -> &'static str {
10308 "type.googleapis.com/google.cloud.developerconnect.v1.AccountConnector"
10309 }
10310}
10311
10312/// Defines additional types related to [AccountConnector].
10313pub mod account_connector {
10314 #[allow(unused_imports)]
10315 use super::*;
10316
10317 /// The AccountConnector config.
10318 #[derive(Clone, Debug, PartialEq)]
10319 #[non_exhaustive]
10320 pub enum AccountConnectorConfig {
10321 /// Optional. Provider OAuth config.
10322 ProviderOauthConfig(std::boxed::Box<crate::model::ProviderOAuthConfig>),
10323 }
10324}
10325
10326/// User represents a user connected to the service providers through
10327/// a AccountConnector.
10328#[derive(Clone, Default, PartialEq)]
10329#[non_exhaustive]
10330pub struct User {
10331 /// Identifier. Resource name of the user, in the format
10332 /// `projects/*/locations/*/accountConnectors/*/users/*`.
10333 pub name: std::string::String,
10334
10335 /// Output only. Developer Connect automatically converts user identity
10336 /// to some human readable description, e.g., email address.
10337 pub display_name: std::string::String,
10338
10339 /// Output only. The timestamp when the user was created.
10340 pub create_time: std::option::Option<wkt::Timestamp>,
10341
10342 /// Output only. The timestamp when the token was last requested.
10343 pub last_token_request_time: std::option::Option<wkt::Timestamp>,
10344
10345 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10346}
10347
10348impl User {
10349 /// Creates a new default instance.
10350 pub fn new() -> Self {
10351 std::default::Default::default()
10352 }
10353
10354 /// Sets the value of [name][crate::model::User::name].
10355 ///
10356 /// # Example
10357 /// ```ignore,no_run
10358 /// # use google_cloud_developerconnect_v1::model::User;
10359 /// # let project_id = "project_id";
10360 /// # let location_id = "location_id";
10361 /// # let account_connector_id = "account_connector_id";
10362 /// # let user_id = "user_id";
10363 /// let x = User::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}/users/{user_id}"));
10364 /// ```
10365 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10366 self.name = v.into();
10367 self
10368 }
10369
10370 /// Sets the value of [display_name][crate::model::User::display_name].
10371 ///
10372 /// # Example
10373 /// ```ignore,no_run
10374 /// # use google_cloud_developerconnect_v1::model::User;
10375 /// let x = User::new().set_display_name("example");
10376 /// ```
10377 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10378 self.display_name = v.into();
10379 self
10380 }
10381
10382 /// Sets the value of [create_time][crate::model::User::create_time].
10383 ///
10384 /// # Example
10385 /// ```ignore,no_run
10386 /// # use google_cloud_developerconnect_v1::model::User;
10387 /// use wkt::Timestamp;
10388 /// let x = User::new().set_create_time(Timestamp::default()/* use setters */);
10389 /// ```
10390 pub fn set_create_time<T>(mut self, v: T) -> Self
10391 where
10392 T: std::convert::Into<wkt::Timestamp>,
10393 {
10394 self.create_time = std::option::Option::Some(v.into());
10395 self
10396 }
10397
10398 /// Sets or clears the value of [create_time][crate::model::User::create_time].
10399 ///
10400 /// # Example
10401 /// ```ignore,no_run
10402 /// # use google_cloud_developerconnect_v1::model::User;
10403 /// use wkt::Timestamp;
10404 /// let x = User::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10405 /// let x = User::new().set_or_clear_create_time(None::<Timestamp>);
10406 /// ```
10407 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10408 where
10409 T: std::convert::Into<wkt::Timestamp>,
10410 {
10411 self.create_time = v.map(|x| x.into());
10412 self
10413 }
10414
10415 /// Sets the value of [last_token_request_time][crate::model::User::last_token_request_time].
10416 ///
10417 /// # Example
10418 /// ```ignore,no_run
10419 /// # use google_cloud_developerconnect_v1::model::User;
10420 /// use wkt::Timestamp;
10421 /// let x = User::new().set_last_token_request_time(Timestamp::default()/* use setters */);
10422 /// ```
10423 pub fn set_last_token_request_time<T>(mut self, v: T) -> Self
10424 where
10425 T: std::convert::Into<wkt::Timestamp>,
10426 {
10427 self.last_token_request_time = std::option::Option::Some(v.into());
10428 self
10429 }
10430
10431 /// Sets or clears the value of [last_token_request_time][crate::model::User::last_token_request_time].
10432 ///
10433 /// # Example
10434 /// ```ignore,no_run
10435 /// # use google_cloud_developerconnect_v1::model::User;
10436 /// use wkt::Timestamp;
10437 /// let x = User::new().set_or_clear_last_token_request_time(Some(Timestamp::default()/* use setters */));
10438 /// let x = User::new().set_or_clear_last_token_request_time(None::<Timestamp>);
10439 /// ```
10440 pub fn set_or_clear_last_token_request_time<T>(mut self, v: std::option::Option<T>) -> Self
10441 where
10442 T: std::convert::Into<wkt::Timestamp>,
10443 {
10444 self.last_token_request_time = v.map(|x| x.into());
10445 self
10446 }
10447}
10448
10449impl wkt::message::Message for User {
10450 fn typename() -> &'static str {
10451 "type.googleapis.com/google.cloud.developerconnect.v1.User"
10452 }
10453}
10454
10455/// ProviderOAuthConfig is the OAuth config for a provider.
10456#[derive(Clone, Default, PartialEq)]
10457#[non_exhaustive]
10458pub struct ProviderOAuthConfig {
10459 /// Required. User selected scopes to apply to the Oauth config
10460 /// In the event of changing scopes, user records under AccountConnector will
10461 /// be deleted and users will re-auth again.
10462 pub scopes: std::vec::Vec<std::string::String>,
10463
10464 /// OAuth Provider ID. It could be Developer Connect owned or providers
10465 /// provided.
10466 pub oauth_provider_id:
10467 std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
10468
10469 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10470}
10471
10472impl ProviderOAuthConfig {
10473 /// Creates a new default instance.
10474 pub fn new() -> Self {
10475 std::default::Default::default()
10476 }
10477
10478 /// Sets the value of [scopes][crate::model::ProviderOAuthConfig::scopes].
10479 ///
10480 /// # Example
10481 /// ```ignore,no_run
10482 /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
10483 /// let x = ProviderOAuthConfig::new().set_scopes(["a", "b", "c"]);
10484 /// ```
10485 pub fn set_scopes<T, V>(mut self, v: T) -> Self
10486 where
10487 T: std::iter::IntoIterator<Item = V>,
10488 V: std::convert::Into<std::string::String>,
10489 {
10490 use std::iter::Iterator;
10491 self.scopes = v.into_iter().map(|i| i.into()).collect();
10492 self
10493 }
10494
10495 /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id].
10496 ///
10497 /// Note that all the setters affecting `oauth_provider_id` are mutually
10498 /// exclusive.
10499 ///
10500 /// # Example
10501 /// ```ignore,no_run
10502 /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
10503 /// use google_cloud_developerconnect_v1::model::SystemProvider;
10504 /// let x0 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
10505 /// google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Github)));
10506 /// let x1 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
10507 /// google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Gitlab)));
10508 /// let x2 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
10509 /// google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Google)));
10510 /// ```
10511 pub fn set_oauth_provider_id<
10512 T: std::convert::Into<
10513 std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
10514 >,
10515 >(
10516 mut self,
10517 v: T,
10518 ) -> Self {
10519 self.oauth_provider_id = v.into();
10520 self
10521 }
10522
10523 /// The value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
10524 /// if it holds a `SystemProviderId`, `None` if the field is not set or
10525 /// holds a different branch.
10526 pub fn system_provider_id(&self) -> std::option::Option<&crate::model::SystemProvider> {
10527 #[allow(unreachable_patterns)]
10528 self.oauth_provider_id.as_ref().and_then(|v| match v {
10529 crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v) => {
10530 std::option::Option::Some(v)
10531 }
10532 _ => std::option::Option::None,
10533 })
10534 }
10535
10536 /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
10537 /// to hold a `SystemProviderId`.
10538 ///
10539 /// Note that all the setters affecting `oauth_provider_id` are
10540 /// mutually exclusive.
10541 ///
10542 /// # Example
10543 /// ```ignore,no_run
10544 /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
10545 /// use google_cloud_developerconnect_v1::model::SystemProvider;
10546 /// let x0 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Github);
10547 /// let x1 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Gitlab);
10548 /// let x2 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Google);
10549 /// assert!(x0.system_provider_id().is_some());
10550 /// assert!(x1.system_provider_id().is_some());
10551 /// assert!(x2.system_provider_id().is_some());
10552 /// ```
10553 pub fn set_system_provider_id<T: std::convert::Into<crate::model::SystemProvider>>(
10554 mut self,
10555 v: T,
10556 ) -> Self {
10557 self.oauth_provider_id = std::option::Option::Some(
10558 crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v.into()),
10559 );
10560 self
10561 }
10562}
10563
10564impl wkt::message::Message for ProviderOAuthConfig {
10565 fn typename() -> &'static str {
10566 "type.googleapis.com/google.cloud.developerconnect.v1.ProviderOAuthConfig"
10567 }
10568}
10569
10570/// Defines additional types related to [ProviderOAuthConfig].
10571pub mod provider_o_auth_config {
10572 #[allow(unused_imports)]
10573 use super::*;
10574
10575 /// OAuth Provider ID. It could be Developer Connect owned or providers
10576 /// provided.
10577 #[derive(Clone, Debug, PartialEq)]
10578 #[non_exhaustive]
10579 pub enum OauthProviderId {
10580 /// Optional. Immutable. Developer Connect provided OAuth.
10581 SystemProviderId(crate::model::SystemProvider),
10582 }
10583}
10584
10585/// The InsightsConfig resource is the core configuration object to capture
10586/// events from your Software Development Lifecycle. It acts as the central hub
10587/// for managing how Developer Connect understands your application, its runtime
10588/// environments, and the artifacts deployed within them.
10589#[derive(Clone, Default, PartialEq)]
10590#[non_exhaustive]
10591pub struct InsightsConfig {
10592 /// Identifier. The name of the InsightsConfig.
10593 /// Format:
10594 /// projects/{project}/locations/{location}/insightsConfigs/{insightsConfig}
10595 pub name: std::string::String,
10596
10597 /// Output only. Create timestamp.
10598 pub create_time: std::option::Option<wkt::Timestamp>,
10599
10600 /// Output only. Update timestamp.
10601 pub update_time: std::option::Option<wkt::Timestamp>,
10602
10603 /// Output only. The runtime configurations where the application is deployed.
10604 pub runtime_configs: std::vec::Vec<crate::model::RuntimeConfig>,
10605
10606 /// Optional. The artifact configurations of the artifacts that are deployed.
10607 pub artifact_configs: std::vec::Vec<crate::model::ArtifactConfig>,
10608
10609 /// Optional. Output only. The state of the InsightsConfig.
10610 pub state: crate::model::insights_config::State,
10611
10612 /// Optional. User specified annotations. See
10613 /// <https://google.aip.dev/148#annotations> for more details such as format and
10614 /// size limitations.
10615 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
10616
10617 /// Optional. Set of labels associated with an InsightsConfig.
10618 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10619
10620 /// Output only. Reconciling (<https://google.aip.dev/128#reconciliation>).
10621 /// Set to true if the current state of InsightsConfig does not match the
10622 /// user's intended state, and the service is actively updating the resource to
10623 /// reconcile them. This can happen due to user-triggered updates or
10624 /// system actions like failover or maintenance.
10625 pub reconciling: bool,
10626
10627 /// Output only. Any errors that occurred while setting up the InsightsConfig.
10628 /// Each error will be in the format: `field_name: error_message`, e.g.
10629 /// GetAppHubApplication: Permission denied while getting App Hub
10630 /// application. Please grant permissions to the P4SA.
10631 pub errors: std::vec::Vec<google_cloud_rpc::model::Status>,
10632
10633 /// The context of the InsightsConfig.
10634 pub insights_config_context:
10635 std::option::Option<crate::model::insights_config::InsightsConfigContext>,
10636
10637 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10638}
10639
10640impl InsightsConfig {
10641 /// Creates a new default instance.
10642 pub fn new() -> Self {
10643 std::default::Default::default()
10644 }
10645
10646 /// Sets the value of [name][crate::model::InsightsConfig::name].
10647 ///
10648 /// # Example
10649 /// ```ignore,no_run
10650 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
10651 /// # let project_id = "project_id";
10652 /// # let location_id = "location_id";
10653 /// # let insights_config_id = "insights_config_id";
10654 /// let x = InsightsConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"));
10655 /// ```
10656 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10657 self.name = v.into();
10658 self
10659 }
10660
10661 /// Sets the value of [create_time][crate::model::InsightsConfig::create_time].
10662 ///
10663 /// # Example
10664 /// ```ignore,no_run
10665 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
10666 /// use wkt::Timestamp;
10667 /// let x = InsightsConfig::new().set_create_time(Timestamp::default()/* use setters */);
10668 /// ```
10669 pub fn set_create_time<T>(mut self, v: T) -> Self
10670 where
10671 T: std::convert::Into<wkt::Timestamp>,
10672 {
10673 self.create_time = std::option::Option::Some(v.into());
10674 self
10675 }
10676
10677 /// Sets or clears the value of [create_time][crate::model::InsightsConfig::create_time].
10678 ///
10679 /// # Example
10680 /// ```ignore,no_run
10681 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
10682 /// use wkt::Timestamp;
10683 /// let x = InsightsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10684 /// let x = InsightsConfig::new().set_or_clear_create_time(None::<Timestamp>);
10685 /// ```
10686 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10687 where
10688 T: std::convert::Into<wkt::Timestamp>,
10689 {
10690 self.create_time = v.map(|x| x.into());
10691 self
10692 }
10693
10694 /// Sets the value of [update_time][crate::model::InsightsConfig::update_time].
10695 ///
10696 /// # Example
10697 /// ```ignore,no_run
10698 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
10699 /// use wkt::Timestamp;
10700 /// let x = InsightsConfig::new().set_update_time(Timestamp::default()/* use setters */);
10701 /// ```
10702 pub fn set_update_time<T>(mut self, v: T) -> Self
10703 where
10704 T: std::convert::Into<wkt::Timestamp>,
10705 {
10706 self.update_time = std::option::Option::Some(v.into());
10707 self
10708 }
10709
10710 /// Sets or clears the value of [update_time][crate::model::InsightsConfig::update_time].
10711 ///
10712 /// # Example
10713 /// ```ignore,no_run
10714 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
10715 /// use wkt::Timestamp;
10716 /// let x = InsightsConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10717 /// let x = InsightsConfig::new().set_or_clear_update_time(None::<Timestamp>);
10718 /// ```
10719 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10720 where
10721 T: std::convert::Into<wkt::Timestamp>,
10722 {
10723 self.update_time = v.map(|x| x.into());
10724 self
10725 }
10726
10727 /// Sets the value of [runtime_configs][crate::model::InsightsConfig::runtime_configs].
10728 ///
10729 /// # Example
10730 /// ```ignore,no_run
10731 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
10732 /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
10733 /// let x = InsightsConfig::new()
10734 /// .set_runtime_configs([
10735 /// RuntimeConfig::default()/* use setters */,
10736 /// RuntimeConfig::default()/* use (different) setters */,
10737 /// ]);
10738 /// ```
10739 pub fn set_runtime_configs<T, V>(mut self, v: T) -> Self
10740 where
10741 T: std::iter::IntoIterator<Item = V>,
10742 V: std::convert::Into<crate::model::RuntimeConfig>,
10743 {
10744 use std::iter::Iterator;
10745 self.runtime_configs = v.into_iter().map(|i| i.into()).collect();
10746 self
10747 }
10748
10749 /// Sets the value of [artifact_configs][crate::model::InsightsConfig::artifact_configs].
10750 ///
10751 /// # Example
10752 /// ```ignore,no_run
10753 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
10754 /// use google_cloud_developerconnect_v1::model::ArtifactConfig;
10755 /// let x = InsightsConfig::new()
10756 /// .set_artifact_configs([
10757 /// ArtifactConfig::default()/* use setters */,
10758 /// ArtifactConfig::default()/* use (different) setters */,
10759 /// ]);
10760 /// ```
10761 pub fn set_artifact_configs<T, V>(mut self, v: T) -> Self
10762 where
10763 T: std::iter::IntoIterator<Item = V>,
10764 V: std::convert::Into<crate::model::ArtifactConfig>,
10765 {
10766 use std::iter::Iterator;
10767 self.artifact_configs = v.into_iter().map(|i| i.into()).collect();
10768 self
10769 }
10770
10771 /// Sets the value of [state][crate::model::InsightsConfig::state].
10772 ///
10773 /// # Example
10774 /// ```ignore,no_run
10775 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
10776 /// use google_cloud_developerconnect_v1::model::insights_config::State;
10777 /// let x0 = InsightsConfig::new().set_state(State::Pending);
10778 /// let x1 = InsightsConfig::new().set_state(State::Complete);
10779 /// let x2 = InsightsConfig::new().set_state(State::Error);
10780 /// ```
10781 pub fn set_state<T: std::convert::Into<crate::model::insights_config::State>>(
10782 mut self,
10783 v: T,
10784 ) -> Self {
10785 self.state = v.into();
10786 self
10787 }
10788
10789 /// Sets the value of [annotations][crate::model::InsightsConfig::annotations].
10790 ///
10791 /// # Example
10792 /// ```ignore,no_run
10793 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
10794 /// let x = InsightsConfig::new().set_annotations([
10795 /// ("key0", "abc"),
10796 /// ("key1", "xyz"),
10797 /// ]);
10798 /// ```
10799 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
10800 where
10801 T: std::iter::IntoIterator<Item = (K, V)>,
10802 K: std::convert::Into<std::string::String>,
10803 V: std::convert::Into<std::string::String>,
10804 {
10805 use std::iter::Iterator;
10806 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10807 self
10808 }
10809
10810 /// Sets the value of [labels][crate::model::InsightsConfig::labels].
10811 ///
10812 /// # Example
10813 /// ```ignore,no_run
10814 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
10815 /// let x = InsightsConfig::new().set_labels([
10816 /// ("key0", "abc"),
10817 /// ("key1", "xyz"),
10818 /// ]);
10819 /// ```
10820 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10821 where
10822 T: std::iter::IntoIterator<Item = (K, V)>,
10823 K: std::convert::Into<std::string::String>,
10824 V: std::convert::Into<std::string::String>,
10825 {
10826 use std::iter::Iterator;
10827 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10828 self
10829 }
10830
10831 /// Sets the value of [reconciling][crate::model::InsightsConfig::reconciling].
10832 ///
10833 /// # Example
10834 /// ```ignore,no_run
10835 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
10836 /// let x = InsightsConfig::new().set_reconciling(true);
10837 /// ```
10838 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10839 self.reconciling = v.into();
10840 self
10841 }
10842
10843 /// Sets the value of [errors][crate::model::InsightsConfig::errors].
10844 ///
10845 /// # Example
10846 /// ```ignore,no_run
10847 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
10848 /// use google_cloud_rpc::model::Status;
10849 /// let x = InsightsConfig::new()
10850 /// .set_errors([
10851 /// Status::default()/* use setters */,
10852 /// Status::default()/* use (different) setters */,
10853 /// ]);
10854 /// ```
10855 pub fn set_errors<T, V>(mut self, v: T) -> Self
10856 where
10857 T: std::iter::IntoIterator<Item = V>,
10858 V: std::convert::Into<google_cloud_rpc::model::Status>,
10859 {
10860 use std::iter::Iterator;
10861 self.errors = v.into_iter().map(|i| i.into()).collect();
10862 self
10863 }
10864
10865 /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context].
10866 ///
10867 /// Note that all the setters affecting `insights_config_context` are mutually
10868 /// exclusive.
10869 ///
10870 /// # Example
10871 /// ```ignore,no_run
10872 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
10873 /// use google_cloud_developerconnect_v1::model::insights_config::InsightsConfigContext;
10874 /// let x = InsightsConfig::new().set_insights_config_context(Some(InsightsConfigContext::AppHubApplication("example".to_string())));
10875 /// ```
10876 pub fn set_insights_config_context<
10877 T: std::convert::Into<
10878 std::option::Option<crate::model::insights_config::InsightsConfigContext>,
10879 >,
10880 >(
10881 mut self,
10882 v: T,
10883 ) -> Self {
10884 self.insights_config_context = v.into();
10885 self
10886 }
10887
10888 /// The value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
10889 /// if it holds a `AppHubApplication`, `None` if the field is not set or
10890 /// holds a different branch.
10891 pub fn app_hub_application(&self) -> std::option::Option<&std::string::String> {
10892 #[allow(unreachable_patterns)]
10893 self.insights_config_context.as_ref().and_then(|v| match v {
10894 crate::model::insights_config::InsightsConfigContext::AppHubApplication(v) => {
10895 std::option::Option::Some(v)
10896 }
10897 _ => std::option::Option::None,
10898 })
10899 }
10900
10901 /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
10902 /// to hold a `AppHubApplication`.
10903 ///
10904 /// Note that all the setters affecting `insights_config_context` are
10905 /// mutually exclusive.
10906 ///
10907 /// # Example
10908 /// ```ignore,no_run
10909 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
10910 /// let x = InsightsConfig::new().set_app_hub_application("example");
10911 /// assert!(x.app_hub_application().is_some());
10912 /// assert!(x.projects().is_none());
10913 /// ```
10914 pub fn set_app_hub_application<T: std::convert::Into<std::string::String>>(
10915 mut self,
10916 v: T,
10917 ) -> Self {
10918 self.insights_config_context = std::option::Option::Some(
10919 crate::model::insights_config::InsightsConfigContext::AppHubApplication(v.into()),
10920 );
10921 self
10922 }
10923
10924 /// The value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
10925 /// if it holds a `Projects`, `None` if the field is not set or
10926 /// holds a different branch.
10927 pub fn projects(&self) -> std::option::Option<&std::boxed::Box<crate::model::Projects>> {
10928 #[allow(unreachable_patterns)]
10929 self.insights_config_context.as_ref().and_then(|v| match v {
10930 crate::model::insights_config::InsightsConfigContext::Projects(v) => {
10931 std::option::Option::Some(v)
10932 }
10933 _ => std::option::Option::None,
10934 })
10935 }
10936
10937 /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
10938 /// to hold a `Projects`.
10939 ///
10940 /// Note that all the setters affecting `insights_config_context` are
10941 /// mutually exclusive.
10942 ///
10943 /// # Example
10944 /// ```ignore,no_run
10945 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
10946 /// use google_cloud_developerconnect_v1::model::Projects;
10947 /// let x = InsightsConfig::new().set_projects(Projects::default()/* use setters */);
10948 /// assert!(x.projects().is_some());
10949 /// assert!(x.app_hub_application().is_none());
10950 /// ```
10951 pub fn set_projects<T: std::convert::Into<std::boxed::Box<crate::model::Projects>>>(
10952 mut self,
10953 v: T,
10954 ) -> Self {
10955 self.insights_config_context = std::option::Option::Some(
10956 crate::model::insights_config::InsightsConfigContext::Projects(v.into()),
10957 );
10958 self
10959 }
10960}
10961
10962impl wkt::message::Message for InsightsConfig {
10963 fn typename() -> &'static str {
10964 "type.googleapis.com/google.cloud.developerconnect.v1.InsightsConfig"
10965 }
10966}
10967
10968/// Defines additional types related to [InsightsConfig].
10969pub mod insights_config {
10970 #[allow(unused_imports)]
10971 use super::*;
10972
10973 /// The state of the InsightsConfig.
10974 ///
10975 /// # Working with unknown values
10976 ///
10977 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10978 /// additional enum variants at any time. Adding new variants is not considered
10979 /// a breaking change. Applications should write their code in anticipation of:
10980 ///
10981 /// - New values appearing in future releases of the client library, **and**
10982 /// - New values received dynamically, without application changes.
10983 ///
10984 /// Please consult the [Working with enums] section in the user guide for some
10985 /// guidelines.
10986 ///
10987 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10988 #[derive(Clone, Debug, PartialEq)]
10989 #[non_exhaustive]
10990 pub enum State {
10991 /// No state specified.
10992 Unspecified,
10993 /// The InsightsConfig is pending application discovery/runtime discovery.
10994 Pending,
10995 /// The initial discovery process is complete.
10996 Complete,
10997 /// The InsightsConfig is in an error state.
10998 Error,
10999 /// If set, the enum was initialized with an unknown value.
11000 ///
11001 /// Applications can examine the value using [State::value] or
11002 /// [State::name].
11003 UnknownValue(state::UnknownValue),
11004 }
11005
11006 #[doc(hidden)]
11007 pub mod state {
11008 #[allow(unused_imports)]
11009 use super::*;
11010 #[derive(Clone, Debug, PartialEq)]
11011 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11012 }
11013
11014 impl State {
11015 /// Gets the enum value.
11016 ///
11017 /// Returns `None` if the enum contains an unknown value deserialized from
11018 /// the string representation of enums.
11019 pub fn value(&self) -> std::option::Option<i32> {
11020 match self {
11021 Self::Unspecified => std::option::Option::Some(0),
11022 Self::Pending => std::option::Option::Some(5),
11023 Self::Complete => std::option::Option::Some(3),
11024 Self::Error => std::option::Option::Some(4),
11025 Self::UnknownValue(u) => u.0.value(),
11026 }
11027 }
11028
11029 /// Gets the enum value as a string.
11030 ///
11031 /// Returns `None` if the enum contains an unknown value deserialized from
11032 /// the integer representation of enums.
11033 pub fn name(&self) -> std::option::Option<&str> {
11034 match self {
11035 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11036 Self::Pending => std::option::Option::Some("PENDING"),
11037 Self::Complete => std::option::Option::Some("COMPLETE"),
11038 Self::Error => std::option::Option::Some("ERROR"),
11039 Self::UnknownValue(u) => u.0.name(),
11040 }
11041 }
11042 }
11043
11044 impl std::default::Default for State {
11045 fn default() -> Self {
11046 use std::convert::From;
11047 Self::from(0)
11048 }
11049 }
11050
11051 impl std::fmt::Display for State {
11052 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11053 wkt::internal::display_enum(f, self.name(), self.value())
11054 }
11055 }
11056
11057 impl std::convert::From<i32> for State {
11058 fn from(value: i32) -> Self {
11059 match value {
11060 0 => Self::Unspecified,
11061 3 => Self::Complete,
11062 4 => Self::Error,
11063 5 => Self::Pending,
11064 _ => Self::UnknownValue(state::UnknownValue(
11065 wkt::internal::UnknownEnumValue::Integer(value),
11066 )),
11067 }
11068 }
11069 }
11070
11071 impl std::convert::From<&str> for State {
11072 fn from(value: &str) -> Self {
11073 use std::string::ToString;
11074 match value {
11075 "STATE_UNSPECIFIED" => Self::Unspecified,
11076 "PENDING" => Self::Pending,
11077 "COMPLETE" => Self::Complete,
11078 "ERROR" => Self::Error,
11079 _ => Self::UnknownValue(state::UnknownValue(
11080 wkt::internal::UnknownEnumValue::String(value.to_string()),
11081 )),
11082 }
11083 }
11084 }
11085
11086 impl serde::ser::Serialize for State {
11087 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11088 where
11089 S: serde::Serializer,
11090 {
11091 match self {
11092 Self::Unspecified => serializer.serialize_i32(0),
11093 Self::Pending => serializer.serialize_i32(5),
11094 Self::Complete => serializer.serialize_i32(3),
11095 Self::Error => serializer.serialize_i32(4),
11096 Self::UnknownValue(u) => u.0.serialize(serializer),
11097 }
11098 }
11099 }
11100
11101 impl<'de> serde::de::Deserialize<'de> for State {
11102 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11103 where
11104 D: serde::Deserializer<'de>,
11105 {
11106 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11107 ".google.cloud.developerconnect.v1.InsightsConfig.State",
11108 ))
11109 }
11110 }
11111
11112 /// The context of the InsightsConfig.
11113 #[derive(Clone, Debug, PartialEq)]
11114 #[non_exhaustive]
11115 pub enum InsightsConfigContext {
11116 /// Optional. The name of the App Hub Application.
11117 /// Format:
11118 /// projects/{project}/locations/{location}/applications/{application}
11119 AppHubApplication(std::string::String),
11120 /// Optional. The projects to track with the InsightsConfig.
11121 Projects(std::boxed::Box<crate::model::Projects>),
11122 }
11123}
11124
11125/// Projects represents the projects to track with the InsightsConfig.
11126#[derive(Clone, Default, PartialEq)]
11127#[non_exhaustive]
11128pub struct Projects {
11129 /// Optional. The project IDs.
11130 /// Format: {project}
11131 pub project_ids: std::vec::Vec<std::string::String>,
11132
11133 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11134}
11135
11136impl Projects {
11137 /// Creates a new default instance.
11138 pub fn new() -> Self {
11139 std::default::Default::default()
11140 }
11141
11142 /// Sets the value of [project_ids][crate::model::Projects::project_ids].
11143 ///
11144 /// # Example
11145 /// ```ignore,no_run
11146 /// # use google_cloud_developerconnect_v1::model::Projects;
11147 /// let x = Projects::new().set_project_ids(["a", "b", "c"]);
11148 /// ```
11149 pub fn set_project_ids<T, V>(mut self, v: T) -> Self
11150 where
11151 T: std::iter::IntoIterator<Item = V>,
11152 V: std::convert::Into<std::string::String>,
11153 {
11154 use std::iter::Iterator;
11155 self.project_ids = v.into_iter().map(|i| i.into()).collect();
11156 self
11157 }
11158}
11159
11160impl wkt::message::Message for Projects {
11161 fn typename() -> &'static str {
11162 "type.googleapis.com/google.cloud.developerconnect.v1.Projects"
11163 }
11164}
11165
11166/// RuntimeConfig represents the runtimes where the application is
11167/// deployed.
11168#[derive(Clone, Default, PartialEq)]
11169#[non_exhaustive]
11170pub struct RuntimeConfig {
11171 /// Required. Immutable. The URI of the runtime configuration.
11172 /// For GKE, this is the cluster name.
11173 /// For Cloud Run, this is the service name.
11174 pub uri: std::string::String,
11175
11176 /// Output only. The state of the Runtime.
11177 pub state: crate::model::runtime_config::State,
11178
11179 /// The type of the runtime.
11180 pub runtime: std::option::Option<crate::model::runtime_config::Runtime>,
11181
11182 /// Where the runtime is derived from.
11183 pub derived_from: std::option::Option<crate::model::runtime_config::DerivedFrom>,
11184
11185 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11186}
11187
11188impl RuntimeConfig {
11189 /// Creates a new default instance.
11190 pub fn new() -> Self {
11191 std::default::Default::default()
11192 }
11193
11194 /// Sets the value of [uri][crate::model::RuntimeConfig::uri].
11195 ///
11196 /// # Example
11197 /// ```ignore,no_run
11198 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
11199 /// let x = RuntimeConfig::new().set_uri("example");
11200 /// ```
11201 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11202 self.uri = v.into();
11203 self
11204 }
11205
11206 /// Sets the value of [state][crate::model::RuntimeConfig::state].
11207 ///
11208 /// # Example
11209 /// ```ignore,no_run
11210 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
11211 /// use google_cloud_developerconnect_v1::model::runtime_config::State;
11212 /// let x0 = RuntimeConfig::new().set_state(State::Linked);
11213 /// let x1 = RuntimeConfig::new().set_state(State::Unlinked);
11214 /// ```
11215 pub fn set_state<T: std::convert::Into<crate::model::runtime_config::State>>(
11216 mut self,
11217 v: T,
11218 ) -> Self {
11219 self.state = v.into();
11220 self
11221 }
11222
11223 /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime].
11224 ///
11225 /// Note that all the setters affecting `runtime` are mutually
11226 /// exclusive.
11227 ///
11228 /// # Example
11229 /// ```ignore,no_run
11230 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
11231 /// use google_cloud_developerconnect_v1::model::GKEWorkload;
11232 /// let x = RuntimeConfig::new().set_runtime(Some(
11233 /// google_cloud_developerconnect_v1::model::runtime_config::Runtime::GkeWorkload(GKEWorkload::default().into())));
11234 /// ```
11235 pub fn set_runtime<
11236 T: std::convert::Into<std::option::Option<crate::model::runtime_config::Runtime>>,
11237 >(
11238 mut self,
11239 v: T,
11240 ) -> Self {
11241 self.runtime = v.into();
11242 self
11243 }
11244
11245 /// The value of [runtime][crate::model::RuntimeConfig::runtime]
11246 /// if it holds a `GkeWorkload`, `None` if the field is not set or
11247 /// holds a different branch.
11248 pub fn gke_workload(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEWorkload>> {
11249 #[allow(unreachable_patterns)]
11250 self.runtime.as_ref().and_then(|v| match v {
11251 crate::model::runtime_config::Runtime::GkeWorkload(v) => std::option::Option::Some(v),
11252 _ => std::option::Option::None,
11253 })
11254 }
11255
11256 /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime]
11257 /// to hold a `GkeWorkload`.
11258 ///
11259 /// Note that all the setters affecting `runtime` are
11260 /// mutually exclusive.
11261 ///
11262 /// # Example
11263 /// ```ignore,no_run
11264 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
11265 /// use google_cloud_developerconnect_v1::model::GKEWorkload;
11266 /// let x = RuntimeConfig::new().set_gke_workload(GKEWorkload::default()/* use setters */);
11267 /// assert!(x.gke_workload().is_some());
11268 /// assert!(x.google_cloud_run().is_none());
11269 /// ```
11270 pub fn set_gke_workload<T: std::convert::Into<std::boxed::Box<crate::model::GKEWorkload>>>(
11271 mut self,
11272 v: T,
11273 ) -> Self {
11274 self.runtime =
11275 std::option::Option::Some(crate::model::runtime_config::Runtime::GkeWorkload(v.into()));
11276 self
11277 }
11278
11279 /// The value of [runtime][crate::model::RuntimeConfig::runtime]
11280 /// if it holds a `GoogleCloudRun`, `None` if the field is not set or
11281 /// holds a different branch.
11282 pub fn google_cloud_run(
11283 &self,
11284 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleCloudRun>> {
11285 #[allow(unreachable_patterns)]
11286 self.runtime.as_ref().and_then(|v| match v {
11287 crate::model::runtime_config::Runtime::GoogleCloudRun(v) => {
11288 std::option::Option::Some(v)
11289 }
11290 _ => std::option::Option::None,
11291 })
11292 }
11293
11294 /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime]
11295 /// to hold a `GoogleCloudRun`.
11296 ///
11297 /// Note that all the setters affecting `runtime` are
11298 /// mutually exclusive.
11299 ///
11300 /// # Example
11301 /// ```ignore,no_run
11302 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
11303 /// use google_cloud_developerconnect_v1::model::GoogleCloudRun;
11304 /// let x = RuntimeConfig::new().set_google_cloud_run(GoogleCloudRun::default()/* use setters */);
11305 /// assert!(x.google_cloud_run().is_some());
11306 /// assert!(x.gke_workload().is_none());
11307 /// ```
11308 pub fn set_google_cloud_run<
11309 T: std::convert::Into<std::boxed::Box<crate::model::GoogleCloudRun>>,
11310 >(
11311 mut self,
11312 v: T,
11313 ) -> Self {
11314 self.runtime = std::option::Option::Some(
11315 crate::model::runtime_config::Runtime::GoogleCloudRun(v.into()),
11316 );
11317 self
11318 }
11319
11320 /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from].
11321 ///
11322 /// Note that all the setters affecting `derived_from` are mutually
11323 /// exclusive.
11324 ///
11325 /// # Example
11326 /// ```ignore,no_run
11327 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
11328 /// use google_cloud_developerconnect_v1::model::AppHubWorkload;
11329 /// let x = RuntimeConfig::new().set_derived_from(Some(
11330 /// google_cloud_developerconnect_v1::model::runtime_config::DerivedFrom::AppHubWorkload(AppHubWorkload::default().into())));
11331 /// ```
11332 pub fn set_derived_from<
11333 T: std::convert::Into<std::option::Option<crate::model::runtime_config::DerivedFrom>>,
11334 >(
11335 mut self,
11336 v: T,
11337 ) -> Self {
11338 self.derived_from = v.into();
11339 self
11340 }
11341
11342 /// The value of [derived_from][crate::model::RuntimeConfig::derived_from]
11343 /// if it holds a `AppHubWorkload`, `None` if the field is not set or
11344 /// holds a different branch.
11345 pub fn app_hub_workload(
11346 &self,
11347 ) -> std::option::Option<&std::boxed::Box<crate::model::AppHubWorkload>> {
11348 #[allow(unreachable_patterns)]
11349 self.derived_from.as_ref().and_then(|v| match v {
11350 crate::model::runtime_config::DerivedFrom::AppHubWorkload(v) => {
11351 std::option::Option::Some(v)
11352 }
11353 _ => std::option::Option::None,
11354 })
11355 }
11356
11357 /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from]
11358 /// to hold a `AppHubWorkload`.
11359 ///
11360 /// Note that all the setters affecting `derived_from` are
11361 /// mutually exclusive.
11362 ///
11363 /// # Example
11364 /// ```ignore,no_run
11365 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
11366 /// use google_cloud_developerconnect_v1::model::AppHubWorkload;
11367 /// let x = RuntimeConfig::new().set_app_hub_workload(AppHubWorkload::default()/* use setters */);
11368 /// assert!(x.app_hub_workload().is_some());
11369 /// assert!(x.app_hub_service().is_none());
11370 /// ```
11371 pub fn set_app_hub_workload<
11372 T: std::convert::Into<std::boxed::Box<crate::model::AppHubWorkload>>,
11373 >(
11374 mut self,
11375 v: T,
11376 ) -> Self {
11377 self.derived_from = std::option::Option::Some(
11378 crate::model::runtime_config::DerivedFrom::AppHubWorkload(v.into()),
11379 );
11380 self
11381 }
11382
11383 /// The value of [derived_from][crate::model::RuntimeConfig::derived_from]
11384 /// if it holds a `AppHubService`, `None` if the field is not set or
11385 /// holds a different branch.
11386 pub fn app_hub_service(
11387 &self,
11388 ) -> std::option::Option<&std::boxed::Box<crate::model::AppHubService>> {
11389 #[allow(unreachable_patterns)]
11390 self.derived_from.as_ref().and_then(|v| match v {
11391 crate::model::runtime_config::DerivedFrom::AppHubService(v) => {
11392 std::option::Option::Some(v)
11393 }
11394 _ => std::option::Option::None,
11395 })
11396 }
11397
11398 /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from]
11399 /// to hold a `AppHubService`.
11400 ///
11401 /// Note that all the setters affecting `derived_from` are
11402 /// mutually exclusive.
11403 ///
11404 /// # Example
11405 /// ```ignore,no_run
11406 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
11407 /// use google_cloud_developerconnect_v1::model::AppHubService;
11408 /// let x = RuntimeConfig::new().set_app_hub_service(AppHubService::default()/* use setters */);
11409 /// assert!(x.app_hub_service().is_some());
11410 /// assert!(x.app_hub_workload().is_none());
11411 /// ```
11412 pub fn set_app_hub_service<
11413 T: std::convert::Into<std::boxed::Box<crate::model::AppHubService>>,
11414 >(
11415 mut self,
11416 v: T,
11417 ) -> Self {
11418 self.derived_from = std::option::Option::Some(
11419 crate::model::runtime_config::DerivedFrom::AppHubService(v.into()),
11420 );
11421 self
11422 }
11423}
11424
11425impl wkt::message::Message for RuntimeConfig {
11426 fn typename() -> &'static str {
11427 "type.googleapis.com/google.cloud.developerconnect.v1.RuntimeConfig"
11428 }
11429}
11430
11431/// Defines additional types related to [RuntimeConfig].
11432pub mod runtime_config {
11433 #[allow(unused_imports)]
11434 use super::*;
11435
11436 /// The state of the runtime in the InsightsConfig.
11437 /// Whether the runtime is linked to the InsightsConfig.
11438 ///
11439 /// # Working with unknown values
11440 ///
11441 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11442 /// additional enum variants at any time. Adding new variants is not considered
11443 /// a breaking change. Applications should write their code in anticipation of:
11444 ///
11445 /// - New values appearing in future releases of the client library, **and**
11446 /// - New values received dynamically, without application changes.
11447 ///
11448 /// Please consult the [Working with enums] section in the user guide for some
11449 /// guidelines.
11450 ///
11451 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11452 #[derive(Clone, Debug, PartialEq)]
11453 #[non_exhaustive]
11454 pub enum State {
11455 /// No state specified.
11456 Unspecified,
11457 /// The runtime configuration has been linked to the InsightsConfig.
11458 Linked,
11459 /// The runtime configuration has been unlinked to the InsightsConfig.
11460 Unlinked,
11461 /// If set, the enum was initialized with an unknown value.
11462 ///
11463 /// Applications can examine the value using [State::value] or
11464 /// [State::name].
11465 UnknownValue(state::UnknownValue),
11466 }
11467
11468 #[doc(hidden)]
11469 pub mod state {
11470 #[allow(unused_imports)]
11471 use super::*;
11472 #[derive(Clone, Debug, PartialEq)]
11473 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11474 }
11475
11476 impl State {
11477 /// Gets the enum value.
11478 ///
11479 /// Returns `None` if the enum contains an unknown value deserialized from
11480 /// the string representation of enums.
11481 pub fn value(&self) -> std::option::Option<i32> {
11482 match self {
11483 Self::Unspecified => std::option::Option::Some(0),
11484 Self::Linked => std::option::Option::Some(1),
11485 Self::Unlinked => std::option::Option::Some(2),
11486 Self::UnknownValue(u) => u.0.value(),
11487 }
11488 }
11489
11490 /// Gets the enum value as a string.
11491 ///
11492 /// Returns `None` if the enum contains an unknown value deserialized from
11493 /// the integer representation of enums.
11494 pub fn name(&self) -> std::option::Option<&str> {
11495 match self {
11496 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11497 Self::Linked => std::option::Option::Some("LINKED"),
11498 Self::Unlinked => std::option::Option::Some("UNLINKED"),
11499 Self::UnknownValue(u) => u.0.name(),
11500 }
11501 }
11502 }
11503
11504 impl std::default::Default for State {
11505 fn default() -> Self {
11506 use std::convert::From;
11507 Self::from(0)
11508 }
11509 }
11510
11511 impl std::fmt::Display for State {
11512 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11513 wkt::internal::display_enum(f, self.name(), self.value())
11514 }
11515 }
11516
11517 impl std::convert::From<i32> for State {
11518 fn from(value: i32) -> Self {
11519 match value {
11520 0 => Self::Unspecified,
11521 1 => Self::Linked,
11522 2 => Self::Unlinked,
11523 _ => Self::UnknownValue(state::UnknownValue(
11524 wkt::internal::UnknownEnumValue::Integer(value),
11525 )),
11526 }
11527 }
11528 }
11529
11530 impl std::convert::From<&str> for State {
11531 fn from(value: &str) -> Self {
11532 use std::string::ToString;
11533 match value {
11534 "STATE_UNSPECIFIED" => Self::Unspecified,
11535 "LINKED" => Self::Linked,
11536 "UNLINKED" => Self::Unlinked,
11537 _ => Self::UnknownValue(state::UnknownValue(
11538 wkt::internal::UnknownEnumValue::String(value.to_string()),
11539 )),
11540 }
11541 }
11542 }
11543
11544 impl serde::ser::Serialize for State {
11545 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11546 where
11547 S: serde::Serializer,
11548 {
11549 match self {
11550 Self::Unspecified => serializer.serialize_i32(0),
11551 Self::Linked => serializer.serialize_i32(1),
11552 Self::Unlinked => serializer.serialize_i32(2),
11553 Self::UnknownValue(u) => u.0.serialize(serializer),
11554 }
11555 }
11556 }
11557
11558 impl<'de> serde::de::Deserialize<'de> for State {
11559 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11560 where
11561 D: serde::Deserializer<'de>,
11562 {
11563 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11564 ".google.cloud.developerconnect.v1.RuntimeConfig.State",
11565 ))
11566 }
11567 }
11568
11569 /// The type of the runtime.
11570 #[derive(Clone, Debug, PartialEq)]
11571 #[non_exhaustive]
11572 pub enum Runtime {
11573 /// Output only. Google Kubernetes Engine runtime.
11574 GkeWorkload(std::boxed::Box<crate::model::GKEWorkload>),
11575 /// Output only. Cloud Run runtime.
11576 GoogleCloudRun(std::boxed::Box<crate::model::GoogleCloudRun>),
11577 }
11578
11579 /// Where the runtime is derived from.
11580 #[derive(Clone, Debug, PartialEq)]
11581 #[non_exhaustive]
11582 pub enum DerivedFrom {
11583 /// Output only. App Hub Workload.
11584 AppHubWorkload(std::boxed::Box<crate::model::AppHubWorkload>),
11585 /// Output only. App Hub Service.
11586 AppHubService(std::boxed::Box<crate::model::AppHubService>),
11587 }
11588}
11589
11590/// GKEWorkload represents the Google Kubernetes Engine runtime.
11591#[derive(Clone, Default, PartialEq)]
11592#[non_exhaustive]
11593pub struct GKEWorkload {
11594 /// Required. Immutable. The name of the GKE cluster.
11595 /// Format:
11596 /// `projects/{project}/locations/{location}/clusters/{cluster}`.
11597 pub cluster: std::string::String,
11598
11599 /// Output only. The name of the GKE deployment.
11600 /// Format:
11601 /// `projects/{project}/locations/{location}/clusters/{cluster}/namespaces/{namespace}/deployments/{deployment}`.
11602 pub deployment: std::string::String,
11603
11604 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11605}
11606
11607impl GKEWorkload {
11608 /// Creates a new default instance.
11609 pub fn new() -> Self {
11610 std::default::Default::default()
11611 }
11612
11613 /// Sets the value of [cluster][crate::model::GKEWorkload::cluster].
11614 ///
11615 /// # Example
11616 /// ```ignore,no_run
11617 /// # use google_cloud_developerconnect_v1::model::GKEWorkload;
11618 /// let x = GKEWorkload::new().set_cluster("example");
11619 /// ```
11620 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11621 self.cluster = v.into();
11622 self
11623 }
11624
11625 /// Sets the value of [deployment][crate::model::GKEWorkload::deployment].
11626 ///
11627 /// # Example
11628 /// ```ignore,no_run
11629 /// # use google_cloud_developerconnect_v1::model::GKEWorkload;
11630 /// let x = GKEWorkload::new().set_deployment("example");
11631 /// ```
11632 pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11633 self.deployment = v.into();
11634 self
11635 }
11636}
11637
11638impl wkt::message::Message for GKEWorkload {
11639 fn typename() -> &'static str {
11640 "type.googleapis.com/google.cloud.developerconnect.v1.GKEWorkload"
11641 }
11642}
11643
11644/// GoogleCloudRun represents the Cloud Run runtime.
11645#[derive(Clone, Default, PartialEq)]
11646#[non_exhaustive]
11647pub struct GoogleCloudRun {
11648 /// Required. Immutable. The name of the Cloud Run service.
11649 /// Format:
11650 /// `projects/{project}/locations/{location}/services/{service}`.
11651 pub service_uri: std::string::String,
11652
11653 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11654}
11655
11656impl GoogleCloudRun {
11657 /// Creates a new default instance.
11658 pub fn new() -> Self {
11659 std::default::Default::default()
11660 }
11661
11662 /// Sets the value of [service_uri][crate::model::GoogleCloudRun::service_uri].
11663 ///
11664 /// # Example
11665 /// ```ignore,no_run
11666 /// # use google_cloud_developerconnect_v1::model::GoogleCloudRun;
11667 /// let x = GoogleCloudRun::new().set_service_uri("example");
11668 /// ```
11669 pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11670 self.service_uri = v.into();
11671 self
11672 }
11673}
11674
11675impl wkt::message::Message for GoogleCloudRun {
11676 fn typename() -> &'static str {
11677 "type.googleapis.com/google.cloud.developerconnect.v1.GoogleCloudRun"
11678 }
11679}
11680
11681/// AppHubWorkload represents the App Hub Workload.
11682#[derive(Clone, Default, PartialEq)]
11683#[non_exhaustive]
11684pub struct AppHubWorkload {
11685 /// Required. Output only. Immutable. The name of the App Hub Workload.
11686 /// Format:
11687 /// `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
11688 pub workload: std::string::String,
11689
11690 /// Output only. The criticality of the App Hub Workload.
11691 pub criticality: std::string::String,
11692
11693 /// Output only. The environment of the App Hub Workload.
11694 pub environment: std::string::String,
11695
11696 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11697}
11698
11699impl AppHubWorkload {
11700 /// Creates a new default instance.
11701 pub fn new() -> Self {
11702 std::default::Default::default()
11703 }
11704
11705 /// Sets the value of [workload][crate::model::AppHubWorkload::workload].
11706 ///
11707 /// # Example
11708 /// ```ignore,no_run
11709 /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
11710 /// let x = AppHubWorkload::new().set_workload("example");
11711 /// ```
11712 pub fn set_workload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11713 self.workload = v.into();
11714 self
11715 }
11716
11717 /// Sets the value of [criticality][crate::model::AppHubWorkload::criticality].
11718 ///
11719 /// # Example
11720 /// ```ignore,no_run
11721 /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
11722 /// let x = AppHubWorkload::new().set_criticality("example");
11723 /// ```
11724 pub fn set_criticality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11725 self.criticality = v.into();
11726 self
11727 }
11728
11729 /// Sets the value of [environment][crate::model::AppHubWorkload::environment].
11730 ///
11731 /// # Example
11732 /// ```ignore,no_run
11733 /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
11734 /// let x = AppHubWorkload::new().set_environment("example");
11735 /// ```
11736 pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11737 self.environment = v.into();
11738 self
11739 }
11740}
11741
11742impl wkt::message::Message for AppHubWorkload {
11743 fn typename() -> &'static str {
11744 "type.googleapis.com/google.cloud.developerconnect.v1.AppHubWorkload"
11745 }
11746}
11747
11748/// AppHubService represents the App Hub Service.
11749#[derive(Clone, Default, PartialEq)]
11750#[non_exhaustive]
11751pub struct AppHubService {
11752 /// Required. Output only. Immutable. The name of the App Hub Service.
11753 /// Format:
11754 /// `projects/{project}/locations/{location}/applications/{application}/services/{service}`.
11755 pub apphub_service: std::string::String,
11756
11757 /// Output only. The criticality of the App Hub Service.
11758 pub criticality: std::string::String,
11759
11760 /// Output only. The environment of the App Hub Service.
11761 pub environment: std::string::String,
11762
11763 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11764}
11765
11766impl AppHubService {
11767 /// Creates a new default instance.
11768 pub fn new() -> Self {
11769 std::default::Default::default()
11770 }
11771
11772 /// Sets the value of [apphub_service][crate::model::AppHubService::apphub_service].
11773 ///
11774 /// # Example
11775 /// ```ignore,no_run
11776 /// # use google_cloud_developerconnect_v1::model::AppHubService;
11777 /// let x = AppHubService::new().set_apphub_service("example");
11778 /// ```
11779 pub fn set_apphub_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11780 self.apphub_service = v.into();
11781 self
11782 }
11783
11784 /// Sets the value of [criticality][crate::model::AppHubService::criticality].
11785 ///
11786 /// # Example
11787 /// ```ignore,no_run
11788 /// # use google_cloud_developerconnect_v1::model::AppHubService;
11789 /// let x = AppHubService::new().set_criticality("example");
11790 /// ```
11791 pub fn set_criticality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11792 self.criticality = v.into();
11793 self
11794 }
11795
11796 /// Sets the value of [environment][crate::model::AppHubService::environment].
11797 ///
11798 /// # Example
11799 /// ```ignore,no_run
11800 /// # use google_cloud_developerconnect_v1::model::AppHubService;
11801 /// let x = AppHubService::new().set_environment("example");
11802 /// ```
11803 pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11804 self.environment = v.into();
11805 self
11806 }
11807}
11808
11809impl wkt::message::Message for AppHubService {
11810 fn typename() -> &'static str {
11811 "type.googleapis.com/google.cloud.developerconnect.v1.AppHubService"
11812 }
11813}
11814
11815/// The artifact config of the artifact that is deployed.
11816#[derive(Clone, Default, PartialEq)]
11817#[non_exhaustive]
11818pub struct ArtifactConfig {
11819 /// Required. Immutable. The URI of the artifact that is deployed.
11820 /// e.g. `us-docker.pkg.dev/my-project/my-repo/image`.
11821 /// The URI does not include the tag / digest because it captures a lineage of
11822 /// artifacts.
11823 pub uri: std::string::String,
11824
11825 /// The storage location of the artifact.
11826 pub artifact_storage: std::option::Option<crate::model::artifact_config::ArtifactStorage>,
11827
11828 /// The storage location of the artifact metadata.
11829 pub artifact_metadata_storage:
11830 std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
11831
11832 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11833}
11834
11835impl ArtifactConfig {
11836 /// Creates a new default instance.
11837 pub fn new() -> Self {
11838 std::default::Default::default()
11839 }
11840
11841 /// Sets the value of [uri][crate::model::ArtifactConfig::uri].
11842 ///
11843 /// # Example
11844 /// ```ignore,no_run
11845 /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
11846 /// let x = ArtifactConfig::new().set_uri("example");
11847 /// ```
11848 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11849 self.uri = v.into();
11850 self
11851 }
11852
11853 /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage].
11854 ///
11855 /// Note that all the setters affecting `artifact_storage` are mutually
11856 /// exclusive.
11857 ///
11858 /// # Example
11859 /// ```ignore,no_run
11860 /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
11861 /// use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
11862 /// let x = ArtifactConfig::new().set_artifact_storage(Some(
11863 /// google_cloud_developerconnect_v1::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(GoogleArtifactRegistry::default().into())));
11864 /// ```
11865 pub fn set_artifact_storage<
11866 T: std::convert::Into<std::option::Option<crate::model::artifact_config::ArtifactStorage>>,
11867 >(
11868 mut self,
11869 v: T,
11870 ) -> Self {
11871 self.artifact_storage = v.into();
11872 self
11873 }
11874
11875 /// The value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
11876 /// if it holds a `GoogleArtifactRegistry`, `None` if the field is not set or
11877 /// holds a different branch.
11878 pub fn google_artifact_registry(
11879 &self,
11880 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactRegistry>> {
11881 #[allow(unreachable_patterns)]
11882 self.artifact_storage.as_ref().and_then(|v| match v {
11883 crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v) => {
11884 std::option::Option::Some(v)
11885 }
11886 _ => std::option::Option::None,
11887 })
11888 }
11889
11890 /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
11891 /// to hold a `GoogleArtifactRegistry`.
11892 ///
11893 /// Note that all the setters affecting `artifact_storage` are
11894 /// mutually exclusive.
11895 ///
11896 /// # Example
11897 /// ```ignore,no_run
11898 /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
11899 /// use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
11900 /// let x = ArtifactConfig::new().set_google_artifact_registry(GoogleArtifactRegistry::default()/* use setters */);
11901 /// assert!(x.google_artifact_registry().is_some());
11902 /// ```
11903 pub fn set_google_artifact_registry<
11904 T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactRegistry>>,
11905 >(
11906 mut self,
11907 v: T,
11908 ) -> Self {
11909 self.artifact_storage = std::option::Option::Some(
11910 crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v.into()),
11911 );
11912 self
11913 }
11914
11915 /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage].
11916 ///
11917 /// Note that all the setters affecting `artifact_metadata_storage` are mutually
11918 /// exclusive.
11919 ///
11920 /// # Example
11921 /// ```ignore,no_run
11922 /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
11923 /// use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
11924 /// let x = ArtifactConfig::new().set_artifact_metadata_storage(Some(
11925 /// google_cloud_developerconnect_v1::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(GoogleArtifactAnalysis::default().into())));
11926 /// ```
11927 pub fn set_artifact_metadata_storage<
11928 T: std::convert::Into<
11929 std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
11930 >,
11931 >(
11932 mut self,
11933 v: T,
11934 ) -> Self {
11935 self.artifact_metadata_storage = v.into();
11936 self
11937 }
11938
11939 /// The value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
11940 /// if it holds a `GoogleArtifactAnalysis`, `None` if the field is not set or
11941 /// holds a different branch.
11942 pub fn google_artifact_analysis(
11943 &self,
11944 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactAnalysis>> {
11945 #[allow(unreachable_patterns)]
11946 self.artifact_metadata_storage
11947 .as_ref()
11948 .and_then(|v| match v {
11949 crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
11950 v,
11951 ) => std::option::Option::Some(v),
11952 _ => std::option::Option::None,
11953 })
11954 }
11955
11956 /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
11957 /// to hold a `GoogleArtifactAnalysis`.
11958 ///
11959 /// Note that all the setters affecting `artifact_metadata_storage` are
11960 /// mutually exclusive.
11961 ///
11962 /// # Example
11963 /// ```ignore,no_run
11964 /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
11965 /// use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
11966 /// let x = ArtifactConfig::new().set_google_artifact_analysis(GoogleArtifactAnalysis::default()/* use setters */);
11967 /// assert!(x.google_artifact_analysis().is_some());
11968 /// ```
11969 pub fn set_google_artifact_analysis<
11970 T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactAnalysis>>,
11971 >(
11972 mut self,
11973 v: T,
11974 ) -> Self {
11975 self.artifact_metadata_storage = std::option::Option::Some(
11976 crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
11977 v.into(),
11978 ),
11979 );
11980 self
11981 }
11982}
11983
11984impl wkt::message::Message for ArtifactConfig {
11985 fn typename() -> &'static str {
11986 "type.googleapis.com/google.cloud.developerconnect.v1.ArtifactConfig"
11987 }
11988}
11989
11990/// Defines additional types related to [ArtifactConfig].
11991pub mod artifact_config {
11992 #[allow(unused_imports)]
11993 use super::*;
11994
11995 /// The storage location of the artifact.
11996 #[derive(Clone, Debug, PartialEq)]
11997 #[non_exhaustive]
11998 pub enum ArtifactStorage {
11999 /// Optional. Set if the artifact is stored in Artifact registry.
12000 GoogleArtifactRegistry(std::boxed::Box<crate::model::GoogleArtifactRegistry>),
12001 }
12002
12003 /// The storage location of the artifact metadata.
12004 #[derive(Clone, Debug, PartialEq)]
12005 #[non_exhaustive]
12006 pub enum ArtifactMetadataStorage {
12007 /// Optional. Set if the artifact metadata is stored in Artifact analysis.
12008 GoogleArtifactAnalysis(std::boxed::Box<crate::model::GoogleArtifactAnalysis>),
12009 }
12010}
12011
12012/// Google Artifact Analysis configurations.
12013#[derive(Clone, Default, PartialEq)]
12014#[non_exhaustive]
12015pub struct GoogleArtifactAnalysis {
12016 /// Required. The project id of the project where the provenance is stored.
12017 pub project_id: std::string::String,
12018
12019 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12020}
12021
12022impl GoogleArtifactAnalysis {
12023 /// Creates a new default instance.
12024 pub fn new() -> Self {
12025 std::default::Default::default()
12026 }
12027
12028 /// Sets the value of [project_id][crate::model::GoogleArtifactAnalysis::project_id].
12029 ///
12030 /// # Example
12031 /// ```ignore,no_run
12032 /// # use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
12033 /// let x = GoogleArtifactAnalysis::new().set_project_id("example");
12034 /// ```
12035 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12036 self.project_id = v.into();
12037 self
12038 }
12039}
12040
12041impl wkt::message::Message for GoogleArtifactAnalysis {
12042 fn typename() -> &'static str {
12043 "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactAnalysis"
12044 }
12045}
12046
12047/// Google Artifact Registry configurations.
12048#[derive(Clone, Default, PartialEq)]
12049#[non_exhaustive]
12050pub struct GoogleArtifactRegistry {
12051 /// Required. The host project of Artifact Registry.
12052 pub project_id: std::string::String,
12053
12054 /// Required. Immutable. The name of the artifact registry package.
12055 pub artifact_registry_package: std::string::String,
12056
12057 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12058}
12059
12060impl GoogleArtifactRegistry {
12061 /// Creates a new default instance.
12062 pub fn new() -> Self {
12063 std::default::Default::default()
12064 }
12065
12066 /// Sets the value of [project_id][crate::model::GoogleArtifactRegistry::project_id].
12067 ///
12068 /// # Example
12069 /// ```ignore,no_run
12070 /// # use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
12071 /// let x = GoogleArtifactRegistry::new().set_project_id("example");
12072 /// ```
12073 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12074 self.project_id = v.into();
12075 self
12076 }
12077
12078 /// Sets the value of [artifact_registry_package][crate::model::GoogleArtifactRegistry::artifact_registry_package].
12079 ///
12080 /// # Example
12081 /// ```ignore,no_run
12082 /// # use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
12083 /// let x = GoogleArtifactRegistry::new().set_artifact_registry_package("example");
12084 /// ```
12085 pub fn set_artifact_registry_package<T: std::convert::Into<std::string::String>>(
12086 mut self,
12087 v: T,
12088 ) -> Self {
12089 self.artifact_registry_package = v.into();
12090 self
12091 }
12092}
12093
12094impl wkt::message::Message for GoogleArtifactRegistry {
12095 fn typename() -> &'static str {
12096 "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactRegistry"
12097 }
12098}
12099
12100/// The DeploymentEvent resource represents the deployment of the artifact within
12101/// the InsightsConfig resource.
12102#[derive(Clone, Default, PartialEq)]
12103#[non_exhaustive]
12104pub struct DeploymentEvent {
12105 /// Identifier. The name of the DeploymentEvent. This name is provided by
12106 /// Developer Connect insights. Format:
12107 /// projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid}
12108 pub name: std::string::String,
12109
12110 /// Output only. The create time of the DeploymentEvent.
12111 pub create_time: std::option::Option<wkt::Timestamp>,
12112
12113 /// Output only. The update time of the DeploymentEvent.
12114 pub update_time: std::option::Option<wkt::Timestamp>,
12115
12116 /// Output only. The runtime configurations where the DeploymentEvent happened.
12117 pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
12118
12119 /// Output only. The runtime assigned URI of the DeploymentEvent.
12120 /// For GKE, this is the fully qualified replica set uri.
12121 /// e.g.
12122 /// container.googleapis.com/projects/{project}/locations/{location}/clusters/{cluster}/k8s/namespaces/{namespace}/apps/replicasets/{replica-set-id}
12123 /// For Cloud Run, this is the revision name.
12124 pub runtime_deployment_uri: std::string::String,
12125
12126 /// Output only. The state of the DeploymentEvent.
12127 pub state: crate::model::deployment_event::State,
12128
12129 /// Output only. The artifact deployments of the DeploymentEvent. Each artifact
12130 /// deployment contains the artifact uri and the runtime configuration uri. For
12131 /// GKE, this would be all the containers images that are deployed in the pod.
12132 pub artifact_deployments: std::vec::Vec<crate::model::ArtifactDeployment>,
12133
12134 /// Output only. The time at which the DeploymentEvent was deployed.
12135 /// This would be the min of all ArtifactDeployment deploy_times.
12136 pub deploy_time: std::option::Option<wkt::Timestamp>,
12137
12138 /// Output only. The time at which the DeploymentEvent was undeployed, all
12139 /// artifacts are considered undeployed once this time is set. This would be
12140 /// the max of all ArtifactDeployment undeploy_times. If any ArtifactDeployment
12141 /// is still active (i.e. does not have an undeploy_time), this field will be
12142 /// empty.
12143 pub undeploy_time: std::option::Option<wkt::Timestamp>,
12144
12145 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12146}
12147
12148impl DeploymentEvent {
12149 /// Creates a new default instance.
12150 pub fn new() -> Self {
12151 std::default::Default::default()
12152 }
12153
12154 /// Sets the value of [name][crate::model::DeploymentEvent::name].
12155 ///
12156 /// # Example
12157 /// ```ignore,no_run
12158 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
12159 /// # let project_id = "project_id";
12160 /// # let location_id = "location_id";
12161 /// # let insights_config_id = "insights_config_id";
12162 /// # let deployment_event_id = "deployment_event_id";
12163 /// let x = DeploymentEvent::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}/deploymentEvents/{deployment_event_id}"));
12164 /// ```
12165 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12166 self.name = v.into();
12167 self
12168 }
12169
12170 /// Sets the value of [create_time][crate::model::DeploymentEvent::create_time].
12171 ///
12172 /// # Example
12173 /// ```ignore,no_run
12174 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
12175 /// use wkt::Timestamp;
12176 /// let x = DeploymentEvent::new().set_create_time(Timestamp::default()/* use setters */);
12177 /// ```
12178 pub fn set_create_time<T>(mut self, v: T) -> Self
12179 where
12180 T: std::convert::Into<wkt::Timestamp>,
12181 {
12182 self.create_time = std::option::Option::Some(v.into());
12183 self
12184 }
12185
12186 /// Sets or clears the value of [create_time][crate::model::DeploymentEvent::create_time].
12187 ///
12188 /// # Example
12189 /// ```ignore,no_run
12190 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
12191 /// use wkt::Timestamp;
12192 /// let x = DeploymentEvent::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12193 /// let x = DeploymentEvent::new().set_or_clear_create_time(None::<Timestamp>);
12194 /// ```
12195 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12196 where
12197 T: std::convert::Into<wkt::Timestamp>,
12198 {
12199 self.create_time = v.map(|x| x.into());
12200 self
12201 }
12202
12203 /// Sets the value of [update_time][crate::model::DeploymentEvent::update_time].
12204 ///
12205 /// # Example
12206 /// ```ignore,no_run
12207 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
12208 /// use wkt::Timestamp;
12209 /// let x = DeploymentEvent::new().set_update_time(Timestamp::default()/* use setters */);
12210 /// ```
12211 pub fn set_update_time<T>(mut self, v: T) -> Self
12212 where
12213 T: std::convert::Into<wkt::Timestamp>,
12214 {
12215 self.update_time = std::option::Option::Some(v.into());
12216 self
12217 }
12218
12219 /// Sets or clears the value of [update_time][crate::model::DeploymentEvent::update_time].
12220 ///
12221 /// # Example
12222 /// ```ignore,no_run
12223 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
12224 /// use wkt::Timestamp;
12225 /// let x = DeploymentEvent::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
12226 /// let x = DeploymentEvent::new().set_or_clear_update_time(None::<Timestamp>);
12227 /// ```
12228 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12229 where
12230 T: std::convert::Into<wkt::Timestamp>,
12231 {
12232 self.update_time = v.map(|x| x.into());
12233 self
12234 }
12235
12236 /// Sets the value of [runtime_config][crate::model::DeploymentEvent::runtime_config].
12237 ///
12238 /// # Example
12239 /// ```ignore,no_run
12240 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
12241 /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
12242 /// let x = DeploymentEvent::new().set_runtime_config(RuntimeConfig::default()/* use setters */);
12243 /// ```
12244 pub fn set_runtime_config<T>(mut self, v: T) -> Self
12245 where
12246 T: std::convert::Into<crate::model::RuntimeConfig>,
12247 {
12248 self.runtime_config = std::option::Option::Some(v.into());
12249 self
12250 }
12251
12252 /// Sets or clears the value of [runtime_config][crate::model::DeploymentEvent::runtime_config].
12253 ///
12254 /// # Example
12255 /// ```ignore,no_run
12256 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
12257 /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
12258 /// let x = DeploymentEvent::new().set_or_clear_runtime_config(Some(RuntimeConfig::default()/* use setters */));
12259 /// let x = DeploymentEvent::new().set_or_clear_runtime_config(None::<RuntimeConfig>);
12260 /// ```
12261 pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
12262 where
12263 T: std::convert::Into<crate::model::RuntimeConfig>,
12264 {
12265 self.runtime_config = v.map(|x| x.into());
12266 self
12267 }
12268
12269 /// Sets the value of [runtime_deployment_uri][crate::model::DeploymentEvent::runtime_deployment_uri].
12270 ///
12271 /// # Example
12272 /// ```ignore,no_run
12273 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
12274 /// let x = DeploymentEvent::new().set_runtime_deployment_uri("example");
12275 /// ```
12276 pub fn set_runtime_deployment_uri<T: std::convert::Into<std::string::String>>(
12277 mut self,
12278 v: T,
12279 ) -> Self {
12280 self.runtime_deployment_uri = v.into();
12281 self
12282 }
12283
12284 /// Sets the value of [state][crate::model::DeploymentEvent::state].
12285 ///
12286 /// # Example
12287 /// ```ignore,no_run
12288 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
12289 /// use google_cloud_developerconnect_v1::model::deployment_event::State;
12290 /// let x0 = DeploymentEvent::new().set_state(State::Active);
12291 /// let x1 = DeploymentEvent::new().set_state(State::Inactive);
12292 /// ```
12293 pub fn set_state<T: std::convert::Into<crate::model::deployment_event::State>>(
12294 mut self,
12295 v: T,
12296 ) -> Self {
12297 self.state = v.into();
12298 self
12299 }
12300
12301 /// Sets the value of [artifact_deployments][crate::model::DeploymentEvent::artifact_deployments].
12302 ///
12303 /// # Example
12304 /// ```ignore,no_run
12305 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
12306 /// use google_cloud_developerconnect_v1::model::ArtifactDeployment;
12307 /// let x = DeploymentEvent::new()
12308 /// .set_artifact_deployments([
12309 /// ArtifactDeployment::default()/* use setters */,
12310 /// ArtifactDeployment::default()/* use (different) setters */,
12311 /// ]);
12312 /// ```
12313 pub fn set_artifact_deployments<T, V>(mut self, v: T) -> Self
12314 where
12315 T: std::iter::IntoIterator<Item = V>,
12316 V: std::convert::Into<crate::model::ArtifactDeployment>,
12317 {
12318 use std::iter::Iterator;
12319 self.artifact_deployments = v.into_iter().map(|i| i.into()).collect();
12320 self
12321 }
12322
12323 /// Sets the value of [deploy_time][crate::model::DeploymentEvent::deploy_time].
12324 ///
12325 /// # Example
12326 /// ```ignore,no_run
12327 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
12328 /// use wkt::Timestamp;
12329 /// let x = DeploymentEvent::new().set_deploy_time(Timestamp::default()/* use setters */);
12330 /// ```
12331 pub fn set_deploy_time<T>(mut self, v: T) -> Self
12332 where
12333 T: std::convert::Into<wkt::Timestamp>,
12334 {
12335 self.deploy_time = std::option::Option::Some(v.into());
12336 self
12337 }
12338
12339 /// Sets or clears the value of [deploy_time][crate::model::DeploymentEvent::deploy_time].
12340 ///
12341 /// # Example
12342 /// ```ignore,no_run
12343 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
12344 /// use wkt::Timestamp;
12345 /// let x = DeploymentEvent::new().set_or_clear_deploy_time(Some(Timestamp::default()/* use setters */));
12346 /// let x = DeploymentEvent::new().set_or_clear_deploy_time(None::<Timestamp>);
12347 /// ```
12348 pub fn set_or_clear_deploy_time<T>(mut self, v: std::option::Option<T>) -> Self
12349 where
12350 T: std::convert::Into<wkt::Timestamp>,
12351 {
12352 self.deploy_time = v.map(|x| x.into());
12353 self
12354 }
12355
12356 /// Sets the value of [undeploy_time][crate::model::DeploymentEvent::undeploy_time].
12357 ///
12358 /// # Example
12359 /// ```ignore,no_run
12360 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
12361 /// use wkt::Timestamp;
12362 /// let x = DeploymentEvent::new().set_undeploy_time(Timestamp::default()/* use setters */);
12363 /// ```
12364 pub fn set_undeploy_time<T>(mut self, v: T) -> Self
12365 where
12366 T: std::convert::Into<wkt::Timestamp>,
12367 {
12368 self.undeploy_time = std::option::Option::Some(v.into());
12369 self
12370 }
12371
12372 /// Sets or clears the value of [undeploy_time][crate::model::DeploymentEvent::undeploy_time].
12373 ///
12374 /// # Example
12375 /// ```ignore,no_run
12376 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
12377 /// use wkt::Timestamp;
12378 /// let x = DeploymentEvent::new().set_or_clear_undeploy_time(Some(Timestamp::default()/* use setters */));
12379 /// let x = DeploymentEvent::new().set_or_clear_undeploy_time(None::<Timestamp>);
12380 /// ```
12381 pub fn set_or_clear_undeploy_time<T>(mut self, v: std::option::Option<T>) -> Self
12382 where
12383 T: std::convert::Into<wkt::Timestamp>,
12384 {
12385 self.undeploy_time = v.map(|x| x.into());
12386 self
12387 }
12388}
12389
12390impl wkt::message::Message for DeploymentEvent {
12391 fn typename() -> &'static str {
12392 "type.googleapis.com/google.cloud.developerconnect.v1.DeploymentEvent"
12393 }
12394}
12395
12396/// Defines additional types related to [DeploymentEvent].
12397pub mod deployment_event {
12398 #[allow(unused_imports)]
12399 use super::*;
12400
12401 /// The state of the DeploymentEvent.
12402 ///
12403 /// # Working with unknown values
12404 ///
12405 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12406 /// additional enum variants at any time. Adding new variants is not considered
12407 /// a breaking change. Applications should write their code in anticipation of:
12408 ///
12409 /// - New values appearing in future releases of the client library, **and**
12410 /// - New values received dynamically, without application changes.
12411 ///
12412 /// Please consult the [Working with enums] section in the user guide for some
12413 /// guidelines.
12414 ///
12415 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12416 #[derive(Clone, Debug, PartialEq)]
12417 #[non_exhaustive]
12418 pub enum State {
12419 /// No state specified.
12420 Unspecified,
12421 /// The deployment is active in the runtime.
12422 Active,
12423 /// The deployment is not in the runtime.
12424 Inactive,
12425 /// If set, the enum was initialized with an unknown value.
12426 ///
12427 /// Applications can examine the value using [State::value] or
12428 /// [State::name].
12429 UnknownValue(state::UnknownValue),
12430 }
12431
12432 #[doc(hidden)]
12433 pub mod state {
12434 #[allow(unused_imports)]
12435 use super::*;
12436 #[derive(Clone, Debug, PartialEq)]
12437 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12438 }
12439
12440 impl State {
12441 /// Gets the enum value.
12442 ///
12443 /// Returns `None` if the enum contains an unknown value deserialized from
12444 /// the string representation of enums.
12445 pub fn value(&self) -> std::option::Option<i32> {
12446 match self {
12447 Self::Unspecified => std::option::Option::Some(0),
12448 Self::Active => std::option::Option::Some(1),
12449 Self::Inactive => std::option::Option::Some(2),
12450 Self::UnknownValue(u) => u.0.value(),
12451 }
12452 }
12453
12454 /// Gets the enum value as a string.
12455 ///
12456 /// Returns `None` if the enum contains an unknown value deserialized from
12457 /// the integer representation of enums.
12458 pub fn name(&self) -> std::option::Option<&str> {
12459 match self {
12460 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12461 Self::Active => std::option::Option::Some("STATE_ACTIVE"),
12462 Self::Inactive => std::option::Option::Some("STATE_INACTIVE"),
12463 Self::UnknownValue(u) => u.0.name(),
12464 }
12465 }
12466 }
12467
12468 impl std::default::Default for State {
12469 fn default() -> Self {
12470 use std::convert::From;
12471 Self::from(0)
12472 }
12473 }
12474
12475 impl std::fmt::Display for State {
12476 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12477 wkt::internal::display_enum(f, self.name(), self.value())
12478 }
12479 }
12480
12481 impl std::convert::From<i32> for State {
12482 fn from(value: i32) -> Self {
12483 match value {
12484 0 => Self::Unspecified,
12485 1 => Self::Active,
12486 2 => Self::Inactive,
12487 _ => Self::UnknownValue(state::UnknownValue(
12488 wkt::internal::UnknownEnumValue::Integer(value),
12489 )),
12490 }
12491 }
12492 }
12493
12494 impl std::convert::From<&str> for State {
12495 fn from(value: &str) -> Self {
12496 use std::string::ToString;
12497 match value {
12498 "STATE_UNSPECIFIED" => Self::Unspecified,
12499 "STATE_ACTIVE" => Self::Active,
12500 "STATE_INACTIVE" => Self::Inactive,
12501 _ => Self::UnknownValue(state::UnknownValue(
12502 wkt::internal::UnknownEnumValue::String(value.to_string()),
12503 )),
12504 }
12505 }
12506 }
12507
12508 impl serde::ser::Serialize for State {
12509 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12510 where
12511 S: serde::Serializer,
12512 {
12513 match self {
12514 Self::Unspecified => serializer.serialize_i32(0),
12515 Self::Active => serializer.serialize_i32(1),
12516 Self::Inactive => serializer.serialize_i32(2),
12517 Self::UnknownValue(u) => u.0.serialize(serializer),
12518 }
12519 }
12520 }
12521
12522 impl<'de> serde::de::Deserialize<'de> for State {
12523 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12524 where
12525 D: serde::Deserializer<'de>,
12526 {
12527 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12528 ".google.cloud.developerconnect.v1.DeploymentEvent.State",
12529 ))
12530 }
12531 }
12532}
12533
12534/// Request for getting a DeploymentEvent.
12535#[derive(Clone, Default, PartialEq)]
12536#[non_exhaustive]
12537pub struct GetDeploymentEventRequest {
12538 /// Required. The name of the deployment event to retrieve.
12539 /// Format:
12540 /// projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid}
12541 pub name: std::string::String,
12542
12543 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12544}
12545
12546impl GetDeploymentEventRequest {
12547 /// Creates a new default instance.
12548 pub fn new() -> Self {
12549 std::default::Default::default()
12550 }
12551
12552 /// Sets the value of [name][crate::model::GetDeploymentEventRequest::name].
12553 ///
12554 /// # Example
12555 /// ```ignore,no_run
12556 /// # use google_cloud_developerconnect_v1::model::GetDeploymentEventRequest;
12557 /// # let project_id = "project_id";
12558 /// # let location_id = "location_id";
12559 /// # let insights_config_id = "insights_config_id";
12560 /// # let deployment_event_id = "deployment_event_id";
12561 /// let x = GetDeploymentEventRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}/deploymentEvents/{deployment_event_id}"));
12562 /// ```
12563 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12564 self.name = v.into();
12565 self
12566 }
12567}
12568
12569impl wkt::message::Message for GetDeploymentEventRequest {
12570 fn typename() -> &'static str {
12571 "type.googleapis.com/google.cloud.developerconnect.v1.GetDeploymentEventRequest"
12572 }
12573}
12574
12575/// Request for requesting list of DeploymentEvents.
12576#[derive(Clone, Default, PartialEq)]
12577#[non_exhaustive]
12578pub struct ListDeploymentEventsRequest {
12579 /// Required. The parent insights config that owns this collection of
12580 /// deployment events. Format:
12581 /// projects/{project}/locations/{location}/insightsConfigs/{insights_config}
12582 pub parent: std::string::String,
12583
12584 /// Optional. The maximum number of deployment events to return. The service
12585 /// may return fewer than this value. If unspecified, at most 50 deployment
12586 /// events will be returned. The maximum value is 1000; values above 1000 will
12587 /// be coerced to 1000.
12588 pub page_size: i32,
12589
12590 /// Optional. A page token, received from a previous `ListDeploymentEvents`
12591 /// call. Provide this to retrieve the subsequent page.
12592 ///
12593 /// When paginating, all other parameters provided to `ListDeploymentEvents`
12594 /// must match the call that provided the page token.
12595 pub page_token: std::string::String,
12596
12597 /// Optional. Filter expression that matches a subset of the DeploymentEvents.
12598 /// <https://google.aip.dev/160>.
12599 pub filter: std::string::String,
12600
12601 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12602}
12603
12604impl ListDeploymentEventsRequest {
12605 /// Creates a new default instance.
12606 pub fn new() -> Self {
12607 std::default::Default::default()
12608 }
12609
12610 /// Sets the value of [parent][crate::model::ListDeploymentEventsRequest::parent].
12611 ///
12612 /// # Example
12613 /// ```ignore,no_run
12614 /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
12615 /// # let project_id = "project_id";
12616 /// # let location_id = "location_id";
12617 /// # let insights_config_id = "insights_config_id";
12618 /// let x = ListDeploymentEventsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"));
12619 /// ```
12620 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12621 self.parent = v.into();
12622 self
12623 }
12624
12625 /// Sets the value of [page_size][crate::model::ListDeploymentEventsRequest::page_size].
12626 ///
12627 /// # Example
12628 /// ```ignore,no_run
12629 /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
12630 /// let x = ListDeploymentEventsRequest::new().set_page_size(42);
12631 /// ```
12632 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12633 self.page_size = v.into();
12634 self
12635 }
12636
12637 /// Sets the value of [page_token][crate::model::ListDeploymentEventsRequest::page_token].
12638 ///
12639 /// # Example
12640 /// ```ignore,no_run
12641 /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
12642 /// let x = ListDeploymentEventsRequest::new().set_page_token("example");
12643 /// ```
12644 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12645 self.page_token = v.into();
12646 self
12647 }
12648
12649 /// Sets the value of [filter][crate::model::ListDeploymentEventsRequest::filter].
12650 ///
12651 /// # Example
12652 /// ```ignore,no_run
12653 /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
12654 /// let x = ListDeploymentEventsRequest::new().set_filter("example");
12655 /// ```
12656 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12657 self.filter = v.into();
12658 self
12659 }
12660}
12661
12662impl wkt::message::Message for ListDeploymentEventsRequest {
12663 fn typename() -> &'static str {
12664 "type.googleapis.com/google.cloud.developerconnect.v1.ListDeploymentEventsRequest"
12665 }
12666}
12667
12668/// Response to listing DeploymentEvents.
12669#[derive(Clone, Default, PartialEq)]
12670#[non_exhaustive]
12671pub struct ListDeploymentEventsResponse {
12672 /// The list of DeploymentEvents.
12673 pub deployment_events: std::vec::Vec<crate::model::DeploymentEvent>,
12674
12675 /// A token, which can be sent as `page_token` to retrieve the next page.
12676 /// If this field is omitted, there are no subsequent pages.
12677 pub next_page_token: std::string::String,
12678
12679 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12680}
12681
12682impl ListDeploymentEventsResponse {
12683 /// Creates a new default instance.
12684 pub fn new() -> Self {
12685 std::default::Default::default()
12686 }
12687
12688 /// Sets the value of [deployment_events][crate::model::ListDeploymentEventsResponse::deployment_events].
12689 ///
12690 /// # Example
12691 /// ```ignore,no_run
12692 /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsResponse;
12693 /// use google_cloud_developerconnect_v1::model::DeploymentEvent;
12694 /// let x = ListDeploymentEventsResponse::new()
12695 /// .set_deployment_events([
12696 /// DeploymentEvent::default()/* use setters */,
12697 /// DeploymentEvent::default()/* use (different) setters */,
12698 /// ]);
12699 /// ```
12700 pub fn set_deployment_events<T, V>(mut self, v: T) -> Self
12701 where
12702 T: std::iter::IntoIterator<Item = V>,
12703 V: std::convert::Into<crate::model::DeploymentEvent>,
12704 {
12705 use std::iter::Iterator;
12706 self.deployment_events = v.into_iter().map(|i| i.into()).collect();
12707 self
12708 }
12709
12710 /// Sets the value of [next_page_token][crate::model::ListDeploymentEventsResponse::next_page_token].
12711 ///
12712 /// # Example
12713 /// ```ignore,no_run
12714 /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsResponse;
12715 /// let x = ListDeploymentEventsResponse::new().set_next_page_token("example");
12716 /// ```
12717 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12718 self.next_page_token = v.into();
12719 self
12720 }
12721}
12722
12723impl wkt::message::Message for ListDeploymentEventsResponse {
12724 fn typename() -> &'static str {
12725 "type.googleapis.com/google.cloud.developerconnect.v1.ListDeploymentEventsResponse"
12726 }
12727}
12728
12729#[doc(hidden)]
12730impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentEventsResponse {
12731 type PageItem = crate::model::DeploymentEvent;
12732
12733 fn items(self) -> std::vec::Vec<Self::PageItem> {
12734 self.deployment_events
12735 }
12736
12737 fn next_page_token(&self) -> std::string::String {
12738 use std::clone::Clone;
12739 self.next_page_token.clone()
12740 }
12741}
12742
12743/// The ArtifactDeployment resource represents the deployment of the artifact
12744/// within the InsightsConfig resource.
12745#[derive(Clone, Default, PartialEq)]
12746#[non_exhaustive]
12747pub struct ArtifactDeployment {
12748 /// Output only. Unique identifier of `ArtifactDeployment`.
12749 pub id: std::string::String,
12750
12751 /// Output only. The artifact that is deployed.
12752 pub artifact_reference: std::string::String,
12753
12754 /// Output only. The artifact alias in the deployment spec, with Tag/SHA.
12755 /// e.g. us-docker.pkg.dev/my-project/my-repo/image:1.0.0
12756 pub artifact_alias: std::string::String,
12757
12758 /// Output only. The source commits at which this artifact was built. Extracted
12759 /// from provenance.
12760 pub source_commit_uris: std::vec::Vec<std::string::String>,
12761
12762 /// Output only. The time at which the deployment was deployed.
12763 pub deploy_time: std::option::Option<wkt::Timestamp>,
12764
12765 /// Output only. The time at which the deployment was undeployed, all artifacts
12766 /// are considered undeployed once this time is set.
12767 pub undeploy_time: std::option::Option<wkt::Timestamp>,
12768
12769 /// Output only. The summary of container status of the artifact deployment.
12770 /// Format as `ContainerStatusState-Reason : restartCount`
12771 /// e.g. "Waiting-ImagePullBackOff : 3"
12772 pub container_status_summary: std::string::String,
12773
12774 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12775}
12776
12777impl ArtifactDeployment {
12778 /// Creates a new default instance.
12779 pub fn new() -> Self {
12780 std::default::Default::default()
12781 }
12782
12783 /// Sets the value of [id][crate::model::ArtifactDeployment::id].
12784 ///
12785 /// # Example
12786 /// ```ignore,no_run
12787 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
12788 /// let x = ArtifactDeployment::new().set_id("example");
12789 /// ```
12790 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12791 self.id = v.into();
12792 self
12793 }
12794
12795 /// Sets the value of [artifact_reference][crate::model::ArtifactDeployment::artifact_reference].
12796 ///
12797 /// # Example
12798 /// ```ignore,no_run
12799 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
12800 /// let x = ArtifactDeployment::new().set_artifact_reference("example");
12801 /// ```
12802 pub fn set_artifact_reference<T: std::convert::Into<std::string::String>>(
12803 mut self,
12804 v: T,
12805 ) -> Self {
12806 self.artifact_reference = v.into();
12807 self
12808 }
12809
12810 /// Sets the value of [artifact_alias][crate::model::ArtifactDeployment::artifact_alias].
12811 ///
12812 /// # Example
12813 /// ```ignore,no_run
12814 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
12815 /// let x = ArtifactDeployment::new().set_artifact_alias("example");
12816 /// ```
12817 pub fn set_artifact_alias<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12818 self.artifact_alias = v.into();
12819 self
12820 }
12821
12822 /// Sets the value of [source_commit_uris][crate::model::ArtifactDeployment::source_commit_uris].
12823 ///
12824 /// # Example
12825 /// ```ignore,no_run
12826 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
12827 /// let x = ArtifactDeployment::new().set_source_commit_uris(["a", "b", "c"]);
12828 /// ```
12829 pub fn set_source_commit_uris<T, V>(mut self, v: T) -> Self
12830 where
12831 T: std::iter::IntoIterator<Item = V>,
12832 V: std::convert::Into<std::string::String>,
12833 {
12834 use std::iter::Iterator;
12835 self.source_commit_uris = v.into_iter().map(|i| i.into()).collect();
12836 self
12837 }
12838
12839 /// Sets the value of [deploy_time][crate::model::ArtifactDeployment::deploy_time].
12840 ///
12841 /// # Example
12842 /// ```ignore,no_run
12843 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
12844 /// use wkt::Timestamp;
12845 /// let x = ArtifactDeployment::new().set_deploy_time(Timestamp::default()/* use setters */);
12846 /// ```
12847 pub fn set_deploy_time<T>(mut self, v: T) -> Self
12848 where
12849 T: std::convert::Into<wkt::Timestamp>,
12850 {
12851 self.deploy_time = std::option::Option::Some(v.into());
12852 self
12853 }
12854
12855 /// Sets or clears the value of [deploy_time][crate::model::ArtifactDeployment::deploy_time].
12856 ///
12857 /// # Example
12858 /// ```ignore,no_run
12859 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
12860 /// use wkt::Timestamp;
12861 /// let x = ArtifactDeployment::new().set_or_clear_deploy_time(Some(Timestamp::default()/* use setters */));
12862 /// let x = ArtifactDeployment::new().set_or_clear_deploy_time(None::<Timestamp>);
12863 /// ```
12864 pub fn set_or_clear_deploy_time<T>(mut self, v: std::option::Option<T>) -> Self
12865 where
12866 T: std::convert::Into<wkt::Timestamp>,
12867 {
12868 self.deploy_time = v.map(|x| x.into());
12869 self
12870 }
12871
12872 /// Sets the value of [undeploy_time][crate::model::ArtifactDeployment::undeploy_time].
12873 ///
12874 /// # Example
12875 /// ```ignore,no_run
12876 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
12877 /// use wkt::Timestamp;
12878 /// let x = ArtifactDeployment::new().set_undeploy_time(Timestamp::default()/* use setters */);
12879 /// ```
12880 pub fn set_undeploy_time<T>(mut self, v: T) -> Self
12881 where
12882 T: std::convert::Into<wkt::Timestamp>,
12883 {
12884 self.undeploy_time = std::option::Option::Some(v.into());
12885 self
12886 }
12887
12888 /// Sets or clears the value of [undeploy_time][crate::model::ArtifactDeployment::undeploy_time].
12889 ///
12890 /// # Example
12891 /// ```ignore,no_run
12892 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
12893 /// use wkt::Timestamp;
12894 /// let x = ArtifactDeployment::new().set_or_clear_undeploy_time(Some(Timestamp::default()/* use setters */));
12895 /// let x = ArtifactDeployment::new().set_or_clear_undeploy_time(None::<Timestamp>);
12896 /// ```
12897 pub fn set_or_clear_undeploy_time<T>(mut self, v: std::option::Option<T>) -> Self
12898 where
12899 T: std::convert::Into<wkt::Timestamp>,
12900 {
12901 self.undeploy_time = v.map(|x| x.into());
12902 self
12903 }
12904
12905 /// Sets the value of [container_status_summary][crate::model::ArtifactDeployment::container_status_summary].
12906 ///
12907 /// # Example
12908 /// ```ignore,no_run
12909 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
12910 /// let x = ArtifactDeployment::new().set_container_status_summary("example");
12911 /// ```
12912 pub fn set_container_status_summary<T: std::convert::Into<std::string::String>>(
12913 mut self,
12914 v: T,
12915 ) -> Self {
12916 self.container_status_summary = v.into();
12917 self
12918 }
12919}
12920
12921impl wkt::message::Message for ArtifactDeployment {
12922 fn typename() -> &'static str {
12923 "type.googleapis.com/google.cloud.developerconnect.v1.ArtifactDeployment"
12924 }
12925}
12926
12927/// Request for creating an InsightsConfig.
12928#[derive(Clone, Default, PartialEq)]
12929#[non_exhaustive]
12930pub struct CreateInsightsConfigRequest {
12931 /// Required. Value for parent.
12932 pub parent: std::string::String,
12933
12934 /// Required. ID of the requesting InsightsConfig.
12935 pub insights_config_id: std::string::String,
12936
12937 /// Required. The resource being created.
12938 pub insights_config: std::option::Option<crate::model::InsightsConfig>,
12939
12940 /// Optional. If set, validate the request, but do not actually post it.
12941 pub validate_only: bool,
12942
12943 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12944}
12945
12946impl CreateInsightsConfigRequest {
12947 /// Creates a new default instance.
12948 pub fn new() -> Self {
12949 std::default::Default::default()
12950 }
12951
12952 /// Sets the value of [parent][crate::model::CreateInsightsConfigRequest::parent].
12953 ///
12954 /// # Example
12955 /// ```ignore,no_run
12956 /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
12957 /// # let project_id = "project_id";
12958 /// # let location_id = "location_id";
12959 /// let x = CreateInsightsConfigRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
12960 /// ```
12961 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12962 self.parent = v.into();
12963 self
12964 }
12965
12966 /// Sets the value of [insights_config_id][crate::model::CreateInsightsConfigRequest::insights_config_id].
12967 ///
12968 /// # Example
12969 /// ```ignore,no_run
12970 /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
12971 /// let x = CreateInsightsConfigRequest::new().set_insights_config_id("example");
12972 /// ```
12973 pub fn set_insights_config_id<T: std::convert::Into<std::string::String>>(
12974 mut self,
12975 v: T,
12976 ) -> Self {
12977 self.insights_config_id = v.into();
12978 self
12979 }
12980
12981 /// Sets the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
12982 ///
12983 /// # Example
12984 /// ```ignore,no_run
12985 /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
12986 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
12987 /// let x = CreateInsightsConfigRequest::new().set_insights_config(InsightsConfig::default()/* use setters */);
12988 /// ```
12989 pub fn set_insights_config<T>(mut self, v: T) -> Self
12990 where
12991 T: std::convert::Into<crate::model::InsightsConfig>,
12992 {
12993 self.insights_config = std::option::Option::Some(v.into());
12994 self
12995 }
12996
12997 /// Sets or clears the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
12998 ///
12999 /// # Example
13000 /// ```ignore,no_run
13001 /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
13002 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
13003 /// let x = CreateInsightsConfigRequest::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
13004 /// let x = CreateInsightsConfigRequest::new().set_or_clear_insights_config(None::<InsightsConfig>);
13005 /// ```
13006 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
13007 where
13008 T: std::convert::Into<crate::model::InsightsConfig>,
13009 {
13010 self.insights_config = v.map(|x| x.into());
13011 self
13012 }
13013
13014 /// Sets the value of [validate_only][crate::model::CreateInsightsConfigRequest::validate_only].
13015 ///
13016 /// # Example
13017 /// ```ignore,no_run
13018 /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
13019 /// let x = CreateInsightsConfigRequest::new().set_validate_only(true);
13020 /// ```
13021 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13022 self.validate_only = v.into();
13023 self
13024 }
13025}
13026
13027impl wkt::message::Message for CreateInsightsConfigRequest {
13028 fn typename() -> &'static str {
13029 "type.googleapis.com/google.cloud.developerconnect.v1.CreateInsightsConfigRequest"
13030 }
13031}
13032
13033/// Request for getting an InsightsConfig.
13034#[derive(Clone, Default, PartialEq)]
13035#[non_exhaustive]
13036pub struct GetInsightsConfigRequest {
13037 /// Required. Name of the resource.
13038 pub name: std::string::String,
13039
13040 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13041}
13042
13043impl GetInsightsConfigRequest {
13044 /// Creates a new default instance.
13045 pub fn new() -> Self {
13046 std::default::Default::default()
13047 }
13048
13049 /// Sets the value of [name][crate::model::GetInsightsConfigRequest::name].
13050 ///
13051 /// # Example
13052 /// ```ignore,no_run
13053 /// # use google_cloud_developerconnect_v1::model::GetInsightsConfigRequest;
13054 /// # let project_id = "project_id";
13055 /// # let location_id = "location_id";
13056 /// # let insights_config_id = "insights_config_id";
13057 /// let x = GetInsightsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"));
13058 /// ```
13059 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13060 self.name = v.into();
13061 self
13062 }
13063}
13064
13065impl wkt::message::Message for GetInsightsConfigRequest {
13066 fn typename() -> &'static str {
13067 "type.googleapis.com/google.cloud.developerconnect.v1.GetInsightsConfigRequest"
13068 }
13069}
13070
13071/// Request for requesting list of InsightsConfigs.
13072#[derive(Clone, Default, PartialEq)]
13073#[non_exhaustive]
13074pub struct ListInsightsConfigsRequest {
13075 /// Required. Parent value for ListInsightsConfigsRequest.
13076 pub parent: std::string::String,
13077
13078 /// Optional. Requested page size. Server may return fewer items than
13079 /// requested. If unspecified, server will pick an appropriate default.
13080 pub page_size: i32,
13081
13082 /// Optional. A token identifying a page of results the server should return.
13083 pub page_token: std::string::String,
13084
13085 /// Optional. Filtering results. See <https://google.aip.dev/160> for more
13086 /// details. Filter string, adhering to the rules in
13087 /// <https://google.aip.dev/160>. List only InsightsConfigs matching the filter.
13088 /// If filter is empty, all InsightsConfigs are listed.
13089 pub filter: std::string::String,
13090
13091 /// Optional. Hint for how to order the results.
13092 pub order_by: std::string::String,
13093
13094 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13095}
13096
13097impl ListInsightsConfigsRequest {
13098 /// Creates a new default instance.
13099 pub fn new() -> Self {
13100 std::default::Default::default()
13101 }
13102
13103 /// Sets the value of [parent][crate::model::ListInsightsConfigsRequest::parent].
13104 ///
13105 /// # Example
13106 /// ```ignore,no_run
13107 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
13108 /// # let project_id = "project_id";
13109 /// # let location_id = "location_id";
13110 /// let x = ListInsightsConfigsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
13111 /// ```
13112 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13113 self.parent = v.into();
13114 self
13115 }
13116
13117 /// Sets the value of [page_size][crate::model::ListInsightsConfigsRequest::page_size].
13118 ///
13119 /// # Example
13120 /// ```ignore,no_run
13121 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
13122 /// let x = ListInsightsConfigsRequest::new().set_page_size(42);
13123 /// ```
13124 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13125 self.page_size = v.into();
13126 self
13127 }
13128
13129 /// Sets the value of [page_token][crate::model::ListInsightsConfigsRequest::page_token].
13130 ///
13131 /// # Example
13132 /// ```ignore,no_run
13133 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
13134 /// let x = ListInsightsConfigsRequest::new().set_page_token("example");
13135 /// ```
13136 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13137 self.page_token = v.into();
13138 self
13139 }
13140
13141 /// Sets the value of [filter][crate::model::ListInsightsConfigsRequest::filter].
13142 ///
13143 /// # Example
13144 /// ```ignore,no_run
13145 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
13146 /// let x = ListInsightsConfigsRequest::new().set_filter("example");
13147 /// ```
13148 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13149 self.filter = v.into();
13150 self
13151 }
13152
13153 /// Sets the value of [order_by][crate::model::ListInsightsConfigsRequest::order_by].
13154 ///
13155 /// # Example
13156 /// ```ignore,no_run
13157 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
13158 /// let x = ListInsightsConfigsRequest::new().set_order_by("example");
13159 /// ```
13160 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13161 self.order_by = v.into();
13162 self
13163 }
13164}
13165
13166impl wkt::message::Message for ListInsightsConfigsRequest {
13167 fn typename() -> &'static str {
13168 "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsRequest"
13169 }
13170}
13171
13172/// Request for response to listing InsightsConfigs.
13173#[derive(Clone, Default, PartialEq)]
13174#[non_exhaustive]
13175pub struct ListInsightsConfigsResponse {
13176 /// The list of InsightsConfigs.
13177 pub insights_configs: std::vec::Vec<crate::model::InsightsConfig>,
13178
13179 /// A token identifying a page of results the server should return.
13180 pub next_page_token: std::string::String,
13181
13182 /// Locations that could not be reached.
13183 pub unreachable: std::vec::Vec<std::string::String>,
13184
13185 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13186}
13187
13188impl ListInsightsConfigsResponse {
13189 /// Creates a new default instance.
13190 pub fn new() -> Self {
13191 std::default::Default::default()
13192 }
13193
13194 /// Sets the value of [insights_configs][crate::model::ListInsightsConfigsResponse::insights_configs].
13195 ///
13196 /// # Example
13197 /// ```ignore,no_run
13198 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
13199 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
13200 /// let x = ListInsightsConfigsResponse::new()
13201 /// .set_insights_configs([
13202 /// InsightsConfig::default()/* use setters */,
13203 /// InsightsConfig::default()/* use (different) setters */,
13204 /// ]);
13205 /// ```
13206 pub fn set_insights_configs<T, V>(mut self, v: T) -> Self
13207 where
13208 T: std::iter::IntoIterator<Item = V>,
13209 V: std::convert::Into<crate::model::InsightsConfig>,
13210 {
13211 use std::iter::Iterator;
13212 self.insights_configs = v.into_iter().map(|i| i.into()).collect();
13213 self
13214 }
13215
13216 /// Sets the value of [next_page_token][crate::model::ListInsightsConfigsResponse::next_page_token].
13217 ///
13218 /// # Example
13219 /// ```ignore,no_run
13220 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
13221 /// let x = ListInsightsConfigsResponse::new().set_next_page_token("example");
13222 /// ```
13223 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13224 self.next_page_token = v.into();
13225 self
13226 }
13227
13228 /// Sets the value of [unreachable][crate::model::ListInsightsConfigsResponse::unreachable].
13229 ///
13230 /// # Example
13231 /// ```ignore,no_run
13232 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
13233 /// let x = ListInsightsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
13234 /// ```
13235 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13236 where
13237 T: std::iter::IntoIterator<Item = V>,
13238 V: std::convert::Into<std::string::String>,
13239 {
13240 use std::iter::Iterator;
13241 self.unreachable = v.into_iter().map(|i| i.into()).collect();
13242 self
13243 }
13244}
13245
13246impl wkt::message::Message for ListInsightsConfigsResponse {
13247 fn typename() -> &'static str {
13248 "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsResponse"
13249 }
13250}
13251
13252#[doc(hidden)]
13253impl google_cloud_gax::paginator::internal::PageableResponse for ListInsightsConfigsResponse {
13254 type PageItem = crate::model::InsightsConfig;
13255
13256 fn items(self) -> std::vec::Vec<Self::PageItem> {
13257 self.insights_configs
13258 }
13259
13260 fn next_page_token(&self) -> std::string::String {
13261 use std::clone::Clone;
13262 self.next_page_token.clone()
13263 }
13264}
13265
13266/// Request for deleting an InsightsConfig.
13267#[derive(Clone, Default, PartialEq)]
13268#[non_exhaustive]
13269pub struct DeleteInsightsConfigRequest {
13270 /// Required. Value for parent.
13271 pub name: std::string::String,
13272
13273 /// Optional. An optional request ID to identify requests. Specify a unique
13274 /// request ID so that if you must retry your request, the server will know to
13275 /// ignore the request if it has already been completed. The server will
13276 /// guarantee that for at least 60 minutes after the first request.
13277 ///
13278 /// For example, consider a situation where you make an initial request and the
13279 /// request times out. If you make the request again with the same request
13280 /// ID, the server can check if original operation with the same request ID
13281 /// was received, and if so, will ignore the second request. This prevents
13282 /// clients from accidentally creating duplicate commitments.
13283 ///
13284 /// The request ID must be a valid UUID with the exception that zero UUID is
13285 /// not supported (00000000-0000-0000-0000-000000000000).
13286 pub request_id: std::string::String,
13287
13288 /// Optional. If set, validate the request, but do not actually post it.
13289 pub validate_only: bool,
13290
13291 /// Optional. This checksum is computed by the server based on the value of
13292 /// other fields, and may be sent on update and delete requests to ensure the
13293 /// client has an up-to-date value before proceeding.
13294 pub etag: std::string::String,
13295
13296 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13297}
13298
13299impl DeleteInsightsConfigRequest {
13300 /// Creates a new default instance.
13301 pub fn new() -> Self {
13302 std::default::Default::default()
13303 }
13304
13305 /// Sets the value of [name][crate::model::DeleteInsightsConfigRequest::name].
13306 ///
13307 /// # Example
13308 /// ```ignore,no_run
13309 /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
13310 /// # let project_id = "project_id";
13311 /// # let location_id = "location_id";
13312 /// # let insights_config_id = "insights_config_id";
13313 /// let x = DeleteInsightsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"));
13314 /// ```
13315 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13316 self.name = v.into();
13317 self
13318 }
13319
13320 /// Sets the value of [request_id][crate::model::DeleteInsightsConfigRequest::request_id].
13321 ///
13322 /// # Example
13323 /// ```ignore,no_run
13324 /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
13325 /// let x = DeleteInsightsConfigRequest::new().set_request_id("example");
13326 /// ```
13327 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13328 self.request_id = v.into();
13329 self
13330 }
13331
13332 /// Sets the value of [validate_only][crate::model::DeleteInsightsConfigRequest::validate_only].
13333 ///
13334 /// # Example
13335 /// ```ignore,no_run
13336 /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
13337 /// let x = DeleteInsightsConfigRequest::new().set_validate_only(true);
13338 /// ```
13339 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13340 self.validate_only = v.into();
13341 self
13342 }
13343
13344 /// Sets the value of [etag][crate::model::DeleteInsightsConfigRequest::etag].
13345 ///
13346 /// # Example
13347 /// ```ignore,no_run
13348 /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
13349 /// let x = DeleteInsightsConfigRequest::new().set_etag("example");
13350 /// ```
13351 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13352 self.etag = v.into();
13353 self
13354 }
13355}
13356
13357impl wkt::message::Message for DeleteInsightsConfigRequest {
13358 fn typename() -> &'static str {
13359 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteInsightsConfigRequest"
13360 }
13361}
13362
13363/// Request for updating an InsightsConfig.
13364#[derive(Clone, Default, PartialEq)]
13365#[non_exhaustive]
13366pub struct UpdateInsightsConfigRequest {
13367 /// Required. The resource being updated.
13368 pub insights_config: std::option::Option<crate::model::InsightsConfig>,
13369
13370 /// Optional. An optional request ID to identify requests. Specify a unique
13371 /// request ID so that if you must retry your request, the server will know to
13372 /// ignore the request if it has already been completed. The server will
13373 /// guarantee that for at least 60 minutes after the first request.
13374 ///
13375 /// For example, consider a situation where you make an initial request and the
13376 /// request times out. If you make the request again with the same request
13377 /// ID, the server can check if original operation with the same request ID
13378 /// was received, and if so, will ignore the second request. This prevents
13379 /// clients from accidentally creating duplicate commitments.
13380 ///
13381 /// The request ID must be a valid UUID with the exception that zero UUID is
13382 /// not supported (00000000-0000-0000-0000-000000000000).
13383 pub request_id: std::string::String,
13384
13385 /// Optional. If set to true, and the insightsConfig is not found a new
13386 /// insightsConfig will be created. In this situation `update_mask` is ignored.
13387 /// The creation will succeed only if the input insightsConfig has all the
13388 /// necessary information (e.g a github_config with both user_oauth_token and
13389 /// installation_id properties).
13390 pub allow_missing: bool,
13391
13392 /// Optional. If set, validate the request, but do not actually post it.
13393 pub validate_only: bool,
13394
13395 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13396}
13397
13398impl UpdateInsightsConfigRequest {
13399 /// Creates a new default instance.
13400 pub fn new() -> Self {
13401 std::default::Default::default()
13402 }
13403
13404 /// Sets the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
13405 ///
13406 /// # Example
13407 /// ```ignore,no_run
13408 /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
13409 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
13410 /// let x = UpdateInsightsConfigRequest::new().set_insights_config(InsightsConfig::default()/* use setters */);
13411 /// ```
13412 pub fn set_insights_config<T>(mut self, v: T) -> Self
13413 where
13414 T: std::convert::Into<crate::model::InsightsConfig>,
13415 {
13416 self.insights_config = std::option::Option::Some(v.into());
13417 self
13418 }
13419
13420 /// Sets or clears the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
13421 ///
13422 /// # Example
13423 /// ```ignore,no_run
13424 /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
13425 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
13426 /// let x = UpdateInsightsConfigRequest::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
13427 /// let x = UpdateInsightsConfigRequest::new().set_or_clear_insights_config(None::<InsightsConfig>);
13428 /// ```
13429 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
13430 where
13431 T: std::convert::Into<crate::model::InsightsConfig>,
13432 {
13433 self.insights_config = v.map(|x| x.into());
13434 self
13435 }
13436
13437 /// Sets the value of [request_id][crate::model::UpdateInsightsConfigRequest::request_id].
13438 ///
13439 /// # Example
13440 /// ```ignore,no_run
13441 /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
13442 /// let x = UpdateInsightsConfigRequest::new().set_request_id("example");
13443 /// ```
13444 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13445 self.request_id = v.into();
13446 self
13447 }
13448
13449 /// Sets the value of [allow_missing][crate::model::UpdateInsightsConfigRequest::allow_missing].
13450 ///
13451 /// # Example
13452 /// ```ignore,no_run
13453 /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
13454 /// let x = UpdateInsightsConfigRequest::new().set_allow_missing(true);
13455 /// ```
13456 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13457 self.allow_missing = v.into();
13458 self
13459 }
13460
13461 /// Sets the value of [validate_only][crate::model::UpdateInsightsConfigRequest::validate_only].
13462 ///
13463 /// # Example
13464 /// ```ignore,no_run
13465 /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
13466 /// let x = UpdateInsightsConfigRequest::new().set_validate_only(true);
13467 /// ```
13468 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13469 self.validate_only = v.into();
13470 self
13471 }
13472}
13473
13474impl wkt::message::Message for UpdateInsightsConfigRequest {
13475 fn typename() -> &'static str {
13476 "type.googleapis.com/google.cloud.developerconnect.v1.UpdateInsightsConfigRequest"
13477 }
13478}
13479
13480/// The level of commit details to return in the response.
13481///
13482/// # Working with unknown values
13483///
13484/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13485/// additional enum variants at any time. Adding new variants is not considered
13486/// a breaking change. Applications should write their code in anticipation of:
13487///
13488/// - New values appearing in future releases of the client library, **and**
13489/// - New values received dynamically, without application changes.
13490///
13491/// Please consult the [Working with enums] section in the user guide for some
13492/// guidelines.
13493///
13494/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13495#[derive(Clone, Debug, PartialEq)]
13496#[non_exhaustive]
13497pub enum CommitView {
13498 /// Unspecified, defaults to BASIC.
13499 Unspecified,
13500 /// Basic view, returns commit metadata but no file diffs.
13501 Basic,
13502 /// Full view, returns commit metadata and file diffs.
13503 Full,
13504 /// If set, the enum was initialized with an unknown value.
13505 ///
13506 /// Applications can examine the value using [CommitView::value] or
13507 /// [CommitView::name].
13508 UnknownValue(commit_view::UnknownValue),
13509}
13510
13511#[doc(hidden)]
13512pub mod commit_view {
13513 #[allow(unused_imports)]
13514 use super::*;
13515 #[derive(Clone, Debug, PartialEq)]
13516 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13517}
13518
13519impl CommitView {
13520 /// Gets the enum value.
13521 ///
13522 /// Returns `None` if the enum contains an unknown value deserialized from
13523 /// the string representation of enums.
13524 pub fn value(&self) -> std::option::Option<i32> {
13525 match self {
13526 Self::Unspecified => std::option::Option::Some(0),
13527 Self::Basic => std::option::Option::Some(1),
13528 Self::Full => std::option::Option::Some(2),
13529 Self::UnknownValue(u) => u.0.value(),
13530 }
13531 }
13532
13533 /// Gets the enum value as a string.
13534 ///
13535 /// Returns `None` if the enum contains an unknown value deserialized from
13536 /// the integer representation of enums.
13537 pub fn name(&self) -> std::option::Option<&str> {
13538 match self {
13539 Self::Unspecified => std::option::Option::Some("COMMIT_VIEW_UNSPECIFIED"),
13540 Self::Basic => std::option::Option::Some("BASIC"),
13541 Self::Full => std::option::Option::Some("FULL"),
13542 Self::UnknownValue(u) => u.0.name(),
13543 }
13544 }
13545}
13546
13547impl std::default::Default for CommitView {
13548 fn default() -> Self {
13549 use std::convert::From;
13550 Self::from(0)
13551 }
13552}
13553
13554impl std::fmt::Display for CommitView {
13555 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13556 wkt::internal::display_enum(f, self.name(), self.value())
13557 }
13558}
13559
13560impl std::convert::From<i32> for CommitView {
13561 fn from(value: i32) -> Self {
13562 match value {
13563 0 => Self::Unspecified,
13564 1 => Self::Basic,
13565 2 => Self::Full,
13566 _ => Self::UnknownValue(commit_view::UnknownValue(
13567 wkt::internal::UnknownEnumValue::Integer(value),
13568 )),
13569 }
13570 }
13571}
13572
13573impl std::convert::From<&str> for CommitView {
13574 fn from(value: &str) -> Self {
13575 use std::string::ToString;
13576 match value {
13577 "COMMIT_VIEW_UNSPECIFIED" => Self::Unspecified,
13578 "BASIC" => Self::Basic,
13579 "FULL" => Self::Full,
13580 _ => Self::UnknownValue(commit_view::UnknownValue(
13581 wkt::internal::UnknownEnumValue::String(value.to_string()),
13582 )),
13583 }
13584 }
13585}
13586
13587impl serde::ser::Serialize for CommitView {
13588 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13589 where
13590 S: serde::Serializer,
13591 {
13592 match self {
13593 Self::Unspecified => serializer.serialize_i32(0),
13594 Self::Basic => serializer.serialize_i32(1),
13595 Self::Full => serializer.serialize_i32(2),
13596 Self::UnknownValue(u) => u.0.serialize(serializer),
13597 }
13598 }
13599}
13600
13601impl<'de> serde::de::Deserialize<'de> for CommitView {
13602 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13603 where
13604 D: serde::Deserializer<'de>,
13605 {
13606 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CommitView>::new(
13607 ".google.cloud.developerconnect.v1.CommitView",
13608 ))
13609 }
13610}
13611
13612/// SystemProvider is a list of providers that are owned by Developer Connect.
13613///
13614/// # Working with unknown values
13615///
13616/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13617/// additional enum variants at any time. Adding new variants is not considered
13618/// a breaking change. Applications should write their code in anticipation of:
13619///
13620/// - New values appearing in future releases of the client library, **and**
13621/// - New values received dynamically, without application changes.
13622///
13623/// Please consult the [Working with enums] section in the user guide for some
13624/// guidelines.
13625///
13626/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13627#[derive(Clone, Debug, PartialEq)]
13628#[non_exhaustive]
13629pub enum SystemProvider {
13630 /// No system provider specified.
13631 Unspecified,
13632 /// GitHub provider.
13633 /// Scopes can be found at
13634 /// <https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes>
13635 Github,
13636 /// GitLab provider.
13637 /// Scopes can be found at
13638 /// <https://docs.gitlab.com/user/profile/personal_access_tokens/#personal-access-token-scopes>
13639 Gitlab,
13640 /// Google provider.
13641 /// Recommended scopes:
13642 /// `https://www.googleapis.com/auth/drive.readonly`,
13643 /// `https://www.googleapis.com/auth/documents.readonly`
13644 Google,
13645 /// Sentry provider.
13646 /// Scopes can be found at
13647 /// <https://docs.sentry.io/api/permissions/>
13648 Sentry,
13649 /// Rovo provider.
13650 /// Must select the "rovo" scope.
13651 Rovo,
13652 /// New Relic provider.
13653 /// No scopes are allowed.
13654 NewRelic,
13655 /// Datastax provider.
13656 /// No scopes are allowed.
13657 Datastax,
13658 /// Dynatrace provider.
13659 Dynatrace,
13660 /// If set, the enum was initialized with an unknown value.
13661 ///
13662 /// Applications can examine the value using [SystemProvider::value] or
13663 /// [SystemProvider::name].
13664 UnknownValue(system_provider::UnknownValue),
13665}
13666
13667#[doc(hidden)]
13668pub mod system_provider {
13669 #[allow(unused_imports)]
13670 use super::*;
13671 #[derive(Clone, Debug, PartialEq)]
13672 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13673}
13674
13675impl SystemProvider {
13676 /// Gets the enum value.
13677 ///
13678 /// Returns `None` if the enum contains an unknown value deserialized from
13679 /// the string representation of enums.
13680 pub fn value(&self) -> std::option::Option<i32> {
13681 match self {
13682 Self::Unspecified => std::option::Option::Some(0),
13683 Self::Github => std::option::Option::Some(1),
13684 Self::Gitlab => std::option::Option::Some(2),
13685 Self::Google => std::option::Option::Some(3),
13686 Self::Sentry => std::option::Option::Some(4),
13687 Self::Rovo => std::option::Option::Some(5),
13688 Self::NewRelic => std::option::Option::Some(6),
13689 Self::Datastax => std::option::Option::Some(7),
13690 Self::Dynatrace => std::option::Option::Some(8),
13691 Self::UnknownValue(u) => u.0.value(),
13692 }
13693 }
13694
13695 /// Gets the enum value as a string.
13696 ///
13697 /// Returns `None` if the enum contains an unknown value deserialized from
13698 /// the integer representation of enums.
13699 pub fn name(&self) -> std::option::Option<&str> {
13700 match self {
13701 Self::Unspecified => std::option::Option::Some("SYSTEM_PROVIDER_UNSPECIFIED"),
13702 Self::Github => std::option::Option::Some("GITHUB"),
13703 Self::Gitlab => std::option::Option::Some("GITLAB"),
13704 Self::Google => std::option::Option::Some("GOOGLE"),
13705 Self::Sentry => std::option::Option::Some("SENTRY"),
13706 Self::Rovo => std::option::Option::Some("ROVO"),
13707 Self::NewRelic => std::option::Option::Some("NEW_RELIC"),
13708 Self::Datastax => std::option::Option::Some("DATASTAX"),
13709 Self::Dynatrace => std::option::Option::Some("DYNATRACE"),
13710 Self::UnknownValue(u) => u.0.name(),
13711 }
13712 }
13713}
13714
13715impl std::default::Default for SystemProvider {
13716 fn default() -> Self {
13717 use std::convert::From;
13718 Self::from(0)
13719 }
13720}
13721
13722impl std::fmt::Display for SystemProvider {
13723 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13724 wkt::internal::display_enum(f, self.name(), self.value())
13725 }
13726}
13727
13728impl std::convert::From<i32> for SystemProvider {
13729 fn from(value: i32) -> Self {
13730 match value {
13731 0 => Self::Unspecified,
13732 1 => Self::Github,
13733 2 => Self::Gitlab,
13734 3 => Self::Google,
13735 4 => Self::Sentry,
13736 5 => Self::Rovo,
13737 6 => Self::NewRelic,
13738 7 => Self::Datastax,
13739 8 => Self::Dynatrace,
13740 _ => Self::UnknownValue(system_provider::UnknownValue(
13741 wkt::internal::UnknownEnumValue::Integer(value),
13742 )),
13743 }
13744 }
13745}
13746
13747impl std::convert::From<&str> for SystemProvider {
13748 fn from(value: &str) -> Self {
13749 use std::string::ToString;
13750 match value {
13751 "SYSTEM_PROVIDER_UNSPECIFIED" => Self::Unspecified,
13752 "GITHUB" => Self::Github,
13753 "GITLAB" => Self::Gitlab,
13754 "GOOGLE" => Self::Google,
13755 "SENTRY" => Self::Sentry,
13756 "ROVO" => Self::Rovo,
13757 "NEW_RELIC" => Self::NewRelic,
13758 "DATASTAX" => Self::Datastax,
13759 "DYNATRACE" => Self::Dynatrace,
13760 _ => Self::UnknownValue(system_provider::UnknownValue(
13761 wkt::internal::UnknownEnumValue::String(value.to_string()),
13762 )),
13763 }
13764 }
13765}
13766
13767impl serde::ser::Serialize for SystemProvider {
13768 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13769 where
13770 S: serde::Serializer,
13771 {
13772 match self {
13773 Self::Unspecified => serializer.serialize_i32(0),
13774 Self::Github => serializer.serialize_i32(1),
13775 Self::Gitlab => serializer.serialize_i32(2),
13776 Self::Google => serializer.serialize_i32(3),
13777 Self::Sentry => serializer.serialize_i32(4),
13778 Self::Rovo => serializer.serialize_i32(5),
13779 Self::NewRelic => serializer.serialize_i32(6),
13780 Self::Datastax => serializer.serialize_i32(7),
13781 Self::Dynatrace => serializer.serialize_i32(8),
13782 Self::UnknownValue(u) => u.0.serialize(serializer),
13783 }
13784 }
13785}
13786
13787impl<'de> serde::de::Deserialize<'de> for SystemProvider {
13788 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13789 where
13790 D: serde::Deserializer<'de>,
13791 {
13792 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SystemProvider>::new(
13793 ".google.cloud.developerconnect.v1.SystemProvider",
13794 ))
13795 }
13796}