google_cloud_developerconnect_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_location;
27extern crate google_cloud_longrunning;
28extern crate google_cloud_lro;
29extern crate google_cloud_rpc;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// Message for requesting a list of Users
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct ListUsersRequest {
45 /// Required. Parent value for ListUsersRequest
46 pub parent: std::string::String,
47
48 /// Optional. Requested page size. Server may return fewer items than
49 /// requested. If unspecified, server will pick an appropriate default.
50 pub page_size: i32,
51
52 /// Optional. A token identifying a page of results the server should return.
53 pub page_token: std::string::String,
54
55 /// Optional. Filtering results
56 pub filter: std::string::String,
57
58 /// Optional. Hint for how to order the results
59 pub order_by: std::string::String,
60
61 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
62}
63
64impl ListUsersRequest {
65 /// Creates a new default instance.
66 pub fn new() -> Self {
67 std::default::Default::default()
68 }
69
70 /// Sets the value of [parent][crate::model::ListUsersRequest::parent].
71 ///
72 /// # Example
73 /// ```ignore,no_run
74 /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
75 /// # let project_id = "project_id";
76 /// # let location_id = "location_id";
77 /// # let account_connector_id = "account_connector_id";
78 /// let x = ListUsersRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
79 /// ```
80 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
81 self.parent = v.into();
82 self
83 }
84
85 /// Sets the value of [page_size][crate::model::ListUsersRequest::page_size].
86 ///
87 /// # Example
88 /// ```ignore,no_run
89 /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
90 /// let x = ListUsersRequest::new().set_page_size(42);
91 /// ```
92 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
93 self.page_size = v.into();
94 self
95 }
96
97 /// Sets the value of [page_token][crate::model::ListUsersRequest::page_token].
98 ///
99 /// # Example
100 /// ```ignore,no_run
101 /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
102 /// let x = ListUsersRequest::new().set_page_token("example");
103 /// ```
104 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
105 self.page_token = v.into();
106 self
107 }
108
109 /// Sets the value of [filter][crate::model::ListUsersRequest::filter].
110 ///
111 /// # Example
112 /// ```ignore,no_run
113 /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
114 /// let x = ListUsersRequest::new().set_filter("example");
115 /// ```
116 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
117 self.filter = v.into();
118 self
119 }
120
121 /// Sets the value of [order_by][crate::model::ListUsersRequest::order_by].
122 ///
123 /// # Example
124 /// ```ignore,no_run
125 /// # use google_cloud_developerconnect_v1::model::ListUsersRequest;
126 /// let x = ListUsersRequest::new().set_order_by("example");
127 /// ```
128 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
129 self.order_by = v.into();
130 self
131 }
132}
133
134impl wkt::message::Message for ListUsersRequest {
135 fn typename() -> &'static str {
136 "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersRequest"
137 }
138}
139
140/// Message for response to listing Users
141#[derive(Clone, Default, PartialEq)]
142#[non_exhaustive]
143pub struct ListUsersResponse {
144 /// The list of Users
145 pub users: std::vec::Vec<crate::model::User>,
146
147 /// A token identifying a page of results the server should return.
148 pub next_page_token: std::string::String,
149
150 /// Locations that could not be reached.
151 pub unreachable: std::vec::Vec<std::string::String>,
152
153 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
154}
155
156impl ListUsersResponse {
157 /// Creates a new default instance.
158 pub fn new() -> Self {
159 std::default::Default::default()
160 }
161
162 /// Sets the value of [users][crate::model::ListUsersResponse::users].
163 ///
164 /// # Example
165 /// ```ignore,no_run
166 /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
167 /// use google_cloud_developerconnect_v1::model::User;
168 /// let x = ListUsersResponse::new()
169 /// .set_users([
170 /// User::default()/* use setters */,
171 /// User::default()/* use (different) setters */,
172 /// ]);
173 /// ```
174 pub fn set_users<T, V>(mut self, v: T) -> Self
175 where
176 T: std::iter::IntoIterator<Item = V>,
177 V: std::convert::Into<crate::model::User>,
178 {
179 use std::iter::Iterator;
180 self.users = v.into_iter().map(|i| i.into()).collect();
181 self
182 }
183
184 /// Sets the value of [next_page_token][crate::model::ListUsersResponse::next_page_token].
185 ///
186 /// # Example
187 /// ```ignore,no_run
188 /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
189 /// let x = ListUsersResponse::new().set_next_page_token("example");
190 /// ```
191 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
192 self.next_page_token = v.into();
193 self
194 }
195
196 /// Sets the value of [unreachable][crate::model::ListUsersResponse::unreachable].
197 ///
198 /// # Example
199 /// ```ignore,no_run
200 /// # use google_cloud_developerconnect_v1::model::ListUsersResponse;
201 /// let x = ListUsersResponse::new().set_unreachable(["a", "b", "c"]);
202 /// ```
203 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
204 where
205 T: std::iter::IntoIterator<Item = V>,
206 V: std::convert::Into<std::string::String>,
207 {
208 use std::iter::Iterator;
209 self.unreachable = v.into_iter().map(|i| i.into()).collect();
210 self
211 }
212}
213
214impl wkt::message::Message for ListUsersResponse {
215 fn typename() -> &'static str {
216 "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersResponse"
217 }
218}
219
220#[doc(hidden)]
221impl google_cloud_gax::paginator::internal::PageableResponse for ListUsersResponse {
222 type PageItem = crate::model::User;
223
224 fn items(self) -> std::vec::Vec<Self::PageItem> {
225 self.users
226 }
227
228 fn next_page_token(&self) -> std::string::String {
229 use std::clone::Clone;
230 self.next_page_token.clone()
231 }
232}
233
234/// Message describing Connection object
235#[derive(Clone, Default, PartialEq)]
236#[non_exhaustive]
237pub struct Connection {
238 /// Identifier. The resource name of the connection, in the format
239 /// `projects/{project}/locations/{location}/connections/{connection_id}`.
240 pub name: std::string::String,
241
242 /// Output only. [Output only] Create timestamp
243 pub create_time: std::option::Option<wkt::Timestamp>,
244
245 /// Output only. [Output only] Update timestamp
246 pub update_time: std::option::Option<wkt::Timestamp>,
247
248 /// Output only. [Output only] Delete timestamp
249 pub delete_time: std::option::Option<wkt::Timestamp>,
250
251 /// Optional. Labels as key value pairs
252 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
253
254 /// Output only. Installation state of the Connection.
255 pub installation_state: std::option::Option<crate::model::InstallationState>,
256
257 /// Optional. If disabled is set to true, functionality is disabled for this
258 /// connection. Repository based API methods and webhooks processing for
259 /// repositories in this connection will be disabled.
260 pub disabled: bool,
261
262 /// Output only. Set to true when the connection is being set up or updated in
263 /// the background.
264 pub reconciling: bool,
265
266 /// Optional. Allows clients to store small amounts of arbitrary data.
267 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
268
269 /// Optional. This checksum is computed by the server based on the value of
270 /// other fields, and may be sent on update and delete requests to ensure the
271 /// client has an up-to-date value before proceeding.
272 pub etag: std::string::String,
273
274 /// Output only. A system-assigned unique identifier for the Connection.
275 pub uid: std::string::String,
276
277 /// Optional. The crypto key configuration. This field is used by the
278 /// Customer-Managed Encryption Keys (CMEK) feature.
279 pub crypto_key_config: std::option::Option<crate::model::CryptoKeyConfig>,
280
281 /// Optional. Configuration for the git proxy feature. Enabling the git proxy
282 /// allows clients to perform git operations on the repositories linked in the
283 /// connection.
284 pub git_proxy_config: std::option::Option<crate::model::GitProxyConfig>,
285
286 /// Configuration for the connection depending on the type of provider.
287 pub connection_config: std::option::Option<crate::model::connection::ConnectionConfig>,
288
289 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
290}
291
292impl Connection {
293 /// Creates a new default instance.
294 pub fn new() -> Self {
295 std::default::Default::default()
296 }
297
298 /// Sets the value of [name][crate::model::Connection::name].
299 ///
300 /// # Example
301 /// ```ignore,no_run
302 /// # use google_cloud_developerconnect_v1::model::Connection;
303 /// # let project_id = "project_id";
304 /// # let location_id = "location_id";
305 /// # let connection_id = "connection_id";
306 /// let x = Connection::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
307 /// ```
308 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
309 self.name = v.into();
310 self
311 }
312
313 /// Sets the value of [create_time][crate::model::Connection::create_time].
314 ///
315 /// # Example
316 /// ```ignore,no_run
317 /// # use google_cloud_developerconnect_v1::model::Connection;
318 /// use wkt::Timestamp;
319 /// let x = Connection::new().set_create_time(Timestamp::default()/* use setters */);
320 /// ```
321 pub fn set_create_time<T>(mut self, v: T) -> Self
322 where
323 T: std::convert::Into<wkt::Timestamp>,
324 {
325 self.create_time = std::option::Option::Some(v.into());
326 self
327 }
328
329 /// Sets or clears the value of [create_time][crate::model::Connection::create_time].
330 ///
331 /// # Example
332 /// ```ignore,no_run
333 /// # use google_cloud_developerconnect_v1::model::Connection;
334 /// use wkt::Timestamp;
335 /// let x = Connection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
336 /// let x = Connection::new().set_or_clear_create_time(None::<Timestamp>);
337 /// ```
338 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
339 where
340 T: std::convert::Into<wkt::Timestamp>,
341 {
342 self.create_time = v.map(|x| x.into());
343 self
344 }
345
346 /// Sets the value of [update_time][crate::model::Connection::update_time].
347 ///
348 /// # Example
349 /// ```ignore,no_run
350 /// # use google_cloud_developerconnect_v1::model::Connection;
351 /// use wkt::Timestamp;
352 /// let x = Connection::new().set_update_time(Timestamp::default()/* use setters */);
353 /// ```
354 pub fn set_update_time<T>(mut self, v: T) -> Self
355 where
356 T: std::convert::Into<wkt::Timestamp>,
357 {
358 self.update_time = std::option::Option::Some(v.into());
359 self
360 }
361
362 /// Sets or clears the value of [update_time][crate::model::Connection::update_time].
363 ///
364 /// # Example
365 /// ```ignore,no_run
366 /// # use google_cloud_developerconnect_v1::model::Connection;
367 /// use wkt::Timestamp;
368 /// let x = Connection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
369 /// let x = Connection::new().set_or_clear_update_time(None::<Timestamp>);
370 /// ```
371 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
372 where
373 T: std::convert::Into<wkt::Timestamp>,
374 {
375 self.update_time = v.map(|x| x.into());
376 self
377 }
378
379 /// Sets the value of [delete_time][crate::model::Connection::delete_time].
380 ///
381 /// # Example
382 /// ```ignore,no_run
383 /// # use google_cloud_developerconnect_v1::model::Connection;
384 /// use wkt::Timestamp;
385 /// let x = Connection::new().set_delete_time(Timestamp::default()/* use setters */);
386 /// ```
387 pub fn set_delete_time<T>(mut self, v: T) -> Self
388 where
389 T: std::convert::Into<wkt::Timestamp>,
390 {
391 self.delete_time = std::option::Option::Some(v.into());
392 self
393 }
394
395 /// Sets or clears the value of [delete_time][crate::model::Connection::delete_time].
396 ///
397 /// # Example
398 /// ```ignore,no_run
399 /// # use google_cloud_developerconnect_v1::model::Connection;
400 /// use wkt::Timestamp;
401 /// let x = Connection::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
402 /// let x = Connection::new().set_or_clear_delete_time(None::<Timestamp>);
403 /// ```
404 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
405 where
406 T: std::convert::Into<wkt::Timestamp>,
407 {
408 self.delete_time = v.map(|x| x.into());
409 self
410 }
411
412 /// Sets the value of [labels][crate::model::Connection::labels].
413 ///
414 /// # Example
415 /// ```ignore,no_run
416 /// # use google_cloud_developerconnect_v1::model::Connection;
417 /// let x = Connection::new().set_labels([
418 /// ("key0", "abc"),
419 /// ("key1", "xyz"),
420 /// ]);
421 /// ```
422 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
423 where
424 T: std::iter::IntoIterator<Item = (K, V)>,
425 K: std::convert::Into<std::string::String>,
426 V: std::convert::Into<std::string::String>,
427 {
428 use std::iter::Iterator;
429 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
430 self
431 }
432
433 /// Sets the value of [installation_state][crate::model::Connection::installation_state].
434 ///
435 /// # Example
436 /// ```ignore,no_run
437 /// # use google_cloud_developerconnect_v1::model::Connection;
438 /// use google_cloud_developerconnect_v1::model::InstallationState;
439 /// let x = Connection::new().set_installation_state(InstallationState::default()/* use setters */);
440 /// ```
441 pub fn set_installation_state<T>(mut self, v: T) -> Self
442 where
443 T: std::convert::Into<crate::model::InstallationState>,
444 {
445 self.installation_state = std::option::Option::Some(v.into());
446 self
447 }
448
449 /// Sets or clears the value of [installation_state][crate::model::Connection::installation_state].
450 ///
451 /// # Example
452 /// ```ignore,no_run
453 /// # use google_cloud_developerconnect_v1::model::Connection;
454 /// use google_cloud_developerconnect_v1::model::InstallationState;
455 /// let x = Connection::new().set_or_clear_installation_state(Some(InstallationState::default()/* use setters */));
456 /// let x = Connection::new().set_or_clear_installation_state(None::<InstallationState>);
457 /// ```
458 pub fn set_or_clear_installation_state<T>(mut self, v: std::option::Option<T>) -> Self
459 where
460 T: std::convert::Into<crate::model::InstallationState>,
461 {
462 self.installation_state = v.map(|x| x.into());
463 self
464 }
465
466 /// Sets the value of [disabled][crate::model::Connection::disabled].
467 ///
468 /// # Example
469 /// ```ignore,no_run
470 /// # use google_cloud_developerconnect_v1::model::Connection;
471 /// let x = Connection::new().set_disabled(true);
472 /// ```
473 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
474 self.disabled = v.into();
475 self
476 }
477
478 /// Sets the value of [reconciling][crate::model::Connection::reconciling].
479 ///
480 /// # Example
481 /// ```ignore,no_run
482 /// # use google_cloud_developerconnect_v1::model::Connection;
483 /// let x = Connection::new().set_reconciling(true);
484 /// ```
485 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
486 self.reconciling = v.into();
487 self
488 }
489
490 /// Sets the value of [annotations][crate::model::Connection::annotations].
491 ///
492 /// # Example
493 /// ```ignore,no_run
494 /// # use google_cloud_developerconnect_v1::model::Connection;
495 /// let x = Connection::new().set_annotations([
496 /// ("key0", "abc"),
497 /// ("key1", "xyz"),
498 /// ]);
499 /// ```
500 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
501 where
502 T: std::iter::IntoIterator<Item = (K, V)>,
503 K: std::convert::Into<std::string::String>,
504 V: std::convert::Into<std::string::String>,
505 {
506 use std::iter::Iterator;
507 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
508 self
509 }
510
511 /// Sets the value of [etag][crate::model::Connection::etag].
512 ///
513 /// # Example
514 /// ```ignore,no_run
515 /// # use google_cloud_developerconnect_v1::model::Connection;
516 /// let x = Connection::new().set_etag("example");
517 /// ```
518 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
519 self.etag = v.into();
520 self
521 }
522
523 /// Sets the value of [uid][crate::model::Connection::uid].
524 ///
525 /// # Example
526 /// ```ignore,no_run
527 /// # use google_cloud_developerconnect_v1::model::Connection;
528 /// let x = Connection::new().set_uid("example");
529 /// ```
530 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
531 self.uid = v.into();
532 self
533 }
534
535 /// Sets the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
536 ///
537 /// # Example
538 /// ```ignore,no_run
539 /// # use google_cloud_developerconnect_v1::model::Connection;
540 /// use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
541 /// let x = Connection::new().set_crypto_key_config(CryptoKeyConfig::default()/* use setters */);
542 /// ```
543 pub fn set_crypto_key_config<T>(mut self, v: T) -> Self
544 where
545 T: std::convert::Into<crate::model::CryptoKeyConfig>,
546 {
547 self.crypto_key_config = std::option::Option::Some(v.into());
548 self
549 }
550
551 /// Sets or clears the value of [crypto_key_config][crate::model::Connection::crypto_key_config].
552 ///
553 /// # Example
554 /// ```ignore,no_run
555 /// # use google_cloud_developerconnect_v1::model::Connection;
556 /// use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
557 /// let x = Connection::new().set_or_clear_crypto_key_config(Some(CryptoKeyConfig::default()/* use setters */));
558 /// let x = Connection::new().set_or_clear_crypto_key_config(None::<CryptoKeyConfig>);
559 /// ```
560 pub fn set_or_clear_crypto_key_config<T>(mut self, v: std::option::Option<T>) -> Self
561 where
562 T: std::convert::Into<crate::model::CryptoKeyConfig>,
563 {
564 self.crypto_key_config = v.map(|x| x.into());
565 self
566 }
567
568 /// Sets the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
569 ///
570 /// # Example
571 /// ```ignore,no_run
572 /// # use google_cloud_developerconnect_v1::model::Connection;
573 /// use google_cloud_developerconnect_v1::model::GitProxyConfig;
574 /// let x = Connection::new().set_git_proxy_config(GitProxyConfig::default()/* use setters */);
575 /// ```
576 pub fn set_git_proxy_config<T>(mut self, v: T) -> Self
577 where
578 T: std::convert::Into<crate::model::GitProxyConfig>,
579 {
580 self.git_proxy_config = std::option::Option::Some(v.into());
581 self
582 }
583
584 /// Sets or clears the value of [git_proxy_config][crate::model::Connection::git_proxy_config].
585 ///
586 /// # Example
587 /// ```ignore,no_run
588 /// # use google_cloud_developerconnect_v1::model::Connection;
589 /// use google_cloud_developerconnect_v1::model::GitProxyConfig;
590 /// let x = Connection::new().set_or_clear_git_proxy_config(Some(GitProxyConfig::default()/* use setters */));
591 /// let x = Connection::new().set_or_clear_git_proxy_config(None::<GitProxyConfig>);
592 /// ```
593 pub fn set_or_clear_git_proxy_config<T>(mut self, v: std::option::Option<T>) -> Self
594 where
595 T: std::convert::Into<crate::model::GitProxyConfig>,
596 {
597 self.git_proxy_config = v.map(|x| x.into());
598 self
599 }
600
601 /// Sets the value of [connection_config][crate::model::Connection::connection_config].
602 ///
603 /// Note that all the setters affecting `connection_config` are mutually
604 /// exclusive.
605 ///
606 /// # Example
607 /// ```ignore,no_run
608 /// # use google_cloud_developerconnect_v1::model::Connection;
609 /// use google_cloud_developerconnect_v1::model::GitHubConfig;
610 /// let x = Connection::new().set_connection_config(Some(
611 /// google_cloud_developerconnect_v1::model::connection::ConnectionConfig::GithubConfig(GitHubConfig::default().into())));
612 /// ```
613 pub fn set_connection_config<
614 T: std::convert::Into<std::option::Option<crate::model::connection::ConnectionConfig>>,
615 >(
616 mut self,
617 v: T,
618 ) -> Self {
619 self.connection_config = v.into();
620 self
621 }
622
623 /// The value of [connection_config][crate::model::Connection::connection_config]
624 /// if it holds a `GithubConfig`, `None` if the field is not set or
625 /// holds a different branch.
626 pub fn github_config(
627 &self,
628 ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubConfig>> {
629 #[allow(unreachable_patterns)]
630 self.connection_config.as_ref().and_then(|v| match v {
631 crate::model::connection::ConnectionConfig::GithubConfig(v) => {
632 std::option::Option::Some(v)
633 }
634 _ => std::option::Option::None,
635 })
636 }
637
638 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
639 /// to hold a `GithubConfig`.
640 ///
641 /// Note that all the setters affecting `connection_config` are
642 /// mutually exclusive.
643 ///
644 /// # Example
645 /// ```ignore,no_run
646 /// # use google_cloud_developerconnect_v1::model::Connection;
647 /// use google_cloud_developerconnect_v1::model::GitHubConfig;
648 /// let x = Connection::new().set_github_config(GitHubConfig::default()/* use setters */);
649 /// assert!(x.github_config().is_some());
650 /// assert!(x.github_enterprise_config().is_none());
651 /// assert!(x.gitlab_config().is_none());
652 /// assert!(x.gitlab_enterprise_config().is_none());
653 /// assert!(x.bitbucket_data_center_config().is_none());
654 /// assert!(x.bitbucket_cloud_config().is_none());
655 /// assert!(x.secure_source_manager_instance_config().is_none());
656 /// assert!(x.http_config().is_none());
657 /// ```
658 pub fn set_github_config<T: std::convert::Into<std::boxed::Box<crate::model::GitHubConfig>>>(
659 mut self,
660 v: T,
661 ) -> Self {
662 self.connection_config = std::option::Option::Some(
663 crate::model::connection::ConnectionConfig::GithubConfig(v.into()),
664 );
665 self
666 }
667
668 /// The value of [connection_config][crate::model::Connection::connection_config]
669 /// if it holds a `GithubEnterpriseConfig`, `None` if the field is not set or
670 /// holds a different branch.
671 pub fn github_enterprise_config(
672 &self,
673 ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubEnterpriseConfig>> {
674 #[allow(unreachable_patterns)]
675 self.connection_config.as_ref().and_then(|v| match v {
676 crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v) => {
677 std::option::Option::Some(v)
678 }
679 _ => std::option::Option::None,
680 })
681 }
682
683 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
684 /// to hold a `GithubEnterpriseConfig`.
685 ///
686 /// Note that all the setters affecting `connection_config` are
687 /// mutually exclusive.
688 ///
689 /// # Example
690 /// ```ignore,no_run
691 /// # use google_cloud_developerconnect_v1::model::Connection;
692 /// use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
693 /// let x = Connection::new().set_github_enterprise_config(GitHubEnterpriseConfig::default()/* use setters */);
694 /// assert!(x.github_enterprise_config().is_some());
695 /// assert!(x.github_config().is_none());
696 /// assert!(x.gitlab_config().is_none());
697 /// assert!(x.gitlab_enterprise_config().is_none());
698 /// assert!(x.bitbucket_data_center_config().is_none());
699 /// assert!(x.bitbucket_cloud_config().is_none());
700 /// assert!(x.secure_source_manager_instance_config().is_none());
701 /// assert!(x.http_config().is_none());
702 /// ```
703 pub fn set_github_enterprise_config<
704 T: std::convert::Into<std::boxed::Box<crate::model::GitHubEnterpriseConfig>>,
705 >(
706 mut self,
707 v: T,
708 ) -> Self {
709 self.connection_config = std::option::Option::Some(
710 crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v.into()),
711 );
712 self
713 }
714
715 /// The value of [connection_config][crate::model::Connection::connection_config]
716 /// if it holds a `GitlabConfig`, `None` if the field is not set or
717 /// holds a different branch.
718 pub fn gitlab_config(
719 &self,
720 ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabConfig>> {
721 #[allow(unreachable_patterns)]
722 self.connection_config.as_ref().and_then(|v| match v {
723 crate::model::connection::ConnectionConfig::GitlabConfig(v) => {
724 std::option::Option::Some(v)
725 }
726 _ => std::option::Option::None,
727 })
728 }
729
730 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
731 /// to hold a `GitlabConfig`.
732 ///
733 /// Note that all the setters affecting `connection_config` are
734 /// mutually exclusive.
735 ///
736 /// # Example
737 /// ```ignore,no_run
738 /// # use google_cloud_developerconnect_v1::model::Connection;
739 /// use google_cloud_developerconnect_v1::model::GitLabConfig;
740 /// let x = Connection::new().set_gitlab_config(GitLabConfig::default()/* use setters */);
741 /// assert!(x.gitlab_config().is_some());
742 /// assert!(x.github_config().is_none());
743 /// assert!(x.github_enterprise_config().is_none());
744 /// assert!(x.gitlab_enterprise_config().is_none());
745 /// assert!(x.bitbucket_data_center_config().is_none());
746 /// assert!(x.bitbucket_cloud_config().is_none());
747 /// assert!(x.secure_source_manager_instance_config().is_none());
748 /// assert!(x.http_config().is_none());
749 /// ```
750 pub fn set_gitlab_config<T: std::convert::Into<std::boxed::Box<crate::model::GitLabConfig>>>(
751 mut self,
752 v: T,
753 ) -> Self {
754 self.connection_config = std::option::Option::Some(
755 crate::model::connection::ConnectionConfig::GitlabConfig(v.into()),
756 );
757 self
758 }
759
760 /// The value of [connection_config][crate::model::Connection::connection_config]
761 /// if it holds a `GitlabEnterpriseConfig`, `None` if the field is not set or
762 /// holds a different branch.
763 pub fn gitlab_enterprise_config(
764 &self,
765 ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabEnterpriseConfig>> {
766 #[allow(unreachable_patterns)]
767 self.connection_config.as_ref().and_then(|v| match v {
768 crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v) => {
769 std::option::Option::Some(v)
770 }
771 _ => std::option::Option::None,
772 })
773 }
774
775 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
776 /// to hold a `GitlabEnterpriseConfig`.
777 ///
778 /// Note that all the setters affecting `connection_config` are
779 /// mutually exclusive.
780 ///
781 /// # Example
782 /// ```ignore,no_run
783 /// # use google_cloud_developerconnect_v1::model::Connection;
784 /// use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
785 /// let x = Connection::new().set_gitlab_enterprise_config(GitLabEnterpriseConfig::default()/* use setters */);
786 /// assert!(x.gitlab_enterprise_config().is_some());
787 /// assert!(x.github_config().is_none());
788 /// assert!(x.github_enterprise_config().is_none());
789 /// assert!(x.gitlab_config().is_none());
790 /// assert!(x.bitbucket_data_center_config().is_none());
791 /// assert!(x.bitbucket_cloud_config().is_none());
792 /// assert!(x.secure_source_manager_instance_config().is_none());
793 /// assert!(x.http_config().is_none());
794 /// ```
795 pub fn set_gitlab_enterprise_config<
796 T: std::convert::Into<std::boxed::Box<crate::model::GitLabEnterpriseConfig>>,
797 >(
798 mut self,
799 v: T,
800 ) -> Self {
801 self.connection_config = std::option::Option::Some(
802 crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v.into()),
803 );
804 self
805 }
806
807 /// The value of [connection_config][crate::model::Connection::connection_config]
808 /// if it holds a `BitbucketDataCenterConfig`, `None` if the field is not set or
809 /// holds a different branch.
810 pub fn bitbucket_data_center_config(
811 &self,
812 ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketDataCenterConfig>> {
813 #[allow(unreachable_patterns)]
814 self.connection_config.as_ref().and_then(|v| match v {
815 crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v) => {
816 std::option::Option::Some(v)
817 }
818 _ => std::option::Option::None,
819 })
820 }
821
822 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
823 /// to hold a `BitbucketDataCenterConfig`.
824 ///
825 /// Note that all the setters affecting `connection_config` are
826 /// mutually exclusive.
827 ///
828 /// # Example
829 /// ```ignore,no_run
830 /// # use google_cloud_developerconnect_v1::model::Connection;
831 /// use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
832 /// let x = Connection::new().set_bitbucket_data_center_config(BitbucketDataCenterConfig::default()/* use setters */);
833 /// assert!(x.bitbucket_data_center_config().is_some());
834 /// assert!(x.github_config().is_none());
835 /// assert!(x.github_enterprise_config().is_none());
836 /// assert!(x.gitlab_config().is_none());
837 /// assert!(x.gitlab_enterprise_config().is_none());
838 /// assert!(x.bitbucket_cloud_config().is_none());
839 /// assert!(x.secure_source_manager_instance_config().is_none());
840 /// assert!(x.http_config().is_none());
841 /// ```
842 pub fn set_bitbucket_data_center_config<
843 T: std::convert::Into<std::boxed::Box<crate::model::BitbucketDataCenterConfig>>,
844 >(
845 mut self,
846 v: T,
847 ) -> Self {
848 self.connection_config = std::option::Option::Some(
849 crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v.into()),
850 );
851 self
852 }
853
854 /// The value of [connection_config][crate::model::Connection::connection_config]
855 /// if it holds a `BitbucketCloudConfig`, `None` if the field is not set or
856 /// holds a different branch.
857 pub fn bitbucket_cloud_config(
858 &self,
859 ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketCloudConfig>> {
860 #[allow(unreachable_patterns)]
861 self.connection_config.as_ref().and_then(|v| match v {
862 crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v) => {
863 std::option::Option::Some(v)
864 }
865 _ => std::option::Option::None,
866 })
867 }
868
869 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
870 /// to hold a `BitbucketCloudConfig`.
871 ///
872 /// Note that all the setters affecting `connection_config` are
873 /// mutually exclusive.
874 ///
875 /// # Example
876 /// ```ignore,no_run
877 /// # use google_cloud_developerconnect_v1::model::Connection;
878 /// use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
879 /// let x = Connection::new().set_bitbucket_cloud_config(BitbucketCloudConfig::default()/* use setters */);
880 /// assert!(x.bitbucket_cloud_config().is_some());
881 /// assert!(x.github_config().is_none());
882 /// assert!(x.github_enterprise_config().is_none());
883 /// assert!(x.gitlab_config().is_none());
884 /// assert!(x.gitlab_enterprise_config().is_none());
885 /// assert!(x.bitbucket_data_center_config().is_none());
886 /// assert!(x.secure_source_manager_instance_config().is_none());
887 /// assert!(x.http_config().is_none());
888 /// ```
889 pub fn set_bitbucket_cloud_config<
890 T: std::convert::Into<std::boxed::Box<crate::model::BitbucketCloudConfig>>,
891 >(
892 mut self,
893 v: T,
894 ) -> Self {
895 self.connection_config = std::option::Option::Some(
896 crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v.into()),
897 );
898 self
899 }
900
901 /// The value of [connection_config][crate::model::Connection::connection_config]
902 /// if it holds a `SecureSourceManagerInstanceConfig`, `None` if the field is not set or
903 /// holds a different branch.
904 pub fn secure_source_manager_instance_config(
905 &self,
906 ) -> std::option::Option<&std::boxed::Box<crate::model::SecureSourceManagerInstanceConfig>>
907 {
908 #[allow(unreachable_patterns)]
909 self.connection_config.as_ref().and_then(|v| match v {
910 crate::model::connection::ConnectionConfig::SecureSourceManagerInstanceConfig(v) => {
911 std::option::Option::Some(v)
912 }
913 _ => std::option::Option::None,
914 })
915 }
916
917 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
918 /// to hold a `SecureSourceManagerInstanceConfig`.
919 ///
920 /// Note that all the setters affecting `connection_config` are
921 /// mutually exclusive.
922 ///
923 /// # Example
924 /// ```ignore,no_run
925 /// # use google_cloud_developerconnect_v1::model::Connection;
926 /// use google_cloud_developerconnect_v1::model::SecureSourceManagerInstanceConfig;
927 /// let x = Connection::new().set_secure_source_manager_instance_config(SecureSourceManagerInstanceConfig::default()/* use setters */);
928 /// assert!(x.secure_source_manager_instance_config().is_some());
929 /// assert!(x.github_config().is_none());
930 /// assert!(x.github_enterprise_config().is_none());
931 /// assert!(x.gitlab_config().is_none());
932 /// assert!(x.gitlab_enterprise_config().is_none());
933 /// assert!(x.bitbucket_data_center_config().is_none());
934 /// assert!(x.bitbucket_cloud_config().is_none());
935 /// assert!(x.http_config().is_none());
936 /// ```
937 pub fn set_secure_source_manager_instance_config<
938 T: std::convert::Into<std::boxed::Box<crate::model::SecureSourceManagerInstanceConfig>>,
939 >(
940 mut self,
941 v: T,
942 ) -> Self {
943 self.connection_config = std::option::Option::Some(
944 crate::model::connection::ConnectionConfig::SecureSourceManagerInstanceConfig(v.into()),
945 );
946 self
947 }
948
949 /// The value of [connection_config][crate::model::Connection::connection_config]
950 /// if it holds a `HttpConfig`, `None` if the field is not set or
951 /// holds a different branch.
952 pub fn http_config(
953 &self,
954 ) -> std::option::Option<&std::boxed::Box<crate::model::GenericHTTPEndpointConfig>> {
955 #[allow(unreachable_patterns)]
956 self.connection_config.as_ref().and_then(|v| match v {
957 crate::model::connection::ConnectionConfig::HttpConfig(v) => {
958 std::option::Option::Some(v)
959 }
960 _ => std::option::Option::None,
961 })
962 }
963
964 /// Sets the value of [connection_config][crate::model::Connection::connection_config]
965 /// to hold a `HttpConfig`.
966 ///
967 /// Note that all the setters affecting `connection_config` are
968 /// mutually exclusive.
969 ///
970 /// # Example
971 /// ```ignore,no_run
972 /// # use google_cloud_developerconnect_v1::model::Connection;
973 /// use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
974 /// let x = Connection::new().set_http_config(GenericHTTPEndpointConfig::default()/* use setters */);
975 /// assert!(x.http_config().is_some());
976 /// assert!(x.github_config().is_none());
977 /// assert!(x.github_enterprise_config().is_none());
978 /// assert!(x.gitlab_config().is_none());
979 /// assert!(x.gitlab_enterprise_config().is_none());
980 /// assert!(x.bitbucket_data_center_config().is_none());
981 /// assert!(x.bitbucket_cloud_config().is_none());
982 /// assert!(x.secure_source_manager_instance_config().is_none());
983 /// ```
984 pub fn set_http_config<
985 T: std::convert::Into<std::boxed::Box<crate::model::GenericHTTPEndpointConfig>>,
986 >(
987 mut self,
988 v: T,
989 ) -> Self {
990 self.connection_config = std::option::Option::Some(
991 crate::model::connection::ConnectionConfig::HttpConfig(v.into()),
992 );
993 self
994 }
995}
996
997impl wkt::message::Message for Connection {
998 fn typename() -> &'static str {
999 "type.googleapis.com/google.cloud.developerconnect.v1.Connection"
1000 }
1001}
1002
1003/// Defines additional types related to [Connection].
1004pub mod connection {
1005 #[allow(unused_imports)]
1006 use super::*;
1007
1008 /// Configuration for the connection depending on the type of provider.
1009 #[derive(Clone, Debug, PartialEq)]
1010 #[non_exhaustive]
1011 pub enum ConnectionConfig {
1012 /// Configuration for connections to github.com.
1013 GithubConfig(std::boxed::Box<crate::model::GitHubConfig>),
1014 /// Configuration for connections to an instance of GitHub Enterprise.
1015 GithubEnterpriseConfig(std::boxed::Box<crate::model::GitHubEnterpriseConfig>),
1016 /// Configuration for connections to gitlab.com.
1017 GitlabConfig(std::boxed::Box<crate::model::GitLabConfig>),
1018 /// Configuration for connections to an instance of GitLab Enterprise.
1019 GitlabEnterpriseConfig(std::boxed::Box<crate::model::GitLabEnterpriseConfig>),
1020 /// Configuration for connections to an instance of Bitbucket Data Center.
1021 BitbucketDataCenterConfig(std::boxed::Box<crate::model::BitbucketDataCenterConfig>),
1022 /// Configuration for connections to an instance of Bitbucket Clouds.
1023 BitbucketCloudConfig(std::boxed::Box<crate::model::BitbucketCloudConfig>),
1024 /// Configuration for connections to an instance of Secure Source Manager.
1025 SecureSourceManagerInstanceConfig(
1026 std::boxed::Box<crate::model::SecureSourceManagerInstanceConfig>,
1027 ),
1028 /// Optional. Configuration for connections to an HTTP service provider.
1029 HttpConfig(std::boxed::Box<crate::model::GenericHTTPEndpointConfig>),
1030 }
1031}
1032
1033/// The crypto key configuration. This field is used by the Customer-managed
1034/// encryption keys (CMEK) feature.
1035#[derive(Clone, Default, PartialEq)]
1036#[non_exhaustive]
1037pub struct CryptoKeyConfig {
1038 /// Required. The name of the key which is used to encrypt/decrypt customer
1039 /// data. For key in Cloud KMS, the key should be in the format of
1040 /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
1041 pub key_reference: std::string::String,
1042
1043 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1044}
1045
1046impl CryptoKeyConfig {
1047 /// Creates a new default instance.
1048 pub fn new() -> Self {
1049 std::default::Default::default()
1050 }
1051
1052 /// Sets the value of [key_reference][crate::model::CryptoKeyConfig::key_reference].
1053 ///
1054 /// # Example
1055 /// ```ignore,no_run
1056 /// # use google_cloud_developerconnect_v1::model::CryptoKeyConfig;
1057 /// let x = CryptoKeyConfig::new().set_key_reference("example");
1058 /// ```
1059 pub fn set_key_reference<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1060 self.key_reference = v.into();
1061 self
1062 }
1063}
1064
1065impl wkt::message::Message for CryptoKeyConfig {
1066 fn typename() -> &'static str {
1067 "type.googleapis.com/google.cloud.developerconnect.v1.CryptoKeyConfig"
1068 }
1069}
1070
1071/// The git proxy configuration.
1072#[derive(Clone, Default, PartialEq)]
1073#[non_exhaustive]
1074pub struct GitProxyConfig {
1075 /// Optional. Setting this to true allows the git proxy to be used for
1076 /// performing git operations on the repositories linked in the connection.
1077 pub enabled: bool,
1078
1079 /// Output only. The base URI for the HTTP proxy endpoint. Has
1080 /// the format
1081 /// `https://{generatedID}-c-h-{shortRegion}.developerconnect.dev`
1082 /// Populated only when enabled is set to true.
1083 /// This endpoint is used by other Google services that integrate with
1084 /// Developer Connect.
1085 pub http_proxy_base_uri: std::string::String,
1086
1087 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1088}
1089
1090impl GitProxyConfig {
1091 /// Creates a new default instance.
1092 pub fn new() -> Self {
1093 std::default::Default::default()
1094 }
1095
1096 /// Sets the value of [enabled][crate::model::GitProxyConfig::enabled].
1097 ///
1098 /// # Example
1099 /// ```ignore,no_run
1100 /// # use google_cloud_developerconnect_v1::model::GitProxyConfig;
1101 /// let x = GitProxyConfig::new().set_enabled(true);
1102 /// ```
1103 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1104 self.enabled = v.into();
1105 self
1106 }
1107
1108 /// Sets the value of [http_proxy_base_uri][crate::model::GitProxyConfig::http_proxy_base_uri].
1109 ///
1110 /// # Example
1111 /// ```ignore,no_run
1112 /// # use google_cloud_developerconnect_v1::model::GitProxyConfig;
1113 /// let x = GitProxyConfig::new().set_http_proxy_base_uri("example");
1114 /// ```
1115 pub fn set_http_proxy_base_uri<T: std::convert::Into<std::string::String>>(
1116 mut self,
1117 v: T,
1118 ) -> Self {
1119 self.http_proxy_base_uri = v.into();
1120 self
1121 }
1122}
1123
1124impl wkt::message::Message for GitProxyConfig {
1125 fn typename() -> &'static str {
1126 "type.googleapis.com/google.cloud.developerconnect.v1.GitProxyConfig"
1127 }
1128}
1129
1130/// Describes stage and necessary actions to be taken by the
1131/// user to complete the installation. Used for GitHub and GitHub Enterprise
1132/// based connections.
1133#[derive(Clone, Default, PartialEq)]
1134#[non_exhaustive]
1135pub struct InstallationState {
1136 /// Output only. Current step of the installation process.
1137 pub stage: crate::model::installation_state::Stage,
1138
1139 /// Output only. Message of what the user should do next to continue the
1140 /// installation. Empty string if the installation is already complete.
1141 pub message: std::string::String,
1142
1143 /// Output only. Link to follow for next action. Empty string if the
1144 /// installation is already complete.
1145 pub action_uri: std::string::String,
1146
1147 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1148}
1149
1150impl InstallationState {
1151 /// Creates a new default instance.
1152 pub fn new() -> Self {
1153 std::default::Default::default()
1154 }
1155
1156 /// Sets the value of [stage][crate::model::InstallationState::stage].
1157 ///
1158 /// # Example
1159 /// ```ignore,no_run
1160 /// # use google_cloud_developerconnect_v1::model::InstallationState;
1161 /// use google_cloud_developerconnect_v1::model::installation_state::Stage;
1162 /// let x0 = InstallationState::new().set_stage(Stage::PendingCreateApp);
1163 /// let x1 = InstallationState::new().set_stage(Stage::PendingUserOauth);
1164 /// let x2 = InstallationState::new().set_stage(Stage::PendingInstallApp);
1165 /// ```
1166 pub fn set_stage<T: std::convert::Into<crate::model::installation_state::Stage>>(
1167 mut self,
1168 v: T,
1169 ) -> Self {
1170 self.stage = v.into();
1171 self
1172 }
1173
1174 /// Sets the value of [message][crate::model::InstallationState::message].
1175 ///
1176 /// # Example
1177 /// ```ignore,no_run
1178 /// # use google_cloud_developerconnect_v1::model::InstallationState;
1179 /// let x = InstallationState::new().set_message("example");
1180 /// ```
1181 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1182 self.message = v.into();
1183 self
1184 }
1185
1186 /// Sets the value of [action_uri][crate::model::InstallationState::action_uri].
1187 ///
1188 /// # Example
1189 /// ```ignore,no_run
1190 /// # use google_cloud_developerconnect_v1::model::InstallationState;
1191 /// let x = InstallationState::new().set_action_uri("example");
1192 /// ```
1193 pub fn set_action_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1194 self.action_uri = v.into();
1195 self
1196 }
1197}
1198
1199impl wkt::message::Message for InstallationState {
1200 fn typename() -> &'static str {
1201 "type.googleapis.com/google.cloud.developerconnect.v1.InstallationState"
1202 }
1203}
1204
1205/// Defines additional types related to [InstallationState].
1206pub mod installation_state {
1207 #[allow(unused_imports)]
1208 use super::*;
1209
1210 /// Stage of the installation process.
1211 ///
1212 /// # Working with unknown values
1213 ///
1214 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1215 /// additional enum variants at any time. Adding new variants is not considered
1216 /// a breaking change. Applications should write their code in anticipation of:
1217 ///
1218 /// - New values appearing in future releases of the client library, **and**
1219 /// - New values received dynamically, without application changes.
1220 ///
1221 /// Please consult the [Working with enums] section in the user guide for some
1222 /// guidelines.
1223 ///
1224 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1225 #[derive(Clone, Debug, PartialEq)]
1226 #[non_exhaustive]
1227 pub enum Stage {
1228 /// No stage specified.
1229 Unspecified,
1230 /// Only for GitHub Enterprise. An App creation has been requested.
1231 /// The user needs to confirm the creation in their GitHub enterprise host.
1232 PendingCreateApp,
1233 /// User needs to authorize the GitHub (or Enterprise) App via OAuth.
1234 PendingUserOauth,
1235 /// User needs to follow the link to install the GitHub (or Enterprise) App.
1236 PendingInstallApp,
1237 /// Installation process has been completed.
1238 Complete,
1239 /// If set, the enum was initialized with an unknown value.
1240 ///
1241 /// Applications can examine the value using [Stage::value] or
1242 /// [Stage::name].
1243 UnknownValue(stage::UnknownValue),
1244 }
1245
1246 #[doc(hidden)]
1247 pub mod stage {
1248 #[allow(unused_imports)]
1249 use super::*;
1250 #[derive(Clone, Debug, PartialEq)]
1251 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1252 }
1253
1254 impl Stage {
1255 /// Gets the enum value.
1256 ///
1257 /// Returns `None` if the enum contains an unknown value deserialized from
1258 /// the string representation of enums.
1259 pub fn value(&self) -> std::option::Option<i32> {
1260 match self {
1261 Self::Unspecified => std::option::Option::Some(0),
1262 Self::PendingCreateApp => std::option::Option::Some(1),
1263 Self::PendingUserOauth => std::option::Option::Some(2),
1264 Self::PendingInstallApp => std::option::Option::Some(3),
1265 Self::Complete => std::option::Option::Some(10),
1266 Self::UnknownValue(u) => u.0.value(),
1267 }
1268 }
1269
1270 /// Gets the enum value as a string.
1271 ///
1272 /// Returns `None` if the enum contains an unknown value deserialized from
1273 /// the integer representation of enums.
1274 pub fn name(&self) -> std::option::Option<&str> {
1275 match self {
1276 Self::Unspecified => std::option::Option::Some("STAGE_UNSPECIFIED"),
1277 Self::PendingCreateApp => std::option::Option::Some("PENDING_CREATE_APP"),
1278 Self::PendingUserOauth => std::option::Option::Some("PENDING_USER_OAUTH"),
1279 Self::PendingInstallApp => std::option::Option::Some("PENDING_INSTALL_APP"),
1280 Self::Complete => std::option::Option::Some("COMPLETE"),
1281 Self::UnknownValue(u) => u.0.name(),
1282 }
1283 }
1284 }
1285
1286 impl std::default::Default for Stage {
1287 fn default() -> Self {
1288 use std::convert::From;
1289 Self::from(0)
1290 }
1291 }
1292
1293 impl std::fmt::Display for Stage {
1294 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1295 wkt::internal::display_enum(f, self.name(), self.value())
1296 }
1297 }
1298
1299 impl std::convert::From<i32> for Stage {
1300 fn from(value: i32) -> Self {
1301 match value {
1302 0 => Self::Unspecified,
1303 1 => Self::PendingCreateApp,
1304 2 => Self::PendingUserOauth,
1305 3 => Self::PendingInstallApp,
1306 10 => Self::Complete,
1307 _ => Self::UnknownValue(stage::UnknownValue(
1308 wkt::internal::UnknownEnumValue::Integer(value),
1309 )),
1310 }
1311 }
1312 }
1313
1314 impl std::convert::From<&str> for Stage {
1315 fn from(value: &str) -> Self {
1316 use std::string::ToString;
1317 match value {
1318 "STAGE_UNSPECIFIED" => Self::Unspecified,
1319 "PENDING_CREATE_APP" => Self::PendingCreateApp,
1320 "PENDING_USER_OAUTH" => Self::PendingUserOauth,
1321 "PENDING_INSTALL_APP" => Self::PendingInstallApp,
1322 "COMPLETE" => Self::Complete,
1323 _ => Self::UnknownValue(stage::UnknownValue(
1324 wkt::internal::UnknownEnumValue::String(value.to_string()),
1325 )),
1326 }
1327 }
1328 }
1329
1330 impl serde::ser::Serialize for Stage {
1331 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1332 where
1333 S: serde::Serializer,
1334 {
1335 match self {
1336 Self::Unspecified => serializer.serialize_i32(0),
1337 Self::PendingCreateApp => serializer.serialize_i32(1),
1338 Self::PendingUserOauth => serializer.serialize_i32(2),
1339 Self::PendingInstallApp => serializer.serialize_i32(3),
1340 Self::Complete => serializer.serialize_i32(10),
1341 Self::UnknownValue(u) => u.0.serialize(serializer),
1342 }
1343 }
1344 }
1345
1346 impl<'de> serde::de::Deserialize<'de> for Stage {
1347 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1348 where
1349 D: serde::Deserializer<'de>,
1350 {
1351 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Stage>::new(
1352 ".google.cloud.developerconnect.v1.InstallationState.Stage",
1353 ))
1354 }
1355 }
1356}
1357
1358/// Defines the configuration for connections to an HTTP service provider.
1359#[derive(Clone, Default, PartialEq)]
1360#[non_exhaustive]
1361pub struct GenericHTTPEndpointConfig {
1362 /// Required. Immutable. The service provider's https endpoint.
1363 pub host_uri: std::string::String,
1364
1365 /// Optional. Configuration for using Service Directory to privately connect to
1366 /// a HTTP service provider. This should only be set if the Http service
1367 /// provider is hosted on-premises and not reachable by public internet. If
1368 /// this field is left empty, calls to the HTTP service provider will be made
1369 /// over the public internet.
1370 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
1371
1372 /// Optional. The SSL certificate to use for requests to the HTTP service
1373 /// provider.
1374 pub ssl_ca_certificate: std::string::String,
1375
1376 /// The authentication mechanism to use for requests to the HTTP service
1377 /// provider.
1378 pub authentication:
1379 std::option::Option<crate::model::generic_http_endpoint_config::Authentication>,
1380
1381 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1382}
1383
1384impl GenericHTTPEndpointConfig {
1385 /// Creates a new default instance.
1386 pub fn new() -> Self {
1387 std::default::Default::default()
1388 }
1389
1390 /// Sets the value of [host_uri][crate::model::GenericHTTPEndpointConfig::host_uri].
1391 ///
1392 /// # Example
1393 /// ```ignore,no_run
1394 /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1395 /// let x = GenericHTTPEndpointConfig::new().set_host_uri("example");
1396 /// ```
1397 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1398 self.host_uri = v.into();
1399 self
1400 }
1401
1402 /// Sets the value of [service_directory_config][crate::model::GenericHTTPEndpointConfig::service_directory_config].
1403 ///
1404 /// # Example
1405 /// ```ignore,no_run
1406 /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1407 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
1408 /// let x = GenericHTTPEndpointConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
1409 /// ```
1410 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
1411 where
1412 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1413 {
1414 self.service_directory_config = std::option::Option::Some(v.into());
1415 self
1416 }
1417
1418 /// Sets or clears the value of [service_directory_config][crate::model::GenericHTTPEndpointConfig::service_directory_config].
1419 ///
1420 /// # Example
1421 /// ```ignore,no_run
1422 /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1423 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
1424 /// let x = GenericHTTPEndpointConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
1425 /// let x = GenericHTTPEndpointConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
1426 /// ```
1427 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
1428 where
1429 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
1430 {
1431 self.service_directory_config = v.map(|x| x.into());
1432 self
1433 }
1434
1435 /// Sets the value of [ssl_ca_certificate][crate::model::GenericHTTPEndpointConfig::ssl_ca_certificate].
1436 ///
1437 /// # Example
1438 /// ```ignore,no_run
1439 /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1440 /// let x = GenericHTTPEndpointConfig::new().set_ssl_ca_certificate("example");
1441 /// ```
1442 pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
1443 mut self,
1444 v: T,
1445 ) -> Self {
1446 self.ssl_ca_certificate = v.into();
1447 self
1448 }
1449
1450 /// Sets the value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication].
1451 ///
1452 /// Note that all the setters affecting `authentication` are mutually
1453 /// exclusive.
1454 ///
1455 /// # Example
1456 /// ```ignore,no_run
1457 /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1458 /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1459 /// let x = GenericHTTPEndpointConfig::new().set_authentication(Some(
1460 /// google_cloud_developerconnect_v1::model::generic_http_endpoint_config::Authentication::BasicAuthentication(BasicAuthentication::default().into())));
1461 /// ```
1462 pub fn set_authentication<
1463 T: std::convert::Into<
1464 std::option::Option<crate::model::generic_http_endpoint_config::Authentication>,
1465 >,
1466 >(
1467 mut self,
1468 v: T,
1469 ) -> Self {
1470 self.authentication = v.into();
1471 self
1472 }
1473
1474 /// The value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1475 /// if it holds a `BasicAuthentication`, `None` if the field is not set or
1476 /// holds a different branch.
1477 pub fn basic_authentication(
1478 &self,
1479 ) -> std::option::Option<
1480 &std::boxed::Box<crate::model::generic_http_endpoint_config::BasicAuthentication>,
1481 > {
1482 #[allow(unreachable_patterns)]
1483 self.authentication.as_ref().and_then(|v| match v {
1484 crate::model::generic_http_endpoint_config::Authentication::BasicAuthentication(v) => {
1485 std::option::Option::Some(v)
1486 }
1487 _ => std::option::Option::None,
1488 })
1489 }
1490
1491 /// Sets the value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1492 /// to hold a `BasicAuthentication`.
1493 ///
1494 /// Note that all the setters affecting `authentication` are
1495 /// mutually exclusive.
1496 ///
1497 /// # Example
1498 /// ```ignore,no_run
1499 /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1500 /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1501 /// let x = GenericHTTPEndpointConfig::new().set_basic_authentication(BasicAuthentication::default()/* use setters */);
1502 /// assert!(x.basic_authentication().is_some());
1503 /// assert!(x.bearer_token_authentication().is_none());
1504 /// ```
1505 pub fn set_basic_authentication<
1506 T: std::convert::Into<
1507 std::boxed::Box<crate::model::generic_http_endpoint_config::BasicAuthentication>,
1508 >,
1509 >(
1510 mut self,
1511 v: T,
1512 ) -> Self {
1513 self.authentication = std::option::Option::Some(
1514 crate::model::generic_http_endpoint_config::Authentication::BasicAuthentication(
1515 v.into(),
1516 ),
1517 );
1518 self
1519 }
1520
1521 /// The value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1522 /// if it holds a `BearerTokenAuthentication`, `None` if the field is not set or
1523 /// holds a different branch.
1524 pub fn bearer_token_authentication(
1525 &self,
1526 ) -> std::option::Option<
1527 &std::boxed::Box<crate::model::generic_http_endpoint_config::BearerTokenAuthentication>,
1528 > {
1529 #[allow(unreachable_patterns)]
1530 self.authentication.as_ref().and_then(|v| match v {
1531 crate::model::generic_http_endpoint_config::Authentication::BearerTokenAuthentication(v) => std::option::Option::Some(v),
1532 _ => std::option::Option::None,
1533 })
1534 }
1535
1536 /// Sets the value of [authentication][crate::model::GenericHTTPEndpointConfig::authentication]
1537 /// to hold a `BearerTokenAuthentication`.
1538 ///
1539 /// Note that all the setters affecting `authentication` are
1540 /// mutually exclusive.
1541 ///
1542 /// # Example
1543 /// ```ignore,no_run
1544 /// # use google_cloud_developerconnect_v1::model::GenericHTTPEndpointConfig;
1545 /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BearerTokenAuthentication;
1546 /// let x = GenericHTTPEndpointConfig::new().set_bearer_token_authentication(BearerTokenAuthentication::default()/* use setters */);
1547 /// assert!(x.bearer_token_authentication().is_some());
1548 /// assert!(x.basic_authentication().is_none());
1549 /// ```
1550 pub fn set_bearer_token_authentication<
1551 T: std::convert::Into<
1552 std::boxed::Box<
1553 crate::model::generic_http_endpoint_config::BearerTokenAuthentication,
1554 >,
1555 >,
1556 >(
1557 mut self,
1558 v: T,
1559 ) -> Self {
1560 self.authentication = std::option::Option::Some(
1561 crate::model::generic_http_endpoint_config::Authentication::BearerTokenAuthentication(
1562 v.into(),
1563 ),
1564 );
1565 self
1566 }
1567}
1568
1569impl wkt::message::Message for GenericHTTPEndpointConfig {
1570 fn typename() -> &'static str {
1571 "type.googleapis.com/google.cloud.developerconnect.v1.GenericHTTPEndpointConfig"
1572 }
1573}
1574
1575/// Defines additional types related to [GenericHTTPEndpointConfig].
1576pub mod generic_http_endpoint_config {
1577 #[allow(unused_imports)]
1578 use super::*;
1579
1580 /// Basic authentication with username and password.
1581 #[derive(Clone, Default, PartialEq)]
1582 #[non_exhaustive]
1583 pub struct BasicAuthentication {
1584 /// Required. The username to authenticate as.
1585 pub username: std::string::String,
1586
1587 /// The password to authenticate as.
1588 pub password: std::option::Option<
1589 crate::model::generic_http_endpoint_config::basic_authentication::Password,
1590 >,
1591
1592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1593 }
1594
1595 impl BasicAuthentication {
1596 /// Creates a new default instance.
1597 pub fn new() -> Self {
1598 std::default::Default::default()
1599 }
1600
1601 /// Sets the value of [username][crate::model::generic_http_endpoint_config::BasicAuthentication::username].
1602 ///
1603 /// # Example
1604 /// ```ignore,no_run
1605 /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1606 /// let x = BasicAuthentication::new().set_username("example");
1607 /// ```
1608 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1609 self.username = v.into();
1610 self
1611 }
1612
1613 /// Sets the value of [password][crate::model::generic_http_endpoint_config::BasicAuthentication::password].
1614 ///
1615 /// Note that all the setters affecting `password` are mutually
1616 /// exclusive.
1617 ///
1618 /// # Example
1619 /// ```ignore,no_run
1620 /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1621 /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::basic_authentication::Password;
1622 /// let x = BasicAuthentication::new().set_password(Some(Password::PasswordSecretVersion("example".to_string())));
1623 /// ```
1624 pub fn set_password<
1625 T: std::convert::Into<
1626 std::option::Option<
1627 crate::model::generic_http_endpoint_config::basic_authentication::Password,
1628 >,
1629 >,
1630 >(
1631 mut self,
1632 v: T,
1633 ) -> Self {
1634 self.password = v.into();
1635 self
1636 }
1637
1638 /// The value of [password][crate::model::generic_http_endpoint_config::BasicAuthentication::password]
1639 /// if it holds a `PasswordSecretVersion`, `None` if the field is not set or
1640 /// holds a different branch.
1641 pub fn password_secret_version(&self) -> std::option::Option<&std::string::String> {
1642 #[allow(unreachable_patterns)]
1643 self.password.as_ref().and_then(|v| match v {
1644 crate::model::generic_http_endpoint_config::basic_authentication::Password::PasswordSecretVersion(v) => std::option::Option::Some(v),
1645 _ => std::option::Option::None,
1646 })
1647 }
1648
1649 /// Sets the value of [password][crate::model::generic_http_endpoint_config::BasicAuthentication::password]
1650 /// to hold a `PasswordSecretVersion`.
1651 ///
1652 /// Note that all the setters affecting `password` are
1653 /// mutually exclusive.
1654 ///
1655 /// # Example
1656 /// ```ignore,no_run
1657 /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BasicAuthentication;
1658 /// let x = BasicAuthentication::new().set_password_secret_version("example");
1659 /// assert!(x.password_secret_version().is_some());
1660 /// ```
1661 pub fn set_password_secret_version<T: std::convert::Into<std::string::String>>(
1662 mut self,
1663 v: T,
1664 ) -> Self {
1665 self.password = std::option::Option::Some(
1666 crate::model::generic_http_endpoint_config::basic_authentication::Password::PasswordSecretVersion(
1667 v.into()
1668 )
1669 );
1670 self
1671 }
1672 }
1673
1674 impl wkt::message::Message for BasicAuthentication {
1675 fn typename() -> &'static str {
1676 "type.googleapis.com/google.cloud.developerconnect.v1.GenericHTTPEndpointConfig.BasicAuthentication"
1677 }
1678 }
1679
1680 /// Defines additional types related to [BasicAuthentication].
1681 pub mod basic_authentication {
1682 #[allow(unused_imports)]
1683 use super::*;
1684
1685 /// The password to authenticate as.
1686 #[derive(Clone, Debug, PartialEq)]
1687 #[non_exhaustive]
1688 pub enum Password {
1689 /// The password SecretManager secret version to authenticate as.
1690 PasswordSecretVersion(std::string::String),
1691 }
1692 }
1693
1694 /// Bearer token authentication with a token.
1695 #[derive(Clone, Default, PartialEq)]
1696 #[non_exhaustive]
1697 pub struct BearerTokenAuthentication {
1698 /// The token to authenticate as.
1699 pub token: std::option::Option<
1700 crate::model::generic_http_endpoint_config::bearer_token_authentication::Token,
1701 >,
1702
1703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1704 }
1705
1706 impl BearerTokenAuthentication {
1707 /// Creates a new default instance.
1708 pub fn new() -> Self {
1709 std::default::Default::default()
1710 }
1711
1712 /// Sets the value of [token][crate::model::generic_http_endpoint_config::BearerTokenAuthentication::token].
1713 ///
1714 /// Note that all the setters affecting `token` are mutually
1715 /// exclusive.
1716 ///
1717 /// # Example
1718 /// ```ignore,no_run
1719 /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BearerTokenAuthentication;
1720 /// use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::bearer_token_authentication::Token;
1721 /// let x = BearerTokenAuthentication::new().set_token(Some(Token::TokenSecretVersion("example".to_string())));
1722 /// ```
1723 pub fn set_token<T: std::convert::Into<std::option::Option<crate::model::generic_http_endpoint_config::bearer_token_authentication::Token>>>(mut self, v: T) -> Self
1724 {
1725 self.token = v.into();
1726 self
1727 }
1728
1729 /// The value of [token][crate::model::generic_http_endpoint_config::BearerTokenAuthentication::token]
1730 /// if it holds a `TokenSecretVersion`, `None` if the field is not set or
1731 /// holds a different branch.
1732 pub fn token_secret_version(&self) -> std::option::Option<&std::string::String> {
1733 #[allow(unreachable_patterns)]
1734 self.token.as_ref().and_then(|v| match v {
1735 crate::model::generic_http_endpoint_config::bearer_token_authentication::Token::TokenSecretVersion(v) => std::option::Option::Some(v),
1736 _ => std::option::Option::None,
1737 })
1738 }
1739
1740 /// Sets the value of [token][crate::model::generic_http_endpoint_config::BearerTokenAuthentication::token]
1741 /// to hold a `TokenSecretVersion`.
1742 ///
1743 /// Note that all the setters affecting `token` are
1744 /// mutually exclusive.
1745 ///
1746 /// # Example
1747 /// ```ignore,no_run
1748 /// # use google_cloud_developerconnect_v1::model::generic_http_endpoint_config::BearerTokenAuthentication;
1749 /// let x = BearerTokenAuthentication::new().set_token_secret_version("example");
1750 /// assert!(x.token_secret_version().is_some());
1751 /// ```
1752 pub fn set_token_secret_version<T: std::convert::Into<std::string::String>>(
1753 mut self,
1754 v: T,
1755 ) -> Self {
1756 self.token = std::option::Option::Some(
1757 crate::model::generic_http_endpoint_config::bearer_token_authentication::Token::TokenSecretVersion(
1758 v.into()
1759 )
1760 );
1761 self
1762 }
1763 }
1764
1765 impl wkt::message::Message for BearerTokenAuthentication {
1766 fn typename() -> &'static str {
1767 "type.googleapis.com/google.cloud.developerconnect.v1.GenericHTTPEndpointConfig.BearerTokenAuthentication"
1768 }
1769 }
1770
1771 /// Defines additional types related to [BearerTokenAuthentication].
1772 pub mod bearer_token_authentication {
1773 #[allow(unused_imports)]
1774 use super::*;
1775
1776 /// The token to authenticate as.
1777 #[derive(Clone, Debug, PartialEq)]
1778 #[non_exhaustive]
1779 pub enum Token {
1780 /// Optional. The token SecretManager secret version to authenticate as.
1781 TokenSecretVersion(std::string::String),
1782 }
1783 }
1784
1785 /// The authentication mechanism to use for requests to the HTTP service
1786 /// provider.
1787 #[derive(Clone, Debug, PartialEq)]
1788 #[non_exhaustive]
1789 pub enum Authentication {
1790 /// Optional. Basic authentication with username and password.
1791 BasicAuthentication(
1792 std::boxed::Box<crate::model::generic_http_endpoint_config::BasicAuthentication>,
1793 ),
1794 /// Optional. Bearer token authentication with a token.
1795 BearerTokenAuthentication(
1796 std::boxed::Box<crate::model::generic_http_endpoint_config::BearerTokenAuthentication>,
1797 ),
1798 }
1799}
1800
1801/// Configuration for connections to github.com.
1802#[derive(Clone, Default, PartialEq)]
1803#[non_exhaustive]
1804pub struct GitHubConfig {
1805 /// Required. Immutable. The GitHub Application that was installed to the
1806 /// GitHub user or organization.
1807 pub github_app: crate::model::git_hub_config::GitHubApp,
1808
1809 /// Optional. OAuth credential of the account that authorized the GitHub App.
1810 /// It is recommended to use a robot account instead of a human user account.
1811 /// The OAuth token must be tied to the GitHub App of this config.
1812 pub authorizer_credential: std::option::Option<crate::model::OAuthCredential>,
1813
1814 /// Optional. GitHub App installation id.
1815 pub app_installation_id: i64,
1816
1817 /// Output only. The URI to navigate to in order to manage the installation
1818 /// associated with this GitHubConfig.
1819 pub installation_uri: std::string::String,
1820
1821 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1822}
1823
1824impl GitHubConfig {
1825 /// Creates a new default instance.
1826 pub fn new() -> Self {
1827 std::default::Default::default()
1828 }
1829
1830 /// Sets the value of [github_app][crate::model::GitHubConfig::github_app].
1831 ///
1832 /// # Example
1833 /// ```ignore,no_run
1834 /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1835 /// use google_cloud_developerconnect_v1::model::git_hub_config::GitHubApp;
1836 /// let x0 = GitHubConfig::new().set_github_app(GitHubApp::DeveloperConnect);
1837 /// let x1 = GitHubConfig::new().set_github_app(GitHubApp::Firebase);
1838 /// let x2 = GitHubConfig::new().set_github_app(GitHubApp::GeminiCodeAssist);
1839 /// ```
1840 pub fn set_github_app<T: std::convert::Into<crate::model::git_hub_config::GitHubApp>>(
1841 mut self,
1842 v: T,
1843 ) -> Self {
1844 self.github_app = v.into();
1845 self
1846 }
1847
1848 /// Sets the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
1849 ///
1850 /// # Example
1851 /// ```ignore,no_run
1852 /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1853 /// use google_cloud_developerconnect_v1::model::OAuthCredential;
1854 /// let x = GitHubConfig::new().set_authorizer_credential(OAuthCredential::default()/* use setters */);
1855 /// ```
1856 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
1857 where
1858 T: std::convert::Into<crate::model::OAuthCredential>,
1859 {
1860 self.authorizer_credential = std::option::Option::Some(v.into());
1861 self
1862 }
1863
1864 /// Sets or clears the value of [authorizer_credential][crate::model::GitHubConfig::authorizer_credential].
1865 ///
1866 /// # Example
1867 /// ```ignore,no_run
1868 /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1869 /// use google_cloud_developerconnect_v1::model::OAuthCredential;
1870 /// let x = GitHubConfig::new().set_or_clear_authorizer_credential(Some(OAuthCredential::default()/* use setters */));
1871 /// let x = GitHubConfig::new().set_or_clear_authorizer_credential(None::<OAuthCredential>);
1872 /// ```
1873 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
1874 where
1875 T: std::convert::Into<crate::model::OAuthCredential>,
1876 {
1877 self.authorizer_credential = v.map(|x| x.into());
1878 self
1879 }
1880
1881 /// Sets the value of [app_installation_id][crate::model::GitHubConfig::app_installation_id].
1882 ///
1883 /// # Example
1884 /// ```ignore,no_run
1885 /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1886 /// let x = GitHubConfig::new().set_app_installation_id(42);
1887 /// ```
1888 pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1889 self.app_installation_id = v.into();
1890 self
1891 }
1892
1893 /// Sets the value of [installation_uri][crate::model::GitHubConfig::installation_uri].
1894 ///
1895 /// # Example
1896 /// ```ignore,no_run
1897 /// # use google_cloud_developerconnect_v1::model::GitHubConfig;
1898 /// let x = GitHubConfig::new().set_installation_uri("example");
1899 /// ```
1900 pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
1901 mut self,
1902 v: T,
1903 ) -> Self {
1904 self.installation_uri = v.into();
1905 self
1906 }
1907}
1908
1909impl wkt::message::Message for GitHubConfig {
1910 fn typename() -> &'static str {
1911 "type.googleapis.com/google.cloud.developerconnect.v1.GitHubConfig"
1912 }
1913}
1914
1915/// Defines additional types related to [GitHubConfig].
1916pub mod git_hub_config {
1917 #[allow(unused_imports)]
1918 use super::*;
1919
1920 /// Represents the various GitHub Applications that can be installed to a
1921 /// GitHub user or organization and used with Developer Connect.
1922 ///
1923 /// # Working with unknown values
1924 ///
1925 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1926 /// additional enum variants at any time. Adding new variants is not considered
1927 /// a breaking change. Applications should write their code in anticipation of:
1928 ///
1929 /// - New values appearing in future releases of the client library, **and**
1930 /// - New values received dynamically, without application changes.
1931 ///
1932 /// Please consult the [Working with enums] section in the user guide for some
1933 /// guidelines.
1934 ///
1935 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1936 #[derive(Clone, Debug, PartialEq)]
1937 #[non_exhaustive]
1938 pub enum GitHubApp {
1939 /// GitHub App not specified.
1940 Unspecified,
1941 /// The Developer Connect GitHub Application.
1942 DeveloperConnect,
1943 /// The Firebase GitHub Application.
1944 Firebase,
1945 /// The Gemini Code Assist Application.
1946 GeminiCodeAssist,
1947 /// If set, the enum was initialized with an unknown value.
1948 ///
1949 /// Applications can examine the value using [GitHubApp::value] or
1950 /// [GitHubApp::name].
1951 UnknownValue(git_hub_app::UnknownValue),
1952 }
1953
1954 #[doc(hidden)]
1955 pub mod git_hub_app {
1956 #[allow(unused_imports)]
1957 use super::*;
1958 #[derive(Clone, Debug, PartialEq)]
1959 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1960 }
1961
1962 impl GitHubApp {
1963 /// Gets the enum value.
1964 ///
1965 /// Returns `None` if the enum contains an unknown value deserialized from
1966 /// the string representation of enums.
1967 pub fn value(&self) -> std::option::Option<i32> {
1968 match self {
1969 Self::Unspecified => std::option::Option::Some(0),
1970 Self::DeveloperConnect => std::option::Option::Some(1),
1971 Self::Firebase => std::option::Option::Some(2),
1972 Self::GeminiCodeAssist => std::option::Option::Some(3),
1973 Self::UnknownValue(u) => u.0.value(),
1974 }
1975 }
1976
1977 /// Gets the enum value as a string.
1978 ///
1979 /// Returns `None` if the enum contains an unknown value deserialized from
1980 /// the integer representation of enums.
1981 pub fn name(&self) -> std::option::Option<&str> {
1982 match self {
1983 Self::Unspecified => std::option::Option::Some("GIT_HUB_APP_UNSPECIFIED"),
1984 Self::DeveloperConnect => std::option::Option::Some("DEVELOPER_CONNECT"),
1985 Self::Firebase => std::option::Option::Some("FIREBASE"),
1986 Self::GeminiCodeAssist => std::option::Option::Some("GEMINI_CODE_ASSIST"),
1987 Self::UnknownValue(u) => u.0.name(),
1988 }
1989 }
1990 }
1991
1992 impl std::default::Default for GitHubApp {
1993 fn default() -> Self {
1994 use std::convert::From;
1995 Self::from(0)
1996 }
1997 }
1998
1999 impl std::fmt::Display for GitHubApp {
2000 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2001 wkt::internal::display_enum(f, self.name(), self.value())
2002 }
2003 }
2004
2005 impl std::convert::From<i32> for GitHubApp {
2006 fn from(value: i32) -> Self {
2007 match value {
2008 0 => Self::Unspecified,
2009 1 => Self::DeveloperConnect,
2010 2 => Self::Firebase,
2011 3 => Self::GeminiCodeAssist,
2012 _ => Self::UnknownValue(git_hub_app::UnknownValue(
2013 wkt::internal::UnknownEnumValue::Integer(value),
2014 )),
2015 }
2016 }
2017 }
2018
2019 impl std::convert::From<&str> for GitHubApp {
2020 fn from(value: &str) -> Self {
2021 use std::string::ToString;
2022 match value {
2023 "GIT_HUB_APP_UNSPECIFIED" => Self::Unspecified,
2024 "DEVELOPER_CONNECT" => Self::DeveloperConnect,
2025 "FIREBASE" => Self::Firebase,
2026 "GEMINI_CODE_ASSIST" => Self::GeminiCodeAssist,
2027 _ => Self::UnknownValue(git_hub_app::UnknownValue(
2028 wkt::internal::UnknownEnumValue::String(value.to_string()),
2029 )),
2030 }
2031 }
2032 }
2033
2034 impl serde::ser::Serialize for GitHubApp {
2035 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2036 where
2037 S: serde::Serializer,
2038 {
2039 match self {
2040 Self::Unspecified => serializer.serialize_i32(0),
2041 Self::DeveloperConnect => serializer.serialize_i32(1),
2042 Self::Firebase => serializer.serialize_i32(2),
2043 Self::GeminiCodeAssist => serializer.serialize_i32(3),
2044 Self::UnknownValue(u) => u.0.serialize(serializer),
2045 }
2046 }
2047 }
2048
2049 impl<'de> serde::de::Deserialize<'de> for GitHubApp {
2050 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2051 where
2052 D: serde::Deserializer<'de>,
2053 {
2054 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GitHubApp>::new(
2055 ".google.cloud.developerconnect.v1.GitHubConfig.GitHubApp",
2056 ))
2057 }
2058 }
2059}
2060
2061/// Configuration for connections to an instance of GitHub Enterprise.
2062#[derive(Clone, Default, PartialEq)]
2063#[non_exhaustive]
2064pub struct GitHubEnterpriseConfig {
2065 /// Required. The URI of the GitHub Enterprise host this connection is for.
2066 pub host_uri: std::string::String,
2067
2068 /// Optional. ID of the GitHub App created from the manifest.
2069 pub app_id: i64,
2070
2071 /// Output only. The URL-friendly name of the GitHub App.
2072 pub app_slug: std::string::String,
2073
2074 /// Optional. SecretManager resource containing the private key of the GitHub
2075 /// App, formatted as `projects/*/secrets/*/versions/*` or
2076 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2077 /// supported in that location).
2078 pub private_key_secret_version: std::string::String,
2079
2080 /// Optional. SecretManager resource containing the webhook secret of the
2081 /// GitHub App, formatted as `projects/*/secrets/*/versions/*` or
2082 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2083 /// supported in that location).
2084 pub webhook_secret_secret_version: std::string::String,
2085
2086 /// Optional. ID of the installation of the GitHub App.
2087 pub app_installation_id: i64,
2088
2089 /// Output only. The URI to navigate to in order to manage the installation
2090 /// associated with this GitHubEnterpriseConfig.
2091 pub installation_uri: std::string::String,
2092
2093 /// Optional. Configuration for using Service Directory to privately connect to
2094 /// a GitHub Enterprise server. This should only be set if the GitHub
2095 /// Enterprise server is hosted on-premises and not reachable by public
2096 /// internet. If this field is left empty, calls to the GitHub Enterprise
2097 /// server will be made over the public internet.
2098 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2099
2100 /// Output only. GitHub Enterprise version installed at the host_uri.
2101 pub server_version: std::string::String,
2102
2103 /// Optional. SSL certificate to use for requests to GitHub Enterprise.
2104 pub ssl_ca_certificate: std::string::String,
2105
2106 /// Optional. Immutable. GitHub Enterprise organization in which the GitHub App
2107 /// is created.
2108 pub organization: std::string::String,
2109
2110 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2111}
2112
2113impl GitHubEnterpriseConfig {
2114 /// Creates a new default instance.
2115 pub fn new() -> Self {
2116 std::default::Default::default()
2117 }
2118
2119 /// Sets the value of [host_uri][crate::model::GitHubEnterpriseConfig::host_uri].
2120 ///
2121 /// # Example
2122 /// ```ignore,no_run
2123 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2124 /// let x = GitHubEnterpriseConfig::new().set_host_uri("example");
2125 /// ```
2126 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2127 self.host_uri = v.into();
2128 self
2129 }
2130
2131 /// Sets the value of [app_id][crate::model::GitHubEnterpriseConfig::app_id].
2132 ///
2133 /// # Example
2134 /// ```ignore,no_run
2135 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2136 /// let x = GitHubEnterpriseConfig::new().set_app_id(42);
2137 /// ```
2138 pub fn set_app_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2139 self.app_id = v.into();
2140 self
2141 }
2142
2143 /// Sets the value of [app_slug][crate::model::GitHubEnterpriseConfig::app_slug].
2144 ///
2145 /// # Example
2146 /// ```ignore,no_run
2147 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2148 /// let x = GitHubEnterpriseConfig::new().set_app_slug("example");
2149 /// ```
2150 pub fn set_app_slug<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2151 self.app_slug = v.into();
2152 self
2153 }
2154
2155 /// Sets the value of [private_key_secret_version][crate::model::GitHubEnterpriseConfig::private_key_secret_version].
2156 ///
2157 /// # Example
2158 /// ```ignore,no_run
2159 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2160 /// let x = GitHubEnterpriseConfig::new().set_private_key_secret_version("example");
2161 /// ```
2162 pub fn set_private_key_secret_version<T: std::convert::Into<std::string::String>>(
2163 mut self,
2164 v: T,
2165 ) -> Self {
2166 self.private_key_secret_version = v.into();
2167 self
2168 }
2169
2170 /// Sets the value of [webhook_secret_secret_version][crate::model::GitHubEnterpriseConfig::webhook_secret_secret_version].
2171 ///
2172 /// # Example
2173 /// ```ignore,no_run
2174 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2175 /// let x = GitHubEnterpriseConfig::new().set_webhook_secret_secret_version("example");
2176 /// ```
2177 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2178 mut self,
2179 v: T,
2180 ) -> Self {
2181 self.webhook_secret_secret_version = v.into();
2182 self
2183 }
2184
2185 /// Sets the value of [app_installation_id][crate::model::GitHubEnterpriseConfig::app_installation_id].
2186 ///
2187 /// # Example
2188 /// ```ignore,no_run
2189 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2190 /// let x = GitHubEnterpriseConfig::new().set_app_installation_id(42);
2191 /// ```
2192 pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2193 self.app_installation_id = v.into();
2194 self
2195 }
2196
2197 /// Sets the value of [installation_uri][crate::model::GitHubEnterpriseConfig::installation_uri].
2198 ///
2199 /// # Example
2200 /// ```ignore,no_run
2201 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2202 /// let x = GitHubEnterpriseConfig::new().set_installation_uri("example");
2203 /// ```
2204 pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
2205 mut self,
2206 v: T,
2207 ) -> Self {
2208 self.installation_uri = v.into();
2209 self
2210 }
2211
2212 /// Sets the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
2213 ///
2214 /// # Example
2215 /// ```ignore,no_run
2216 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2217 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2218 /// let x = GitHubEnterpriseConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2219 /// ```
2220 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2221 where
2222 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2223 {
2224 self.service_directory_config = std::option::Option::Some(v.into());
2225 self
2226 }
2227
2228 /// Sets or clears the value of [service_directory_config][crate::model::GitHubEnterpriseConfig::service_directory_config].
2229 ///
2230 /// # Example
2231 /// ```ignore,no_run
2232 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2233 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2234 /// let x = GitHubEnterpriseConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2235 /// let x = GitHubEnterpriseConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2236 /// ```
2237 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2238 where
2239 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2240 {
2241 self.service_directory_config = v.map(|x| x.into());
2242 self
2243 }
2244
2245 /// Sets the value of [server_version][crate::model::GitHubEnterpriseConfig::server_version].
2246 ///
2247 /// # Example
2248 /// ```ignore,no_run
2249 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2250 /// let x = GitHubEnterpriseConfig::new().set_server_version("example");
2251 /// ```
2252 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2253 self.server_version = v.into();
2254 self
2255 }
2256
2257 /// Sets the value of [ssl_ca_certificate][crate::model::GitHubEnterpriseConfig::ssl_ca_certificate].
2258 ///
2259 /// # Example
2260 /// ```ignore,no_run
2261 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2262 /// let x = GitHubEnterpriseConfig::new().set_ssl_ca_certificate("example");
2263 /// ```
2264 pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2265 mut self,
2266 v: T,
2267 ) -> Self {
2268 self.ssl_ca_certificate = v.into();
2269 self
2270 }
2271
2272 /// Sets the value of [organization][crate::model::GitHubEnterpriseConfig::organization].
2273 ///
2274 /// # Example
2275 /// ```ignore,no_run
2276 /// # use google_cloud_developerconnect_v1::model::GitHubEnterpriseConfig;
2277 /// let x = GitHubEnterpriseConfig::new().set_organization("example");
2278 /// ```
2279 pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2280 self.organization = v.into();
2281 self
2282 }
2283}
2284
2285impl wkt::message::Message for GitHubEnterpriseConfig {
2286 fn typename() -> &'static str {
2287 "type.googleapis.com/google.cloud.developerconnect.v1.GitHubEnterpriseConfig"
2288 }
2289}
2290
2291/// ServiceDirectoryConfig represents Service Directory configuration for a
2292/// connection.
2293#[derive(Clone, Default, PartialEq)]
2294#[non_exhaustive]
2295pub struct ServiceDirectoryConfig {
2296 /// Required. The Service Directory service name.
2297 /// Format:
2298 /// projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
2299 pub service: std::string::String,
2300
2301 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2302}
2303
2304impl ServiceDirectoryConfig {
2305 /// Creates a new default instance.
2306 pub fn new() -> Self {
2307 std::default::Default::default()
2308 }
2309
2310 /// Sets the value of [service][crate::model::ServiceDirectoryConfig::service].
2311 ///
2312 /// # Example
2313 /// ```ignore,no_run
2314 /// # use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2315 /// let x = ServiceDirectoryConfig::new().set_service("example");
2316 /// ```
2317 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2318 self.service = v.into();
2319 self
2320 }
2321}
2322
2323impl wkt::message::Message for ServiceDirectoryConfig {
2324 fn typename() -> &'static str {
2325 "type.googleapis.com/google.cloud.developerconnect.v1.ServiceDirectoryConfig"
2326 }
2327}
2328
2329/// Represents an OAuth token of the account that authorized the Connection,
2330/// and associated metadata.
2331#[derive(Clone, Default, PartialEq)]
2332#[non_exhaustive]
2333pub struct OAuthCredential {
2334 /// Required. A SecretManager resource containing the OAuth token that
2335 /// authorizes the connection. Format: `projects/*/secrets/*/versions/*` or
2336 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2337 /// supported in that location).
2338 pub oauth_token_secret_version: std::string::String,
2339
2340 /// Output only. The username associated with this token.
2341 pub username: std::string::String,
2342
2343 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2344}
2345
2346impl OAuthCredential {
2347 /// Creates a new default instance.
2348 pub fn new() -> Self {
2349 std::default::Default::default()
2350 }
2351
2352 /// Sets the value of [oauth_token_secret_version][crate::model::OAuthCredential::oauth_token_secret_version].
2353 ///
2354 /// # Example
2355 /// ```ignore,no_run
2356 /// # use google_cloud_developerconnect_v1::model::OAuthCredential;
2357 /// let x = OAuthCredential::new().set_oauth_token_secret_version("example");
2358 /// ```
2359 pub fn set_oauth_token_secret_version<T: std::convert::Into<std::string::String>>(
2360 mut self,
2361 v: T,
2362 ) -> Self {
2363 self.oauth_token_secret_version = v.into();
2364 self
2365 }
2366
2367 /// Sets the value of [username][crate::model::OAuthCredential::username].
2368 ///
2369 /// # Example
2370 /// ```ignore,no_run
2371 /// # use google_cloud_developerconnect_v1::model::OAuthCredential;
2372 /// let x = OAuthCredential::new().set_username("example");
2373 /// ```
2374 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2375 self.username = v.into();
2376 self
2377 }
2378}
2379
2380impl wkt::message::Message for OAuthCredential {
2381 fn typename() -> &'static str {
2382 "type.googleapis.com/google.cloud.developerconnect.v1.OAuthCredential"
2383 }
2384}
2385
2386/// Configuration for connections to gitlab.com.
2387#[derive(Clone, Default, PartialEq)]
2388#[non_exhaustive]
2389pub struct GitLabConfig {
2390 /// Required. Immutable. SecretManager resource containing the webhook secret
2391 /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*` or
2392 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2393 /// supported in that location). This is used to validate webhooks.
2394 pub webhook_secret_secret_version: std::string::String,
2395
2396 /// Required. A GitLab personal access token with the minimum `read_api` scope
2397 /// access and a minimum role of `reporter`. The GitLab Projects visible to
2398 /// this Personal Access Token will control which Projects Developer Connect
2399 /// has access to.
2400 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2401
2402 /// Required. A GitLab personal access token with the minimum `api` scope
2403 /// access and a minimum role of `maintainer`. The GitLab Projects visible to
2404 /// this Personal Access Token will control which Projects Developer Connect
2405 /// has access to.
2406 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2407
2408 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2409}
2410
2411impl GitLabConfig {
2412 /// Creates a new default instance.
2413 pub fn new() -> Self {
2414 std::default::Default::default()
2415 }
2416
2417 /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabConfig::webhook_secret_secret_version].
2418 ///
2419 /// # Example
2420 /// ```ignore,no_run
2421 /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2422 /// let x = GitLabConfig::new().set_webhook_secret_secret_version("example");
2423 /// ```
2424 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2425 mut self,
2426 v: T,
2427 ) -> Self {
2428 self.webhook_secret_secret_version = v.into();
2429 self
2430 }
2431
2432 /// Sets the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
2433 ///
2434 /// # Example
2435 /// ```ignore,no_run
2436 /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2437 /// use google_cloud_developerconnect_v1::model::UserCredential;
2438 /// let x = GitLabConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2439 /// ```
2440 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2441 where
2442 T: std::convert::Into<crate::model::UserCredential>,
2443 {
2444 self.read_authorizer_credential = std::option::Option::Some(v.into());
2445 self
2446 }
2447
2448 /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabConfig::read_authorizer_credential].
2449 ///
2450 /// # Example
2451 /// ```ignore,no_run
2452 /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2453 /// use google_cloud_developerconnect_v1::model::UserCredential;
2454 /// let x = GitLabConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2455 /// let x = GitLabConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2456 /// ```
2457 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2458 where
2459 T: std::convert::Into<crate::model::UserCredential>,
2460 {
2461 self.read_authorizer_credential = v.map(|x| x.into());
2462 self
2463 }
2464
2465 /// Sets the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
2466 ///
2467 /// # Example
2468 /// ```ignore,no_run
2469 /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2470 /// use google_cloud_developerconnect_v1::model::UserCredential;
2471 /// let x = GitLabConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2472 /// ```
2473 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2474 where
2475 T: std::convert::Into<crate::model::UserCredential>,
2476 {
2477 self.authorizer_credential = std::option::Option::Some(v.into());
2478 self
2479 }
2480
2481 /// Sets or clears the value of [authorizer_credential][crate::model::GitLabConfig::authorizer_credential].
2482 ///
2483 /// # Example
2484 /// ```ignore,no_run
2485 /// # use google_cloud_developerconnect_v1::model::GitLabConfig;
2486 /// use google_cloud_developerconnect_v1::model::UserCredential;
2487 /// let x = GitLabConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2488 /// let x = GitLabConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2489 /// ```
2490 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2491 where
2492 T: std::convert::Into<crate::model::UserCredential>,
2493 {
2494 self.authorizer_credential = v.map(|x| x.into());
2495 self
2496 }
2497}
2498
2499impl wkt::message::Message for GitLabConfig {
2500 fn typename() -> &'static str {
2501 "type.googleapis.com/google.cloud.developerconnect.v1.GitLabConfig"
2502 }
2503}
2504
2505/// Represents a personal access token that authorized the Connection,
2506/// and associated metadata.
2507#[derive(Clone, Default, PartialEq)]
2508#[non_exhaustive]
2509pub struct UserCredential {
2510 /// Required. A SecretManager resource containing the user token that
2511 /// authorizes the Developer Connect connection. Format:
2512 /// `projects/*/secrets/*/versions/*` or
2513 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2514 /// supported in that location).
2515 pub user_token_secret_version: std::string::String,
2516
2517 /// Output only. The username associated with this token.
2518 pub username: std::string::String,
2519
2520 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2521}
2522
2523impl UserCredential {
2524 /// Creates a new default instance.
2525 pub fn new() -> Self {
2526 std::default::Default::default()
2527 }
2528
2529 /// Sets the value of [user_token_secret_version][crate::model::UserCredential::user_token_secret_version].
2530 ///
2531 /// # Example
2532 /// ```ignore,no_run
2533 /// # use google_cloud_developerconnect_v1::model::UserCredential;
2534 /// let x = UserCredential::new().set_user_token_secret_version("example");
2535 /// ```
2536 pub fn set_user_token_secret_version<T: std::convert::Into<std::string::String>>(
2537 mut self,
2538 v: T,
2539 ) -> Self {
2540 self.user_token_secret_version = v.into();
2541 self
2542 }
2543
2544 /// Sets the value of [username][crate::model::UserCredential::username].
2545 ///
2546 /// # Example
2547 /// ```ignore,no_run
2548 /// # use google_cloud_developerconnect_v1::model::UserCredential;
2549 /// let x = UserCredential::new().set_username("example");
2550 /// ```
2551 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2552 self.username = v.into();
2553 self
2554 }
2555}
2556
2557impl wkt::message::Message for UserCredential {
2558 fn typename() -> &'static str {
2559 "type.googleapis.com/google.cloud.developerconnect.v1.UserCredential"
2560 }
2561}
2562
2563/// Configuration for connections to an instance of GitLab Enterprise.
2564#[derive(Clone, Default, PartialEq)]
2565#[non_exhaustive]
2566pub struct GitLabEnterpriseConfig {
2567 /// Required. The URI of the GitLab Enterprise host this connection is for.
2568 pub host_uri: std::string::String,
2569
2570 /// Required. Immutable. SecretManager resource containing the webhook secret
2571 /// of a GitLab project, formatted as `projects/*/secrets/*/versions/*` or
2572 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2573 /// supported in that location). This is used to validate webhooks.
2574 pub webhook_secret_secret_version: std::string::String,
2575
2576 /// Required. A GitLab personal access token with the minimum `read_api` scope
2577 /// access and a minimum role of `reporter`. The GitLab Projects visible to
2578 /// this Personal Access Token will control which Projects Developer Connect
2579 /// has access to.
2580 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2581
2582 /// Required. A GitLab personal access token with the minimum `api` scope
2583 /// access and a minimum role of `maintainer`. The GitLab Projects visible to
2584 /// this Personal Access Token will control which Projects Developer Connect
2585 /// has access to.
2586 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2587
2588 /// Optional. Configuration for using Service Directory to privately connect to
2589 /// a GitLab Enterprise instance. This should only be set if the GitLab
2590 /// Enterprise server is hosted on-premises and not reachable by public
2591 /// internet. If this field is left empty, calls to the GitLab Enterprise
2592 /// server will be made over the public internet.
2593 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2594
2595 /// Optional. SSL Certificate Authority certificate to use for requests to
2596 /// GitLab Enterprise instance.
2597 pub ssl_ca_certificate: std::string::String,
2598
2599 /// Output only. Version of the GitLab Enterprise server running on the
2600 /// `host_uri`.
2601 pub server_version: std::string::String,
2602
2603 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2604}
2605
2606impl GitLabEnterpriseConfig {
2607 /// Creates a new default instance.
2608 pub fn new() -> Self {
2609 std::default::Default::default()
2610 }
2611
2612 /// Sets the value of [host_uri][crate::model::GitLabEnterpriseConfig::host_uri].
2613 ///
2614 /// # Example
2615 /// ```ignore,no_run
2616 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2617 /// let x = GitLabEnterpriseConfig::new().set_host_uri("example");
2618 /// ```
2619 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2620 self.host_uri = v.into();
2621 self
2622 }
2623
2624 /// Sets the value of [webhook_secret_secret_version][crate::model::GitLabEnterpriseConfig::webhook_secret_secret_version].
2625 ///
2626 /// # Example
2627 /// ```ignore,no_run
2628 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2629 /// let x = GitLabEnterpriseConfig::new().set_webhook_secret_secret_version("example");
2630 /// ```
2631 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2632 mut self,
2633 v: T,
2634 ) -> Self {
2635 self.webhook_secret_secret_version = v.into();
2636 self
2637 }
2638
2639 /// Sets the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
2640 ///
2641 /// # Example
2642 /// ```ignore,no_run
2643 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2644 /// use google_cloud_developerconnect_v1::model::UserCredential;
2645 /// let x = GitLabEnterpriseConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2646 /// ```
2647 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2648 where
2649 T: std::convert::Into<crate::model::UserCredential>,
2650 {
2651 self.read_authorizer_credential = std::option::Option::Some(v.into());
2652 self
2653 }
2654
2655 /// Sets or clears the value of [read_authorizer_credential][crate::model::GitLabEnterpriseConfig::read_authorizer_credential].
2656 ///
2657 /// # Example
2658 /// ```ignore,no_run
2659 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2660 /// use google_cloud_developerconnect_v1::model::UserCredential;
2661 /// let x = GitLabEnterpriseConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2662 /// let x = GitLabEnterpriseConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2663 /// ```
2664 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2665 where
2666 T: std::convert::Into<crate::model::UserCredential>,
2667 {
2668 self.read_authorizer_credential = v.map(|x| x.into());
2669 self
2670 }
2671
2672 /// Sets the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
2673 ///
2674 /// # Example
2675 /// ```ignore,no_run
2676 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2677 /// use google_cloud_developerconnect_v1::model::UserCredential;
2678 /// let x = GitLabEnterpriseConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2679 /// ```
2680 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2681 where
2682 T: std::convert::Into<crate::model::UserCredential>,
2683 {
2684 self.authorizer_credential = std::option::Option::Some(v.into());
2685 self
2686 }
2687
2688 /// Sets or clears the value of [authorizer_credential][crate::model::GitLabEnterpriseConfig::authorizer_credential].
2689 ///
2690 /// # Example
2691 /// ```ignore,no_run
2692 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2693 /// use google_cloud_developerconnect_v1::model::UserCredential;
2694 /// let x = GitLabEnterpriseConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2695 /// let x = GitLabEnterpriseConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2696 /// ```
2697 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2698 where
2699 T: std::convert::Into<crate::model::UserCredential>,
2700 {
2701 self.authorizer_credential = v.map(|x| x.into());
2702 self
2703 }
2704
2705 /// Sets the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
2706 ///
2707 /// # Example
2708 /// ```ignore,no_run
2709 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2710 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2711 /// let x = GitLabEnterpriseConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2712 /// ```
2713 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2714 where
2715 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2716 {
2717 self.service_directory_config = std::option::Option::Some(v.into());
2718 self
2719 }
2720
2721 /// Sets or clears the value of [service_directory_config][crate::model::GitLabEnterpriseConfig::service_directory_config].
2722 ///
2723 /// # Example
2724 /// ```ignore,no_run
2725 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2726 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2727 /// let x = GitLabEnterpriseConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2728 /// let x = GitLabEnterpriseConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2729 /// ```
2730 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2731 where
2732 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2733 {
2734 self.service_directory_config = v.map(|x| x.into());
2735 self
2736 }
2737
2738 /// Sets the value of [ssl_ca_certificate][crate::model::GitLabEnterpriseConfig::ssl_ca_certificate].
2739 ///
2740 /// # Example
2741 /// ```ignore,no_run
2742 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2743 /// let x = GitLabEnterpriseConfig::new().set_ssl_ca_certificate("example");
2744 /// ```
2745 pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2746 mut self,
2747 v: T,
2748 ) -> Self {
2749 self.ssl_ca_certificate = v.into();
2750 self
2751 }
2752
2753 /// Sets the value of [server_version][crate::model::GitLabEnterpriseConfig::server_version].
2754 ///
2755 /// # Example
2756 /// ```ignore,no_run
2757 /// # use google_cloud_developerconnect_v1::model::GitLabEnterpriseConfig;
2758 /// let x = GitLabEnterpriseConfig::new().set_server_version("example");
2759 /// ```
2760 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2761 self.server_version = v.into();
2762 self
2763 }
2764}
2765
2766impl wkt::message::Message for GitLabEnterpriseConfig {
2767 fn typename() -> &'static str {
2768 "type.googleapis.com/google.cloud.developerconnect.v1.GitLabEnterpriseConfig"
2769 }
2770}
2771
2772/// Configuration for connections to an instance of Bitbucket Data Center.
2773#[derive(Clone, Default, PartialEq)]
2774#[non_exhaustive]
2775pub struct BitbucketDataCenterConfig {
2776 /// Required. The URI of the Bitbucket Data Center host this connection is for.
2777 pub host_uri: std::string::String,
2778
2779 /// Required. Immutable. SecretManager resource containing the webhook secret
2780 /// used to verify webhook events, formatted as
2781 /// `projects/*/secrets/*/versions/*` or
2782 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2783 /// supported in that location). This is used to validate webhooks.
2784 pub webhook_secret_secret_version: std::string::String,
2785
2786 /// Required. An http access token with the minimum `Repository read` access.
2787 /// It's recommended to use a system account to generate the credentials.
2788 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2789
2790 /// Required. An http access token with the minimum `Repository admin` scope
2791 /// access. This is needed to create webhooks. It's recommended to use a system
2792 /// account to generate these credentials.
2793 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2794
2795 /// Optional. Configuration for using Service Directory to privately connect to
2796 /// a Bitbucket Data Center instance. This should only be set if the Bitbucket
2797 /// Data Center is hosted on-premises and not reachable by public internet. If
2798 /// this field is left empty, calls to the Bitbucket Data Center will be made
2799 /// over the public internet.
2800 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2801
2802 /// Optional. SSL certificate authority to trust when making requests to
2803 /// Bitbucket Data Center.
2804 pub ssl_ca_certificate: std::string::String,
2805
2806 /// Output only. Version of the Bitbucket Data Center server running on the
2807 /// `host_uri`.
2808 pub server_version: std::string::String,
2809
2810 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2811}
2812
2813impl BitbucketDataCenterConfig {
2814 /// Creates a new default instance.
2815 pub fn new() -> Self {
2816 std::default::Default::default()
2817 }
2818
2819 /// Sets the value of [host_uri][crate::model::BitbucketDataCenterConfig::host_uri].
2820 ///
2821 /// # Example
2822 /// ```ignore,no_run
2823 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2824 /// let x = BitbucketDataCenterConfig::new().set_host_uri("example");
2825 /// ```
2826 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2827 self.host_uri = v.into();
2828 self
2829 }
2830
2831 /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketDataCenterConfig::webhook_secret_secret_version].
2832 ///
2833 /// # Example
2834 /// ```ignore,no_run
2835 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2836 /// let x = BitbucketDataCenterConfig::new().set_webhook_secret_secret_version("example");
2837 /// ```
2838 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2839 mut self,
2840 v: T,
2841 ) -> Self {
2842 self.webhook_secret_secret_version = v.into();
2843 self
2844 }
2845
2846 /// Sets the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
2847 ///
2848 /// # Example
2849 /// ```ignore,no_run
2850 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2851 /// use google_cloud_developerconnect_v1::model::UserCredential;
2852 /// let x = BitbucketDataCenterConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
2853 /// ```
2854 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2855 where
2856 T: std::convert::Into<crate::model::UserCredential>,
2857 {
2858 self.read_authorizer_credential = std::option::Option::Some(v.into());
2859 self
2860 }
2861
2862 /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketDataCenterConfig::read_authorizer_credential].
2863 ///
2864 /// # Example
2865 /// ```ignore,no_run
2866 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2867 /// use google_cloud_developerconnect_v1::model::UserCredential;
2868 /// let x = BitbucketDataCenterConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
2869 /// let x = BitbucketDataCenterConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
2870 /// ```
2871 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2872 where
2873 T: std::convert::Into<crate::model::UserCredential>,
2874 {
2875 self.read_authorizer_credential = v.map(|x| x.into());
2876 self
2877 }
2878
2879 /// Sets the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
2880 ///
2881 /// # Example
2882 /// ```ignore,no_run
2883 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2884 /// use google_cloud_developerconnect_v1::model::UserCredential;
2885 /// let x = BitbucketDataCenterConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
2886 /// ```
2887 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2888 where
2889 T: std::convert::Into<crate::model::UserCredential>,
2890 {
2891 self.authorizer_credential = std::option::Option::Some(v.into());
2892 self
2893 }
2894
2895 /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketDataCenterConfig::authorizer_credential].
2896 ///
2897 /// # Example
2898 /// ```ignore,no_run
2899 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2900 /// use google_cloud_developerconnect_v1::model::UserCredential;
2901 /// let x = BitbucketDataCenterConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
2902 /// let x = BitbucketDataCenterConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
2903 /// ```
2904 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2905 where
2906 T: std::convert::Into<crate::model::UserCredential>,
2907 {
2908 self.authorizer_credential = v.map(|x| x.into());
2909 self
2910 }
2911
2912 /// Sets the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
2913 ///
2914 /// # Example
2915 /// ```ignore,no_run
2916 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2917 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2918 /// let x = BitbucketDataCenterConfig::new().set_service_directory_config(ServiceDirectoryConfig::default()/* use setters */);
2919 /// ```
2920 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2921 where
2922 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2923 {
2924 self.service_directory_config = std::option::Option::Some(v.into());
2925 self
2926 }
2927
2928 /// Sets or clears the value of [service_directory_config][crate::model::BitbucketDataCenterConfig::service_directory_config].
2929 ///
2930 /// # Example
2931 /// ```ignore,no_run
2932 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2933 /// use google_cloud_developerconnect_v1::model::ServiceDirectoryConfig;
2934 /// let x = BitbucketDataCenterConfig::new().set_or_clear_service_directory_config(Some(ServiceDirectoryConfig::default()/* use setters */));
2935 /// let x = BitbucketDataCenterConfig::new().set_or_clear_service_directory_config(None::<ServiceDirectoryConfig>);
2936 /// ```
2937 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2938 where
2939 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2940 {
2941 self.service_directory_config = v.map(|x| x.into());
2942 self
2943 }
2944
2945 /// Sets the value of [ssl_ca_certificate][crate::model::BitbucketDataCenterConfig::ssl_ca_certificate].
2946 ///
2947 /// # Example
2948 /// ```ignore,no_run
2949 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2950 /// let x = BitbucketDataCenterConfig::new().set_ssl_ca_certificate("example");
2951 /// ```
2952 pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2953 mut self,
2954 v: T,
2955 ) -> Self {
2956 self.ssl_ca_certificate = v.into();
2957 self
2958 }
2959
2960 /// Sets the value of [server_version][crate::model::BitbucketDataCenterConfig::server_version].
2961 ///
2962 /// # Example
2963 /// ```ignore,no_run
2964 /// # use google_cloud_developerconnect_v1::model::BitbucketDataCenterConfig;
2965 /// let x = BitbucketDataCenterConfig::new().set_server_version("example");
2966 /// ```
2967 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2968 self.server_version = v.into();
2969 self
2970 }
2971}
2972
2973impl wkt::message::Message for BitbucketDataCenterConfig {
2974 fn typename() -> &'static str {
2975 "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketDataCenterConfig"
2976 }
2977}
2978
2979/// Configuration for connections to an instance of Bitbucket Cloud.
2980#[derive(Clone, Default, PartialEq)]
2981#[non_exhaustive]
2982pub struct BitbucketCloudConfig {
2983 /// Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud
2984 /// Platform.
2985 pub workspace: std::string::String,
2986
2987 /// Required. Immutable. SecretManager resource containing the webhook secret
2988 /// used to verify webhook events, formatted as
2989 /// `projects/*/secrets/*/versions/*` or
2990 /// `projects/*/locations/*/secrets/*/versions/*` (if regional secrets are
2991 /// supported in that location). This is used to validate and create webhooks.
2992 pub webhook_secret_secret_version: std::string::String,
2993
2994 /// Required. An access token with the minimum `repository` access.
2995 /// It can either be a workspace, project or repository access token.
2996 /// It's recommended to use a system account to generate the credentials.
2997 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2998
2999 /// Required. An access token with the minimum `repository`, `pullrequest` and
3000 /// `webhook` scope access. It can either be a workspace, project or repository
3001 /// access token. This is needed to create webhooks. It's recommended to use a
3002 /// system account to generate these credentials.
3003 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
3004
3005 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3006}
3007
3008impl BitbucketCloudConfig {
3009 /// Creates a new default instance.
3010 pub fn new() -> Self {
3011 std::default::Default::default()
3012 }
3013
3014 /// Sets the value of [workspace][crate::model::BitbucketCloudConfig::workspace].
3015 ///
3016 /// # Example
3017 /// ```ignore,no_run
3018 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3019 /// let x = BitbucketCloudConfig::new().set_workspace("example");
3020 /// ```
3021 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3022 self.workspace = v.into();
3023 self
3024 }
3025
3026 /// Sets the value of [webhook_secret_secret_version][crate::model::BitbucketCloudConfig::webhook_secret_secret_version].
3027 ///
3028 /// # Example
3029 /// ```ignore,no_run
3030 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3031 /// let x = BitbucketCloudConfig::new().set_webhook_secret_secret_version("example");
3032 /// ```
3033 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
3034 mut self,
3035 v: T,
3036 ) -> Self {
3037 self.webhook_secret_secret_version = v.into();
3038 self
3039 }
3040
3041 /// Sets the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
3042 ///
3043 /// # Example
3044 /// ```ignore,no_run
3045 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3046 /// use google_cloud_developerconnect_v1::model::UserCredential;
3047 /// let x = BitbucketCloudConfig::new().set_read_authorizer_credential(UserCredential::default()/* use setters */);
3048 /// ```
3049 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
3050 where
3051 T: std::convert::Into<crate::model::UserCredential>,
3052 {
3053 self.read_authorizer_credential = std::option::Option::Some(v.into());
3054 self
3055 }
3056
3057 /// Sets or clears the value of [read_authorizer_credential][crate::model::BitbucketCloudConfig::read_authorizer_credential].
3058 ///
3059 /// # Example
3060 /// ```ignore,no_run
3061 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3062 /// use google_cloud_developerconnect_v1::model::UserCredential;
3063 /// let x = BitbucketCloudConfig::new().set_or_clear_read_authorizer_credential(Some(UserCredential::default()/* use setters */));
3064 /// let x = BitbucketCloudConfig::new().set_or_clear_read_authorizer_credential(None::<UserCredential>);
3065 /// ```
3066 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3067 where
3068 T: std::convert::Into<crate::model::UserCredential>,
3069 {
3070 self.read_authorizer_credential = v.map(|x| x.into());
3071 self
3072 }
3073
3074 /// Sets the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
3075 ///
3076 /// # Example
3077 /// ```ignore,no_run
3078 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3079 /// use google_cloud_developerconnect_v1::model::UserCredential;
3080 /// let x = BitbucketCloudConfig::new().set_authorizer_credential(UserCredential::default()/* use setters */);
3081 /// ```
3082 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
3083 where
3084 T: std::convert::Into<crate::model::UserCredential>,
3085 {
3086 self.authorizer_credential = std::option::Option::Some(v.into());
3087 self
3088 }
3089
3090 /// Sets or clears the value of [authorizer_credential][crate::model::BitbucketCloudConfig::authorizer_credential].
3091 ///
3092 /// # Example
3093 /// ```ignore,no_run
3094 /// # use google_cloud_developerconnect_v1::model::BitbucketCloudConfig;
3095 /// use google_cloud_developerconnect_v1::model::UserCredential;
3096 /// let x = BitbucketCloudConfig::new().set_or_clear_authorizer_credential(Some(UserCredential::default()/* use setters */));
3097 /// let x = BitbucketCloudConfig::new().set_or_clear_authorizer_credential(None::<UserCredential>);
3098 /// ```
3099 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3100 where
3101 T: std::convert::Into<crate::model::UserCredential>,
3102 {
3103 self.authorizer_credential = v.map(|x| x.into());
3104 self
3105 }
3106}
3107
3108impl wkt::message::Message for BitbucketCloudConfig {
3109 fn typename() -> &'static str {
3110 "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketCloudConfig"
3111 }
3112}
3113
3114/// Configuration for connections to Secure Source Manager instance
3115#[derive(Clone, Default, PartialEq)]
3116#[non_exhaustive]
3117pub struct SecureSourceManagerInstanceConfig {
3118 /// Required. Immutable. Secure Source Manager instance resource, formatted as
3119 /// `projects/*/locations/*/instances/*`
3120 pub instance: std::string::String,
3121
3122 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3123}
3124
3125impl SecureSourceManagerInstanceConfig {
3126 /// Creates a new default instance.
3127 pub fn new() -> Self {
3128 std::default::Default::default()
3129 }
3130
3131 /// Sets the value of [instance][crate::model::SecureSourceManagerInstanceConfig::instance].
3132 ///
3133 /// # Example
3134 /// ```ignore,no_run
3135 /// # use google_cloud_developerconnect_v1::model::SecureSourceManagerInstanceConfig;
3136 /// let x = SecureSourceManagerInstanceConfig::new().set_instance("example");
3137 /// ```
3138 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3139 self.instance = v.into();
3140 self
3141 }
3142}
3143
3144impl wkt::message::Message for SecureSourceManagerInstanceConfig {
3145 fn typename() -> &'static str {
3146 "type.googleapis.com/google.cloud.developerconnect.v1.SecureSourceManagerInstanceConfig"
3147 }
3148}
3149
3150/// Message for requesting list of Connections
3151#[derive(Clone, Default, PartialEq)]
3152#[non_exhaustive]
3153pub struct ListConnectionsRequest {
3154 /// Required. Parent value for ListConnectionsRequest
3155 pub parent: std::string::String,
3156
3157 /// Optional. Requested page size. Server may return fewer items than
3158 /// requested. If unspecified, server will pick an appropriate default.
3159 pub page_size: i32,
3160
3161 /// Optional. A token identifying a page of results the server should return.
3162 pub page_token: std::string::String,
3163
3164 /// Optional. Filtering results
3165 pub filter: std::string::String,
3166
3167 /// Optional. Hint for how to order the results
3168 pub order_by: std::string::String,
3169
3170 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3171}
3172
3173impl ListConnectionsRequest {
3174 /// Creates a new default instance.
3175 pub fn new() -> Self {
3176 std::default::Default::default()
3177 }
3178
3179 /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
3180 ///
3181 /// # Example
3182 /// ```ignore,no_run
3183 /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3184 /// # let project_id = "project_id";
3185 /// # let location_id = "location_id";
3186 /// let x = ListConnectionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3187 /// ```
3188 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3189 self.parent = v.into();
3190 self
3191 }
3192
3193 /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
3194 ///
3195 /// # Example
3196 /// ```ignore,no_run
3197 /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3198 /// let x = ListConnectionsRequest::new().set_page_size(42);
3199 /// ```
3200 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3201 self.page_size = v.into();
3202 self
3203 }
3204
3205 /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
3206 ///
3207 /// # Example
3208 /// ```ignore,no_run
3209 /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3210 /// let x = ListConnectionsRequest::new().set_page_token("example");
3211 /// ```
3212 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3213 self.page_token = v.into();
3214 self
3215 }
3216
3217 /// Sets the value of [filter][crate::model::ListConnectionsRequest::filter].
3218 ///
3219 /// # Example
3220 /// ```ignore,no_run
3221 /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3222 /// let x = ListConnectionsRequest::new().set_filter("example");
3223 /// ```
3224 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3225 self.filter = v.into();
3226 self
3227 }
3228
3229 /// Sets the value of [order_by][crate::model::ListConnectionsRequest::order_by].
3230 ///
3231 /// # Example
3232 /// ```ignore,no_run
3233 /// # use google_cloud_developerconnect_v1::model::ListConnectionsRequest;
3234 /// let x = ListConnectionsRequest::new().set_order_by("example");
3235 /// ```
3236 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3237 self.order_by = v.into();
3238 self
3239 }
3240}
3241
3242impl wkt::message::Message for ListConnectionsRequest {
3243 fn typename() -> &'static str {
3244 "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsRequest"
3245 }
3246}
3247
3248/// Message for response to listing Connections
3249#[derive(Clone, Default, PartialEq)]
3250#[non_exhaustive]
3251pub struct ListConnectionsResponse {
3252 /// The list of Connection
3253 pub connections: std::vec::Vec<crate::model::Connection>,
3254
3255 /// A token identifying a page of results the server should return.
3256 pub next_page_token: std::string::String,
3257
3258 /// Locations that could not be reached.
3259 pub unreachable: std::vec::Vec<std::string::String>,
3260
3261 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3262}
3263
3264impl ListConnectionsResponse {
3265 /// Creates a new default instance.
3266 pub fn new() -> Self {
3267 std::default::Default::default()
3268 }
3269
3270 /// Sets the value of [connections][crate::model::ListConnectionsResponse::connections].
3271 ///
3272 /// # Example
3273 /// ```ignore,no_run
3274 /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
3275 /// use google_cloud_developerconnect_v1::model::Connection;
3276 /// let x = ListConnectionsResponse::new()
3277 /// .set_connections([
3278 /// Connection::default()/* use setters */,
3279 /// Connection::default()/* use (different) setters */,
3280 /// ]);
3281 /// ```
3282 pub fn set_connections<T, V>(mut self, v: T) -> Self
3283 where
3284 T: std::iter::IntoIterator<Item = V>,
3285 V: std::convert::Into<crate::model::Connection>,
3286 {
3287 use std::iter::Iterator;
3288 self.connections = v.into_iter().map(|i| i.into()).collect();
3289 self
3290 }
3291
3292 /// Sets the value of [next_page_token][crate::model::ListConnectionsResponse::next_page_token].
3293 ///
3294 /// # Example
3295 /// ```ignore,no_run
3296 /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
3297 /// let x = ListConnectionsResponse::new().set_next_page_token("example");
3298 /// ```
3299 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3300 self.next_page_token = v.into();
3301 self
3302 }
3303
3304 /// Sets the value of [unreachable][crate::model::ListConnectionsResponse::unreachable].
3305 ///
3306 /// # Example
3307 /// ```ignore,no_run
3308 /// # use google_cloud_developerconnect_v1::model::ListConnectionsResponse;
3309 /// let x = ListConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
3310 /// ```
3311 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3312 where
3313 T: std::iter::IntoIterator<Item = V>,
3314 V: std::convert::Into<std::string::String>,
3315 {
3316 use std::iter::Iterator;
3317 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3318 self
3319 }
3320}
3321
3322impl wkt::message::Message for ListConnectionsResponse {
3323 fn typename() -> &'static str {
3324 "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsResponse"
3325 }
3326}
3327
3328#[doc(hidden)]
3329impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionsResponse {
3330 type PageItem = crate::model::Connection;
3331
3332 fn items(self) -> std::vec::Vec<Self::PageItem> {
3333 self.connections
3334 }
3335
3336 fn next_page_token(&self) -> std::string::String {
3337 use std::clone::Clone;
3338 self.next_page_token.clone()
3339 }
3340}
3341
3342/// Message for getting a Connection
3343#[derive(Clone, Default, PartialEq)]
3344#[non_exhaustive]
3345pub struct GetConnectionRequest {
3346 /// Required. Name of the resource
3347 pub name: std::string::String,
3348
3349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3350}
3351
3352impl GetConnectionRequest {
3353 /// Creates a new default instance.
3354 pub fn new() -> Self {
3355 std::default::Default::default()
3356 }
3357
3358 /// Sets the value of [name][crate::model::GetConnectionRequest::name].
3359 ///
3360 /// # Example
3361 /// ```ignore,no_run
3362 /// # use google_cloud_developerconnect_v1::model::GetConnectionRequest;
3363 /// # let project_id = "project_id";
3364 /// # let location_id = "location_id";
3365 /// # let connection_id = "connection_id";
3366 /// let x = GetConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
3367 /// ```
3368 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3369 self.name = v.into();
3370 self
3371 }
3372}
3373
3374impl wkt::message::Message for GetConnectionRequest {
3375 fn typename() -> &'static str {
3376 "type.googleapis.com/google.cloud.developerconnect.v1.GetConnectionRequest"
3377 }
3378}
3379
3380/// Message for creating a Connection
3381#[derive(Clone, Default, PartialEq)]
3382#[non_exhaustive]
3383pub struct CreateConnectionRequest {
3384 /// Required. Value for parent.
3385 pub parent: std::string::String,
3386
3387 /// Required. Id of the requesting object
3388 /// If auto-generating Id server-side, remove this field and
3389 /// connection_id from the method_signature of Create RPC
3390 pub connection_id: std::string::String,
3391
3392 /// Required. The resource being created
3393 pub connection: std::option::Option<crate::model::Connection>,
3394
3395 /// Optional. An optional request ID to identify requests. Specify a unique
3396 /// request ID so that if you must retry your request, the server will know to
3397 /// ignore the request if it has already been completed. The server will
3398 /// guarantee that for at least 60 minutes since the first request.
3399 ///
3400 /// For example, consider a situation where you make an initial request and the
3401 /// request times out. If you make the request again with the same request
3402 /// ID, the server can check if original operation with the same request ID
3403 /// was received, and if so, will ignore the second request. This prevents
3404 /// clients from accidentally creating duplicate commitments.
3405 ///
3406 /// The request ID must be a valid UUID with the exception that zero UUID is
3407 /// not supported (00000000-0000-0000-0000-000000000000).
3408 pub request_id: std::string::String,
3409
3410 /// Optional. If set, validate the request, but do not actually post it.
3411 pub validate_only: bool,
3412
3413 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3414}
3415
3416impl CreateConnectionRequest {
3417 /// Creates a new default instance.
3418 pub fn new() -> Self {
3419 std::default::Default::default()
3420 }
3421
3422 /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
3423 ///
3424 /// # Example
3425 /// ```ignore,no_run
3426 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3427 /// # let project_id = "project_id";
3428 /// # let location_id = "location_id";
3429 /// let x = CreateConnectionRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3430 /// ```
3431 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3432 self.parent = v.into();
3433 self
3434 }
3435
3436 /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
3437 ///
3438 /// # Example
3439 /// ```ignore,no_run
3440 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3441 /// let x = CreateConnectionRequest::new().set_connection_id("example");
3442 /// ```
3443 pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3444 self.connection_id = v.into();
3445 self
3446 }
3447
3448 /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
3449 ///
3450 /// # Example
3451 /// ```ignore,no_run
3452 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3453 /// use google_cloud_developerconnect_v1::model::Connection;
3454 /// let x = CreateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
3455 /// ```
3456 pub fn set_connection<T>(mut self, v: T) -> Self
3457 where
3458 T: std::convert::Into<crate::model::Connection>,
3459 {
3460 self.connection = std::option::Option::Some(v.into());
3461 self
3462 }
3463
3464 /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
3465 ///
3466 /// # Example
3467 /// ```ignore,no_run
3468 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3469 /// use google_cloud_developerconnect_v1::model::Connection;
3470 /// let x = CreateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
3471 /// let x = CreateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
3472 /// ```
3473 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
3474 where
3475 T: std::convert::Into<crate::model::Connection>,
3476 {
3477 self.connection = v.map(|x| x.into());
3478 self
3479 }
3480
3481 /// Sets the value of [request_id][crate::model::CreateConnectionRequest::request_id].
3482 ///
3483 /// # Example
3484 /// ```ignore,no_run
3485 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3486 /// let x = CreateConnectionRequest::new().set_request_id("example");
3487 /// ```
3488 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3489 self.request_id = v.into();
3490 self
3491 }
3492
3493 /// Sets the value of [validate_only][crate::model::CreateConnectionRequest::validate_only].
3494 ///
3495 /// # Example
3496 /// ```ignore,no_run
3497 /// # use google_cloud_developerconnect_v1::model::CreateConnectionRequest;
3498 /// let x = CreateConnectionRequest::new().set_validate_only(true);
3499 /// ```
3500 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3501 self.validate_only = v.into();
3502 self
3503 }
3504}
3505
3506impl wkt::message::Message for CreateConnectionRequest {
3507 fn typename() -> &'static str {
3508 "type.googleapis.com/google.cloud.developerconnect.v1.CreateConnectionRequest"
3509 }
3510}
3511
3512/// Message for updating a Connection
3513#[derive(Clone, Default, PartialEq)]
3514#[non_exhaustive]
3515pub struct UpdateConnectionRequest {
3516 /// Required. Field mask is used to specify the fields to be overwritten in the
3517 /// Connection resource by the update.
3518 /// The fields specified in the update_mask are relative to the resource, not
3519 /// the full request. A field will be overwritten if it is in the mask. If the
3520 /// user does not provide a mask then all fields will be overwritten.
3521 pub update_mask: std::option::Option<wkt::FieldMask>,
3522
3523 /// Required. The resource being updated
3524 pub connection: std::option::Option<crate::model::Connection>,
3525
3526 /// Optional. An optional request ID to identify requests. Specify a unique
3527 /// request ID so that if you must retry your request, the server will know to
3528 /// ignore the request if it has already been completed. The server will
3529 /// guarantee that for at least 60 minutes since the first request.
3530 ///
3531 /// For example, consider a situation where you make an initial request and the
3532 /// request times out. If you make the request again with the same request
3533 /// ID, the server can check if original operation with the same request ID
3534 /// was received, and if so, will ignore the second request. This prevents
3535 /// clients from accidentally creating duplicate commitments.
3536 ///
3537 /// The request ID must be a valid UUID with the exception that zero UUID is
3538 /// not supported (00000000-0000-0000-0000-000000000000).
3539 pub request_id: std::string::String,
3540
3541 /// Optional. If set to true, and the connection is not found a new connection
3542 /// will be created. In this situation `update_mask` is ignored.
3543 /// The creation will succeed only if the input connection has all the
3544 /// necessary information (e.g a github_config with both user_oauth_token and
3545 /// installation_id properties).
3546 pub allow_missing: bool,
3547
3548 /// Optional. If set, validate the request, but do not actually post it.
3549 pub validate_only: bool,
3550
3551 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3552}
3553
3554impl UpdateConnectionRequest {
3555 /// Creates a new default instance.
3556 pub fn new() -> Self {
3557 std::default::Default::default()
3558 }
3559
3560 /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
3561 ///
3562 /// # Example
3563 /// ```ignore,no_run
3564 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3565 /// use wkt::FieldMask;
3566 /// let x = UpdateConnectionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3567 /// ```
3568 pub fn set_update_mask<T>(mut self, v: T) -> Self
3569 where
3570 T: std::convert::Into<wkt::FieldMask>,
3571 {
3572 self.update_mask = std::option::Option::Some(v.into());
3573 self
3574 }
3575
3576 /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
3577 ///
3578 /// # Example
3579 /// ```ignore,no_run
3580 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3581 /// use wkt::FieldMask;
3582 /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3583 /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3584 /// ```
3585 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3586 where
3587 T: std::convert::Into<wkt::FieldMask>,
3588 {
3589 self.update_mask = v.map(|x| x.into());
3590 self
3591 }
3592
3593 /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
3594 ///
3595 /// # Example
3596 /// ```ignore,no_run
3597 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3598 /// use google_cloud_developerconnect_v1::model::Connection;
3599 /// let x = UpdateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
3600 /// ```
3601 pub fn set_connection<T>(mut self, v: T) -> Self
3602 where
3603 T: std::convert::Into<crate::model::Connection>,
3604 {
3605 self.connection = std::option::Option::Some(v.into());
3606 self
3607 }
3608
3609 /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
3610 ///
3611 /// # Example
3612 /// ```ignore,no_run
3613 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3614 /// use google_cloud_developerconnect_v1::model::Connection;
3615 /// let x = UpdateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
3616 /// let x = UpdateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
3617 /// ```
3618 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
3619 where
3620 T: std::convert::Into<crate::model::Connection>,
3621 {
3622 self.connection = v.map(|x| x.into());
3623 self
3624 }
3625
3626 /// Sets the value of [request_id][crate::model::UpdateConnectionRequest::request_id].
3627 ///
3628 /// # Example
3629 /// ```ignore,no_run
3630 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3631 /// let x = UpdateConnectionRequest::new().set_request_id("example");
3632 /// ```
3633 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3634 self.request_id = v.into();
3635 self
3636 }
3637
3638 /// Sets the value of [allow_missing][crate::model::UpdateConnectionRequest::allow_missing].
3639 ///
3640 /// # Example
3641 /// ```ignore,no_run
3642 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3643 /// let x = UpdateConnectionRequest::new().set_allow_missing(true);
3644 /// ```
3645 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3646 self.allow_missing = v.into();
3647 self
3648 }
3649
3650 /// Sets the value of [validate_only][crate::model::UpdateConnectionRequest::validate_only].
3651 ///
3652 /// # Example
3653 /// ```ignore,no_run
3654 /// # use google_cloud_developerconnect_v1::model::UpdateConnectionRequest;
3655 /// let x = UpdateConnectionRequest::new().set_validate_only(true);
3656 /// ```
3657 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3658 self.validate_only = v.into();
3659 self
3660 }
3661}
3662
3663impl wkt::message::Message for UpdateConnectionRequest {
3664 fn typename() -> &'static str {
3665 "type.googleapis.com/google.cloud.developerconnect.v1.UpdateConnectionRequest"
3666 }
3667}
3668
3669/// Message for deleting a Connection
3670#[derive(Clone, Default, PartialEq)]
3671#[non_exhaustive]
3672pub struct DeleteConnectionRequest {
3673 /// Required. Name of the resource
3674 pub name: std::string::String,
3675
3676 /// Optional. An optional request ID to identify requests. Specify a unique
3677 /// request ID so that if you must retry your request, the server will know to
3678 /// ignore the request if it has already been completed. The server will
3679 /// guarantee that for at least 60 minutes after the first request.
3680 ///
3681 /// For example, consider a situation where you make an initial request and the
3682 /// request times out. If you make the request again with the same request
3683 /// ID, the server can check if original operation with the same request ID
3684 /// was received, and if so, will ignore the second request. This prevents
3685 /// clients from accidentally creating duplicate commitments.
3686 ///
3687 /// The request ID must be a valid UUID with the exception that zero UUID is
3688 /// not supported (00000000-0000-0000-0000-000000000000).
3689 pub request_id: std::string::String,
3690
3691 /// Optional. If set, validate the request, but do not actually post it.
3692 pub validate_only: bool,
3693
3694 /// Optional. The current etag of the Connection.
3695 /// If an etag is provided and does not match the current etag of the
3696 /// Connection, deletion will be blocked and an ABORTED error will be returned.
3697 pub etag: std::string::String,
3698
3699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3700}
3701
3702impl DeleteConnectionRequest {
3703 /// Creates a new default instance.
3704 pub fn new() -> Self {
3705 std::default::Default::default()
3706 }
3707
3708 /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
3709 ///
3710 /// # Example
3711 /// ```ignore,no_run
3712 /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3713 /// # let project_id = "project_id";
3714 /// # let location_id = "location_id";
3715 /// # let connection_id = "connection_id";
3716 /// let x = DeleteConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
3717 /// ```
3718 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3719 self.name = v.into();
3720 self
3721 }
3722
3723 /// Sets the value of [request_id][crate::model::DeleteConnectionRequest::request_id].
3724 ///
3725 /// # Example
3726 /// ```ignore,no_run
3727 /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3728 /// let x = DeleteConnectionRequest::new().set_request_id("example");
3729 /// ```
3730 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3731 self.request_id = v.into();
3732 self
3733 }
3734
3735 /// Sets the value of [validate_only][crate::model::DeleteConnectionRequest::validate_only].
3736 ///
3737 /// # Example
3738 /// ```ignore,no_run
3739 /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3740 /// let x = DeleteConnectionRequest::new().set_validate_only(true);
3741 /// ```
3742 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3743 self.validate_only = v.into();
3744 self
3745 }
3746
3747 /// Sets the value of [etag][crate::model::DeleteConnectionRequest::etag].
3748 ///
3749 /// # Example
3750 /// ```ignore,no_run
3751 /// # use google_cloud_developerconnect_v1::model::DeleteConnectionRequest;
3752 /// let x = DeleteConnectionRequest::new().set_etag("example");
3753 /// ```
3754 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3755 self.etag = v.into();
3756 self
3757 }
3758}
3759
3760impl wkt::message::Message for DeleteConnectionRequest {
3761 fn typename() -> &'static str {
3762 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteConnectionRequest"
3763 }
3764}
3765
3766/// Message for requesting list of AccountConnectors
3767#[derive(Clone, Default, PartialEq)]
3768#[non_exhaustive]
3769pub struct ListAccountConnectorsRequest {
3770 /// Required. Parent value for ListAccountConnectorsRequest
3771 pub parent: std::string::String,
3772
3773 /// Optional. Requested page size. Server may return fewer items than
3774 /// requested. If unspecified, server will pick an appropriate default.
3775 pub page_size: i32,
3776
3777 /// Optional. A token identifying a page of results the server should return.
3778 pub page_token: std::string::String,
3779
3780 /// Optional. Filtering results
3781 pub filter: std::string::String,
3782
3783 /// Optional. Hint for how to order the results
3784 pub order_by: std::string::String,
3785
3786 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3787}
3788
3789impl ListAccountConnectorsRequest {
3790 /// Creates a new default instance.
3791 pub fn new() -> Self {
3792 std::default::Default::default()
3793 }
3794
3795 /// Sets the value of [parent][crate::model::ListAccountConnectorsRequest::parent].
3796 ///
3797 /// # Example
3798 /// ```ignore,no_run
3799 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3800 /// # let project_id = "project_id";
3801 /// # let location_id = "location_id";
3802 /// let x = ListAccountConnectorsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3803 /// ```
3804 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3805 self.parent = v.into();
3806 self
3807 }
3808
3809 /// Sets the value of [page_size][crate::model::ListAccountConnectorsRequest::page_size].
3810 ///
3811 /// # Example
3812 /// ```ignore,no_run
3813 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3814 /// let x = ListAccountConnectorsRequest::new().set_page_size(42);
3815 /// ```
3816 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3817 self.page_size = v.into();
3818 self
3819 }
3820
3821 /// Sets the value of [page_token][crate::model::ListAccountConnectorsRequest::page_token].
3822 ///
3823 /// # Example
3824 /// ```ignore,no_run
3825 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3826 /// let x = ListAccountConnectorsRequest::new().set_page_token("example");
3827 /// ```
3828 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3829 self.page_token = v.into();
3830 self
3831 }
3832
3833 /// Sets the value of [filter][crate::model::ListAccountConnectorsRequest::filter].
3834 ///
3835 /// # Example
3836 /// ```ignore,no_run
3837 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3838 /// let x = ListAccountConnectorsRequest::new().set_filter("example");
3839 /// ```
3840 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3841 self.filter = v.into();
3842 self
3843 }
3844
3845 /// Sets the value of [order_by][crate::model::ListAccountConnectorsRequest::order_by].
3846 ///
3847 /// # Example
3848 /// ```ignore,no_run
3849 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsRequest;
3850 /// let x = ListAccountConnectorsRequest::new().set_order_by("example");
3851 /// ```
3852 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3853 self.order_by = v.into();
3854 self
3855 }
3856}
3857
3858impl wkt::message::Message for ListAccountConnectorsRequest {
3859 fn typename() -> &'static str {
3860 "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsRequest"
3861 }
3862}
3863
3864/// Message for response to listing AccountConnectors
3865#[derive(Clone, Default, PartialEq)]
3866#[non_exhaustive]
3867pub struct ListAccountConnectorsResponse {
3868 /// The list of AccountConnectors
3869 pub account_connectors: std::vec::Vec<crate::model::AccountConnector>,
3870
3871 /// A token identifying a page of results the server should return.
3872 pub next_page_token: std::string::String,
3873
3874 /// Locations that could not be reached.
3875 pub unreachable: std::vec::Vec<std::string::String>,
3876
3877 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3878}
3879
3880impl ListAccountConnectorsResponse {
3881 /// Creates a new default instance.
3882 pub fn new() -> Self {
3883 std::default::Default::default()
3884 }
3885
3886 /// Sets the value of [account_connectors][crate::model::ListAccountConnectorsResponse::account_connectors].
3887 ///
3888 /// # Example
3889 /// ```ignore,no_run
3890 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3891 /// use google_cloud_developerconnect_v1::model::AccountConnector;
3892 /// let x = ListAccountConnectorsResponse::new()
3893 /// .set_account_connectors([
3894 /// AccountConnector::default()/* use setters */,
3895 /// AccountConnector::default()/* use (different) setters */,
3896 /// ]);
3897 /// ```
3898 pub fn set_account_connectors<T, V>(mut self, v: T) -> Self
3899 where
3900 T: std::iter::IntoIterator<Item = V>,
3901 V: std::convert::Into<crate::model::AccountConnector>,
3902 {
3903 use std::iter::Iterator;
3904 self.account_connectors = v.into_iter().map(|i| i.into()).collect();
3905 self
3906 }
3907
3908 /// Sets the value of [next_page_token][crate::model::ListAccountConnectorsResponse::next_page_token].
3909 ///
3910 /// # Example
3911 /// ```ignore,no_run
3912 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3913 /// let x = ListAccountConnectorsResponse::new().set_next_page_token("example");
3914 /// ```
3915 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3916 self.next_page_token = v.into();
3917 self
3918 }
3919
3920 /// Sets the value of [unreachable][crate::model::ListAccountConnectorsResponse::unreachable].
3921 ///
3922 /// # Example
3923 /// ```ignore,no_run
3924 /// # use google_cloud_developerconnect_v1::model::ListAccountConnectorsResponse;
3925 /// let x = ListAccountConnectorsResponse::new().set_unreachable(["a", "b", "c"]);
3926 /// ```
3927 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3928 where
3929 T: std::iter::IntoIterator<Item = V>,
3930 V: std::convert::Into<std::string::String>,
3931 {
3932 use std::iter::Iterator;
3933 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3934 self
3935 }
3936}
3937
3938impl wkt::message::Message for ListAccountConnectorsResponse {
3939 fn typename() -> &'static str {
3940 "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsResponse"
3941 }
3942}
3943
3944#[doc(hidden)]
3945impl google_cloud_gax::paginator::internal::PageableResponse for ListAccountConnectorsResponse {
3946 type PageItem = crate::model::AccountConnector;
3947
3948 fn items(self) -> std::vec::Vec<Self::PageItem> {
3949 self.account_connectors
3950 }
3951
3952 fn next_page_token(&self) -> std::string::String {
3953 use std::clone::Clone;
3954 self.next_page_token.clone()
3955 }
3956}
3957
3958/// Message for getting a AccountConnector
3959#[derive(Clone, Default, PartialEq)]
3960#[non_exhaustive]
3961pub struct GetAccountConnectorRequest {
3962 /// Required. Name of the resource
3963 pub name: std::string::String,
3964
3965 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3966}
3967
3968impl GetAccountConnectorRequest {
3969 /// Creates a new default instance.
3970 pub fn new() -> Self {
3971 std::default::Default::default()
3972 }
3973
3974 /// Sets the value of [name][crate::model::GetAccountConnectorRequest::name].
3975 ///
3976 /// # Example
3977 /// ```ignore,no_run
3978 /// # use google_cloud_developerconnect_v1::model::GetAccountConnectorRequest;
3979 /// # let project_id = "project_id";
3980 /// # let location_id = "location_id";
3981 /// # let account_connector_id = "account_connector_id";
3982 /// let x = GetAccountConnectorRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
3983 /// ```
3984 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3985 self.name = v.into();
3986 self
3987 }
3988}
3989
3990impl wkt::message::Message for GetAccountConnectorRequest {
3991 fn typename() -> &'static str {
3992 "type.googleapis.com/google.cloud.developerconnect.v1.GetAccountConnectorRequest"
3993 }
3994}
3995
3996#[allow(missing_docs)]
3997#[derive(Clone, Default, PartialEq)]
3998#[non_exhaustive]
3999pub struct CreateAccountConnectorRequest {
4000 /// Required. Location resource name as the account_connector’s parent.
4001 pub parent: std::string::String,
4002
4003 /// Required. The ID to use for the AccountConnector, which will become the
4004 /// final component of the AccountConnector's resource name. Its format should
4005 /// adhere to <https://google.aip.dev/122#resource-id-segments> Names must be
4006 /// unique per-project per-location.
4007 pub account_connector_id: std::string::String,
4008
4009 /// Required. The AccountConnector to create.
4010 pub account_connector: std::option::Option<crate::model::AccountConnector>,
4011
4012 /// Optional. An optional request ID to identify requests. Specify a unique
4013 /// request ID so that if you must retry your request, the server will know to
4014 /// ignore the request if it has already been completed. The server will
4015 /// guarantee that for at least 60 minutes since the first request.
4016 ///
4017 /// For example, consider a situation where you make an initial request and the
4018 /// request times out. If you make the request again with the same request
4019 /// ID, the server can check if original operation with the same request ID
4020 /// was received, and if so, will ignore the second request. This prevents
4021 /// clients from accidentally creating duplicate commitments.
4022 ///
4023 /// The request ID must be a valid UUID with the exception that zero UUID is
4024 /// not supported (00000000-0000-0000-0000-000000000000).
4025 pub request_id: std::string::String,
4026
4027 /// Optional. If set, validate the request, but do not actually post it.
4028 pub validate_only: bool,
4029
4030 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4031}
4032
4033impl CreateAccountConnectorRequest {
4034 /// Creates a new default instance.
4035 pub fn new() -> Self {
4036 std::default::Default::default()
4037 }
4038
4039 /// Sets the value of [parent][crate::model::CreateAccountConnectorRequest::parent].
4040 ///
4041 /// # Example
4042 /// ```ignore,no_run
4043 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4044 /// # let project_id = "project_id";
4045 /// # let location_id = "location_id";
4046 /// let x = CreateAccountConnectorRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4047 /// ```
4048 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4049 self.parent = v.into();
4050 self
4051 }
4052
4053 /// Sets the value of [account_connector_id][crate::model::CreateAccountConnectorRequest::account_connector_id].
4054 ///
4055 /// # Example
4056 /// ```ignore,no_run
4057 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4058 /// let x = CreateAccountConnectorRequest::new().set_account_connector_id("example");
4059 /// ```
4060 pub fn set_account_connector_id<T: std::convert::Into<std::string::String>>(
4061 mut self,
4062 v: T,
4063 ) -> Self {
4064 self.account_connector_id = v.into();
4065 self
4066 }
4067
4068 /// Sets the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
4069 ///
4070 /// # Example
4071 /// ```ignore,no_run
4072 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4073 /// use google_cloud_developerconnect_v1::model::AccountConnector;
4074 /// let x = CreateAccountConnectorRequest::new().set_account_connector(AccountConnector::default()/* use setters */);
4075 /// ```
4076 pub fn set_account_connector<T>(mut self, v: T) -> Self
4077 where
4078 T: std::convert::Into<crate::model::AccountConnector>,
4079 {
4080 self.account_connector = std::option::Option::Some(v.into());
4081 self
4082 }
4083
4084 /// Sets or clears the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
4085 ///
4086 /// # Example
4087 /// ```ignore,no_run
4088 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4089 /// use google_cloud_developerconnect_v1::model::AccountConnector;
4090 /// let x = CreateAccountConnectorRequest::new().set_or_clear_account_connector(Some(AccountConnector::default()/* use setters */));
4091 /// let x = CreateAccountConnectorRequest::new().set_or_clear_account_connector(None::<AccountConnector>);
4092 /// ```
4093 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
4094 where
4095 T: std::convert::Into<crate::model::AccountConnector>,
4096 {
4097 self.account_connector = v.map(|x| x.into());
4098 self
4099 }
4100
4101 /// Sets the value of [request_id][crate::model::CreateAccountConnectorRequest::request_id].
4102 ///
4103 /// # Example
4104 /// ```ignore,no_run
4105 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4106 /// let x = CreateAccountConnectorRequest::new().set_request_id("example");
4107 /// ```
4108 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4109 self.request_id = v.into();
4110 self
4111 }
4112
4113 /// Sets the value of [validate_only][crate::model::CreateAccountConnectorRequest::validate_only].
4114 ///
4115 /// # Example
4116 /// ```ignore,no_run
4117 /// # use google_cloud_developerconnect_v1::model::CreateAccountConnectorRequest;
4118 /// let x = CreateAccountConnectorRequest::new().set_validate_only(true);
4119 /// ```
4120 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4121 self.validate_only = v.into();
4122 self
4123 }
4124}
4125
4126impl wkt::message::Message for CreateAccountConnectorRequest {
4127 fn typename() -> &'static str {
4128 "type.googleapis.com/google.cloud.developerconnect.v1.CreateAccountConnectorRequest"
4129 }
4130}
4131
4132/// Message for updating a AccountConnector
4133#[derive(Clone, Default, PartialEq)]
4134#[non_exhaustive]
4135pub struct UpdateAccountConnectorRequest {
4136 /// Optional. The list of fields to be updated.
4137 pub update_mask: std::option::Option<wkt::FieldMask>,
4138
4139 /// Required. The AccountConnector to update.
4140 pub account_connector: std::option::Option<crate::model::AccountConnector>,
4141
4142 /// Optional. An optional request ID to identify requests. Specify a unique
4143 /// request ID so that if you must retry your request, the server will know to
4144 /// ignore the request if it has already been completed. The server will
4145 /// guarantee that for at least 60 minutes since the first request.
4146 ///
4147 /// For example, consider a situation where you make an initial request and the
4148 /// request times out. If you make the request again with the same request
4149 /// ID, the server can check if original operation with the same request ID
4150 /// was received, and if so, will ignore the second request. This prevents
4151 /// clients from accidentally creating duplicate commitments.
4152 ///
4153 /// The request ID must be a valid UUID with the exception that zero UUID is
4154 /// not supported (00000000-0000-0000-0000-000000000000).
4155 pub request_id: std::string::String,
4156
4157 /// Optional. If set to true, and the accountConnector is not found a new
4158 /// accountConnector will be created. In this situation `update_mask` is
4159 /// ignored. The creation will succeed only if the input accountConnector has
4160 /// all the necessary
4161 pub allow_missing: bool,
4162
4163 /// Optional. If set, validate the request, but do not actually post it.
4164 pub validate_only: bool,
4165
4166 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4167}
4168
4169impl UpdateAccountConnectorRequest {
4170 /// Creates a new default instance.
4171 pub fn new() -> Self {
4172 std::default::Default::default()
4173 }
4174
4175 /// Sets the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
4176 ///
4177 /// # Example
4178 /// ```ignore,no_run
4179 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4180 /// use wkt::FieldMask;
4181 /// let x = UpdateAccountConnectorRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4182 /// ```
4183 pub fn set_update_mask<T>(mut self, v: T) -> Self
4184 where
4185 T: std::convert::Into<wkt::FieldMask>,
4186 {
4187 self.update_mask = std::option::Option::Some(v.into());
4188 self
4189 }
4190
4191 /// Sets or clears the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
4192 ///
4193 /// # Example
4194 /// ```ignore,no_run
4195 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4196 /// use wkt::FieldMask;
4197 /// let x = UpdateAccountConnectorRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4198 /// let x = UpdateAccountConnectorRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4199 /// ```
4200 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4201 where
4202 T: std::convert::Into<wkt::FieldMask>,
4203 {
4204 self.update_mask = v.map(|x| x.into());
4205 self
4206 }
4207
4208 /// Sets the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
4209 ///
4210 /// # Example
4211 /// ```ignore,no_run
4212 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4213 /// use google_cloud_developerconnect_v1::model::AccountConnector;
4214 /// let x = UpdateAccountConnectorRequest::new().set_account_connector(AccountConnector::default()/* use setters */);
4215 /// ```
4216 pub fn set_account_connector<T>(mut self, v: T) -> Self
4217 where
4218 T: std::convert::Into<crate::model::AccountConnector>,
4219 {
4220 self.account_connector = std::option::Option::Some(v.into());
4221 self
4222 }
4223
4224 /// Sets or clears the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
4225 ///
4226 /// # Example
4227 /// ```ignore,no_run
4228 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4229 /// use google_cloud_developerconnect_v1::model::AccountConnector;
4230 /// let x = UpdateAccountConnectorRequest::new().set_or_clear_account_connector(Some(AccountConnector::default()/* use setters */));
4231 /// let x = UpdateAccountConnectorRequest::new().set_or_clear_account_connector(None::<AccountConnector>);
4232 /// ```
4233 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
4234 where
4235 T: std::convert::Into<crate::model::AccountConnector>,
4236 {
4237 self.account_connector = v.map(|x| x.into());
4238 self
4239 }
4240
4241 /// Sets the value of [request_id][crate::model::UpdateAccountConnectorRequest::request_id].
4242 ///
4243 /// # Example
4244 /// ```ignore,no_run
4245 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4246 /// let x = UpdateAccountConnectorRequest::new().set_request_id("example");
4247 /// ```
4248 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4249 self.request_id = v.into();
4250 self
4251 }
4252
4253 /// Sets the value of [allow_missing][crate::model::UpdateAccountConnectorRequest::allow_missing].
4254 ///
4255 /// # Example
4256 /// ```ignore,no_run
4257 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4258 /// let x = UpdateAccountConnectorRequest::new().set_allow_missing(true);
4259 /// ```
4260 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4261 self.allow_missing = v.into();
4262 self
4263 }
4264
4265 /// Sets the value of [validate_only][crate::model::UpdateAccountConnectorRequest::validate_only].
4266 ///
4267 /// # Example
4268 /// ```ignore,no_run
4269 /// # use google_cloud_developerconnect_v1::model::UpdateAccountConnectorRequest;
4270 /// let x = UpdateAccountConnectorRequest::new().set_validate_only(true);
4271 /// ```
4272 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4273 self.validate_only = v.into();
4274 self
4275 }
4276}
4277
4278impl wkt::message::Message for UpdateAccountConnectorRequest {
4279 fn typename() -> &'static str {
4280 "type.googleapis.com/google.cloud.developerconnect.v1.UpdateAccountConnectorRequest"
4281 }
4282}
4283
4284/// Message for deleting a AccountConnector
4285#[derive(Clone, Default, PartialEq)]
4286#[non_exhaustive]
4287pub struct DeleteAccountConnectorRequest {
4288 /// Required. Name of the resource
4289 pub name: std::string::String,
4290
4291 /// Optional. An optional request ID to identify requests. Specify a unique
4292 /// request ID so that if you must retry your request, the server will know to
4293 /// ignore the request if it has already been completed. The server will
4294 /// guarantee that for at least 60 minutes after the first request.
4295 ///
4296 /// For example, consider a situation where you make an initial request and the
4297 /// request times out. If you make the request again with the same request
4298 /// ID, the server can check if original operation with the same request ID
4299 /// was received, and if so, will ignore the second request. This prevents
4300 /// clients from accidentally creating duplicate commitments.
4301 ///
4302 /// The request ID must be a valid UUID with the exception that zero UUID is
4303 /// not supported (00000000-0000-0000-0000-000000000000).
4304 pub request_id: std::string::String,
4305
4306 /// Optional. If set, validate the request, but do not actually post it.
4307 pub validate_only: bool,
4308
4309 /// Optional. The current etag of the AccountConnectorn.
4310 /// If an etag is provided and does not match the current etag of the
4311 /// AccountConnector, deletion will be blocked and an ABORTED error will be
4312 /// returned.
4313 pub etag: std::string::String,
4314
4315 /// Optional. If set to true, any Users from this AccountConnector will also
4316 /// be deleted. (Otherwise, the request will only work if the AccountConnector
4317 /// has no Users.)
4318 pub force: bool,
4319
4320 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4321}
4322
4323impl DeleteAccountConnectorRequest {
4324 /// Creates a new default instance.
4325 pub fn new() -> Self {
4326 std::default::Default::default()
4327 }
4328
4329 /// Sets the value of [name][crate::model::DeleteAccountConnectorRequest::name].
4330 ///
4331 /// # Example
4332 /// ```ignore,no_run
4333 /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4334 /// # let project_id = "project_id";
4335 /// # let location_id = "location_id";
4336 /// # let account_connector_id = "account_connector_id";
4337 /// let x = DeleteAccountConnectorRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
4338 /// ```
4339 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4340 self.name = v.into();
4341 self
4342 }
4343
4344 /// Sets the value of [request_id][crate::model::DeleteAccountConnectorRequest::request_id].
4345 ///
4346 /// # Example
4347 /// ```ignore,no_run
4348 /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4349 /// let x = DeleteAccountConnectorRequest::new().set_request_id("example");
4350 /// ```
4351 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4352 self.request_id = v.into();
4353 self
4354 }
4355
4356 /// Sets the value of [validate_only][crate::model::DeleteAccountConnectorRequest::validate_only].
4357 ///
4358 /// # Example
4359 /// ```ignore,no_run
4360 /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4361 /// let x = DeleteAccountConnectorRequest::new().set_validate_only(true);
4362 /// ```
4363 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4364 self.validate_only = v.into();
4365 self
4366 }
4367
4368 /// Sets the value of [etag][crate::model::DeleteAccountConnectorRequest::etag].
4369 ///
4370 /// # Example
4371 /// ```ignore,no_run
4372 /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4373 /// let x = DeleteAccountConnectorRequest::new().set_etag("example");
4374 /// ```
4375 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4376 self.etag = v.into();
4377 self
4378 }
4379
4380 /// Sets the value of [force][crate::model::DeleteAccountConnectorRequest::force].
4381 ///
4382 /// # Example
4383 /// ```ignore,no_run
4384 /// # use google_cloud_developerconnect_v1::model::DeleteAccountConnectorRequest;
4385 /// let x = DeleteAccountConnectorRequest::new().set_force(true);
4386 /// ```
4387 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4388 self.force = v.into();
4389 self
4390 }
4391}
4392
4393impl wkt::message::Message for DeleteAccountConnectorRequest {
4394 fn typename() -> &'static str {
4395 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteAccountConnectorRequest"
4396 }
4397}
4398
4399/// Message for deleting a User
4400#[derive(Clone, Default, PartialEq)]
4401#[non_exhaustive]
4402pub struct DeleteUserRequest {
4403 /// Required. Name of the resource
4404 pub name: std::string::String,
4405
4406 /// Optional. An optional request ID to identify requests. Specify a unique
4407 /// request ID so that if you must retry your request, the server will know to
4408 /// ignore the request if it has already been completed. The server will
4409 /// guarantee that for at least 60 minutes after the first request.
4410 ///
4411 /// For example, consider a situation where you make an initial request and the
4412 /// request times out. If you make the request again with the same request
4413 /// ID, the server can check if original operation with the same request ID
4414 /// was received, and if so, will ignore the second request. This prevents
4415 /// clients from accidentally creating duplicate commitments.
4416 ///
4417 /// The request ID must be a valid UUID with the exception that zero UUID is
4418 /// not supported (00000000-0000-0000-0000-000000000000).
4419 pub request_id: std::string::String,
4420
4421 /// Optional. If set, validate the request, but do not actually post it.
4422 pub validate_only: bool,
4423
4424 /// Optional. This checksum is computed by the server based on the value of
4425 /// other fields, and may be sent on update and delete requests to ensure the
4426 /// client has an up-to-date value before proceeding.
4427 pub etag: std::string::String,
4428
4429 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4430}
4431
4432impl DeleteUserRequest {
4433 /// Creates a new default instance.
4434 pub fn new() -> Self {
4435 std::default::Default::default()
4436 }
4437
4438 /// Sets the value of [name][crate::model::DeleteUserRequest::name].
4439 ///
4440 /// # Example
4441 /// ```ignore,no_run
4442 /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4443 /// # let project_id = "project_id";
4444 /// # let location_id = "location_id";
4445 /// # let account_connector_id = "account_connector_id";
4446 /// # let user_id = "user_id";
4447 /// let x = DeleteUserRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}/users/{user_id}"));
4448 /// ```
4449 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4450 self.name = v.into();
4451 self
4452 }
4453
4454 /// Sets the value of [request_id][crate::model::DeleteUserRequest::request_id].
4455 ///
4456 /// # Example
4457 /// ```ignore,no_run
4458 /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4459 /// let x = DeleteUserRequest::new().set_request_id("example");
4460 /// ```
4461 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4462 self.request_id = v.into();
4463 self
4464 }
4465
4466 /// Sets the value of [validate_only][crate::model::DeleteUserRequest::validate_only].
4467 ///
4468 /// # Example
4469 /// ```ignore,no_run
4470 /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4471 /// let x = DeleteUserRequest::new().set_validate_only(true);
4472 /// ```
4473 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4474 self.validate_only = v.into();
4475 self
4476 }
4477
4478 /// Sets the value of [etag][crate::model::DeleteUserRequest::etag].
4479 ///
4480 /// # Example
4481 /// ```ignore,no_run
4482 /// # use google_cloud_developerconnect_v1::model::DeleteUserRequest;
4483 /// let x = DeleteUserRequest::new().set_etag("example");
4484 /// ```
4485 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4486 self.etag = v.into();
4487 self
4488 }
4489}
4490
4491impl wkt::message::Message for DeleteUserRequest {
4492 fn typename() -> &'static str {
4493 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteUserRequest"
4494 }
4495}
4496
4497/// Represents the metadata of the long-running operation.
4498#[derive(Clone, Default, PartialEq)]
4499#[non_exhaustive]
4500pub struct OperationMetadata {
4501 /// Output only. The time the operation was created.
4502 pub create_time: std::option::Option<wkt::Timestamp>,
4503
4504 /// Output only. The time the operation finished running.
4505 pub end_time: std::option::Option<wkt::Timestamp>,
4506
4507 /// Output only. Server-defined resource path for the target of the operation.
4508 pub target: std::string::String,
4509
4510 /// Output only. Name of the verb executed by the operation.
4511 pub verb: std::string::String,
4512
4513 /// Output only. Human-readable status of the operation, if any.
4514 pub status_message: std::string::String,
4515
4516 /// Output only. Identifies whether the user has requested cancellation
4517 /// of the operation. Operations that have been cancelled successfully
4518 /// have
4519 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
4520 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
4521 /// corresponding to `Code.CANCELLED`.
4522 ///
4523 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
4524 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
4525 pub requested_cancellation: bool,
4526
4527 /// Output only. API version used to start the operation.
4528 pub api_version: std::string::String,
4529
4530 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4531}
4532
4533impl OperationMetadata {
4534 /// Creates a new default instance.
4535 pub fn new() -> Self {
4536 std::default::Default::default()
4537 }
4538
4539 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4540 ///
4541 /// # Example
4542 /// ```ignore,no_run
4543 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4544 /// use wkt::Timestamp;
4545 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4546 /// ```
4547 pub fn set_create_time<T>(mut self, v: T) -> Self
4548 where
4549 T: std::convert::Into<wkt::Timestamp>,
4550 {
4551 self.create_time = std::option::Option::Some(v.into());
4552 self
4553 }
4554
4555 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4556 ///
4557 /// # Example
4558 /// ```ignore,no_run
4559 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4560 /// use wkt::Timestamp;
4561 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4562 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4563 /// ```
4564 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4565 where
4566 T: std::convert::Into<wkt::Timestamp>,
4567 {
4568 self.create_time = v.map(|x| x.into());
4569 self
4570 }
4571
4572 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4573 ///
4574 /// # Example
4575 /// ```ignore,no_run
4576 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4577 /// use wkt::Timestamp;
4578 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4579 /// ```
4580 pub fn set_end_time<T>(mut self, v: T) -> Self
4581 where
4582 T: std::convert::Into<wkt::Timestamp>,
4583 {
4584 self.end_time = std::option::Option::Some(v.into());
4585 self
4586 }
4587
4588 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4589 ///
4590 /// # Example
4591 /// ```ignore,no_run
4592 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4593 /// use wkt::Timestamp;
4594 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4595 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4596 /// ```
4597 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4598 where
4599 T: std::convert::Into<wkt::Timestamp>,
4600 {
4601 self.end_time = v.map(|x| x.into());
4602 self
4603 }
4604
4605 /// Sets the value of [target][crate::model::OperationMetadata::target].
4606 ///
4607 /// # Example
4608 /// ```ignore,no_run
4609 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4610 /// let x = OperationMetadata::new().set_target("example");
4611 /// ```
4612 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4613 self.target = v.into();
4614 self
4615 }
4616
4617 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4618 ///
4619 /// # Example
4620 /// ```ignore,no_run
4621 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4622 /// let x = OperationMetadata::new().set_verb("example");
4623 /// ```
4624 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4625 self.verb = v.into();
4626 self
4627 }
4628
4629 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4630 ///
4631 /// # Example
4632 /// ```ignore,no_run
4633 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4634 /// let x = OperationMetadata::new().set_status_message("example");
4635 /// ```
4636 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4637 self.status_message = v.into();
4638 self
4639 }
4640
4641 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4642 ///
4643 /// # Example
4644 /// ```ignore,no_run
4645 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4646 /// let x = OperationMetadata::new().set_requested_cancellation(true);
4647 /// ```
4648 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4649 self.requested_cancellation = v.into();
4650 self
4651 }
4652
4653 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4654 ///
4655 /// # Example
4656 /// ```ignore,no_run
4657 /// # use google_cloud_developerconnect_v1::model::OperationMetadata;
4658 /// let x = OperationMetadata::new().set_api_version("example");
4659 /// ```
4660 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4661 self.api_version = v.into();
4662 self
4663 }
4664}
4665
4666impl wkt::message::Message for OperationMetadata {
4667 fn typename() -> &'static str {
4668 "type.googleapis.com/google.cloud.developerconnect.v1.OperationMetadata"
4669 }
4670}
4671
4672/// Message for fetching a User of the user themselves.
4673#[derive(Clone, Default, PartialEq)]
4674#[non_exhaustive]
4675pub struct FetchSelfRequest {
4676 /// Required. Name of the AccountConnector resource
4677 pub name: std::string::String,
4678
4679 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4680}
4681
4682impl FetchSelfRequest {
4683 /// Creates a new default instance.
4684 pub fn new() -> Self {
4685 std::default::Default::default()
4686 }
4687
4688 /// Sets the value of [name][crate::model::FetchSelfRequest::name].
4689 ///
4690 /// # Example
4691 /// ```ignore,no_run
4692 /// # use google_cloud_developerconnect_v1::model::FetchSelfRequest;
4693 /// # let project_id = "project_id";
4694 /// # let location_id = "location_id";
4695 /// # let account_connector_id = "account_connector_id";
4696 /// let x = FetchSelfRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
4697 /// ```
4698 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4699 self.name = v.into();
4700 self
4701 }
4702}
4703
4704impl wkt::message::Message for FetchSelfRequest {
4705 fn typename() -> &'static str {
4706 "type.googleapis.com/google.cloud.developerconnect.v1.FetchSelfRequest"
4707 }
4708}
4709
4710/// Message for deleting a User of the user themselves.
4711#[derive(Clone, Default, PartialEq)]
4712#[non_exhaustive]
4713pub struct DeleteSelfRequest {
4714 /// Required. Name of the AccountConnector resource
4715 pub name: std::string::String,
4716
4717 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4718}
4719
4720impl DeleteSelfRequest {
4721 /// Creates a new default instance.
4722 pub fn new() -> Self {
4723 std::default::Default::default()
4724 }
4725
4726 /// Sets the value of [name][crate::model::DeleteSelfRequest::name].
4727 ///
4728 /// # Example
4729 /// ```ignore,no_run
4730 /// # use google_cloud_developerconnect_v1::model::DeleteSelfRequest;
4731 /// # let project_id = "project_id";
4732 /// # let location_id = "location_id";
4733 /// # let account_connector_id = "account_connector_id";
4734 /// let x = DeleteSelfRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
4735 /// ```
4736 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4737 self.name = v.into();
4738 self
4739 }
4740}
4741
4742impl wkt::message::Message for DeleteSelfRequest {
4743 fn typename() -> &'static str {
4744 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteSelfRequest"
4745 }
4746}
4747
4748/// Message for fetching an OAuth access token.
4749#[derive(Clone, Default, PartialEq)]
4750#[non_exhaustive]
4751pub struct FetchAccessTokenRequest {
4752 /// Required. The resource name of the AccountConnector in the format
4753 /// `projects/*/locations/*/accountConnectors/*`.
4754 pub account_connector: std::string::String,
4755
4756 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4757}
4758
4759impl FetchAccessTokenRequest {
4760 /// Creates a new default instance.
4761 pub fn new() -> Self {
4762 std::default::Default::default()
4763 }
4764
4765 /// Sets the value of [account_connector][crate::model::FetchAccessTokenRequest::account_connector].
4766 ///
4767 /// # Example
4768 /// ```ignore,no_run
4769 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenRequest;
4770 /// # let project_id = "project_id";
4771 /// # let location_id = "location_id";
4772 /// # let account_connector_id = "account_connector_id";
4773 /// let x = FetchAccessTokenRequest::new().set_account_connector(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
4774 /// ```
4775 pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
4776 mut self,
4777 v: T,
4778 ) -> Self {
4779 self.account_connector = v.into();
4780 self
4781 }
4782}
4783
4784impl wkt::message::Message for FetchAccessTokenRequest {
4785 fn typename() -> &'static str {
4786 "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenRequest"
4787 }
4788}
4789
4790/// Message for responding to getting an OAuth access token.
4791#[derive(Clone, Default, PartialEq)]
4792#[non_exhaustive]
4793pub struct FetchAccessTokenResponse {
4794 /// The token content.
4795 pub token: std::string::String,
4796
4797 /// Expiration timestamp. Can be empty if unknown or non-expiring.
4798 pub expiration_time: std::option::Option<wkt::Timestamp>,
4799
4800 /// The scopes of the access token.
4801 pub scopes: std::vec::Vec<std::string::String>,
4802
4803 /// The error resulted from exchanging OAuth tokens from the service provider.
4804 pub exchange_error: std::option::Option<crate::model::ExchangeError>,
4805
4806 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4807}
4808
4809impl FetchAccessTokenResponse {
4810 /// Creates a new default instance.
4811 pub fn new() -> Self {
4812 std::default::Default::default()
4813 }
4814
4815 /// Sets the value of [token][crate::model::FetchAccessTokenResponse::token].
4816 ///
4817 /// # Example
4818 /// ```ignore,no_run
4819 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4820 /// let x = FetchAccessTokenResponse::new().set_token("example");
4821 /// ```
4822 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4823 self.token = v.into();
4824 self
4825 }
4826
4827 /// Sets the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
4828 ///
4829 /// # Example
4830 /// ```ignore,no_run
4831 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4832 /// use wkt::Timestamp;
4833 /// let x = FetchAccessTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
4834 /// ```
4835 pub fn set_expiration_time<T>(mut self, v: T) -> Self
4836 where
4837 T: std::convert::Into<wkt::Timestamp>,
4838 {
4839 self.expiration_time = std::option::Option::Some(v.into());
4840 self
4841 }
4842
4843 /// Sets or clears the value of [expiration_time][crate::model::FetchAccessTokenResponse::expiration_time].
4844 ///
4845 /// # Example
4846 /// ```ignore,no_run
4847 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4848 /// use wkt::Timestamp;
4849 /// let x = FetchAccessTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
4850 /// let x = FetchAccessTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
4851 /// ```
4852 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
4853 where
4854 T: std::convert::Into<wkt::Timestamp>,
4855 {
4856 self.expiration_time = v.map(|x| x.into());
4857 self
4858 }
4859
4860 /// Sets the value of [scopes][crate::model::FetchAccessTokenResponse::scopes].
4861 ///
4862 /// # Example
4863 /// ```ignore,no_run
4864 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4865 /// let x = FetchAccessTokenResponse::new().set_scopes(["a", "b", "c"]);
4866 /// ```
4867 pub fn set_scopes<T, V>(mut self, v: T) -> Self
4868 where
4869 T: std::iter::IntoIterator<Item = V>,
4870 V: std::convert::Into<std::string::String>,
4871 {
4872 use std::iter::Iterator;
4873 self.scopes = v.into_iter().map(|i| i.into()).collect();
4874 self
4875 }
4876
4877 /// Sets the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
4878 ///
4879 /// # Example
4880 /// ```ignore,no_run
4881 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4882 /// use google_cloud_developerconnect_v1::model::ExchangeError;
4883 /// let x = FetchAccessTokenResponse::new().set_exchange_error(ExchangeError::default()/* use setters */);
4884 /// ```
4885 pub fn set_exchange_error<T>(mut self, v: T) -> Self
4886 where
4887 T: std::convert::Into<crate::model::ExchangeError>,
4888 {
4889 self.exchange_error = std::option::Option::Some(v.into());
4890 self
4891 }
4892
4893 /// Sets or clears the value of [exchange_error][crate::model::FetchAccessTokenResponse::exchange_error].
4894 ///
4895 /// # Example
4896 /// ```ignore,no_run
4897 /// # use google_cloud_developerconnect_v1::model::FetchAccessTokenResponse;
4898 /// use google_cloud_developerconnect_v1::model::ExchangeError;
4899 /// let x = FetchAccessTokenResponse::new().set_or_clear_exchange_error(Some(ExchangeError::default()/* use setters */));
4900 /// let x = FetchAccessTokenResponse::new().set_or_clear_exchange_error(None::<ExchangeError>);
4901 /// ```
4902 pub fn set_or_clear_exchange_error<T>(mut self, v: std::option::Option<T>) -> Self
4903 where
4904 T: std::convert::Into<crate::model::ExchangeError>,
4905 {
4906 self.exchange_error = v.map(|x| x.into());
4907 self
4908 }
4909}
4910
4911impl wkt::message::Message for FetchAccessTokenResponse {
4912 fn typename() -> &'static str {
4913 "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenResponse"
4914 }
4915}
4916
4917/// Message for starting an OAuth flow.
4918#[derive(Clone, Default, PartialEq)]
4919#[non_exhaustive]
4920pub struct StartOAuthRequest {
4921 /// Required. The resource name of the AccountConnector in the format
4922 /// `projects/*/locations/*/accountConnectors/*`.
4923 pub account_connector: std::string::String,
4924
4925 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4926}
4927
4928impl StartOAuthRequest {
4929 /// Creates a new default instance.
4930 pub fn new() -> Self {
4931 std::default::Default::default()
4932 }
4933
4934 /// Sets the value of [account_connector][crate::model::StartOAuthRequest::account_connector].
4935 ///
4936 /// # Example
4937 /// ```ignore,no_run
4938 /// # use google_cloud_developerconnect_v1::model::StartOAuthRequest;
4939 /// # let project_id = "project_id";
4940 /// # let location_id = "location_id";
4941 /// # let account_connector_id = "account_connector_id";
4942 /// let x = StartOAuthRequest::new().set_account_connector(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
4943 /// ```
4944 pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
4945 mut self,
4946 v: T,
4947 ) -> Self {
4948 self.account_connector = v.into();
4949 self
4950 }
4951}
4952
4953impl wkt::message::Message for StartOAuthRequest {
4954 fn typename() -> &'static str {
4955 "type.googleapis.com/google.cloud.developerconnect.v1.StartOAuthRequest"
4956 }
4957}
4958
4959/// Message for responding to starting an OAuth flow.
4960#[derive(Clone, Default, PartialEq)]
4961#[non_exhaustive]
4962pub struct StartOAuthResponse {
4963 /// The ticket to be used for post processing the callback from the service
4964 /// provider.
4965 pub ticket: std::string::String,
4966
4967 /// Please refer to <https://datatracker.ietf.org/doc/html/rfc7636#section-4.1>
4968 pub code_challenge: std::string::String,
4969
4970 /// Please refer to <https://datatracker.ietf.org/doc/html/rfc7636#section-4.2>
4971 pub code_challenge_method: std::string::String,
4972
4973 /// The client ID to the OAuth App of the service provider.
4974 pub client_id: std::string::String,
4975
4976 /// The list of scopes requested by the application.
4977 pub scopes: std::vec::Vec<std::string::String>,
4978
4979 /// The authorization server URL to the OAuth flow of the service provider.
4980 pub auth_uri: std::string::String,
4981
4982 /// The ID of the service provider.
4983 pub id: std::option::Option<crate::model::start_o_auth_response::Id>,
4984
4985 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4986}
4987
4988impl StartOAuthResponse {
4989 /// Creates a new default instance.
4990 pub fn new() -> Self {
4991 std::default::Default::default()
4992 }
4993
4994 /// Sets the value of [ticket][crate::model::StartOAuthResponse::ticket].
4995 ///
4996 /// # Example
4997 /// ```ignore,no_run
4998 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
4999 /// let x = StartOAuthResponse::new().set_ticket("example");
5000 /// ```
5001 pub fn set_ticket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5002 self.ticket = v.into();
5003 self
5004 }
5005
5006 /// Sets the value of [code_challenge][crate::model::StartOAuthResponse::code_challenge].
5007 ///
5008 /// # Example
5009 /// ```ignore,no_run
5010 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5011 /// let x = StartOAuthResponse::new().set_code_challenge("example");
5012 /// ```
5013 pub fn set_code_challenge<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5014 self.code_challenge = v.into();
5015 self
5016 }
5017
5018 /// Sets the value of [code_challenge_method][crate::model::StartOAuthResponse::code_challenge_method].
5019 ///
5020 /// # Example
5021 /// ```ignore,no_run
5022 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5023 /// let x = StartOAuthResponse::new().set_code_challenge_method("example");
5024 /// ```
5025 pub fn set_code_challenge_method<T: std::convert::Into<std::string::String>>(
5026 mut self,
5027 v: T,
5028 ) -> Self {
5029 self.code_challenge_method = v.into();
5030 self
5031 }
5032
5033 /// Sets the value of [client_id][crate::model::StartOAuthResponse::client_id].
5034 ///
5035 /// # Example
5036 /// ```ignore,no_run
5037 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5038 /// let x = StartOAuthResponse::new().set_client_id("example");
5039 /// ```
5040 pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5041 self.client_id = v.into();
5042 self
5043 }
5044
5045 /// Sets the value of [scopes][crate::model::StartOAuthResponse::scopes].
5046 ///
5047 /// # Example
5048 /// ```ignore,no_run
5049 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5050 /// let x = StartOAuthResponse::new().set_scopes(["a", "b", "c"]);
5051 /// ```
5052 pub fn set_scopes<T, V>(mut self, v: T) -> Self
5053 where
5054 T: std::iter::IntoIterator<Item = V>,
5055 V: std::convert::Into<std::string::String>,
5056 {
5057 use std::iter::Iterator;
5058 self.scopes = v.into_iter().map(|i| i.into()).collect();
5059 self
5060 }
5061
5062 /// Sets the value of [auth_uri][crate::model::StartOAuthResponse::auth_uri].
5063 ///
5064 /// # Example
5065 /// ```ignore,no_run
5066 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5067 /// let x = StartOAuthResponse::new().set_auth_uri("example");
5068 /// ```
5069 pub fn set_auth_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5070 self.auth_uri = v.into();
5071 self
5072 }
5073
5074 /// Sets the value of [id][crate::model::StartOAuthResponse::id].
5075 ///
5076 /// Note that all the setters affecting `id` are mutually
5077 /// exclusive.
5078 ///
5079 /// # Example
5080 /// ```ignore,no_run
5081 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5082 /// use google_cloud_developerconnect_v1::model::SystemProvider;
5083 /// let x0 = StartOAuthResponse::new().set_id(Some(
5084 /// google_cloud_developerconnect_v1::model::start_o_auth_response::Id::SystemProviderId(SystemProvider::Github)));
5085 /// let x1 = StartOAuthResponse::new().set_id(Some(
5086 /// google_cloud_developerconnect_v1::model::start_o_auth_response::Id::SystemProviderId(SystemProvider::Gitlab)));
5087 /// let x2 = StartOAuthResponse::new().set_id(Some(
5088 /// google_cloud_developerconnect_v1::model::start_o_auth_response::Id::SystemProviderId(SystemProvider::Google)));
5089 /// ```
5090 pub fn set_id<
5091 T: std::convert::Into<std::option::Option<crate::model::start_o_auth_response::Id>>,
5092 >(
5093 mut self,
5094 v: T,
5095 ) -> Self {
5096 self.id = v.into();
5097 self
5098 }
5099
5100 /// The value of [id][crate::model::StartOAuthResponse::id]
5101 /// if it holds a `SystemProviderId`, `None` if the field is not set or
5102 /// holds a different branch.
5103 pub fn system_provider_id(&self) -> std::option::Option<&crate::model::SystemProvider> {
5104 #[allow(unreachable_patterns)]
5105 self.id.as_ref().and_then(|v| match v {
5106 crate::model::start_o_auth_response::Id::SystemProviderId(v) => {
5107 std::option::Option::Some(v)
5108 }
5109 _ => std::option::Option::None,
5110 })
5111 }
5112
5113 /// Sets the value of [id][crate::model::StartOAuthResponse::id]
5114 /// to hold a `SystemProviderId`.
5115 ///
5116 /// Note that all the setters affecting `id` are
5117 /// mutually exclusive.
5118 ///
5119 /// # Example
5120 /// ```ignore,no_run
5121 /// # use google_cloud_developerconnect_v1::model::StartOAuthResponse;
5122 /// use google_cloud_developerconnect_v1::model::SystemProvider;
5123 /// let x0 = StartOAuthResponse::new().set_system_provider_id(SystemProvider::Github);
5124 /// let x1 = StartOAuthResponse::new().set_system_provider_id(SystemProvider::Gitlab);
5125 /// let x2 = StartOAuthResponse::new().set_system_provider_id(SystemProvider::Google);
5126 /// assert!(x0.system_provider_id().is_some());
5127 /// assert!(x1.system_provider_id().is_some());
5128 /// assert!(x2.system_provider_id().is_some());
5129 /// ```
5130 pub fn set_system_provider_id<T: std::convert::Into<crate::model::SystemProvider>>(
5131 mut self,
5132 v: T,
5133 ) -> Self {
5134 self.id = std::option::Option::Some(
5135 crate::model::start_o_auth_response::Id::SystemProviderId(v.into()),
5136 );
5137 self
5138 }
5139}
5140
5141impl wkt::message::Message for StartOAuthResponse {
5142 fn typename() -> &'static str {
5143 "type.googleapis.com/google.cloud.developerconnect.v1.StartOAuthResponse"
5144 }
5145}
5146
5147/// Defines additional types related to [StartOAuthResponse].
5148pub mod start_o_auth_response {
5149 #[allow(unused_imports)]
5150 use super::*;
5151
5152 /// The ID of the service provider.
5153 #[derive(Clone, Debug, PartialEq)]
5154 #[non_exhaustive]
5155 pub enum Id {
5156 /// The ID of the system provider.
5157 SystemProviderId(crate::model::SystemProvider),
5158 }
5159}
5160
5161/// Message for finishing an OAuth flow.
5162#[derive(Clone, Default, PartialEq)]
5163#[non_exhaustive]
5164pub struct FinishOAuthRequest {
5165 /// Required. The resource name of the AccountConnector in the format
5166 /// `projects/*/locations/*/accountConnectors/*`.
5167 pub account_connector: std::string::String,
5168
5169 /// The params returned by OAuth flow redirect.
5170 pub params: std::option::Option<crate::model::finish_o_auth_request::Params>,
5171
5172 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5173}
5174
5175impl FinishOAuthRequest {
5176 /// Creates a new default instance.
5177 pub fn new() -> Self {
5178 std::default::Default::default()
5179 }
5180
5181 /// Sets the value of [account_connector][crate::model::FinishOAuthRequest::account_connector].
5182 ///
5183 /// # Example
5184 /// ```ignore,no_run
5185 /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5186 /// # let project_id = "project_id";
5187 /// # let location_id = "location_id";
5188 /// # let account_connector_id = "account_connector_id";
5189 /// let x = FinishOAuthRequest::new().set_account_connector(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
5190 /// ```
5191 pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
5192 mut self,
5193 v: T,
5194 ) -> Self {
5195 self.account_connector = v.into();
5196 self
5197 }
5198
5199 /// Sets the value of [params][crate::model::FinishOAuthRequest::params].
5200 ///
5201 /// Note that all the setters affecting `params` are mutually
5202 /// exclusive.
5203 ///
5204 /// # Example
5205 /// ```ignore,no_run
5206 /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5207 /// use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5208 /// let x = FinishOAuthRequest::new().set_params(Some(
5209 /// google_cloud_developerconnect_v1::model::finish_o_auth_request::Params::OauthParams(OAuthParams::default().into())));
5210 /// ```
5211 pub fn set_params<
5212 T: std::convert::Into<std::option::Option<crate::model::finish_o_auth_request::Params>>,
5213 >(
5214 mut self,
5215 v: T,
5216 ) -> Self {
5217 self.params = v.into();
5218 self
5219 }
5220
5221 /// The value of [params][crate::model::FinishOAuthRequest::params]
5222 /// if it holds a `OauthParams`, `None` if the field is not set or
5223 /// holds a different branch.
5224 pub fn oauth_params(
5225 &self,
5226 ) -> std::option::Option<&std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>>
5227 {
5228 #[allow(unreachable_patterns)]
5229 self.params.as_ref().and_then(|v| match v {
5230 crate::model::finish_o_auth_request::Params::OauthParams(v) => {
5231 std::option::Option::Some(v)
5232 }
5233 _ => std::option::Option::None,
5234 })
5235 }
5236
5237 /// Sets the value of [params][crate::model::FinishOAuthRequest::params]
5238 /// to hold a `OauthParams`.
5239 ///
5240 /// Note that all the setters affecting `params` are
5241 /// mutually exclusive.
5242 ///
5243 /// # Example
5244 /// ```ignore,no_run
5245 /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5246 /// use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5247 /// let x = FinishOAuthRequest::new().set_oauth_params(OAuthParams::default()/* use setters */);
5248 /// assert!(x.oauth_params().is_some());
5249 /// assert!(x.google_oauth_params().is_none());
5250 /// ```
5251 pub fn set_oauth_params<
5252 T: std::convert::Into<std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>>,
5253 >(
5254 mut self,
5255 v: T,
5256 ) -> Self {
5257 self.params = std::option::Option::Some(
5258 crate::model::finish_o_auth_request::Params::OauthParams(v.into()),
5259 );
5260 self
5261 }
5262
5263 /// The value of [params][crate::model::FinishOAuthRequest::params]
5264 /// if it holds a `GoogleOauthParams`, `None` if the field is not set or
5265 /// holds a different branch.
5266 pub fn google_oauth_params(
5267 &self,
5268 ) -> std::option::Option<&std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>>
5269 {
5270 #[allow(unreachable_patterns)]
5271 self.params.as_ref().and_then(|v| match v {
5272 crate::model::finish_o_auth_request::Params::GoogleOauthParams(v) => {
5273 std::option::Option::Some(v)
5274 }
5275 _ => std::option::Option::None,
5276 })
5277 }
5278
5279 /// Sets the value of [params][crate::model::FinishOAuthRequest::params]
5280 /// to hold a `GoogleOauthParams`.
5281 ///
5282 /// Note that all the setters affecting `params` are
5283 /// mutually exclusive.
5284 ///
5285 /// # Example
5286 /// ```ignore,no_run
5287 /// # use google_cloud_developerconnect_v1::model::FinishOAuthRequest;
5288 /// use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5289 /// let x = FinishOAuthRequest::new().set_google_oauth_params(GoogleOAuthParams::default()/* use setters */);
5290 /// assert!(x.google_oauth_params().is_some());
5291 /// assert!(x.oauth_params().is_none());
5292 /// ```
5293 pub fn set_google_oauth_params<
5294 T: std::convert::Into<std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>>,
5295 >(
5296 mut self,
5297 v: T,
5298 ) -> Self {
5299 self.params = std::option::Option::Some(
5300 crate::model::finish_o_auth_request::Params::GoogleOauthParams(v.into()),
5301 );
5302 self
5303 }
5304}
5305
5306impl wkt::message::Message for FinishOAuthRequest {
5307 fn typename() -> &'static str {
5308 "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthRequest"
5309 }
5310}
5311
5312/// Defines additional types related to [FinishOAuthRequest].
5313pub mod finish_o_auth_request {
5314 #[allow(unused_imports)]
5315 use super::*;
5316
5317 /// The params returned by non-Google OAuth 2.0 flow redirect.
5318 #[derive(Clone, Default, PartialEq)]
5319 #[non_exhaustive]
5320 pub struct OAuthParams {
5321 /// Required. The code to be used for getting the token from SCM provider.
5322 pub code: std::string::String,
5323
5324 /// Required. The ticket to be used for post processing the callback from SCM
5325 /// provider.
5326 pub ticket: std::string::String,
5327
5328 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5329 }
5330
5331 impl OAuthParams {
5332 /// Creates a new default instance.
5333 pub fn new() -> Self {
5334 std::default::Default::default()
5335 }
5336
5337 /// Sets the value of [code][crate::model::finish_o_auth_request::OAuthParams::code].
5338 ///
5339 /// # Example
5340 /// ```ignore,no_run
5341 /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5342 /// let x = OAuthParams::new().set_code("example");
5343 /// ```
5344 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5345 self.code = v.into();
5346 self
5347 }
5348
5349 /// Sets the value of [ticket][crate::model::finish_o_auth_request::OAuthParams::ticket].
5350 ///
5351 /// # Example
5352 /// ```ignore,no_run
5353 /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::OAuthParams;
5354 /// let x = OAuthParams::new().set_ticket("example");
5355 /// ```
5356 pub fn set_ticket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5357 self.ticket = v.into();
5358 self
5359 }
5360 }
5361
5362 impl wkt::message::Message for OAuthParams {
5363 fn typename() -> &'static str {
5364 "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthRequest.OAuthParams"
5365 }
5366 }
5367
5368 /// The params returned by Google OAuth flow redirects.
5369 #[derive(Clone, Default, PartialEq)]
5370 #[non_exhaustive]
5371 pub struct GoogleOAuthParams {
5372 /// Required. The scopes returned by Google OAuth flow.
5373 pub scopes: std::vec::Vec<std::string::String>,
5374
5375 /// Optional. The version info returned by Google OAuth flow.
5376 pub version_info: std::string::String,
5377
5378 /// Required. The ticket to be used for post processing the callback from
5379 /// Google OAuth flow.
5380 pub ticket: std::string::String,
5381
5382 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5383 }
5384
5385 impl GoogleOAuthParams {
5386 /// Creates a new default instance.
5387 pub fn new() -> Self {
5388 std::default::Default::default()
5389 }
5390
5391 /// Sets the value of [scopes][crate::model::finish_o_auth_request::GoogleOAuthParams::scopes].
5392 ///
5393 /// # Example
5394 /// ```ignore,no_run
5395 /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5396 /// let x = GoogleOAuthParams::new().set_scopes(["a", "b", "c"]);
5397 /// ```
5398 pub fn set_scopes<T, V>(mut self, v: T) -> Self
5399 where
5400 T: std::iter::IntoIterator<Item = V>,
5401 V: std::convert::Into<std::string::String>,
5402 {
5403 use std::iter::Iterator;
5404 self.scopes = v.into_iter().map(|i| i.into()).collect();
5405 self
5406 }
5407
5408 /// Sets the value of [version_info][crate::model::finish_o_auth_request::GoogleOAuthParams::version_info].
5409 ///
5410 /// # Example
5411 /// ```ignore,no_run
5412 /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5413 /// let x = GoogleOAuthParams::new().set_version_info("example");
5414 /// ```
5415 pub fn set_version_info<T: std::convert::Into<std::string::String>>(
5416 mut self,
5417 v: T,
5418 ) -> Self {
5419 self.version_info = v.into();
5420 self
5421 }
5422
5423 /// Sets the value of [ticket][crate::model::finish_o_auth_request::GoogleOAuthParams::ticket].
5424 ///
5425 /// # Example
5426 /// ```ignore,no_run
5427 /// # use google_cloud_developerconnect_v1::model::finish_o_auth_request::GoogleOAuthParams;
5428 /// let x = GoogleOAuthParams::new().set_ticket("example");
5429 /// ```
5430 pub fn set_ticket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5431 self.ticket = v.into();
5432 self
5433 }
5434 }
5435
5436 impl wkt::message::Message for GoogleOAuthParams {
5437 fn typename() -> &'static str {
5438 "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthRequest.GoogleOAuthParams"
5439 }
5440 }
5441
5442 /// The params returned by OAuth flow redirect.
5443 #[derive(Clone, Debug, PartialEq)]
5444 #[non_exhaustive]
5445 pub enum Params {
5446 /// The params returned by non-Google OAuth 2.0 flow redirect.
5447 OauthParams(std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>),
5448 /// The params returned by Google OAuth flow redirects.
5449 GoogleOauthParams(std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>),
5450 }
5451}
5452
5453/// Message for responding to finishing an OAuth flow.
5454#[derive(Clone, Default, PartialEq)]
5455#[non_exhaustive]
5456pub struct FinishOAuthResponse {
5457 /// The error resulted from exchanging OAuth tokens from the service provider.
5458 pub exchange_error: std::option::Option<crate::model::ExchangeError>,
5459
5460 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5461}
5462
5463impl FinishOAuthResponse {
5464 /// Creates a new default instance.
5465 pub fn new() -> Self {
5466 std::default::Default::default()
5467 }
5468
5469 /// Sets the value of [exchange_error][crate::model::FinishOAuthResponse::exchange_error].
5470 ///
5471 /// # Example
5472 /// ```ignore,no_run
5473 /// # use google_cloud_developerconnect_v1::model::FinishOAuthResponse;
5474 /// use google_cloud_developerconnect_v1::model::ExchangeError;
5475 /// let x = FinishOAuthResponse::new().set_exchange_error(ExchangeError::default()/* use setters */);
5476 /// ```
5477 pub fn set_exchange_error<T>(mut self, v: T) -> Self
5478 where
5479 T: std::convert::Into<crate::model::ExchangeError>,
5480 {
5481 self.exchange_error = std::option::Option::Some(v.into());
5482 self
5483 }
5484
5485 /// Sets or clears the value of [exchange_error][crate::model::FinishOAuthResponse::exchange_error].
5486 ///
5487 /// # Example
5488 /// ```ignore,no_run
5489 /// # use google_cloud_developerconnect_v1::model::FinishOAuthResponse;
5490 /// use google_cloud_developerconnect_v1::model::ExchangeError;
5491 /// let x = FinishOAuthResponse::new().set_or_clear_exchange_error(Some(ExchangeError::default()/* use setters */));
5492 /// let x = FinishOAuthResponse::new().set_or_clear_exchange_error(None::<ExchangeError>);
5493 /// ```
5494 pub fn set_or_clear_exchange_error<T>(mut self, v: std::option::Option<T>) -> Self
5495 where
5496 T: std::convert::Into<crate::model::ExchangeError>,
5497 {
5498 self.exchange_error = v.map(|x| x.into());
5499 self
5500 }
5501}
5502
5503impl wkt::message::Message for FinishOAuthResponse {
5504 fn typename() -> &'static str {
5505 "type.googleapis.com/google.cloud.developerconnect.v1.FinishOAuthResponse"
5506 }
5507}
5508
5509/// Message for representing an error from exchanging OAuth tokens.
5510#[derive(Clone, Default, PartialEq)]
5511#[non_exhaustive]
5512pub struct ExchangeError {
5513 /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> - error
5514 pub code: std::string::String,
5515
5516 /// <https://datatracker.ietf.org/doc/html/rfc6749#section-5.2> -
5517 /// error_description
5518 pub description: std::string::String,
5519
5520 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5521}
5522
5523impl ExchangeError {
5524 /// Creates a new default instance.
5525 pub fn new() -> Self {
5526 std::default::Default::default()
5527 }
5528
5529 /// Sets the value of [code][crate::model::ExchangeError::code].
5530 ///
5531 /// # Example
5532 /// ```ignore,no_run
5533 /// # use google_cloud_developerconnect_v1::model::ExchangeError;
5534 /// let x = ExchangeError::new().set_code("example");
5535 /// ```
5536 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5537 self.code = v.into();
5538 self
5539 }
5540
5541 /// Sets the value of [description][crate::model::ExchangeError::description].
5542 ///
5543 /// # Example
5544 /// ```ignore,no_run
5545 /// # use google_cloud_developerconnect_v1::model::ExchangeError;
5546 /// let x = ExchangeError::new().set_description("example");
5547 /// ```
5548 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5549 self.description = v.into();
5550 self
5551 }
5552}
5553
5554impl wkt::message::Message for ExchangeError {
5555 fn typename() -> &'static str {
5556 "type.googleapis.com/google.cloud.developerconnect.v1.ExchangeError"
5557 }
5558}
5559
5560/// Message describing the GitRepositoryLink object
5561#[derive(Clone, Default, PartialEq)]
5562#[non_exhaustive]
5563pub struct GitRepositoryLink {
5564 /// Identifier. Resource name of the repository, in the format
5565 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
5566 pub name: std::string::String,
5567
5568 /// Required. Git Clone URI.
5569 pub clone_uri: std::string::String,
5570
5571 /// Output only. [Output only] Create timestamp
5572 pub create_time: std::option::Option<wkt::Timestamp>,
5573
5574 /// Output only. [Output only] Update timestamp
5575 pub update_time: std::option::Option<wkt::Timestamp>,
5576
5577 /// Output only. [Output only] Delete timestamp
5578 pub delete_time: std::option::Option<wkt::Timestamp>,
5579
5580 /// Optional. Labels as key value pairs
5581 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5582
5583 /// Optional. This checksum is computed by the server based on the value of
5584 /// other fields, and may be sent on update and delete requests to ensure the
5585 /// client has an up-to-date value before proceeding.
5586 pub etag: std::string::String,
5587
5588 /// Output only. Set to true when the connection is being set up or updated in
5589 /// the background.
5590 pub reconciling: bool,
5591
5592 /// Optional. Allows clients to store small amounts of arbitrary data.
5593 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
5594
5595 /// Output only. A system-assigned unique identifier for the GitRepositoryLink.
5596 pub uid: std::string::String,
5597
5598 /// Output only. External ID of the webhook created for the repository.
5599 pub webhook_id: std::string::String,
5600
5601 /// Output only. URI to access the linked repository through the Git Proxy.
5602 /// This field is only populated if the git proxy is enabled for the
5603 /// connection.
5604 pub git_proxy_uri: std::string::String,
5605
5606 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5607}
5608
5609impl GitRepositoryLink {
5610 /// Creates a new default instance.
5611 pub fn new() -> Self {
5612 std::default::Default::default()
5613 }
5614
5615 /// Sets the value of [name][crate::model::GitRepositoryLink::name].
5616 ///
5617 /// # Example
5618 /// ```ignore,no_run
5619 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5620 /// # let project_id = "project_id";
5621 /// # let location_id = "location_id";
5622 /// # let connection_id = "connection_id";
5623 /// # let git_repository_link_id = "git_repository_link_id";
5624 /// let x = GitRepositoryLink::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
5625 /// ```
5626 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5627 self.name = v.into();
5628 self
5629 }
5630
5631 /// Sets the value of [clone_uri][crate::model::GitRepositoryLink::clone_uri].
5632 ///
5633 /// # Example
5634 /// ```ignore,no_run
5635 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5636 /// let x = GitRepositoryLink::new().set_clone_uri("example");
5637 /// ```
5638 pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5639 self.clone_uri = v.into();
5640 self
5641 }
5642
5643 /// Sets the value of [create_time][crate::model::GitRepositoryLink::create_time].
5644 ///
5645 /// # Example
5646 /// ```ignore,no_run
5647 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5648 /// use wkt::Timestamp;
5649 /// let x = GitRepositoryLink::new().set_create_time(Timestamp::default()/* use setters */);
5650 /// ```
5651 pub fn set_create_time<T>(mut self, v: T) -> Self
5652 where
5653 T: std::convert::Into<wkt::Timestamp>,
5654 {
5655 self.create_time = std::option::Option::Some(v.into());
5656 self
5657 }
5658
5659 /// Sets or clears the value of [create_time][crate::model::GitRepositoryLink::create_time].
5660 ///
5661 /// # Example
5662 /// ```ignore,no_run
5663 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5664 /// use wkt::Timestamp;
5665 /// let x = GitRepositoryLink::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5666 /// let x = GitRepositoryLink::new().set_or_clear_create_time(None::<Timestamp>);
5667 /// ```
5668 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5669 where
5670 T: std::convert::Into<wkt::Timestamp>,
5671 {
5672 self.create_time = v.map(|x| x.into());
5673 self
5674 }
5675
5676 /// Sets the value of [update_time][crate::model::GitRepositoryLink::update_time].
5677 ///
5678 /// # Example
5679 /// ```ignore,no_run
5680 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5681 /// use wkt::Timestamp;
5682 /// let x = GitRepositoryLink::new().set_update_time(Timestamp::default()/* use setters */);
5683 /// ```
5684 pub fn set_update_time<T>(mut self, v: T) -> Self
5685 where
5686 T: std::convert::Into<wkt::Timestamp>,
5687 {
5688 self.update_time = std::option::Option::Some(v.into());
5689 self
5690 }
5691
5692 /// Sets or clears the value of [update_time][crate::model::GitRepositoryLink::update_time].
5693 ///
5694 /// # Example
5695 /// ```ignore,no_run
5696 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5697 /// use wkt::Timestamp;
5698 /// let x = GitRepositoryLink::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5699 /// let x = GitRepositoryLink::new().set_or_clear_update_time(None::<Timestamp>);
5700 /// ```
5701 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5702 where
5703 T: std::convert::Into<wkt::Timestamp>,
5704 {
5705 self.update_time = v.map(|x| x.into());
5706 self
5707 }
5708
5709 /// Sets the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
5710 ///
5711 /// # Example
5712 /// ```ignore,no_run
5713 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5714 /// use wkt::Timestamp;
5715 /// let x = GitRepositoryLink::new().set_delete_time(Timestamp::default()/* use setters */);
5716 /// ```
5717 pub fn set_delete_time<T>(mut self, v: T) -> Self
5718 where
5719 T: std::convert::Into<wkt::Timestamp>,
5720 {
5721 self.delete_time = std::option::Option::Some(v.into());
5722 self
5723 }
5724
5725 /// Sets or clears the value of [delete_time][crate::model::GitRepositoryLink::delete_time].
5726 ///
5727 /// # Example
5728 /// ```ignore,no_run
5729 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5730 /// use wkt::Timestamp;
5731 /// let x = GitRepositoryLink::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
5732 /// let x = GitRepositoryLink::new().set_or_clear_delete_time(None::<Timestamp>);
5733 /// ```
5734 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
5735 where
5736 T: std::convert::Into<wkt::Timestamp>,
5737 {
5738 self.delete_time = v.map(|x| x.into());
5739 self
5740 }
5741
5742 /// Sets the value of [labels][crate::model::GitRepositoryLink::labels].
5743 ///
5744 /// # Example
5745 /// ```ignore,no_run
5746 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5747 /// let x = GitRepositoryLink::new().set_labels([
5748 /// ("key0", "abc"),
5749 /// ("key1", "xyz"),
5750 /// ]);
5751 /// ```
5752 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5753 where
5754 T: std::iter::IntoIterator<Item = (K, V)>,
5755 K: std::convert::Into<std::string::String>,
5756 V: std::convert::Into<std::string::String>,
5757 {
5758 use std::iter::Iterator;
5759 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5760 self
5761 }
5762
5763 /// Sets the value of [etag][crate::model::GitRepositoryLink::etag].
5764 ///
5765 /// # Example
5766 /// ```ignore,no_run
5767 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5768 /// let x = GitRepositoryLink::new().set_etag("example");
5769 /// ```
5770 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5771 self.etag = v.into();
5772 self
5773 }
5774
5775 /// Sets the value of [reconciling][crate::model::GitRepositoryLink::reconciling].
5776 ///
5777 /// # Example
5778 /// ```ignore,no_run
5779 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5780 /// let x = GitRepositoryLink::new().set_reconciling(true);
5781 /// ```
5782 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5783 self.reconciling = v.into();
5784 self
5785 }
5786
5787 /// Sets the value of [annotations][crate::model::GitRepositoryLink::annotations].
5788 ///
5789 /// # Example
5790 /// ```ignore,no_run
5791 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5792 /// let x = GitRepositoryLink::new().set_annotations([
5793 /// ("key0", "abc"),
5794 /// ("key1", "xyz"),
5795 /// ]);
5796 /// ```
5797 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
5798 where
5799 T: std::iter::IntoIterator<Item = (K, V)>,
5800 K: std::convert::Into<std::string::String>,
5801 V: std::convert::Into<std::string::String>,
5802 {
5803 use std::iter::Iterator;
5804 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5805 self
5806 }
5807
5808 /// Sets the value of [uid][crate::model::GitRepositoryLink::uid].
5809 ///
5810 /// # Example
5811 /// ```ignore,no_run
5812 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5813 /// let x = GitRepositoryLink::new().set_uid("example");
5814 /// ```
5815 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5816 self.uid = v.into();
5817 self
5818 }
5819
5820 /// Sets the value of [webhook_id][crate::model::GitRepositoryLink::webhook_id].
5821 ///
5822 /// # Example
5823 /// ```ignore,no_run
5824 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5825 /// let x = GitRepositoryLink::new().set_webhook_id("example");
5826 /// ```
5827 pub fn set_webhook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5828 self.webhook_id = v.into();
5829 self
5830 }
5831
5832 /// Sets the value of [git_proxy_uri][crate::model::GitRepositoryLink::git_proxy_uri].
5833 ///
5834 /// # Example
5835 /// ```ignore,no_run
5836 /// # use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5837 /// let x = GitRepositoryLink::new().set_git_proxy_uri("example");
5838 /// ```
5839 pub fn set_git_proxy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5840 self.git_proxy_uri = v.into();
5841 self
5842 }
5843}
5844
5845impl wkt::message::Message for GitRepositoryLink {
5846 fn typename() -> &'static str {
5847 "type.googleapis.com/google.cloud.developerconnect.v1.GitRepositoryLink"
5848 }
5849}
5850
5851/// Message for creating a GitRepositoryLink
5852#[derive(Clone, Default, PartialEq)]
5853#[non_exhaustive]
5854pub struct CreateGitRepositoryLinkRequest {
5855 /// Required. Value for parent.
5856 pub parent: std::string::String,
5857
5858 /// Required. The resource being created
5859 pub git_repository_link: std::option::Option<crate::model::GitRepositoryLink>,
5860
5861 /// Required. The ID to use for the repository, which will become the final
5862 /// component of the repository's resource name. This ID should be unique in
5863 /// the connection. Allows alphanumeric characters and any of
5864 /// -._~%!$&'()*+,;=@.
5865 pub git_repository_link_id: std::string::String,
5866
5867 /// Optional. An optional request ID to identify requests. Specify a unique
5868 /// request ID so that if you must retry your request, the server will know to
5869 /// ignore the request if it has already been completed. The server will
5870 /// guarantee that for at least 60 minutes since the first request.
5871 ///
5872 /// For example, consider a situation where you make an initial request and the
5873 /// request times out. If you make the request again with the same request
5874 /// ID, the server can check if original operation with the same request ID
5875 /// was received, and if so, will ignore the second request. This prevents
5876 /// clients from accidentally creating duplicate commitments.
5877 ///
5878 /// The request ID must be a valid UUID with the exception that zero UUID is
5879 /// not supported (00000000-0000-0000-0000-000000000000).
5880 pub request_id: std::string::String,
5881
5882 /// Optional. If set, validate the request, but do not actually post it.
5883 pub validate_only: bool,
5884
5885 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5886}
5887
5888impl CreateGitRepositoryLinkRequest {
5889 /// Creates a new default instance.
5890 pub fn new() -> Self {
5891 std::default::Default::default()
5892 }
5893
5894 /// Sets the value of [parent][crate::model::CreateGitRepositoryLinkRequest::parent].
5895 ///
5896 /// # Example
5897 /// ```ignore,no_run
5898 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5899 /// # let project_id = "project_id";
5900 /// # let location_id = "location_id";
5901 /// # let connection_id = "connection_id";
5902 /// let x = CreateGitRepositoryLinkRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
5903 /// ```
5904 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5905 self.parent = v.into();
5906 self
5907 }
5908
5909 /// Sets the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
5910 ///
5911 /// # Example
5912 /// ```ignore,no_run
5913 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5914 /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5915 /// let x = CreateGitRepositoryLinkRequest::new().set_git_repository_link(GitRepositoryLink::default()/* use setters */);
5916 /// ```
5917 pub fn set_git_repository_link<T>(mut self, v: T) -> Self
5918 where
5919 T: std::convert::Into<crate::model::GitRepositoryLink>,
5920 {
5921 self.git_repository_link = std::option::Option::Some(v.into());
5922 self
5923 }
5924
5925 /// Sets or clears the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
5926 ///
5927 /// # Example
5928 /// ```ignore,no_run
5929 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5930 /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
5931 /// let x = CreateGitRepositoryLinkRequest::new().set_or_clear_git_repository_link(Some(GitRepositoryLink::default()/* use setters */));
5932 /// let x = CreateGitRepositoryLinkRequest::new().set_or_clear_git_repository_link(None::<GitRepositoryLink>);
5933 /// ```
5934 pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
5935 where
5936 T: std::convert::Into<crate::model::GitRepositoryLink>,
5937 {
5938 self.git_repository_link = v.map(|x| x.into());
5939 self
5940 }
5941
5942 /// Sets the value of [git_repository_link_id][crate::model::CreateGitRepositoryLinkRequest::git_repository_link_id].
5943 ///
5944 /// # Example
5945 /// ```ignore,no_run
5946 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5947 /// let x = CreateGitRepositoryLinkRequest::new().set_git_repository_link_id("example");
5948 /// ```
5949 pub fn set_git_repository_link_id<T: std::convert::Into<std::string::String>>(
5950 mut self,
5951 v: T,
5952 ) -> Self {
5953 self.git_repository_link_id = v.into();
5954 self
5955 }
5956
5957 /// Sets the value of [request_id][crate::model::CreateGitRepositoryLinkRequest::request_id].
5958 ///
5959 /// # Example
5960 /// ```ignore,no_run
5961 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5962 /// let x = CreateGitRepositoryLinkRequest::new().set_request_id("example");
5963 /// ```
5964 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5965 self.request_id = v.into();
5966 self
5967 }
5968
5969 /// Sets the value of [validate_only][crate::model::CreateGitRepositoryLinkRequest::validate_only].
5970 ///
5971 /// # Example
5972 /// ```ignore,no_run
5973 /// # use google_cloud_developerconnect_v1::model::CreateGitRepositoryLinkRequest;
5974 /// let x = CreateGitRepositoryLinkRequest::new().set_validate_only(true);
5975 /// ```
5976 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5977 self.validate_only = v.into();
5978 self
5979 }
5980}
5981
5982impl wkt::message::Message for CreateGitRepositoryLinkRequest {
5983 fn typename() -> &'static str {
5984 "type.googleapis.com/google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest"
5985 }
5986}
5987
5988/// Message for deleting a GitRepositoryLink
5989#[derive(Clone, Default, PartialEq)]
5990#[non_exhaustive]
5991pub struct DeleteGitRepositoryLinkRequest {
5992 /// Required. Name of the resource
5993 pub name: std::string::String,
5994
5995 /// Optional. An optional request ID to identify requests. Specify a unique
5996 /// request ID so that if you must retry your request, the server will know to
5997 /// ignore the request if it has already been completed. The server will
5998 /// guarantee that for at least 60 minutes after the first request.
5999 ///
6000 /// For example, consider a situation where you make an initial request and the
6001 /// request times out. If you make the request again with the same request
6002 /// ID, the server can check if original operation with the same request ID
6003 /// was received, and if so, will ignore the second request. This prevents
6004 /// clients from accidentally creating duplicate commitments.
6005 ///
6006 /// The request ID must be a valid UUID with the exception that zero UUID is
6007 /// not supported (00000000-0000-0000-0000-000000000000).
6008 pub request_id: std::string::String,
6009
6010 /// Optional. If set, validate the request, but do not actually post it.
6011 pub validate_only: bool,
6012
6013 /// Optional. This checksum is computed by the server based on the value of
6014 /// other fields, and may be sent on update and delete requests to ensure the
6015 /// client has an up-to-date value before proceeding.
6016 pub etag: std::string::String,
6017
6018 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6019}
6020
6021impl DeleteGitRepositoryLinkRequest {
6022 /// Creates a new default instance.
6023 pub fn new() -> Self {
6024 std::default::Default::default()
6025 }
6026
6027 /// Sets the value of [name][crate::model::DeleteGitRepositoryLinkRequest::name].
6028 ///
6029 /// # Example
6030 /// ```ignore,no_run
6031 /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
6032 /// # let project_id = "project_id";
6033 /// # let location_id = "location_id";
6034 /// # let connection_id = "connection_id";
6035 /// # let git_repository_link_id = "git_repository_link_id";
6036 /// let x = DeleteGitRepositoryLinkRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
6037 /// ```
6038 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6039 self.name = v.into();
6040 self
6041 }
6042
6043 /// Sets the value of [request_id][crate::model::DeleteGitRepositoryLinkRequest::request_id].
6044 ///
6045 /// # Example
6046 /// ```ignore,no_run
6047 /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
6048 /// let x = DeleteGitRepositoryLinkRequest::new().set_request_id("example");
6049 /// ```
6050 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6051 self.request_id = v.into();
6052 self
6053 }
6054
6055 /// Sets the value of [validate_only][crate::model::DeleteGitRepositoryLinkRequest::validate_only].
6056 ///
6057 /// # Example
6058 /// ```ignore,no_run
6059 /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
6060 /// let x = DeleteGitRepositoryLinkRequest::new().set_validate_only(true);
6061 /// ```
6062 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6063 self.validate_only = v.into();
6064 self
6065 }
6066
6067 /// Sets the value of [etag][crate::model::DeleteGitRepositoryLinkRequest::etag].
6068 ///
6069 /// # Example
6070 /// ```ignore,no_run
6071 /// # use google_cloud_developerconnect_v1::model::DeleteGitRepositoryLinkRequest;
6072 /// let x = DeleteGitRepositoryLinkRequest::new().set_etag("example");
6073 /// ```
6074 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6075 self.etag = v.into();
6076 self
6077 }
6078}
6079
6080impl wkt::message::Message for DeleteGitRepositoryLinkRequest {
6081 fn typename() -> &'static str {
6082 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest"
6083 }
6084}
6085
6086/// Message for requesting a list of GitRepositoryLinks
6087#[derive(Clone, Default, PartialEq)]
6088#[non_exhaustive]
6089pub struct ListGitRepositoryLinksRequest {
6090 /// Required. Parent value for ListGitRepositoryLinksRequest
6091 pub parent: std::string::String,
6092
6093 /// Optional. Requested page size. Server may return fewer items than
6094 /// requested. If unspecified, server will pick an appropriate default.
6095 pub page_size: i32,
6096
6097 /// Optional. A token identifying a page of results the server should return.
6098 pub page_token: std::string::String,
6099
6100 /// Optional. Filtering results
6101 pub filter: std::string::String,
6102
6103 /// Optional. Hint for how to order the results
6104 pub order_by: std::string::String,
6105
6106 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6107}
6108
6109impl ListGitRepositoryLinksRequest {
6110 /// Creates a new default instance.
6111 pub fn new() -> Self {
6112 std::default::Default::default()
6113 }
6114
6115 /// Sets the value of [parent][crate::model::ListGitRepositoryLinksRequest::parent].
6116 ///
6117 /// # Example
6118 /// ```ignore,no_run
6119 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6120 /// # let project_id = "project_id";
6121 /// # let location_id = "location_id";
6122 /// # let connection_id = "connection_id";
6123 /// let x = ListGitRepositoryLinksRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
6124 /// ```
6125 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6126 self.parent = v.into();
6127 self
6128 }
6129
6130 /// Sets the value of [page_size][crate::model::ListGitRepositoryLinksRequest::page_size].
6131 ///
6132 /// # Example
6133 /// ```ignore,no_run
6134 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6135 /// let x = ListGitRepositoryLinksRequest::new().set_page_size(42);
6136 /// ```
6137 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6138 self.page_size = v.into();
6139 self
6140 }
6141
6142 /// Sets the value of [page_token][crate::model::ListGitRepositoryLinksRequest::page_token].
6143 ///
6144 /// # Example
6145 /// ```ignore,no_run
6146 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6147 /// let x = ListGitRepositoryLinksRequest::new().set_page_token("example");
6148 /// ```
6149 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6150 self.page_token = v.into();
6151 self
6152 }
6153
6154 /// Sets the value of [filter][crate::model::ListGitRepositoryLinksRequest::filter].
6155 ///
6156 /// # Example
6157 /// ```ignore,no_run
6158 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6159 /// let x = ListGitRepositoryLinksRequest::new().set_filter("example");
6160 /// ```
6161 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6162 self.filter = v.into();
6163 self
6164 }
6165
6166 /// Sets the value of [order_by][crate::model::ListGitRepositoryLinksRequest::order_by].
6167 ///
6168 /// # Example
6169 /// ```ignore,no_run
6170 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksRequest;
6171 /// let x = ListGitRepositoryLinksRequest::new().set_order_by("example");
6172 /// ```
6173 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6174 self.order_by = v.into();
6175 self
6176 }
6177}
6178
6179impl wkt::message::Message for ListGitRepositoryLinksRequest {
6180 fn typename() -> &'static str {
6181 "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest"
6182 }
6183}
6184
6185/// Message for response to listing GitRepositoryLinks
6186#[derive(Clone, Default, PartialEq)]
6187#[non_exhaustive]
6188pub struct ListGitRepositoryLinksResponse {
6189 /// The list of GitRepositoryLinks
6190 pub git_repository_links: std::vec::Vec<crate::model::GitRepositoryLink>,
6191
6192 /// A token identifying a page of results the server should return.
6193 pub next_page_token: std::string::String,
6194
6195 /// Locations that could not be reached.
6196 pub unreachable: std::vec::Vec<std::string::String>,
6197
6198 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6199}
6200
6201impl ListGitRepositoryLinksResponse {
6202 /// Creates a new default instance.
6203 pub fn new() -> Self {
6204 std::default::Default::default()
6205 }
6206
6207 /// Sets the value of [git_repository_links][crate::model::ListGitRepositoryLinksResponse::git_repository_links].
6208 ///
6209 /// # Example
6210 /// ```ignore,no_run
6211 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
6212 /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
6213 /// let x = ListGitRepositoryLinksResponse::new()
6214 /// .set_git_repository_links([
6215 /// GitRepositoryLink::default()/* use setters */,
6216 /// GitRepositoryLink::default()/* use (different) setters */,
6217 /// ]);
6218 /// ```
6219 pub fn set_git_repository_links<T, V>(mut self, v: T) -> Self
6220 where
6221 T: std::iter::IntoIterator<Item = V>,
6222 V: std::convert::Into<crate::model::GitRepositoryLink>,
6223 {
6224 use std::iter::Iterator;
6225 self.git_repository_links = v.into_iter().map(|i| i.into()).collect();
6226 self
6227 }
6228
6229 /// Sets the value of [next_page_token][crate::model::ListGitRepositoryLinksResponse::next_page_token].
6230 ///
6231 /// # Example
6232 /// ```ignore,no_run
6233 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
6234 /// let x = ListGitRepositoryLinksResponse::new().set_next_page_token("example");
6235 /// ```
6236 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6237 self.next_page_token = v.into();
6238 self
6239 }
6240
6241 /// Sets the value of [unreachable][crate::model::ListGitRepositoryLinksResponse::unreachable].
6242 ///
6243 /// # Example
6244 /// ```ignore,no_run
6245 /// # use google_cloud_developerconnect_v1::model::ListGitRepositoryLinksResponse;
6246 /// let x = ListGitRepositoryLinksResponse::new().set_unreachable(["a", "b", "c"]);
6247 /// ```
6248 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6249 where
6250 T: std::iter::IntoIterator<Item = V>,
6251 V: std::convert::Into<std::string::String>,
6252 {
6253 use std::iter::Iterator;
6254 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6255 self
6256 }
6257}
6258
6259impl wkt::message::Message for ListGitRepositoryLinksResponse {
6260 fn typename() -> &'static str {
6261 "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksResponse"
6262 }
6263}
6264
6265#[doc(hidden)]
6266impl google_cloud_gax::paginator::internal::PageableResponse for ListGitRepositoryLinksResponse {
6267 type PageItem = crate::model::GitRepositoryLink;
6268
6269 fn items(self) -> std::vec::Vec<Self::PageItem> {
6270 self.git_repository_links
6271 }
6272
6273 fn next_page_token(&self) -> std::string::String {
6274 use std::clone::Clone;
6275 self.next_page_token.clone()
6276 }
6277}
6278
6279/// Message for getting a GitRepositoryLink
6280#[derive(Clone, Default, PartialEq)]
6281#[non_exhaustive]
6282pub struct GetGitRepositoryLinkRequest {
6283 /// Required. Name of the resource
6284 pub name: std::string::String,
6285
6286 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6287}
6288
6289impl GetGitRepositoryLinkRequest {
6290 /// Creates a new default instance.
6291 pub fn new() -> Self {
6292 std::default::Default::default()
6293 }
6294
6295 /// Sets the value of [name][crate::model::GetGitRepositoryLinkRequest::name].
6296 ///
6297 /// # Example
6298 /// ```ignore,no_run
6299 /// # use google_cloud_developerconnect_v1::model::GetGitRepositoryLinkRequest;
6300 /// # let project_id = "project_id";
6301 /// # let location_id = "location_id";
6302 /// # let connection_id = "connection_id";
6303 /// # let git_repository_link_id = "git_repository_link_id";
6304 /// let x = GetGitRepositoryLinkRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
6305 /// ```
6306 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6307 self.name = v.into();
6308 self
6309 }
6310}
6311
6312impl wkt::message::Message for GetGitRepositoryLinkRequest {
6313 fn typename() -> &'static str {
6314 "type.googleapis.com/google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest"
6315 }
6316}
6317
6318/// Message for fetching SCM read/write token.
6319#[derive(Clone, Default, PartialEq)]
6320#[non_exhaustive]
6321pub struct FetchReadWriteTokenRequest {
6322 /// Required. The resource name of the gitRepositoryLink in the format
6323 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
6324 pub git_repository_link: std::string::String,
6325
6326 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6327}
6328
6329impl FetchReadWriteTokenRequest {
6330 /// Creates a new default instance.
6331 pub fn new() -> Self {
6332 std::default::Default::default()
6333 }
6334
6335 /// Sets the value of [git_repository_link][crate::model::FetchReadWriteTokenRequest::git_repository_link].
6336 ///
6337 /// # Example
6338 /// ```ignore,no_run
6339 /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenRequest;
6340 /// # let project_id = "project_id";
6341 /// # let location_id = "location_id";
6342 /// # let connection_id = "connection_id";
6343 /// # let git_repository_link_id = "git_repository_link_id";
6344 /// let x = FetchReadWriteTokenRequest::new().set_git_repository_link(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
6345 /// ```
6346 pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
6347 mut self,
6348 v: T,
6349 ) -> Self {
6350 self.git_repository_link = v.into();
6351 self
6352 }
6353}
6354
6355impl wkt::message::Message for FetchReadWriteTokenRequest {
6356 fn typename() -> &'static str {
6357 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenRequest"
6358 }
6359}
6360
6361/// Message for fetching SCM read token.
6362#[derive(Clone, Default, PartialEq)]
6363#[non_exhaustive]
6364pub struct FetchReadTokenRequest {
6365 /// Required. The resource name of the gitRepositoryLink in the format
6366 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
6367 pub git_repository_link: std::string::String,
6368
6369 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6370}
6371
6372impl FetchReadTokenRequest {
6373 /// Creates a new default instance.
6374 pub fn new() -> Self {
6375 std::default::Default::default()
6376 }
6377
6378 /// Sets the value of [git_repository_link][crate::model::FetchReadTokenRequest::git_repository_link].
6379 ///
6380 /// # Example
6381 /// ```ignore,no_run
6382 /// # use google_cloud_developerconnect_v1::model::FetchReadTokenRequest;
6383 /// # let project_id = "project_id";
6384 /// # let location_id = "location_id";
6385 /// # let connection_id = "connection_id";
6386 /// # let git_repository_link_id = "git_repository_link_id";
6387 /// let x = FetchReadTokenRequest::new().set_git_repository_link(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
6388 /// ```
6389 pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
6390 mut self,
6391 v: T,
6392 ) -> Self {
6393 self.git_repository_link = v.into();
6394 self
6395 }
6396}
6397
6398impl wkt::message::Message for FetchReadTokenRequest {
6399 fn typename() -> &'static str {
6400 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenRequest"
6401 }
6402}
6403
6404/// Message for responding to get read token.
6405#[derive(Clone, Default, PartialEq)]
6406#[non_exhaustive]
6407pub struct FetchReadTokenResponse {
6408 /// The token content.
6409 pub token: std::string::String,
6410
6411 /// Expiration timestamp. Can be empty if unknown or non-expiring.
6412 pub expiration_time: std::option::Option<wkt::Timestamp>,
6413
6414 /// The git_username to specify when making a git clone with the
6415 /// token. For example, for GitHub GitRepositoryLinks, this would be
6416 /// "x-access-token"
6417 pub git_username: std::string::String,
6418
6419 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6420}
6421
6422impl FetchReadTokenResponse {
6423 /// Creates a new default instance.
6424 pub fn new() -> Self {
6425 std::default::Default::default()
6426 }
6427
6428 /// Sets the value of [token][crate::model::FetchReadTokenResponse::token].
6429 ///
6430 /// # Example
6431 /// ```ignore,no_run
6432 /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6433 /// let x = FetchReadTokenResponse::new().set_token("example");
6434 /// ```
6435 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6436 self.token = v.into();
6437 self
6438 }
6439
6440 /// Sets the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
6441 ///
6442 /// # Example
6443 /// ```ignore,no_run
6444 /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6445 /// use wkt::Timestamp;
6446 /// let x = FetchReadTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
6447 /// ```
6448 pub fn set_expiration_time<T>(mut self, v: T) -> Self
6449 where
6450 T: std::convert::Into<wkt::Timestamp>,
6451 {
6452 self.expiration_time = std::option::Option::Some(v.into());
6453 self
6454 }
6455
6456 /// Sets or clears the value of [expiration_time][crate::model::FetchReadTokenResponse::expiration_time].
6457 ///
6458 /// # Example
6459 /// ```ignore,no_run
6460 /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6461 /// use wkt::Timestamp;
6462 /// let x = FetchReadTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
6463 /// let x = FetchReadTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
6464 /// ```
6465 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
6466 where
6467 T: std::convert::Into<wkt::Timestamp>,
6468 {
6469 self.expiration_time = v.map(|x| x.into());
6470 self
6471 }
6472
6473 /// Sets the value of [git_username][crate::model::FetchReadTokenResponse::git_username].
6474 ///
6475 /// # Example
6476 /// ```ignore,no_run
6477 /// # use google_cloud_developerconnect_v1::model::FetchReadTokenResponse;
6478 /// let x = FetchReadTokenResponse::new().set_git_username("example");
6479 /// ```
6480 pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6481 self.git_username = v.into();
6482 self
6483 }
6484}
6485
6486impl wkt::message::Message for FetchReadTokenResponse {
6487 fn typename() -> &'static str {
6488 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenResponse"
6489 }
6490}
6491
6492/// Message for responding to get read/write token.
6493#[derive(Clone, Default, PartialEq)]
6494#[non_exhaustive]
6495pub struct FetchReadWriteTokenResponse {
6496 /// The token content.
6497 pub token: std::string::String,
6498
6499 /// Expiration timestamp. Can be empty if unknown or non-expiring.
6500 pub expiration_time: std::option::Option<wkt::Timestamp>,
6501
6502 /// The git_username to specify when making a git clone with the
6503 /// token. For example, for GitHub GitRepositoryLinks, this would be
6504 /// "x-access-token"
6505 pub git_username: std::string::String,
6506
6507 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6508}
6509
6510impl FetchReadWriteTokenResponse {
6511 /// Creates a new default instance.
6512 pub fn new() -> Self {
6513 std::default::Default::default()
6514 }
6515
6516 /// Sets the value of [token][crate::model::FetchReadWriteTokenResponse::token].
6517 ///
6518 /// # Example
6519 /// ```ignore,no_run
6520 /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6521 /// let x = FetchReadWriteTokenResponse::new().set_token("example");
6522 /// ```
6523 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6524 self.token = v.into();
6525 self
6526 }
6527
6528 /// Sets the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
6529 ///
6530 /// # Example
6531 /// ```ignore,no_run
6532 /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6533 /// use wkt::Timestamp;
6534 /// let x = FetchReadWriteTokenResponse::new().set_expiration_time(Timestamp::default()/* use setters */);
6535 /// ```
6536 pub fn set_expiration_time<T>(mut self, v: T) -> Self
6537 where
6538 T: std::convert::Into<wkt::Timestamp>,
6539 {
6540 self.expiration_time = std::option::Option::Some(v.into());
6541 self
6542 }
6543
6544 /// Sets or clears the value of [expiration_time][crate::model::FetchReadWriteTokenResponse::expiration_time].
6545 ///
6546 /// # Example
6547 /// ```ignore,no_run
6548 /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6549 /// use wkt::Timestamp;
6550 /// let x = FetchReadWriteTokenResponse::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
6551 /// let x = FetchReadWriteTokenResponse::new().set_or_clear_expiration_time(None::<Timestamp>);
6552 /// ```
6553 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
6554 where
6555 T: std::convert::Into<wkt::Timestamp>,
6556 {
6557 self.expiration_time = v.map(|x| x.into());
6558 self
6559 }
6560
6561 /// Sets the value of [git_username][crate::model::FetchReadWriteTokenResponse::git_username].
6562 ///
6563 /// # Example
6564 /// ```ignore,no_run
6565 /// # use google_cloud_developerconnect_v1::model::FetchReadWriteTokenResponse;
6566 /// let x = FetchReadWriteTokenResponse::new().set_git_username("example");
6567 /// ```
6568 pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6569 self.git_username = v.into();
6570 self
6571 }
6572}
6573
6574impl wkt::message::Message for FetchReadWriteTokenResponse {
6575 fn typename() -> &'static str {
6576 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenResponse"
6577 }
6578}
6579
6580/// Request message for FetchLinkableGitRepositoriesRequest.
6581#[derive(Clone, Default, PartialEq)]
6582#[non_exhaustive]
6583pub struct FetchLinkableGitRepositoriesRequest {
6584 /// Required. The name of the Connection.
6585 /// Format: `projects/*/locations/*/connections/*`.
6586 pub connection: std::string::String,
6587
6588 /// Optional. Number of results to return in the list. Defaults to 20.
6589 pub page_size: i32,
6590
6591 /// Optional. Page start.
6592 pub page_token: std::string::String,
6593
6594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6595}
6596
6597impl FetchLinkableGitRepositoriesRequest {
6598 /// Creates a new default instance.
6599 pub fn new() -> Self {
6600 std::default::Default::default()
6601 }
6602
6603 /// Sets the value of [connection][crate::model::FetchLinkableGitRepositoriesRequest::connection].
6604 ///
6605 /// # Example
6606 /// ```ignore,no_run
6607 /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
6608 /// # let project_id = "project_id";
6609 /// # let location_id = "location_id";
6610 /// # let connection_id = "connection_id";
6611 /// let x = FetchLinkableGitRepositoriesRequest::new().set_connection(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
6612 /// ```
6613 pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6614 self.connection = v.into();
6615 self
6616 }
6617
6618 /// Sets the value of [page_size][crate::model::FetchLinkableGitRepositoriesRequest::page_size].
6619 ///
6620 /// # Example
6621 /// ```ignore,no_run
6622 /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
6623 /// let x = FetchLinkableGitRepositoriesRequest::new().set_page_size(42);
6624 /// ```
6625 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6626 self.page_size = v.into();
6627 self
6628 }
6629
6630 /// Sets the value of [page_token][crate::model::FetchLinkableGitRepositoriesRequest::page_token].
6631 ///
6632 /// # Example
6633 /// ```ignore,no_run
6634 /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesRequest;
6635 /// let x = FetchLinkableGitRepositoriesRequest::new().set_page_token("example");
6636 /// ```
6637 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6638 self.page_token = v.into();
6639 self
6640 }
6641}
6642
6643impl wkt::message::Message for FetchLinkableGitRepositoriesRequest {
6644 fn typename() -> &'static str {
6645 "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest"
6646 }
6647}
6648
6649/// Response message for FetchLinkableGitRepositories.
6650#[derive(Clone, Default, PartialEq)]
6651#[non_exhaustive]
6652pub struct FetchLinkableGitRepositoriesResponse {
6653 /// The git repositories that can be linked to the connection.
6654 pub linkable_git_repositories: std::vec::Vec<crate::model::LinkableGitRepository>,
6655
6656 /// A token identifying a page of results the server should return.
6657 pub next_page_token: std::string::String,
6658
6659 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6660}
6661
6662impl FetchLinkableGitRepositoriesResponse {
6663 /// Creates a new default instance.
6664 pub fn new() -> Self {
6665 std::default::Default::default()
6666 }
6667
6668 /// Sets the value of [linkable_git_repositories][crate::model::FetchLinkableGitRepositoriesResponse::linkable_git_repositories].
6669 ///
6670 /// # Example
6671 /// ```ignore,no_run
6672 /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesResponse;
6673 /// use google_cloud_developerconnect_v1::model::LinkableGitRepository;
6674 /// let x = FetchLinkableGitRepositoriesResponse::new()
6675 /// .set_linkable_git_repositories([
6676 /// LinkableGitRepository::default()/* use setters */,
6677 /// LinkableGitRepository::default()/* use (different) setters */,
6678 /// ]);
6679 /// ```
6680 pub fn set_linkable_git_repositories<T, V>(mut self, v: T) -> Self
6681 where
6682 T: std::iter::IntoIterator<Item = V>,
6683 V: std::convert::Into<crate::model::LinkableGitRepository>,
6684 {
6685 use std::iter::Iterator;
6686 self.linkable_git_repositories = v.into_iter().map(|i| i.into()).collect();
6687 self
6688 }
6689
6690 /// Sets the value of [next_page_token][crate::model::FetchLinkableGitRepositoriesResponse::next_page_token].
6691 ///
6692 /// # Example
6693 /// ```ignore,no_run
6694 /// # use google_cloud_developerconnect_v1::model::FetchLinkableGitRepositoriesResponse;
6695 /// let x = FetchLinkableGitRepositoriesResponse::new().set_next_page_token("example");
6696 /// ```
6697 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6698 self.next_page_token = v.into();
6699 self
6700 }
6701}
6702
6703impl wkt::message::Message for FetchLinkableGitRepositoriesResponse {
6704 fn typename() -> &'static str {
6705 "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesResponse"
6706 }
6707}
6708
6709#[doc(hidden)]
6710impl google_cloud_gax::paginator::internal::PageableResponse
6711 for FetchLinkableGitRepositoriesResponse
6712{
6713 type PageItem = crate::model::LinkableGitRepository;
6714
6715 fn items(self) -> std::vec::Vec<Self::PageItem> {
6716 self.linkable_git_repositories
6717 }
6718
6719 fn next_page_token(&self) -> std::string::String {
6720 use std::clone::Clone;
6721 self.next_page_token.clone()
6722 }
6723}
6724
6725/// LinkableGitRepository represents a git repository that can be linked to a
6726/// connection.
6727#[derive(Clone, Default, PartialEq)]
6728#[non_exhaustive]
6729pub struct LinkableGitRepository {
6730 /// The clone uri of the repository.
6731 pub clone_uri: std::string::String,
6732
6733 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6734}
6735
6736impl LinkableGitRepository {
6737 /// Creates a new default instance.
6738 pub fn new() -> Self {
6739 std::default::Default::default()
6740 }
6741
6742 /// Sets the value of [clone_uri][crate::model::LinkableGitRepository::clone_uri].
6743 ///
6744 /// # Example
6745 /// ```ignore,no_run
6746 /// # use google_cloud_developerconnect_v1::model::LinkableGitRepository;
6747 /// let x = LinkableGitRepository::new().set_clone_uri("example");
6748 /// ```
6749 pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6750 self.clone_uri = v.into();
6751 self
6752 }
6753}
6754
6755impl wkt::message::Message for LinkableGitRepository {
6756 fn typename() -> &'static str {
6757 "type.googleapis.com/google.cloud.developerconnect.v1.LinkableGitRepository"
6758 }
6759}
6760
6761/// Request for fetching github installations.
6762#[derive(Clone, Default, PartialEq)]
6763#[non_exhaustive]
6764pub struct FetchGitHubInstallationsRequest {
6765 /// Required. The resource name of the connection in the format
6766 /// `projects/*/locations/*/connections/*`.
6767 pub connection: std::string::String,
6768
6769 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6770}
6771
6772impl FetchGitHubInstallationsRequest {
6773 /// Creates a new default instance.
6774 pub fn new() -> Self {
6775 std::default::Default::default()
6776 }
6777
6778 /// Sets the value of [connection][crate::model::FetchGitHubInstallationsRequest::connection].
6779 ///
6780 /// # Example
6781 /// ```ignore,no_run
6782 /// # use google_cloud_developerconnect_v1::model::FetchGitHubInstallationsRequest;
6783 /// # let project_id = "project_id";
6784 /// # let location_id = "location_id";
6785 /// # let connection_id = "connection_id";
6786 /// let x = FetchGitHubInstallationsRequest::new().set_connection(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"));
6787 /// ```
6788 pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6789 self.connection = v.into();
6790 self
6791 }
6792}
6793
6794impl wkt::message::Message for FetchGitHubInstallationsRequest {
6795 fn typename() -> &'static str {
6796 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest"
6797 }
6798}
6799
6800/// Response of fetching github installations.
6801#[derive(Clone, Default, PartialEq)]
6802#[non_exhaustive]
6803pub struct FetchGitHubInstallationsResponse {
6804 /// List of installations available to the OAuth user (for github.com)
6805 /// or all the installations (for GitHub enterprise).
6806 pub installations:
6807 std::vec::Vec<crate::model::fetch_git_hub_installations_response::Installation>,
6808
6809 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6810}
6811
6812impl FetchGitHubInstallationsResponse {
6813 /// Creates a new default instance.
6814 pub fn new() -> Self {
6815 std::default::Default::default()
6816 }
6817
6818 /// Sets the value of [installations][crate::model::FetchGitHubInstallationsResponse::installations].
6819 ///
6820 /// # Example
6821 /// ```ignore,no_run
6822 /// # use google_cloud_developerconnect_v1::model::FetchGitHubInstallationsResponse;
6823 /// use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6824 /// let x = FetchGitHubInstallationsResponse::new()
6825 /// .set_installations([
6826 /// Installation::default()/* use setters */,
6827 /// Installation::default()/* use (different) setters */,
6828 /// ]);
6829 /// ```
6830 pub fn set_installations<T, V>(mut self, v: T) -> Self
6831 where
6832 T: std::iter::IntoIterator<Item = V>,
6833 V: std::convert::Into<crate::model::fetch_git_hub_installations_response::Installation>,
6834 {
6835 use std::iter::Iterator;
6836 self.installations = v.into_iter().map(|i| i.into()).collect();
6837 self
6838 }
6839}
6840
6841impl wkt::message::Message for FetchGitHubInstallationsResponse {
6842 fn typename() -> &'static str {
6843 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse"
6844 }
6845}
6846
6847/// Defines additional types related to [FetchGitHubInstallationsResponse].
6848pub mod fetch_git_hub_installations_response {
6849 #[allow(unused_imports)]
6850 use super::*;
6851
6852 /// Represents an installation of the GitHub App.
6853 #[derive(Clone, Default, PartialEq)]
6854 #[non_exhaustive]
6855 pub struct Installation {
6856 /// ID of the installation in GitHub.
6857 pub id: i64,
6858
6859 /// Name of the GitHub user or organization that owns this installation.
6860 pub name: std::string::String,
6861
6862 /// Either "user" or "organization".
6863 pub r#type: std::string::String,
6864
6865 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6866 }
6867
6868 impl Installation {
6869 /// Creates a new default instance.
6870 pub fn new() -> Self {
6871 std::default::Default::default()
6872 }
6873
6874 /// Sets the value of [id][crate::model::fetch_git_hub_installations_response::Installation::id].
6875 ///
6876 /// # Example
6877 /// ```ignore,no_run
6878 /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6879 /// let x = Installation::new().set_id(42);
6880 /// ```
6881 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6882 self.id = v.into();
6883 self
6884 }
6885
6886 /// Sets the value of [name][crate::model::fetch_git_hub_installations_response::Installation::name].
6887 ///
6888 /// # Example
6889 /// ```ignore,no_run
6890 /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6891 /// let x = Installation::new().set_name("example");
6892 /// ```
6893 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6894 self.name = v.into();
6895 self
6896 }
6897
6898 /// Sets the value of [r#type][crate::model::fetch_git_hub_installations_response::Installation::type].
6899 ///
6900 /// # Example
6901 /// ```ignore,no_run
6902 /// # use google_cloud_developerconnect_v1::model::fetch_git_hub_installations_response::Installation;
6903 /// let x = Installation::new().set_type("example");
6904 /// ```
6905 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6906 self.r#type = v.into();
6907 self
6908 }
6909 }
6910
6911 impl wkt::message::Message for Installation {
6912 fn typename() -> &'static str {
6913 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation"
6914 }
6915 }
6916}
6917
6918/// Request for fetching git refs.
6919#[derive(Clone, Default, PartialEq)]
6920#[non_exhaustive]
6921pub struct FetchGitRefsRequest {
6922 /// Required. The resource name of GitRepositoryLink in the format
6923 /// `projects/*/locations/*/connections/*/gitRepositoryLinks/*`.
6924 pub git_repository_link: std::string::String,
6925
6926 /// Required. Type of refs to fetch.
6927 pub ref_type: crate::model::fetch_git_refs_request::RefType,
6928
6929 /// Optional. Number of results to return in the list. Default to 20.
6930 pub page_size: i32,
6931
6932 /// Optional. Page start.
6933 pub page_token: std::string::String,
6934
6935 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6936}
6937
6938impl FetchGitRefsRequest {
6939 /// Creates a new default instance.
6940 pub fn new() -> Self {
6941 std::default::Default::default()
6942 }
6943
6944 /// Sets the value of [git_repository_link][crate::model::FetchGitRefsRequest::git_repository_link].
6945 ///
6946 /// # Example
6947 /// ```ignore,no_run
6948 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6949 /// # let project_id = "project_id";
6950 /// # let location_id = "location_id";
6951 /// # let connection_id = "connection_id";
6952 /// # let git_repository_link_id = "git_repository_link_id";
6953 /// let x = FetchGitRefsRequest::new().set_git_repository_link(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"));
6954 /// ```
6955 pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
6956 mut self,
6957 v: T,
6958 ) -> Self {
6959 self.git_repository_link = v.into();
6960 self
6961 }
6962
6963 /// Sets the value of [ref_type][crate::model::FetchGitRefsRequest::ref_type].
6964 ///
6965 /// # Example
6966 /// ```ignore,no_run
6967 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6968 /// use google_cloud_developerconnect_v1::model::fetch_git_refs_request::RefType;
6969 /// let x0 = FetchGitRefsRequest::new().set_ref_type(RefType::Tag);
6970 /// let x1 = FetchGitRefsRequest::new().set_ref_type(RefType::Branch);
6971 /// ```
6972 pub fn set_ref_type<T: std::convert::Into<crate::model::fetch_git_refs_request::RefType>>(
6973 mut self,
6974 v: T,
6975 ) -> Self {
6976 self.ref_type = v.into();
6977 self
6978 }
6979
6980 /// Sets the value of [page_size][crate::model::FetchGitRefsRequest::page_size].
6981 ///
6982 /// # Example
6983 /// ```ignore,no_run
6984 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6985 /// let x = FetchGitRefsRequest::new().set_page_size(42);
6986 /// ```
6987 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6988 self.page_size = v.into();
6989 self
6990 }
6991
6992 /// Sets the value of [page_token][crate::model::FetchGitRefsRequest::page_token].
6993 ///
6994 /// # Example
6995 /// ```ignore,no_run
6996 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsRequest;
6997 /// let x = FetchGitRefsRequest::new().set_page_token("example");
6998 /// ```
6999 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7000 self.page_token = v.into();
7001 self
7002 }
7003}
7004
7005impl wkt::message::Message for FetchGitRefsRequest {
7006 fn typename() -> &'static str {
7007 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsRequest"
7008 }
7009}
7010
7011/// Defines additional types related to [FetchGitRefsRequest].
7012pub mod fetch_git_refs_request {
7013 #[allow(unused_imports)]
7014 use super::*;
7015
7016 /// Type of refs.
7017 ///
7018 /// # Working with unknown values
7019 ///
7020 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7021 /// additional enum variants at any time. Adding new variants is not considered
7022 /// a breaking change. Applications should write their code in anticipation of:
7023 ///
7024 /// - New values appearing in future releases of the client library, **and**
7025 /// - New values received dynamically, without application changes.
7026 ///
7027 /// Please consult the [Working with enums] section in the user guide for some
7028 /// guidelines.
7029 ///
7030 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7031 #[derive(Clone, Debug, PartialEq)]
7032 #[non_exhaustive]
7033 pub enum RefType {
7034 /// No type specified.
7035 Unspecified,
7036 /// To fetch tags.
7037 Tag,
7038 /// To fetch branches.
7039 Branch,
7040 /// If set, the enum was initialized with an unknown value.
7041 ///
7042 /// Applications can examine the value using [RefType::value] or
7043 /// [RefType::name].
7044 UnknownValue(ref_type::UnknownValue),
7045 }
7046
7047 #[doc(hidden)]
7048 pub mod ref_type {
7049 #[allow(unused_imports)]
7050 use super::*;
7051 #[derive(Clone, Debug, PartialEq)]
7052 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7053 }
7054
7055 impl RefType {
7056 /// Gets the enum value.
7057 ///
7058 /// Returns `None` if the enum contains an unknown value deserialized from
7059 /// the string representation of enums.
7060 pub fn value(&self) -> std::option::Option<i32> {
7061 match self {
7062 Self::Unspecified => std::option::Option::Some(0),
7063 Self::Tag => std::option::Option::Some(1),
7064 Self::Branch => std::option::Option::Some(2),
7065 Self::UnknownValue(u) => u.0.value(),
7066 }
7067 }
7068
7069 /// Gets the enum value as a string.
7070 ///
7071 /// Returns `None` if the enum contains an unknown value deserialized from
7072 /// the integer representation of enums.
7073 pub fn name(&self) -> std::option::Option<&str> {
7074 match self {
7075 Self::Unspecified => std::option::Option::Some("REF_TYPE_UNSPECIFIED"),
7076 Self::Tag => std::option::Option::Some("TAG"),
7077 Self::Branch => std::option::Option::Some("BRANCH"),
7078 Self::UnknownValue(u) => u.0.name(),
7079 }
7080 }
7081 }
7082
7083 impl std::default::Default for RefType {
7084 fn default() -> Self {
7085 use std::convert::From;
7086 Self::from(0)
7087 }
7088 }
7089
7090 impl std::fmt::Display for RefType {
7091 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7092 wkt::internal::display_enum(f, self.name(), self.value())
7093 }
7094 }
7095
7096 impl std::convert::From<i32> for RefType {
7097 fn from(value: i32) -> Self {
7098 match value {
7099 0 => Self::Unspecified,
7100 1 => Self::Tag,
7101 2 => Self::Branch,
7102 _ => Self::UnknownValue(ref_type::UnknownValue(
7103 wkt::internal::UnknownEnumValue::Integer(value),
7104 )),
7105 }
7106 }
7107 }
7108
7109 impl std::convert::From<&str> for RefType {
7110 fn from(value: &str) -> Self {
7111 use std::string::ToString;
7112 match value {
7113 "REF_TYPE_UNSPECIFIED" => Self::Unspecified,
7114 "TAG" => Self::Tag,
7115 "BRANCH" => Self::Branch,
7116 _ => Self::UnknownValue(ref_type::UnknownValue(
7117 wkt::internal::UnknownEnumValue::String(value.to_string()),
7118 )),
7119 }
7120 }
7121 }
7122
7123 impl serde::ser::Serialize for RefType {
7124 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7125 where
7126 S: serde::Serializer,
7127 {
7128 match self {
7129 Self::Unspecified => serializer.serialize_i32(0),
7130 Self::Tag => serializer.serialize_i32(1),
7131 Self::Branch => serializer.serialize_i32(2),
7132 Self::UnknownValue(u) => u.0.serialize(serializer),
7133 }
7134 }
7135 }
7136
7137 impl<'de> serde::de::Deserialize<'de> for RefType {
7138 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7139 where
7140 D: serde::Deserializer<'de>,
7141 {
7142 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RefType>::new(
7143 ".google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType",
7144 ))
7145 }
7146 }
7147}
7148
7149/// Response for fetching git refs.
7150#[derive(Clone, Default, PartialEq)]
7151#[non_exhaustive]
7152pub struct FetchGitRefsResponse {
7153 /// Name of the refs fetched.
7154 pub ref_names: std::vec::Vec<std::string::String>,
7155
7156 /// A token identifying a page of results the server should return.
7157 pub next_page_token: std::string::String,
7158
7159 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7160}
7161
7162impl FetchGitRefsResponse {
7163 /// Creates a new default instance.
7164 pub fn new() -> Self {
7165 std::default::Default::default()
7166 }
7167
7168 /// Sets the value of [ref_names][crate::model::FetchGitRefsResponse::ref_names].
7169 ///
7170 /// # Example
7171 /// ```ignore,no_run
7172 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsResponse;
7173 /// let x = FetchGitRefsResponse::new().set_ref_names(["a", "b", "c"]);
7174 /// ```
7175 pub fn set_ref_names<T, V>(mut self, v: T) -> Self
7176 where
7177 T: std::iter::IntoIterator<Item = V>,
7178 V: std::convert::Into<std::string::String>,
7179 {
7180 use std::iter::Iterator;
7181 self.ref_names = v.into_iter().map(|i| i.into()).collect();
7182 self
7183 }
7184
7185 /// Sets the value of [next_page_token][crate::model::FetchGitRefsResponse::next_page_token].
7186 ///
7187 /// # Example
7188 /// ```ignore,no_run
7189 /// # use google_cloud_developerconnect_v1::model::FetchGitRefsResponse;
7190 /// let x = FetchGitRefsResponse::new().set_next_page_token("example");
7191 /// ```
7192 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7193 self.next_page_token = v.into();
7194 self
7195 }
7196}
7197
7198impl wkt::message::Message for FetchGitRefsResponse {
7199 fn typename() -> &'static str {
7200 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsResponse"
7201 }
7202}
7203
7204/// AccountConnector encapsulates what a platform administrator needs to
7205/// configure for users to connect to the service providers, which includes,
7206/// among other fields, the OAuth client ID, client secret, and authorization and
7207/// token endpoints.
7208#[derive(Clone, Default, PartialEq)]
7209#[non_exhaustive]
7210pub struct AccountConnector {
7211 /// Identifier. The resource name of the accountConnector, in the format
7212 /// `projects/{project}/locations/{location}/accountConnectors/{account_connector_id}`.
7213 pub name: std::string::String,
7214
7215 /// Output only. The timestamp when the accountConnector was created.
7216 pub create_time: std::option::Option<wkt::Timestamp>,
7217
7218 /// Output only. The timestamp when the accountConnector was updated.
7219 pub update_time: std::option::Option<wkt::Timestamp>,
7220
7221 /// Optional. Allows users to store small amounts of arbitrary data.
7222 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
7223
7224 /// Optional. This checksum is computed by the server based on the value of
7225 /// other fields, and may be sent on update and delete requests to ensure the
7226 /// client has an up-to-date value before proceeding.
7227 pub etag: std::string::String,
7228
7229 /// Optional. Labels as key value pairs
7230 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7231
7232 /// Output only. Start OAuth flow by clicking on this URL.
7233 pub oauth_start_uri: std::string::String,
7234
7235 /// The AccountConnector config.
7236 pub account_connector_config:
7237 std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
7238
7239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7240}
7241
7242impl AccountConnector {
7243 /// Creates a new default instance.
7244 pub fn new() -> Self {
7245 std::default::Default::default()
7246 }
7247
7248 /// Sets the value of [name][crate::model::AccountConnector::name].
7249 ///
7250 /// # Example
7251 /// ```ignore,no_run
7252 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7253 /// # let project_id = "project_id";
7254 /// # let location_id = "location_id";
7255 /// # let account_connector_id = "account_connector_id";
7256 /// let x = AccountConnector::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"));
7257 /// ```
7258 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7259 self.name = v.into();
7260 self
7261 }
7262
7263 /// Sets the value of [create_time][crate::model::AccountConnector::create_time].
7264 ///
7265 /// # Example
7266 /// ```ignore,no_run
7267 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7268 /// use wkt::Timestamp;
7269 /// let x = AccountConnector::new().set_create_time(Timestamp::default()/* use setters */);
7270 /// ```
7271 pub fn set_create_time<T>(mut self, v: T) -> Self
7272 where
7273 T: std::convert::Into<wkt::Timestamp>,
7274 {
7275 self.create_time = std::option::Option::Some(v.into());
7276 self
7277 }
7278
7279 /// Sets or clears the value of [create_time][crate::model::AccountConnector::create_time].
7280 ///
7281 /// # Example
7282 /// ```ignore,no_run
7283 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7284 /// use wkt::Timestamp;
7285 /// let x = AccountConnector::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7286 /// let x = AccountConnector::new().set_or_clear_create_time(None::<Timestamp>);
7287 /// ```
7288 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7289 where
7290 T: std::convert::Into<wkt::Timestamp>,
7291 {
7292 self.create_time = v.map(|x| x.into());
7293 self
7294 }
7295
7296 /// Sets the value of [update_time][crate::model::AccountConnector::update_time].
7297 ///
7298 /// # Example
7299 /// ```ignore,no_run
7300 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7301 /// use wkt::Timestamp;
7302 /// let x = AccountConnector::new().set_update_time(Timestamp::default()/* use setters */);
7303 /// ```
7304 pub fn set_update_time<T>(mut self, v: T) -> Self
7305 where
7306 T: std::convert::Into<wkt::Timestamp>,
7307 {
7308 self.update_time = std::option::Option::Some(v.into());
7309 self
7310 }
7311
7312 /// Sets or clears the value of [update_time][crate::model::AccountConnector::update_time].
7313 ///
7314 /// # Example
7315 /// ```ignore,no_run
7316 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7317 /// use wkt::Timestamp;
7318 /// let x = AccountConnector::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7319 /// let x = AccountConnector::new().set_or_clear_update_time(None::<Timestamp>);
7320 /// ```
7321 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7322 where
7323 T: std::convert::Into<wkt::Timestamp>,
7324 {
7325 self.update_time = v.map(|x| x.into());
7326 self
7327 }
7328
7329 /// Sets the value of [annotations][crate::model::AccountConnector::annotations].
7330 ///
7331 /// # Example
7332 /// ```ignore,no_run
7333 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7334 /// let x = AccountConnector::new().set_annotations([
7335 /// ("key0", "abc"),
7336 /// ("key1", "xyz"),
7337 /// ]);
7338 /// ```
7339 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7340 where
7341 T: std::iter::IntoIterator<Item = (K, V)>,
7342 K: std::convert::Into<std::string::String>,
7343 V: std::convert::Into<std::string::String>,
7344 {
7345 use std::iter::Iterator;
7346 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7347 self
7348 }
7349
7350 /// Sets the value of [etag][crate::model::AccountConnector::etag].
7351 ///
7352 /// # Example
7353 /// ```ignore,no_run
7354 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7355 /// let x = AccountConnector::new().set_etag("example");
7356 /// ```
7357 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7358 self.etag = v.into();
7359 self
7360 }
7361
7362 /// Sets the value of [labels][crate::model::AccountConnector::labels].
7363 ///
7364 /// # Example
7365 /// ```ignore,no_run
7366 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7367 /// let x = AccountConnector::new().set_labels([
7368 /// ("key0", "abc"),
7369 /// ("key1", "xyz"),
7370 /// ]);
7371 /// ```
7372 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7373 where
7374 T: std::iter::IntoIterator<Item = (K, V)>,
7375 K: std::convert::Into<std::string::String>,
7376 V: std::convert::Into<std::string::String>,
7377 {
7378 use std::iter::Iterator;
7379 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7380 self
7381 }
7382
7383 /// Sets the value of [oauth_start_uri][crate::model::AccountConnector::oauth_start_uri].
7384 ///
7385 /// # Example
7386 /// ```ignore,no_run
7387 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7388 /// let x = AccountConnector::new().set_oauth_start_uri("example");
7389 /// ```
7390 pub fn set_oauth_start_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7391 self.oauth_start_uri = v.into();
7392 self
7393 }
7394
7395 /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config].
7396 ///
7397 /// Note that all the setters affecting `account_connector_config` are mutually
7398 /// exclusive.
7399 ///
7400 /// # Example
7401 /// ```ignore,no_run
7402 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7403 /// use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7404 /// let x = AccountConnector::new().set_account_connector_config(Some(
7405 /// google_cloud_developerconnect_v1::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(ProviderOAuthConfig::default().into())));
7406 /// ```
7407 pub fn set_account_connector_config<
7408 T: std::convert::Into<
7409 std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
7410 >,
7411 >(
7412 mut self,
7413 v: T,
7414 ) -> Self {
7415 self.account_connector_config = v.into();
7416 self
7417 }
7418
7419 /// The value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
7420 /// if it holds a `ProviderOauthConfig`, `None` if the field is not set or
7421 /// holds a different branch.
7422 pub fn provider_oauth_config(
7423 &self,
7424 ) -> std::option::Option<&std::boxed::Box<crate::model::ProviderOAuthConfig>> {
7425 #[allow(unreachable_patterns)]
7426 self.account_connector_config
7427 .as_ref()
7428 .and_then(|v| match v {
7429 crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v) => {
7430 std::option::Option::Some(v)
7431 }
7432 _ => std::option::Option::None,
7433 })
7434 }
7435
7436 /// Sets the value of [account_connector_config][crate::model::AccountConnector::account_connector_config]
7437 /// to hold a `ProviderOauthConfig`.
7438 ///
7439 /// Note that all the setters affecting `account_connector_config` are
7440 /// mutually exclusive.
7441 ///
7442 /// # Example
7443 /// ```ignore,no_run
7444 /// # use google_cloud_developerconnect_v1::model::AccountConnector;
7445 /// use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7446 /// let x = AccountConnector::new().set_provider_oauth_config(ProviderOAuthConfig::default()/* use setters */);
7447 /// assert!(x.provider_oauth_config().is_some());
7448 /// ```
7449 pub fn set_provider_oauth_config<
7450 T: std::convert::Into<std::boxed::Box<crate::model::ProviderOAuthConfig>>,
7451 >(
7452 mut self,
7453 v: T,
7454 ) -> Self {
7455 self.account_connector_config = std::option::Option::Some(
7456 crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v.into()),
7457 );
7458 self
7459 }
7460}
7461
7462impl wkt::message::Message for AccountConnector {
7463 fn typename() -> &'static str {
7464 "type.googleapis.com/google.cloud.developerconnect.v1.AccountConnector"
7465 }
7466}
7467
7468/// Defines additional types related to [AccountConnector].
7469pub mod account_connector {
7470 #[allow(unused_imports)]
7471 use super::*;
7472
7473 /// The AccountConnector config.
7474 #[derive(Clone, Debug, PartialEq)]
7475 #[non_exhaustive]
7476 pub enum AccountConnectorConfig {
7477 /// Optional. Provider OAuth config.
7478 ProviderOauthConfig(std::boxed::Box<crate::model::ProviderOAuthConfig>),
7479 }
7480}
7481
7482/// User represents a user connected to the service providers through
7483/// a AccountConnector.
7484#[derive(Clone, Default, PartialEq)]
7485#[non_exhaustive]
7486pub struct User {
7487 /// Identifier. Resource name of the user, in the format
7488 /// `projects/*/locations/*/accountConnectors/*/users/*`.
7489 pub name: std::string::String,
7490
7491 /// Output only. Developer Connect automatically converts user identity
7492 /// to some human readable description, e.g., email address.
7493 pub display_name: std::string::String,
7494
7495 /// Output only. The timestamp when the user was created.
7496 pub create_time: std::option::Option<wkt::Timestamp>,
7497
7498 /// Output only. The timestamp when the token was last requested.
7499 pub last_token_request_time: std::option::Option<wkt::Timestamp>,
7500
7501 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7502}
7503
7504impl User {
7505 /// Creates a new default instance.
7506 pub fn new() -> Self {
7507 std::default::Default::default()
7508 }
7509
7510 /// Sets the value of [name][crate::model::User::name].
7511 ///
7512 /// # Example
7513 /// ```ignore,no_run
7514 /// # use google_cloud_developerconnect_v1::model::User;
7515 /// # let project_id = "project_id";
7516 /// # let location_id = "location_id";
7517 /// # let account_connector_id = "account_connector_id";
7518 /// # let user_id = "user_id";
7519 /// let x = User::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}/users/{user_id}"));
7520 /// ```
7521 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7522 self.name = v.into();
7523 self
7524 }
7525
7526 /// Sets the value of [display_name][crate::model::User::display_name].
7527 ///
7528 /// # Example
7529 /// ```ignore,no_run
7530 /// # use google_cloud_developerconnect_v1::model::User;
7531 /// let x = User::new().set_display_name("example");
7532 /// ```
7533 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7534 self.display_name = v.into();
7535 self
7536 }
7537
7538 /// Sets the value of [create_time][crate::model::User::create_time].
7539 ///
7540 /// # Example
7541 /// ```ignore,no_run
7542 /// # use google_cloud_developerconnect_v1::model::User;
7543 /// use wkt::Timestamp;
7544 /// let x = User::new().set_create_time(Timestamp::default()/* use setters */);
7545 /// ```
7546 pub fn set_create_time<T>(mut self, v: T) -> Self
7547 where
7548 T: std::convert::Into<wkt::Timestamp>,
7549 {
7550 self.create_time = std::option::Option::Some(v.into());
7551 self
7552 }
7553
7554 /// Sets or clears the value of [create_time][crate::model::User::create_time].
7555 ///
7556 /// # Example
7557 /// ```ignore,no_run
7558 /// # use google_cloud_developerconnect_v1::model::User;
7559 /// use wkt::Timestamp;
7560 /// let x = User::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7561 /// let x = User::new().set_or_clear_create_time(None::<Timestamp>);
7562 /// ```
7563 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7564 where
7565 T: std::convert::Into<wkt::Timestamp>,
7566 {
7567 self.create_time = v.map(|x| x.into());
7568 self
7569 }
7570
7571 /// Sets the value of [last_token_request_time][crate::model::User::last_token_request_time].
7572 ///
7573 /// # Example
7574 /// ```ignore,no_run
7575 /// # use google_cloud_developerconnect_v1::model::User;
7576 /// use wkt::Timestamp;
7577 /// let x = User::new().set_last_token_request_time(Timestamp::default()/* use setters */);
7578 /// ```
7579 pub fn set_last_token_request_time<T>(mut self, v: T) -> Self
7580 where
7581 T: std::convert::Into<wkt::Timestamp>,
7582 {
7583 self.last_token_request_time = std::option::Option::Some(v.into());
7584 self
7585 }
7586
7587 /// Sets or clears the value of [last_token_request_time][crate::model::User::last_token_request_time].
7588 ///
7589 /// # Example
7590 /// ```ignore,no_run
7591 /// # use google_cloud_developerconnect_v1::model::User;
7592 /// use wkt::Timestamp;
7593 /// let x = User::new().set_or_clear_last_token_request_time(Some(Timestamp::default()/* use setters */));
7594 /// let x = User::new().set_or_clear_last_token_request_time(None::<Timestamp>);
7595 /// ```
7596 pub fn set_or_clear_last_token_request_time<T>(mut self, v: std::option::Option<T>) -> Self
7597 where
7598 T: std::convert::Into<wkt::Timestamp>,
7599 {
7600 self.last_token_request_time = v.map(|x| x.into());
7601 self
7602 }
7603}
7604
7605impl wkt::message::Message for User {
7606 fn typename() -> &'static str {
7607 "type.googleapis.com/google.cloud.developerconnect.v1.User"
7608 }
7609}
7610
7611/// ProviderOAuthConfig is the OAuth config for a provider.
7612#[derive(Clone, Default, PartialEq)]
7613#[non_exhaustive]
7614pub struct ProviderOAuthConfig {
7615 /// Required. User selected scopes to apply to the Oauth config
7616 /// In the event of changing scopes, user records under AccountConnector will
7617 /// be deleted and users will re-auth again.
7618 pub scopes: std::vec::Vec<std::string::String>,
7619
7620 /// OAuth Provider ID. It could be Developer Connect owned or providers
7621 /// provided.
7622 pub oauth_provider_id:
7623 std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
7624
7625 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7626}
7627
7628impl ProviderOAuthConfig {
7629 /// Creates a new default instance.
7630 pub fn new() -> Self {
7631 std::default::Default::default()
7632 }
7633
7634 /// Sets the value of [scopes][crate::model::ProviderOAuthConfig::scopes].
7635 ///
7636 /// # Example
7637 /// ```ignore,no_run
7638 /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7639 /// let x = ProviderOAuthConfig::new().set_scopes(["a", "b", "c"]);
7640 /// ```
7641 pub fn set_scopes<T, V>(mut self, v: T) -> Self
7642 where
7643 T: std::iter::IntoIterator<Item = V>,
7644 V: std::convert::Into<std::string::String>,
7645 {
7646 use std::iter::Iterator;
7647 self.scopes = v.into_iter().map(|i| i.into()).collect();
7648 self
7649 }
7650
7651 /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id].
7652 ///
7653 /// Note that all the setters affecting `oauth_provider_id` are mutually
7654 /// exclusive.
7655 ///
7656 /// # Example
7657 /// ```ignore,no_run
7658 /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7659 /// use google_cloud_developerconnect_v1::model::SystemProvider;
7660 /// let x0 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
7661 /// google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Github)));
7662 /// let x1 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
7663 /// google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Gitlab)));
7664 /// let x2 = ProviderOAuthConfig::new().set_oauth_provider_id(Some(
7665 /// google_cloud_developerconnect_v1::model::provider_o_auth_config::OauthProviderId::SystemProviderId(SystemProvider::Google)));
7666 /// ```
7667 pub fn set_oauth_provider_id<
7668 T: std::convert::Into<
7669 std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
7670 >,
7671 >(
7672 mut self,
7673 v: T,
7674 ) -> Self {
7675 self.oauth_provider_id = v.into();
7676 self
7677 }
7678
7679 /// The value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
7680 /// if it holds a `SystemProviderId`, `None` if the field is not set or
7681 /// holds a different branch.
7682 pub fn system_provider_id(&self) -> std::option::Option<&crate::model::SystemProvider> {
7683 #[allow(unreachable_patterns)]
7684 self.oauth_provider_id.as_ref().and_then(|v| match v {
7685 crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v) => {
7686 std::option::Option::Some(v)
7687 }
7688 _ => std::option::Option::None,
7689 })
7690 }
7691
7692 /// Sets the value of [oauth_provider_id][crate::model::ProviderOAuthConfig::oauth_provider_id]
7693 /// to hold a `SystemProviderId`.
7694 ///
7695 /// Note that all the setters affecting `oauth_provider_id` are
7696 /// mutually exclusive.
7697 ///
7698 /// # Example
7699 /// ```ignore,no_run
7700 /// # use google_cloud_developerconnect_v1::model::ProviderOAuthConfig;
7701 /// use google_cloud_developerconnect_v1::model::SystemProvider;
7702 /// let x0 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Github);
7703 /// let x1 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Gitlab);
7704 /// let x2 = ProviderOAuthConfig::new().set_system_provider_id(SystemProvider::Google);
7705 /// assert!(x0.system_provider_id().is_some());
7706 /// assert!(x1.system_provider_id().is_some());
7707 /// assert!(x2.system_provider_id().is_some());
7708 /// ```
7709 pub fn set_system_provider_id<T: std::convert::Into<crate::model::SystemProvider>>(
7710 mut self,
7711 v: T,
7712 ) -> Self {
7713 self.oauth_provider_id = std::option::Option::Some(
7714 crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v.into()),
7715 );
7716 self
7717 }
7718}
7719
7720impl wkt::message::Message for ProviderOAuthConfig {
7721 fn typename() -> &'static str {
7722 "type.googleapis.com/google.cloud.developerconnect.v1.ProviderOAuthConfig"
7723 }
7724}
7725
7726/// Defines additional types related to [ProviderOAuthConfig].
7727pub mod provider_o_auth_config {
7728 #[allow(unused_imports)]
7729 use super::*;
7730
7731 /// OAuth Provider ID. It could be Developer Connect owned or providers
7732 /// provided.
7733 #[derive(Clone, Debug, PartialEq)]
7734 #[non_exhaustive]
7735 pub enum OauthProviderId {
7736 /// Optional. Immutable. Developer Connect provided OAuth.
7737 SystemProviderId(crate::model::SystemProvider),
7738 }
7739}
7740
7741/// The InsightsConfig resource is the core configuration object to capture
7742/// events from your Software Development Lifecycle. It acts as the central hub
7743/// for managing how Developer Connect understands your application, its runtime
7744/// environments, and the artifacts deployed within them.
7745#[derive(Clone, Default, PartialEq)]
7746#[non_exhaustive]
7747pub struct InsightsConfig {
7748 /// Identifier. The name of the InsightsConfig.
7749 /// Format:
7750 /// projects/{project}/locations/{location}/insightsConfigs/{insightsConfig}
7751 pub name: std::string::String,
7752
7753 /// Output only. Create timestamp.
7754 pub create_time: std::option::Option<wkt::Timestamp>,
7755
7756 /// Output only. Update timestamp.
7757 pub update_time: std::option::Option<wkt::Timestamp>,
7758
7759 /// Output only. The runtime configurations where the application is deployed.
7760 pub runtime_configs: std::vec::Vec<crate::model::RuntimeConfig>,
7761
7762 /// Optional. The artifact configurations of the artifacts that are deployed.
7763 pub artifact_configs: std::vec::Vec<crate::model::ArtifactConfig>,
7764
7765 /// Optional. Output only. The state of the InsightsConfig.
7766 pub state: crate::model::insights_config::State,
7767
7768 /// Optional. User specified annotations. See
7769 /// <https://google.aip.dev/148#annotations> for more details such as format and
7770 /// size limitations.
7771 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
7772
7773 /// Optional. Set of labels associated with an InsightsConfig.
7774 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7775
7776 /// Output only. Reconciling (<https://google.aip.dev/128#reconciliation>).
7777 /// Set to true if the current state of InsightsConfig does not match the
7778 /// user's intended state, and the service is actively updating the resource to
7779 /// reconcile them. This can happen due to user-triggered updates or
7780 /// system actions like failover or maintenance.
7781 pub reconciling: bool,
7782
7783 /// Output only. Any errors that occurred while setting up the InsightsConfig.
7784 /// Each error will be in the format: `field_name: error_message`, e.g.
7785 /// GetAppHubApplication: Permission denied while getting App Hub
7786 /// application. Please grant permissions to the P4SA.
7787 pub errors: std::vec::Vec<google_cloud_rpc::model::Status>,
7788
7789 /// The context of the InsightsConfig.
7790 pub insights_config_context:
7791 std::option::Option<crate::model::insights_config::InsightsConfigContext>,
7792
7793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7794}
7795
7796impl InsightsConfig {
7797 /// Creates a new default instance.
7798 pub fn new() -> Self {
7799 std::default::Default::default()
7800 }
7801
7802 /// Sets the value of [name][crate::model::InsightsConfig::name].
7803 ///
7804 /// # Example
7805 /// ```ignore,no_run
7806 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7807 /// # let project_id = "project_id";
7808 /// # let location_id = "location_id";
7809 /// # let insights_config_id = "insights_config_id";
7810 /// let x = InsightsConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"));
7811 /// ```
7812 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7813 self.name = v.into();
7814 self
7815 }
7816
7817 /// Sets the value of [create_time][crate::model::InsightsConfig::create_time].
7818 ///
7819 /// # Example
7820 /// ```ignore,no_run
7821 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7822 /// use wkt::Timestamp;
7823 /// let x = InsightsConfig::new().set_create_time(Timestamp::default()/* use setters */);
7824 /// ```
7825 pub fn set_create_time<T>(mut self, v: T) -> Self
7826 where
7827 T: std::convert::Into<wkt::Timestamp>,
7828 {
7829 self.create_time = std::option::Option::Some(v.into());
7830 self
7831 }
7832
7833 /// Sets or clears the value of [create_time][crate::model::InsightsConfig::create_time].
7834 ///
7835 /// # Example
7836 /// ```ignore,no_run
7837 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7838 /// use wkt::Timestamp;
7839 /// let x = InsightsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7840 /// let x = InsightsConfig::new().set_or_clear_create_time(None::<Timestamp>);
7841 /// ```
7842 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7843 where
7844 T: std::convert::Into<wkt::Timestamp>,
7845 {
7846 self.create_time = v.map(|x| x.into());
7847 self
7848 }
7849
7850 /// Sets the value of [update_time][crate::model::InsightsConfig::update_time].
7851 ///
7852 /// # Example
7853 /// ```ignore,no_run
7854 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7855 /// use wkt::Timestamp;
7856 /// let x = InsightsConfig::new().set_update_time(Timestamp::default()/* use setters */);
7857 /// ```
7858 pub fn set_update_time<T>(mut self, v: T) -> Self
7859 where
7860 T: std::convert::Into<wkt::Timestamp>,
7861 {
7862 self.update_time = std::option::Option::Some(v.into());
7863 self
7864 }
7865
7866 /// Sets or clears the value of [update_time][crate::model::InsightsConfig::update_time].
7867 ///
7868 /// # Example
7869 /// ```ignore,no_run
7870 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7871 /// use wkt::Timestamp;
7872 /// let x = InsightsConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7873 /// let x = InsightsConfig::new().set_or_clear_update_time(None::<Timestamp>);
7874 /// ```
7875 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7876 where
7877 T: std::convert::Into<wkt::Timestamp>,
7878 {
7879 self.update_time = v.map(|x| x.into());
7880 self
7881 }
7882
7883 /// Sets the value of [runtime_configs][crate::model::InsightsConfig::runtime_configs].
7884 ///
7885 /// # Example
7886 /// ```ignore,no_run
7887 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7888 /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
7889 /// let x = InsightsConfig::new()
7890 /// .set_runtime_configs([
7891 /// RuntimeConfig::default()/* use setters */,
7892 /// RuntimeConfig::default()/* use (different) setters */,
7893 /// ]);
7894 /// ```
7895 pub fn set_runtime_configs<T, V>(mut self, v: T) -> Self
7896 where
7897 T: std::iter::IntoIterator<Item = V>,
7898 V: std::convert::Into<crate::model::RuntimeConfig>,
7899 {
7900 use std::iter::Iterator;
7901 self.runtime_configs = v.into_iter().map(|i| i.into()).collect();
7902 self
7903 }
7904
7905 /// Sets the value of [artifact_configs][crate::model::InsightsConfig::artifact_configs].
7906 ///
7907 /// # Example
7908 /// ```ignore,no_run
7909 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7910 /// use google_cloud_developerconnect_v1::model::ArtifactConfig;
7911 /// let x = InsightsConfig::new()
7912 /// .set_artifact_configs([
7913 /// ArtifactConfig::default()/* use setters */,
7914 /// ArtifactConfig::default()/* use (different) setters */,
7915 /// ]);
7916 /// ```
7917 pub fn set_artifact_configs<T, V>(mut self, v: T) -> Self
7918 where
7919 T: std::iter::IntoIterator<Item = V>,
7920 V: std::convert::Into<crate::model::ArtifactConfig>,
7921 {
7922 use std::iter::Iterator;
7923 self.artifact_configs = v.into_iter().map(|i| i.into()).collect();
7924 self
7925 }
7926
7927 /// Sets the value of [state][crate::model::InsightsConfig::state].
7928 ///
7929 /// # Example
7930 /// ```ignore,no_run
7931 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7932 /// use google_cloud_developerconnect_v1::model::insights_config::State;
7933 /// let x0 = InsightsConfig::new().set_state(State::Pending);
7934 /// let x1 = InsightsConfig::new().set_state(State::Complete);
7935 /// let x2 = InsightsConfig::new().set_state(State::Error);
7936 /// ```
7937 pub fn set_state<T: std::convert::Into<crate::model::insights_config::State>>(
7938 mut self,
7939 v: T,
7940 ) -> Self {
7941 self.state = v.into();
7942 self
7943 }
7944
7945 /// Sets the value of [annotations][crate::model::InsightsConfig::annotations].
7946 ///
7947 /// # Example
7948 /// ```ignore,no_run
7949 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7950 /// let x = InsightsConfig::new().set_annotations([
7951 /// ("key0", "abc"),
7952 /// ("key1", "xyz"),
7953 /// ]);
7954 /// ```
7955 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
7956 where
7957 T: std::iter::IntoIterator<Item = (K, V)>,
7958 K: std::convert::Into<std::string::String>,
7959 V: std::convert::Into<std::string::String>,
7960 {
7961 use std::iter::Iterator;
7962 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7963 self
7964 }
7965
7966 /// Sets the value of [labels][crate::model::InsightsConfig::labels].
7967 ///
7968 /// # Example
7969 /// ```ignore,no_run
7970 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7971 /// let x = InsightsConfig::new().set_labels([
7972 /// ("key0", "abc"),
7973 /// ("key1", "xyz"),
7974 /// ]);
7975 /// ```
7976 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7977 where
7978 T: std::iter::IntoIterator<Item = (K, V)>,
7979 K: std::convert::Into<std::string::String>,
7980 V: std::convert::Into<std::string::String>,
7981 {
7982 use std::iter::Iterator;
7983 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7984 self
7985 }
7986
7987 /// Sets the value of [reconciling][crate::model::InsightsConfig::reconciling].
7988 ///
7989 /// # Example
7990 /// ```ignore,no_run
7991 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
7992 /// let x = InsightsConfig::new().set_reconciling(true);
7993 /// ```
7994 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7995 self.reconciling = v.into();
7996 self
7997 }
7998
7999 /// Sets the value of [errors][crate::model::InsightsConfig::errors].
8000 ///
8001 /// # Example
8002 /// ```ignore,no_run
8003 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
8004 /// use google_cloud_rpc::model::Status;
8005 /// let x = InsightsConfig::new()
8006 /// .set_errors([
8007 /// Status::default()/* use setters */,
8008 /// Status::default()/* use (different) setters */,
8009 /// ]);
8010 /// ```
8011 pub fn set_errors<T, V>(mut self, v: T) -> Self
8012 where
8013 T: std::iter::IntoIterator<Item = V>,
8014 V: std::convert::Into<google_cloud_rpc::model::Status>,
8015 {
8016 use std::iter::Iterator;
8017 self.errors = v.into_iter().map(|i| i.into()).collect();
8018 self
8019 }
8020
8021 /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context].
8022 ///
8023 /// Note that all the setters affecting `insights_config_context` are mutually
8024 /// exclusive.
8025 ///
8026 /// # Example
8027 /// ```ignore,no_run
8028 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
8029 /// use google_cloud_developerconnect_v1::model::insights_config::InsightsConfigContext;
8030 /// let x = InsightsConfig::new().set_insights_config_context(Some(InsightsConfigContext::AppHubApplication("example".to_string())));
8031 /// ```
8032 pub fn set_insights_config_context<
8033 T: std::convert::Into<
8034 std::option::Option<crate::model::insights_config::InsightsConfigContext>,
8035 >,
8036 >(
8037 mut self,
8038 v: T,
8039 ) -> Self {
8040 self.insights_config_context = v.into();
8041 self
8042 }
8043
8044 /// The value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
8045 /// if it holds a `AppHubApplication`, `None` if the field is not set or
8046 /// holds a different branch.
8047 pub fn app_hub_application(&self) -> std::option::Option<&std::string::String> {
8048 #[allow(unreachable_patterns)]
8049 self.insights_config_context.as_ref().and_then(|v| match v {
8050 crate::model::insights_config::InsightsConfigContext::AppHubApplication(v) => {
8051 std::option::Option::Some(v)
8052 }
8053 _ => std::option::Option::None,
8054 })
8055 }
8056
8057 /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
8058 /// to hold a `AppHubApplication`.
8059 ///
8060 /// Note that all the setters affecting `insights_config_context` are
8061 /// mutually exclusive.
8062 ///
8063 /// # Example
8064 /// ```ignore,no_run
8065 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
8066 /// let x = InsightsConfig::new().set_app_hub_application("example");
8067 /// assert!(x.app_hub_application().is_some());
8068 /// assert!(x.projects().is_none());
8069 /// ```
8070 pub fn set_app_hub_application<T: std::convert::Into<std::string::String>>(
8071 mut self,
8072 v: T,
8073 ) -> Self {
8074 self.insights_config_context = std::option::Option::Some(
8075 crate::model::insights_config::InsightsConfigContext::AppHubApplication(v.into()),
8076 );
8077 self
8078 }
8079
8080 /// The value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
8081 /// if it holds a `Projects`, `None` if the field is not set or
8082 /// holds a different branch.
8083 pub fn projects(&self) -> std::option::Option<&std::boxed::Box<crate::model::Projects>> {
8084 #[allow(unreachable_patterns)]
8085 self.insights_config_context.as_ref().and_then(|v| match v {
8086 crate::model::insights_config::InsightsConfigContext::Projects(v) => {
8087 std::option::Option::Some(v)
8088 }
8089 _ => std::option::Option::None,
8090 })
8091 }
8092
8093 /// Sets the value of [insights_config_context][crate::model::InsightsConfig::insights_config_context]
8094 /// to hold a `Projects`.
8095 ///
8096 /// Note that all the setters affecting `insights_config_context` are
8097 /// mutually exclusive.
8098 ///
8099 /// # Example
8100 /// ```ignore,no_run
8101 /// # use google_cloud_developerconnect_v1::model::InsightsConfig;
8102 /// use google_cloud_developerconnect_v1::model::Projects;
8103 /// let x = InsightsConfig::new().set_projects(Projects::default()/* use setters */);
8104 /// assert!(x.projects().is_some());
8105 /// assert!(x.app_hub_application().is_none());
8106 /// ```
8107 pub fn set_projects<T: std::convert::Into<std::boxed::Box<crate::model::Projects>>>(
8108 mut self,
8109 v: T,
8110 ) -> Self {
8111 self.insights_config_context = std::option::Option::Some(
8112 crate::model::insights_config::InsightsConfigContext::Projects(v.into()),
8113 );
8114 self
8115 }
8116}
8117
8118impl wkt::message::Message for InsightsConfig {
8119 fn typename() -> &'static str {
8120 "type.googleapis.com/google.cloud.developerconnect.v1.InsightsConfig"
8121 }
8122}
8123
8124/// Defines additional types related to [InsightsConfig].
8125pub mod insights_config {
8126 #[allow(unused_imports)]
8127 use super::*;
8128
8129 /// The state of the InsightsConfig.
8130 ///
8131 /// # Working with unknown values
8132 ///
8133 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8134 /// additional enum variants at any time. Adding new variants is not considered
8135 /// a breaking change. Applications should write their code in anticipation of:
8136 ///
8137 /// - New values appearing in future releases of the client library, **and**
8138 /// - New values received dynamically, without application changes.
8139 ///
8140 /// Please consult the [Working with enums] section in the user guide for some
8141 /// guidelines.
8142 ///
8143 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8144 #[derive(Clone, Debug, PartialEq)]
8145 #[non_exhaustive]
8146 pub enum State {
8147 /// No state specified.
8148 Unspecified,
8149 /// The InsightsConfig is pending application discovery/runtime discovery.
8150 Pending,
8151 /// The initial discovery process is complete.
8152 Complete,
8153 /// The InsightsConfig is in an error state.
8154 Error,
8155 /// If set, the enum was initialized with an unknown value.
8156 ///
8157 /// Applications can examine the value using [State::value] or
8158 /// [State::name].
8159 UnknownValue(state::UnknownValue),
8160 }
8161
8162 #[doc(hidden)]
8163 pub mod state {
8164 #[allow(unused_imports)]
8165 use super::*;
8166 #[derive(Clone, Debug, PartialEq)]
8167 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8168 }
8169
8170 impl State {
8171 /// Gets the enum value.
8172 ///
8173 /// Returns `None` if the enum contains an unknown value deserialized from
8174 /// the string representation of enums.
8175 pub fn value(&self) -> std::option::Option<i32> {
8176 match self {
8177 Self::Unspecified => std::option::Option::Some(0),
8178 Self::Pending => std::option::Option::Some(5),
8179 Self::Complete => std::option::Option::Some(3),
8180 Self::Error => std::option::Option::Some(4),
8181 Self::UnknownValue(u) => u.0.value(),
8182 }
8183 }
8184
8185 /// Gets the enum value as a string.
8186 ///
8187 /// Returns `None` if the enum contains an unknown value deserialized from
8188 /// the integer representation of enums.
8189 pub fn name(&self) -> std::option::Option<&str> {
8190 match self {
8191 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8192 Self::Pending => std::option::Option::Some("PENDING"),
8193 Self::Complete => std::option::Option::Some("COMPLETE"),
8194 Self::Error => std::option::Option::Some("ERROR"),
8195 Self::UnknownValue(u) => u.0.name(),
8196 }
8197 }
8198 }
8199
8200 impl std::default::Default for State {
8201 fn default() -> Self {
8202 use std::convert::From;
8203 Self::from(0)
8204 }
8205 }
8206
8207 impl std::fmt::Display for State {
8208 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8209 wkt::internal::display_enum(f, self.name(), self.value())
8210 }
8211 }
8212
8213 impl std::convert::From<i32> for State {
8214 fn from(value: i32) -> Self {
8215 match value {
8216 0 => Self::Unspecified,
8217 3 => Self::Complete,
8218 4 => Self::Error,
8219 5 => Self::Pending,
8220 _ => Self::UnknownValue(state::UnknownValue(
8221 wkt::internal::UnknownEnumValue::Integer(value),
8222 )),
8223 }
8224 }
8225 }
8226
8227 impl std::convert::From<&str> for State {
8228 fn from(value: &str) -> Self {
8229 use std::string::ToString;
8230 match value {
8231 "STATE_UNSPECIFIED" => Self::Unspecified,
8232 "PENDING" => Self::Pending,
8233 "COMPLETE" => Self::Complete,
8234 "ERROR" => Self::Error,
8235 _ => Self::UnknownValue(state::UnknownValue(
8236 wkt::internal::UnknownEnumValue::String(value.to_string()),
8237 )),
8238 }
8239 }
8240 }
8241
8242 impl serde::ser::Serialize for State {
8243 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8244 where
8245 S: serde::Serializer,
8246 {
8247 match self {
8248 Self::Unspecified => serializer.serialize_i32(0),
8249 Self::Pending => serializer.serialize_i32(5),
8250 Self::Complete => serializer.serialize_i32(3),
8251 Self::Error => serializer.serialize_i32(4),
8252 Self::UnknownValue(u) => u.0.serialize(serializer),
8253 }
8254 }
8255 }
8256
8257 impl<'de> serde::de::Deserialize<'de> for State {
8258 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8259 where
8260 D: serde::Deserializer<'de>,
8261 {
8262 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8263 ".google.cloud.developerconnect.v1.InsightsConfig.State",
8264 ))
8265 }
8266 }
8267
8268 /// The context of the InsightsConfig.
8269 #[derive(Clone, Debug, PartialEq)]
8270 #[non_exhaustive]
8271 pub enum InsightsConfigContext {
8272 /// Optional. The name of the App Hub Application.
8273 /// Format:
8274 /// projects/{project}/locations/{location}/applications/{application}
8275 AppHubApplication(std::string::String),
8276 /// Optional. The projects to track with the InsightsConfig.
8277 Projects(std::boxed::Box<crate::model::Projects>),
8278 }
8279}
8280
8281/// Projects represents the projects to track with the InsightsConfig.
8282#[derive(Clone, Default, PartialEq)]
8283#[non_exhaustive]
8284pub struct Projects {
8285 /// Optional. The project IDs.
8286 /// Format: {project}
8287 pub project_ids: std::vec::Vec<std::string::String>,
8288
8289 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8290}
8291
8292impl Projects {
8293 /// Creates a new default instance.
8294 pub fn new() -> Self {
8295 std::default::Default::default()
8296 }
8297
8298 /// Sets the value of [project_ids][crate::model::Projects::project_ids].
8299 ///
8300 /// # Example
8301 /// ```ignore,no_run
8302 /// # use google_cloud_developerconnect_v1::model::Projects;
8303 /// let x = Projects::new().set_project_ids(["a", "b", "c"]);
8304 /// ```
8305 pub fn set_project_ids<T, V>(mut self, v: T) -> Self
8306 where
8307 T: std::iter::IntoIterator<Item = V>,
8308 V: std::convert::Into<std::string::String>,
8309 {
8310 use std::iter::Iterator;
8311 self.project_ids = v.into_iter().map(|i| i.into()).collect();
8312 self
8313 }
8314}
8315
8316impl wkt::message::Message for Projects {
8317 fn typename() -> &'static str {
8318 "type.googleapis.com/google.cloud.developerconnect.v1.Projects"
8319 }
8320}
8321
8322/// RuntimeConfig represents the runtimes where the application is
8323/// deployed.
8324#[derive(Clone, Default, PartialEq)]
8325#[non_exhaustive]
8326pub struct RuntimeConfig {
8327 /// Required. Immutable. The URI of the runtime configuration.
8328 /// For GKE, this is the cluster name.
8329 /// For Cloud Run, this is the service name.
8330 pub uri: std::string::String,
8331
8332 /// Output only. The state of the Runtime.
8333 pub state: crate::model::runtime_config::State,
8334
8335 /// The type of the runtime.
8336 pub runtime: std::option::Option<crate::model::runtime_config::Runtime>,
8337
8338 /// Where the runtime is derived from.
8339 pub derived_from: std::option::Option<crate::model::runtime_config::DerivedFrom>,
8340
8341 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8342}
8343
8344impl RuntimeConfig {
8345 /// Creates a new default instance.
8346 pub fn new() -> Self {
8347 std::default::Default::default()
8348 }
8349
8350 /// Sets the value of [uri][crate::model::RuntimeConfig::uri].
8351 ///
8352 /// # Example
8353 /// ```ignore,no_run
8354 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8355 /// let x = RuntimeConfig::new().set_uri("example");
8356 /// ```
8357 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8358 self.uri = v.into();
8359 self
8360 }
8361
8362 /// Sets the value of [state][crate::model::RuntimeConfig::state].
8363 ///
8364 /// # Example
8365 /// ```ignore,no_run
8366 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8367 /// use google_cloud_developerconnect_v1::model::runtime_config::State;
8368 /// let x0 = RuntimeConfig::new().set_state(State::Linked);
8369 /// let x1 = RuntimeConfig::new().set_state(State::Unlinked);
8370 /// ```
8371 pub fn set_state<T: std::convert::Into<crate::model::runtime_config::State>>(
8372 mut self,
8373 v: T,
8374 ) -> Self {
8375 self.state = v.into();
8376 self
8377 }
8378
8379 /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime].
8380 ///
8381 /// Note that all the setters affecting `runtime` are mutually
8382 /// exclusive.
8383 ///
8384 /// # Example
8385 /// ```ignore,no_run
8386 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8387 /// use google_cloud_developerconnect_v1::model::GKEWorkload;
8388 /// let x = RuntimeConfig::new().set_runtime(Some(
8389 /// google_cloud_developerconnect_v1::model::runtime_config::Runtime::GkeWorkload(GKEWorkload::default().into())));
8390 /// ```
8391 pub fn set_runtime<
8392 T: std::convert::Into<std::option::Option<crate::model::runtime_config::Runtime>>,
8393 >(
8394 mut self,
8395 v: T,
8396 ) -> Self {
8397 self.runtime = v.into();
8398 self
8399 }
8400
8401 /// The value of [runtime][crate::model::RuntimeConfig::runtime]
8402 /// if it holds a `GkeWorkload`, `None` if the field is not set or
8403 /// holds a different branch.
8404 pub fn gke_workload(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEWorkload>> {
8405 #[allow(unreachable_patterns)]
8406 self.runtime.as_ref().and_then(|v| match v {
8407 crate::model::runtime_config::Runtime::GkeWorkload(v) => std::option::Option::Some(v),
8408 _ => std::option::Option::None,
8409 })
8410 }
8411
8412 /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime]
8413 /// to hold a `GkeWorkload`.
8414 ///
8415 /// Note that all the setters affecting `runtime` are
8416 /// mutually exclusive.
8417 ///
8418 /// # Example
8419 /// ```ignore,no_run
8420 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8421 /// use google_cloud_developerconnect_v1::model::GKEWorkload;
8422 /// let x = RuntimeConfig::new().set_gke_workload(GKEWorkload::default()/* use setters */);
8423 /// assert!(x.gke_workload().is_some());
8424 /// assert!(x.google_cloud_run().is_none());
8425 /// ```
8426 pub fn set_gke_workload<T: std::convert::Into<std::boxed::Box<crate::model::GKEWorkload>>>(
8427 mut self,
8428 v: T,
8429 ) -> Self {
8430 self.runtime =
8431 std::option::Option::Some(crate::model::runtime_config::Runtime::GkeWorkload(v.into()));
8432 self
8433 }
8434
8435 /// The value of [runtime][crate::model::RuntimeConfig::runtime]
8436 /// if it holds a `GoogleCloudRun`, `None` if the field is not set or
8437 /// holds a different branch.
8438 pub fn google_cloud_run(
8439 &self,
8440 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleCloudRun>> {
8441 #[allow(unreachable_patterns)]
8442 self.runtime.as_ref().and_then(|v| match v {
8443 crate::model::runtime_config::Runtime::GoogleCloudRun(v) => {
8444 std::option::Option::Some(v)
8445 }
8446 _ => std::option::Option::None,
8447 })
8448 }
8449
8450 /// Sets the value of [runtime][crate::model::RuntimeConfig::runtime]
8451 /// to hold a `GoogleCloudRun`.
8452 ///
8453 /// Note that all the setters affecting `runtime` are
8454 /// mutually exclusive.
8455 ///
8456 /// # Example
8457 /// ```ignore,no_run
8458 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8459 /// use google_cloud_developerconnect_v1::model::GoogleCloudRun;
8460 /// let x = RuntimeConfig::new().set_google_cloud_run(GoogleCloudRun::default()/* use setters */);
8461 /// assert!(x.google_cloud_run().is_some());
8462 /// assert!(x.gke_workload().is_none());
8463 /// ```
8464 pub fn set_google_cloud_run<
8465 T: std::convert::Into<std::boxed::Box<crate::model::GoogleCloudRun>>,
8466 >(
8467 mut self,
8468 v: T,
8469 ) -> Self {
8470 self.runtime = std::option::Option::Some(
8471 crate::model::runtime_config::Runtime::GoogleCloudRun(v.into()),
8472 );
8473 self
8474 }
8475
8476 /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from].
8477 ///
8478 /// Note that all the setters affecting `derived_from` are mutually
8479 /// exclusive.
8480 ///
8481 /// # Example
8482 /// ```ignore,no_run
8483 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8484 /// use google_cloud_developerconnect_v1::model::AppHubWorkload;
8485 /// let x = RuntimeConfig::new().set_derived_from(Some(
8486 /// google_cloud_developerconnect_v1::model::runtime_config::DerivedFrom::AppHubWorkload(AppHubWorkload::default().into())));
8487 /// ```
8488 pub fn set_derived_from<
8489 T: std::convert::Into<std::option::Option<crate::model::runtime_config::DerivedFrom>>,
8490 >(
8491 mut self,
8492 v: T,
8493 ) -> Self {
8494 self.derived_from = v.into();
8495 self
8496 }
8497
8498 /// The value of [derived_from][crate::model::RuntimeConfig::derived_from]
8499 /// if it holds a `AppHubWorkload`, `None` if the field is not set or
8500 /// holds a different branch.
8501 pub fn app_hub_workload(
8502 &self,
8503 ) -> std::option::Option<&std::boxed::Box<crate::model::AppHubWorkload>> {
8504 #[allow(unreachable_patterns)]
8505 self.derived_from.as_ref().and_then(|v| match v {
8506 crate::model::runtime_config::DerivedFrom::AppHubWorkload(v) => {
8507 std::option::Option::Some(v)
8508 }
8509 _ => std::option::Option::None,
8510 })
8511 }
8512
8513 /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from]
8514 /// to hold a `AppHubWorkload`.
8515 ///
8516 /// Note that all the setters affecting `derived_from` are
8517 /// mutually exclusive.
8518 ///
8519 /// # Example
8520 /// ```ignore,no_run
8521 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8522 /// use google_cloud_developerconnect_v1::model::AppHubWorkload;
8523 /// let x = RuntimeConfig::new().set_app_hub_workload(AppHubWorkload::default()/* use setters */);
8524 /// assert!(x.app_hub_workload().is_some());
8525 /// assert!(x.app_hub_service().is_none());
8526 /// ```
8527 pub fn set_app_hub_workload<
8528 T: std::convert::Into<std::boxed::Box<crate::model::AppHubWorkload>>,
8529 >(
8530 mut self,
8531 v: T,
8532 ) -> Self {
8533 self.derived_from = std::option::Option::Some(
8534 crate::model::runtime_config::DerivedFrom::AppHubWorkload(v.into()),
8535 );
8536 self
8537 }
8538
8539 /// The value of [derived_from][crate::model::RuntimeConfig::derived_from]
8540 /// if it holds a `AppHubService`, `None` if the field is not set or
8541 /// holds a different branch.
8542 pub fn app_hub_service(
8543 &self,
8544 ) -> std::option::Option<&std::boxed::Box<crate::model::AppHubService>> {
8545 #[allow(unreachable_patterns)]
8546 self.derived_from.as_ref().and_then(|v| match v {
8547 crate::model::runtime_config::DerivedFrom::AppHubService(v) => {
8548 std::option::Option::Some(v)
8549 }
8550 _ => std::option::Option::None,
8551 })
8552 }
8553
8554 /// Sets the value of [derived_from][crate::model::RuntimeConfig::derived_from]
8555 /// to hold a `AppHubService`.
8556 ///
8557 /// Note that all the setters affecting `derived_from` are
8558 /// mutually exclusive.
8559 ///
8560 /// # Example
8561 /// ```ignore,no_run
8562 /// # use google_cloud_developerconnect_v1::model::RuntimeConfig;
8563 /// use google_cloud_developerconnect_v1::model::AppHubService;
8564 /// let x = RuntimeConfig::new().set_app_hub_service(AppHubService::default()/* use setters */);
8565 /// assert!(x.app_hub_service().is_some());
8566 /// assert!(x.app_hub_workload().is_none());
8567 /// ```
8568 pub fn set_app_hub_service<
8569 T: std::convert::Into<std::boxed::Box<crate::model::AppHubService>>,
8570 >(
8571 mut self,
8572 v: T,
8573 ) -> Self {
8574 self.derived_from = std::option::Option::Some(
8575 crate::model::runtime_config::DerivedFrom::AppHubService(v.into()),
8576 );
8577 self
8578 }
8579}
8580
8581impl wkt::message::Message for RuntimeConfig {
8582 fn typename() -> &'static str {
8583 "type.googleapis.com/google.cloud.developerconnect.v1.RuntimeConfig"
8584 }
8585}
8586
8587/// Defines additional types related to [RuntimeConfig].
8588pub mod runtime_config {
8589 #[allow(unused_imports)]
8590 use super::*;
8591
8592 /// The state of the runtime in the InsightsConfig.
8593 /// Whether the runtime is linked to the InsightsConfig.
8594 ///
8595 /// # Working with unknown values
8596 ///
8597 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8598 /// additional enum variants at any time. Adding new variants is not considered
8599 /// a breaking change. Applications should write their code in anticipation of:
8600 ///
8601 /// - New values appearing in future releases of the client library, **and**
8602 /// - New values received dynamically, without application changes.
8603 ///
8604 /// Please consult the [Working with enums] section in the user guide for some
8605 /// guidelines.
8606 ///
8607 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8608 #[derive(Clone, Debug, PartialEq)]
8609 #[non_exhaustive]
8610 pub enum State {
8611 /// No state specified.
8612 Unspecified,
8613 /// The runtime configuration has been linked to the InsightsConfig.
8614 Linked,
8615 /// The runtime configuration has been unlinked to the InsightsConfig.
8616 Unlinked,
8617 /// If set, the enum was initialized with an unknown value.
8618 ///
8619 /// Applications can examine the value using [State::value] or
8620 /// [State::name].
8621 UnknownValue(state::UnknownValue),
8622 }
8623
8624 #[doc(hidden)]
8625 pub mod state {
8626 #[allow(unused_imports)]
8627 use super::*;
8628 #[derive(Clone, Debug, PartialEq)]
8629 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8630 }
8631
8632 impl State {
8633 /// Gets the enum value.
8634 ///
8635 /// Returns `None` if the enum contains an unknown value deserialized from
8636 /// the string representation of enums.
8637 pub fn value(&self) -> std::option::Option<i32> {
8638 match self {
8639 Self::Unspecified => std::option::Option::Some(0),
8640 Self::Linked => std::option::Option::Some(1),
8641 Self::Unlinked => std::option::Option::Some(2),
8642 Self::UnknownValue(u) => u.0.value(),
8643 }
8644 }
8645
8646 /// Gets the enum value as a string.
8647 ///
8648 /// Returns `None` if the enum contains an unknown value deserialized from
8649 /// the integer representation of enums.
8650 pub fn name(&self) -> std::option::Option<&str> {
8651 match self {
8652 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8653 Self::Linked => std::option::Option::Some("LINKED"),
8654 Self::Unlinked => std::option::Option::Some("UNLINKED"),
8655 Self::UnknownValue(u) => u.0.name(),
8656 }
8657 }
8658 }
8659
8660 impl std::default::Default for State {
8661 fn default() -> Self {
8662 use std::convert::From;
8663 Self::from(0)
8664 }
8665 }
8666
8667 impl std::fmt::Display for State {
8668 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8669 wkt::internal::display_enum(f, self.name(), self.value())
8670 }
8671 }
8672
8673 impl std::convert::From<i32> for State {
8674 fn from(value: i32) -> Self {
8675 match value {
8676 0 => Self::Unspecified,
8677 1 => Self::Linked,
8678 2 => Self::Unlinked,
8679 _ => Self::UnknownValue(state::UnknownValue(
8680 wkt::internal::UnknownEnumValue::Integer(value),
8681 )),
8682 }
8683 }
8684 }
8685
8686 impl std::convert::From<&str> for State {
8687 fn from(value: &str) -> Self {
8688 use std::string::ToString;
8689 match value {
8690 "STATE_UNSPECIFIED" => Self::Unspecified,
8691 "LINKED" => Self::Linked,
8692 "UNLINKED" => Self::Unlinked,
8693 _ => Self::UnknownValue(state::UnknownValue(
8694 wkt::internal::UnknownEnumValue::String(value.to_string()),
8695 )),
8696 }
8697 }
8698 }
8699
8700 impl serde::ser::Serialize for State {
8701 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8702 where
8703 S: serde::Serializer,
8704 {
8705 match self {
8706 Self::Unspecified => serializer.serialize_i32(0),
8707 Self::Linked => serializer.serialize_i32(1),
8708 Self::Unlinked => serializer.serialize_i32(2),
8709 Self::UnknownValue(u) => u.0.serialize(serializer),
8710 }
8711 }
8712 }
8713
8714 impl<'de> serde::de::Deserialize<'de> for State {
8715 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8716 where
8717 D: serde::Deserializer<'de>,
8718 {
8719 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8720 ".google.cloud.developerconnect.v1.RuntimeConfig.State",
8721 ))
8722 }
8723 }
8724
8725 /// The type of the runtime.
8726 #[derive(Clone, Debug, PartialEq)]
8727 #[non_exhaustive]
8728 pub enum Runtime {
8729 /// Output only. Google Kubernetes Engine runtime.
8730 GkeWorkload(std::boxed::Box<crate::model::GKEWorkload>),
8731 /// Output only. Cloud Run runtime.
8732 GoogleCloudRun(std::boxed::Box<crate::model::GoogleCloudRun>),
8733 }
8734
8735 /// Where the runtime is derived from.
8736 #[derive(Clone, Debug, PartialEq)]
8737 #[non_exhaustive]
8738 pub enum DerivedFrom {
8739 /// Output only. App Hub Workload.
8740 AppHubWorkload(std::boxed::Box<crate::model::AppHubWorkload>),
8741 /// Output only. App Hub Service.
8742 AppHubService(std::boxed::Box<crate::model::AppHubService>),
8743 }
8744}
8745
8746/// GKEWorkload represents the Google Kubernetes Engine runtime.
8747#[derive(Clone, Default, PartialEq)]
8748#[non_exhaustive]
8749pub struct GKEWorkload {
8750 /// Required. Immutable. The name of the GKE cluster.
8751 /// Format:
8752 /// `projects/{project}/locations/{location}/clusters/{cluster}`.
8753 pub cluster: std::string::String,
8754
8755 /// Output only. The name of the GKE deployment.
8756 /// Format:
8757 /// `projects/{project}/locations/{location}/clusters/{cluster}/namespaces/{namespace}/deployments/{deployment}`.
8758 pub deployment: std::string::String,
8759
8760 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8761}
8762
8763impl GKEWorkload {
8764 /// Creates a new default instance.
8765 pub fn new() -> Self {
8766 std::default::Default::default()
8767 }
8768
8769 /// Sets the value of [cluster][crate::model::GKEWorkload::cluster].
8770 ///
8771 /// # Example
8772 /// ```ignore,no_run
8773 /// # use google_cloud_developerconnect_v1::model::GKEWorkload;
8774 /// let x = GKEWorkload::new().set_cluster("example");
8775 /// ```
8776 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8777 self.cluster = v.into();
8778 self
8779 }
8780
8781 /// Sets the value of [deployment][crate::model::GKEWorkload::deployment].
8782 ///
8783 /// # Example
8784 /// ```ignore,no_run
8785 /// # use google_cloud_developerconnect_v1::model::GKEWorkload;
8786 /// let x = GKEWorkload::new().set_deployment("example");
8787 /// ```
8788 pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8789 self.deployment = v.into();
8790 self
8791 }
8792}
8793
8794impl wkt::message::Message for GKEWorkload {
8795 fn typename() -> &'static str {
8796 "type.googleapis.com/google.cloud.developerconnect.v1.GKEWorkload"
8797 }
8798}
8799
8800/// GoogleCloudRun represents the Cloud Run runtime.
8801#[derive(Clone, Default, PartialEq)]
8802#[non_exhaustive]
8803pub struct GoogleCloudRun {
8804 /// Required. Immutable. The name of the Cloud Run service.
8805 /// Format:
8806 /// `projects/{project}/locations/{location}/services/{service}`.
8807 pub service_uri: std::string::String,
8808
8809 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8810}
8811
8812impl GoogleCloudRun {
8813 /// Creates a new default instance.
8814 pub fn new() -> Self {
8815 std::default::Default::default()
8816 }
8817
8818 /// Sets the value of [service_uri][crate::model::GoogleCloudRun::service_uri].
8819 ///
8820 /// # Example
8821 /// ```ignore,no_run
8822 /// # use google_cloud_developerconnect_v1::model::GoogleCloudRun;
8823 /// let x = GoogleCloudRun::new().set_service_uri("example");
8824 /// ```
8825 pub fn set_service_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8826 self.service_uri = v.into();
8827 self
8828 }
8829}
8830
8831impl wkt::message::Message for GoogleCloudRun {
8832 fn typename() -> &'static str {
8833 "type.googleapis.com/google.cloud.developerconnect.v1.GoogleCloudRun"
8834 }
8835}
8836
8837/// AppHubWorkload represents the App Hub Workload.
8838#[derive(Clone, Default, PartialEq)]
8839#[non_exhaustive]
8840pub struct AppHubWorkload {
8841 /// Required. Output only. Immutable. The name of the App Hub Workload.
8842 /// Format:
8843 /// `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
8844 pub workload: std::string::String,
8845
8846 /// Output only. The criticality of the App Hub Workload.
8847 pub criticality: std::string::String,
8848
8849 /// Output only. The environment of the App Hub Workload.
8850 pub environment: std::string::String,
8851
8852 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8853}
8854
8855impl AppHubWorkload {
8856 /// Creates a new default instance.
8857 pub fn new() -> Self {
8858 std::default::Default::default()
8859 }
8860
8861 /// Sets the value of [workload][crate::model::AppHubWorkload::workload].
8862 ///
8863 /// # Example
8864 /// ```ignore,no_run
8865 /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
8866 /// let x = AppHubWorkload::new().set_workload("example");
8867 /// ```
8868 pub fn set_workload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8869 self.workload = v.into();
8870 self
8871 }
8872
8873 /// Sets the value of [criticality][crate::model::AppHubWorkload::criticality].
8874 ///
8875 /// # Example
8876 /// ```ignore,no_run
8877 /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
8878 /// let x = AppHubWorkload::new().set_criticality("example");
8879 /// ```
8880 pub fn set_criticality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8881 self.criticality = v.into();
8882 self
8883 }
8884
8885 /// Sets the value of [environment][crate::model::AppHubWorkload::environment].
8886 ///
8887 /// # Example
8888 /// ```ignore,no_run
8889 /// # use google_cloud_developerconnect_v1::model::AppHubWorkload;
8890 /// let x = AppHubWorkload::new().set_environment("example");
8891 /// ```
8892 pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8893 self.environment = v.into();
8894 self
8895 }
8896}
8897
8898impl wkt::message::Message for AppHubWorkload {
8899 fn typename() -> &'static str {
8900 "type.googleapis.com/google.cloud.developerconnect.v1.AppHubWorkload"
8901 }
8902}
8903
8904/// AppHubService represents the App Hub Service.
8905#[derive(Clone, Default, PartialEq)]
8906#[non_exhaustive]
8907pub struct AppHubService {
8908 /// Required. Output only. Immutable. The name of the App Hub Service.
8909 /// Format:
8910 /// `projects/{project}/locations/{location}/applications/{application}/services/{service}`.
8911 pub apphub_service: std::string::String,
8912
8913 /// Output only. The criticality of the App Hub Service.
8914 pub criticality: std::string::String,
8915
8916 /// Output only. The environment of the App Hub Service.
8917 pub environment: std::string::String,
8918
8919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8920}
8921
8922impl AppHubService {
8923 /// Creates a new default instance.
8924 pub fn new() -> Self {
8925 std::default::Default::default()
8926 }
8927
8928 /// Sets the value of [apphub_service][crate::model::AppHubService::apphub_service].
8929 ///
8930 /// # Example
8931 /// ```ignore,no_run
8932 /// # use google_cloud_developerconnect_v1::model::AppHubService;
8933 /// let x = AppHubService::new().set_apphub_service("example");
8934 /// ```
8935 pub fn set_apphub_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8936 self.apphub_service = v.into();
8937 self
8938 }
8939
8940 /// Sets the value of [criticality][crate::model::AppHubService::criticality].
8941 ///
8942 /// # Example
8943 /// ```ignore,no_run
8944 /// # use google_cloud_developerconnect_v1::model::AppHubService;
8945 /// let x = AppHubService::new().set_criticality("example");
8946 /// ```
8947 pub fn set_criticality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8948 self.criticality = v.into();
8949 self
8950 }
8951
8952 /// Sets the value of [environment][crate::model::AppHubService::environment].
8953 ///
8954 /// # Example
8955 /// ```ignore,no_run
8956 /// # use google_cloud_developerconnect_v1::model::AppHubService;
8957 /// let x = AppHubService::new().set_environment("example");
8958 /// ```
8959 pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8960 self.environment = v.into();
8961 self
8962 }
8963}
8964
8965impl wkt::message::Message for AppHubService {
8966 fn typename() -> &'static str {
8967 "type.googleapis.com/google.cloud.developerconnect.v1.AppHubService"
8968 }
8969}
8970
8971/// The artifact config of the artifact that is deployed.
8972#[derive(Clone, Default, PartialEq)]
8973#[non_exhaustive]
8974pub struct ArtifactConfig {
8975 /// Required. Immutable. The URI of the artifact that is deployed.
8976 /// e.g. `us-docker.pkg.dev/my-project/my-repo/image`.
8977 /// The URI does not include the tag / digest because it captures a lineage of
8978 /// artifacts.
8979 pub uri: std::string::String,
8980
8981 /// The storage location of the artifact.
8982 pub artifact_storage: std::option::Option<crate::model::artifact_config::ArtifactStorage>,
8983
8984 /// The storage location of the artifact metadata.
8985 pub artifact_metadata_storage:
8986 std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
8987
8988 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8989}
8990
8991impl ArtifactConfig {
8992 /// Creates a new default instance.
8993 pub fn new() -> Self {
8994 std::default::Default::default()
8995 }
8996
8997 /// Sets the value of [uri][crate::model::ArtifactConfig::uri].
8998 ///
8999 /// # Example
9000 /// ```ignore,no_run
9001 /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
9002 /// let x = ArtifactConfig::new().set_uri("example");
9003 /// ```
9004 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9005 self.uri = v.into();
9006 self
9007 }
9008
9009 /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage].
9010 ///
9011 /// Note that all the setters affecting `artifact_storage` are mutually
9012 /// exclusive.
9013 ///
9014 /// # Example
9015 /// ```ignore,no_run
9016 /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
9017 /// use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
9018 /// let x = ArtifactConfig::new().set_artifact_storage(Some(
9019 /// google_cloud_developerconnect_v1::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(GoogleArtifactRegistry::default().into())));
9020 /// ```
9021 pub fn set_artifact_storage<
9022 T: std::convert::Into<std::option::Option<crate::model::artifact_config::ArtifactStorage>>,
9023 >(
9024 mut self,
9025 v: T,
9026 ) -> Self {
9027 self.artifact_storage = v.into();
9028 self
9029 }
9030
9031 /// The value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
9032 /// if it holds a `GoogleArtifactRegistry`, `None` if the field is not set or
9033 /// holds a different branch.
9034 pub fn google_artifact_registry(
9035 &self,
9036 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactRegistry>> {
9037 #[allow(unreachable_patterns)]
9038 self.artifact_storage.as_ref().and_then(|v| match v {
9039 crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v) => {
9040 std::option::Option::Some(v)
9041 }
9042 _ => std::option::Option::None,
9043 })
9044 }
9045
9046 /// Sets the value of [artifact_storage][crate::model::ArtifactConfig::artifact_storage]
9047 /// to hold a `GoogleArtifactRegistry`.
9048 ///
9049 /// Note that all the setters affecting `artifact_storage` are
9050 /// mutually exclusive.
9051 ///
9052 /// # Example
9053 /// ```ignore,no_run
9054 /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
9055 /// use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
9056 /// let x = ArtifactConfig::new().set_google_artifact_registry(GoogleArtifactRegistry::default()/* use setters */);
9057 /// assert!(x.google_artifact_registry().is_some());
9058 /// ```
9059 pub fn set_google_artifact_registry<
9060 T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactRegistry>>,
9061 >(
9062 mut self,
9063 v: T,
9064 ) -> Self {
9065 self.artifact_storage = std::option::Option::Some(
9066 crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v.into()),
9067 );
9068 self
9069 }
9070
9071 /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage].
9072 ///
9073 /// Note that all the setters affecting `artifact_metadata_storage` are mutually
9074 /// exclusive.
9075 ///
9076 /// # Example
9077 /// ```ignore,no_run
9078 /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
9079 /// use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
9080 /// let x = ArtifactConfig::new().set_artifact_metadata_storage(Some(
9081 /// google_cloud_developerconnect_v1::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(GoogleArtifactAnalysis::default().into())));
9082 /// ```
9083 pub fn set_artifact_metadata_storage<
9084 T: std::convert::Into<
9085 std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
9086 >,
9087 >(
9088 mut self,
9089 v: T,
9090 ) -> Self {
9091 self.artifact_metadata_storage = v.into();
9092 self
9093 }
9094
9095 /// The value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
9096 /// if it holds a `GoogleArtifactAnalysis`, `None` if the field is not set or
9097 /// holds a different branch.
9098 pub fn google_artifact_analysis(
9099 &self,
9100 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactAnalysis>> {
9101 #[allow(unreachable_patterns)]
9102 self.artifact_metadata_storage
9103 .as_ref()
9104 .and_then(|v| match v {
9105 crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
9106 v,
9107 ) => std::option::Option::Some(v),
9108 _ => std::option::Option::None,
9109 })
9110 }
9111
9112 /// Sets the value of [artifact_metadata_storage][crate::model::ArtifactConfig::artifact_metadata_storage]
9113 /// to hold a `GoogleArtifactAnalysis`.
9114 ///
9115 /// Note that all the setters affecting `artifact_metadata_storage` are
9116 /// mutually exclusive.
9117 ///
9118 /// # Example
9119 /// ```ignore,no_run
9120 /// # use google_cloud_developerconnect_v1::model::ArtifactConfig;
9121 /// use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
9122 /// let x = ArtifactConfig::new().set_google_artifact_analysis(GoogleArtifactAnalysis::default()/* use setters */);
9123 /// assert!(x.google_artifact_analysis().is_some());
9124 /// ```
9125 pub fn set_google_artifact_analysis<
9126 T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactAnalysis>>,
9127 >(
9128 mut self,
9129 v: T,
9130 ) -> Self {
9131 self.artifact_metadata_storage = std::option::Option::Some(
9132 crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
9133 v.into(),
9134 ),
9135 );
9136 self
9137 }
9138}
9139
9140impl wkt::message::Message for ArtifactConfig {
9141 fn typename() -> &'static str {
9142 "type.googleapis.com/google.cloud.developerconnect.v1.ArtifactConfig"
9143 }
9144}
9145
9146/// Defines additional types related to [ArtifactConfig].
9147pub mod artifact_config {
9148 #[allow(unused_imports)]
9149 use super::*;
9150
9151 /// The storage location of the artifact.
9152 #[derive(Clone, Debug, PartialEq)]
9153 #[non_exhaustive]
9154 pub enum ArtifactStorage {
9155 /// Optional. Set if the artifact is stored in Artifact registry.
9156 GoogleArtifactRegistry(std::boxed::Box<crate::model::GoogleArtifactRegistry>),
9157 }
9158
9159 /// The storage location of the artifact metadata.
9160 #[derive(Clone, Debug, PartialEq)]
9161 #[non_exhaustive]
9162 pub enum ArtifactMetadataStorage {
9163 /// Optional. Set if the artifact metadata is stored in Artifact analysis.
9164 GoogleArtifactAnalysis(std::boxed::Box<crate::model::GoogleArtifactAnalysis>),
9165 }
9166}
9167
9168/// Google Artifact Analysis configurations.
9169#[derive(Clone, Default, PartialEq)]
9170#[non_exhaustive]
9171pub struct GoogleArtifactAnalysis {
9172 /// Required. The project id of the project where the provenance is stored.
9173 pub project_id: std::string::String,
9174
9175 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9176}
9177
9178impl GoogleArtifactAnalysis {
9179 /// Creates a new default instance.
9180 pub fn new() -> Self {
9181 std::default::Default::default()
9182 }
9183
9184 /// Sets the value of [project_id][crate::model::GoogleArtifactAnalysis::project_id].
9185 ///
9186 /// # Example
9187 /// ```ignore,no_run
9188 /// # use google_cloud_developerconnect_v1::model::GoogleArtifactAnalysis;
9189 /// let x = GoogleArtifactAnalysis::new().set_project_id("example");
9190 /// ```
9191 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9192 self.project_id = v.into();
9193 self
9194 }
9195}
9196
9197impl wkt::message::Message for GoogleArtifactAnalysis {
9198 fn typename() -> &'static str {
9199 "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactAnalysis"
9200 }
9201}
9202
9203/// Google Artifact Registry configurations.
9204#[derive(Clone, Default, PartialEq)]
9205#[non_exhaustive]
9206pub struct GoogleArtifactRegistry {
9207 /// Required. The host project of Artifact Registry.
9208 pub project_id: std::string::String,
9209
9210 /// Required. Immutable. The name of the artifact registry package.
9211 pub artifact_registry_package: std::string::String,
9212
9213 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9214}
9215
9216impl GoogleArtifactRegistry {
9217 /// Creates a new default instance.
9218 pub fn new() -> Self {
9219 std::default::Default::default()
9220 }
9221
9222 /// Sets the value of [project_id][crate::model::GoogleArtifactRegistry::project_id].
9223 ///
9224 /// # Example
9225 /// ```ignore,no_run
9226 /// # use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
9227 /// let x = GoogleArtifactRegistry::new().set_project_id("example");
9228 /// ```
9229 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9230 self.project_id = v.into();
9231 self
9232 }
9233
9234 /// Sets the value of [artifact_registry_package][crate::model::GoogleArtifactRegistry::artifact_registry_package].
9235 ///
9236 /// # Example
9237 /// ```ignore,no_run
9238 /// # use google_cloud_developerconnect_v1::model::GoogleArtifactRegistry;
9239 /// let x = GoogleArtifactRegistry::new().set_artifact_registry_package("example");
9240 /// ```
9241 pub fn set_artifact_registry_package<T: std::convert::Into<std::string::String>>(
9242 mut self,
9243 v: T,
9244 ) -> Self {
9245 self.artifact_registry_package = v.into();
9246 self
9247 }
9248}
9249
9250impl wkt::message::Message for GoogleArtifactRegistry {
9251 fn typename() -> &'static str {
9252 "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactRegistry"
9253 }
9254}
9255
9256/// The DeploymentEvent resource represents the deployment of the artifact within
9257/// the InsightsConfig resource.
9258#[derive(Clone, Default, PartialEq)]
9259#[non_exhaustive]
9260pub struct DeploymentEvent {
9261 /// Identifier. The name of the DeploymentEvent. This name is provided by
9262 /// Developer Connect insights. Format:
9263 /// projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid}
9264 pub name: std::string::String,
9265
9266 /// Output only. The create time of the DeploymentEvent.
9267 pub create_time: std::option::Option<wkt::Timestamp>,
9268
9269 /// Output only. The update time of the DeploymentEvent.
9270 pub update_time: std::option::Option<wkt::Timestamp>,
9271
9272 /// Output only. The runtime configurations where the DeploymentEvent happened.
9273 pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
9274
9275 /// Output only. The runtime assigned URI of the DeploymentEvent.
9276 /// For GKE, this is the fully qualified replica set uri.
9277 /// e.g.
9278 /// container.googleapis.com/projects/{project}/locations/{location}/clusters/{cluster}/k8s/namespaces/{namespace}/apps/replicasets/{replica-set-id}
9279 /// For Cloud Run, this is the revision name.
9280 pub runtime_deployment_uri: std::string::String,
9281
9282 /// Output only. The state of the DeploymentEvent.
9283 pub state: crate::model::deployment_event::State,
9284
9285 /// Output only. The artifact deployments of the DeploymentEvent. Each artifact
9286 /// deployment contains the artifact uri and the runtime configuration uri. For
9287 /// GKE, this would be all the containers images that are deployed in the pod.
9288 pub artifact_deployments: std::vec::Vec<crate::model::ArtifactDeployment>,
9289
9290 /// Output only. The time at which the DeploymentEvent was deployed.
9291 /// This would be the min of all ArtifactDeployment deploy_times.
9292 pub deploy_time: std::option::Option<wkt::Timestamp>,
9293
9294 /// Output only. The time at which the DeploymentEvent was undeployed, all
9295 /// artifacts are considered undeployed once this time is set. This would be
9296 /// the max of all ArtifactDeployment undeploy_times. If any ArtifactDeployment
9297 /// is still active (i.e. does not have an undeploy_time), this field will be
9298 /// empty.
9299 pub undeploy_time: std::option::Option<wkt::Timestamp>,
9300
9301 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9302}
9303
9304impl DeploymentEvent {
9305 /// Creates a new default instance.
9306 pub fn new() -> Self {
9307 std::default::Default::default()
9308 }
9309
9310 /// Sets the value of [name][crate::model::DeploymentEvent::name].
9311 ///
9312 /// # Example
9313 /// ```ignore,no_run
9314 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9315 /// # let project_id = "project_id";
9316 /// # let location_id = "location_id";
9317 /// # let insights_config_id = "insights_config_id";
9318 /// # let deployment_event_id = "deployment_event_id";
9319 /// let x = DeploymentEvent::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}/deploymentEvents/{deployment_event_id}"));
9320 /// ```
9321 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9322 self.name = v.into();
9323 self
9324 }
9325
9326 /// Sets the value of [create_time][crate::model::DeploymentEvent::create_time].
9327 ///
9328 /// # Example
9329 /// ```ignore,no_run
9330 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9331 /// use wkt::Timestamp;
9332 /// let x = DeploymentEvent::new().set_create_time(Timestamp::default()/* use setters */);
9333 /// ```
9334 pub fn set_create_time<T>(mut self, v: T) -> Self
9335 where
9336 T: std::convert::Into<wkt::Timestamp>,
9337 {
9338 self.create_time = std::option::Option::Some(v.into());
9339 self
9340 }
9341
9342 /// Sets or clears the value of [create_time][crate::model::DeploymentEvent::create_time].
9343 ///
9344 /// # Example
9345 /// ```ignore,no_run
9346 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9347 /// use wkt::Timestamp;
9348 /// let x = DeploymentEvent::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9349 /// let x = DeploymentEvent::new().set_or_clear_create_time(None::<Timestamp>);
9350 /// ```
9351 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9352 where
9353 T: std::convert::Into<wkt::Timestamp>,
9354 {
9355 self.create_time = v.map(|x| x.into());
9356 self
9357 }
9358
9359 /// Sets the value of [update_time][crate::model::DeploymentEvent::update_time].
9360 ///
9361 /// # Example
9362 /// ```ignore,no_run
9363 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9364 /// use wkt::Timestamp;
9365 /// let x = DeploymentEvent::new().set_update_time(Timestamp::default()/* use setters */);
9366 /// ```
9367 pub fn set_update_time<T>(mut self, v: T) -> Self
9368 where
9369 T: std::convert::Into<wkt::Timestamp>,
9370 {
9371 self.update_time = std::option::Option::Some(v.into());
9372 self
9373 }
9374
9375 /// Sets or clears the value of [update_time][crate::model::DeploymentEvent::update_time].
9376 ///
9377 /// # Example
9378 /// ```ignore,no_run
9379 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9380 /// use wkt::Timestamp;
9381 /// let x = DeploymentEvent::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9382 /// let x = DeploymentEvent::new().set_or_clear_update_time(None::<Timestamp>);
9383 /// ```
9384 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9385 where
9386 T: std::convert::Into<wkt::Timestamp>,
9387 {
9388 self.update_time = v.map(|x| x.into());
9389 self
9390 }
9391
9392 /// Sets the value of [runtime_config][crate::model::DeploymentEvent::runtime_config].
9393 ///
9394 /// # Example
9395 /// ```ignore,no_run
9396 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9397 /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
9398 /// let x = DeploymentEvent::new().set_runtime_config(RuntimeConfig::default()/* use setters */);
9399 /// ```
9400 pub fn set_runtime_config<T>(mut self, v: T) -> Self
9401 where
9402 T: std::convert::Into<crate::model::RuntimeConfig>,
9403 {
9404 self.runtime_config = std::option::Option::Some(v.into());
9405 self
9406 }
9407
9408 /// Sets or clears the value of [runtime_config][crate::model::DeploymentEvent::runtime_config].
9409 ///
9410 /// # Example
9411 /// ```ignore,no_run
9412 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9413 /// use google_cloud_developerconnect_v1::model::RuntimeConfig;
9414 /// let x = DeploymentEvent::new().set_or_clear_runtime_config(Some(RuntimeConfig::default()/* use setters */));
9415 /// let x = DeploymentEvent::new().set_or_clear_runtime_config(None::<RuntimeConfig>);
9416 /// ```
9417 pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
9418 where
9419 T: std::convert::Into<crate::model::RuntimeConfig>,
9420 {
9421 self.runtime_config = v.map(|x| x.into());
9422 self
9423 }
9424
9425 /// Sets the value of [runtime_deployment_uri][crate::model::DeploymentEvent::runtime_deployment_uri].
9426 ///
9427 /// # Example
9428 /// ```ignore,no_run
9429 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9430 /// let x = DeploymentEvent::new().set_runtime_deployment_uri("example");
9431 /// ```
9432 pub fn set_runtime_deployment_uri<T: std::convert::Into<std::string::String>>(
9433 mut self,
9434 v: T,
9435 ) -> Self {
9436 self.runtime_deployment_uri = v.into();
9437 self
9438 }
9439
9440 /// Sets the value of [state][crate::model::DeploymentEvent::state].
9441 ///
9442 /// # Example
9443 /// ```ignore,no_run
9444 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9445 /// use google_cloud_developerconnect_v1::model::deployment_event::State;
9446 /// let x0 = DeploymentEvent::new().set_state(State::Active);
9447 /// let x1 = DeploymentEvent::new().set_state(State::Inactive);
9448 /// ```
9449 pub fn set_state<T: std::convert::Into<crate::model::deployment_event::State>>(
9450 mut self,
9451 v: T,
9452 ) -> Self {
9453 self.state = v.into();
9454 self
9455 }
9456
9457 /// Sets the value of [artifact_deployments][crate::model::DeploymentEvent::artifact_deployments].
9458 ///
9459 /// # Example
9460 /// ```ignore,no_run
9461 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9462 /// use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9463 /// let x = DeploymentEvent::new()
9464 /// .set_artifact_deployments([
9465 /// ArtifactDeployment::default()/* use setters */,
9466 /// ArtifactDeployment::default()/* use (different) setters */,
9467 /// ]);
9468 /// ```
9469 pub fn set_artifact_deployments<T, V>(mut self, v: T) -> Self
9470 where
9471 T: std::iter::IntoIterator<Item = V>,
9472 V: std::convert::Into<crate::model::ArtifactDeployment>,
9473 {
9474 use std::iter::Iterator;
9475 self.artifact_deployments = v.into_iter().map(|i| i.into()).collect();
9476 self
9477 }
9478
9479 /// Sets the value of [deploy_time][crate::model::DeploymentEvent::deploy_time].
9480 ///
9481 /// # Example
9482 /// ```ignore,no_run
9483 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9484 /// use wkt::Timestamp;
9485 /// let x = DeploymentEvent::new().set_deploy_time(Timestamp::default()/* use setters */);
9486 /// ```
9487 pub fn set_deploy_time<T>(mut self, v: T) -> Self
9488 where
9489 T: std::convert::Into<wkt::Timestamp>,
9490 {
9491 self.deploy_time = std::option::Option::Some(v.into());
9492 self
9493 }
9494
9495 /// Sets or clears the value of [deploy_time][crate::model::DeploymentEvent::deploy_time].
9496 ///
9497 /// # Example
9498 /// ```ignore,no_run
9499 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9500 /// use wkt::Timestamp;
9501 /// let x = DeploymentEvent::new().set_or_clear_deploy_time(Some(Timestamp::default()/* use setters */));
9502 /// let x = DeploymentEvent::new().set_or_clear_deploy_time(None::<Timestamp>);
9503 /// ```
9504 pub fn set_or_clear_deploy_time<T>(mut self, v: std::option::Option<T>) -> Self
9505 where
9506 T: std::convert::Into<wkt::Timestamp>,
9507 {
9508 self.deploy_time = v.map(|x| x.into());
9509 self
9510 }
9511
9512 /// Sets the value of [undeploy_time][crate::model::DeploymentEvent::undeploy_time].
9513 ///
9514 /// # Example
9515 /// ```ignore,no_run
9516 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9517 /// use wkt::Timestamp;
9518 /// let x = DeploymentEvent::new().set_undeploy_time(Timestamp::default()/* use setters */);
9519 /// ```
9520 pub fn set_undeploy_time<T>(mut self, v: T) -> Self
9521 where
9522 T: std::convert::Into<wkt::Timestamp>,
9523 {
9524 self.undeploy_time = std::option::Option::Some(v.into());
9525 self
9526 }
9527
9528 /// Sets or clears the value of [undeploy_time][crate::model::DeploymentEvent::undeploy_time].
9529 ///
9530 /// # Example
9531 /// ```ignore,no_run
9532 /// # use google_cloud_developerconnect_v1::model::DeploymentEvent;
9533 /// use wkt::Timestamp;
9534 /// let x = DeploymentEvent::new().set_or_clear_undeploy_time(Some(Timestamp::default()/* use setters */));
9535 /// let x = DeploymentEvent::new().set_or_clear_undeploy_time(None::<Timestamp>);
9536 /// ```
9537 pub fn set_or_clear_undeploy_time<T>(mut self, v: std::option::Option<T>) -> Self
9538 where
9539 T: std::convert::Into<wkt::Timestamp>,
9540 {
9541 self.undeploy_time = v.map(|x| x.into());
9542 self
9543 }
9544}
9545
9546impl wkt::message::Message for DeploymentEvent {
9547 fn typename() -> &'static str {
9548 "type.googleapis.com/google.cloud.developerconnect.v1.DeploymentEvent"
9549 }
9550}
9551
9552/// Defines additional types related to [DeploymentEvent].
9553pub mod deployment_event {
9554 #[allow(unused_imports)]
9555 use super::*;
9556
9557 /// The state of the DeploymentEvent.
9558 ///
9559 /// # Working with unknown values
9560 ///
9561 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9562 /// additional enum variants at any time. Adding new variants is not considered
9563 /// a breaking change. Applications should write their code in anticipation of:
9564 ///
9565 /// - New values appearing in future releases of the client library, **and**
9566 /// - New values received dynamically, without application changes.
9567 ///
9568 /// Please consult the [Working with enums] section in the user guide for some
9569 /// guidelines.
9570 ///
9571 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9572 #[derive(Clone, Debug, PartialEq)]
9573 #[non_exhaustive]
9574 pub enum State {
9575 /// No state specified.
9576 Unspecified,
9577 /// The deployment is active in the runtime.
9578 Active,
9579 /// The deployment is not in the runtime.
9580 Inactive,
9581 /// If set, the enum was initialized with an unknown value.
9582 ///
9583 /// Applications can examine the value using [State::value] or
9584 /// [State::name].
9585 UnknownValue(state::UnknownValue),
9586 }
9587
9588 #[doc(hidden)]
9589 pub mod state {
9590 #[allow(unused_imports)]
9591 use super::*;
9592 #[derive(Clone, Debug, PartialEq)]
9593 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9594 }
9595
9596 impl State {
9597 /// Gets the enum value.
9598 ///
9599 /// Returns `None` if the enum contains an unknown value deserialized from
9600 /// the string representation of enums.
9601 pub fn value(&self) -> std::option::Option<i32> {
9602 match self {
9603 Self::Unspecified => std::option::Option::Some(0),
9604 Self::Active => std::option::Option::Some(1),
9605 Self::Inactive => std::option::Option::Some(2),
9606 Self::UnknownValue(u) => u.0.value(),
9607 }
9608 }
9609
9610 /// Gets the enum value as a string.
9611 ///
9612 /// Returns `None` if the enum contains an unknown value deserialized from
9613 /// the integer representation of enums.
9614 pub fn name(&self) -> std::option::Option<&str> {
9615 match self {
9616 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9617 Self::Active => std::option::Option::Some("STATE_ACTIVE"),
9618 Self::Inactive => std::option::Option::Some("STATE_INACTIVE"),
9619 Self::UnknownValue(u) => u.0.name(),
9620 }
9621 }
9622 }
9623
9624 impl std::default::Default for State {
9625 fn default() -> Self {
9626 use std::convert::From;
9627 Self::from(0)
9628 }
9629 }
9630
9631 impl std::fmt::Display for State {
9632 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9633 wkt::internal::display_enum(f, self.name(), self.value())
9634 }
9635 }
9636
9637 impl std::convert::From<i32> for State {
9638 fn from(value: i32) -> Self {
9639 match value {
9640 0 => Self::Unspecified,
9641 1 => Self::Active,
9642 2 => Self::Inactive,
9643 _ => Self::UnknownValue(state::UnknownValue(
9644 wkt::internal::UnknownEnumValue::Integer(value),
9645 )),
9646 }
9647 }
9648 }
9649
9650 impl std::convert::From<&str> for State {
9651 fn from(value: &str) -> Self {
9652 use std::string::ToString;
9653 match value {
9654 "STATE_UNSPECIFIED" => Self::Unspecified,
9655 "STATE_ACTIVE" => Self::Active,
9656 "STATE_INACTIVE" => Self::Inactive,
9657 _ => Self::UnknownValue(state::UnknownValue(
9658 wkt::internal::UnknownEnumValue::String(value.to_string()),
9659 )),
9660 }
9661 }
9662 }
9663
9664 impl serde::ser::Serialize for State {
9665 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9666 where
9667 S: serde::Serializer,
9668 {
9669 match self {
9670 Self::Unspecified => serializer.serialize_i32(0),
9671 Self::Active => serializer.serialize_i32(1),
9672 Self::Inactive => serializer.serialize_i32(2),
9673 Self::UnknownValue(u) => u.0.serialize(serializer),
9674 }
9675 }
9676 }
9677
9678 impl<'de> serde::de::Deserialize<'de> for State {
9679 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9680 where
9681 D: serde::Deserializer<'de>,
9682 {
9683 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9684 ".google.cloud.developerconnect.v1.DeploymentEvent.State",
9685 ))
9686 }
9687 }
9688}
9689
9690/// Request for getting a DeploymentEvent.
9691#[derive(Clone, Default, PartialEq)]
9692#[non_exhaustive]
9693pub struct GetDeploymentEventRequest {
9694 /// Required. The name of the deployment event to retrieve.
9695 /// Format:
9696 /// projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid}
9697 pub name: std::string::String,
9698
9699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9700}
9701
9702impl GetDeploymentEventRequest {
9703 /// Creates a new default instance.
9704 pub fn new() -> Self {
9705 std::default::Default::default()
9706 }
9707
9708 /// Sets the value of [name][crate::model::GetDeploymentEventRequest::name].
9709 ///
9710 /// # Example
9711 /// ```ignore,no_run
9712 /// # use google_cloud_developerconnect_v1::model::GetDeploymentEventRequest;
9713 /// # let project_id = "project_id";
9714 /// # let location_id = "location_id";
9715 /// # let insights_config_id = "insights_config_id";
9716 /// # let deployment_event_id = "deployment_event_id";
9717 /// let x = GetDeploymentEventRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}/deploymentEvents/{deployment_event_id}"));
9718 /// ```
9719 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9720 self.name = v.into();
9721 self
9722 }
9723}
9724
9725impl wkt::message::Message for GetDeploymentEventRequest {
9726 fn typename() -> &'static str {
9727 "type.googleapis.com/google.cloud.developerconnect.v1.GetDeploymentEventRequest"
9728 }
9729}
9730
9731/// Request for requesting list of DeploymentEvents.
9732#[derive(Clone, Default, PartialEq)]
9733#[non_exhaustive]
9734pub struct ListDeploymentEventsRequest {
9735 /// Required. The parent insights config that owns this collection of
9736 /// deployment events. Format:
9737 /// projects/{project}/locations/{location}/insightsConfigs/{insights_config}
9738 pub parent: std::string::String,
9739
9740 /// Optional. The maximum number of deployment events to return. The service
9741 /// may return fewer than this value. If unspecified, at most 50 deployment
9742 /// events will be returned. The maximum value is 1000; values above 1000 will
9743 /// be coerced to 1000.
9744 pub page_size: i32,
9745
9746 /// Optional. A page token, received from a previous `ListDeploymentEvents`
9747 /// call. Provide this to retrieve the subsequent page.
9748 ///
9749 /// When paginating, all other parameters provided to `ListDeploymentEvents`
9750 /// must match the call that provided the page token.
9751 pub page_token: std::string::String,
9752
9753 /// Optional. Filter expression that matches a subset of the DeploymentEvents.
9754 /// <https://google.aip.dev/160>.
9755 pub filter: std::string::String,
9756
9757 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9758}
9759
9760impl ListDeploymentEventsRequest {
9761 /// Creates a new default instance.
9762 pub fn new() -> Self {
9763 std::default::Default::default()
9764 }
9765
9766 /// Sets the value of [parent][crate::model::ListDeploymentEventsRequest::parent].
9767 ///
9768 /// # Example
9769 /// ```ignore,no_run
9770 /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9771 /// # let project_id = "project_id";
9772 /// # let location_id = "location_id";
9773 /// # let insights_config_id = "insights_config_id";
9774 /// let x = ListDeploymentEventsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"));
9775 /// ```
9776 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9777 self.parent = v.into();
9778 self
9779 }
9780
9781 /// Sets the value of [page_size][crate::model::ListDeploymentEventsRequest::page_size].
9782 ///
9783 /// # Example
9784 /// ```ignore,no_run
9785 /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9786 /// let x = ListDeploymentEventsRequest::new().set_page_size(42);
9787 /// ```
9788 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9789 self.page_size = v.into();
9790 self
9791 }
9792
9793 /// Sets the value of [page_token][crate::model::ListDeploymentEventsRequest::page_token].
9794 ///
9795 /// # Example
9796 /// ```ignore,no_run
9797 /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9798 /// let x = ListDeploymentEventsRequest::new().set_page_token("example");
9799 /// ```
9800 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9801 self.page_token = v.into();
9802 self
9803 }
9804
9805 /// Sets the value of [filter][crate::model::ListDeploymentEventsRequest::filter].
9806 ///
9807 /// # Example
9808 /// ```ignore,no_run
9809 /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsRequest;
9810 /// let x = ListDeploymentEventsRequest::new().set_filter("example");
9811 /// ```
9812 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9813 self.filter = v.into();
9814 self
9815 }
9816}
9817
9818impl wkt::message::Message for ListDeploymentEventsRequest {
9819 fn typename() -> &'static str {
9820 "type.googleapis.com/google.cloud.developerconnect.v1.ListDeploymentEventsRequest"
9821 }
9822}
9823
9824/// Response to listing DeploymentEvents.
9825#[derive(Clone, Default, PartialEq)]
9826#[non_exhaustive]
9827pub struct ListDeploymentEventsResponse {
9828 /// The list of DeploymentEvents.
9829 pub deployment_events: std::vec::Vec<crate::model::DeploymentEvent>,
9830
9831 /// A token, which can be sent as `page_token` to retrieve the next page.
9832 /// If this field is omitted, there are no subsequent pages.
9833 pub next_page_token: std::string::String,
9834
9835 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9836}
9837
9838impl ListDeploymentEventsResponse {
9839 /// Creates a new default instance.
9840 pub fn new() -> Self {
9841 std::default::Default::default()
9842 }
9843
9844 /// Sets the value of [deployment_events][crate::model::ListDeploymentEventsResponse::deployment_events].
9845 ///
9846 /// # Example
9847 /// ```ignore,no_run
9848 /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsResponse;
9849 /// use google_cloud_developerconnect_v1::model::DeploymentEvent;
9850 /// let x = ListDeploymentEventsResponse::new()
9851 /// .set_deployment_events([
9852 /// DeploymentEvent::default()/* use setters */,
9853 /// DeploymentEvent::default()/* use (different) setters */,
9854 /// ]);
9855 /// ```
9856 pub fn set_deployment_events<T, V>(mut self, v: T) -> Self
9857 where
9858 T: std::iter::IntoIterator<Item = V>,
9859 V: std::convert::Into<crate::model::DeploymentEvent>,
9860 {
9861 use std::iter::Iterator;
9862 self.deployment_events = v.into_iter().map(|i| i.into()).collect();
9863 self
9864 }
9865
9866 /// Sets the value of [next_page_token][crate::model::ListDeploymentEventsResponse::next_page_token].
9867 ///
9868 /// # Example
9869 /// ```ignore,no_run
9870 /// # use google_cloud_developerconnect_v1::model::ListDeploymentEventsResponse;
9871 /// let x = ListDeploymentEventsResponse::new().set_next_page_token("example");
9872 /// ```
9873 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9874 self.next_page_token = v.into();
9875 self
9876 }
9877}
9878
9879impl wkt::message::Message for ListDeploymentEventsResponse {
9880 fn typename() -> &'static str {
9881 "type.googleapis.com/google.cloud.developerconnect.v1.ListDeploymentEventsResponse"
9882 }
9883}
9884
9885#[doc(hidden)]
9886impl google_cloud_gax::paginator::internal::PageableResponse for ListDeploymentEventsResponse {
9887 type PageItem = crate::model::DeploymentEvent;
9888
9889 fn items(self) -> std::vec::Vec<Self::PageItem> {
9890 self.deployment_events
9891 }
9892
9893 fn next_page_token(&self) -> std::string::String {
9894 use std::clone::Clone;
9895 self.next_page_token.clone()
9896 }
9897}
9898
9899/// The ArtifactDeployment resource represents the deployment of the artifact
9900/// within the InsightsConfig resource.
9901#[derive(Clone, Default, PartialEq)]
9902#[non_exhaustive]
9903pub struct ArtifactDeployment {
9904 /// Output only. Unique identifier of `ArtifactDeployment`.
9905 pub id: std::string::String,
9906
9907 /// Output only. The artifact that is deployed.
9908 pub artifact_reference: std::string::String,
9909
9910 /// Output only. The artifact alias in the deployment spec, with Tag/SHA.
9911 /// e.g. us-docker.pkg.dev/my-project/my-repo/image:1.0.0
9912 pub artifact_alias: std::string::String,
9913
9914 /// Output only. The source commits at which this artifact was built. Extracted
9915 /// from provenance.
9916 pub source_commit_uris: std::vec::Vec<std::string::String>,
9917
9918 /// Output only. The time at which the deployment was deployed.
9919 pub deploy_time: std::option::Option<wkt::Timestamp>,
9920
9921 /// Output only. The time at which the deployment was undeployed, all artifacts
9922 /// are considered undeployed once this time is set.
9923 pub undeploy_time: std::option::Option<wkt::Timestamp>,
9924
9925 /// Output only. The summary of container status of the artifact deployment.
9926 /// Format as `ContainerStatusState-Reason : restartCount`
9927 /// e.g. "Waiting-ImagePullBackOff : 3"
9928 pub container_status_summary: std::string::String,
9929
9930 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9931}
9932
9933impl ArtifactDeployment {
9934 /// Creates a new default instance.
9935 pub fn new() -> Self {
9936 std::default::Default::default()
9937 }
9938
9939 /// Sets the value of [id][crate::model::ArtifactDeployment::id].
9940 ///
9941 /// # Example
9942 /// ```ignore,no_run
9943 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9944 /// let x = ArtifactDeployment::new().set_id("example");
9945 /// ```
9946 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9947 self.id = v.into();
9948 self
9949 }
9950
9951 /// Sets the value of [artifact_reference][crate::model::ArtifactDeployment::artifact_reference].
9952 ///
9953 /// # Example
9954 /// ```ignore,no_run
9955 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9956 /// let x = ArtifactDeployment::new().set_artifact_reference("example");
9957 /// ```
9958 pub fn set_artifact_reference<T: std::convert::Into<std::string::String>>(
9959 mut self,
9960 v: T,
9961 ) -> Self {
9962 self.artifact_reference = v.into();
9963 self
9964 }
9965
9966 /// Sets the value of [artifact_alias][crate::model::ArtifactDeployment::artifact_alias].
9967 ///
9968 /// # Example
9969 /// ```ignore,no_run
9970 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9971 /// let x = ArtifactDeployment::new().set_artifact_alias("example");
9972 /// ```
9973 pub fn set_artifact_alias<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9974 self.artifact_alias = v.into();
9975 self
9976 }
9977
9978 /// Sets the value of [source_commit_uris][crate::model::ArtifactDeployment::source_commit_uris].
9979 ///
9980 /// # Example
9981 /// ```ignore,no_run
9982 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
9983 /// let x = ArtifactDeployment::new().set_source_commit_uris(["a", "b", "c"]);
9984 /// ```
9985 pub fn set_source_commit_uris<T, V>(mut self, v: T) -> Self
9986 where
9987 T: std::iter::IntoIterator<Item = V>,
9988 V: std::convert::Into<std::string::String>,
9989 {
9990 use std::iter::Iterator;
9991 self.source_commit_uris = v.into_iter().map(|i| i.into()).collect();
9992 self
9993 }
9994
9995 /// Sets the value of [deploy_time][crate::model::ArtifactDeployment::deploy_time].
9996 ///
9997 /// # Example
9998 /// ```ignore,no_run
9999 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
10000 /// use wkt::Timestamp;
10001 /// let x = ArtifactDeployment::new().set_deploy_time(Timestamp::default()/* use setters */);
10002 /// ```
10003 pub fn set_deploy_time<T>(mut self, v: T) -> Self
10004 where
10005 T: std::convert::Into<wkt::Timestamp>,
10006 {
10007 self.deploy_time = std::option::Option::Some(v.into());
10008 self
10009 }
10010
10011 /// Sets or clears the value of [deploy_time][crate::model::ArtifactDeployment::deploy_time].
10012 ///
10013 /// # Example
10014 /// ```ignore,no_run
10015 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
10016 /// use wkt::Timestamp;
10017 /// let x = ArtifactDeployment::new().set_or_clear_deploy_time(Some(Timestamp::default()/* use setters */));
10018 /// let x = ArtifactDeployment::new().set_or_clear_deploy_time(None::<Timestamp>);
10019 /// ```
10020 pub fn set_or_clear_deploy_time<T>(mut self, v: std::option::Option<T>) -> Self
10021 where
10022 T: std::convert::Into<wkt::Timestamp>,
10023 {
10024 self.deploy_time = v.map(|x| x.into());
10025 self
10026 }
10027
10028 /// Sets the value of [undeploy_time][crate::model::ArtifactDeployment::undeploy_time].
10029 ///
10030 /// # Example
10031 /// ```ignore,no_run
10032 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
10033 /// use wkt::Timestamp;
10034 /// let x = ArtifactDeployment::new().set_undeploy_time(Timestamp::default()/* use setters */);
10035 /// ```
10036 pub fn set_undeploy_time<T>(mut self, v: T) -> Self
10037 where
10038 T: std::convert::Into<wkt::Timestamp>,
10039 {
10040 self.undeploy_time = std::option::Option::Some(v.into());
10041 self
10042 }
10043
10044 /// Sets or clears the value of [undeploy_time][crate::model::ArtifactDeployment::undeploy_time].
10045 ///
10046 /// # Example
10047 /// ```ignore,no_run
10048 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
10049 /// use wkt::Timestamp;
10050 /// let x = ArtifactDeployment::new().set_or_clear_undeploy_time(Some(Timestamp::default()/* use setters */));
10051 /// let x = ArtifactDeployment::new().set_or_clear_undeploy_time(None::<Timestamp>);
10052 /// ```
10053 pub fn set_or_clear_undeploy_time<T>(mut self, v: std::option::Option<T>) -> Self
10054 where
10055 T: std::convert::Into<wkt::Timestamp>,
10056 {
10057 self.undeploy_time = v.map(|x| x.into());
10058 self
10059 }
10060
10061 /// Sets the value of [container_status_summary][crate::model::ArtifactDeployment::container_status_summary].
10062 ///
10063 /// # Example
10064 /// ```ignore,no_run
10065 /// # use google_cloud_developerconnect_v1::model::ArtifactDeployment;
10066 /// let x = ArtifactDeployment::new().set_container_status_summary("example");
10067 /// ```
10068 pub fn set_container_status_summary<T: std::convert::Into<std::string::String>>(
10069 mut self,
10070 v: T,
10071 ) -> Self {
10072 self.container_status_summary = v.into();
10073 self
10074 }
10075}
10076
10077impl wkt::message::Message for ArtifactDeployment {
10078 fn typename() -> &'static str {
10079 "type.googleapis.com/google.cloud.developerconnect.v1.ArtifactDeployment"
10080 }
10081}
10082
10083/// Request for creating an InsightsConfig.
10084#[derive(Clone, Default, PartialEq)]
10085#[non_exhaustive]
10086pub struct CreateInsightsConfigRequest {
10087 /// Required. Value for parent.
10088 pub parent: std::string::String,
10089
10090 /// Required. ID of the requesting InsightsConfig.
10091 pub insights_config_id: std::string::String,
10092
10093 /// Required. The resource being created.
10094 pub insights_config: std::option::Option<crate::model::InsightsConfig>,
10095
10096 /// Optional. If set, validate the request, but do not actually post it.
10097 pub validate_only: bool,
10098
10099 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10100}
10101
10102impl CreateInsightsConfigRequest {
10103 /// Creates a new default instance.
10104 pub fn new() -> Self {
10105 std::default::Default::default()
10106 }
10107
10108 /// Sets the value of [parent][crate::model::CreateInsightsConfigRequest::parent].
10109 ///
10110 /// # Example
10111 /// ```ignore,no_run
10112 /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
10113 /// # let project_id = "project_id";
10114 /// # let location_id = "location_id";
10115 /// let x = CreateInsightsConfigRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
10116 /// ```
10117 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10118 self.parent = v.into();
10119 self
10120 }
10121
10122 /// Sets the value of [insights_config_id][crate::model::CreateInsightsConfigRequest::insights_config_id].
10123 ///
10124 /// # Example
10125 /// ```ignore,no_run
10126 /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
10127 /// let x = CreateInsightsConfigRequest::new().set_insights_config_id("example");
10128 /// ```
10129 pub fn set_insights_config_id<T: std::convert::Into<std::string::String>>(
10130 mut self,
10131 v: T,
10132 ) -> Self {
10133 self.insights_config_id = v.into();
10134 self
10135 }
10136
10137 /// Sets the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
10138 ///
10139 /// # Example
10140 /// ```ignore,no_run
10141 /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
10142 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10143 /// let x = CreateInsightsConfigRequest::new().set_insights_config(InsightsConfig::default()/* use setters */);
10144 /// ```
10145 pub fn set_insights_config<T>(mut self, v: T) -> Self
10146 where
10147 T: std::convert::Into<crate::model::InsightsConfig>,
10148 {
10149 self.insights_config = std::option::Option::Some(v.into());
10150 self
10151 }
10152
10153 /// Sets or clears the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
10154 ///
10155 /// # Example
10156 /// ```ignore,no_run
10157 /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
10158 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10159 /// let x = CreateInsightsConfigRequest::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
10160 /// let x = CreateInsightsConfigRequest::new().set_or_clear_insights_config(None::<InsightsConfig>);
10161 /// ```
10162 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
10163 where
10164 T: std::convert::Into<crate::model::InsightsConfig>,
10165 {
10166 self.insights_config = v.map(|x| x.into());
10167 self
10168 }
10169
10170 /// Sets the value of [validate_only][crate::model::CreateInsightsConfigRequest::validate_only].
10171 ///
10172 /// # Example
10173 /// ```ignore,no_run
10174 /// # use google_cloud_developerconnect_v1::model::CreateInsightsConfigRequest;
10175 /// let x = CreateInsightsConfigRequest::new().set_validate_only(true);
10176 /// ```
10177 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10178 self.validate_only = v.into();
10179 self
10180 }
10181}
10182
10183impl wkt::message::Message for CreateInsightsConfigRequest {
10184 fn typename() -> &'static str {
10185 "type.googleapis.com/google.cloud.developerconnect.v1.CreateInsightsConfigRequest"
10186 }
10187}
10188
10189/// Request for getting an InsightsConfig.
10190#[derive(Clone, Default, PartialEq)]
10191#[non_exhaustive]
10192pub struct GetInsightsConfigRequest {
10193 /// Required. Name of the resource.
10194 pub name: std::string::String,
10195
10196 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10197}
10198
10199impl GetInsightsConfigRequest {
10200 /// Creates a new default instance.
10201 pub fn new() -> Self {
10202 std::default::Default::default()
10203 }
10204
10205 /// Sets the value of [name][crate::model::GetInsightsConfigRequest::name].
10206 ///
10207 /// # Example
10208 /// ```ignore,no_run
10209 /// # use google_cloud_developerconnect_v1::model::GetInsightsConfigRequest;
10210 /// # let project_id = "project_id";
10211 /// # let location_id = "location_id";
10212 /// # let insights_config_id = "insights_config_id";
10213 /// let x = GetInsightsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"));
10214 /// ```
10215 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10216 self.name = v.into();
10217 self
10218 }
10219}
10220
10221impl wkt::message::Message for GetInsightsConfigRequest {
10222 fn typename() -> &'static str {
10223 "type.googleapis.com/google.cloud.developerconnect.v1.GetInsightsConfigRequest"
10224 }
10225}
10226
10227/// Request for requesting list of InsightsConfigs.
10228#[derive(Clone, Default, PartialEq)]
10229#[non_exhaustive]
10230pub struct ListInsightsConfigsRequest {
10231 /// Required. Parent value for ListInsightsConfigsRequest.
10232 pub parent: std::string::String,
10233
10234 /// Optional. Requested page size. Server may return fewer items than
10235 /// requested. If unspecified, server will pick an appropriate default.
10236 pub page_size: i32,
10237
10238 /// Optional. A token identifying a page of results the server should return.
10239 pub page_token: std::string::String,
10240
10241 /// Optional. Filtering results. See <https://google.aip.dev/160> for more
10242 /// details. Filter string, adhering to the rules in
10243 /// <https://google.aip.dev/160>. List only InsightsConfigs matching the filter.
10244 /// If filter is empty, all InsightsConfigs are listed.
10245 pub filter: std::string::String,
10246
10247 /// Optional. Hint for how to order the results.
10248 pub order_by: std::string::String,
10249
10250 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10251}
10252
10253impl ListInsightsConfigsRequest {
10254 /// Creates a new default instance.
10255 pub fn new() -> Self {
10256 std::default::Default::default()
10257 }
10258
10259 /// Sets the value of [parent][crate::model::ListInsightsConfigsRequest::parent].
10260 ///
10261 /// # Example
10262 /// ```ignore,no_run
10263 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10264 /// # let project_id = "project_id";
10265 /// # let location_id = "location_id";
10266 /// let x = ListInsightsConfigsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
10267 /// ```
10268 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10269 self.parent = v.into();
10270 self
10271 }
10272
10273 /// Sets the value of [page_size][crate::model::ListInsightsConfigsRequest::page_size].
10274 ///
10275 /// # Example
10276 /// ```ignore,no_run
10277 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10278 /// let x = ListInsightsConfigsRequest::new().set_page_size(42);
10279 /// ```
10280 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10281 self.page_size = v.into();
10282 self
10283 }
10284
10285 /// Sets the value of [page_token][crate::model::ListInsightsConfigsRequest::page_token].
10286 ///
10287 /// # Example
10288 /// ```ignore,no_run
10289 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10290 /// let x = ListInsightsConfigsRequest::new().set_page_token("example");
10291 /// ```
10292 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10293 self.page_token = v.into();
10294 self
10295 }
10296
10297 /// Sets the value of [filter][crate::model::ListInsightsConfigsRequest::filter].
10298 ///
10299 /// # Example
10300 /// ```ignore,no_run
10301 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10302 /// let x = ListInsightsConfigsRequest::new().set_filter("example");
10303 /// ```
10304 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10305 self.filter = v.into();
10306 self
10307 }
10308
10309 /// Sets the value of [order_by][crate::model::ListInsightsConfigsRequest::order_by].
10310 ///
10311 /// # Example
10312 /// ```ignore,no_run
10313 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsRequest;
10314 /// let x = ListInsightsConfigsRequest::new().set_order_by("example");
10315 /// ```
10316 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10317 self.order_by = v.into();
10318 self
10319 }
10320}
10321
10322impl wkt::message::Message for ListInsightsConfigsRequest {
10323 fn typename() -> &'static str {
10324 "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsRequest"
10325 }
10326}
10327
10328/// Request for response to listing InsightsConfigs.
10329#[derive(Clone, Default, PartialEq)]
10330#[non_exhaustive]
10331pub struct ListInsightsConfigsResponse {
10332 /// The list of InsightsConfigs.
10333 pub insights_configs: std::vec::Vec<crate::model::InsightsConfig>,
10334
10335 /// A token identifying a page of results the server should return.
10336 pub next_page_token: std::string::String,
10337
10338 /// Locations that could not be reached.
10339 pub unreachable: std::vec::Vec<std::string::String>,
10340
10341 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10342}
10343
10344impl ListInsightsConfigsResponse {
10345 /// Creates a new default instance.
10346 pub fn new() -> Self {
10347 std::default::Default::default()
10348 }
10349
10350 /// Sets the value of [insights_configs][crate::model::ListInsightsConfigsResponse::insights_configs].
10351 ///
10352 /// # Example
10353 /// ```ignore,no_run
10354 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
10355 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10356 /// let x = ListInsightsConfigsResponse::new()
10357 /// .set_insights_configs([
10358 /// InsightsConfig::default()/* use setters */,
10359 /// InsightsConfig::default()/* use (different) setters */,
10360 /// ]);
10361 /// ```
10362 pub fn set_insights_configs<T, V>(mut self, v: T) -> Self
10363 where
10364 T: std::iter::IntoIterator<Item = V>,
10365 V: std::convert::Into<crate::model::InsightsConfig>,
10366 {
10367 use std::iter::Iterator;
10368 self.insights_configs = v.into_iter().map(|i| i.into()).collect();
10369 self
10370 }
10371
10372 /// Sets the value of [next_page_token][crate::model::ListInsightsConfigsResponse::next_page_token].
10373 ///
10374 /// # Example
10375 /// ```ignore,no_run
10376 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
10377 /// let x = ListInsightsConfigsResponse::new().set_next_page_token("example");
10378 /// ```
10379 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10380 self.next_page_token = v.into();
10381 self
10382 }
10383
10384 /// Sets the value of [unreachable][crate::model::ListInsightsConfigsResponse::unreachable].
10385 ///
10386 /// # Example
10387 /// ```ignore,no_run
10388 /// # use google_cloud_developerconnect_v1::model::ListInsightsConfigsResponse;
10389 /// let x = ListInsightsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
10390 /// ```
10391 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10392 where
10393 T: std::iter::IntoIterator<Item = V>,
10394 V: std::convert::Into<std::string::String>,
10395 {
10396 use std::iter::Iterator;
10397 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10398 self
10399 }
10400}
10401
10402impl wkt::message::Message for ListInsightsConfigsResponse {
10403 fn typename() -> &'static str {
10404 "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsResponse"
10405 }
10406}
10407
10408#[doc(hidden)]
10409impl google_cloud_gax::paginator::internal::PageableResponse for ListInsightsConfigsResponse {
10410 type PageItem = crate::model::InsightsConfig;
10411
10412 fn items(self) -> std::vec::Vec<Self::PageItem> {
10413 self.insights_configs
10414 }
10415
10416 fn next_page_token(&self) -> std::string::String {
10417 use std::clone::Clone;
10418 self.next_page_token.clone()
10419 }
10420}
10421
10422/// Request for deleting an InsightsConfig.
10423#[derive(Clone, Default, PartialEq)]
10424#[non_exhaustive]
10425pub struct DeleteInsightsConfigRequest {
10426 /// Required. Value for parent.
10427 pub name: std::string::String,
10428
10429 /// Optional. An optional request ID to identify requests. Specify a unique
10430 /// request ID so that if you must retry your request, the server will know to
10431 /// ignore the request if it has already been completed. The server will
10432 /// guarantee that for at least 60 minutes after the first request.
10433 ///
10434 /// For example, consider a situation where you make an initial request and the
10435 /// request times out. If you make the request again with the same request
10436 /// ID, the server can check if original operation with the same request ID
10437 /// was received, and if so, will ignore the second request. This prevents
10438 /// clients from accidentally creating duplicate commitments.
10439 ///
10440 /// The request ID must be a valid UUID with the exception that zero UUID is
10441 /// not supported (00000000-0000-0000-0000-000000000000).
10442 pub request_id: std::string::String,
10443
10444 /// Optional. If set, validate the request, but do not actually post it.
10445 pub validate_only: bool,
10446
10447 /// Optional. This checksum is computed by the server based on the value of
10448 /// other fields, and may be sent on update and delete requests to ensure the
10449 /// client has an up-to-date value before proceeding.
10450 pub etag: std::string::String,
10451
10452 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10453}
10454
10455impl DeleteInsightsConfigRequest {
10456 /// Creates a new default instance.
10457 pub fn new() -> Self {
10458 std::default::Default::default()
10459 }
10460
10461 /// Sets the value of [name][crate::model::DeleteInsightsConfigRequest::name].
10462 ///
10463 /// # Example
10464 /// ```ignore,no_run
10465 /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10466 /// # let project_id = "project_id";
10467 /// # let location_id = "location_id";
10468 /// # let insights_config_id = "insights_config_id";
10469 /// let x = DeleteInsightsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"));
10470 /// ```
10471 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10472 self.name = v.into();
10473 self
10474 }
10475
10476 /// Sets the value of [request_id][crate::model::DeleteInsightsConfigRequest::request_id].
10477 ///
10478 /// # Example
10479 /// ```ignore,no_run
10480 /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10481 /// let x = DeleteInsightsConfigRequest::new().set_request_id("example");
10482 /// ```
10483 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10484 self.request_id = v.into();
10485 self
10486 }
10487
10488 /// Sets the value of [validate_only][crate::model::DeleteInsightsConfigRequest::validate_only].
10489 ///
10490 /// # Example
10491 /// ```ignore,no_run
10492 /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10493 /// let x = DeleteInsightsConfigRequest::new().set_validate_only(true);
10494 /// ```
10495 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10496 self.validate_only = v.into();
10497 self
10498 }
10499
10500 /// Sets the value of [etag][crate::model::DeleteInsightsConfigRequest::etag].
10501 ///
10502 /// # Example
10503 /// ```ignore,no_run
10504 /// # use google_cloud_developerconnect_v1::model::DeleteInsightsConfigRequest;
10505 /// let x = DeleteInsightsConfigRequest::new().set_etag("example");
10506 /// ```
10507 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10508 self.etag = v.into();
10509 self
10510 }
10511}
10512
10513impl wkt::message::Message for DeleteInsightsConfigRequest {
10514 fn typename() -> &'static str {
10515 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteInsightsConfigRequest"
10516 }
10517}
10518
10519/// Request for updating an InsightsConfig.
10520#[derive(Clone, Default, PartialEq)]
10521#[non_exhaustive]
10522pub struct UpdateInsightsConfigRequest {
10523 /// Required. The resource being updated.
10524 pub insights_config: std::option::Option<crate::model::InsightsConfig>,
10525
10526 /// Optional. An optional request ID to identify requests. Specify a unique
10527 /// request ID so that if you must retry your request, the server will know to
10528 /// ignore the request if it has already been completed. The server will
10529 /// guarantee that for at least 60 minutes after the first request.
10530 ///
10531 /// For example, consider a situation where you make an initial request and the
10532 /// request times out. If you make the request again with the same request
10533 /// ID, the server can check if original operation with the same request ID
10534 /// was received, and if so, will ignore the second request. This prevents
10535 /// clients from accidentally creating duplicate commitments.
10536 ///
10537 /// The request ID must be a valid UUID with the exception that zero UUID is
10538 /// not supported (00000000-0000-0000-0000-000000000000).
10539 pub request_id: std::string::String,
10540
10541 /// Optional. If set to true, and the insightsConfig is not found a new
10542 /// insightsConfig will be created. In this situation `update_mask` is ignored.
10543 /// The creation will succeed only if the input insightsConfig has all the
10544 /// necessary information (e.g a github_config with both user_oauth_token and
10545 /// installation_id properties).
10546 pub allow_missing: bool,
10547
10548 /// Optional. If set, validate the request, but do not actually post it.
10549 pub validate_only: bool,
10550
10551 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10552}
10553
10554impl UpdateInsightsConfigRequest {
10555 /// Creates a new default instance.
10556 pub fn new() -> Self {
10557 std::default::Default::default()
10558 }
10559
10560 /// Sets the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
10561 ///
10562 /// # Example
10563 /// ```ignore,no_run
10564 /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10565 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10566 /// let x = UpdateInsightsConfigRequest::new().set_insights_config(InsightsConfig::default()/* use setters */);
10567 /// ```
10568 pub fn set_insights_config<T>(mut self, v: T) -> Self
10569 where
10570 T: std::convert::Into<crate::model::InsightsConfig>,
10571 {
10572 self.insights_config = std::option::Option::Some(v.into());
10573 self
10574 }
10575
10576 /// Sets or clears the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
10577 ///
10578 /// # Example
10579 /// ```ignore,no_run
10580 /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10581 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
10582 /// let x = UpdateInsightsConfigRequest::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
10583 /// let x = UpdateInsightsConfigRequest::new().set_or_clear_insights_config(None::<InsightsConfig>);
10584 /// ```
10585 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
10586 where
10587 T: std::convert::Into<crate::model::InsightsConfig>,
10588 {
10589 self.insights_config = v.map(|x| x.into());
10590 self
10591 }
10592
10593 /// Sets the value of [request_id][crate::model::UpdateInsightsConfigRequest::request_id].
10594 ///
10595 /// # Example
10596 /// ```ignore,no_run
10597 /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10598 /// let x = UpdateInsightsConfigRequest::new().set_request_id("example");
10599 /// ```
10600 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10601 self.request_id = v.into();
10602 self
10603 }
10604
10605 /// Sets the value of [allow_missing][crate::model::UpdateInsightsConfigRequest::allow_missing].
10606 ///
10607 /// # Example
10608 /// ```ignore,no_run
10609 /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10610 /// let x = UpdateInsightsConfigRequest::new().set_allow_missing(true);
10611 /// ```
10612 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10613 self.allow_missing = v.into();
10614 self
10615 }
10616
10617 /// Sets the value of [validate_only][crate::model::UpdateInsightsConfigRequest::validate_only].
10618 ///
10619 /// # Example
10620 /// ```ignore,no_run
10621 /// # use google_cloud_developerconnect_v1::model::UpdateInsightsConfigRequest;
10622 /// let x = UpdateInsightsConfigRequest::new().set_validate_only(true);
10623 /// ```
10624 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10625 self.validate_only = v.into();
10626 self
10627 }
10628}
10629
10630impl wkt::message::Message for UpdateInsightsConfigRequest {
10631 fn typename() -> &'static str {
10632 "type.googleapis.com/google.cloud.developerconnect.v1.UpdateInsightsConfigRequest"
10633 }
10634}
10635
10636/// SystemProvider is a list of providers that are owned by Developer Connect.
10637///
10638/// # Working with unknown values
10639///
10640/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10641/// additional enum variants at any time. Adding new variants is not considered
10642/// a breaking change. Applications should write their code in anticipation of:
10643///
10644/// - New values appearing in future releases of the client library, **and**
10645/// - New values received dynamically, without application changes.
10646///
10647/// Please consult the [Working with enums] section in the user guide for some
10648/// guidelines.
10649///
10650/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10651#[derive(Clone, Debug, PartialEq)]
10652#[non_exhaustive]
10653pub enum SystemProvider {
10654 /// No system provider specified.
10655 Unspecified,
10656 /// GitHub provider.
10657 /// Scopes can be found at
10658 /// <https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes>
10659 Github,
10660 /// GitLab provider.
10661 /// Scopes can be found at
10662 /// <https://docs.gitlab.com/user/profile/personal_access_tokens/#personal-access-token-scopes>
10663 Gitlab,
10664 /// Google provider.
10665 /// Recommended scopes:
10666 /// `https://www.googleapis.com/auth/drive.readonly`,
10667 /// `https://www.googleapis.com/auth/documents.readonly`
10668 Google,
10669 /// Sentry provider.
10670 /// Scopes can be found at
10671 /// <https://docs.sentry.io/api/permissions/>
10672 Sentry,
10673 /// Rovo provider.
10674 /// Must select the "rovo" scope.
10675 Rovo,
10676 /// New Relic provider.
10677 /// No scopes are allowed.
10678 NewRelic,
10679 /// Datastax provider.
10680 /// No scopes are allowed.
10681 Datastax,
10682 /// Dynatrace provider.
10683 Dynatrace,
10684 /// If set, the enum was initialized with an unknown value.
10685 ///
10686 /// Applications can examine the value using [SystemProvider::value] or
10687 /// [SystemProvider::name].
10688 UnknownValue(system_provider::UnknownValue),
10689}
10690
10691#[doc(hidden)]
10692pub mod system_provider {
10693 #[allow(unused_imports)]
10694 use super::*;
10695 #[derive(Clone, Debug, PartialEq)]
10696 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10697}
10698
10699impl SystemProvider {
10700 /// Gets the enum value.
10701 ///
10702 /// Returns `None` if the enum contains an unknown value deserialized from
10703 /// the string representation of enums.
10704 pub fn value(&self) -> std::option::Option<i32> {
10705 match self {
10706 Self::Unspecified => std::option::Option::Some(0),
10707 Self::Github => std::option::Option::Some(1),
10708 Self::Gitlab => std::option::Option::Some(2),
10709 Self::Google => std::option::Option::Some(3),
10710 Self::Sentry => std::option::Option::Some(4),
10711 Self::Rovo => std::option::Option::Some(5),
10712 Self::NewRelic => std::option::Option::Some(6),
10713 Self::Datastax => std::option::Option::Some(7),
10714 Self::Dynatrace => std::option::Option::Some(8),
10715 Self::UnknownValue(u) => u.0.value(),
10716 }
10717 }
10718
10719 /// Gets the enum value as a string.
10720 ///
10721 /// Returns `None` if the enum contains an unknown value deserialized from
10722 /// the integer representation of enums.
10723 pub fn name(&self) -> std::option::Option<&str> {
10724 match self {
10725 Self::Unspecified => std::option::Option::Some("SYSTEM_PROVIDER_UNSPECIFIED"),
10726 Self::Github => std::option::Option::Some("GITHUB"),
10727 Self::Gitlab => std::option::Option::Some("GITLAB"),
10728 Self::Google => std::option::Option::Some("GOOGLE"),
10729 Self::Sentry => std::option::Option::Some("SENTRY"),
10730 Self::Rovo => std::option::Option::Some("ROVO"),
10731 Self::NewRelic => std::option::Option::Some("NEW_RELIC"),
10732 Self::Datastax => std::option::Option::Some("DATASTAX"),
10733 Self::Dynatrace => std::option::Option::Some("DYNATRACE"),
10734 Self::UnknownValue(u) => u.0.name(),
10735 }
10736 }
10737}
10738
10739impl std::default::Default for SystemProvider {
10740 fn default() -> Self {
10741 use std::convert::From;
10742 Self::from(0)
10743 }
10744}
10745
10746impl std::fmt::Display for SystemProvider {
10747 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10748 wkt::internal::display_enum(f, self.name(), self.value())
10749 }
10750}
10751
10752impl std::convert::From<i32> for SystemProvider {
10753 fn from(value: i32) -> Self {
10754 match value {
10755 0 => Self::Unspecified,
10756 1 => Self::Github,
10757 2 => Self::Gitlab,
10758 3 => Self::Google,
10759 4 => Self::Sentry,
10760 5 => Self::Rovo,
10761 6 => Self::NewRelic,
10762 7 => Self::Datastax,
10763 8 => Self::Dynatrace,
10764 _ => Self::UnknownValue(system_provider::UnknownValue(
10765 wkt::internal::UnknownEnumValue::Integer(value),
10766 )),
10767 }
10768 }
10769}
10770
10771impl std::convert::From<&str> for SystemProvider {
10772 fn from(value: &str) -> Self {
10773 use std::string::ToString;
10774 match value {
10775 "SYSTEM_PROVIDER_UNSPECIFIED" => Self::Unspecified,
10776 "GITHUB" => Self::Github,
10777 "GITLAB" => Self::Gitlab,
10778 "GOOGLE" => Self::Google,
10779 "SENTRY" => Self::Sentry,
10780 "ROVO" => Self::Rovo,
10781 "NEW_RELIC" => Self::NewRelic,
10782 "DATASTAX" => Self::Datastax,
10783 "DYNATRACE" => Self::Dynatrace,
10784 _ => Self::UnknownValue(system_provider::UnknownValue(
10785 wkt::internal::UnknownEnumValue::String(value.to_string()),
10786 )),
10787 }
10788 }
10789}
10790
10791impl serde::ser::Serialize for SystemProvider {
10792 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10793 where
10794 S: serde::Serializer,
10795 {
10796 match self {
10797 Self::Unspecified => serializer.serialize_i32(0),
10798 Self::Github => serializer.serialize_i32(1),
10799 Self::Gitlab => serializer.serialize_i32(2),
10800 Self::Google => serializer.serialize_i32(3),
10801 Self::Sentry => serializer.serialize_i32(4),
10802 Self::Rovo => serializer.serialize_i32(5),
10803 Self::NewRelic => serializer.serialize_i32(6),
10804 Self::Datastax => serializer.serialize_i32(7),
10805 Self::Dynatrace => serializer.serialize_i32(8),
10806 Self::UnknownValue(u) => u.0.serialize(serializer),
10807 }
10808 }
10809}
10810
10811impl<'de> serde::de::Deserialize<'de> for SystemProvider {
10812 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10813 where
10814 D: serde::Deserializer<'de>,
10815 {
10816 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SystemProvider>::new(
10817 ".google.cloud.developerconnect.v1.SystemProvider",
10818 ))
10819 }
10820}