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::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate google_cloud_rpc;
28extern crate lazy_static;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// Message for requesting a list of Users
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct ListUsersRequest {
44 /// Required. Parent value for ListUsersRequest
45 pub parent: std::string::String,
46
47 /// Optional. Requested page size. Server may return fewer items than
48 /// requested. If unspecified, server will pick an appropriate default.
49 pub page_size: i32,
50
51 /// Optional. A token identifying a page of results the server should return.
52 pub page_token: std::string::String,
53
54 /// Optional. Filtering results
55 pub filter: std::string::String,
56
57 /// Optional. Hint for how to order the results
58 pub order_by: std::string::String,
59
60 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
61}
62
63impl ListUsersRequest {
64 pub fn new() -> Self {
65 std::default::Default::default()
66 }
67
68 /// Sets the value of [parent][crate::model::ListUsersRequest::parent].
69 ///
70 /// # Example
71 /// ```ignore,no_run
72 /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
73 /// let x = ListUsersRequest::new().set_parent("example");
74 /// ```
75 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
76 self.parent = v.into();
77 self
78 }
79
80 /// Sets the value of [page_size][crate::model::ListUsersRequest::page_size].
81 ///
82 /// # Example
83 /// ```ignore,no_run
84 /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
85 /// let x = ListUsersRequest::new().set_page_size(42);
86 /// ```
87 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
88 self.page_size = v.into();
89 self
90 }
91
92 /// Sets the value of [page_token][crate::model::ListUsersRequest::page_token].
93 ///
94 /// # Example
95 /// ```ignore,no_run
96 /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
97 /// let x = ListUsersRequest::new().set_page_token("example");
98 /// ```
99 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
100 self.page_token = v.into();
101 self
102 }
103
104 /// Sets the value of [filter][crate::model::ListUsersRequest::filter].
105 ///
106 /// # Example
107 /// ```ignore,no_run
108 /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
109 /// let x = ListUsersRequest::new().set_filter("example");
110 /// ```
111 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
112 self.filter = v.into();
113 self
114 }
115
116 /// Sets the value of [order_by][crate::model::ListUsersRequest::order_by].
117 ///
118 /// # Example
119 /// ```ignore,no_run
120 /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
121 /// let x = ListUsersRequest::new().set_order_by("example");
122 /// ```
123 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
124 self.order_by = v.into();
125 self
126 }
127}
128
129impl wkt::message::Message for ListUsersRequest {
130 fn typename() -> &'static str {
131 "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersRequest"
132 }
133}
134
135/// Message for response to listing Users
136#[derive(Clone, Default, PartialEq)]
137#[non_exhaustive]
138pub struct ListUsersResponse {
139 /// The list of Users
140 pub users: std::vec::Vec<crate::model::User>,
141
142 /// A token identifying a page of results the server should return.
143 pub next_page_token: std::string::String,
144
145 /// Locations that could not be reached.
146 pub unreachable: std::vec::Vec<std::string::String>,
147
148 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
149}
150
151impl ListUsersResponse {
152 pub fn new() -> Self {
153 std::default::Default::default()
154 }
155
156 /// Sets the value of [users][crate::model::ListUsersResponse::users].
157 ///
158 /// # Example
159 /// ```ignore,no_run
160 /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
161 /// use google_cloud_developerconnect_v1::model::User;
162 /// let x = ListUsersResponse::new()
163 /// .set_users([
164 /// User::default()/* use setters */,
165 /// User::default()/* use (different) setters */,
166 /// ]);
167 /// ```
168 pub fn set_users<T, V>(mut self, v: T) -> Self
169 where
170 T: std::iter::IntoIterator<Item = V>,
171 V: std::convert::Into<crate::model::User>,
172 {
173 use std::iter::Iterator;
174 self.users = v.into_iter().map(|i| i.into()).collect();
175 self
176 }
177
178 /// Sets the value of [next_page_token][crate::model::ListUsersResponse::next_page_token].
179 ///
180 /// # Example
181 /// ```ignore,no_run
182 /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
183 /// let x = ListUsersResponse::new().set_next_page_token("example");
184 /// ```
185 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
186 self.next_page_token = v.into();
187 self
188 }
189
190 /// Sets the value of [unreachable][crate::model::ListUsersResponse::unreachable].
191 ///
192 /// # Example
193 /// ```ignore,no_run
194 /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
195 /// let x = ListUsersResponse::new().set_unreachable(["a", "b", "c"]);
196 /// ```
197 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
198 where
199 T: std::iter::IntoIterator<Item = V>,
200 V: std::convert::Into<std::string::String>,
201 {
202 use std::iter::Iterator;
203 self.unreachable = v.into_iter().map(|i| i.into()).collect();
204 self
205 }
206}
207
208impl wkt::message::Message for ListUsersResponse {
209 fn typename() -> &'static str {
210 "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersResponse"
211 }
212}
213
214#[doc(hidden)]
215impl google_cloud_gax::paginator::internal::PageableResponse for ListUsersResponse {
216 type PageItem = crate::model::User;
217
218 fn items(self) -> std::vec::Vec<Self::PageItem> {
219 self.users
220 }
221
222 fn next_page_token(&self) -> std::string::String {
223 use std::clone::Clone;
224 self.next_page_token.clone()
225 }
226}
227
228/// Message describing Connection object
229#[derive(Clone, Default, PartialEq)]
230#[non_exhaustive]
231pub struct Connection {
232 /// Identifier. The resource name of the connection, in the format
233 /// `projects/{project}/locations/{location}/connections/{connection_id}`.
234 pub name: std::string::String,
235
236 /// Output only. [Output only] Create timestamp
237 pub create_time: std::option::Option<wkt::Timestamp>,
238
239 /// Output only. [Output only] Update timestamp
240 pub update_time: std::option::Option<wkt::Timestamp>,
241
242 /// Output only. [Output only] Delete timestamp
243 pub delete_time: std::option::Option<wkt::Timestamp>,
244
245 /// Optional. Labels as key value pairs
246 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
247
248 /// Output only. Installation state of the Connection.
249 pub installation_state: std::option::Option<crate::model::InstallationState>,
250
251 /// Optional. If disabled is set to true, functionality is disabled for this
252 /// connection. Repository based API methods and webhooks processing for
253 /// repositories in this connection will be disabled.
254 pub disabled: bool,
255
256 /// Output only. Set to true when the connection is being set up or updated in
257 /// the background.
258 pub reconciling: bool,
259
260 /// Optional. Allows clients to store small amounts of arbitrary data.
261 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
262
263 /// Optional. This checksum is computed by the server based on the value of
264 /// other fields, and may be sent on update and delete requests to ensure the
265 /// client has an up-to-date value before proceeding.
266 pub etag: std::string::String,
267
268 /// Output only. A system-assigned unique identifier for the Connection.
269 pub uid: std::string::String,
270
271 /// Optional. The crypto key configuration. This field is used by the
272 /// Customer-Managed Encryption Keys (CMEK) feature.
273 pub crypto_key_config: std::option::Option<crate::model::CryptoKeyConfig>,
274
275 /// Optional. Configuration for the git proxy feature. Enabling the git proxy
276 /// allows clients to perform git operations on the repositories linked in the
277 /// connection.
278 pub git_proxy_config: std::option::Option<crate::model::GitProxyConfig>,
279
280 /// Configuration for the connection depending on the type of provider.
281 pub connection_config: std::option::Option<crate::model::connection::ConnectionConfig>,
282
283 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
284}
285
286impl Connection {
287 pub fn new() -> Self {
288 std::default::Default::default()
289 }
290
291 /// Sets the value of [name][crate::model::Connection::name].
292 ///
293 /// # Example
294 /// ```ignore,no_run
295 /// # use google_cloud_developerconnect_v1::model::Connection;
296 /// let x = Connection::new().set_name("example");
297 /// ```
298 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
299 self.name = v.into();
300 self
301 }
302
303 /// Sets the value of [create_time][crate::model::Connection::create_time].
304 ///
305 /// # Example
306 /// ```ignore,no_run
307 /// # use google_cloud_developerconnect_v1::model::Connection;
308 /// use wkt::Timestamp;
309 /// let x = Connection::new().set_create_time(Timestamp::default()/* use setters */);
310 /// ```
311 pub fn set_create_time<T>(mut self, v: T) -> Self
312 where
313 T: std::convert::Into<wkt::Timestamp>,
314 {
315 self.create_time = std::option::Option::Some(v.into());
316 self
317 }
318
319 /// Sets or clears the value of [create_time][crate::model::Connection::create_time].
320 ///
321 /// # Example
322 /// ```ignore,no_run
323 /// # use google_cloud_developerconnect_v1::model::Connection;
324 /// use wkt::Timestamp;
325 /// let x = Connection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
326 /// let x = Connection::new().set_or_clear_create_time(None::<Timestamp>);
327 /// ```
328 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
329 where
330 T: std::convert::Into<wkt::Timestamp>,
331 {
332 self.create_time = v.map(|x| x.into());
333 self
334 }
335
336 /// Sets the value of [update_time][crate::model::Connection::update_time].
337 ///
338 /// # Example
339 /// ```ignore,no_run
340 /// # use google_cloud_developerconnect_v1::model::Connection;
341 /// use wkt::Timestamp;
342 /// let x = Connection::new().set_update_time(Timestamp::default()/* use setters */);
343 /// ```
344 pub fn set_update_time<T>(mut self, v: T) -> Self
345 where
346 T: std::convert::Into<wkt::Timestamp>,
347 {
348 self.update_time = std::option::Option::Some(v.into());
349 self
350 }
351
352 /// Sets or clears the value of [update_time][crate::model::Connection::update_time].
353 ///
354 /// # Example
355 /// ```ignore,no_run
356 /// # use google_cloud_developerconnect_v1::model::Connection;
357 /// use wkt::Timestamp;
358 /// let x = Connection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
359 /// let x = Connection::new().set_or_clear_update_time(None::<Timestamp>);
360 /// ```
361 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
362 where
363 T: std::convert::Into<wkt::Timestamp>,
364 {
365 self.update_time = v.map(|x| x.into());
366 self
367 }
368
369 /// Sets the value of [delete_time][crate::model::Connection::delete_time].
370 ///
371 /// # Example
372 /// ```ignore,no_run
373 /// # use google_cloud_developerconnect_v1::model::Connection;
374 /// use wkt::Timestamp;
375 /// let x = Connection::new().set_delete_time(Timestamp::default()/* use setters */);
376 /// ```
377 pub fn set_delete_time<T>(mut self, v: T) -> Self
378 where
379 T: std::convert::Into<wkt::Timestamp>,
380 {
381 self.delete_time = std::option::Option::Some(v.into());
382 self
383 }
384
385 /// Sets or clears the value of [delete_time][crate::model::Connection::delete_time].
386 ///
387 /// # Example
388 /// ```ignore,no_run
389 /// # use google_cloud_developerconnect_v1::model::Connection;
390 /// use wkt::Timestamp;
391 /// let x = Connection::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
392 /// let x = Connection::new().set_or_clear_delete_time(None::<Timestamp>);
393 /// ```
394 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
395 where
396 T: std::convert::Into<wkt::Timestamp>,
397 {
398 self.delete_time = v.map(|x| x.into());
399 self
400 }
401
402 /// Sets the value of [labels][crate::model::Connection::labels].
403 ///
404 /// # Example
405 /// ```ignore,no_run
406 /// # use google_cloud_developerconnect_v1::model::Connection;
407 /// let x = Connection::new().set_labels([
408 /// ("key0", "abc"),
409 /// ("key1", "xyz"),
410 /// ]);
411 /// ```
412 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
413 where
414 T: std::iter::IntoIterator<Item = (K, V)>,
415 K: std::convert::Into<std::string::String>,
416 V: std::convert::Into<std::string::String>,
417 {
418 use std::iter::Iterator;
419 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
420 self
421 }
422
423 /// Sets the value of [installation_state][crate::model::Connection::installation_state].
424 ///
425 /// # Example
426 /// ```ignore,no_run
427 /// # use google_cloud_developerconnect_v1::model::Connection;
428 /// use google_cloud_developerconnect_v1::model::InstallationState;
429 /// let x = Connection::new().set_installation_state(InstallationState::default()/* use setters */);
430 /// ```
431 pub fn set_installation_state<T>(mut self, v: T) -> Self
432 where
433 T: std::convert::Into<crate::model::InstallationState>,
434 {
435 self.installation_state = std::option::Option::Some(v.into());
436 self
437 }
438
439 /// Sets or clears the value of [installation_state][crate::model::Connection::installation_state].
440 ///
441 /// # Example
442 /// ```ignore,no_run
443 /// # use google_cloud_developerconnect_v1::model::Connection;
444 /// use google_cloud_developerconnect_v1::model::InstallationState;
445 /// let x = Connection::new().set_or_clear_installation_state(Some(InstallationState::default()/* use setters */));
446 /// let x = Connection::new().set_or_clear_installation_state(None::<InstallationState>);
447 /// ```
448 pub fn set_or_clear_installation_state<T>(mut self, v: std::option::Option<T>) -> Self
449 where
450 T: std::convert::Into<crate::model::InstallationState>,
451 {
452 self.installation_state = v.map(|x| x.into());
453 self
454 }
455
456 /// Sets the value of [disabled][crate::model::Connection::disabled].
457 ///
458 /// # Example
459 /// ```ignore,no_run
460 /// # use google_cloud_developerconnect_v1::model::Connection;
461 /// let x = Connection::new().set_disabled(true);
462 /// ```
463 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
464 self.disabled = v.into();
465 self
466 }
467
468 /// Sets the value of [reconciling][crate::model::Connection::reconciling].
469 ///
470 /// # Example
471 /// ```ignore,no_run
472 /// # use google_cloud_developerconnect_v1::model::Connection;
473 /// let x = Connection::new().set_reconciling(true);
474 /// ```
475 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
476 self.reconciling = v.into();
477 self
478 }
479
480 /// Sets the value of [annotations][crate::model::Connection::annotations].
481 ///
482 /// # Example
483 /// ```ignore,no_run
484 /// # use google_cloud_developerconnect_v1::model::Connection;
485 /// let x = Connection::new().set_annotations([
486 /// ("key0", "abc"),
487 /// ("key1", "xyz"),
488 /// ]);
489 /// ```
490 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
491 where
492 T: std::iter::IntoIterator<Item = (K, V)>,
493 K: std::convert::Into<std::string::String>,
494 V: std::convert::Into<std::string::String>,
495 {
496 use std::iter::Iterator;
497 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
498 self
499 }
500
501 /// Sets the value of [etag][crate::model::Connection::etag].
502 ///
503 /// # Example
504 /// ```ignore,no_run
505 /// # use google_cloud_developerconnect_v1::model::Connection;
506 /// let x = Connection::new().set_etag("example");
507 /// ```
508 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
509 self.etag = v.into();
510 self
511 }
512
513 /// Sets the value of [uid][crate::model::Connection::uid].
514 ///
515 /// # Example
516 /// ```ignore,no_run
517 /// # use google_cloud_developerconnect_v1::model::Connection;
518 /// let x = Connection::new().set_uid("example");
519 /// ```
520 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
521 self.uid = v.into();
522 self
523 }
524
525 /// Sets the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
526 ///
527 /// # Example
528 /// ```ignore,no_run
529 /// # use google_cloud_developerconnect_v1::model::Connection;
530 /// use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
531 /// let x = Connection::new().set_crypto_key_config(CryptoKeyConfig::default()/* use setters */);
532 /// ```
533 pub fn set_crypto_key_config<T>(mut self, v: T) -> Self
534 where
535 T: std::convert::Into<crate::model::CryptoKeyConfig>,
536 {
537 self.crypto_key_config = std::option::Option::Some(v.into());
538 self
539 }
540
541 /// Sets or clears the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
542 ///
543 /// # Example
544 /// ```ignore,no_run
545 /// # use google_cloud_developerconnect_v1::model::Connection;
546 /// use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
547 /// let x = Connection::new().set_or_clear_crypto_key_config(Some(CryptoKeyConfig::default()/* use setters */));
548 /// let x = Connection::new().set_or_clear_crypto_key_config(None::<CryptoKeyConfig>);
549 /// ```
550 pub fn set_or_clear_crypto_key_config<T>(mut self, v: std::option::Option<T>) -> Self
551 where
552 T: std::convert::Into<crate::model::CryptoKeyConfig>,
553 {
554 self.crypto_key_config = v.map(|x| x.into());
555 self
556 }
557
558 /// Sets the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
559 ///
560 /// # Example
561 /// ```ignore,no_run
562 /// # use google_cloud_developerconnect_v1::model::Connection;
563 /// use google_cloud_developerconnect_v1::model::GitProxyConfig;
564 /// let x = Connection::new().set_git_proxy_config(GitProxyConfig::default()/* use setters */);
565 /// ```
566 pub fn set_git_proxy_config<T>(mut self, v: T) -> Self
567 where
568 T: std::convert::Into<crate::model::GitProxyConfig>,
569 {
570 self.git_proxy_config = std::option::Option::Some(v.into());
571 self
572 }
573
574 /// Sets or clears the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
575 ///
576 /// # Example
577 /// ```ignore,no_run
578 /// # use google_cloud_developerconnect_v1::model::Connection;
579 /// use google_cloud_developerconnect_v1::model::GitProxyConfig;
580 /// let x = Connection::new().set_or_clear_git_proxy_config(Some(GitProxyConfig::default()/* use setters */));
581 /// let x = Connection::new().set_or_clear_git_proxy_config(None::<GitProxyConfig>);
582 /// ```
583 pub fn set_or_clear_git_proxy_config<T>(mut self, v: std::option::Option<T>) -> Self
584 where
585 T: std::convert::Into<crate::model::GitProxyConfig>,
586 {
587 self.git_proxy_config = v.map(|x| x.into());
588 self
589 }
590
591 /// Sets the value of [connection_config][crate::model::Connection::connection_config].
592 ///
593 /// Note that all the setters affecting `connection_config` are mutually
594 /// exclusive.
595 ///
596 /// # Example
597 /// ```ignore,no_run
598 /// # use google_cloud_developerconnect_v1::model::Connection;
599 /// use google_cloud_developerconnect_v1::model::GitHubConfig;
600 /// let x = Connection::new().set_connection_config(Some(
601 /// google_cloud_developerconnect_v1::model::connection::ConnectionConfig::GithubConfig(GitHubConfig::default().into())));
602 /// ```
603 pub fn set_connection_config<
604 T: std::convert::Into<std::option::Option<crate::model::connection::ConnectionConfig>>,
605 >(
606 mut self,
607 v: T,
608 ) -> Self {
609 self.connection_config = v.into();
610 self
611 }
612
613 /// The value of [connection_config][crate::model::Connection::connection_config]
614 /// if it holds a `GithubConfig`, `None` if the field is not set or
615 /// holds a different branch.
616 pub fn github_config(
617 &self,
618 ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubConfig>> {
619 #[allow(unreachable_patterns)]
620 self.connection_config.as_ref().and_then(|v| match v {
621 crate::model::connection::ConnectionConfig::GithubConfig(v) => {
622 std::option::Option::Some(v)
623 }
624 _ => std::option::Option::None,
625 })
626 }
627
628 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
629 /// to hold a `GithubConfig`.
630 ///
631 /// Note that all the setters affecting `connection_config` are
632 /// mutually exclusive.
633 ///
634 /// # Example
635 /// ```ignore,no_run
636 /// # use google_cloud_developerconnect_v1::model::Connection;
637 /// use google_cloud_developerconnect_v1::model::GitHubConfig;
638 /// let x = Connection::new().set_github_config(GitHubConfig::default()/* use setters */);
639 /// assert!(x.github_config().is_some());
640 /// assert!(x.github_enterprise_config().is_none());
641 /// assert!(x.gitlab_config().is_none());
642 /// assert!(x.gitlab_enterprise_config().is_none());
643 /// assert!(x.bitbucket_data_center_config().is_none());
644 /// assert!(x.bitbucket_cloud_config().is_none());
645 /// ```
646 pub fn set_github_config<T: std::convert::Into<std::boxed::Box<crate::model::GitHubConfig>>>(
647 mut self,
648 v: T,
649 ) -> Self {
650 self.connection_config = std::option::Option::Some(
651 crate::model::connection::ConnectionConfig::GithubConfig(v.into()),
652 );
653 self
654 }
655
656 /// The value of [connection_config][crate::model::Connection::connection_config]
657 /// if it holds a `GithubEnterpriseConfig`, `None` if the field is not set or
658 /// holds a different branch.
659 pub fn github_enterprise_config(
660 &self,
661 ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubEnterpriseConfig>> {
662 #[allow(unreachable_patterns)]
663 self.connection_config.as_ref().and_then(|v| match v {
664 crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v) => {
665 std::option::Option::Some(v)
666 }
667 _ => std::option::Option::None,
668 })
669 }
670
671 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
672 /// to hold a `GithubEnterpriseConfig`.
673 ///
674 /// Note that all the setters affecting `connection_config` are
675 /// mutually exclusive.
676 ///
677 /// # Example
678 /// ```ignore,no_run
679 /// # use google_cloud_developerconnect_v1::model::Connection;
680 /// use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
681 /// let x = Connection::new().set_github_enterprise_config(GitHubEnterpriseConfig::default()/* use setters */);
682 /// assert!(x.github_enterprise_config().is_some());
683 /// assert!(x.github_config().is_none());
684 /// assert!(x.gitlab_config().is_none());
685 /// assert!(x.gitlab_enterprise_config().is_none());
686 /// assert!(x.bitbucket_data_center_config().is_none());
687 /// assert!(x.bitbucket_cloud_config().is_none());
688 /// ```
689 pub fn set_github_enterprise_config<
690 T: std::convert::Into<std::boxed::Box<crate::model::GitHubEnterpriseConfig>>,
691 >(
692 mut self,
693 v: T,
694 ) -> Self {
695 self.connection_config = std::option::Option::Some(
696 crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v.into()),
697 );
698 self
699 }
700
701 /// The value of [connection_config][crate::model::Connection::connection_config]
702 /// if it holds a `GitlabConfig`, `None` if the field is not set or
703 /// holds a different branch.
704 pub fn gitlab_config(
705 &self,
706 ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabConfig>> {
707 #[allow(unreachable_patterns)]
708 self.connection_config.as_ref().and_then(|v| match v {
709 crate::model::connection::ConnectionConfig::GitlabConfig(v) => {
710 std::option::Option::Some(v)
711 }
712 _ => std::option::Option::None,
713 })
714 }
715
716 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
717 /// to hold a `GitlabConfig`.
718 ///
719 /// Note that all the setters affecting `connection_config` are
720 /// mutually exclusive.
721 ///
722 /// # Example
723 /// ```ignore,no_run
724 /// # use google_cloud_developerconnect_v1::model::Connection;
725 /// use google_cloud_developerconnect_v1::model::GitLabConfig;
726 /// let x = Connection::new().set_gitlab_config(GitLabConfig::default()/* use setters */);
727 /// assert!(x.gitlab_config().is_some());
728 /// assert!(x.github_config().is_none());
729 /// assert!(x.github_enterprise_config().is_none());
730 /// assert!(x.gitlab_enterprise_config().is_none());
731 /// assert!(x.bitbucket_data_center_config().is_none());
732 /// assert!(x.bitbucket_cloud_config().is_none());
733 /// ```
734 pub fn set_gitlab_config<T: std::convert::Into<std::boxed::Box<crate::model::GitLabConfig>>>(
735 mut self,
736 v: T,
737 ) -> Self {
738 self.connection_config = std::option::Option::Some(
739 crate::model::connection::ConnectionConfig::GitlabConfig(v.into()),
740 );
741 self
742 }
743
744 /// The value of [connection_config][crate::model::Connection::connection_config]
745 /// if it holds a `GitlabEnterpriseConfig`, `None` if the field is not set or
746 /// holds a different branch.
747 pub fn gitlab_enterprise_config(
748 &self,
749 ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabEnterpriseConfig>> {
750 #[allow(unreachable_patterns)]
751 self.connection_config.as_ref().and_then(|v| match v {
752 crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v) => {
753 std::option::Option::Some(v)
754 }
755 _ => std::option::Option::None,
756 })
757 }
758
759 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
760 /// to hold a `GitlabEnterpriseConfig`.
761 ///
762 /// Note that all the setters affecting `connection_config` are
763 /// mutually exclusive.
764 ///
765 /// # Example
766 /// ```ignore,no_run
767 /// # use google_cloud_developerconnect_v1::model::Connection;
768 /// use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
769 /// let x = Connection::new().set_gitlab_enterprise_config(GitLabEnterpriseConfig::default()/* use setters */);
770 /// assert!(x.gitlab_enterprise_config().is_some());
771 /// assert!(x.github_config().is_none());
772 /// assert!(x.github_enterprise_config().is_none());
773 /// assert!(x.gitlab_config().is_none());
774 /// assert!(x.bitbucket_data_center_config().is_none());
775 /// assert!(x.bitbucket_cloud_config().is_none());
776 /// ```
777 pub fn set_gitlab_enterprise_config<
778 T: std::convert::Into<std::boxed::Box<crate::model::GitLabEnterpriseConfig>>,
779 >(
780 mut self,
781 v: T,
782 ) -> Self {
783 self.connection_config = std::option::Option::Some(
784 crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v.into()),
785 );
786 self
787 }
788
789 /// The value of [connection_config][crate::model::Connection::connection_config]
790 /// if it holds a `BitbucketDataCenterConfig`, `None` if the field is not set or
791 /// holds a different branch.
792 pub fn bitbucket_data_center_config(
793 &self,
794 ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketDataCenterConfig>> {
795 #[allow(unreachable_patterns)]
796 self.connection_config.as_ref().and_then(|v| match v {
797 crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v) => {
798 std::option::Option::Some(v)
799 }
800 _ => std::option::Option::None,
801 })
802 }
803
804 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
805 /// to hold a `BitbucketDataCenterConfig`.
806 ///
807 /// Note that all the setters affecting `connection_config` are
808 /// mutually exclusive.
809 ///
810 /// # Example
811 /// ```ignore,no_run
812 /// # use google_cloud_developerconnect_v1::model::Connection;
813 /// use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
814 /// let x = Connection::new().set_bitbucket_data_center_config(BitbucketDataCenterConfig::default()/* use setters */);
815 /// assert!(x.bitbucket_data_center_config().is_some());
816 /// assert!(x.github_config().is_none());
817 /// assert!(x.github_enterprise_config().is_none());
818 /// assert!(x.gitlab_config().is_none());
819 /// assert!(x.gitlab_enterprise_config().is_none());
820 /// assert!(x.bitbucket_cloud_config().is_none());
821 /// ```
822 pub fn set_bitbucket_data_center_config<
823 T: std::convert::Into<std::boxed::Box<crate::model::BitbucketDataCenterConfig>>,
824 >(
825 mut self,
826 v: T,
827 ) -> Self {
828 self.connection_config = std::option::Option::Some(
829 crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v.into()),
830 );
831 self
832 }
833
834 /// The value of [connection_config][crate::model::Connection::connection_config]
835 /// if it holds a `BitbucketCloudConfig`, `None` if the field is not set or
836 /// holds a different branch.
837 pub fn bitbucket_cloud_config(
838 &self,
839 ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketCloudConfig>> {
840 #[allow(unreachable_patterns)]
841 self.connection_config.as_ref().and_then(|v| match v {
842 crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v) => {
843 std::option::Option::Some(v)
844 }
845 _ => std::option::Option::None,
846 })
847 }
848
849 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
850 /// to hold a `BitbucketCloudConfig`.
851 ///
852 /// Note that all the setters affecting `connection_config` are
853 /// mutually exclusive.
854 ///
855 /// # Example
856 /// ```ignore,no_run
857 /// # use google_cloud_developerconnect_v1::model::Connection;
858 /// use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
859 /// let x = Connection::new().set_bitbucket_cloud_config(BitbucketCloudConfig::default()/* use setters */);
860 /// assert!(x.bitbucket_cloud_config().is_some());
861 /// assert!(x.github_config().is_none());
862 /// assert!(x.github_enterprise_config().is_none());
863 /// assert!(x.gitlab_config().is_none());
864 /// assert!(x.gitlab_enterprise_config().is_none());
865 /// assert!(x.bitbucket_data_center_config().is_none());
866 /// ```
867 pub fn set_bitbucket_cloud_config<
868 T: std::convert::Into<std::boxed::Box<crate::model::BitbucketCloudConfig>>,
869 >(
870 mut self,
871 v: T,
872 ) -> Self {
873 self.connection_config = std::option::Option::Some(
874 crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v.into()),
875 );
876 self
877 }
878}
879
880impl wkt::message::Message for Connection {
881 fn typename() -> &'static str {
882 "type.googleapis.com/google.cloud.developerconnect.v1.Connection"
883 }
884}
885
886/// Defines additional types related to [Connection].
887pub mod connection {
888 #[allow(unused_imports)]
889 use super::*;
890
891 /// Configuration for the connection depending on the type of provider.
892 #[derive(Clone, Debug, PartialEq)]
893 #[non_exhaustive]
894 pub enum ConnectionConfig {
895 /// Configuration for connections to github.com.
896 GithubConfig(std::boxed::Box<crate::model::GitHubConfig>),
897 /// Configuration for connections to an instance of GitHub Enterprise.
898 GithubEnterpriseConfig(std::boxed::Box<crate::model::GitHubEnterpriseConfig>),
899 /// Configuration for connections to gitlab.com.
900 GitlabConfig(std::boxed::Box<crate::model::GitLabConfig>),
901 /// Configuration for connections to an instance of GitLab Enterprise.
902 GitlabEnterpriseConfig(std::boxed::Box<crate::model::GitLabEnterpriseConfig>),
903 /// Configuration for connections to an instance of Bitbucket Data Center.
904 BitbucketDataCenterConfig(std::boxed::Box<crate::model::BitbucketDataCenterConfig>),
905 /// Configuration for connections to an instance of Bitbucket Clouds.
906 BitbucketCloudConfig(std::boxed::Box<crate::model::BitbucketCloudConfig>),
907 }
908}
909
910/// The crypto key configuration. This field is used by the Customer-managed
911/// encryption keys (CMEK) feature.
912#[derive(Clone, Default, PartialEq)]
913#[non_exhaustive]
914pub struct CryptoKeyConfig {
915 /// Required. The name of the key which is used to encrypt/decrypt customer
916 /// data. For key in Cloud KMS, the key should be in the format of
917 /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
918 pub key_reference: std::string::String,
919
920 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
921}
922
923impl CryptoKeyConfig {
924 pub fn new() -> Self {
925 std::default::Default::default()
926 }
927
928 /// Sets the value of [key_reference][crate::model::CryptoKeyConfig::key_reference].
929 ///
930 /// # Example
931 /// ```ignore,no_run
932 /// # use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
933 /// let x = CryptoKeyConfig::new().set_key_reference("example");
934 /// ```
935 pub fn set_key_reference<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
936 self.key_reference = v.into();
937 self
938 }
939}
940
941impl wkt::message::Message for CryptoKeyConfig {
942 fn typename() -> &'static str {
943 "type.googleapis.com/google.cloud.developerconnect.v1.CryptoKeyConfig"
944 }
945}
946
947/// The git proxy configuration.
948#[derive(Clone, Default, PartialEq)]
949#[non_exhaustive]
950pub struct GitProxyConfig {
951 /// Optional. Setting this to true allows the git proxy to be used for
952 /// performing git operations on the repositories linked in the connection.
953 pub enabled: bool,
954
955 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
956}
957
958impl GitProxyConfig {
959 pub fn new() -> Self {
960 std::default::Default::default()
961 }
962
963 /// Sets the value of [enabled][crate::model::GitProxyConfig::enabled].
964 ///
965 /// # Example
966 /// ```ignore,no_run
967 /// # use google_cloud_developerconnect_v1::model::GitProxyConfig;
968 /// let x = GitProxyConfig::new().set_enabled(true);
969 /// ```
970 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
971 self.enabled = v.into();
972 self
973 }
974}
975
976impl wkt::message::Message for GitProxyConfig {
977 fn typename() -> &'static str {
978 "type.googleapis.com/google.cloud.developerconnect.v1.GitProxyConfig"
979 }
980}
981
982/// Describes stage and necessary actions to be taken by the
983/// user to complete the installation. Used for GitHub and GitHub Enterprise
984/// based connections.
985#[derive(Clone, Default, PartialEq)]
986#[non_exhaustive]
987pub struct InstallationState {
988 /// Output only. Current step of the installation process.
989 pub stage: crate::model::installation_state::Stage,
990
991 /// Output only. Message of what the user should do next to continue the
992 /// installation. Empty string if the installation is already complete.
993 pub message: std::string::String,
994
995 /// Output only. Link to follow for next action. Empty string if the
996 /// installation is already complete.
997 pub action_uri: std::string::String,
998
999 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1000}
1001
1002impl InstallationState {
1003 pub fn new() -> Self {
1004 std::default::Default::default()
1005 }
1006
1007 /// Sets the value of [stage][crate::model::InstallationState::stage].
1008 ///
1009 /// # Example
1010 /// ```ignore,no_run
1011 /// # use google_cloud_developerconnect_v1::model::InstallationState;
1012 /// use google_cloud_developerconnect_v1::model::installation_state::Stage;
1013 /// let x0 = InstallationState::new().set_stage(Stage::PendingCreateApp);
1014 /// let x1 = InstallationState::new().set_stage(Stage::PendingUserOauth);
1015 /// let x2 = InstallationState::new().set_stage(Stage::PendingInstallApp);
1016 /// ```
1017 pub fn set_stage<T: std::convert::Into<crate::model::installation_state::Stage>>(
1018 mut self,
1019 v: T,
1020 ) -> Self {
1021 self.stage = v.into();
1022 self
1023 }
1024
1025 /// Sets the value of [message][crate::model::InstallationState::message].
1026 ///
1027 /// # Example
1028 /// ```ignore,no_run
1029 /// # use google_cloud_developerconnect_v1::model::InstallationState;
1030 /// let x = InstallationState::new().set_message("example");
1031 /// ```
1032 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1033 self.message = v.into();
1034 self
1035 }
1036
1037 /// Sets the value of [action_uri][crate::model::InstallationState::action_uri].
1038 ///
1039 /// # Example
1040 /// ```ignore,no_run
1041 /// # use google_cloud_developerconnect_v1::model::InstallationState;
1042 /// let x = InstallationState::new().set_action_uri("example");
1043 /// ```
1044 pub fn set_action_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1045 self.action_uri = v.into();
1046 self
1047 }
1048}
1049
1050impl wkt::message::Message for InstallationState {
1051 fn typename() -> &'static str {
1052 "type.googleapis.com/google.cloud.developerconnect.v1.InstallationState"
1053 }
1054}
1055
1056/// Defines additional types related to [InstallationState].
1057pub mod installation_state {
1058 #[allow(unused_imports)]
1059 use super::*;
1060
1061 /// Stage of the installation process.
1062 ///
1063 /// # Working with unknown values
1064 ///
1065 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1066 /// additional enum variants at any time. Adding new variants is not considered
1067 /// a breaking change. Applications should write their code in anticipation of:
1068 ///
1069 /// - New values appearing in future releases of the client library, **and**
1070 /// - New values received dynamically, without application changes.
1071 ///
1072 /// Please consult the [Working with enums] section in the user guide for some
1073 /// guidelines.
1074 ///
1075 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1076 #[derive(Clone, Debug, PartialEq)]
1077 #[non_exhaustive]
1078 pub enum Stage {
1079 /// No stage specified.
1080 Unspecified,
1081 /// Only for GitHub Enterprise. An App creation has been requested.
1082 /// The user needs to confirm the creation in their GitHub enterprise host.
1083 PendingCreateApp,
1084 /// User needs to authorize the GitHub (or Enterprise) App via OAuth.
1085 PendingUserOauth,
1086 /// User needs to follow the link to install the GitHub (or Enterprise) App.
1087 PendingInstallApp,
1088 /// Installation process has been completed.
1089 Complete,
1090 /// If set, the enum was initialized with an unknown value.
1091 ///
1092 /// Applications can examine the value using [Stage::value] or
1093 /// [Stage::name].
1094 UnknownValue(stage::UnknownValue),
1095 }
1096
1097 #[doc(hidden)]
1098 pub mod stage {
1099 #[allow(unused_imports)]
1100 use super::*;
1101 #[derive(Clone, Debug, PartialEq)]
1102 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1103 }
1104
1105 impl Stage {
1106 /// Gets the enum value.
1107 ///
1108 /// Returns `None` if the enum contains an unknown value deserialized from
1109 /// the string representation of enums.
1110 pub fn value(&self) -> std::option::Option<i32> {
1111 match self {
1112 Self::Unspecified => std::option::Option::Some(0),
1113 Self::PendingCreateApp => std::option::Option::Some(1),
1114 Self::PendingUserOauth => std::option::Option::Some(2),
1115 Self::PendingInstallApp => std::option::Option::Some(3),
1116 Self::Complete => std::option::Option::Some(10),
1117 Self::UnknownValue(u) => u.0.value(),
1118 }
1119 }
1120
1121 /// Gets the enum value as a string.
1122 ///
1123 /// Returns `None` if the enum contains an unknown value deserialized from
1124 /// the integer representation of enums.
1125 pub fn name(&self) -> std::option::Option<&str> {
1126 match self {
1127 Self::Unspecified => std::option::Option::Some("STAGE_UNSPECIFIED"),
1128 Self::PendingCreateApp => std::option::Option::Some("PENDING_CREATE_APP"),
1129 Self::PendingUserOauth => std::option::Option::Some("PENDING_USER_OAUTH"),
1130 Self::PendingInstallApp => std::option::Option::Some("PENDING_INSTALL_APP"),
1131 Self::Complete => std::option::Option::Some("COMPLETE"),
1132 Self::UnknownValue(u) => u.0.name(),
1133 }
1134 }
1135 }
1136
1137 impl std::default::Default for Stage {
1138 fn default() -> Self {
1139 use std::convert::From;
1140 Self::from(0)
1141 }
1142 }
1143
1144 impl std::fmt::Display for Stage {
1145 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1146 wkt::internal::display_enum(f, self.name(), self.value())
1147 }
1148 }
1149
1150 impl std::convert::From<i32> for Stage {
1151 fn from(value: i32) -> Self {
1152 match value {
1153 0 => Self::Unspecified,
1154 1 => Self::PendingCreateApp,
1155 2 => Self::PendingUserOauth,
1156 3 => Self::PendingInstallApp,
1157 10 => Self::Complete,
1158 _ => Self::UnknownValue(stage::UnknownValue(
1159 wkt::internal::UnknownEnumValue::Integer(value),
1160 )),
1161 }
1162 }
1163 }
1164
1165 impl std::convert::From<&str> for Stage {
1166 fn from(value: &str) -> Self {
1167 use std::string::ToString;
1168 match value {
1169 "STAGE_UNSPECIFIED" => Self::Unspecified,
1170 "PENDING_CREATE_APP" => Self::PendingCreateApp,
1171 "PENDING_USER_OAUTH" => Self::PendingUserOauth,
1172 "PENDING_INSTALL_APP" => Self::PendingInstallApp,
1173 "COMPLETE" => Self::Complete,
1174 _ => Self::UnknownValue(stage::UnknownValue(
1175 wkt::internal::UnknownEnumValue::String(value.to_string()),
1176 )),
1177 }
1178 }
1179 }
1180
1181 impl serde::ser::Serialize for Stage {
1182 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1183 where
1184 S: serde::Serializer,
1185 {
1186 match self {
1187 Self::Unspecified => serializer.serialize_i32(0),
1188 Self::PendingCreateApp => serializer.serialize_i32(1),
1189 Self::PendingUserOauth => serializer.serialize_i32(2),
1190 Self::PendingInstallApp => serializer.serialize_i32(3),
1191 Self::Complete => serializer.serialize_i32(10),
1192 Self::UnknownValue(u) => u.0.serialize(serializer),
1193 }
1194 }
1195 }
1196
1197 impl<'de> serde::de::Deserialize<'de> for Stage {
1198 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1199 where
1200 D: serde::Deserializer<'de>,
1201 {
1202 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Stage>::new(
1203 ".google.cloud.developerconnect.v1.InstallationState.Stage",
1204 ))
1205 }
1206 }
1207}
1208
1209/// Configuration for connections to github.com.
1210#[derive(Clone, Default, PartialEq)]
1211#[non_exhaustive]
1212pub struct GitHubConfig {
1213 /// Required. Immutable. The GitHub Application that was installed to the
1214 /// GitHub user or organization.
1215 pub github_app: crate::model::git_hub_config::GitHubApp,
1216
1217 /// Optional. OAuth credential of the account that authorized the GitHub App.
1218 /// It is recommended to use a robot account instead of a human user account.
1219 /// The OAuth token must be tied to the GitHub App of this config.
1220 pub authorizer_credential: std::option::Option<crate::model::OAuthCredential>,
1221
1222 /// Optional. GitHub App installation id.
1223 pub app_installation_id: i64,
1224
1225 /// Output only. The URI to navigate to in order to manage the installation
1226 /// associated with this GitHubConfig.
1227 pub installation_uri: std::string::String,
1228
1229 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1230}
1231
1232impl GitHubConfig {
1233 pub fn new() -> Self {
1234 std::default::Default::default()
1235 }
1236
1237 /// Sets the value of [github_app][crate::model::GitHubConfig::github_app].
1238 ///
1239 /// # Example
1240 /// ```ignore,no_run
1241 /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1242 /// use google_cloud_developerconnect_v1::model::git_hub_config::GitHubApp;
1243 /// let x0 = GitHubConfig::new().set_github_app(GitHubApp::DeveloperConnect);
1244 /// let x1 = GitHubConfig::new().set_github_app(GitHubApp::Firebase);
1245 /// ```
1246 pub fn set_github_app<T: std::convert::Into<crate::model::git_hub_config::GitHubApp>>(
1247 mut self,
1248 v: T,
1249 ) -> Self {
1250 self.github_app = v.into();
1251 self
1252 }
1253
1254 /// Sets the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
1255 ///
1256 /// # Example
1257 /// ```ignore,no_run
1258 /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1259 /// use google_cloud_developerconnect_v1::model::OAuthCredential;
1260 /// let x = GitHubConfig::new().set_authorizer_credential(OAuthCredential::default()/* use setters */);
1261 /// ```
1262 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1263 where
1264 T: std::convert::Into<crate::model::OAuthCredential>,
1265 {
1266 self.authorizer_credential = std::option::Option::Some(v.into());
1267 self
1268 }
1269
1270 /// Sets or clears the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
1271 ///
1272 /// # Example
1273 /// ```ignore,no_run
1274 /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1275 /// use google_cloud_developerconnect_v1::model::OAuthCredential;
1276 /// let x = GitHubConfig::new().set_or_clear_authorizer_credential(Some(OAuthCredential::default()/* use setters */));
1277 /// let x = GitHubConfig::new().set_or_clear_authorizer_credential(None::<OAuthCredential>);
1278 /// ```
1279 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1280 where
1281 T: std::convert::Into<crate::model::OAuthCredential>,
1282 {
1283 self.authorizer_credential = v.map(|x| x.into());
1284 self
1285 }
1286
1287 /// Sets the value of [app_installation_id][crate::model::GitHubConfig::app_installation_id].
1288 ///
1289 /// # Example
1290 /// ```ignore,no_run
1291 /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1292 /// let x = GitHubConfig::new().set_app_installation_id(42);
1293 /// ```
1294 pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1295 self.app_installation_id = v.into();
1296 self
1297 }
1298
1299 /// Sets the value of [installation_uri][crate::model::GitHubConfig::installation_uri].
1300 ///
1301 /// # Example
1302 /// ```ignore,no_run
1303 /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1304 /// let x = GitHubConfig::new().set_installation_uri("example");
1305 /// ```
1306 pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
1307 mut self,
1308 v: T,
1309 ) -> Self {
1310 self.installation_uri = v.into();
1311 self
1312 }
1313}
1314
1315impl wkt::message::Message for GitHubConfig {
1316 fn typename() -> &'static str {
1317 "type.googleapis.com/google.cloud.developerconnect.v1.GitHubConfig"
1318 }
1319}
1320
1321/// Defines additional types related to [GitHubConfig].
1322pub mod git_hub_config {
1323 #[allow(unused_imports)]
1324 use super::*;
1325
1326 /// Represents the various GitHub Applications that can be installed to a
1327 /// GitHub user or organization and used with Developer Connect.
1328 ///
1329 /// # Working with unknown values
1330 ///
1331 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1332 /// additional enum variants at any time. Adding new variants is not considered
1333 /// a breaking change. Applications should write their code in anticipation of:
1334 ///
1335 /// - New values appearing in future releases of the client library, **and**
1336 /// - New values received dynamically, without application changes.
1337 ///
1338 /// Please consult the [Working with enums] section in the user guide for some
1339 /// guidelines.
1340 ///
1341 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1342 #[derive(Clone, Debug, PartialEq)]
1343 #[non_exhaustive]
1344 pub enum GitHubApp {
1345 /// GitHub App not specified.
1346 Unspecified,
1347 /// The Developer Connect GitHub Application.
1348 DeveloperConnect,
1349 /// The Firebase GitHub Application.
1350 Firebase,
1351 /// If set, the enum was initialized with an unknown value.
1352 ///
1353 /// Applications can examine the value using [GitHubApp::value] or
1354 /// [GitHubApp::name].
1355 UnknownValue(git_hub_app::UnknownValue),
1356 }
1357
1358 #[doc(hidden)]
1359 pub mod git_hub_app {
1360 #[allow(unused_imports)]
1361 use super::*;
1362 #[derive(Clone, Debug, PartialEq)]
1363 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1364 }
1365
1366 impl GitHubApp {
1367 /// Gets the enum value.
1368 ///
1369 /// Returns `None` if the enum contains an unknown value deserialized from
1370 /// the string representation of enums.
1371 pub fn value(&self) -> std::option::Option<i32> {
1372 match self {
1373 Self::Unspecified => std::option::Option::Some(0),
1374 Self::DeveloperConnect => std::option::Option::Some(1),
1375 Self::Firebase => std::option::Option::Some(2),
1376 Self::UnknownValue(u) => u.0.value(),
1377 }
1378 }
1379
1380 /// Gets the enum value as a string.
1381 ///
1382 /// Returns `None` if the enum contains an unknown value deserialized from
1383 /// the integer representation of enums.
1384 pub fn name(&self) -> std::option::Option<&str> {
1385 match self {
1386 Self::Unspecified => std::option::Option::Some("GIT_HUB_APP_UNSPECIFIED"),
1387 Self::DeveloperConnect => std::option::Option::Some("DEVELOPER_CONNECT"),
1388 Self::Firebase => std::option::Option::Some("FIREBASE"),
1389 Self::UnknownValue(u) => u.0.name(),
1390 }
1391 }
1392 }
1393
1394 impl std::default::Default for GitHubApp {
1395 fn default() -> Self {
1396 use std::convert::From;
1397 Self::from(0)
1398 }
1399 }
1400
1401 impl std::fmt::Display for GitHubApp {
1402 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1403 wkt::internal::display_enum(f, self.name(), self.value())
1404 }
1405 }
1406
1407 impl std::convert::From<i32> for GitHubApp {
1408 fn from(value: i32) -> Self {
1409 match value {
1410 0 => Self::Unspecified,
1411 1 => Self::DeveloperConnect,
1412 2 => Self::Firebase,
1413 _ => Self::UnknownValue(git_hub_app::UnknownValue(
1414 wkt::internal::UnknownEnumValue::Integer(value),
1415 )),
1416 }
1417 }
1418 }
1419
1420 impl std::convert::From<&str> for GitHubApp {
1421 fn from(value: &str) -> Self {
1422 use std::string::ToString;
1423 match value {
1424 "GIT_HUB_APP_UNSPECIFIED" => Self::Unspecified,
1425 "DEVELOPER_CONNECT" => Self::DeveloperConnect,
1426 "FIREBASE" => Self::Firebase,
1427 _ => Self::UnknownValue(git_hub_app::UnknownValue(
1428 wkt::internal::UnknownEnumValue::String(value.to_string()),
1429 )),
1430 }
1431 }
1432 }
1433
1434 impl serde::ser::Serialize for GitHubApp {
1435 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1436 where
1437 S: serde::Serializer,
1438 {
1439 match self {
1440 Self::Unspecified => serializer.serialize_i32(0),
1441 Self::DeveloperConnect => serializer.serialize_i32(1),
1442 Self::Firebase => serializer.serialize_i32(2),
1443 Self::UnknownValue(u) => u.0.serialize(serializer),
1444 }
1445 }
1446 }
1447
1448 impl<'de> serde::de::Deserialize<'de> for GitHubApp {
1449 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1450 where
1451 D: serde::Deserializer<'de>,
1452 {
1453 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GitHubApp>::new(
1454 ".google.cloud.developerconnect.v1.GitHubConfig.GitHubApp",
1455 ))
1456 }
1457 }
1458}
1459
1460/// Configuration for connections to an instance of GitHub Enterprise.
1461#[derive(Clone, Default, PartialEq)]
1462#[non_exhaustive]
1463pub struct GitHubEnterpriseConfig {
1464 /// Required. The URI of the GitHub Enterprise host this connection is for.
1465 pub host_uri: std::string::String,
1466
1467 /// Optional. ID of the GitHub App created from the manifest.
1468 pub app_id: i64,
1469
1470 /// Output only. The URL-friendly name of the GitHub App.
1471 pub app_slug: std::string::String,
1472
1473 /// Optional. SecretManager resource containing the private key of the GitHub
1474 /// App, formatted as `projects/*/secrets/*/versions/*`.
1475 pub private_key_secret_version: std::string::String,
1476
1477 /// Optional. SecretManager resource containing the webhook secret of the
1478 /// GitHub App, formatted as `projects/*/secrets/*/versions/*`.
1479 pub webhook_secret_secret_version: std::string::String,
1480
1481 /// Optional. ID of the installation of the GitHub App.
1482 pub app_installation_id: i64,
1483
1484 /// Output only. The URI to navigate to in order to manage the installation
1485 /// associated with this GitHubEnterpriseConfig.
1486 pub installation_uri: std::string::String,
1487
1488 /// Optional. Configuration for using Service Directory to privately connect to
1489 /// a GitHub Enterprise server. This should only be set if the GitHub
1490 /// Enterprise server is hosted on-premises and not reachable by public
1491 /// internet. If this field is left empty, calls to the GitHub Enterprise
1492 /// server will be made over the public internet.
1493 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1494
1495 /// Output only. GitHub Enterprise version installed at the host_uri.
1496 pub server_version: std::string::String,
1497
1498 /// Optional. SSL certificate to use for requests to GitHub Enterprise.
1499 pub ssl_ca_certificate: std::string::String,
1500
1501 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1502}
1503
1504impl GitHubEnterpriseConfig {
1505 pub fn new() -> Self {
1506 std::default::Default::default()
1507 }
1508
1509 /// Sets the value of [host_uri][crate::model::GitHubEnterpriseConfig::host_uri].
1510 ///
1511 /// # Example
1512 /// ```ignore,no_run
1513 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
1514 /// let x = GitHubEnterpriseConfig::new().set_host_uri("example");
1515 /// ```
1516 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1517 self.host_uri = v.into();
1518 self
1519 }
1520
1521 /// Sets the value of [app_id][crate::model::GitHubEnterpriseConfig::app_id].
1522 ///
1523 /// # Example
1524 /// ```ignore,no_run
1525 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
1526 /// let x = GitHubEnterpriseConfig::new().set_app_id(42);
1527 /// ```
1528 pub fn set_app_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1529 self.app_id = v.into();
1530 self
1531 }
1532
1533 /// Sets the value of [app_slug][crate::model::GitHubEnterpriseConfig::app_slug].
1534 ///
1535 /// # Example
1536 /// ```ignore,no_run
1537 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
1538 /// let x = GitHubEnterpriseConfig::new().set_app_slug("example");
1539 /// ```
1540 pub fn set_app_slug<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1541 self.app_slug = v.into();
1542 self
1543 }
1544
1545 /// Sets the value of [private_key_secret_version][crate::model::GitHubEnterpriseConfig::private_key_secret_version].
1546 ///
1547 /// # Example
1548 /// ```ignore,no_run
1549 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
1550 /// let x = GitHubEnterpriseConfig::new().set_private_key_secret_version("example");
1551 /// ```
1552 pub fn set_private_key_secret_version<T: std::convert::Into<std::string::String>>(
1553 mut self,
1554 v: T,
1555 ) -> Self {
1556 self.private_key_secret_version = v.into();
1557 self
1558 }
1559
1560 /// Sets the value of [webhook_secret_secret_version][crate::model::GitHubEnterpriseConfig::webhook_secret_secret_version].
1561 ///
1562 /// # Example
1563 /// ```ignore,no_run
1564 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
1565 /// let x = GitHubEnterpriseConfig::new().set_webhook_secret_secret_version("example");
1566 /// ```
1567 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1568 mut self,
1569 v: T,
1570 ) -> Self {
1571 self.webhook_secret_secret_version = v.into();
1572 self
1573 }
1574
1575 /// Sets the value of [app_installation_id][crate::model::GitHubEnterpriseConfig::app_installation_id].
1576 ///
1577 /// # Example
1578 /// ```ignore,no_run
1579 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
1580 /// let x = GitHubEnterpriseConfig::new().set_app_installation_id(42);
1581 /// ```
1582 pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1583 self.app_installation_id = v.into();
1584 self
1585 }
1586
1587 /// Sets the value of [installation_uri][crate::model::GitHubEnterpriseConfig::installation_uri].
1588 ///
1589 /// # Example
1590 /// ```ignore,no_run
1591 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
1592 /// let x = GitHubEnterpriseConfig::new().set_installation_uri("example");
1593 /// ```
1594 pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
1595 mut self,
1596 v: T,
1597 ) -> Self {
1598 self.installation_uri = v.into();
1599 self
1600 }
1601
1602 /// Sets the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
1603 ///
1604 /// # Example
1605 /// ```ignore,no_run
1606 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
1607 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
1608 /// let x = GitHubEnterpriseConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
1609 /// ```
1610 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
1611 where
1612 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1613 {
1614 self.service_directory_config = std::option::Option::Some(v.into());
1615 self
1616 }
1617
1618 /// Sets or clears the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
1619 ///
1620 /// # Example
1621 /// ```ignore,no_run
1622 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
1623 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
1624 /// let x = GitHubEnterpriseConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
1625 /// let x = GitHubEnterpriseConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
1626 /// ```
1627 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
1628 where
1629 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1630 {
1631 self.service_directory_config = v.map(|x| x.into());
1632 self
1633 }
1634
1635 /// Sets the value of [server_version][crate::model::GitHubEnterpriseConfig::server_version].
1636 ///
1637 /// # Example
1638 /// ```ignore,no_run
1639 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
1640 /// let x = GitHubEnterpriseConfig::new().set_server_version("example");
1641 /// ```
1642 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1643 self.server_version = v.into();
1644 self
1645 }
1646
1647 /// Sets the value of [ssl_ca_certificate][crate::model::GitHubEnterpriseConfig::ssl_ca_certificate].
1648 ///
1649 /// # Example
1650 /// ```ignore,no_run
1651 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
1652 /// let x = GitHubEnterpriseConfig::new().set_ssl_ca_certificate("example");
1653 /// ```
1654 pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
1655 mut self,
1656 v: T,
1657 ) -> Self {
1658 self.ssl_ca_certificate = v.into();
1659 self
1660 }
1661}
1662
1663impl wkt::message::Message for GitHubEnterpriseConfig {
1664 fn typename() -> &'static str {
1665 "type.googleapis.com/google.cloud.developerconnect.v1.GitHubEnterpriseConfig"
1666 }
1667}
1668
1669/// ServiceDirectoryConfig represents Service Directory configuration for a
1670/// connection.
1671#[derive(Clone, Default, PartialEq)]
1672#[non_exhaustive]
1673pub struct ServiceDirectoryConfig {
1674 /// Required. The Service Directory service name.
1675 /// Format:
1676 /// projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
1677 pub service: std::string::String,
1678
1679 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1680}
1681
1682impl ServiceDirectoryConfig {
1683 pub fn new() -> Self {
1684 std::default::Default::default()
1685 }
1686
1687 /// Sets the value of [service][crate::model::ServiceDirectoryConfig::service].
1688 ///
1689 /// # Example
1690 /// ```ignore,no_run
1691 /// # use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
1692 /// let x = ServiceDirectoryConfig::new().set_service("example");
1693 /// ```
1694 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1695 self.service = v.into();
1696 self
1697 }
1698}
1699
1700impl wkt::message::Message for ServiceDirectoryConfig {
1701 fn typename() -> &'static str {
1702 "type.googleapis.com/google.cloud.developerconnect.v1.ServiceDirectoryConfig"
1703 }
1704}
1705
1706/// Represents an OAuth token of the account that authorized the Connection,
1707/// and associated metadata.
1708#[derive(Clone, Default, PartialEq)]
1709#[non_exhaustive]
1710pub struct OAuthCredential {
1711 /// Required. A SecretManager resource containing the OAuth token that
1712 /// authorizes the connection. Format: `projects/*/secrets/*/versions/*`.
1713 pub oauth_token_secret_version: std::string::String,
1714
1715 /// Output only. The username associated with this token.
1716 pub username: std::string::String,
1717
1718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1719}
1720
1721impl OAuthCredential {
1722 pub fn new() -> Self {
1723 std::default::Default::default()
1724 }
1725
1726 /// Sets the value of [oauth_token_secret_version][crate::model::OAuthCredential::oauth_token_secret_version].
1727 ///
1728 /// # Example
1729 /// ```ignore,no_run
1730 /// # use google_cloud_developerconnect_v1::model::OAuthCredential;
1731 /// let x = OAuthCredential::new().set_oauth_token_secret_version("example");
1732 /// ```
1733 pub fn set_oauth_token_secret_version<T: std::convert::Into<std::string::String>>(
1734 mut self,
1735 v: T,
1736 ) -> Self {
1737 self.oauth_token_secret_version = v.into();
1738 self
1739 }
1740
1741 /// Sets the value of [username][crate::model::OAuthCredential::username].
1742 ///
1743 /// # Example
1744 /// ```ignore,no_run
1745 /// # use google_cloud_developerconnect_v1::model::OAuthCredential;
1746 /// let x = OAuthCredential::new().set_username("example");
1747 /// ```
1748 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1749 self.username = v.into();
1750 self
1751 }
1752}
1753
1754impl wkt::message::Message for OAuthCredential {
1755 fn typename() -> &'static str {
1756 "type.googleapis.com/google.cloud.developerconnect.v1.OAuthCredential"
1757 }
1758}
1759
1760/// Configuration for connections to gitlab.com.
1761#[derive(Clone, Default, PartialEq)]
1762#[non_exhaustive]
1763pub struct GitLabConfig {
1764 /// Required. Immutable. SecretManager resource containing the webhook secret
1765 /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This
1766 /// is used to validate webhooks.
1767 pub webhook_secret_secret_version: std::string::String,
1768
1769 /// Required. A GitLab personal access token with the minimum `read_api` scope
1770 /// access and a minimum role of `reporter`. The GitLab Projects visible to
1771 /// this Personal Access Token will control which Projects Developer Connect
1772 /// has access to.
1773 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
1774
1775 /// Required. A GitLab personal access token with the minimum `api` scope
1776 /// access and a minimum role of `maintainer`. The GitLab Projects visible to
1777 /// this Personal Access Token will control which Projects Developer Connect
1778 /// has access to.
1779 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
1780
1781 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1782}
1783
1784impl GitLabConfig {
1785 pub fn new() -> Self {
1786 std::default::Default::default()
1787 }
1788
1789 /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabConfig::webhook_secret_secret_version].
1790 ///
1791 /// # Example
1792 /// ```ignore,no_run
1793 /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
1794 /// let x = GitLabConfig::new().set_webhook_secret_secret_version("example");
1795 /// ```
1796 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1797 mut self,
1798 v: T,
1799 ) -> Self {
1800 self.webhook_secret_secret_version = v.into();
1801 self
1802 }
1803
1804 /// Sets the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
1805 ///
1806 /// # Example
1807 /// ```ignore,no_run
1808 /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
1809 /// use google_cloud_developerconnect_v1::model::UserCredential;
1810 /// let x = GitLabConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
1811 /// ```
1812 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
1813 where
1814 T: std::convert::Into<crate::model::UserCredential>,
1815 {
1816 self.read_authorizer_credential = std::option::Option::Some(v.into());
1817 self
1818 }
1819
1820 /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
1821 ///
1822 /// # Example
1823 /// ```ignore,no_run
1824 /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
1825 /// use google_cloud_developerconnect_v1::model::UserCredential;
1826 /// let x = GitLabConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
1827 /// let x = GitLabConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
1828 /// ```
1829 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1830 where
1831 T: std::convert::Into<crate::model::UserCredential>,
1832 {
1833 self.read_authorizer_credential = v.map(|x| x.into());
1834 self
1835 }
1836
1837 /// Sets the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
1838 ///
1839 /// # Example
1840 /// ```ignore,no_run
1841 /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
1842 /// use google_cloud_developerconnect_v1::model::UserCredential;
1843 /// let x = GitLabConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
1844 /// ```
1845 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1846 where
1847 T: std::convert::Into<crate::model::UserCredential>,
1848 {
1849 self.authorizer_credential = std::option::Option::Some(v.into());
1850 self
1851 }
1852
1853 /// Sets or clears the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
1854 ///
1855 /// # Example
1856 /// ```ignore,no_run
1857 /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
1858 /// use google_cloud_developerconnect_v1::model::UserCredential;
1859 /// let x = GitLabConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
1860 /// let x = GitLabConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
1861 /// ```
1862 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1863 where
1864 T: std::convert::Into<crate::model::UserCredential>,
1865 {
1866 self.authorizer_credential = v.map(|x| x.into());
1867 self
1868 }
1869}
1870
1871impl wkt::message::Message for GitLabConfig {
1872 fn typename() -> &'static str {
1873 "type.googleapis.com/google.cloud.developerconnect.v1.GitLabConfig"
1874 }
1875}
1876
1877/// Represents a personal access token that authorized the Connection,
1878/// and associated metadata.
1879#[derive(Clone, Default, PartialEq)]
1880#[non_exhaustive]
1881pub struct UserCredential {
1882 /// Required. A SecretManager resource containing the user token that
1883 /// authorizes the Developer Connect connection. Format:
1884 /// `projects/*/secrets/*/versions/*`.
1885 pub user_token_secret_version: std::string::String,
1886
1887 /// Output only. The username associated with this token.
1888 pub username: std::string::String,
1889
1890 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1891}
1892
1893impl UserCredential {
1894 pub fn new() -> Self {
1895 std::default::Default::default()
1896 }
1897
1898 /// Sets the value of [user_token_secret_version][crate::model::UserCredential::user_token_secret_version].
1899 ///
1900 /// # Example
1901 /// ```ignore,no_run
1902 /// # use google_cloud_developerconnect_v1::model::UserCredential;
1903 /// let x = UserCredential::new().set_user_token_secret_version("example");
1904 /// ```
1905 pub fn set_user_token_secret_version<T: std::convert::Into<std::string::String>>(
1906 mut self,
1907 v: T,
1908 ) -> Self {
1909 self.user_token_secret_version = v.into();
1910 self
1911 }
1912
1913 /// Sets the value of [username][crate::model::UserCredential::username].
1914 ///
1915 /// # Example
1916 /// ```ignore,no_run
1917 /// # use google_cloud_developerconnect_v1::model::UserCredential;
1918 /// let x = UserCredential::new().set_username("example");
1919 /// ```
1920 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1921 self.username = v.into();
1922 self
1923 }
1924}
1925
1926impl wkt::message::Message for UserCredential {
1927 fn typename() -> &'static str {
1928 "type.googleapis.com/google.cloud.developerconnect.v1.UserCredential"
1929 }
1930}
1931
1932/// Configuration for connections to an instance of GitLab Enterprise.
1933#[derive(Clone, Default, PartialEq)]
1934#[non_exhaustive]
1935pub struct GitLabEnterpriseConfig {
1936 /// Required. The URI of the GitLab Enterprise host this connection is for.
1937 pub host_uri: std::string::String,
1938
1939 /// Required. Immutable. SecretManager resource containing the webhook secret
1940 /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This
1941 /// is used to validate webhooks.
1942 pub webhook_secret_secret_version: std::string::String,
1943
1944 /// Required. A GitLab personal access token with the minimum `read_api` scope
1945 /// access and a minimum role of `reporter`. The GitLab Projects visible to
1946 /// this Personal Access Token will control which Projects Developer Connect
1947 /// has access to.
1948 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
1949
1950 /// Required. A GitLab personal access token with the minimum `api` scope
1951 /// access and a minimum role of `maintainer`. The GitLab Projects visible to
1952 /// this Personal Access Token will control which Projects Developer Connect
1953 /// has access to.
1954 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
1955
1956 /// Optional. Configuration for using Service Directory to privately connect to
1957 /// a GitLab Enterprise instance. This should only be set if the GitLab
1958 /// Enterprise server is hosted on-premises and not reachable by public
1959 /// internet. If this field is left empty, calls to the GitLab Enterprise
1960 /// server will be made over the public internet.
1961 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1962
1963 /// Optional. SSL Certificate Authority certificate to use for requests to
1964 /// GitLab Enterprise instance.
1965 pub ssl_ca_certificate: std::string::String,
1966
1967 /// Output only. Version of the GitLab Enterprise server running on the
1968 /// `host_uri`.
1969 pub server_version: std::string::String,
1970
1971 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1972}
1973
1974impl GitLabEnterpriseConfig {
1975 pub fn new() -> Self {
1976 std::default::Default::default()
1977 }
1978
1979 /// Sets the value of [host_uri][crate::model::GitLabEnterpriseConfig::host_uri].
1980 ///
1981 /// # Example
1982 /// ```ignore,no_run
1983 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
1984 /// let x = GitLabEnterpriseConfig::new().set_host_uri("example");
1985 /// ```
1986 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1987 self.host_uri = v.into();
1988 self
1989 }
1990
1991 /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabEnterpriseConfig::webhook_secret_secret_version].
1992 ///
1993 /// # Example
1994 /// ```ignore,no_run
1995 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
1996 /// let x = GitLabEnterpriseConfig::new().set_webhook_secret_secret_version("example");
1997 /// ```
1998 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
1999 mut self,
2000 v: T,
2001 ) -> Self {
2002 self.webhook_secret_secret_version = v.into();
2003 self
2004 }
2005
2006 /// Sets the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
2007 ///
2008 /// # Example
2009 /// ```ignore,no_run
2010 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2011 /// use google_cloud_developerconnect_v1::model::UserCredential;
2012 /// let x = GitLabEnterpriseConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2013 /// ```
2014 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2015 where
2016 T: std::convert::Into<crate::model::UserCredential>,
2017 {
2018 self.read_authorizer_credential = std::option::Option::Some(v.into());
2019 self
2020 }
2021
2022 /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
2023 ///
2024 /// # Example
2025 /// ```ignore,no_run
2026 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2027 /// use google_cloud_developerconnect_v1::model::UserCredential;
2028 /// let x = GitLabEnterpriseConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2029 /// let x = GitLabEnterpriseConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2030 /// ```
2031 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2032 where
2033 T: std::convert::Into<crate::model::UserCredential>,
2034 {
2035 self.read_authorizer_credential = v.map(|x| x.into());
2036 self
2037 }
2038
2039 /// Sets the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
2040 ///
2041 /// # Example
2042 /// ```ignore,no_run
2043 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2044 /// use google_cloud_developerconnect_v1::model::UserCredential;
2045 /// let x = GitLabEnterpriseConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2046 /// ```
2047 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2048 where
2049 T: std::convert::Into<crate::model::UserCredential>,
2050 {
2051 self.authorizer_credential = std::option::Option::Some(v.into());
2052 self
2053 }
2054
2055 /// Sets or clears the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
2056 ///
2057 /// # Example
2058 /// ```ignore,no_run
2059 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2060 /// use google_cloud_developerconnect_v1::model::UserCredential;
2061 /// let x = GitLabEnterpriseConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2062 /// let x = GitLabEnterpriseConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2063 /// ```
2064 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2065 where
2066 T: std::convert::Into<crate::model::UserCredential>,
2067 {
2068 self.authorizer_credential = v.map(|x| x.into());
2069 self
2070 }
2071
2072 /// Sets the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
2073 ///
2074 /// # Example
2075 /// ```ignore,no_run
2076 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2077 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2078 /// let x = GitLabEnterpriseConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2079 /// ```
2080 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2081 where
2082 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2083 {
2084 self.service_directory_config = std::option::Option::Some(v.into());
2085 self
2086 }
2087
2088 /// Sets or clears the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
2089 ///
2090 /// # Example
2091 /// ```ignore,no_run
2092 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2093 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2094 /// let x = GitLabEnterpriseConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2095 /// let x = GitLabEnterpriseConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2096 /// ```
2097 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2098 where
2099 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2100 {
2101 self.service_directory_config = v.map(|x| x.into());
2102 self
2103 }
2104
2105 /// Sets the value of [ssl_ca_certificate][crate::model::GitLabEnterpriseConfig::ssl_ca_certificate].
2106 ///
2107 /// # Example
2108 /// ```ignore,no_run
2109 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2110 /// let x = GitLabEnterpriseConfig::new().set_ssl_ca_certificate("example");
2111 /// ```
2112 pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2113 mut self,
2114 v: T,
2115 ) -> Self {
2116 self.ssl_ca_certificate = v.into();
2117 self
2118 }
2119
2120 /// Sets the value of [server_version][crate::model::GitLabEnterpriseConfig::server_version].
2121 ///
2122 /// # Example
2123 /// ```ignore,no_run
2124 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2125 /// let x = GitLabEnterpriseConfig::new().set_server_version("example");
2126 /// ```
2127 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2128 self.server_version = v.into();
2129 self
2130 }
2131}
2132
2133impl wkt::message::Message for GitLabEnterpriseConfig {
2134 fn typename() -> &'static str {
2135 "type.googleapis.com/google.cloud.developerconnect.v1.GitLabEnterpriseConfig"
2136 }
2137}
2138
2139/// Configuration for connections to an instance of Bitbucket Data Center.
2140#[derive(Clone, Default, PartialEq)]
2141#[non_exhaustive]
2142pub struct BitbucketDataCenterConfig {
2143 /// Required. The URI of the Bitbucket Data Center host this connection is for.
2144 pub host_uri: std::string::String,
2145
2146 /// Required. Immutable. SecretManager resource containing the webhook secret
2147 /// used to verify webhook events, formatted as
2148 /// `projects/*/secrets/*/versions/*`. This is used to validate webhooks.
2149 pub webhook_secret_secret_version: std::string::String,
2150
2151 /// Required. An http access token with the minimum `Repository read` access.
2152 /// It's recommended to use a system account to generate the credentials.
2153 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2154
2155 /// Required. An http access token with the minimum `Repository admin` scope
2156 /// access. This is needed to create webhooks. It's recommended to use a system
2157 /// account to generate these credentials.
2158 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2159
2160 /// Optional. Configuration for using Service Directory to privately connect to
2161 /// a Bitbucket Data Center instance. This should only be set if the Bitbucket
2162 /// Data Center is hosted on-premises and not reachable by public internet. If
2163 /// this field is left empty, calls to the Bitbucket Data Center will be made
2164 /// over the public internet.
2165 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2166
2167 /// Optional. SSL certificate authority to trust when making requests to
2168 /// Bitbucket Data Center.
2169 pub ssl_ca_certificate: std::string::String,
2170
2171 /// Output only. Version of the Bitbucket Data Center server running on the
2172 /// `host_uri`.
2173 pub server_version: std::string::String,
2174
2175 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2176}
2177
2178impl BitbucketDataCenterConfig {
2179 pub fn new() -> Self {
2180 std::default::Default::default()
2181 }
2182
2183 /// Sets the value of [host_uri][crate::model::BitbucketDataCenterConfig::host_uri].
2184 ///
2185 /// # Example
2186 /// ```ignore,no_run
2187 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2188 /// let x = BitbucketDataCenterConfig::new().set_host_uri("example");
2189 /// ```
2190 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2191 self.host_uri = v.into();
2192 self
2193 }
2194
2195 /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketDataCenterConfig::webhook_secret_secret_version].
2196 ///
2197 /// # Example
2198 /// ```ignore,no_run
2199 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2200 /// let x = BitbucketDataCenterConfig::new().set_webhook_secret_secret_version("example");
2201 /// ```
2202 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2203 mut self,
2204 v: T,
2205 ) -> Self {
2206 self.webhook_secret_secret_version = v.into();
2207 self
2208 }
2209
2210 /// Sets the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
2211 ///
2212 /// # Example
2213 /// ```ignore,no_run
2214 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2215 /// use google_cloud_developerconnect_v1::model::UserCredential;
2216 /// let x = BitbucketDataCenterConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2217 /// ```
2218 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2219 where
2220 T: std::convert::Into<crate::model::UserCredential>,
2221 {
2222 self.read_authorizer_credential = std::option::Option::Some(v.into());
2223 self
2224 }
2225
2226 /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
2227 ///
2228 /// # Example
2229 /// ```ignore,no_run
2230 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2231 /// use google_cloud_developerconnect_v1::model::UserCredential;
2232 /// let x = BitbucketDataCenterConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2233 /// let x = BitbucketDataCenterConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2234 /// ```
2235 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2236 where
2237 T: std::convert::Into<crate::model::UserCredential>,
2238 {
2239 self.read_authorizer_credential = v.map(|x| x.into());
2240 self
2241 }
2242
2243 /// Sets the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
2244 ///
2245 /// # Example
2246 /// ```ignore,no_run
2247 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2248 /// use google_cloud_developerconnect_v1::model::UserCredential;
2249 /// let x = BitbucketDataCenterConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2250 /// ```
2251 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2252 where
2253 T: std::convert::Into<crate::model::UserCredential>,
2254 {
2255 self.authorizer_credential = std::option::Option::Some(v.into());
2256 self
2257 }
2258
2259 /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
2260 ///
2261 /// # Example
2262 /// ```ignore,no_run
2263 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2264 /// use google_cloud_developerconnect_v1::model::UserCredential;
2265 /// let x = BitbucketDataCenterConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2266 /// let x = BitbucketDataCenterConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2267 /// ```
2268 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2269 where
2270 T: std::convert::Into<crate::model::UserCredential>,
2271 {
2272 self.authorizer_credential = v.map(|x| x.into());
2273 self
2274 }
2275
2276 /// Sets the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
2277 ///
2278 /// # Example
2279 /// ```ignore,no_run
2280 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2281 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2282 /// let x = BitbucketDataCenterConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2283 /// ```
2284 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2285 where
2286 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2287 {
2288 self.service_directory_config = std::option::Option::Some(v.into());
2289 self
2290 }
2291
2292 /// Sets or clears the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
2293 ///
2294 /// # Example
2295 /// ```ignore,no_run
2296 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2297 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2298 /// let x = BitbucketDataCenterConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2299 /// let x = BitbucketDataCenterConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2300 /// ```
2301 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2302 where
2303 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2304 {
2305 self.service_directory_config = v.map(|x| x.into());
2306 self
2307 }
2308
2309 /// Sets the value of [ssl_ca_certificate][crate::model::BitbucketDataCenterConfig::ssl_ca_certificate].
2310 ///
2311 /// # Example
2312 /// ```ignore,no_run
2313 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2314 /// let x = BitbucketDataCenterConfig::new().set_ssl_ca_certificate("example");
2315 /// ```
2316 pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2317 mut self,
2318 v: T,
2319 ) -> Self {
2320 self.ssl_ca_certificate = v.into();
2321 self
2322 }
2323
2324 /// Sets the value of [server_version][crate::model::BitbucketDataCenterConfig::server_version].
2325 ///
2326 /// # Example
2327 /// ```ignore,no_run
2328 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2329 /// let x = BitbucketDataCenterConfig::new().set_server_version("example");
2330 /// ```
2331 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2332 self.server_version = v.into();
2333 self
2334 }
2335}
2336
2337impl wkt::message::Message for BitbucketDataCenterConfig {
2338 fn typename() -> &'static str {
2339 "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketDataCenterConfig"
2340 }
2341}
2342
2343/// Configuration for connections to an instance of Bitbucket Cloud.
2344#[derive(Clone, Default, PartialEq)]
2345#[non_exhaustive]
2346pub struct BitbucketCloudConfig {
2347 /// Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud
2348 /// Platform.
2349 pub workspace: std::string::String,
2350
2351 /// Required. Immutable. SecretManager resource containing the webhook secret
2352 /// used to verify webhook events, formatted as
2353 /// `projects/*/secrets/*/versions/*`. This is used to validate and create
2354 /// webhooks.
2355 pub webhook_secret_secret_version: std::string::String,
2356
2357 /// Required. An access token with the minimum `repository` access.
2358 /// It can either be a workspace, project or repository access token.
2359 /// It's recommended to use a system account to generate the credentials.
2360 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2361
2362 /// Required. An access token with the minimum `repository`, `pullrequest` and
2363 /// `webhook` scope access. It can either be a workspace, project or repository
2364 /// access token. This is needed to create webhooks. It's recommended to use a
2365 /// system account to generate these credentials.
2366 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2367
2368 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2369}
2370
2371impl BitbucketCloudConfig {
2372 pub fn new() -> Self {
2373 std::default::Default::default()
2374 }
2375
2376 /// Sets the value of [workspace][crate::model::BitbucketCloudConfig::workspace].
2377 ///
2378 /// # Example
2379 /// ```ignore,no_run
2380 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
2381 /// let x = BitbucketCloudConfig::new().set_workspace("example");
2382 /// ```
2383 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2384 self.workspace = v.into();
2385 self
2386 }
2387
2388 /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketCloudConfig::webhook_secret_secret_version].
2389 ///
2390 /// # Example
2391 /// ```ignore,no_run
2392 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
2393 /// let x = BitbucketCloudConfig::new().set_webhook_secret_secret_version("example");
2394 /// ```
2395 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2396 mut self,
2397 v: T,
2398 ) -> Self {
2399 self.webhook_secret_secret_version = v.into();
2400 self
2401 }
2402
2403 /// Sets the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
2404 ///
2405 /// # Example
2406 /// ```ignore,no_run
2407 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
2408 /// use google_cloud_developerconnect_v1::model::UserCredential;
2409 /// let x = BitbucketCloudConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2410 /// ```
2411 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2412 where
2413 T: std::convert::Into<crate::model::UserCredential>,
2414 {
2415 self.read_authorizer_credential = std::option::Option::Some(v.into());
2416 self
2417 }
2418
2419 /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
2420 ///
2421 /// # Example
2422 /// ```ignore,no_run
2423 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
2424 /// use google_cloud_developerconnect_v1::model::UserCredential;
2425 /// let x = BitbucketCloudConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2426 /// let x = BitbucketCloudConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2427 /// ```
2428 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2429 where
2430 T: std::convert::Into<crate::model::UserCredential>,
2431 {
2432 self.read_authorizer_credential = v.map(|x| x.into());
2433 self
2434 }
2435
2436 /// Sets the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
2437 ///
2438 /// # Example
2439 /// ```ignore,no_run
2440 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
2441 /// use google_cloud_developerconnect_v1::model::UserCredential;
2442 /// let x = BitbucketCloudConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2443 /// ```
2444 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2445 where
2446 T: std::convert::Into<crate::model::UserCredential>,
2447 {
2448 self.authorizer_credential = std::option::Option::Some(v.into());
2449 self
2450 }
2451
2452 /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
2453 ///
2454 /// # Example
2455 /// ```ignore,no_run
2456 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
2457 /// use google_cloud_developerconnect_v1::model::UserCredential;
2458 /// let x = BitbucketCloudConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2459 /// let x = BitbucketCloudConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2460 /// ```
2461 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2462 where
2463 T: std::convert::Into<crate::model::UserCredential>,
2464 {
2465 self.authorizer_credential = v.map(|x| x.into());
2466 self
2467 }
2468}
2469
2470impl wkt::message::Message for BitbucketCloudConfig {
2471 fn typename() -> &'static str {
2472 "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketCloudConfig"
2473 }
2474}
2475
2476/// Message for requesting list of Connections
2477#[derive(Clone, Default, PartialEq)]
2478#[non_exhaustive]
2479pub struct ListConnectionsRequest {
2480 /// Required. Parent value for ListConnectionsRequest
2481 pub parent: std::string::String,
2482
2483 /// Optional. Requested page size. Server may return fewer items than
2484 /// requested. If unspecified, server will pick an appropriate default.
2485 pub page_size: i32,
2486
2487 /// Optional. A token identifying a page of results the server should return.
2488 pub page_token: std::string::String,
2489
2490 /// Optional. Filtering results
2491 pub filter: std::string::String,
2492
2493 /// Optional. Hint for how to order the results
2494 pub order_by: std::string::String,
2495
2496 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2497}
2498
2499impl ListConnectionsRequest {
2500 pub fn new() -> Self {
2501 std::default::Default::default()
2502 }
2503
2504 /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
2505 ///
2506 /// # Example
2507 /// ```ignore,no_run
2508 /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
2509 /// let x = ListConnectionsRequest::new().set_parent("example");
2510 /// ```
2511 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2512 self.parent = v.into();
2513 self
2514 }
2515
2516 /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
2517 ///
2518 /// # Example
2519 /// ```ignore,no_run
2520 /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
2521 /// let x = ListConnectionsRequest::new().set_page_size(42);
2522 /// ```
2523 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2524 self.page_size = v.into();
2525 self
2526 }
2527
2528 /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
2529 ///
2530 /// # Example
2531 /// ```ignore,no_run
2532 /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
2533 /// let x = ListConnectionsRequest::new().set_page_token("example");
2534 /// ```
2535 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2536 self.page_token = v.into();
2537 self
2538 }
2539
2540 /// Sets the value of [filter][crate::model::ListConnectionsRequest::filter].
2541 ///
2542 /// # Example
2543 /// ```ignore,no_run
2544 /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
2545 /// let x = ListConnectionsRequest::new().set_filter("example");
2546 /// ```
2547 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2548 self.filter = v.into();
2549 self
2550 }
2551
2552 /// Sets the value of [order_by][crate::model::ListConnectionsRequest::order_by].
2553 ///
2554 /// # Example
2555 /// ```ignore,no_run
2556 /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
2557 /// let x = ListConnectionsRequest::new().set_order_by("example");
2558 /// ```
2559 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2560 self.order_by = v.into();
2561 self
2562 }
2563}
2564
2565impl wkt::message::Message for ListConnectionsRequest {
2566 fn typename() -> &'static str {
2567 "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsRequest"
2568 }
2569}
2570
2571/// Message for response to listing Connections
2572#[derive(Clone, Default, PartialEq)]
2573#[non_exhaustive]
2574pub struct ListConnectionsResponse {
2575 /// The list of Connection
2576 pub connections: std::vec::Vec<crate::model::Connection>,
2577
2578 /// A token identifying a page of results the server should return.
2579 pub next_page_token: std::string::String,
2580
2581 /// Locations that could not be reached.
2582 pub unreachable: std::vec::Vec<std::string::String>,
2583
2584 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2585}
2586
2587impl ListConnectionsResponse {
2588 pub fn new() -> Self {
2589 std::default::Default::default()
2590 }
2591
2592 /// Sets the value of [connections][crate::model::ListConnectionsResponse::connections].
2593 ///
2594 /// # Example
2595 /// ```ignore,no_run
2596 /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
2597 /// use google_cloud_developerconnect_v1::model::Connection;
2598 /// let x = ListConnectionsResponse::new()
2599 /// .set_connections([
2600 /// Connection::default()/* use setters */,
2601 /// Connection::default()/* use (different) setters */,
2602 /// ]);
2603 /// ```
2604 pub fn set_connections<T, V>(mut self, v: T) -> Self
2605 where
2606 T: std::iter::IntoIterator<Item = V>,
2607 V: std::convert::Into<crate::model::Connection>,
2608 {
2609 use std::iter::Iterator;
2610 self.connections = v.into_iter().map(|i| i.into()).collect();
2611 self
2612 }
2613
2614 /// Sets the value of [next_page_token][crate::model::ListConnectionsResponse::next_page_token].
2615 ///
2616 /// # Example
2617 /// ```ignore,no_run
2618 /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
2619 /// let x = ListConnectionsResponse::new().set_next_page_token("example");
2620 /// ```
2621 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2622 self.next_page_token = v.into();
2623 self
2624 }
2625
2626 /// Sets the value of [unreachable][crate::model::ListConnectionsResponse::unreachable].
2627 ///
2628 /// # Example
2629 /// ```ignore,no_run
2630 /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
2631 /// let x = ListConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
2632 /// ```
2633 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2634 where
2635 T: std::iter::IntoIterator<Item = V>,
2636 V: std::convert::Into<std::string::String>,
2637 {
2638 use std::iter::Iterator;
2639 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2640 self
2641 }
2642}
2643
2644impl wkt::message::Message for ListConnectionsResponse {
2645 fn typename() -> &'static str {
2646 "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsResponse"
2647 }
2648}
2649
2650#[doc(hidden)]
2651impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionsResponse {
2652 type PageItem = crate::model::Connection;
2653
2654 fn items(self) -> std::vec::Vec<Self::PageItem> {
2655 self.connections
2656 }
2657
2658 fn next_page_token(&self) -> std::string::String {
2659 use std::clone::Clone;
2660 self.next_page_token.clone()
2661 }
2662}
2663
2664/// Message for getting a Connection
2665#[derive(Clone, Default, PartialEq)]
2666#[non_exhaustive]
2667pub struct GetConnectionRequest {
2668 /// Required. Name of the resource
2669 pub name: std::string::String,
2670
2671 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2672}
2673
2674impl GetConnectionRequest {
2675 pub fn new() -> Self {
2676 std::default::Default::default()
2677 }
2678
2679 /// Sets the value of [name][crate::model::GetConnectionRequest::name].
2680 ///
2681 /// # Example
2682 /// ```ignore,no_run
2683 /// # use google_cloud_developerconnect_v1::model::GetConnectionRequest;
2684 /// let x = GetConnectionRequest::new().set_name("example");
2685 /// ```
2686 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2687 self.name = v.into();
2688 self
2689 }
2690}
2691
2692impl wkt::message::Message for GetConnectionRequest {
2693 fn typename() -> &'static str {
2694 "type.googleapis.com/google.cloud.developerconnect.v1.GetConnectionRequest"
2695 }
2696}
2697
2698/// Message for creating a Connection
2699#[derive(Clone, Default, PartialEq)]
2700#[non_exhaustive]
2701pub struct CreateConnectionRequest {
2702 /// Required. Value for parent.
2703 pub parent: std::string::String,
2704
2705 /// Required. Id of the requesting object
2706 /// If auto-generating Id server-side, remove this field and
2707 /// connection_id from the method_signature of Create RPC
2708 pub connection_id: std::string::String,
2709
2710 /// Required. The resource being created
2711 pub connection: std::option::Option<crate::model::Connection>,
2712
2713 /// Optional. An optional request ID to identify requests. Specify a unique
2714 /// request ID so that if you must retry your request, the server will know to
2715 /// ignore the request if it has already been completed. The server will
2716 /// guarantee that for at least 60 minutes since the first request.
2717 ///
2718 /// For example, consider a situation where you make an initial request and the
2719 /// request times out. If you make the request again with the same request
2720 /// ID, the server can check if original operation with the same request ID
2721 /// was received, and if so, will ignore the second request. This prevents
2722 /// clients from accidentally creating duplicate commitments.
2723 ///
2724 /// The request ID must be a valid UUID with the exception that zero UUID is
2725 /// not supported (00000000-0000-0000-0000-000000000000).
2726 pub request_id: std::string::String,
2727
2728 /// Optional. If set, validate the request, but do not actually post it.
2729 pub validate_only: bool,
2730
2731 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2732}
2733
2734impl CreateConnectionRequest {
2735 pub fn new() -> Self {
2736 std::default::Default::default()
2737 }
2738
2739 /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
2740 ///
2741 /// # Example
2742 /// ```ignore,no_run
2743 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
2744 /// let x = CreateConnectionRequest::new().set_parent("example");
2745 /// ```
2746 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2747 self.parent = v.into();
2748 self
2749 }
2750
2751 /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
2752 ///
2753 /// # Example
2754 /// ```ignore,no_run
2755 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
2756 /// let x = CreateConnectionRequest::new().set_connection_id("example");
2757 /// ```
2758 pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2759 self.connection_id = v.into();
2760 self
2761 }
2762
2763 /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
2764 ///
2765 /// # Example
2766 /// ```ignore,no_run
2767 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
2768 /// use google_cloud_developerconnect_v1::model::Connection;
2769 /// let x = CreateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
2770 /// ```
2771 pub fn set_connection<T>(mut self, v: T) -> Self
2772 where
2773 T: std::convert::Into<crate::model::Connection>,
2774 {
2775 self.connection = std::option::Option::Some(v.into());
2776 self
2777 }
2778
2779 /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
2780 ///
2781 /// # Example
2782 /// ```ignore,no_run
2783 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
2784 /// use google_cloud_developerconnect_v1::model::Connection;
2785 /// let x = CreateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
2786 /// let x = CreateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
2787 /// ```
2788 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
2789 where
2790 T: std::convert::Into<crate::model::Connection>,
2791 {
2792 self.connection = v.map(|x| x.into());
2793 self
2794 }
2795
2796 /// Sets the value of [request_id][crate::model::CreateConnectionRequest::request_id].
2797 ///
2798 /// # Example
2799 /// ```ignore,no_run
2800 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
2801 /// let x = CreateConnectionRequest::new().set_request_id("example");
2802 /// ```
2803 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2804 self.request_id = v.into();
2805 self
2806 }
2807
2808 /// Sets the value of [validate_only][crate::model::CreateConnectionRequest::validate_only].
2809 ///
2810 /// # Example
2811 /// ```ignore,no_run
2812 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
2813 /// let x = CreateConnectionRequest::new().set_validate_only(true);
2814 /// ```
2815 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2816 self.validate_only = v.into();
2817 self
2818 }
2819}
2820
2821impl wkt::message::Message for CreateConnectionRequest {
2822 fn typename() -> &'static str {
2823 "type.googleapis.com/google.cloud.developerconnect.v1.CreateConnectionRequest"
2824 }
2825}
2826
2827/// Message for updating a Connection
2828#[derive(Clone, Default, PartialEq)]
2829#[non_exhaustive]
2830pub struct UpdateConnectionRequest {
2831 /// Required. Field mask is used to specify the fields to be overwritten in the
2832 /// Connection resource by the update.
2833 /// The fields specified in the update_mask are relative to the resource, not
2834 /// the full request. A field will be overwritten if it is in the mask. If the
2835 /// user does not provide a mask then all fields will be overwritten.
2836 pub update_mask: std::option::Option<wkt::FieldMask>,
2837
2838 /// Required. The resource being updated
2839 pub connection: std::option::Option<crate::model::Connection>,
2840
2841 /// Optional. An optional request ID to identify requests. Specify a unique
2842 /// request ID so that if you must retry your request, the server will know to
2843 /// ignore the request if it has already been completed. The server will
2844 /// guarantee that for at least 60 minutes since the first request.
2845 ///
2846 /// For example, consider a situation where you make an initial request and the
2847 /// request times out. If you make the request again with the same request
2848 /// ID, the server can check if original operation with the same request ID
2849 /// was received, and if so, will ignore the second request. This prevents
2850 /// clients from accidentally creating duplicate commitments.
2851 ///
2852 /// The request ID must be a valid UUID with the exception that zero UUID is
2853 /// not supported (00000000-0000-0000-0000-000000000000).
2854 pub request_id: std::string::String,
2855
2856 /// Optional. If set to true, and the connection is not found a new connection
2857 /// will be created. In this situation `update_mask` is ignored.
2858 /// The creation will succeed only if the input connection has all the
2859 /// necessary information (e.g a github_config with both user_oauth_token and
2860 /// installation_id properties).
2861 pub allow_missing: bool,
2862
2863 /// Optional. If set, validate the request, but do not actually post it.
2864 pub validate_only: bool,
2865
2866 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2867}
2868
2869impl UpdateConnectionRequest {
2870 pub fn new() -> Self {
2871 std::default::Default::default()
2872 }
2873
2874 /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
2875 ///
2876 /// # Example
2877 /// ```ignore,no_run
2878 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
2879 /// use wkt::FieldMask;
2880 /// let x = UpdateConnectionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2881 /// ```
2882 pub fn set_update_mask<T>(mut self, v: T) -> Self
2883 where
2884 T: std::convert::Into<wkt::FieldMask>,
2885 {
2886 self.update_mask = std::option::Option::Some(v.into());
2887 self
2888 }
2889
2890 /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
2891 ///
2892 /// # Example
2893 /// ```ignore,no_run
2894 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
2895 /// use wkt::FieldMask;
2896 /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2897 /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2898 /// ```
2899 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2900 where
2901 T: std::convert::Into<wkt::FieldMask>,
2902 {
2903 self.update_mask = v.map(|x| x.into());
2904 self
2905 }
2906
2907 /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
2908 ///
2909 /// # Example
2910 /// ```ignore,no_run
2911 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
2912 /// use google_cloud_developerconnect_v1::model::Connection;
2913 /// let x = UpdateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
2914 /// ```
2915 pub fn set_connection<T>(mut self, v: T) -> Self
2916 where
2917 T: std::convert::Into<crate::model::Connection>,
2918 {
2919 self.connection = std::option::Option::Some(v.into());
2920 self
2921 }
2922
2923 /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
2924 ///
2925 /// # Example
2926 /// ```ignore,no_run
2927 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
2928 /// use google_cloud_developerconnect_v1::model::Connection;
2929 /// let x = UpdateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
2930 /// let x = UpdateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
2931 /// ```
2932 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
2933 where
2934 T: std::convert::Into<crate::model::Connection>,
2935 {
2936 self.connection = v.map(|x| x.into());
2937 self
2938 }
2939
2940 /// Sets the value of [request_id][crate::model::UpdateConnectionRequest::request_id].
2941 ///
2942 /// # Example
2943 /// ```ignore,no_run
2944 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
2945 /// let x = UpdateConnectionRequest::new().set_request_id("example");
2946 /// ```
2947 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2948 self.request_id = v.into();
2949 self
2950 }
2951
2952 /// Sets the value of [allow_missing][crate::model::UpdateConnectionRequest::allow_missing].
2953 ///
2954 /// # Example
2955 /// ```ignore,no_run
2956 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
2957 /// let x = UpdateConnectionRequest::new().set_allow_missing(true);
2958 /// ```
2959 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2960 self.allow_missing = v.into();
2961 self
2962 }
2963
2964 /// Sets the value of [validate_only][crate::model::UpdateConnectionRequest::validate_only].
2965 ///
2966 /// # Example
2967 /// ```ignore,no_run
2968 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
2969 /// let x = UpdateConnectionRequest::new().set_validate_only(true);
2970 /// ```
2971 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2972 self.validate_only = v.into();
2973 self
2974 }
2975}
2976
2977impl wkt::message::Message for UpdateConnectionRequest {
2978 fn typename() -> &'static str {
2979 "type.googleapis.com/google.cloud.developerconnect.v1.UpdateConnectionRequest"
2980 }
2981}
2982
2983/// Message for deleting a Connection
2984#[derive(Clone, Default, PartialEq)]
2985#[non_exhaustive]
2986pub struct DeleteConnectionRequest {
2987 /// Required. Name of the resource
2988 pub name: std::string::String,
2989
2990 /// Optional. An optional request ID to identify requests. Specify a unique
2991 /// request ID so that if you must retry your request, the server will know to
2992 /// ignore the request if it has already been completed. The server will
2993 /// guarantee that for at least 60 minutes after the first request.
2994 ///
2995 /// For example, consider a situation where you make an initial request and the
2996 /// request times out. If you make the request again with the same request
2997 /// ID, the server can check if original operation with the same request ID
2998 /// was received, and if so, will ignore the second request. This prevents
2999 /// clients from accidentally creating duplicate commitments.
3000 ///
3001 /// The request ID must be a valid UUID with the exception that zero UUID is
3002 /// not supported (00000000-0000-0000-0000-000000000000).
3003 pub request_id: std::string::String,
3004
3005 /// Optional. If set, validate the request, but do not actually post it.
3006 pub validate_only: bool,
3007
3008 /// Optional. The current etag of the Connection.
3009 /// If an etag is provided and does not match the current etag of the
3010 /// Connection, deletion will be blocked and an ABORTED error will be returned.
3011 pub etag: std::string::String,
3012
3013 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3014}
3015
3016impl DeleteConnectionRequest {
3017 pub fn new() -> Self {
3018 std::default::Default::default()
3019 }
3020
3021 /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
3022 ///
3023 /// # Example
3024 /// ```ignore,no_run
3025 /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3026 /// let x = DeleteConnectionRequest::new().set_name("example");
3027 /// ```
3028 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3029 self.name = v.into();
3030 self
3031 }
3032
3033 /// Sets the value of [request_id][crate::model::DeleteConnectionRequest::request_id].
3034 ///
3035 /// # Example
3036 /// ```ignore,no_run
3037 /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3038 /// let x = DeleteConnectionRequest::new().set_request_id("example");
3039 /// ```
3040 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3041 self.request_id = v.into();
3042 self
3043 }
3044
3045 /// Sets the value of [validate_only][crate::model::DeleteConnectionRequest::validate_only].
3046 ///
3047 /// # Example
3048 /// ```ignore,no_run
3049 /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3050 /// let x = DeleteConnectionRequest::new().set_validate_only(true);
3051 /// ```
3052 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3053 self.validate_only = v.into();
3054 self
3055 }
3056
3057 /// Sets the value of [etag][crate::model::DeleteConnectionRequest::etag].
3058 ///
3059 /// # Example
3060 /// ```ignore,no_run
3061 /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3062 /// let x = DeleteConnectionRequest::new().set_etag("example");
3063 /// ```
3064 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3065 self.etag = v.into();
3066 self
3067 }
3068}
3069
3070impl wkt::message::Message for DeleteConnectionRequest {
3071 fn typename() -> &'static str {
3072 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteConnectionRequest"
3073 }
3074}
3075
3076/// Message for requesting list of AccountConnectors
3077#[derive(Clone, Default, PartialEq)]
3078#[non_exhaustive]
3079pub struct ListAccountConnectorsRequest {
3080 /// Required. Parent value for ListAccountConnectorsRequest
3081 pub parent: std::string::String,
3082
3083 /// Optional. Requested page size. Server may return fewer items than
3084 /// requested. If unspecified, server will pick an appropriate default.
3085 pub page_size: i32,
3086
3087 /// Optional. A token identifying a page of results the server should return.
3088 pub page_token: std::string::String,
3089
3090 /// Optional. Filtering results
3091 pub filter: std::string::String,
3092
3093 /// Optional. Hint for how to order the results
3094 pub order_by: std::string::String,
3095
3096 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3097}
3098
3099impl ListAccountConnectorsRequest {
3100 pub fn new() -> Self {
3101 std::default::Default::default()
3102 }
3103
3104 /// Sets the value of [parent][crate::model::ListAccountConnectorsRequest::parent].
3105 ///
3106 /// # Example
3107 /// ```ignore,no_run
3108 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3109 /// let x = ListAccountConnectorsRequest::new().set_parent("example");
3110 /// ```
3111 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3112 self.parent = v.into();
3113 self
3114 }
3115
3116 /// Sets the value of [page_size][crate::model::ListAccountConnectorsRequest::page_size].
3117 ///
3118 /// # Example
3119 /// ```ignore,no_run
3120 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3121 /// let x = ListAccountConnectorsRequest::new().set_page_size(42);
3122 /// ```
3123 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3124 self.page_size = v.into();
3125 self
3126 }
3127
3128 /// Sets the value of [page_token][crate::model::ListAccountConnectorsRequest::page_token].
3129 ///
3130 /// # Example
3131 /// ```ignore,no_run
3132 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3133 /// let x = ListAccountConnectorsRequest::new().set_page_token("example");
3134 /// ```
3135 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3136 self.page_token = v.into();
3137 self
3138 }
3139
3140 /// Sets the value of [filter][crate::model::ListAccountConnectorsRequest::filter].
3141 ///
3142 /// # Example
3143 /// ```ignore,no_run
3144 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3145 /// let x = ListAccountConnectorsRequest::new().set_filter("example");
3146 /// ```
3147 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3148 self.filter = v.into();
3149 self
3150 }
3151
3152 /// Sets the value of [order_by][crate::model::ListAccountConnectorsRequest::order_by].
3153 ///
3154 /// # Example
3155 /// ```ignore,no_run
3156 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3157 /// let x = ListAccountConnectorsRequest::new().set_order_by("example");
3158 /// ```
3159 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3160 self.order_by = v.into();
3161 self
3162 }
3163}
3164
3165impl wkt::message::Message for ListAccountConnectorsRequest {
3166 fn typename() -> &'static str {
3167 "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsRequest"
3168 }
3169}
3170
3171/// Message for response to listing AccountConnectors
3172#[derive(Clone, Default, PartialEq)]
3173#[non_exhaustive]
3174pub struct ListAccountConnectorsResponse {
3175 /// The list of AccountConnectors
3176 pub account_connectors: std::vec::Vec<crate::model::AccountConnector>,
3177
3178 /// A token identifying a page of results the server should return.
3179 pub next_page_token: std::string::String,
3180
3181 /// Locations that could not be reached.
3182 pub unreachable: std::vec::Vec<std::string::String>,
3183
3184 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3185}
3186
3187impl ListAccountConnectorsResponse {
3188 pub fn new() -> Self {
3189 std::default::Default::default()
3190 }
3191
3192 /// Sets the value of [account_connectors][crate::model::ListAccountConnectorsResponse::account_connectors].
3193 ///
3194 /// # Example
3195 /// ```ignore,no_run
3196 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3197 /// use google_cloud_developerconnect_v1::model::AccountConnector;
3198 /// let x = ListAccountConnectorsResponse::new()
3199 /// .set_account_connectors([
3200 /// AccountConnector::default()/* use setters */,
3201 /// AccountConnector::default()/* use (different) setters */,
3202 /// ]);
3203 /// ```
3204 pub fn set_account_connectors<T, V>(mut self, v: T) -> Self
3205 where
3206 T: std::iter::IntoIterator<Item = V>,
3207 V: std::convert::Into<crate::model::AccountConnector>,
3208 {
3209 use std::iter::Iterator;
3210 self.account_connectors = v.into_iter().map(|i| i.into()).collect();
3211 self
3212 }
3213
3214 /// Sets the value of [next_page_token][crate::model::ListAccountConnectorsResponse::next_page_token].
3215 ///
3216 /// # Example
3217 /// ```ignore,no_run
3218 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3219 /// let x = ListAccountConnectorsResponse::new().set_next_page_token("example");
3220 /// ```
3221 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3222 self.next_page_token = v.into();
3223 self
3224 }
3225
3226 /// Sets the value of [unreachable][crate::model::ListAccountConnectorsResponse::unreachable].
3227 ///
3228 /// # Example
3229 /// ```ignore,no_run
3230 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3231 /// let x = ListAccountConnectorsResponse::new().set_unreachable(["a", "b", "c"]);
3232 /// ```
3233 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3234 where
3235 T: std::iter::IntoIterator<Item = V>,
3236 V: std::convert::Into<std::string::String>,
3237 {
3238 use std::iter::Iterator;
3239 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3240 self
3241 }
3242}
3243
3244impl wkt::message::Message for ListAccountConnectorsResponse {
3245 fn typename() -> &'static str {
3246 "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsResponse"
3247 }
3248}
3249
3250#[doc(hidden)]
3251impl google_cloud_gax::paginator::internal::PageableResponse for ListAccountConnectorsResponse {
3252 type PageItem = crate::model::AccountConnector;
3253
3254 fn items(self) -> std::vec::Vec<Self::PageItem> {
3255 self.account_connectors
3256 }
3257
3258 fn next_page_token(&self) -> std::string::String {
3259 use std::clone::Clone;
3260 self.next_page_token.clone()
3261 }
3262}
3263
3264/// Message for getting a AccountConnector
3265#[derive(Clone, Default, PartialEq)]
3266#[non_exhaustive]
3267pub struct GetAccountConnectorRequest {
3268 /// Required. Name of the resource
3269 pub name: std::string::String,
3270
3271 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3272}
3273
3274impl GetAccountConnectorRequest {
3275 pub fn new() -> Self {
3276 std::default::Default::default()
3277 }
3278
3279 /// Sets the value of [name][crate::model::GetAccountConnectorRequest::name].
3280 ///
3281 /// # Example
3282 /// ```ignore,no_run
3283 /// # use google_cloud_developerconnect_v1::model::GetAccountConnectorRequest;
3284 /// let x = GetAccountConnectorRequest::new().set_name("example");
3285 /// ```
3286 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3287 self.name = v.into();
3288 self
3289 }
3290}
3291
3292impl wkt::message::Message for GetAccountConnectorRequest {
3293 fn typename() -> &'static str {
3294 "type.googleapis.com/google.cloud.developerconnect.v1.GetAccountConnectorRequest"
3295 }
3296}
3297
3298#[derive(Clone, Default, PartialEq)]
3299#[non_exhaustive]
3300pub struct CreateAccountConnectorRequest {
3301 /// Required. Location resource name as the account_connector’s parent.
3302 pub parent: std::string::String,
3303
3304 /// Required. The ID to use for the AccountConnector, which will become the
3305 /// final component of the AccountConnector's resource name. Its format should
3306 /// adhere to <https://google.aip.dev/122#resource-id-segments> Names must be
3307 /// unique per-project per-location.
3308 pub account_connector_id: std::string::String,
3309
3310 /// Required. The AccountConnector to create.
3311 pub account_connector: std::option::Option<crate::model::AccountConnector>,
3312
3313 /// Optional. An optional request ID to identify requests. Specify a unique
3314 /// request ID so that if you must retry your request, the server will know to
3315 /// ignore the request if it has already been completed. The server will
3316 /// guarantee that for at least 60 minutes since the first request.
3317 ///
3318 /// For example, consider a situation where you make an initial request and the
3319 /// request times out. If you make the request again with the same request
3320 /// ID, the server can check if original operation with the same request ID
3321 /// was received, and if so, will ignore the second request. This prevents
3322 /// clients from accidentally creating duplicate commitments.
3323 ///
3324 /// The request ID must be a valid UUID with the exception that zero UUID is
3325 /// not supported (00000000-0000-0000-0000-000000000000).
3326 pub request_id: std::string::String,
3327
3328 /// Optional. If set, validate the request, but do not actually post it.
3329 pub validate_only: bool,
3330
3331 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3332}
3333
3334impl CreateAccountConnectorRequest {
3335 pub fn new() -> Self {
3336 std::default::Default::default()
3337 }
3338
3339 /// Sets the value of [parent][crate::model::CreateAccountConnectorRequest::parent].
3340 ///
3341 /// # Example
3342 /// ```ignore,no_run
3343 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
3344 /// let x = CreateAccountConnectorRequest::new().set_parent("example");
3345 /// ```
3346 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3347 self.parent = v.into();
3348 self
3349 }
3350
3351 /// Sets the value of [account_connector_id][crate::model::CreateAccountConnectorRequest::account_connector_id].
3352 ///
3353 /// # Example
3354 /// ```ignore,no_run
3355 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
3356 /// let x = CreateAccountConnectorRequest::new().set_account_connector_id("example");
3357 /// ```
3358 pub fn set_account_connector_id<T: std::convert::Into<std::string::String>>(
3359 mut self,
3360 v: T,
3361 ) -> Self {
3362 self.account_connector_id = v.into();
3363 self
3364 }
3365
3366 /// Sets the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
3367 ///
3368 /// # Example
3369 /// ```ignore,no_run
3370 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
3371 /// use google_cloud_developerconnect_v1::model::AccountConnector;
3372 /// let x = CreateAccountConnectorRequest::new().set_account_connector(AccountConnector::default()/* use setters */);
3373 /// ```
3374 pub fn set_account_connector<T>(mut self, v: T) -> Self
3375 where
3376 T: std::convert::Into<crate::model::AccountConnector>,
3377 {
3378 self.account_connector = std::option::Option::Some(v.into());
3379 self
3380 }
3381
3382 /// Sets or clears the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
3383 ///
3384 /// # Example
3385 /// ```ignore,no_run
3386 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
3387 /// use google_cloud_developerconnect_v1::model::AccountConnector;
3388 /// let x = CreateAccountConnectorRequest::new().set_or_clear_account_connector(Some(AccountConnector::default()/* use setters */));
3389 /// let x = CreateAccountConnectorRequest::new().set_or_clear_account_connector(None::<AccountConnector>);
3390 /// ```
3391 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
3392 where
3393 T: std::convert::Into<crate::model::AccountConnector>,
3394 {
3395 self.account_connector = v.map(|x| x.into());
3396 self
3397 }
3398
3399 /// Sets the value of [request_id][crate::model::CreateAccountConnectorRequest::request_id].
3400 ///
3401 /// # Example
3402 /// ```ignore,no_run
3403 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
3404 /// let x = CreateAccountConnectorRequest::new().set_request_id("example");
3405 /// ```
3406 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3407 self.request_id = v.into();
3408 self
3409 }
3410
3411 /// Sets the value of [validate_only][crate::model::CreateAccountConnectorRequest::validate_only].
3412 ///
3413 /// # Example
3414 /// ```ignore,no_run
3415 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
3416 /// let x = CreateAccountConnectorRequest::new().set_validate_only(true);
3417 /// ```
3418 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3419 self.validate_only = v.into();
3420 self
3421 }
3422}
3423
3424impl wkt::message::Message for CreateAccountConnectorRequest {
3425 fn typename() -> &'static str {
3426 "type.googleapis.com/google.cloud.developerconnect.v1.CreateAccountConnectorRequest"
3427 }
3428}
3429
3430/// Message for updating a AccountConnector
3431#[derive(Clone, Default, PartialEq)]
3432#[non_exhaustive]
3433pub struct UpdateAccountConnectorRequest {
3434 /// Optional. The list of fields to be updated.
3435 pub update_mask: std::option::Option<wkt::FieldMask>,
3436
3437 /// Required. The AccountConnector to update.
3438 pub account_connector: std::option::Option<crate::model::AccountConnector>,
3439
3440 /// Optional. An optional request ID to identify requests. Specify a unique
3441 /// request ID so that if you must retry your request, the server will know to
3442 /// ignore the request if it has already been completed. The server will
3443 /// guarantee that for at least 60 minutes since the first request.
3444 ///
3445 /// For example, consider a situation where you make an initial request and the
3446 /// request times out. If you make the request again with the same request
3447 /// ID, the server can check if original operation with the same request ID
3448 /// was received, and if so, will ignore the second request. This prevents
3449 /// clients from accidentally creating duplicate commitments.
3450 ///
3451 /// The request ID must be a valid UUID with the exception that zero UUID is
3452 /// not supported (00000000-0000-0000-0000-000000000000).
3453 pub request_id: std::string::String,
3454
3455 /// Optional. If set to true, and the accountConnector is not found a new
3456 /// accountConnector will be created. In this situation `update_mask` is
3457 /// ignored. The creation will succeed only if the input accountConnector has
3458 /// all the necessary
3459 pub allow_missing: bool,
3460
3461 /// Optional. If set, validate the request, but do not actually post it.
3462 pub validate_only: bool,
3463
3464 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3465}
3466
3467impl UpdateAccountConnectorRequest {
3468 pub fn new() -> Self {
3469 std::default::Default::default()
3470 }
3471
3472 /// Sets the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
3473 ///
3474 /// # Example
3475 /// ```ignore,no_run
3476 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
3477 /// use wkt::FieldMask;
3478 /// let x = UpdateAccountConnectorRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3479 /// ```
3480 pub fn set_update_mask<T>(mut self, v: T) -> Self
3481 where
3482 T: std::convert::Into<wkt::FieldMask>,
3483 {
3484 self.update_mask = std::option::Option::Some(v.into());
3485 self
3486 }
3487
3488 /// Sets or clears the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
3489 ///
3490 /// # Example
3491 /// ```ignore,no_run
3492 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
3493 /// use wkt::FieldMask;
3494 /// let x = UpdateAccountConnectorRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3495 /// let x = UpdateAccountConnectorRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3496 /// ```
3497 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3498 where
3499 T: std::convert::Into<wkt::FieldMask>,
3500 {
3501 self.update_mask = v.map(|x| x.into());
3502 self
3503 }
3504
3505 /// Sets the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
3506 ///
3507 /// # Example
3508 /// ```ignore,no_run
3509 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
3510 /// use google_cloud_developerconnect_v1::model::AccountConnector;
3511 /// let x = UpdateAccountConnectorRequest::new().set_account_connector(AccountConnector::default()/* use setters */);
3512 /// ```
3513 pub fn set_account_connector<T>(mut self, v: T) -> Self
3514 where
3515 T: std::convert::Into<crate::model::AccountConnector>,
3516 {
3517 self.account_connector = std::option::Option::Some(v.into());
3518 self
3519 }
3520
3521 /// Sets or clears the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
3522 ///
3523 /// # Example
3524 /// ```ignore,no_run
3525 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
3526 /// use google_cloud_developerconnect_v1::model::AccountConnector;
3527 /// let x = UpdateAccountConnectorRequest::new().set_or_clear_account_connector(Some(AccountConnector::default()/* use setters */));
3528 /// let x = UpdateAccountConnectorRequest::new().set_or_clear_account_connector(None::<AccountConnector>);
3529 /// ```
3530 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
3531 where
3532 T: std::convert::Into<crate::model::AccountConnector>,
3533 {
3534 self.account_connector = v.map(|x| x.into());
3535 self
3536 }
3537
3538 /// Sets the value of [request_id][crate::model::UpdateAccountConnectorRequest::request_id].
3539 ///
3540 /// # Example
3541 /// ```ignore,no_run
3542 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
3543 /// let x = UpdateAccountConnectorRequest::new().set_request_id("example");
3544 /// ```
3545 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3546 self.request_id = v.into();
3547 self
3548 }
3549
3550 /// Sets the value of [allow_missing][crate::model::UpdateAccountConnectorRequest::allow_missing].
3551 ///
3552 /// # Example
3553 /// ```ignore,no_run
3554 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
3555 /// let x = UpdateAccountConnectorRequest::new().set_allow_missing(true);
3556 /// ```
3557 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3558 self.allow_missing = v.into();
3559 self
3560 }
3561
3562 /// Sets the value of [validate_only][crate::model::UpdateAccountConnectorRequest::validate_only].
3563 ///
3564 /// # Example
3565 /// ```ignore,no_run
3566 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
3567 /// let x = UpdateAccountConnectorRequest::new().set_validate_only(true);
3568 /// ```
3569 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3570 self.validate_only = v.into();
3571 self
3572 }
3573}
3574
3575impl wkt::message::Message for UpdateAccountConnectorRequest {
3576 fn typename() -> &'static str {
3577 "type.googleapis.com/google.cloud.developerconnect.v1.UpdateAccountConnectorRequest"
3578 }
3579}
3580
3581/// Message for deleting a AccountConnector
3582#[derive(Clone, Default, PartialEq)]
3583#[non_exhaustive]
3584pub struct DeleteAccountConnectorRequest {
3585 /// Required. Name of the resource
3586 pub name: std::string::String,
3587
3588 /// Optional. An optional request ID to identify requests. Specify a unique
3589 /// request ID so that if you must retry your request, the server will know to
3590 /// ignore the request if it has already been completed. The server will
3591 /// guarantee that for at least 60 minutes after the first request.
3592 ///
3593 /// For example, consider a situation where you make an initial request and the
3594 /// request times out. If you make the request again with the same request
3595 /// ID, the server can check if original operation with the same request ID
3596 /// was received, and if so, will ignore the second request. This prevents
3597 /// clients from accidentally creating duplicate commitments.
3598 ///
3599 /// The request ID must be a valid UUID with the exception that zero UUID is
3600 /// not supported (00000000-0000-0000-0000-000000000000).
3601 pub request_id: std::string::String,
3602
3603 /// Optional. If set, validate the request, but do not actually post it.
3604 pub validate_only: bool,
3605
3606 /// Optional. The current etag of the AccountConnectorn.
3607 /// If an etag is provided and does not match the current etag of the
3608 /// AccountConnector, deletion will be blocked and an ABORTED error will be
3609 /// returned.
3610 pub etag: std::string::String,
3611
3612 /// Optional. If set to true, any Users from this AccountConnector will also
3613 /// be deleted. (Otherwise, the request will only work if the AccountConnector
3614 /// has no Users.)
3615 pub force: bool,
3616
3617 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3618}
3619
3620impl DeleteAccountConnectorRequest {
3621 pub fn new() -> Self {
3622 std::default::Default::default()
3623 }
3624
3625 /// Sets the value of [name][crate::model::DeleteAccountConnectorRequest::name].
3626 ///
3627 /// # Example
3628 /// ```ignore,no_run
3629 /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
3630 /// let x = DeleteAccountConnectorRequest::new().set_name("example");
3631 /// ```
3632 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3633 self.name = v.into();
3634 self
3635 }
3636
3637 /// Sets the value of [request_id][crate::model::DeleteAccountConnectorRequest::request_id].
3638 ///
3639 /// # Example
3640 /// ```ignore,no_run
3641 /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
3642 /// let x = DeleteAccountConnectorRequest::new().set_request_id("example");
3643 /// ```
3644 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3645 self.request_id = v.into();
3646 self
3647 }
3648
3649 /// Sets the value of [validate_only][crate::model::DeleteAccountConnectorRequest::validate_only].
3650 ///
3651 /// # Example
3652 /// ```ignore,no_run
3653 /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
3654 /// let x = DeleteAccountConnectorRequest::new().set_validate_only(true);
3655 /// ```
3656 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3657 self.validate_only = v.into();
3658 self
3659 }
3660
3661 /// Sets the value of [etag][crate::model::DeleteAccountConnectorRequest::etag].
3662 ///
3663 /// # Example
3664 /// ```ignore,no_run
3665 /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
3666 /// let x = DeleteAccountConnectorRequest::new().set_etag("example");
3667 /// ```
3668 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3669 self.etag = v.into();
3670 self
3671 }
3672
3673 /// Sets the value of [force][crate::model::DeleteAccountConnectorRequest::force].
3674 ///
3675 /// # Example
3676 /// ```ignore,no_run
3677 /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
3678 /// let x = DeleteAccountConnectorRequest::new().set_force(true);
3679 /// ```
3680 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3681 self.force = v.into();
3682 self
3683 }
3684}
3685
3686impl wkt::message::Message for DeleteAccountConnectorRequest {
3687 fn typename() -> &'static str {
3688 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteAccountConnectorRequest"
3689 }
3690}
3691
3692/// Message for deleting a User
3693#[derive(Clone, Default, PartialEq)]
3694#[non_exhaustive]
3695pub struct DeleteUserRequest {
3696 /// Required. Name of the resource
3697 pub name: std::string::String,
3698
3699 /// Optional. An optional request ID to identify requests. Specify a unique
3700 /// request ID so that if you must retry your request, the server will know to
3701 /// ignore the request if it has already been completed. The server will
3702 /// guarantee that for at least 60 minutes after the first request.
3703 ///
3704 /// For example, consider a situation where you make an initial request and the
3705 /// request times out. If you make the request again with the same request
3706 /// ID, the server can check if original operation with the same request ID
3707 /// was received, and if so, will ignore the second request. This prevents
3708 /// clients from accidentally creating duplicate commitments.
3709 ///
3710 /// The request ID must be a valid UUID with the exception that zero UUID is
3711 /// not supported (00000000-0000-0000-0000-000000000000).
3712 pub request_id: std::string::String,
3713
3714 /// Optional. If set, validate the request, but do not actually post it.
3715 pub validate_only: bool,
3716
3717 /// Optional. This checksum is computed by the server based on the value of
3718 /// other fields, and may be sent on update and delete requests to ensure the
3719 /// client has an up-to-date value before proceeding.
3720 pub etag: std::string::String,
3721
3722 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3723}
3724
3725impl DeleteUserRequest {
3726 pub fn new() -> Self {
3727 std::default::Default::default()
3728 }
3729
3730 /// Sets the value of [name][crate::model::DeleteUserRequest::name].
3731 ///
3732 /// # Example
3733 /// ```ignore,no_run
3734 /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
3735 /// let x = DeleteUserRequest::new().set_name("example");
3736 /// ```
3737 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3738 self.name = v.into();
3739 self
3740 }
3741
3742 /// Sets the value of [request_id][crate::model::DeleteUserRequest::request_id].
3743 ///
3744 /// # Example
3745 /// ```ignore,no_run
3746 /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
3747 /// let x = DeleteUserRequest::new().set_request_id("example");
3748 /// ```
3749 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3750 self.request_id = v.into();
3751 self
3752 }
3753
3754 /// Sets the value of [validate_only][crate::model::DeleteUserRequest::validate_only].
3755 ///
3756 /// # Example
3757 /// ```ignore,no_run
3758 /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
3759 /// let x = DeleteUserRequest::new().set_validate_only(true);
3760 /// ```
3761 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3762 self.validate_only = v.into();
3763 self
3764 }
3765
3766 /// Sets the value of [etag][crate::model::DeleteUserRequest::etag].
3767 ///
3768 /// # Example
3769 /// ```ignore,no_run
3770 /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
3771 /// let x = DeleteUserRequest::new().set_etag("example");
3772 /// ```
3773 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3774 self.etag = v.into();
3775 self
3776 }
3777}
3778
3779impl wkt::message::Message for DeleteUserRequest {
3780 fn typename() -> &'static str {
3781 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteUserRequest"
3782 }
3783}
3784
3785/// Represents the metadata of the long-running operation.
3786#[derive(Clone, Default, PartialEq)]
3787#[non_exhaustive]
3788pub struct OperationMetadata {
3789 /// Output only. The time the operation was created.
3790 pub create_time: std::option::Option<wkt::Timestamp>,
3791
3792 /// Output only. The time the operation finished running.
3793 pub end_time: std::option::Option<wkt::Timestamp>,
3794
3795 /// Output only. Server-defined resource path for the target of the operation.
3796 pub target: std::string::String,
3797
3798 /// Output only. Name of the verb executed by the operation.
3799 pub verb: std::string::String,
3800
3801 /// Output only. Human-readable status of the operation, if any.
3802 pub status_message: std::string::String,
3803
3804 /// Output only. Identifies whether the user has requested cancellation
3805 /// of the operation. Operations that have been cancelled successfully
3806 /// have
3807 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
3808 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
3809 /// corresponding to `Code.CANCELLED`.
3810 ///
3811 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
3812 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
3813 pub requested_cancellation: bool,
3814
3815 /// Output only. API version used to start the operation.
3816 pub api_version: std::string::String,
3817
3818 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3819}
3820
3821impl OperationMetadata {
3822 pub fn new() -> Self {
3823 std::default::Default::default()
3824 }
3825
3826 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
3827 ///
3828 /// # Example
3829 /// ```ignore,no_run
3830 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
3831 /// use wkt::Timestamp;
3832 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
3833 /// ```
3834 pub fn set_create_time<T>(mut self, v: T) -> Self
3835 where
3836 T: std::convert::Into<wkt::Timestamp>,
3837 {
3838 self.create_time = std::option::Option::Some(v.into());
3839 self
3840 }
3841
3842 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
3843 ///
3844 /// # Example
3845 /// ```ignore,no_run
3846 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
3847 /// use wkt::Timestamp;
3848 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3849 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
3850 /// ```
3851 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3852 where
3853 T: std::convert::Into<wkt::Timestamp>,
3854 {
3855 self.create_time = v.map(|x| x.into());
3856 self
3857 }
3858
3859 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
3860 ///
3861 /// # Example
3862 /// ```ignore,no_run
3863 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
3864 /// use wkt::Timestamp;
3865 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
3866 /// ```
3867 pub fn set_end_time<T>(mut self, v: T) -> Self
3868 where
3869 T: std::convert::Into<wkt::Timestamp>,
3870 {
3871 self.end_time = std::option::Option::Some(v.into());
3872 self
3873 }
3874
3875 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
3876 ///
3877 /// # Example
3878 /// ```ignore,no_run
3879 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
3880 /// use wkt::Timestamp;
3881 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3882 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
3883 /// ```
3884 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3885 where
3886 T: std::convert::Into<wkt::Timestamp>,
3887 {
3888 self.end_time = v.map(|x| x.into());
3889 self
3890 }
3891
3892 /// Sets the value of [target][crate::model::OperationMetadata::target].
3893 ///
3894 /// # Example
3895 /// ```ignore,no_run
3896 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
3897 /// let x = OperationMetadata::new().set_target("example");
3898 /// ```
3899 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3900 self.target = v.into();
3901 self
3902 }
3903
3904 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
3905 ///
3906 /// # Example
3907 /// ```ignore,no_run
3908 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
3909 /// let x = OperationMetadata::new().set_verb("example");
3910 /// ```
3911 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3912 self.verb = v.into();
3913 self
3914 }
3915
3916 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
3917 ///
3918 /// # Example
3919 /// ```ignore,no_run
3920 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
3921 /// let x = OperationMetadata::new().set_status_message("example");
3922 /// ```
3923 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3924 self.status_message = v.into();
3925 self
3926 }
3927
3928 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
3929 ///
3930 /// # Example
3931 /// ```ignore,no_run
3932 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
3933 /// let x = OperationMetadata::new().set_requested_cancellation(true);
3934 /// ```
3935 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3936 self.requested_cancellation = v.into();
3937 self
3938 }
3939
3940 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
3941 ///
3942 /// # Example
3943 /// ```ignore,no_run
3944 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
3945 /// let x = OperationMetadata::new().set_api_version("example");
3946 /// ```
3947 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3948 self.api_version = v.into();
3949 self
3950 }
3951}
3952
3953impl wkt::message::Message for OperationMetadata {
3954 fn typename() -> &'static str {
3955 "type.googleapis.com/google.cloud.developerconnect.v1.OperationMetadata"
3956 }
3957}
3958
3959/// Message for fetching a User of the user themselves.
3960#[derive(Clone, Default, PartialEq)]
3961#[non_exhaustive]
3962pub struct FetchSelfRequest {
3963 /// Required. Name of the AccountConnector resource
3964 pub name: std::string::String,
3965
3966 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3967}
3968
3969impl FetchSelfRequest {
3970 pub fn new() -> Self {
3971 std::default::Default::default()
3972 }
3973
3974 /// Sets the value of [name][crate::model::FetchSelfRequest::name].
3975 ///
3976 /// # Example
3977 /// ```ignore,no_run
3978 /// # use google_cloud_developerconnect_v1::model::FetchSelfRequest;
3979 /// let x = FetchSelfRequest::new().set_name("example");
3980 /// ```
3981 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3982 self.name = v.into();
3983 self
3984 }
3985}
3986
3987impl wkt::message::Message for FetchSelfRequest {
3988 fn typename() -> &'static str {
3989 "type.googleapis.com/google.cloud.developerconnect.v1.FetchSelfRequest"
3990 }
3991}
3992
3993/// Message for deleting a User of the user themselves.
3994#[derive(Clone, Default, PartialEq)]
3995#[non_exhaustive]
3996pub struct DeleteSelfRequest {
3997 /// Required. Name of the AccountConnector resource
3998 pub name: std::string::String,
3999
4000 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4001}
4002
4003impl DeleteSelfRequest {
4004 pub fn new() -> Self {
4005 std::default::Default::default()
4006 }
4007
4008 /// Sets the value of [name][crate::model::DeleteSelfRequest::name].
4009 ///
4010 /// # Example
4011 /// ```ignore,no_run
4012 /// # use google_cloud_developerconnect_v1::model::DeleteSelfRequest;
4013 /// let x = DeleteSelfRequest::new().set_name("example");
4014 /// ```
4015 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4016 self.name = v.into();
4017 self
4018 }
4019}
4020
4021impl wkt::message::Message for DeleteSelfRequest {
4022 fn typename() -> &'static str {
4023 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteSelfRequest"
4024 }
4025}
4026
4027/// Message for fetching an OAuth access token.
4028#[derive(Clone, Default, PartialEq)]
4029#[non_exhaustive]
4030pub struct FetchAccessTokenRequest {
4031 /// Required. The resource name of the AccountConnector in the format
4032 /// `projects/*/locations/*/accountConnectors/*`.
4033 pub account_connector: std::string::String,
4034
4035 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4036}
4037
4038impl FetchAccessTokenRequest {
4039 pub fn new() -> Self {
4040 std::default::Default::default()
4041 }
4042
4043 /// Sets the value of [account_connector][crate::model::FetchAccessTokenRequest::account_connector].
4044 ///
4045 /// # Example
4046 /// ```ignore,no_run
4047 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenRequest;
4048 /// let x = FetchAccessTokenRequest::new().set_account_connector("example");
4049 /// ```
4050 pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
4051 mut self,
4052 v: T,
4053 ) -> Self {
4054 self.account_connector = v.into();
4055 self
4056 }
4057}
4058
4059impl wkt::message::Message for FetchAccessTokenRequest {
4060 fn typename() -> &'static str {
4061 "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenRequest"
4062 }
4063}
4064
4065/// Message for responding to getting an OAuth access token.
4066#[derive(Clone, Default, PartialEq)]
4067#[non_exhaustive]
4068pub struct FetchAccessTokenResponse {
4069 /// The token content.
4070 pub token: std::string::String,
4071
4072 /// Expiration timestamp. Can be empty if unknown or non-expiring.
4073 pub expiration_time: std::option::Option<wkt::Timestamp>,
4074
4075 /// The scopes of the access token.
4076 pub scopes: std::vec::Vec<std::string::String>,
4077
4078 /// The error resulted from exchanging OAuth tokens from the service provider.
4079 pub exchange_error: std::option::Option<crate::model::ExchangeError>,
4080
4081 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4082}
4083
4084impl FetchAccessTokenResponse {
4085 pub fn new() -> Self {
4086 std::default::Default::default()
4087 }
4088
4089 /// Sets the value of [token][crate::model::FetchAccessTokenResponse::token].
4090 ///
4091 /// # Example
4092 /// ```ignore,no_run
4093 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4094 /// let x = FetchAccessTokenResponse::new().set_token("example");
4095 /// ```
4096 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4097 self.token = v.into();
4098 self
4099 }
4100
4101 /// Sets the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
4102 ///
4103 /// # Example
4104 /// ```ignore,no_run
4105 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4106 /// use wkt::Timestamp;
4107 /// let x = FetchAccessTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
4108 /// ```
4109 pub fn set_expiration_time<T>(mut self, v: T) -> Self
4110 where
4111 T: std::convert::Into<wkt::Timestamp>,
4112 {
4113 self.expiration_time = std::option::Option::Some(v.into());
4114 self
4115 }
4116
4117 /// Sets or clears the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
4118 ///
4119 /// # Example
4120 /// ```ignore,no_run
4121 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4122 /// use wkt::Timestamp;
4123 /// let x = FetchAccessTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
4124 /// let x = FetchAccessTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
4125 /// ```
4126 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
4127 where
4128 T: std::convert::Into<wkt::Timestamp>,
4129 {
4130 self.expiration_time = v.map(|x| x.into());
4131 self
4132 }
4133
4134 /// Sets the value of [scopes][crate::model::FetchAccessTokenResponse::scopes].
4135 ///
4136 /// # Example
4137 /// ```ignore,no_run
4138 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4139 /// let x = FetchAccessTokenResponse::new().set_scopes(["a", "b", "c"]);
4140 /// ```
4141 pub fn set_scopes<T, V>(mut self, v: T) -> Self
4142 where
4143 T: std::iter::IntoIterator<Item = V>,
4144 V: std::convert::Into<std::string::String>,
4145 {
4146 use std::iter::Iterator;
4147 self.scopes = v.into_iter().map(|i| i.into()).collect();
4148 self
4149 }
4150
4151 /// Sets the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
4152 ///
4153 /// # Example
4154 /// ```ignore,no_run
4155 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4156 /// use google_cloud_developerconnect_v1::model::ExchangeError;
4157 /// let x = FetchAccessTokenResponse::new().set_exchange_error(ExchangeError::default()/* use setters */);
4158 /// ```
4159 pub fn set_exchange_error<T>(mut self, v: T) -> Self
4160 where
4161 T: std::convert::Into<crate::model::ExchangeError>,
4162 {
4163 self.exchange_error = std::option::Option::Some(v.into());
4164 self
4165 }
4166
4167 /// Sets or clears the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
4168 ///
4169 /// # Example
4170 /// ```ignore,no_run
4171 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4172 /// use google_cloud_developerconnect_v1::model::ExchangeError;
4173 /// let x = FetchAccessTokenResponse::new().set_or_clear_exchange_error(Some(ExchangeError::default()/* use setters */));
4174 /// let x = FetchAccessTokenResponse::new().set_or_clear_exchange_error(None::<ExchangeError>);
4175 /// ```
4176 pub fn set_or_clear_exchange_error<T>(mut self, v: std::option::Option<T>) -> Self
4177 where
4178 T: std::convert::Into<crate::model::ExchangeError>,
4179 {
4180 self.exchange_error = v.map(|x| x.into());
4181 self
4182 }
4183}
4184
4185impl wkt::message::Message for FetchAccessTokenResponse {
4186 fn typename() -> &'static str {
4187 "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenResponse"
4188 }
4189}
4190
4191/// Message for representing an error from exchanging OAuth tokens.
4192#[derive(Clone, Default, PartialEq)]
4193#[non_exhaustive]
4194pub struct ExchangeError {
4195 /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> - error
4196 pub code: std::string::String,
4197
4198 /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> -
4199 /// error_description
4200 pub description: std::string::String,
4201
4202 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4203}
4204
4205impl ExchangeError {
4206 pub fn new() -> Self {
4207 std::default::Default::default()
4208 }
4209
4210 /// Sets the value of [code][crate::model::ExchangeError::code].
4211 ///
4212 /// # Example
4213 /// ```ignore,no_run
4214 /// # use google_cloud_developerconnect_v1::model::ExchangeError;
4215 /// let x = ExchangeError::new().set_code("example");
4216 /// ```
4217 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4218 self.code = v.into();
4219 self
4220 }
4221
4222 /// Sets the value of [description][crate::model::ExchangeError::description].
4223 ///
4224 /// # Example
4225 /// ```ignore,no_run
4226 /// # use google_cloud_developerconnect_v1::model::ExchangeError;
4227 /// let x = ExchangeError::new().set_description("example");
4228 /// ```
4229 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4230 self.description = v.into();
4231 self
4232 }
4233}
4234
4235impl wkt::message::Message for ExchangeError {
4236 fn typename() -> &'static str {
4237 "type.googleapis.com/google.cloud.developerconnect.v1.ExchangeError"
4238 }
4239}
4240
4241/// Message describing the GitRepositoryLink object
4242#[derive(Clone, Default, PartialEq)]
4243#[non_exhaustive]
4244pub struct GitRepositoryLink {
4245 /// Identifier. Resource name of the repository, in the format
4246 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
4247 pub name: std::string::String,
4248
4249 /// Required. Git Clone URI.
4250 pub clone_uri: std::string::String,
4251
4252 /// Output only. [Output only] Create timestamp
4253 pub create_time: std::option::Option<wkt::Timestamp>,
4254
4255 /// Output only. [Output only] Update timestamp
4256 pub update_time: std::option::Option<wkt::Timestamp>,
4257
4258 /// Output only. [Output only] Delete timestamp
4259 pub delete_time: std::option::Option<wkt::Timestamp>,
4260
4261 /// Optional. Labels as key value pairs
4262 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4263
4264 /// Optional. This checksum is computed by the server based on the value of
4265 /// other fields, and may be sent on update and delete requests to ensure the
4266 /// client has an up-to-date value before proceeding.
4267 pub etag: std::string::String,
4268
4269 /// Output only. Set to true when the connection is being set up or updated in
4270 /// the background.
4271 pub reconciling: bool,
4272
4273 /// Optional. Allows clients to store small amounts of arbitrary data.
4274 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
4275
4276 /// Output only. A system-assigned unique identifier for the GitRepositoryLink.
4277 pub uid: std::string::String,
4278
4279 /// Output only. External ID of the webhook created for the repository.
4280 pub webhook_id: std::string::String,
4281
4282 /// Output only. URI to access the linked repository through the Git Proxy.
4283 /// This field is only populated if the git proxy is enabled for the
4284 /// connection.
4285 pub git_proxy_uri: std::string::String,
4286
4287 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4288}
4289
4290impl GitRepositoryLink {
4291 pub fn new() -> Self {
4292 std::default::Default::default()
4293 }
4294
4295 /// Sets the value of [name][crate::model::GitRepositoryLink::name].
4296 ///
4297 /// # Example
4298 /// ```ignore,no_run
4299 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4300 /// let x = GitRepositoryLink::new().set_name("example");
4301 /// ```
4302 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4303 self.name = v.into();
4304 self
4305 }
4306
4307 /// Sets the value of [clone_uri][crate::model::GitRepositoryLink::clone_uri].
4308 ///
4309 /// # Example
4310 /// ```ignore,no_run
4311 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4312 /// let x = GitRepositoryLink::new().set_clone_uri("example");
4313 /// ```
4314 pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4315 self.clone_uri = v.into();
4316 self
4317 }
4318
4319 /// Sets the value of [create_time][crate::model::GitRepositoryLink::create_time].
4320 ///
4321 /// # Example
4322 /// ```ignore,no_run
4323 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4324 /// use wkt::Timestamp;
4325 /// let x = GitRepositoryLink::new().set_create_time(Timestamp::default()/* use setters */);
4326 /// ```
4327 pub fn set_create_time<T>(mut self, v: T) -> Self
4328 where
4329 T: std::convert::Into<wkt::Timestamp>,
4330 {
4331 self.create_time = std::option::Option::Some(v.into());
4332 self
4333 }
4334
4335 /// Sets or clears the value of [create_time][crate::model::GitRepositoryLink::create_time].
4336 ///
4337 /// # Example
4338 /// ```ignore,no_run
4339 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4340 /// use wkt::Timestamp;
4341 /// let x = GitRepositoryLink::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4342 /// let x = GitRepositoryLink::new().set_or_clear_create_time(None::<Timestamp>);
4343 /// ```
4344 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4345 where
4346 T: std::convert::Into<wkt::Timestamp>,
4347 {
4348 self.create_time = v.map(|x| x.into());
4349 self
4350 }
4351
4352 /// Sets the value of [update_time][crate::model::GitRepositoryLink::update_time].
4353 ///
4354 /// # Example
4355 /// ```ignore,no_run
4356 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4357 /// use wkt::Timestamp;
4358 /// let x = GitRepositoryLink::new().set_update_time(Timestamp::default()/* use setters */);
4359 /// ```
4360 pub fn set_update_time<T>(mut self, v: T) -> Self
4361 where
4362 T: std::convert::Into<wkt::Timestamp>,
4363 {
4364 self.update_time = std::option::Option::Some(v.into());
4365 self
4366 }
4367
4368 /// Sets or clears the value of [update_time][crate::model::GitRepositoryLink::update_time].
4369 ///
4370 /// # Example
4371 /// ```ignore,no_run
4372 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4373 /// use wkt::Timestamp;
4374 /// let x = GitRepositoryLink::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4375 /// let x = GitRepositoryLink::new().set_or_clear_update_time(None::<Timestamp>);
4376 /// ```
4377 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4378 where
4379 T: std::convert::Into<wkt::Timestamp>,
4380 {
4381 self.update_time = v.map(|x| x.into());
4382 self
4383 }
4384
4385 /// Sets the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
4386 ///
4387 /// # Example
4388 /// ```ignore,no_run
4389 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4390 /// use wkt::Timestamp;
4391 /// let x = GitRepositoryLink::new().set_delete_time(Timestamp::default()/* use setters */);
4392 /// ```
4393 pub fn set_delete_time<T>(mut self, v: T) -> Self
4394 where
4395 T: std::convert::Into<wkt::Timestamp>,
4396 {
4397 self.delete_time = std::option::Option::Some(v.into());
4398 self
4399 }
4400
4401 /// Sets or clears the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
4402 ///
4403 /// # Example
4404 /// ```ignore,no_run
4405 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4406 /// use wkt::Timestamp;
4407 /// let x = GitRepositoryLink::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
4408 /// let x = GitRepositoryLink::new().set_or_clear_delete_time(None::<Timestamp>);
4409 /// ```
4410 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
4411 where
4412 T: std::convert::Into<wkt::Timestamp>,
4413 {
4414 self.delete_time = v.map(|x| x.into());
4415 self
4416 }
4417
4418 /// Sets the value of [labels][crate::model::GitRepositoryLink::labels].
4419 ///
4420 /// # Example
4421 /// ```ignore,no_run
4422 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4423 /// let x = GitRepositoryLink::new().set_labels([
4424 /// ("key0", "abc"),
4425 /// ("key1", "xyz"),
4426 /// ]);
4427 /// ```
4428 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4429 where
4430 T: std::iter::IntoIterator<Item = (K, V)>,
4431 K: std::convert::Into<std::string::String>,
4432 V: std::convert::Into<std::string::String>,
4433 {
4434 use std::iter::Iterator;
4435 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4436 self
4437 }
4438
4439 /// Sets the value of [etag][crate::model::GitRepositoryLink::etag].
4440 ///
4441 /// # Example
4442 /// ```ignore,no_run
4443 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4444 /// let x = GitRepositoryLink::new().set_etag("example");
4445 /// ```
4446 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4447 self.etag = v.into();
4448 self
4449 }
4450
4451 /// Sets the value of [reconciling][crate::model::GitRepositoryLink::reconciling].
4452 ///
4453 /// # Example
4454 /// ```ignore,no_run
4455 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4456 /// let x = GitRepositoryLink::new().set_reconciling(true);
4457 /// ```
4458 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4459 self.reconciling = v.into();
4460 self
4461 }
4462
4463 /// Sets the value of [annotations][crate::model::GitRepositoryLink::annotations].
4464 ///
4465 /// # Example
4466 /// ```ignore,no_run
4467 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4468 /// let x = GitRepositoryLink::new().set_annotations([
4469 /// ("key0", "abc"),
4470 /// ("key1", "xyz"),
4471 /// ]);
4472 /// ```
4473 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
4474 where
4475 T: std::iter::IntoIterator<Item = (K, V)>,
4476 K: std::convert::Into<std::string::String>,
4477 V: std::convert::Into<std::string::String>,
4478 {
4479 use std::iter::Iterator;
4480 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4481 self
4482 }
4483
4484 /// Sets the value of [uid][crate::model::GitRepositoryLink::uid].
4485 ///
4486 /// # Example
4487 /// ```ignore,no_run
4488 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4489 /// let x = GitRepositoryLink::new().set_uid("example");
4490 /// ```
4491 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4492 self.uid = v.into();
4493 self
4494 }
4495
4496 /// Sets the value of [webhook_id][crate::model::GitRepositoryLink::webhook_id].
4497 ///
4498 /// # Example
4499 /// ```ignore,no_run
4500 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4501 /// let x = GitRepositoryLink::new().set_webhook_id("example");
4502 /// ```
4503 pub fn set_webhook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4504 self.webhook_id = v.into();
4505 self
4506 }
4507
4508 /// Sets the value of [git_proxy_uri][crate::model::GitRepositoryLink::git_proxy_uri].
4509 ///
4510 /// # Example
4511 /// ```ignore,no_run
4512 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4513 /// let x = GitRepositoryLink::new().set_git_proxy_uri("example");
4514 /// ```
4515 pub fn set_git_proxy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4516 self.git_proxy_uri = v.into();
4517 self
4518 }
4519}
4520
4521impl wkt::message::Message for GitRepositoryLink {
4522 fn typename() -> &'static str {
4523 "type.googleapis.com/google.cloud.developerconnect.v1.GitRepositoryLink"
4524 }
4525}
4526
4527/// Message for creating a GitRepositoryLink
4528#[derive(Clone, Default, PartialEq)]
4529#[non_exhaustive]
4530pub struct CreateGitRepositoryLinkRequest {
4531 /// Required. Value for parent.
4532 pub parent: std::string::String,
4533
4534 /// Required. The resource being created
4535 pub git_repository_link: std::option::Option<crate::model::GitRepositoryLink>,
4536
4537 /// Required. The ID to use for the repository, which will become the final
4538 /// component of the repository's resource name. This ID should be unique in
4539 /// the connection. Allows alphanumeric characters and any of
4540 /// -._~%!$&'()*+,;=@.
4541 pub git_repository_link_id: std::string::String,
4542
4543 /// Optional. An optional request ID to identify requests. Specify a unique
4544 /// request ID so that if you must retry your request, the server will know to
4545 /// ignore the request if it has already been completed. The server will
4546 /// guarantee that for at least 60 minutes since the first request.
4547 ///
4548 /// For example, consider a situation where you make an initial request and the
4549 /// request times out. If you make the request again with the same request
4550 /// ID, the server can check if original operation with the same request ID
4551 /// was received, and if so, will ignore the second request. This prevents
4552 /// clients from accidentally creating duplicate commitments.
4553 ///
4554 /// The request ID must be a valid UUID with the exception that zero UUID is
4555 /// not supported (00000000-0000-0000-0000-000000000000).
4556 pub request_id: std::string::String,
4557
4558 /// Optional. If set, validate the request, but do not actually post it.
4559 pub validate_only: bool,
4560
4561 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4562}
4563
4564impl CreateGitRepositoryLinkRequest {
4565 pub fn new() -> Self {
4566 std::default::Default::default()
4567 }
4568
4569 /// Sets the value of [parent][crate::model::CreateGitRepositoryLinkRequest::parent].
4570 ///
4571 /// # Example
4572 /// ```ignore,no_run
4573 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
4574 /// let x = CreateGitRepositoryLinkRequest::new().set_parent("example");
4575 /// ```
4576 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4577 self.parent = v.into();
4578 self
4579 }
4580
4581 /// Sets the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
4582 ///
4583 /// # Example
4584 /// ```ignore,no_run
4585 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
4586 /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4587 /// let x = CreateGitRepositoryLinkRequest::new().set_git_repository_link(GitRepositoryLink::default()/* use setters */);
4588 /// ```
4589 pub fn set_git_repository_link<T>(mut self, v: T) -> Self
4590 where
4591 T: std::convert::Into<crate::model::GitRepositoryLink>,
4592 {
4593 self.git_repository_link = std::option::Option::Some(v.into());
4594 self
4595 }
4596
4597 /// Sets or clears the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
4598 ///
4599 /// # Example
4600 /// ```ignore,no_run
4601 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
4602 /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4603 /// let x = CreateGitRepositoryLinkRequest::new().set_or_clear_git_repository_link(Some(GitRepositoryLink::default()/* use setters */));
4604 /// let x = CreateGitRepositoryLinkRequest::new().set_or_clear_git_repository_link(None::<GitRepositoryLink>);
4605 /// ```
4606 pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
4607 where
4608 T: std::convert::Into<crate::model::GitRepositoryLink>,
4609 {
4610 self.git_repository_link = v.map(|x| x.into());
4611 self
4612 }
4613
4614 /// Sets the value of [git_repository_link_id][crate::model::CreateGitRepositoryLinkRequest::git_repository_link_id].
4615 ///
4616 /// # Example
4617 /// ```ignore,no_run
4618 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
4619 /// let x = CreateGitRepositoryLinkRequest::new().set_git_repository_link_id("example");
4620 /// ```
4621 pub fn set_git_repository_link_id<T: std::convert::Into<std::string::String>>(
4622 mut self,
4623 v: T,
4624 ) -> Self {
4625 self.git_repository_link_id = v.into();
4626 self
4627 }
4628
4629 /// Sets the value of [request_id][crate::model::CreateGitRepositoryLinkRequest::request_id].
4630 ///
4631 /// # Example
4632 /// ```ignore,no_run
4633 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
4634 /// let x = CreateGitRepositoryLinkRequest::new().set_request_id("example");
4635 /// ```
4636 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4637 self.request_id = v.into();
4638 self
4639 }
4640
4641 /// Sets the value of [validate_only][crate::model::CreateGitRepositoryLinkRequest::validate_only].
4642 ///
4643 /// # Example
4644 /// ```ignore,no_run
4645 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
4646 /// let x = CreateGitRepositoryLinkRequest::new().set_validate_only(true);
4647 /// ```
4648 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4649 self.validate_only = v.into();
4650 self
4651 }
4652}
4653
4654impl wkt::message::Message for CreateGitRepositoryLinkRequest {
4655 fn typename() -> &'static str {
4656 "type.googleapis.com/google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest"
4657 }
4658}
4659
4660/// Message for deleting a GitRepositoryLink
4661#[derive(Clone, Default, PartialEq)]
4662#[non_exhaustive]
4663pub struct DeleteGitRepositoryLinkRequest {
4664 /// Required. Name of the resource
4665 pub name: std::string::String,
4666
4667 /// Optional. An optional request ID to identify requests. Specify a unique
4668 /// request ID so that if you must retry your request, the server will know to
4669 /// ignore the request if it has already been completed. The server will
4670 /// guarantee that for at least 60 minutes after the first request.
4671 ///
4672 /// For example, consider a situation where you make an initial request and the
4673 /// request times out. If you make the request again with the same request
4674 /// ID, the server can check if original operation with the same request ID
4675 /// was received, and if so, will ignore the second request. This prevents
4676 /// clients from accidentally creating duplicate commitments.
4677 ///
4678 /// The request ID must be a valid UUID with the exception that zero UUID is
4679 /// not supported (00000000-0000-0000-0000-000000000000).
4680 pub request_id: std::string::String,
4681
4682 /// Optional. If set, validate the request, but do not actually post it.
4683 pub validate_only: bool,
4684
4685 /// Optional. This checksum is computed by the server based on the value of
4686 /// other fields, and may be sent on update and delete requests to ensure the
4687 /// client has an up-to-date value before proceeding.
4688 pub etag: std::string::String,
4689
4690 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4691}
4692
4693impl DeleteGitRepositoryLinkRequest {
4694 pub fn new() -> Self {
4695 std::default::Default::default()
4696 }
4697
4698 /// Sets the value of [name][crate::model::DeleteGitRepositoryLinkRequest::name].
4699 ///
4700 /// # Example
4701 /// ```ignore,no_run
4702 /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
4703 /// let x = DeleteGitRepositoryLinkRequest::new().set_name("example");
4704 /// ```
4705 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4706 self.name = v.into();
4707 self
4708 }
4709
4710 /// Sets the value of [request_id][crate::model::DeleteGitRepositoryLinkRequest::request_id].
4711 ///
4712 /// # Example
4713 /// ```ignore,no_run
4714 /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
4715 /// let x = DeleteGitRepositoryLinkRequest::new().set_request_id("example");
4716 /// ```
4717 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4718 self.request_id = v.into();
4719 self
4720 }
4721
4722 /// Sets the value of [validate_only][crate::model::DeleteGitRepositoryLinkRequest::validate_only].
4723 ///
4724 /// # Example
4725 /// ```ignore,no_run
4726 /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
4727 /// let x = DeleteGitRepositoryLinkRequest::new().set_validate_only(true);
4728 /// ```
4729 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4730 self.validate_only = v.into();
4731 self
4732 }
4733
4734 /// Sets the value of [etag][crate::model::DeleteGitRepositoryLinkRequest::etag].
4735 ///
4736 /// # Example
4737 /// ```ignore,no_run
4738 /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
4739 /// let x = DeleteGitRepositoryLinkRequest::new().set_etag("example");
4740 /// ```
4741 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4742 self.etag = v.into();
4743 self
4744 }
4745}
4746
4747impl wkt::message::Message for DeleteGitRepositoryLinkRequest {
4748 fn typename() -> &'static str {
4749 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest"
4750 }
4751}
4752
4753/// Message for requesting a list of GitRepositoryLinks
4754#[derive(Clone, Default, PartialEq)]
4755#[non_exhaustive]
4756pub struct ListGitRepositoryLinksRequest {
4757 /// Required. Parent value for ListGitRepositoryLinksRequest
4758 pub parent: std::string::String,
4759
4760 /// Optional. Requested page size. Server may return fewer items than
4761 /// requested. If unspecified, server will pick an appropriate default.
4762 pub page_size: i32,
4763
4764 /// Optional. A token identifying a page of results the server should return.
4765 pub page_token: std::string::String,
4766
4767 /// Optional. Filtering results
4768 pub filter: std::string::String,
4769
4770 /// Optional. Hint for how to order the results
4771 pub order_by: std::string::String,
4772
4773 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4774}
4775
4776impl ListGitRepositoryLinksRequest {
4777 pub fn new() -> Self {
4778 std::default::Default::default()
4779 }
4780
4781 /// Sets the value of [parent][crate::model::ListGitRepositoryLinksRequest::parent].
4782 ///
4783 /// # Example
4784 /// ```ignore,no_run
4785 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
4786 /// let x = ListGitRepositoryLinksRequest::new().set_parent("example");
4787 /// ```
4788 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4789 self.parent = v.into();
4790 self
4791 }
4792
4793 /// Sets the value of [page_size][crate::model::ListGitRepositoryLinksRequest::page_size].
4794 ///
4795 /// # Example
4796 /// ```ignore,no_run
4797 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
4798 /// let x = ListGitRepositoryLinksRequest::new().set_page_size(42);
4799 /// ```
4800 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4801 self.page_size = v.into();
4802 self
4803 }
4804
4805 /// Sets the value of [page_token][crate::model::ListGitRepositoryLinksRequest::page_token].
4806 ///
4807 /// # Example
4808 /// ```ignore,no_run
4809 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
4810 /// let x = ListGitRepositoryLinksRequest::new().set_page_token("example");
4811 /// ```
4812 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4813 self.page_token = v.into();
4814 self
4815 }
4816
4817 /// Sets the value of [filter][crate::model::ListGitRepositoryLinksRequest::filter].
4818 ///
4819 /// # Example
4820 /// ```ignore,no_run
4821 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
4822 /// let x = ListGitRepositoryLinksRequest::new().set_filter("example");
4823 /// ```
4824 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4825 self.filter = v.into();
4826 self
4827 }
4828
4829 /// Sets the value of [order_by][crate::model::ListGitRepositoryLinksRequest::order_by].
4830 ///
4831 /// # Example
4832 /// ```ignore,no_run
4833 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
4834 /// let x = ListGitRepositoryLinksRequest::new().set_order_by("example");
4835 /// ```
4836 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4837 self.order_by = v.into();
4838 self
4839 }
4840}
4841
4842impl wkt::message::Message for ListGitRepositoryLinksRequest {
4843 fn typename() -> &'static str {
4844 "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest"
4845 }
4846}
4847
4848/// Message for response to listing GitRepositoryLinks
4849#[derive(Clone, Default, PartialEq)]
4850#[non_exhaustive]
4851pub struct ListGitRepositoryLinksResponse {
4852 /// The list of GitRepositoryLinks
4853 pub git_repository_links: std::vec::Vec<crate::model::GitRepositoryLink>,
4854
4855 /// A token identifying a page of results the server should return.
4856 pub next_page_token: std::string::String,
4857
4858 /// Locations that could not be reached.
4859 pub unreachable: std::vec::Vec<std::string::String>,
4860
4861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4862}
4863
4864impl ListGitRepositoryLinksResponse {
4865 pub fn new() -> Self {
4866 std::default::Default::default()
4867 }
4868
4869 /// Sets the value of [git_repository_links][crate::model::ListGitRepositoryLinksResponse::git_repository_links].
4870 ///
4871 /// # Example
4872 /// ```ignore,no_run
4873 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
4874 /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
4875 /// let x = ListGitRepositoryLinksResponse::new()
4876 /// .set_git_repository_links([
4877 /// GitRepositoryLink::default()/* use setters */,
4878 /// GitRepositoryLink::default()/* use (different) setters */,
4879 /// ]);
4880 /// ```
4881 pub fn set_git_repository_links<T, V>(mut self, v: T) -> Self
4882 where
4883 T: std::iter::IntoIterator<Item = V>,
4884 V: std::convert::Into<crate::model::GitRepositoryLink>,
4885 {
4886 use std::iter::Iterator;
4887 self.git_repository_links = v.into_iter().map(|i| i.into()).collect();
4888 self
4889 }
4890
4891 /// Sets the value of [next_page_token][crate::model::ListGitRepositoryLinksResponse::next_page_token].
4892 ///
4893 /// # Example
4894 /// ```ignore,no_run
4895 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
4896 /// let x = ListGitRepositoryLinksResponse::new().set_next_page_token("example");
4897 /// ```
4898 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4899 self.next_page_token = v.into();
4900 self
4901 }
4902
4903 /// Sets the value of [unreachable][crate::model::ListGitRepositoryLinksResponse::unreachable].
4904 ///
4905 /// # Example
4906 /// ```ignore,no_run
4907 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
4908 /// let x = ListGitRepositoryLinksResponse::new().set_unreachable(["a", "b", "c"]);
4909 /// ```
4910 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4911 where
4912 T: std::iter::IntoIterator<Item = V>,
4913 V: std::convert::Into<std::string::String>,
4914 {
4915 use std::iter::Iterator;
4916 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4917 self
4918 }
4919}
4920
4921impl wkt::message::Message for ListGitRepositoryLinksResponse {
4922 fn typename() -> &'static str {
4923 "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksResponse"
4924 }
4925}
4926
4927#[doc(hidden)]
4928impl google_cloud_gax::paginator::internal::PageableResponse for ListGitRepositoryLinksResponse {
4929 type PageItem = crate::model::GitRepositoryLink;
4930
4931 fn items(self) -> std::vec::Vec<Self::PageItem> {
4932 self.git_repository_links
4933 }
4934
4935 fn next_page_token(&self) -> std::string::String {
4936 use std::clone::Clone;
4937 self.next_page_token.clone()
4938 }
4939}
4940
4941/// Message for getting a GitRepositoryLink
4942#[derive(Clone, Default, PartialEq)]
4943#[non_exhaustive]
4944pub struct GetGitRepositoryLinkRequest {
4945 /// Required. Name of the resource
4946 pub name: std::string::String,
4947
4948 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4949}
4950
4951impl GetGitRepositoryLinkRequest {
4952 pub fn new() -> Self {
4953 std::default::Default::default()
4954 }
4955
4956 /// Sets the value of [name][crate::model::GetGitRepositoryLinkRequest::name].
4957 ///
4958 /// # Example
4959 /// ```ignore,no_run
4960 /// # use google_cloud_developerconnect_v1::model::GetGitRepositoryLinkRequest;
4961 /// let x = GetGitRepositoryLinkRequest::new().set_name("example");
4962 /// ```
4963 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4964 self.name = v.into();
4965 self
4966 }
4967}
4968
4969impl wkt::message::Message for GetGitRepositoryLinkRequest {
4970 fn typename() -> &'static str {
4971 "type.googleapis.com/google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest"
4972 }
4973}
4974
4975/// Message for fetching SCM read/write token.
4976#[derive(Clone, Default, PartialEq)]
4977#[non_exhaustive]
4978pub struct FetchReadWriteTokenRequest {
4979 /// Required. The resource name of the gitRepositoryLink in the format
4980 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
4981 pub git_repository_link: std::string::String,
4982
4983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4984}
4985
4986impl FetchReadWriteTokenRequest {
4987 pub fn new() -> Self {
4988 std::default::Default::default()
4989 }
4990
4991 /// Sets the value of [git_repository_link][crate::model::FetchReadWriteTokenRequest::git_repository_link].
4992 ///
4993 /// # Example
4994 /// ```ignore,no_run
4995 /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenRequest;
4996 /// let x = FetchReadWriteTokenRequest::new().set_git_repository_link("example");
4997 /// ```
4998 pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
4999 mut self,
5000 v: T,
5001 ) -> Self {
5002 self.git_repository_link = v.into();
5003 self
5004 }
5005}
5006
5007impl wkt::message::Message for FetchReadWriteTokenRequest {
5008 fn typename() -> &'static str {
5009 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenRequest"
5010 }
5011}
5012
5013/// Message for fetching SCM read token.
5014#[derive(Clone, Default, PartialEq)]
5015#[non_exhaustive]
5016pub struct FetchReadTokenRequest {
5017 /// Required. The resource name of the gitRepositoryLink in the format
5018 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
5019 pub git_repository_link: std::string::String,
5020
5021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5022}
5023
5024impl FetchReadTokenRequest {
5025 pub fn new() -> Self {
5026 std::default::Default::default()
5027 }
5028
5029 /// Sets the value of [git_repository_link][crate::model::FetchReadTokenRequest::git_repository_link].
5030 ///
5031 /// # Example
5032 /// ```ignore,no_run
5033 /// # use google_cloud_developerconnect_v1::model::FetchReadTokenRequest;
5034 /// let x = FetchReadTokenRequest::new().set_git_repository_link("example");
5035 /// ```
5036 pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
5037 mut self,
5038 v: T,
5039 ) -> Self {
5040 self.git_repository_link = v.into();
5041 self
5042 }
5043}
5044
5045impl wkt::message::Message for FetchReadTokenRequest {
5046 fn typename() -> &'static str {
5047 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenRequest"
5048 }
5049}
5050
5051/// Message for responding to get read token.
5052#[derive(Clone, Default, PartialEq)]
5053#[non_exhaustive]
5054pub struct FetchReadTokenResponse {
5055 /// The token content.
5056 pub token: std::string::String,
5057
5058 /// Expiration timestamp. Can be empty if unknown or non-expiring.
5059 pub expiration_time: std::option::Option<wkt::Timestamp>,
5060
5061 /// The git_username to specify when making a git clone with the
5062 /// token. For example, for GitHub GitRepositoryLinks, this would be
5063 /// "x-access-token"
5064 pub git_username: std::string::String,
5065
5066 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5067}
5068
5069impl FetchReadTokenResponse {
5070 pub fn new() -> Self {
5071 std::default::Default::default()
5072 }
5073
5074 /// Sets the value of [token][crate::model::FetchReadTokenResponse::token].
5075 ///
5076 /// # Example
5077 /// ```ignore,no_run
5078 /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
5079 /// let x = FetchReadTokenResponse::new().set_token("example");
5080 /// ```
5081 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5082 self.token = v.into();
5083 self
5084 }
5085
5086 /// Sets the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
5087 ///
5088 /// # Example
5089 /// ```ignore,no_run
5090 /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
5091 /// use wkt::Timestamp;
5092 /// let x = FetchReadTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
5093 /// ```
5094 pub fn set_expiration_time<T>(mut self, v: T) -> Self
5095 where
5096 T: std::convert::Into<wkt::Timestamp>,
5097 {
5098 self.expiration_time = std::option::Option::Some(v.into());
5099 self
5100 }
5101
5102 /// Sets or clears the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
5103 ///
5104 /// # Example
5105 /// ```ignore,no_run
5106 /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
5107 /// use wkt::Timestamp;
5108 /// let x = FetchReadTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
5109 /// let x = FetchReadTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
5110 /// ```
5111 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
5112 where
5113 T: std::convert::Into<wkt::Timestamp>,
5114 {
5115 self.expiration_time = v.map(|x| x.into());
5116 self
5117 }
5118
5119 /// Sets the value of [git_username][crate::model::FetchReadTokenResponse::git_username].
5120 ///
5121 /// # Example
5122 /// ```ignore,no_run
5123 /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
5124 /// let x = FetchReadTokenResponse::new().set_git_username("example");
5125 /// ```
5126 pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5127 self.git_username = v.into();
5128 self
5129 }
5130}
5131
5132impl wkt::message::Message for FetchReadTokenResponse {
5133 fn typename() -> &'static str {
5134 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenResponse"
5135 }
5136}
5137
5138/// Message for responding to get read/write token.
5139#[derive(Clone, Default, PartialEq)]
5140#[non_exhaustive]
5141pub struct FetchReadWriteTokenResponse {
5142 /// The token content.
5143 pub token: std::string::String,
5144
5145 /// Expiration timestamp. Can be empty if unknown or non-expiring.
5146 pub expiration_time: std::option::Option<wkt::Timestamp>,
5147
5148 /// The git_username to specify when making a git clone with the
5149 /// token. For example, for GitHub GitRepositoryLinks, this would be
5150 /// "x-access-token"
5151 pub git_username: std::string::String,
5152
5153 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5154}
5155
5156impl FetchReadWriteTokenResponse {
5157 pub fn new() -> Self {
5158 std::default::Default::default()
5159 }
5160
5161 /// Sets the value of [token][crate::model::FetchReadWriteTokenResponse::token].
5162 ///
5163 /// # Example
5164 /// ```ignore,no_run
5165 /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
5166 /// let x = FetchReadWriteTokenResponse::new().set_token("example");
5167 /// ```
5168 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5169 self.token = v.into();
5170 self
5171 }
5172
5173 /// Sets the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
5174 ///
5175 /// # Example
5176 /// ```ignore,no_run
5177 /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
5178 /// use wkt::Timestamp;
5179 /// let x = FetchReadWriteTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
5180 /// ```
5181 pub fn set_expiration_time<T>(mut self, v: T) -> Self
5182 where
5183 T: std::convert::Into<wkt::Timestamp>,
5184 {
5185 self.expiration_time = std::option::Option::Some(v.into());
5186 self
5187 }
5188
5189 /// Sets or clears the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
5190 ///
5191 /// # Example
5192 /// ```ignore,no_run
5193 /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
5194 /// use wkt::Timestamp;
5195 /// let x = FetchReadWriteTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
5196 /// let x = FetchReadWriteTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
5197 /// ```
5198 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
5199 where
5200 T: std::convert::Into<wkt::Timestamp>,
5201 {
5202 self.expiration_time = v.map(|x| x.into());
5203 self
5204 }
5205
5206 /// Sets the value of [git_username][crate::model::FetchReadWriteTokenResponse::git_username].
5207 ///
5208 /// # Example
5209 /// ```ignore,no_run
5210 /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
5211 /// let x = FetchReadWriteTokenResponse::new().set_git_username("example");
5212 /// ```
5213 pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5214 self.git_username = v.into();
5215 self
5216 }
5217}
5218
5219impl wkt::message::Message for FetchReadWriteTokenResponse {
5220 fn typename() -> &'static str {
5221 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenResponse"
5222 }
5223}
5224
5225/// Request message for FetchLinkableGitRepositoriesRequest.
5226#[derive(Clone, Default, PartialEq)]
5227#[non_exhaustive]
5228pub struct FetchLinkableGitRepositoriesRequest {
5229 /// Required. The name of the Connection.
5230 /// Format: `projects/*/locations/*/connections/*`.
5231 pub connection: std::string::String,
5232
5233 /// Optional. Number of results to return in the list. Defaults to 20.
5234 pub page_size: i32,
5235
5236 /// Optional. Page start.
5237 pub page_token: std::string::String,
5238
5239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5240}
5241
5242impl FetchLinkableGitRepositoriesRequest {
5243 pub fn new() -> Self {
5244 std::default::Default::default()
5245 }
5246
5247 /// Sets the value of [connection][crate::model::FetchLinkableGitRepositoriesRequest::connection].
5248 ///
5249 /// # Example
5250 /// ```ignore,no_run
5251 /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
5252 /// let x = FetchLinkableGitRepositoriesRequest::new().set_connection("example");
5253 /// ```
5254 pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5255 self.connection = v.into();
5256 self
5257 }
5258
5259 /// Sets the value of [page_size][crate::model::FetchLinkableGitRepositoriesRequest::page_size].
5260 ///
5261 /// # Example
5262 /// ```ignore,no_run
5263 /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
5264 /// let x = FetchLinkableGitRepositoriesRequest::new().set_page_size(42);
5265 /// ```
5266 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5267 self.page_size = v.into();
5268 self
5269 }
5270
5271 /// Sets the value of [page_token][crate::model::FetchLinkableGitRepositoriesRequest::page_token].
5272 ///
5273 /// # Example
5274 /// ```ignore,no_run
5275 /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
5276 /// let x = FetchLinkableGitRepositoriesRequest::new().set_page_token("example");
5277 /// ```
5278 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5279 self.page_token = v.into();
5280 self
5281 }
5282}
5283
5284impl wkt::message::Message for FetchLinkableGitRepositoriesRequest {
5285 fn typename() -> &'static str {
5286 "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest"
5287 }
5288}
5289
5290/// Response message for FetchLinkableGitRepositories.
5291#[derive(Clone, Default, PartialEq)]
5292#[non_exhaustive]
5293pub struct FetchLinkableGitRepositoriesResponse {
5294 /// The git repositories that can be linked to the connection.
5295 pub linkable_git_repositories: std::vec::Vec<crate::model::LinkableGitRepository>,
5296
5297 /// A token identifying a page of results the server should return.
5298 pub next_page_token: std::string::String,
5299
5300 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5301}
5302
5303impl FetchLinkableGitRepositoriesResponse {
5304 pub fn new() -> Self {
5305 std::default::Default::default()
5306 }
5307
5308 /// Sets the value of [linkable_git_repositories][crate::model::FetchLinkableGitRepositoriesResponse::linkable_git_repositories].
5309 ///
5310 /// # Example
5311 /// ```ignore,no_run
5312 /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesResponse;
5313 /// use google_cloud_developerconnect_v1::model::LinkableGitRepository;
5314 /// let x = FetchLinkableGitRepositoriesResponse::new()
5315 /// .set_linkable_git_repositories([
5316 /// LinkableGitRepository::default()/* use setters */,
5317 /// LinkableGitRepository::default()/* use (different) setters */,
5318 /// ]);
5319 /// ```
5320 pub fn set_linkable_git_repositories<T, V>(mut self, v: T) -> Self
5321 where
5322 T: std::iter::IntoIterator<Item = V>,
5323 V: std::convert::Into<crate::model::LinkableGitRepository>,
5324 {
5325 use std::iter::Iterator;
5326 self.linkable_git_repositories = v.into_iter().map(|i| i.into()).collect();
5327 self
5328 }
5329
5330 /// Sets the value of [next_page_token][crate::model::FetchLinkableGitRepositoriesResponse::next_page_token].
5331 ///
5332 /// # Example
5333 /// ```ignore,no_run
5334 /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesResponse;
5335 /// let x = FetchLinkableGitRepositoriesResponse::new().set_next_page_token("example");
5336 /// ```
5337 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5338 self.next_page_token = v.into();
5339 self
5340 }
5341}
5342
5343impl wkt::message::Message for FetchLinkableGitRepositoriesResponse {
5344 fn typename() -> &'static str {
5345 "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesResponse"
5346 }
5347}
5348
5349#[doc(hidden)]
5350impl google_cloud_gax::paginator::internal::PageableResponse
5351 for FetchLinkableGitRepositoriesResponse
5352{
5353 type PageItem = crate::model::LinkableGitRepository;
5354
5355 fn items(self) -> std::vec::Vec<Self::PageItem> {
5356 self.linkable_git_repositories
5357 }
5358
5359 fn next_page_token(&self) -> std::string::String {
5360 use std::clone::Clone;
5361 self.next_page_token.clone()
5362 }
5363}
5364
5365/// LinkableGitRepository represents a git repository that can be linked to a
5366/// connection.
5367#[derive(Clone, Default, PartialEq)]
5368#[non_exhaustive]
5369pub struct LinkableGitRepository {
5370 /// The clone uri of the repository.
5371 pub clone_uri: std::string::String,
5372
5373 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5374}
5375
5376impl LinkableGitRepository {
5377 pub fn new() -> Self {
5378 std::default::Default::default()
5379 }
5380
5381 /// Sets the value of [clone_uri][crate::model::LinkableGitRepository::clone_uri].
5382 ///
5383 /// # Example
5384 /// ```ignore,no_run
5385 /// # use google_cloud_developerconnect_v1::model::LinkableGitRepository;
5386 /// let x = LinkableGitRepository::new().set_clone_uri("example");
5387 /// ```
5388 pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5389 self.clone_uri = v.into();
5390 self
5391 }
5392}
5393
5394impl wkt::message::Message for LinkableGitRepository {
5395 fn typename() -> &'static str {
5396 "type.googleapis.com/google.cloud.developerconnect.v1.LinkableGitRepository"
5397 }
5398}
5399
5400/// Request for fetching github installations.
5401#[derive(Clone, Default, PartialEq)]
5402#[non_exhaustive]
5403pub struct FetchGitHubInstallationsRequest {
5404 /// Required. The resource name of the connection in the format
5405 /// `projects/*/locations/*/connections/*`.
5406 pub connection: std::string::String,
5407
5408 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5409}
5410
5411impl FetchGitHubInstallationsRequest {
5412 pub fn new() -> Self {
5413 std::default::Default::default()
5414 }
5415
5416 /// Sets the value of [connection][crate::model::FetchGitHubInstallationsRequest::connection].
5417 ///
5418 /// # Example
5419 /// ```ignore,no_run
5420 /// # use google_cloud_developerconnect_v1::model::FetchGitHubInstallationsRequest;
5421 /// let x = FetchGitHubInstallationsRequest::new().set_connection("example");
5422 /// ```
5423 pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5424 self.connection = v.into();
5425 self
5426 }
5427}
5428
5429impl wkt::message::Message for FetchGitHubInstallationsRequest {
5430 fn typename() -> &'static str {
5431 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest"
5432 }
5433}
5434
5435/// Response of fetching github installations.
5436#[derive(Clone, Default, PartialEq)]
5437#[non_exhaustive]
5438pub struct FetchGitHubInstallationsResponse {
5439 /// List of installations available to the OAuth user (for github.com)
5440 /// or all the installations (for GitHub enterprise).
5441 pub installations:
5442 std::vec::Vec<crate::model::fetch_git_hub_installations_response::Installation>,
5443
5444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5445}
5446
5447impl FetchGitHubInstallationsResponse {
5448 pub fn new() -> Self {
5449 std::default::Default::default()
5450 }
5451
5452 /// Sets the value of [installations][crate::model::FetchGitHubInstallationsResponse::installations].
5453 ///
5454 /// # Example
5455 /// ```ignore,no_run
5456 /// # use google_cloud_developerconnect_v1::model::FetchGitHubInstallationsResponse;
5457 /// use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
5458 /// let x = FetchGitHubInstallationsResponse::new()
5459 /// .set_installations([
5460 /// Installation::default()/* use setters */,
5461 /// Installation::default()/* use (different) setters */,
5462 /// ]);
5463 /// ```
5464 pub fn set_installations<T, V>(mut self, v: T) -> Self
5465 where
5466 T: std::iter::IntoIterator<Item = V>,
5467 V: std::convert::Into<crate::model::fetch_git_hub_installations_response::Installation>,
5468 {
5469 use std::iter::Iterator;
5470 self.installations = v.into_iter().map(|i| i.into()).collect();
5471 self
5472 }
5473}
5474
5475impl wkt::message::Message for FetchGitHubInstallationsResponse {
5476 fn typename() -> &'static str {
5477 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse"
5478 }
5479}
5480
5481/// Defines additional types related to [FetchGitHubInstallationsResponse].
5482pub mod fetch_git_hub_installations_response {
5483 #[allow(unused_imports)]
5484 use super::*;
5485
5486 /// Represents an installation of the GitHub App.
5487 #[derive(Clone, Default, PartialEq)]
5488 #[non_exhaustive]
5489 pub struct Installation {
5490 /// ID of the installation in GitHub.
5491 pub id: i64,
5492
5493 /// Name of the GitHub user or organization that owns this installation.
5494 pub name: std::string::String,
5495
5496 /// Either "user" or "organization".
5497 pub r#type: std::string::String,
5498
5499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5500 }
5501
5502 impl Installation {
5503 pub fn new() -> Self {
5504 std::default::Default::default()
5505 }
5506
5507 /// Sets the value of [id][crate::model::fetch_git_hub_installations_response::Installation::id].
5508 ///
5509 /// # Example
5510 /// ```ignore,no_run
5511 /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
5512 /// let x = Installation::new().set_id(42);
5513 /// ```
5514 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5515 self.id = v.into();
5516 self
5517 }
5518
5519 /// Sets the value of [name][crate::model::fetch_git_hub_installations_response::Installation::name].
5520 ///
5521 /// # Example
5522 /// ```ignore,no_run
5523 /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
5524 /// let x = Installation::new().set_name("example");
5525 /// ```
5526 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5527 self.name = v.into();
5528 self
5529 }
5530
5531 /// Sets the value of [r#type][crate::model::fetch_git_hub_installations_response::Installation::type].
5532 ///
5533 /// # Example
5534 /// ```ignore,no_run
5535 /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
5536 /// let x = Installation::new().set_type("example");
5537 /// ```
5538 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5539 self.r#type = v.into();
5540 self
5541 }
5542 }
5543
5544 impl wkt::message::Message for Installation {
5545 fn typename() -> &'static str {
5546 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation"
5547 }
5548 }
5549}
5550
5551/// Request for fetching git refs.
5552#[derive(Clone, Default, PartialEq)]
5553#[non_exhaustive]
5554pub struct FetchGitRefsRequest {
5555 /// Required. The resource name of GitRepositoryLink in the format
5556 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
5557 pub git_repository_link: std::string::String,
5558
5559 /// Required. Type of refs to fetch.
5560 pub ref_type: crate::model::fetch_git_refs_request::RefType,
5561
5562 /// Optional. Number of results to return in the list. Default to 20.
5563 pub page_size: i32,
5564
5565 /// Optional. Page start.
5566 pub page_token: std::string::String,
5567
5568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5569}
5570
5571impl FetchGitRefsRequest {
5572 pub fn new() -> Self {
5573 std::default::Default::default()
5574 }
5575
5576 /// Sets the value of [git_repository_link][crate::model::FetchGitRefsRequest::git_repository_link].
5577 ///
5578 /// # Example
5579 /// ```ignore,no_run
5580 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
5581 /// let x = FetchGitRefsRequest::new().set_git_repository_link("example");
5582 /// ```
5583 pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
5584 mut self,
5585 v: T,
5586 ) -> Self {
5587 self.git_repository_link = v.into();
5588 self
5589 }
5590
5591 /// Sets the value of [ref_type][crate::model::FetchGitRefsRequest::ref_type].
5592 ///
5593 /// # Example
5594 /// ```ignore,no_run
5595 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
5596 /// use google_cloud_developerconnect_v1::model::fetch_git_refs_request::RefType;
5597 /// let x0 = FetchGitRefsRequest::new().set_ref_type(RefType::Tag);
5598 /// let x1 = FetchGitRefsRequest::new().set_ref_type(RefType::Branch);
5599 /// ```
5600 pub fn set_ref_type<T: std::convert::Into<crate::model::fetch_git_refs_request::RefType>>(
5601 mut self,
5602 v: T,
5603 ) -> Self {
5604 self.ref_type = v.into();
5605 self
5606 }
5607
5608 /// Sets the value of [page_size][crate::model::FetchGitRefsRequest::page_size].
5609 ///
5610 /// # Example
5611 /// ```ignore,no_run
5612 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
5613 /// let x = FetchGitRefsRequest::new().set_page_size(42);
5614 /// ```
5615 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5616 self.page_size = v.into();
5617 self
5618 }
5619
5620 /// Sets the value of [page_token][crate::model::FetchGitRefsRequest::page_token].
5621 ///
5622 /// # Example
5623 /// ```ignore,no_run
5624 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
5625 /// let x = FetchGitRefsRequest::new().set_page_token("example");
5626 /// ```
5627 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5628 self.page_token = v.into();
5629 self
5630 }
5631}
5632
5633impl wkt::message::Message for FetchGitRefsRequest {
5634 fn typename() -> &'static str {
5635 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsRequest"
5636 }
5637}
5638
5639/// Defines additional types related to [FetchGitRefsRequest].
5640pub mod fetch_git_refs_request {
5641 #[allow(unused_imports)]
5642 use super::*;
5643
5644 /// Type of refs.
5645 ///
5646 /// # Working with unknown values
5647 ///
5648 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5649 /// additional enum variants at any time. Adding new variants is not considered
5650 /// a breaking change. Applications should write their code in anticipation of:
5651 ///
5652 /// - New values appearing in future releases of the client library, **and**
5653 /// - New values received dynamically, without application changes.
5654 ///
5655 /// Please consult the [Working with enums] section in the user guide for some
5656 /// guidelines.
5657 ///
5658 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5659 #[derive(Clone, Debug, PartialEq)]
5660 #[non_exhaustive]
5661 pub enum RefType {
5662 /// No type specified.
5663 Unspecified,
5664 /// To fetch tags.
5665 Tag,
5666 /// To fetch branches.
5667 Branch,
5668 /// If set, the enum was initialized with an unknown value.
5669 ///
5670 /// Applications can examine the value using [RefType::value] or
5671 /// [RefType::name].
5672 UnknownValue(ref_type::UnknownValue),
5673 }
5674
5675 #[doc(hidden)]
5676 pub mod ref_type {
5677 #[allow(unused_imports)]
5678 use super::*;
5679 #[derive(Clone, Debug, PartialEq)]
5680 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5681 }
5682
5683 impl RefType {
5684 /// Gets the enum value.
5685 ///
5686 /// Returns `None` if the enum contains an unknown value deserialized from
5687 /// the string representation of enums.
5688 pub fn value(&self) -> std::option::Option<i32> {
5689 match self {
5690 Self::Unspecified => std::option::Option::Some(0),
5691 Self::Tag => std::option::Option::Some(1),
5692 Self::Branch => std::option::Option::Some(2),
5693 Self::UnknownValue(u) => u.0.value(),
5694 }
5695 }
5696
5697 /// Gets the enum value as a string.
5698 ///
5699 /// Returns `None` if the enum contains an unknown value deserialized from
5700 /// the integer representation of enums.
5701 pub fn name(&self) -> std::option::Option<&str> {
5702 match self {
5703 Self::Unspecified => std::option::Option::Some("REF_TYPE_UNSPECIFIED"),
5704 Self::Tag => std::option::Option::Some("TAG"),
5705 Self::Branch => std::option::Option::Some("BRANCH"),
5706 Self::UnknownValue(u) => u.0.name(),
5707 }
5708 }
5709 }
5710
5711 impl std::default::Default for RefType {
5712 fn default() -> Self {
5713 use std::convert::From;
5714 Self::from(0)
5715 }
5716 }
5717
5718 impl std::fmt::Display for RefType {
5719 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5720 wkt::internal::display_enum(f, self.name(), self.value())
5721 }
5722 }
5723
5724 impl std::convert::From<i32> for RefType {
5725 fn from(value: i32) -> Self {
5726 match value {
5727 0 => Self::Unspecified,
5728 1 => Self::Tag,
5729 2 => Self::Branch,
5730 _ => Self::UnknownValue(ref_type::UnknownValue(
5731 wkt::internal::UnknownEnumValue::Integer(value),
5732 )),
5733 }
5734 }
5735 }
5736
5737 impl std::convert::From<&str> for RefType {
5738 fn from(value: &str) -> Self {
5739 use std::string::ToString;
5740 match value {
5741 "REF_TYPE_UNSPECIFIED" => Self::Unspecified,
5742 "TAG" => Self::Tag,
5743 "BRANCH" => Self::Branch,
5744 _ => Self::UnknownValue(ref_type::UnknownValue(
5745 wkt::internal::UnknownEnumValue::String(value.to_string()),
5746 )),
5747 }
5748 }
5749 }
5750
5751 impl serde::ser::Serialize for RefType {
5752 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5753 where
5754 S: serde::Serializer,
5755 {
5756 match self {
5757 Self::Unspecified => serializer.serialize_i32(0),
5758 Self::Tag => serializer.serialize_i32(1),
5759 Self::Branch => serializer.serialize_i32(2),
5760 Self::UnknownValue(u) => u.0.serialize(serializer),
5761 }
5762 }
5763 }
5764
5765 impl<'de> serde::de::Deserialize<'de> for RefType {
5766 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5767 where
5768 D: serde::Deserializer<'de>,
5769 {
5770 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RefType>::new(
5771 ".google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType",
5772 ))
5773 }
5774 }
5775}
5776
5777/// Response for fetching git refs.
5778#[derive(Clone, Default, PartialEq)]
5779#[non_exhaustive]
5780pub struct FetchGitRefsResponse {
5781 /// Name of the refs fetched.
5782 pub ref_names: std::vec::Vec<std::string::String>,
5783
5784 /// A token identifying a page of results the server should return.
5785 pub next_page_token: std::string::String,
5786
5787 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5788}
5789
5790impl FetchGitRefsResponse {
5791 pub fn new() -> Self {
5792 std::default::Default::default()
5793 }
5794
5795 /// Sets the value of [ref_names][crate::model::FetchGitRefsResponse::ref_names].
5796 ///
5797 /// # Example
5798 /// ```ignore,no_run
5799 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsResponse;
5800 /// let x = FetchGitRefsResponse::new().set_ref_names(["a", "b", "c"]);
5801 /// ```
5802 pub fn set_ref_names<T, V>(mut self, v: T) -> Self
5803 where
5804 T: std::iter::IntoIterator<Item = V>,
5805 V: std::convert::Into<std::string::String>,
5806 {
5807 use std::iter::Iterator;
5808 self.ref_names = v.into_iter().map(|i| i.into()).collect();
5809 self
5810 }
5811
5812 /// Sets the value of [next_page_token][crate::model::FetchGitRefsResponse::next_page_token].
5813 ///
5814 /// # Example
5815 /// ```ignore,no_run
5816 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsResponse;
5817 /// let x = FetchGitRefsResponse::new().set_next_page_token("example");
5818 /// ```
5819 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5820 self.next_page_token = v.into();
5821 self
5822 }
5823}
5824
5825impl wkt::message::Message for FetchGitRefsResponse {
5826 fn typename() -> &'static str {
5827 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsResponse"
5828 }
5829}
5830
5831/// AccountConnector encapsulates what a platform administrator needs to
5832/// configure for users to connect to the service providers, which includes,
5833/// among other fields, the OAuth client ID, client secret, and authorization and
5834/// token endpoints.
5835#[derive(Clone, Default, PartialEq)]
5836#[non_exhaustive]
5837pub struct AccountConnector {
5838 /// Identifier. The resource name of the accountConnector, in the format
5839 /// `projects/{project}/locations/{location}/accountConnectors/{account_connector_id}`.
5840 pub name: std::string::String,
5841
5842 /// Output only. The timestamp when the accountConnector was created.
5843 pub create_time: std::option::Option<wkt::Timestamp>,
5844
5845 /// Output only. The timestamp when the accountConnector was updated.
5846 pub update_time: std::option::Option<wkt::Timestamp>,
5847
5848 /// Optional. Allows users to store small amounts of arbitrary data.
5849 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5850
5851 /// Optional. This checksum is computed by the server based on the value of
5852 /// other fields, and may be sent on update and delete requests to ensure the
5853 /// client has an up-to-date value before proceeding.
5854 pub etag: std::string::String,
5855
5856 /// Optional. Labels as key value pairs
5857 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5858
5859 /// Output only. Start OAuth flow by clicking on this URL.
5860 pub oauth_start_uri: std::string::String,
5861
5862 /// The AccountConnector config.
5863 pub account_connector_config:
5864 std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
5865
5866 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5867}
5868
5869impl AccountConnector {
5870 pub fn new() -> Self {
5871 std::default::Default::default()
5872 }
5873
5874 /// Sets the value of [name][crate::model::AccountConnector::name].
5875 ///
5876 /// # Example
5877 /// ```ignore,no_run
5878 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
5879 /// let x = AccountConnector::new().set_name("example");
5880 /// ```
5881 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5882 self.name = v.into();
5883 self
5884 }
5885
5886 /// Sets the value of [create_time][crate::model::AccountConnector::create_time].
5887 ///
5888 /// # Example
5889 /// ```ignore,no_run
5890 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
5891 /// use wkt::Timestamp;
5892 /// let x = AccountConnector::new().set_create_time(Timestamp::default()/* use setters */);
5893 /// ```
5894 pub fn set_create_time<T>(mut self, v: T) -> Self
5895 where
5896 T: std::convert::Into<wkt::Timestamp>,
5897 {
5898 self.create_time = std::option::Option::Some(v.into());
5899 self
5900 }
5901
5902 /// Sets or clears the value of [create_time][crate::model::AccountConnector::create_time].
5903 ///
5904 /// # Example
5905 /// ```ignore,no_run
5906 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
5907 /// use wkt::Timestamp;
5908 /// let x = AccountConnector::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5909 /// let x = AccountConnector::new().set_or_clear_create_time(None::<Timestamp>);
5910 /// ```
5911 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5912 where
5913 T: std::convert::Into<wkt::Timestamp>,
5914 {
5915 self.create_time = v.map(|x| x.into());
5916 self
5917 }
5918
5919 /// Sets the value of [update_time][crate::model::AccountConnector::update_time].
5920 ///
5921 /// # Example
5922 /// ```ignore,no_run
5923 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
5924 /// use wkt::Timestamp;
5925 /// let x = AccountConnector::new().set_update_time(Timestamp::default()/* use setters */);
5926 /// ```
5927 pub fn set_update_time<T>(mut self, v: T) -> Self
5928 where
5929 T: std::convert::Into<wkt::Timestamp>,
5930 {
5931 self.update_time = std::option::Option::Some(v.into());
5932 self
5933 }
5934
5935 /// Sets or clears the value of [update_time][crate::model::AccountConnector::update_time].
5936 ///
5937 /// # Example
5938 /// ```ignore,no_run
5939 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
5940 /// use wkt::Timestamp;
5941 /// let x = AccountConnector::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5942 /// let x = AccountConnector::new().set_or_clear_update_time(None::<Timestamp>);
5943 /// ```
5944 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5945 where
5946 T: std::convert::Into<wkt::Timestamp>,
5947 {
5948 self.update_time = v.map(|x| x.into());
5949 self
5950 }
5951
5952 /// Sets the value of [annotations][crate::model::AccountConnector::annotations].
5953 ///
5954 /// # Example
5955 /// ```ignore,no_run
5956 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
5957 /// let x = AccountConnector::new().set_annotations([
5958 /// ("key0", "abc"),
5959 /// ("key1", "xyz"),
5960 /// ]);
5961 /// ```
5962 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
5963 where
5964 T: std::iter::IntoIterator<Item = (K, V)>,
5965 K: std::convert::Into<std::string::String>,
5966 V: std::convert::Into<std::string::String>,
5967 {
5968 use std::iter::Iterator;
5969 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5970 self
5971 }
5972
5973 /// Sets the value of [etag][crate::model::AccountConnector::etag].
5974 ///
5975 /// # Example
5976 /// ```ignore,no_run
5977 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
5978 /// let x = AccountConnector::new().set_etag("example");
5979 /// ```
5980 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5981 self.etag = v.into();
5982 self
5983 }
5984
5985 /// Sets the value of [labels][crate::model::AccountConnector::labels].
5986 ///
5987 /// # Example
5988 /// ```ignore,no_run
5989 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
5990 /// let x = AccountConnector::new().set_labels([
5991 /// ("key0", "abc"),
5992 /// ("key1", "xyz"),
5993 /// ]);
5994 /// ```
5995 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5996 where
5997 T: std::iter::IntoIterator<Item = (K, V)>,
5998 K: std::convert::Into<std::string::String>,
5999 V: std::convert::Into<std::string::String>,
6000 {
6001 use std::iter::Iterator;
6002 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6003 self
6004 }
6005
6006 /// Sets the value of [oauth_start_uri][crate::model::AccountConnector::oauth_start_uri].
6007 ///
6008 /// # Example
6009 /// ```ignore,no_run
6010 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
6011 /// let x = AccountConnector::new().set_oauth_start_uri("example");
6012 /// ```
6013 pub fn set_oauth_start_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6014 self.oauth_start_uri = v.into();
6015 self
6016 }
6017
6018 /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config].
6019 ///
6020 /// Note that all the setters affecting `account_connector_config` are mutually
6021 /// exclusive.
6022 ///
6023 /// # Example
6024 /// ```ignore,no_run
6025 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
6026 /// use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
6027 /// let x = AccountConnector::new().set_account_connector_config(Some(
6028 /// google_cloud_developerconnect_v1::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(ProviderOAuthConfig::default().into())));
6029 /// ```
6030 pub fn set_account_connector_config<
6031 T: std::convert::Into<
6032 std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
6033 >,
6034 >(
6035 mut self,
6036 v: T,
6037 ) -> Self {
6038 self.account_connector_config = v.into();
6039 self
6040 }
6041
6042 /// The value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
6043 /// if it holds a `ProviderOauthConfig`, `None` if the field is not set or
6044 /// holds a different branch.
6045 pub fn provider_oauth_config(
6046 &self,
6047 ) -> std::option::Option<&std::boxed::Box<crate::model::ProviderOAuthConfig>> {
6048 #[allow(unreachable_patterns)]
6049 self.account_connector_config
6050 .as_ref()
6051 .and_then(|v| match v {
6052 crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v) => {
6053 std::option::Option::Some(v)
6054 }
6055 _ => std::option::Option::None,
6056 })
6057 }
6058
6059 /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
6060 /// to hold a `ProviderOauthConfig`.
6061 ///
6062 /// Note that all the setters affecting `account_connector_config` are
6063 /// mutually exclusive.
6064 ///
6065 /// # Example
6066 /// ```ignore,no_run
6067 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
6068 /// use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
6069 /// let x = AccountConnector::new().set_provider_oauth_config(ProviderOAuthConfig::default()/* use setters */);
6070 /// assert!(x.provider_oauth_config().is_some());
6071 /// ```
6072 pub fn set_provider_oauth_config<
6073 T: std::convert::Into<std::boxed::Box<crate::model::ProviderOAuthConfig>>,
6074 >(
6075 mut self,
6076 v: T,
6077 ) -> Self {
6078 self.account_connector_config = std::option::Option::Some(
6079 crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v.into()),
6080 );
6081 self
6082 }
6083}
6084
6085impl wkt::message::Message for AccountConnector {
6086 fn typename() -> &'static str {
6087 "type.googleapis.com/google.cloud.developerconnect.v1.AccountConnector"
6088 }
6089}
6090
6091/// Defines additional types related to [AccountConnector].
6092pub mod account_connector {
6093 #[allow(unused_imports)]
6094 use super::*;
6095
6096 /// The AccountConnector config.
6097 #[derive(Clone, Debug, PartialEq)]
6098 #[non_exhaustive]
6099 pub enum AccountConnectorConfig {
6100 /// Provider OAuth config.
6101 ProviderOauthConfig(std::boxed::Box<crate::model::ProviderOAuthConfig>),
6102 }
6103}
6104
6105/// User represents a user connected to the service providers through
6106/// a AccountConnector.
6107#[derive(Clone, Default, PartialEq)]
6108#[non_exhaustive]
6109pub struct User {
6110 /// Identifier. Resource name of the user, in the format
6111 /// `projects/*/locations/*/accountConnectors/*/users/*`.
6112 pub name: std::string::String,
6113
6114 /// Output only. Developer Connect automatically converts user identity
6115 /// to some human readable description, e.g., email address.
6116 pub display_name: std::string::String,
6117
6118 /// Output only. The timestamp when the user was created.
6119 pub create_time: std::option::Option<wkt::Timestamp>,
6120
6121 /// Output only. The timestamp when the token was last requested.
6122 pub last_token_request_time: std::option::Option<wkt::Timestamp>,
6123
6124 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6125}
6126
6127impl User {
6128 pub fn new() -> Self {
6129 std::default::Default::default()
6130 }
6131
6132 /// Sets the value of [name][crate::model::User::name].
6133 ///
6134 /// # Example
6135 /// ```ignore,no_run
6136 /// # use google_cloud_developerconnect_v1::model::User;
6137 /// let x = User::new().set_name("example");
6138 /// ```
6139 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6140 self.name = v.into();
6141 self
6142 }
6143
6144 /// Sets the value of [display_name][crate::model::User::display_name].
6145 ///
6146 /// # Example
6147 /// ```ignore,no_run
6148 /// # use google_cloud_developerconnect_v1::model::User;
6149 /// let x = User::new().set_display_name("example");
6150 /// ```
6151 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6152 self.display_name = v.into();
6153 self
6154 }
6155
6156 /// Sets the value of [create_time][crate::model::User::create_time].
6157 ///
6158 /// # Example
6159 /// ```ignore,no_run
6160 /// # use google_cloud_developerconnect_v1::model::User;
6161 /// use wkt::Timestamp;
6162 /// let x = User::new().set_create_time(Timestamp::default()/* use setters */);
6163 /// ```
6164 pub fn set_create_time<T>(mut self, v: T) -> Self
6165 where
6166 T: std::convert::Into<wkt::Timestamp>,
6167 {
6168 self.create_time = std::option::Option::Some(v.into());
6169 self
6170 }
6171
6172 /// Sets or clears the value of [create_time][crate::model::User::create_time].
6173 ///
6174 /// # Example
6175 /// ```ignore,no_run
6176 /// # use google_cloud_developerconnect_v1::model::User;
6177 /// use wkt::Timestamp;
6178 /// let x = User::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6179 /// let x = User::new().set_or_clear_create_time(None::<Timestamp>);
6180 /// ```
6181 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6182 where
6183 T: std::convert::Into<wkt::Timestamp>,
6184 {
6185 self.create_time = v.map(|x| x.into());
6186 self
6187 }
6188
6189 /// Sets the value of [last_token_request_time][crate::model::User::last_token_request_time].
6190 ///
6191 /// # Example
6192 /// ```ignore,no_run
6193 /// # use google_cloud_developerconnect_v1::model::User;
6194 /// use wkt::Timestamp;
6195 /// let x = User::new().set_last_token_request_time(Timestamp::default()/* use setters */);
6196 /// ```
6197 pub fn set_last_token_request_time<T>(mut self, v: T) -> Self
6198 where
6199 T: std::convert::Into<wkt::Timestamp>,
6200 {
6201 self.last_token_request_time = std::option::Option::Some(v.into());
6202 self
6203 }
6204
6205 /// Sets or clears the value of [last_token_request_time][crate::model::User::last_token_request_time].
6206 ///
6207 /// # Example
6208 /// ```ignore,no_run
6209 /// # use google_cloud_developerconnect_v1::model::User;
6210 /// use wkt::Timestamp;
6211 /// let x = User::new().set_or_clear_last_token_request_time(Some(Timestamp::default()/* use setters */));
6212 /// let x = User::new().set_or_clear_last_token_request_time(None::<Timestamp>);
6213 /// ```
6214 pub fn set_or_clear_last_token_request_time<T>(mut self, v: std::option::Option<T>) -> Self
6215 where
6216 T: std::convert::Into<wkt::Timestamp>,
6217 {
6218 self.last_token_request_time = v.map(|x| x.into());
6219 self
6220 }
6221}
6222
6223impl wkt::message::Message for User {
6224 fn typename() -> &'static str {
6225 "type.googleapis.com/google.cloud.developerconnect.v1.User"
6226 }
6227}
6228
6229/// ProviderOAuthConfig is the OAuth config for a provider.
6230#[derive(Clone, Default, PartialEq)]
6231#[non_exhaustive]
6232pub struct ProviderOAuthConfig {
6233 /// Required. User selected scopes to apply to the Oauth config
6234 /// In the event of changing scopes, user records under AccountConnector will
6235 /// be deleted and users will re-auth again.
6236 pub scopes: std::vec::Vec<std::string::String>,
6237
6238 /// OAuth Provider ID. It could be Developer Connect owned or providers
6239 /// provided.
6240 pub oauth_provider_id:
6241 std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
6242
6243 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6244}
6245
6246impl ProviderOAuthConfig {
6247 pub fn new() -> Self {
6248 std::default::Default::default()
6249 }
6250
6251 /// Sets the value of [scopes][crate::model::ProviderOAuthConfig::scopes].
6252 ///
6253 /// # Example
6254 /// ```ignore,no_run
6255 /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
6256 /// let x = ProviderOAuthConfig::new().set_scopes(["a", "b", "c"]);
6257 /// ```
6258 pub fn set_scopes<T, V>(mut self, v: T) -> Self
6259 where
6260 T: std::iter::IntoIterator<Item = V>,
6261 V: std::convert::Into<std::string::String>,
6262 {
6263 use std::iter::Iterator;
6264 self.scopes = v.into_iter().map(|i| i.into()).collect();
6265 self
6266 }
6267
6268 /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id].
6269 ///
6270 /// Note that all the setters affecting `oauth_provider_id` are mutually
6271 /// exclusive.
6272 ///
6273 /// # Example
6274 /// ```ignore,no_run
6275 /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
6276 /// use google_cloud_developerconnect_v1::model::SystemProvider;
6277 /// let x0 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
6278 /// google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Github)));
6279 /// let x1 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
6280 /// google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Gitlab)));
6281 /// let x2 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
6282 /// google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Google)));
6283 /// ```
6284 pub fn set_oauth_provider_id<
6285 T: std::convert::Into<
6286 std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
6287 >,
6288 >(
6289 mut self,
6290 v: T,
6291 ) -> Self {
6292 self.oauth_provider_id = v.into();
6293 self
6294 }
6295
6296 /// The value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
6297 /// if it holds a `SystemProviderId`, `None` if the field is not set or
6298 /// holds a different branch.
6299 pub fn system_provider_id(&self) -> std::option::Option<&crate::model::SystemProvider> {
6300 #[allow(unreachable_patterns)]
6301 self.oauth_provider_id.as_ref().and_then(|v| match v {
6302 crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v) => {
6303 std::option::Option::Some(v)
6304 }
6305 _ => std::option::Option::None,
6306 })
6307 }
6308
6309 /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
6310 /// to hold a `SystemProviderId`.
6311 ///
6312 /// Note that all the setters affecting `oauth_provider_id` are
6313 /// mutually exclusive.
6314 ///
6315 /// # Example
6316 /// ```ignore,no_run
6317 /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
6318 /// use google_cloud_developerconnect_v1::model::SystemProvider;
6319 /// let x0 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Github);
6320 /// let x1 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Gitlab);
6321 /// let x2 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Google);
6322 /// assert!(x0.system_provider_id().is_some());
6323 /// assert!(x1.system_provider_id().is_some());
6324 /// assert!(x2.system_provider_id().is_some());
6325 /// ```
6326 pub fn set_system_provider_id<T: std::convert::Into<crate::model::SystemProvider>>(
6327 mut self,
6328 v: T,
6329 ) -> Self {
6330 self.oauth_provider_id = std::option::Option::Some(
6331 crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v.into()),
6332 );
6333 self
6334 }
6335}
6336
6337impl wkt::message::Message for ProviderOAuthConfig {
6338 fn typename() -> &'static str {
6339 "type.googleapis.com/google.cloud.developerconnect.v1.ProviderOAuthConfig"
6340 }
6341}
6342
6343/// Defines additional types related to [ProviderOAuthConfig].
6344pub mod provider_o_auth_config {
6345 #[allow(unused_imports)]
6346 use super::*;
6347
6348 /// OAuth Provider ID. It could be Developer Connect owned or providers
6349 /// provided.
6350 #[derive(Clone, Debug, PartialEq)]
6351 #[non_exhaustive]
6352 pub enum OauthProviderId {
6353 /// Immutable. Developer Connect provided OAuth.
6354 SystemProviderId(crate::model::SystemProvider),
6355 }
6356}
6357
6358/// The InsightsConfig resource is the core configuration object to capture
6359/// events from your Software Development Lifecycle. It acts as the central hub
6360/// for managing how Developer connect understands your application, its runtime
6361/// environments, and the artifacts deployed within them.
6362#[derive(Clone, Default, PartialEq)]
6363#[non_exhaustive]
6364pub struct InsightsConfig {
6365 /// Identifier. The name of the InsightsConfig.
6366 /// Format:
6367 /// projects/{project}/locations/{location}/insightsConfigs/{insightsConfig}
6368 pub name: std::string::String,
6369
6370 /// Output only. [Output only] Create timestamp
6371 pub create_time: std::option::Option<wkt::Timestamp>,
6372
6373 /// Output only. [Output only] Update timestamp
6374 pub update_time: std::option::Option<wkt::Timestamp>,
6375
6376 /// Output only. The runtime configurations where the application is deployed.
6377 pub runtime_configs: std::vec::Vec<crate::model::RuntimeConfig>,
6378
6379 /// Optional. The artifact configurations of the artifacts that are deployed.
6380 pub artifact_configs: std::vec::Vec<crate::model::ArtifactConfig>,
6381
6382 /// Optional. Output only. The state of the InsightsConfig.
6383 pub state: crate::model::insights_config::State,
6384
6385 /// Optional. User specified annotations. See
6386 /// <https://google.aip.dev/148#annotations> for more details such as format and
6387 /// size limitations.
6388 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
6389
6390 /// Optional. Set of labels associated with an InsightsConfig.
6391 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6392
6393 /// Output only. Reconciling (<https://google.aip.dev/128#reconciliation>).
6394 /// Set to true if the current state of InsightsConfig does not match the
6395 /// user's intended state, and the service is actively updating the resource to
6396 /// reconcile them. This can happen due to user-triggered updates or
6397 /// system actions like failover or maintenance.
6398 pub reconciling: bool,
6399
6400 /// Output only. Any errors that occurred while setting up the InsightsConfig.
6401 /// Each error will be in the format: `field_name: error_message`, e.g.
6402 /// GetAppHubApplication: Permission denied while getting App Hub
6403 /// application. Please grant permissions to the P4SA.
6404 pub errors: std::vec::Vec<google_cloud_rpc::model::Status>,
6405
6406 /// The context of the InsightsConfig.
6407 pub insights_config_context:
6408 std::option::Option<crate::model::insights_config::InsightsConfigContext>,
6409
6410 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6411}
6412
6413impl InsightsConfig {
6414 pub fn new() -> Self {
6415 std::default::Default::default()
6416 }
6417
6418 /// Sets the value of [name][crate::model::InsightsConfig::name].
6419 ///
6420 /// # Example
6421 /// ```ignore,no_run
6422 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
6423 /// let x = InsightsConfig::new().set_name("example");
6424 /// ```
6425 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6426 self.name = v.into();
6427 self
6428 }
6429
6430 /// Sets the value of [create_time][crate::model::InsightsConfig::create_time].
6431 ///
6432 /// # Example
6433 /// ```ignore,no_run
6434 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
6435 /// use wkt::Timestamp;
6436 /// let x = InsightsConfig::new().set_create_time(Timestamp::default()/* use setters */);
6437 /// ```
6438 pub fn set_create_time<T>(mut self, v: T) -> Self
6439 where
6440 T: std::convert::Into<wkt::Timestamp>,
6441 {
6442 self.create_time = std::option::Option::Some(v.into());
6443 self
6444 }
6445
6446 /// Sets or clears the value of [create_time][crate::model::InsightsConfig::create_time].
6447 ///
6448 /// # Example
6449 /// ```ignore,no_run
6450 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
6451 /// use wkt::Timestamp;
6452 /// let x = InsightsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6453 /// let x = InsightsConfig::new().set_or_clear_create_time(None::<Timestamp>);
6454 /// ```
6455 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6456 where
6457 T: std::convert::Into<wkt::Timestamp>,
6458 {
6459 self.create_time = v.map(|x| x.into());
6460 self
6461 }
6462
6463 /// Sets the value of [update_time][crate::model::InsightsConfig::update_time].
6464 ///
6465 /// # Example
6466 /// ```ignore,no_run
6467 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
6468 /// use wkt::Timestamp;
6469 /// let x = InsightsConfig::new().set_update_time(Timestamp::default()/* use setters */);
6470 /// ```
6471 pub fn set_update_time<T>(mut self, v: T) -> Self
6472 where
6473 T: std::convert::Into<wkt::Timestamp>,
6474 {
6475 self.update_time = std::option::Option::Some(v.into());
6476 self
6477 }
6478
6479 /// Sets or clears the value of [update_time][crate::model::InsightsConfig::update_time].
6480 ///
6481 /// # Example
6482 /// ```ignore,no_run
6483 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
6484 /// use wkt::Timestamp;
6485 /// let x = InsightsConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6486 /// let x = InsightsConfig::new().set_or_clear_update_time(None::<Timestamp>);
6487 /// ```
6488 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6489 where
6490 T: std::convert::Into<wkt::Timestamp>,
6491 {
6492 self.update_time = v.map(|x| x.into());
6493 self
6494 }
6495
6496 /// Sets the value of [runtime_configs][crate::model::InsightsConfig::runtime_configs].
6497 ///
6498 /// # Example
6499 /// ```ignore,no_run
6500 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
6501 /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
6502 /// let x = InsightsConfig::new()
6503 /// .set_runtime_configs([
6504 /// RuntimeConfig::default()/* use setters */,
6505 /// RuntimeConfig::default()/* use (different) setters */,
6506 /// ]);
6507 /// ```
6508 pub fn set_runtime_configs<T, V>(mut self, v: T) -> Self
6509 where
6510 T: std::iter::IntoIterator<Item = V>,
6511 V: std::convert::Into<crate::model::RuntimeConfig>,
6512 {
6513 use std::iter::Iterator;
6514 self.runtime_configs = v.into_iter().map(|i| i.into()).collect();
6515 self
6516 }
6517
6518 /// Sets the value of [artifact_configs][crate::model::InsightsConfig::artifact_configs].
6519 ///
6520 /// # Example
6521 /// ```ignore,no_run
6522 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
6523 /// use google_cloud_developerconnect_v1::model::ArtifactConfig;
6524 /// let x = InsightsConfig::new()
6525 /// .set_artifact_configs([
6526 /// ArtifactConfig::default()/* use setters */,
6527 /// ArtifactConfig::default()/* use (different) setters */,
6528 /// ]);
6529 /// ```
6530 pub fn set_artifact_configs<T, V>(mut self, v: T) -> Self
6531 where
6532 T: std::iter::IntoIterator<Item = V>,
6533 V: std::convert::Into<crate::model::ArtifactConfig>,
6534 {
6535 use std::iter::Iterator;
6536 self.artifact_configs = v.into_iter().map(|i| i.into()).collect();
6537 self
6538 }
6539
6540 /// Sets the value of [state][crate::model::InsightsConfig::state].
6541 ///
6542 /// # Example
6543 /// ```ignore,no_run
6544 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
6545 /// use google_cloud_developerconnect_v1::model::insights_config::State;
6546 /// let x0 = InsightsConfig::new().set_state(State::Pending);
6547 /// let x1 = InsightsConfig::new().set_state(State::Complete);
6548 /// let x2 = InsightsConfig::new().set_state(State::Error);
6549 /// ```
6550 pub fn set_state<T: std::convert::Into<crate::model::insights_config::State>>(
6551 mut self,
6552 v: T,
6553 ) -> Self {
6554 self.state = v.into();
6555 self
6556 }
6557
6558 /// Sets the value of [annotations][crate::model::InsightsConfig::annotations].
6559 ///
6560 /// # Example
6561 /// ```ignore,no_run
6562 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
6563 /// let x = InsightsConfig::new().set_annotations([
6564 /// ("key0", "abc"),
6565 /// ("key1", "xyz"),
6566 /// ]);
6567 /// ```
6568 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
6569 where
6570 T: std::iter::IntoIterator<Item = (K, V)>,
6571 K: std::convert::Into<std::string::String>,
6572 V: std::convert::Into<std::string::String>,
6573 {
6574 use std::iter::Iterator;
6575 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6576 self
6577 }
6578
6579 /// Sets the value of [labels][crate::model::InsightsConfig::labels].
6580 ///
6581 /// # Example
6582 /// ```ignore,no_run
6583 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
6584 /// let x = InsightsConfig::new().set_labels([
6585 /// ("key0", "abc"),
6586 /// ("key1", "xyz"),
6587 /// ]);
6588 /// ```
6589 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6590 where
6591 T: std::iter::IntoIterator<Item = (K, V)>,
6592 K: std::convert::Into<std::string::String>,
6593 V: std::convert::Into<std::string::String>,
6594 {
6595 use std::iter::Iterator;
6596 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6597 self
6598 }
6599
6600 /// Sets the value of [reconciling][crate::model::InsightsConfig::reconciling].
6601 ///
6602 /// # Example
6603 /// ```ignore,no_run
6604 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
6605 /// let x = InsightsConfig::new().set_reconciling(true);
6606 /// ```
6607 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6608 self.reconciling = v.into();
6609 self
6610 }
6611
6612 /// Sets the value of [errors][crate::model::InsightsConfig::errors].
6613 ///
6614 /// # Example
6615 /// ```ignore,no_run
6616 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
6617 /// use google_cloud_rpc::model::Status;
6618 /// let x = InsightsConfig::new()
6619 /// .set_errors([
6620 /// Status::default()/* use setters */,
6621 /// Status::default()/* use (different) setters */,
6622 /// ]);
6623 /// ```
6624 pub fn set_errors<T, V>(mut self, v: T) -> Self
6625 where
6626 T: std::iter::IntoIterator<Item = V>,
6627 V: std::convert::Into<google_cloud_rpc::model::Status>,
6628 {
6629 use std::iter::Iterator;
6630 self.errors = v.into_iter().map(|i| i.into()).collect();
6631 self
6632 }
6633
6634 /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context].
6635 ///
6636 /// Note that all the setters affecting `insights_config_context` are mutually
6637 /// exclusive.
6638 ///
6639 /// # Example
6640 /// ```ignore,no_run
6641 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
6642 /// use google_cloud_developerconnect_v1::model::insights_config::InsightsConfigContext;
6643 /// let x = InsightsConfig::new().set_insights_config_context(Some(InsightsConfigContext::AppHubApplication("example".to_string())));
6644 /// ```
6645 pub fn set_insights_config_context<
6646 T: std::convert::Into<
6647 std::option::Option<crate::model::insights_config::InsightsConfigContext>,
6648 >,
6649 >(
6650 mut self,
6651 v: T,
6652 ) -> Self {
6653 self.insights_config_context = v.into();
6654 self
6655 }
6656
6657 /// The value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
6658 /// if it holds a `AppHubApplication`, `None` if the field is not set or
6659 /// holds a different branch.
6660 pub fn app_hub_application(&self) -> std::option::Option<&std::string::String> {
6661 #[allow(unreachable_patterns)]
6662 self.insights_config_context.as_ref().and_then(|v| match v {
6663 crate::model::insights_config::InsightsConfigContext::AppHubApplication(v) => {
6664 std::option::Option::Some(v)
6665 }
6666 _ => std::option::Option::None,
6667 })
6668 }
6669
6670 /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
6671 /// to hold a `AppHubApplication`.
6672 ///
6673 /// Note that all the setters affecting `insights_config_context` are
6674 /// mutually exclusive.
6675 ///
6676 /// # Example
6677 /// ```ignore,no_run
6678 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
6679 /// let x = InsightsConfig::new().set_app_hub_application("example");
6680 /// assert!(x.app_hub_application().is_some());
6681 /// ```
6682 pub fn set_app_hub_application<T: std::convert::Into<std::string::String>>(
6683 mut self,
6684 v: T,
6685 ) -> Self {
6686 self.insights_config_context = std::option::Option::Some(
6687 crate::model::insights_config::InsightsConfigContext::AppHubApplication(v.into()),
6688 );
6689 self
6690 }
6691}
6692
6693impl wkt::message::Message for InsightsConfig {
6694 fn typename() -> &'static str {
6695 "type.googleapis.com/google.cloud.developerconnect.v1.InsightsConfig"
6696 }
6697}
6698
6699/// Defines additional types related to [InsightsConfig].
6700pub mod insights_config {
6701 #[allow(unused_imports)]
6702 use super::*;
6703
6704 /// The state of the InsightsConfig.
6705 ///
6706 /// # Working with unknown values
6707 ///
6708 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6709 /// additional enum variants at any time. Adding new variants is not considered
6710 /// a breaking change. Applications should write their code in anticipation of:
6711 ///
6712 /// - New values appearing in future releases of the client library, **and**
6713 /// - New values received dynamically, without application changes.
6714 ///
6715 /// Please consult the [Working with enums] section in the user guide for some
6716 /// guidelines.
6717 ///
6718 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6719 #[derive(Clone, Debug, PartialEq)]
6720 #[non_exhaustive]
6721 pub enum State {
6722 /// No state specified.
6723 Unspecified,
6724 /// The InsightsConfig is pending application discovery/runtime discovery.
6725 Pending,
6726 /// The initial discovery process is complete.
6727 Complete,
6728 /// The InsightsConfig is in an error state.
6729 Error,
6730 /// If set, the enum was initialized with an unknown value.
6731 ///
6732 /// Applications can examine the value using [State::value] or
6733 /// [State::name].
6734 UnknownValue(state::UnknownValue),
6735 }
6736
6737 #[doc(hidden)]
6738 pub mod state {
6739 #[allow(unused_imports)]
6740 use super::*;
6741 #[derive(Clone, Debug, PartialEq)]
6742 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6743 }
6744
6745 impl State {
6746 /// Gets the enum value.
6747 ///
6748 /// Returns `None` if the enum contains an unknown value deserialized from
6749 /// the string representation of enums.
6750 pub fn value(&self) -> std::option::Option<i32> {
6751 match self {
6752 Self::Unspecified => std::option::Option::Some(0),
6753 Self::Pending => std::option::Option::Some(5),
6754 Self::Complete => std::option::Option::Some(3),
6755 Self::Error => std::option::Option::Some(4),
6756 Self::UnknownValue(u) => u.0.value(),
6757 }
6758 }
6759
6760 /// Gets the enum value as a string.
6761 ///
6762 /// Returns `None` if the enum contains an unknown value deserialized from
6763 /// the integer representation of enums.
6764 pub fn name(&self) -> std::option::Option<&str> {
6765 match self {
6766 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6767 Self::Pending => std::option::Option::Some("PENDING"),
6768 Self::Complete => std::option::Option::Some("COMPLETE"),
6769 Self::Error => std::option::Option::Some("ERROR"),
6770 Self::UnknownValue(u) => u.0.name(),
6771 }
6772 }
6773 }
6774
6775 impl std::default::Default for State {
6776 fn default() -> Self {
6777 use std::convert::From;
6778 Self::from(0)
6779 }
6780 }
6781
6782 impl std::fmt::Display for State {
6783 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6784 wkt::internal::display_enum(f, self.name(), self.value())
6785 }
6786 }
6787
6788 impl std::convert::From<i32> for State {
6789 fn from(value: i32) -> Self {
6790 match value {
6791 0 => Self::Unspecified,
6792 3 => Self::Complete,
6793 4 => Self::Error,
6794 5 => Self::Pending,
6795 _ => Self::UnknownValue(state::UnknownValue(
6796 wkt::internal::UnknownEnumValue::Integer(value),
6797 )),
6798 }
6799 }
6800 }
6801
6802 impl std::convert::From<&str> for State {
6803 fn from(value: &str) -> Self {
6804 use std::string::ToString;
6805 match value {
6806 "STATE_UNSPECIFIED" => Self::Unspecified,
6807 "PENDING" => Self::Pending,
6808 "COMPLETE" => Self::Complete,
6809 "ERROR" => Self::Error,
6810 _ => Self::UnknownValue(state::UnknownValue(
6811 wkt::internal::UnknownEnumValue::String(value.to_string()),
6812 )),
6813 }
6814 }
6815 }
6816
6817 impl serde::ser::Serialize for State {
6818 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6819 where
6820 S: serde::Serializer,
6821 {
6822 match self {
6823 Self::Unspecified => serializer.serialize_i32(0),
6824 Self::Pending => serializer.serialize_i32(5),
6825 Self::Complete => serializer.serialize_i32(3),
6826 Self::Error => serializer.serialize_i32(4),
6827 Self::UnknownValue(u) => u.0.serialize(serializer),
6828 }
6829 }
6830 }
6831
6832 impl<'de> serde::de::Deserialize<'de> for State {
6833 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6834 where
6835 D: serde::Deserializer<'de>,
6836 {
6837 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6838 ".google.cloud.developerconnect.v1.InsightsConfig.State",
6839 ))
6840 }
6841 }
6842
6843 /// The context of the InsightsConfig.
6844 #[derive(Clone, Debug, PartialEq)]
6845 #[non_exhaustive]
6846 pub enum InsightsConfigContext {
6847 /// Optional. The name of the App Hub Application.
6848 /// Format:
6849 /// projects/{project}/locations/{location}/applications/{application}
6850 AppHubApplication(std::string::String),
6851 }
6852}
6853
6854/// RuntimeConfig represents the runtimes where the application is
6855/// deployed.
6856#[derive(Clone, Default, PartialEq)]
6857#[non_exhaustive]
6858pub struct RuntimeConfig {
6859 /// Required. Immutable. The URI of the runtime configuration.
6860 /// For GKE, this is the cluster name.
6861 /// For Cloud Run, this is the service name.
6862 pub uri: std::string::String,
6863
6864 /// Output only. The state of the Runtime.
6865 pub state: crate::model::runtime_config::State,
6866
6867 /// The type of the runtime.
6868 pub runtime: std::option::Option<crate::model::runtime_config::Runtime>,
6869
6870 /// Where the runtime is derived from.
6871 pub derived_from: std::option::Option<crate::model::runtime_config::DerivedFrom>,
6872
6873 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6874}
6875
6876impl RuntimeConfig {
6877 pub fn new() -> Self {
6878 std::default::Default::default()
6879 }
6880
6881 /// Sets the value of [uri][crate::model::RuntimeConfig::uri].
6882 ///
6883 /// # Example
6884 /// ```ignore,no_run
6885 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
6886 /// let x = RuntimeConfig::new().set_uri("example");
6887 /// ```
6888 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6889 self.uri = v.into();
6890 self
6891 }
6892
6893 /// Sets the value of [state][crate::model::RuntimeConfig::state].
6894 ///
6895 /// # Example
6896 /// ```ignore,no_run
6897 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
6898 /// use google_cloud_developerconnect_v1::model::runtime_config::State;
6899 /// let x0 = RuntimeConfig::new().set_state(State::Linked);
6900 /// let x1 = RuntimeConfig::new().set_state(State::Unlinked);
6901 /// ```
6902 pub fn set_state<T: std::convert::Into<crate::model::runtime_config::State>>(
6903 mut self,
6904 v: T,
6905 ) -> Self {
6906 self.state = v.into();
6907 self
6908 }
6909
6910 /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime].
6911 ///
6912 /// Note that all the setters affecting `runtime` are mutually
6913 /// exclusive.
6914 ///
6915 /// # Example
6916 /// ```ignore,no_run
6917 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
6918 /// use google_cloud_developerconnect_v1::model::GKEWorkload;
6919 /// let x = RuntimeConfig::new().set_runtime(Some(
6920 /// google_cloud_developerconnect_v1::model::runtime_config::Runtime::GkeWorkload(GKEWorkload::default().into())));
6921 /// ```
6922 pub fn set_runtime<
6923 T: std::convert::Into<std::option::Option<crate::model::runtime_config::Runtime>>,
6924 >(
6925 mut self,
6926 v: T,
6927 ) -> Self {
6928 self.runtime = v.into();
6929 self
6930 }
6931
6932 /// The value of [runtime][crate::model::RuntimeConfig::runtime]
6933 /// if it holds a `GkeWorkload`, `None` if the field is not set or
6934 /// holds a different branch.
6935 pub fn gke_workload(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEWorkload>> {
6936 #[allow(unreachable_patterns)]
6937 self.runtime.as_ref().and_then(|v| match v {
6938 crate::model::runtime_config::Runtime::GkeWorkload(v) => std::option::Option::Some(v),
6939 _ => std::option::Option::None,
6940 })
6941 }
6942
6943 /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime]
6944 /// to hold a `GkeWorkload`.
6945 ///
6946 /// Note that all the setters affecting `runtime` are
6947 /// mutually exclusive.
6948 ///
6949 /// # Example
6950 /// ```ignore,no_run
6951 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
6952 /// use google_cloud_developerconnect_v1::model::GKEWorkload;
6953 /// let x = RuntimeConfig::new().set_gke_workload(GKEWorkload::default()/* use setters */);
6954 /// assert!(x.gke_workload().is_some());
6955 /// ```
6956 pub fn set_gke_workload<T: std::convert::Into<std::boxed::Box<crate::model::GKEWorkload>>>(
6957 mut self,
6958 v: T,
6959 ) -> Self {
6960 self.runtime =
6961 std::option::Option::Some(crate::model::runtime_config::Runtime::GkeWorkload(v.into()));
6962 self
6963 }
6964
6965 /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from].
6966 ///
6967 /// Note that all the setters affecting `derived_from` are mutually
6968 /// exclusive.
6969 ///
6970 /// # Example
6971 /// ```ignore,no_run
6972 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
6973 /// use google_cloud_developerconnect_v1::model::AppHubWorkload;
6974 /// let x = RuntimeConfig::new().set_derived_from(Some(
6975 /// google_cloud_developerconnect_v1::model::runtime_config::DerivedFrom::AppHubWorkload(AppHubWorkload::default().into())));
6976 /// ```
6977 pub fn set_derived_from<
6978 T: std::convert::Into<std::option::Option<crate::model::runtime_config::DerivedFrom>>,
6979 >(
6980 mut self,
6981 v: T,
6982 ) -> Self {
6983 self.derived_from = v.into();
6984 self
6985 }
6986
6987 /// The value of [derived_from][crate::model::RuntimeConfig::derived_from]
6988 /// if it holds a `AppHubWorkload`, `None` if the field is not set or
6989 /// holds a different branch.
6990 pub fn app_hub_workload(
6991 &self,
6992 ) -> std::option::Option<&std::boxed::Box<crate::model::AppHubWorkload>> {
6993 #[allow(unreachable_patterns)]
6994 self.derived_from.as_ref().and_then(|v| match v {
6995 crate::model::runtime_config::DerivedFrom::AppHubWorkload(v) => {
6996 std::option::Option::Some(v)
6997 }
6998 _ => std::option::Option::None,
6999 })
7000 }
7001
7002 /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from]
7003 /// to hold a `AppHubWorkload`.
7004 ///
7005 /// Note that all the setters affecting `derived_from` are
7006 /// mutually exclusive.
7007 ///
7008 /// # Example
7009 /// ```ignore,no_run
7010 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
7011 /// use google_cloud_developerconnect_v1::model::AppHubWorkload;
7012 /// let x = RuntimeConfig::new().set_app_hub_workload(AppHubWorkload::default()/* use setters */);
7013 /// assert!(x.app_hub_workload().is_some());
7014 /// ```
7015 pub fn set_app_hub_workload<
7016 T: std::convert::Into<std::boxed::Box<crate::model::AppHubWorkload>>,
7017 >(
7018 mut self,
7019 v: T,
7020 ) -> Self {
7021 self.derived_from = std::option::Option::Some(
7022 crate::model::runtime_config::DerivedFrom::AppHubWorkload(v.into()),
7023 );
7024 self
7025 }
7026}
7027
7028impl wkt::message::Message for RuntimeConfig {
7029 fn typename() -> &'static str {
7030 "type.googleapis.com/google.cloud.developerconnect.v1.RuntimeConfig"
7031 }
7032}
7033
7034/// Defines additional types related to [RuntimeConfig].
7035pub mod runtime_config {
7036 #[allow(unused_imports)]
7037 use super::*;
7038
7039 /// The state of the runtime in the InsightsConfig.
7040 /// Whether the runtime is linked to the InsightsConfig.
7041 ///
7042 /// # Working with unknown values
7043 ///
7044 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7045 /// additional enum variants at any time. Adding new variants is not considered
7046 /// a breaking change. Applications should write their code in anticipation of:
7047 ///
7048 /// - New values appearing in future releases of the client library, **and**
7049 /// - New values received dynamically, without application changes.
7050 ///
7051 /// Please consult the [Working with enums] section in the user guide for some
7052 /// guidelines.
7053 ///
7054 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7055 #[derive(Clone, Debug, PartialEq)]
7056 #[non_exhaustive]
7057 pub enum State {
7058 /// No state specified.
7059 Unspecified,
7060 /// The runtime configuration has been linked to the InsightsConfig.
7061 Linked,
7062 /// The runtime configuration has been unlinked to the InsightsConfig.
7063 Unlinked,
7064 /// If set, the enum was initialized with an unknown value.
7065 ///
7066 /// Applications can examine the value using [State::value] or
7067 /// [State::name].
7068 UnknownValue(state::UnknownValue),
7069 }
7070
7071 #[doc(hidden)]
7072 pub mod state {
7073 #[allow(unused_imports)]
7074 use super::*;
7075 #[derive(Clone, Debug, PartialEq)]
7076 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7077 }
7078
7079 impl State {
7080 /// Gets the enum value.
7081 ///
7082 /// Returns `None` if the enum contains an unknown value deserialized from
7083 /// the string representation of enums.
7084 pub fn value(&self) -> std::option::Option<i32> {
7085 match self {
7086 Self::Unspecified => std::option::Option::Some(0),
7087 Self::Linked => std::option::Option::Some(1),
7088 Self::Unlinked => std::option::Option::Some(2),
7089 Self::UnknownValue(u) => u.0.value(),
7090 }
7091 }
7092
7093 /// Gets the enum value as a string.
7094 ///
7095 /// Returns `None` if the enum contains an unknown value deserialized from
7096 /// the integer representation of enums.
7097 pub fn name(&self) -> std::option::Option<&str> {
7098 match self {
7099 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7100 Self::Linked => std::option::Option::Some("LINKED"),
7101 Self::Unlinked => std::option::Option::Some("UNLINKED"),
7102 Self::UnknownValue(u) => u.0.name(),
7103 }
7104 }
7105 }
7106
7107 impl std::default::Default for State {
7108 fn default() -> Self {
7109 use std::convert::From;
7110 Self::from(0)
7111 }
7112 }
7113
7114 impl std::fmt::Display for State {
7115 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7116 wkt::internal::display_enum(f, self.name(), self.value())
7117 }
7118 }
7119
7120 impl std::convert::From<i32> for State {
7121 fn from(value: i32) -> Self {
7122 match value {
7123 0 => Self::Unspecified,
7124 1 => Self::Linked,
7125 2 => Self::Unlinked,
7126 _ => Self::UnknownValue(state::UnknownValue(
7127 wkt::internal::UnknownEnumValue::Integer(value),
7128 )),
7129 }
7130 }
7131 }
7132
7133 impl std::convert::From<&str> for State {
7134 fn from(value: &str) -> Self {
7135 use std::string::ToString;
7136 match value {
7137 "STATE_UNSPECIFIED" => Self::Unspecified,
7138 "LINKED" => Self::Linked,
7139 "UNLINKED" => Self::Unlinked,
7140 _ => Self::UnknownValue(state::UnknownValue(
7141 wkt::internal::UnknownEnumValue::String(value.to_string()),
7142 )),
7143 }
7144 }
7145 }
7146
7147 impl serde::ser::Serialize for State {
7148 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7149 where
7150 S: serde::Serializer,
7151 {
7152 match self {
7153 Self::Unspecified => serializer.serialize_i32(0),
7154 Self::Linked => serializer.serialize_i32(1),
7155 Self::Unlinked => serializer.serialize_i32(2),
7156 Self::UnknownValue(u) => u.0.serialize(serializer),
7157 }
7158 }
7159 }
7160
7161 impl<'de> serde::de::Deserialize<'de> for State {
7162 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7163 where
7164 D: serde::Deserializer<'de>,
7165 {
7166 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7167 ".google.cloud.developerconnect.v1.RuntimeConfig.State",
7168 ))
7169 }
7170 }
7171
7172 /// The type of the runtime.
7173 #[derive(Clone, Debug, PartialEq)]
7174 #[non_exhaustive]
7175 pub enum Runtime {
7176 /// Output only. Google Kubernetes Engine runtime.
7177 GkeWorkload(std::boxed::Box<crate::model::GKEWorkload>),
7178 }
7179
7180 /// Where the runtime is derived from.
7181 #[derive(Clone, Debug, PartialEq)]
7182 #[non_exhaustive]
7183 pub enum DerivedFrom {
7184 /// Output only. App Hub Workload.
7185 AppHubWorkload(std::boxed::Box<crate::model::AppHubWorkload>),
7186 }
7187}
7188
7189/// GKEWorkload represents the Google Kubernetes Engine runtime.
7190#[derive(Clone, Default, PartialEq)]
7191#[non_exhaustive]
7192pub struct GKEWorkload {
7193 /// Required. Immutable. The name of the GKE cluster.
7194 /// Format:
7195 /// `projects/{project}/locations/{location}/clusters/{cluster}`.
7196 pub cluster: std::string::String,
7197
7198 /// Output only. The name of the GKE deployment.
7199 /// Format:
7200 /// `projects/{project}/locations/{location}/clusters/{cluster}/namespaces/{namespace}/deployments/{deployment}`.
7201 pub deployment: std::string::String,
7202
7203 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7204}
7205
7206impl GKEWorkload {
7207 pub fn new() -> Self {
7208 std::default::Default::default()
7209 }
7210
7211 /// Sets the value of [cluster][crate::model::GKEWorkload::cluster].
7212 ///
7213 /// # Example
7214 /// ```ignore,no_run
7215 /// # use google_cloud_developerconnect_v1::model::GKEWorkload;
7216 /// let x = GKEWorkload::new().set_cluster("example");
7217 /// ```
7218 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7219 self.cluster = v.into();
7220 self
7221 }
7222
7223 /// Sets the value of [deployment][crate::model::GKEWorkload::deployment].
7224 ///
7225 /// # Example
7226 /// ```ignore,no_run
7227 /// # use google_cloud_developerconnect_v1::model::GKEWorkload;
7228 /// let x = GKEWorkload::new().set_deployment("example");
7229 /// ```
7230 pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7231 self.deployment = v.into();
7232 self
7233 }
7234}
7235
7236impl wkt::message::Message for GKEWorkload {
7237 fn typename() -> &'static str {
7238 "type.googleapis.com/google.cloud.developerconnect.v1.GKEWorkload"
7239 }
7240}
7241
7242/// AppHubWorkload represents the App Hub Workload.
7243#[derive(Clone, Default, PartialEq)]
7244#[non_exhaustive]
7245pub struct AppHubWorkload {
7246 /// Required. Output only. Immutable. The name of the App Hub Workload.
7247 /// Format:
7248 /// `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
7249 pub workload: std::string::String,
7250
7251 /// Output only. The criticality of the App Hub Workload.
7252 pub criticality: std::string::String,
7253
7254 /// Output only. The environment of the App Hub Workload.
7255 pub environment: std::string::String,
7256
7257 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7258}
7259
7260impl AppHubWorkload {
7261 pub fn new() -> Self {
7262 std::default::Default::default()
7263 }
7264
7265 /// Sets the value of [workload][crate::model::AppHubWorkload::workload].
7266 ///
7267 /// # Example
7268 /// ```ignore,no_run
7269 /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
7270 /// let x = AppHubWorkload::new().set_workload("example");
7271 /// ```
7272 pub fn set_workload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7273 self.workload = v.into();
7274 self
7275 }
7276
7277 /// Sets the value of [criticality][crate::model::AppHubWorkload::criticality].
7278 ///
7279 /// # Example
7280 /// ```ignore,no_run
7281 /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
7282 /// let x = AppHubWorkload::new().set_criticality("example");
7283 /// ```
7284 pub fn set_criticality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7285 self.criticality = v.into();
7286 self
7287 }
7288
7289 /// Sets the value of [environment][crate::model::AppHubWorkload::environment].
7290 ///
7291 /// # Example
7292 /// ```ignore,no_run
7293 /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
7294 /// let x = AppHubWorkload::new().set_environment("example");
7295 /// ```
7296 pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7297 self.environment = v.into();
7298 self
7299 }
7300}
7301
7302impl wkt::message::Message for AppHubWorkload {
7303 fn typename() -> &'static str {
7304 "type.googleapis.com/google.cloud.developerconnect.v1.AppHubWorkload"
7305 }
7306}
7307
7308/// The artifact config of the artifact that is deployed.
7309#[derive(Clone, Default, PartialEq)]
7310#[non_exhaustive]
7311pub struct ArtifactConfig {
7312 /// Required. Immutable. The URI of the artifact that is deployed.
7313 /// e.g. `us-docker.pkg.dev/my-project/my-repo/image`.
7314 /// The URI does not include the tag / digest because it captures a lineage of
7315 /// artifacts.
7316 pub uri: std::string::String,
7317
7318 /// The storage location of the artifact.
7319 pub artifact_storage: std::option::Option<crate::model::artifact_config::ArtifactStorage>,
7320
7321 /// The storage location of the artifact metadata.
7322 pub artifact_metadata_storage:
7323 std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
7324
7325 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7326}
7327
7328impl ArtifactConfig {
7329 pub fn new() -> Self {
7330 std::default::Default::default()
7331 }
7332
7333 /// Sets the value of [uri][crate::model::ArtifactConfig::uri].
7334 ///
7335 /// # Example
7336 /// ```ignore,no_run
7337 /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
7338 /// let x = ArtifactConfig::new().set_uri("example");
7339 /// ```
7340 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7341 self.uri = v.into();
7342 self
7343 }
7344
7345 /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage].
7346 ///
7347 /// Note that all the setters affecting `artifact_storage` are mutually
7348 /// exclusive.
7349 ///
7350 /// # Example
7351 /// ```ignore,no_run
7352 /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
7353 /// use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
7354 /// let x = ArtifactConfig::new().set_artifact_storage(Some(
7355 /// google_cloud_developerconnect_v1::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(GoogleArtifactRegistry::default().into())));
7356 /// ```
7357 pub fn set_artifact_storage<
7358 T: std::convert::Into<std::option::Option<crate::model::artifact_config::ArtifactStorage>>,
7359 >(
7360 mut self,
7361 v: T,
7362 ) -> Self {
7363 self.artifact_storage = v.into();
7364 self
7365 }
7366
7367 /// The value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
7368 /// if it holds a `GoogleArtifactRegistry`, `None` if the field is not set or
7369 /// holds a different branch.
7370 pub fn google_artifact_registry(
7371 &self,
7372 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactRegistry>> {
7373 #[allow(unreachable_patterns)]
7374 self.artifact_storage.as_ref().and_then(|v| match v {
7375 crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v) => {
7376 std::option::Option::Some(v)
7377 }
7378 _ => std::option::Option::None,
7379 })
7380 }
7381
7382 /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
7383 /// to hold a `GoogleArtifactRegistry`.
7384 ///
7385 /// Note that all the setters affecting `artifact_storage` are
7386 /// mutually exclusive.
7387 ///
7388 /// # Example
7389 /// ```ignore,no_run
7390 /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
7391 /// use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
7392 /// let x = ArtifactConfig::new().set_google_artifact_registry(GoogleArtifactRegistry::default()/* use setters */);
7393 /// assert!(x.google_artifact_registry().is_some());
7394 /// ```
7395 pub fn set_google_artifact_registry<
7396 T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactRegistry>>,
7397 >(
7398 mut self,
7399 v: T,
7400 ) -> Self {
7401 self.artifact_storage = std::option::Option::Some(
7402 crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v.into()),
7403 );
7404 self
7405 }
7406
7407 /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage].
7408 ///
7409 /// Note that all the setters affecting `artifact_metadata_storage` are mutually
7410 /// exclusive.
7411 ///
7412 /// # Example
7413 /// ```ignore,no_run
7414 /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
7415 /// use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
7416 /// let x = ArtifactConfig::new().set_artifact_metadata_storage(Some(
7417 /// google_cloud_developerconnect_v1::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(GoogleArtifactAnalysis::default().into())));
7418 /// ```
7419 pub fn set_artifact_metadata_storage<
7420 T: std::convert::Into<
7421 std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
7422 >,
7423 >(
7424 mut self,
7425 v: T,
7426 ) -> Self {
7427 self.artifact_metadata_storage = v.into();
7428 self
7429 }
7430
7431 /// The value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
7432 /// if it holds a `GoogleArtifactAnalysis`, `None` if the field is not set or
7433 /// holds a different branch.
7434 pub fn google_artifact_analysis(
7435 &self,
7436 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactAnalysis>> {
7437 #[allow(unreachable_patterns)]
7438 self.artifact_metadata_storage
7439 .as_ref()
7440 .and_then(|v| match v {
7441 crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
7442 v,
7443 ) => std::option::Option::Some(v),
7444 _ => std::option::Option::None,
7445 })
7446 }
7447
7448 /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
7449 /// to hold a `GoogleArtifactAnalysis`.
7450 ///
7451 /// Note that all the setters affecting `artifact_metadata_storage` are
7452 /// mutually exclusive.
7453 ///
7454 /// # Example
7455 /// ```ignore,no_run
7456 /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
7457 /// use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
7458 /// let x = ArtifactConfig::new().set_google_artifact_analysis(GoogleArtifactAnalysis::default()/* use setters */);
7459 /// assert!(x.google_artifact_analysis().is_some());
7460 /// ```
7461 pub fn set_google_artifact_analysis<
7462 T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactAnalysis>>,
7463 >(
7464 mut self,
7465 v: T,
7466 ) -> Self {
7467 self.artifact_metadata_storage = std::option::Option::Some(
7468 crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
7469 v.into(),
7470 ),
7471 );
7472 self
7473 }
7474}
7475
7476impl wkt::message::Message for ArtifactConfig {
7477 fn typename() -> &'static str {
7478 "type.googleapis.com/google.cloud.developerconnect.v1.ArtifactConfig"
7479 }
7480}
7481
7482/// Defines additional types related to [ArtifactConfig].
7483pub mod artifact_config {
7484 #[allow(unused_imports)]
7485 use super::*;
7486
7487 /// The storage location of the artifact.
7488 #[derive(Clone, Debug, PartialEq)]
7489 #[non_exhaustive]
7490 pub enum ArtifactStorage {
7491 /// Optional. Set if the artifact is stored in Artifact registry.
7492 GoogleArtifactRegistry(std::boxed::Box<crate::model::GoogleArtifactRegistry>),
7493 }
7494
7495 /// The storage location of the artifact metadata.
7496 #[derive(Clone, Debug, PartialEq)]
7497 #[non_exhaustive]
7498 pub enum ArtifactMetadataStorage {
7499 /// Optional. Set if the artifact metadata is stored in Artifact analysis.
7500 GoogleArtifactAnalysis(std::boxed::Box<crate::model::GoogleArtifactAnalysis>),
7501 }
7502}
7503
7504/// Google Artifact Analysis configurations.
7505#[derive(Clone, Default, PartialEq)]
7506#[non_exhaustive]
7507pub struct GoogleArtifactAnalysis {
7508 /// Required. The project id of the project where the provenance is stored.
7509 pub project_id: std::string::String,
7510
7511 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7512}
7513
7514impl GoogleArtifactAnalysis {
7515 pub fn new() -> Self {
7516 std::default::Default::default()
7517 }
7518
7519 /// Sets the value of [project_id][crate::model::GoogleArtifactAnalysis::project_id].
7520 ///
7521 /// # Example
7522 /// ```ignore,no_run
7523 /// # use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
7524 /// let x = GoogleArtifactAnalysis::new().set_project_id("example");
7525 /// ```
7526 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7527 self.project_id = v.into();
7528 self
7529 }
7530}
7531
7532impl wkt::message::Message for GoogleArtifactAnalysis {
7533 fn typename() -> &'static str {
7534 "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactAnalysis"
7535 }
7536}
7537
7538/// Google Artifact Registry configurations.
7539#[derive(Clone, Default, PartialEq)]
7540#[non_exhaustive]
7541pub struct GoogleArtifactRegistry {
7542 /// Required. The host project of Artifact Registry.
7543 pub project_id: std::string::String,
7544
7545 /// Required. Immutable. The name of the artifact registry package.
7546 pub artifact_registry_package: std::string::String,
7547
7548 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7549}
7550
7551impl GoogleArtifactRegistry {
7552 pub fn new() -> Self {
7553 std::default::Default::default()
7554 }
7555
7556 /// Sets the value of [project_id][crate::model::GoogleArtifactRegistry::project_id].
7557 ///
7558 /// # Example
7559 /// ```ignore,no_run
7560 /// # use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
7561 /// let x = GoogleArtifactRegistry::new().set_project_id("example");
7562 /// ```
7563 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7564 self.project_id = v.into();
7565 self
7566 }
7567
7568 /// Sets the value of [artifact_registry_package][crate::model::GoogleArtifactRegistry::artifact_registry_package].
7569 ///
7570 /// # Example
7571 /// ```ignore,no_run
7572 /// # use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
7573 /// let x = GoogleArtifactRegistry::new().set_artifact_registry_package("example");
7574 /// ```
7575 pub fn set_artifact_registry_package<T: std::convert::Into<std::string::String>>(
7576 mut self,
7577 v: T,
7578 ) -> Self {
7579 self.artifact_registry_package = v.into();
7580 self
7581 }
7582}
7583
7584impl wkt::message::Message for GoogleArtifactRegistry {
7585 fn typename() -> &'static str {
7586 "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactRegistry"
7587 }
7588}
7589
7590/// Request for creating an InsightsConfig.
7591#[derive(Clone, Default, PartialEq)]
7592#[non_exhaustive]
7593pub struct CreateInsightsConfigRequest {
7594 /// Required. Value for parent.
7595 pub parent: std::string::String,
7596
7597 /// Required. ID of the requesting InsightsConfig.
7598 pub insights_config_id: std::string::String,
7599
7600 /// Required. The resource being created.
7601 pub insights_config: std::option::Option<crate::model::InsightsConfig>,
7602
7603 /// Optional. If set, validate the request, but do not actually post it.
7604 pub validate_only: bool,
7605
7606 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7607}
7608
7609impl CreateInsightsConfigRequest {
7610 pub fn new() -> Self {
7611 std::default::Default::default()
7612 }
7613
7614 /// Sets the value of [parent][crate::model::CreateInsightsConfigRequest::parent].
7615 ///
7616 /// # Example
7617 /// ```ignore,no_run
7618 /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
7619 /// let x = CreateInsightsConfigRequest::new().set_parent("example");
7620 /// ```
7621 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7622 self.parent = v.into();
7623 self
7624 }
7625
7626 /// Sets the value of [insights_config_id][crate::model::CreateInsightsConfigRequest::insights_config_id].
7627 ///
7628 /// # Example
7629 /// ```ignore,no_run
7630 /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
7631 /// let x = CreateInsightsConfigRequest::new().set_insights_config_id("example");
7632 /// ```
7633 pub fn set_insights_config_id<T: std::convert::Into<std::string::String>>(
7634 mut self,
7635 v: T,
7636 ) -> Self {
7637 self.insights_config_id = v.into();
7638 self
7639 }
7640
7641 /// Sets the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
7642 ///
7643 /// # Example
7644 /// ```ignore,no_run
7645 /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
7646 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
7647 /// let x = CreateInsightsConfigRequest::new().set_insights_config(InsightsConfig::default()/* use setters */);
7648 /// ```
7649 pub fn set_insights_config<T>(mut self, v: T) -> Self
7650 where
7651 T: std::convert::Into<crate::model::InsightsConfig>,
7652 {
7653 self.insights_config = std::option::Option::Some(v.into());
7654 self
7655 }
7656
7657 /// Sets or clears the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
7658 ///
7659 /// # Example
7660 /// ```ignore,no_run
7661 /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
7662 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
7663 /// let x = CreateInsightsConfigRequest::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
7664 /// let x = CreateInsightsConfigRequest::new().set_or_clear_insights_config(None::<InsightsConfig>);
7665 /// ```
7666 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
7667 where
7668 T: std::convert::Into<crate::model::InsightsConfig>,
7669 {
7670 self.insights_config = v.map(|x| x.into());
7671 self
7672 }
7673
7674 /// Sets the value of [validate_only][crate::model::CreateInsightsConfigRequest::validate_only].
7675 ///
7676 /// # Example
7677 /// ```ignore,no_run
7678 /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
7679 /// let x = CreateInsightsConfigRequest::new().set_validate_only(true);
7680 /// ```
7681 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7682 self.validate_only = v.into();
7683 self
7684 }
7685}
7686
7687impl wkt::message::Message for CreateInsightsConfigRequest {
7688 fn typename() -> &'static str {
7689 "type.googleapis.com/google.cloud.developerconnect.v1.CreateInsightsConfigRequest"
7690 }
7691}
7692
7693/// Request for getting an InsightsConfig.
7694#[derive(Clone, Default, PartialEq)]
7695#[non_exhaustive]
7696pub struct GetInsightsConfigRequest {
7697 /// Required. Name of the resource.
7698 pub name: std::string::String,
7699
7700 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7701}
7702
7703impl GetInsightsConfigRequest {
7704 pub fn new() -> Self {
7705 std::default::Default::default()
7706 }
7707
7708 /// Sets the value of [name][crate::model::GetInsightsConfigRequest::name].
7709 ///
7710 /// # Example
7711 /// ```ignore,no_run
7712 /// # use google_cloud_developerconnect_v1::model::GetInsightsConfigRequest;
7713 /// let x = GetInsightsConfigRequest::new().set_name("example");
7714 /// ```
7715 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7716 self.name = v.into();
7717 self
7718 }
7719}
7720
7721impl wkt::message::Message for GetInsightsConfigRequest {
7722 fn typename() -> &'static str {
7723 "type.googleapis.com/google.cloud.developerconnect.v1.GetInsightsConfigRequest"
7724 }
7725}
7726
7727/// Request for requesting list of InsightsConfigs.
7728#[derive(Clone, Default, PartialEq)]
7729#[non_exhaustive]
7730pub struct ListInsightsConfigsRequest {
7731 /// Required. Parent value for ListInsightsConfigsRequest.
7732 pub parent: std::string::String,
7733
7734 /// Optional. Requested page size. Server may return fewer items than
7735 /// requested. If unspecified, server will pick an appropriate default.
7736 pub page_size: i32,
7737
7738 /// Optional. A token identifying a page of results the server should return.
7739 pub page_token: std::string::String,
7740
7741 /// Optional. Filtering results. See <https://google.aip.dev/160> for more
7742 /// details. Filter string, adhering to the rules in
7743 /// <https://google.aip.dev/160>. List only InsightsConfigs matching the filter.
7744 /// If filter is empty, all InsightsConfigs are listed.
7745 pub filter: std::string::String,
7746
7747 /// Optional. Hint for how to order the results.
7748 pub order_by: std::string::String,
7749
7750 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7751}
7752
7753impl ListInsightsConfigsRequest {
7754 pub fn new() -> Self {
7755 std::default::Default::default()
7756 }
7757
7758 /// Sets the value of [parent][crate::model::ListInsightsConfigsRequest::parent].
7759 ///
7760 /// # Example
7761 /// ```ignore,no_run
7762 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
7763 /// let x = ListInsightsConfigsRequest::new().set_parent("example");
7764 /// ```
7765 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7766 self.parent = v.into();
7767 self
7768 }
7769
7770 /// Sets the value of [page_size][crate::model::ListInsightsConfigsRequest::page_size].
7771 ///
7772 /// # Example
7773 /// ```ignore,no_run
7774 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
7775 /// let x = ListInsightsConfigsRequest::new().set_page_size(42);
7776 /// ```
7777 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7778 self.page_size = v.into();
7779 self
7780 }
7781
7782 /// Sets the value of [page_token][crate::model::ListInsightsConfigsRequest::page_token].
7783 ///
7784 /// # Example
7785 /// ```ignore,no_run
7786 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
7787 /// let x = ListInsightsConfigsRequest::new().set_page_token("example");
7788 /// ```
7789 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7790 self.page_token = v.into();
7791 self
7792 }
7793
7794 /// Sets the value of [filter][crate::model::ListInsightsConfigsRequest::filter].
7795 ///
7796 /// # Example
7797 /// ```ignore,no_run
7798 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
7799 /// let x = ListInsightsConfigsRequest::new().set_filter("example");
7800 /// ```
7801 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7802 self.filter = v.into();
7803 self
7804 }
7805
7806 /// Sets the value of [order_by][crate::model::ListInsightsConfigsRequest::order_by].
7807 ///
7808 /// # Example
7809 /// ```ignore,no_run
7810 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
7811 /// let x = ListInsightsConfigsRequest::new().set_order_by("example");
7812 /// ```
7813 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7814 self.order_by = v.into();
7815 self
7816 }
7817}
7818
7819impl wkt::message::Message for ListInsightsConfigsRequest {
7820 fn typename() -> &'static str {
7821 "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsRequest"
7822 }
7823}
7824
7825/// Request for response to listing InsightsConfigs.
7826#[derive(Clone, Default, PartialEq)]
7827#[non_exhaustive]
7828pub struct ListInsightsConfigsResponse {
7829 /// The list of InsightsConfigs.
7830 pub insights_configs: std::vec::Vec<crate::model::InsightsConfig>,
7831
7832 /// A token identifying a page of results the server should return.
7833 pub next_page_token: std::string::String,
7834
7835 /// Locations that could not be reached.
7836 pub unreachable: std::vec::Vec<std::string::String>,
7837
7838 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7839}
7840
7841impl ListInsightsConfigsResponse {
7842 pub fn new() -> Self {
7843 std::default::Default::default()
7844 }
7845
7846 /// Sets the value of [insights_configs][crate::model::ListInsightsConfigsResponse::insights_configs].
7847 ///
7848 /// # Example
7849 /// ```ignore,no_run
7850 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
7851 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
7852 /// let x = ListInsightsConfigsResponse::new()
7853 /// .set_insights_configs([
7854 /// InsightsConfig::default()/* use setters */,
7855 /// InsightsConfig::default()/* use (different) setters */,
7856 /// ]);
7857 /// ```
7858 pub fn set_insights_configs<T, V>(mut self, v: T) -> Self
7859 where
7860 T: std::iter::IntoIterator<Item = V>,
7861 V: std::convert::Into<crate::model::InsightsConfig>,
7862 {
7863 use std::iter::Iterator;
7864 self.insights_configs = v.into_iter().map(|i| i.into()).collect();
7865 self
7866 }
7867
7868 /// Sets the value of [next_page_token][crate::model::ListInsightsConfigsResponse::next_page_token].
7869 ///
7870 /// # Example
7871 /// ```ignore,no_run
7872 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
7873 /// let x = ListInsightsConfigsResponse::new().set_next_page_token("example");
7874 /// ```
7875 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7876 self.next_page_token = v.into();
7877 self
7878 }
7879
7880 /// Sets the value of [unreachable][crate::model::ListInsightsConfigsResponse::unreachable].
7881 ///
7882 /// # Example
7883 /// ```ignore,no_run
7884 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
7885 /// let x = ListInsightsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
7886 /// ```
7887 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7888 where
7889 T: std::iter::IntoIterator<Item = V>,
7890 V: std::convert::Into<std::string::String>,
7891 {
7892 use std::iter::Iterator;
7893 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7894 self
7895 }
7896}
7897
7898impl wkt::message::Message for ListInsightsConfigsResponse {
7899 fn typename() -> &'static str {
7900 "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsResponse"
7901 }
7902}
7903
7904#[doc(hidden)]
7905impl google_cloud_gax::paginator::internal::PageableResponse for ListInsightsConfigsResponse {
7906 type PageItem = crate::model::InsightsConfig;
7907
7908 fn items(self) -> std::vec::Vec<Self::PageItem> {
7909 self.insights_configs
7910 }
7911
7912 fn next_page_token(&self) -> std::string::String {
7913 use std::clone::Clone;
7914 self.next_page_token.clone()
7915 }
7916}
7917
7918/// Request for deleting an InsightsConfig.
7919#[derive(Clone, Default, PartialEq)]
7920#[non_exhaustive]
7921pub struct DeleteInsightsConfigRequest {
7922 /// Required. Value for parent.
7923 pub name: std::string::String,
7924
7925 /// Optional. An optional request ID to identify requests. Specify a unique
7926 /// request ID so that if you must retry your request, the server will know to
7927 /// ignore the request if it has already been completed. The server will
7928 /// guarantee that for at least 60 minutes after the first request.
7929 ///
7930 /// For example, consider a situation where you make an initial request and the
7931 /// request times out. If you make the request again with the same request
7932 /// ID, the server can check if original operation with the same request ID
7933 /// was received, and if so, will ignore the second request. This prevents
7934 /// clients from accidentally creating duplicate commitments.
7935 ///
7936 /// The request ID must be a valid UUID with the exception that zero UUID is
7937 /// not supported (00000000-0000-0000-0000-000000000000).
7938 pub request_id: std::string::String,
7939
7940 /// Optional. If set, validate the request, but do not actually post it.
7941 pub validate_only: bool,
7942
7943 /// Optional. This checksum is computed by the server based on the value of
7944 /// other fields, and may be sent on update and delete requests to ensure the
7945 /// client has an up-to-date value before proceeding.
7946 pub etag: std::string::String,
7947
7948 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7949}
7950
7951impl DeleteInsightsConfigRequest {
7952 pub fn new() -> Self {
7953 std::default::Default::default()
7954 }
7955
7956 /// Sets the value of [name][crate::model::DeleteInsightsConfigRequest::name].
7957 ///
7958 /// # Example
7959 /// ```ignore,no_run
7960 /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
7961 /// let x = DeleteInsightsConfigRequest::new().set_name("example");
7962 /// ```
7963 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7964 self.name = v.into();
7965 self
7966 }
7967
7968 /// Sets the value of [request_id][crate::model::DeleteInsightsConfigRequest::request_id].
7969 ///
7970 /// # Example
7971 /// ```ignore,no_run
7972 /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
7973 /// let x = DeleteInsightsConfigRequest::new().set_request_id("example");
7974 /// ```
7975 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7976 self.request_id = v.into();
7977 self
7978 }
7979
7980 /// Sets the value of [validate_only][crate::model::DeleteInsightsConfigRequest::validate_only].
7981 ///
7982 /// # Example
7983 /// ```ignore,no_run
7984 /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
7985 /// let x = DeleteInsightsConfigRequest::new().set_validate_only(true);
7986 /// ```
7987 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7988 self.validate_only = v.into();
7989 self
7990 }
7991
7992 /// Sets the value of [etag][crate::model::DeleteInsightsConfigRequest::etag].
7993 ///
7994 /// # Example
7995 /// ```ignore,no_run
7996 /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
7997 /// let x = DeleteInsightsConfigRequest::new().set_etag("example");
7998 /// ```
7999 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8000 self.etag = v.into();
8001 self
8002 }
8003}
8004
8005impl wkt::message::Message for DeleteInsightsConfigRequest {
8006 fn typename() -> &'static str {
8007 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteInsightsConfigRequest"
8008 }
8009}
8010
8011/// Request for updating an InsightsConfig.
8012#[derive(Clone, Default, PartialEq)]
8013#[non_exhaustive]
8014pub struct UpdateInsightsConfigRequest {
8015 /// Required. The resource being updated.
8016 pub insights_config: std::option::Option<crate::model::InsightsConfig>,
8017
8018 /// Optional. An optional request ID to identify requests. Specify a unique
8019 /// request ID so that if you must retry your request, the server will know to
8020 /// ignore the request if it has already been completed. The server will
8021 /// guarantee that for at least 60 minutes after the first request.
8022 ///
8023 /// For example, consider a situation where you make an initial request and the
8024 /// request times out. If you make the request again with the same request
8025 /// ID, the server can check if original operation with the same request ID
8026 /// was received, and if so, will ignore the second request. This prevents
8027 /// clients from accidentally creating duplicate commitments.
8028 ///
8029 /// The request ID must be a valid UUID with the exception that zero UUID is
8030 /// not supported (00000000-0000-0000-0000-000000000000).
8031 pub request_id: std::string::String,
8032
8033 /// Optional. If set to true, and the insightsConfig is not found a new
8034 /// insightsConfig will be created. In this situation `update_mask` is ignored.
8035 /// The creation will succeed only if the input insightsConfig has all the
8036 /// necessary information (e.g a github_config with both user_oauth_token and
8037 /// installation_id properties).
8038 pub allow_missing: bool,
8039
8040 /// Optional. If set, validate the request, but do not actually post it.
8041 pub validate_only: bool,
8042
8043 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8044}
8045
8046impl UpdateInsightsConfigRequest {
8047 pub fn new() -> Self {
8048 std::default::Default::default()
8049 }
8050
8051 /// Sets the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
8052 ///
8053 /// # Example
8054 /// ```ignore,no_run
8055 /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
8056 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
8057 /// let x = UpdateInsightsConfigRequest::new().set_insights_config(InsightsConfig::default()/* use setters */);
8058 /// ```
8059 pub fn set_insights_config<T>(mut self, v: T) -> Self
8060 where
8061 T: std::convert::Into<crate::model::InsightsConfig>,
8062 {
8063 self.insights_config = std::option::Option::Some(v.into());
8064 self
8065 }
8066
8067 /// Sets or clears the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
8068 ///
8069 /// # Example
8070 /// ```ignore,no_run
8071 /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
8072 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
8073 /// let x = UpdateInsightsConfigRequest::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
8074 /// let x = UpdateInsightsConfigRequest::new().set_or_clear_insights_config(None::<InsightsConfig>);
8075 /// ```
8076 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
8077 where
8078 T: std::convert::Into<crate::model::InsightsConfig>,
8079 {
8080 self.insights_config = v.map(|x| x.into());
8081 self
8082 }
8083
8084 /// Sets the value of [request_id][crate::model::UpdateInsightsConfigRequest::request_id].
8085 ///
8086 /// # Example
8087 /// ```ignore,no_run
8088 /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
8089 /// let x = UpdateInsightsConfigRequest::new().set_request_id("example");
8090 /// ```
8091 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8092 self.request_id = v.into();
8093 self
8094 }
8095
8096 /// Sets the value of [allow_missing][crate::model::UpdateInsightsConfigRequest::allow_missing].
8097 ///
8098 /// # Example
8099 /// ```ignore,no_run
8100 /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
8101 /// let x = UpdateInsightsConfigRequest::new().set_allow_missing(true);
8102 /// ```
8103 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8104 self.allow_missing = v.into();
8105 self
8106 }
8107
8108 /// Sets the value of [validate_only][crate::model::UpdateInsightsConfigRequest::validate_only].
8109 ///
8110 /// # Example
8111 /// ```ignore,no_run
8112 /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
8113 /// let x = UpdateInsightsConfigRequest::new().set_validate_only(true);
8114 /// ```
8115 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8116 self.validate_only = v.into();
8117 self
8118 }
8119}
8120
8121impl wkt::message::Message for UpdateInsightsConfigRequest {
8122 fn typename() -> &'static str {
8123 "type.googleapis.com/google.cloud.developerconnect.v1.UpdateInsightsConfigRequest"
8124 }
8125}
8126
8127/// SystemProvider is a list of providers that are owned by Developer Connect.
8128///
8129/// # Working with unknown values
8130///
8131/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8132/// additional enum variants at any time. Adding new variants is not considered
8133/// a breaking change. Applications should write their code in anticipation of:
8134///
8135/// - New values appearing in future releases of the client library, **and**
8136/// - New values received dynamically, without application changes.
8137///
8138/// Please consult the [Working with enums] section in the user guide for some
8139/// guidelines.
8140///
8141/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8142#[derive(Clone, Debug, PartialEq)]
8143#[non_exhaustive]
8144pub enum SystemProvider {
8145 /// No system provider specified.
8146 Unspecified,
8147 /// GitHub provider.
8148 /// Scopes can be found at
8149 /// <https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes>
8150 Github,
8151 /// GitLab provider.
8152 /// Scopes can be found at
8153 /// <https://docs.gitlab.com/user/profile/personal_access_tokens/#personal-access-token-scopes>
8154 Gitlab,
8155 /// Google provider.
8156 /// Recommended scopes:
8157 /// `https://www.googleapis.com/auth/drive.readonly`,
8158 /// `https://www.googleapis.com/auth/documents.readonly`
8159 Google,
8160 /// Sentry provider.
8161 /// Scopes can be found at
8162 /// <https://docs.sentry.io/api/permissions/>
8163 Sentry,
8164 /// Rovo provider.
8165 /// Must select the "rovo" scope.
8166 Rovo,
8167 /// New Relic provider.
8168 /// No scopes are allowed.
8169 NewRelic,
8170 /// Datastax provider.
8171 /// No scopes are allowed.
8172 Datastax,
8173 /// Dynatrace provider.
8174 Dynatrace,
8175 /// If set, the enum was initialized with an unknown value.
8176 ///
8177 /// Applications can examine the value using [SystemProvider::value] or
8178 /// [SystemProvider::name].
8179 UnknownValue(system_provider::UnknownValue),
8180}
8181
8182#[doc(hidden)]
8183pub mod system_provider {
8184 #[allow(unused_imports)]
8185 use super::*;
8186 #[derive(Clone, Debug, PartialEq)]
8187 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8188}
8189
8190impl SystemProvider {
8191 /// Gets the enum value.
8192 ///
8193 /// Returns `None` if the enum contains an unknown value deserialized from
8194 /// the string representation of enums.
8195 pub fn value(&self) -> std::option::Option<i32> {
8196 match self {
8197 Self::Unspecified => std::option::Option::Some(0),
8198 Self::Github => std::option::Option::Some(1),
8199 Self::Gitlab => std::option::Option::Some(2),
8200 Self::Google => std::option::Option::Some(3),
8201 Self::Sentry => std::option::Option::Some(4),
8202 Self::Rovo => std::option::Option::Some(5),
8203 Self::NewRelic => std::option::Option::Some(6),
8204 Self::Datastax => std::option::Option::Some(7),
8205 Self::Dynatrace => std::option::Option::Some(8),
8206 Self::UnknownValue(u) => u.0.value(),
8207 }
8208 }
8209
8210 /// Gets the enum value as a string.
8211 ///
8212 /// Returns `None` if the enum contains an unknown value deserialized from
8213 /// the integer representation of enums.
8214 pub fn name(&self) -> std::option::Option<&str> {
8215 match self {
8216 Self::Unspecified => std::option::Option::Some("SYSTEM_PROVIDER_UNSPECIFIED"),
8217 Self::Github => std::option::Option::Some("GITHUB"),
8218 Self::Gitlab => std::option::Option::Some("GITLAB"),
8219 Self::Google => std::option::Option::Some("GOOGLE"),
8220 Self::Sentry => std::option::Option::Some("SENTRY"),
8221 Self::Rovo => std::option::Option::Some("ROVO"),
8222 Self::NewRelic => std::option::Option::Some("NEW_RELIC"),
8223 Self::Datastax => std::option::Option::Some("DATASTAX"),
8224 Self::Dynatrace => std::option::Option::Some("DYNATRACE"),
8225 Self::UnknownValue(u) => u.0.name(),
8226 }
8227 }
8228}
8229
8230impl std::default::Default for SystemProvider {
8231 fn default() -> Self {
8232 use std::convert::From;
8233 Self::from(0)
8234 }
8235}
8236
8237impl std::fmt::Display for SystemProvider {
8238 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8239 wkt::internal::display_enum(f, self.name(), self.value())
8240 }
8241}
8242
8243impl std::convert::From<i32> for SystemProvider {
8244 fn from(value: i32) -> Self {
8245 match value {
8246 0 => Self::Unspecified,
8247 1 => Self::Github,
8248 2 => Self::Gitlab,
8249 3 => Self::Google,
8250 4 => Self::Sentry,
8251 5 => Self::Rovo,
8252 6 => Self::NewRelic,
8253 7 => Self::Datastax,
8254 8 => Self::Dynatrace,
8255 _ => Self::UnknownValue(system_provider::UnknownValue(
8256 wkt::internal::UnknownEnumValue::Integer(value),
8257 )),
8258 }
8259 }
8260}
8261
8262impl std::convert::From<&str> for SystemProvider {
8263 fn from(value: &str) -> Self {
8264 use std::string::ToString;
8265 match value {
8266 "SYSTEM_PROVIDER_UNSPECIFIED" => Self::Unspecified,
8267 "GITHUB" => Self::Github,
8268 "GITLAB" => Self::Gitlab,
8269 "GOOGLE" => Self::Google,
8270 "SENTRY" => Self::Sentry,
8271 "ROVO" => Self::Rovo,
8272 "NEW_RELIC" => Self::NewRelic,
8273 "DATASTAX" => Self::Datastax,
8274 "DYNATRACE" => Self::Dynatrace,
8275 _ => Self::UnknownValue(system_provider::UnknownValue(
8276 wkt::internal::UnknownEnumValue::String(value.to_string()),
8277 )),
8278 }
8279 }
8280}
8281
8282impl serde::ser::Serialize for SystemProvider {
8283 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8284 where
8285 S: serde::Serializer,
8286 {
8287 match self {
8288 Self::Unspecified => serializer.serialize_i32(0),
8289 Self::Github => serializer.serialize_i32(1),
8290 Self::Gitlab => serializer.serialize_i32(2),
8291 Self::Google => serializer.serialize_i32(3),
8292 Self::Sentry => serializer.serialize_i32(4),
8293 Self::Rovo => serializer.serialize_i32(5),
8294 Self::NewRelic => serializer.serialize_i32(6),
8295 Self::Datastax => serializer.serialize_i32(7),
8296 Self::Dynatrace => serializer.serialize_i32(8),
8297 Self::UnknownValue(u) => u.0.serialize(serializer),
8298 }
8299 }
8300}
8301
8302impl<'de> serde::de::Deserialize<'de> for SystemProvider {
8303 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8304 where
8305 D: serde::Deserializer<'de>,
8306 {
8307 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SystemProvider>::new(
8308 ".google.cloud.developerconnect.v1.SystemProvider",
8309 ))
8310 }
8311}