google_cloud_securesourcemanager_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// A resource that represents a Secure Source Manager instance.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct Instance {
43 /// Identifier. A unique identifier for an instance. The name should be of the
44 /// format:
45 /// `projects/{project_number}/locations/{location_id}/instances/{instance_id}`
46 ///
47 /// `project_number`: Maps to a unique int64 id assigned to each project.
48 ///
49 /// `location_id`: Refers to the region where the instance will be deployed.
50 /// Since Secure Source Manager is a regional service, it must be one of the
51 /// valid GCP regions.
52 ///
53 /// `instance_id`: User provided name for the instance, must be unique for a
54 /// project_number and location_id combination.
55 pub name: std::string::String,
56
57 /// Output only. Create timestamp.
58 pub create_time: std::option::Option<wkt::Timestamp>,
59
60 /// Output only. Update timestamp.
61 pub update_time: std::option::Option<wkt::Timestamp>,
62
63 /// Optional. Labels as key value pairs.
64 /// Keys and values can contain only lowercase letters, numeric characters,
65 /// underscores, and dashes.
66 /// For more information, see [Requirements for
67 /// labels](https://cloud.google.com/resource-manager/docs/best-practices-labels#label_encoding).
68 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
69
70 /// Optional. Private settings for private instance.
71 pub private_config: std::option::Option<crate::model::instance::PrivateConfig>,
72
73 /// Output only. Current state of the instance.
74 pub state: crate::model::instance::State,
75
76 /// Output only. An optional field providing information about the current
77 /// instance state.
78 pub state_note: crate::model::instance::StateNote,
79
80 /// Optional. Immutable. Customer-managed encryption key name, in the format
81 /// projects/*/locations/*/keyRings/*/cryptoKeys/*.
82 pub kms_key: std::string::String,
83
84 /// Output only. A list of hostnames for this instance.
85 pub host_config: std::option::Option<crate::model::instance::HostConfig>,
86
87 /// Optional. Configuration for Workforce Identity Federation to support
88 /// third party identity provider. If unset, defaults to the Google OIDC IdP.
89 pub workforce_identity_federation_config:
90 std::option::Option<crate::model::instance::WorkforceIdentityFederationConfig>,
91
92 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
93}
94
95impl Instance {
96 pub fn new() -> Self {
97 std::default::Default::default()
98 }
99
100 /// Sets the value of [name][crate::model::Instance::name].
101 ///
102 /// # Example
103 /// ```ignore,no_run
104 /// # use google_cloud_securesourcemanager_v1::model::Instance;
105 /// let x = Instance::new().set_name("example");
106 /// ```
107 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
108 self.name = v.into();
109 self
110 }
111
112 /// Sets the value of [create_time][crate::model::Instance::create_time].
113 ///
114 /// # Example
115 /// ```ignore,no_run
116 /// # use google_cloud_securesourcemanager_v1::model::Instance;
117 /// use wkt::Timestamp;
118 /// let x = Instance::new().set_create_time(Timestamp::default()/* use setters */);
119 /// ```
120 pub fn set_create_time<T>(mut self, v: T) -> Self
121 where
122 T: std::convert::Into<wkt::Timestamp>,
123 {
124 self.create_time = std::option::Option::Some(v.into());
125 self
126 }
127
128 /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
129 ///
130 /// # Example
131 /// ```ignore,no_run
132 /// # use google_cloud_securesourcemanager_v1::model::Instance;
133 /// use wkt::Timestamp;
134 /// let x = Instance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
135 /// let x = Instance::new().set_or_clear_create_time(None::<Timestamp>);
136 /// ```
137 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
138 where
139 T: std::convert::Into<wkt::Timestamp>,
140 {
141 self.create_time = v.map(|x| x.into());
142 self
143 }
144
145 /// Sets the value of [update_time][crate::model::Instance::update_time].
146 ///
147 /// # Example
148 /// ```ignore,no_run
149 /// # use google_cloud_securesourcemanager_v1::model::Instance;
150 /// use wkt::Timestamp;
151 /// let x = Instance::new().set_update_time(Timestamp::default()/* use setters */);
152 /// ```
153 pub fn set_update_time<T>(mut self, v: T) -> Self
154 where
155 T: std::convert::Into<wkt::Timestamp>,
156 {
157 self.update_time = std::option::Option::Some(v.into());
158 self
159 }
160
161 /// Sets or clears the value of [update_time][crate::model::Instance::update_time].
162 ///
163 /// # Example
164 /// ```ignore,no_run
165 /// # use google_cloud_securesourcemanager_v1::model::Instance;
166 /// use wkt::Timestamp;
167 /// let x = Instance::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
168 /// let x = Instance::new().set_or_clear_update_time(None::<Timestamp>);
169 /// ```
170 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
171 where
172 T: std::convert::Into<wkt::Timestamp>,
173 {
174 self.update_time = v.map(|x| x.into());
175 self
176 }
177
178 /// Sets the value of [labels][crate::model::Instance::labels].
179 ///
180 /// # Example
181 /// ```ignore,no_run
182 /// # use google_cloud_securesourcemanager_v1::model::Instance;
183 /// let x = Instance::new().set_labels([
184 /// ("key0", "abc"),
185 /// ("key1", "xyz"),
186 /// ]);
187 /// ```
188 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
189 where
190 T: std::iter::IntoIterator<Item = (K, V)>,
191 K: std::convert::Into<std::string::String>,
192 V: std::convert::Into<std::string::String>,
193 {
194 use std::iter::Iterator;
195 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
196 self
197 }
198
199 /// Sets the value of [private_config][crate::model::Instance::private_config].
200 ///
201 /// # Example
202 /// ```ignore,no_run
203 /// # use google_cloud_securesourcemanager_v1::model::Instance;
204 /// use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
205 /// let x = Instance::new().set_private_config(PrivateConfig::default()/* use setters */);
206 /// ```
207 pub fn set_private_config<T>(mut self, v: T) -> Self
208 where
209 T: std::convert::Into<crate::model::instance::PrivateConfig>,
210 {
211 self.private_config = std::option::Option::Some(v.into());
212 self
213 }
214
215 /// Sets or clears the value of [private_config][crate::model::Instance::private_config].
216 ///
217 /// # Example
218 /// ```ignore,no_run
219 /// # use google_cloud_securesourcemanager_v1::model::Instance;
220 /// use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
221 /// let x = Instance::new().set_or_clear_private_config(Some(PrivateConfig::default()/* use setters */));
222 /// let x = Instance::new().set_or_clear_private_config(None::<PrivateConfig>);
223 /// ```
224 pub fn set_or_clear_private_config<T>(mut self, v: std::option::Option<T>) -> Self
225 where
226 T: std::convert::Into<crate::model::instance::PrivateConfig>,
227 {
228 self.private_config = v.map(|x| x.into());
229 self
230 }
231
232 /// Sets the value of [state][crate::model::Instance::state].
233 ///
234 /// # Example
235 /// ```ignore,no_run
236 /// # use google_cloud_securesourcemanager_v1::model::Instance;
237 /// use google_cloud_securesourcemanager_v1::model::instance::State;
238 /// let x0 = Instance::new().set_state(State::Creating);
239 /// let x1 = Instance::new().set_state(State::Active);
240 /// let x2 = Instance::new().set_state(State::Deleting);
241 /// ```
242 pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
243 self.state = v.into();
244 self
245 }
246
247 /// Sets the value of [state_note][crate::model::Instance::state_note].
248 ///
249 /// # Example
250 /// ```ignore,no_run
251 /// # use google_cloud_securesourcemanager_v1::model::Instance;
252 /// use google_cloud_securesourcemanager_v1::model::instance::StateNote;
253 /// let x0 = Instance::new().set_state_note(StateNote::PausedCmekUnavailable);
254 /// ```
255 pub fn set_state_note<T: std::convert::Into<crate::model::instance::StateNote>>(
256 mut self,
257 v: T,
258 ) -> Self {
259 self.state_note = v.into();
260 self
261 }
262
263 /// Sets the value of [kms_key][crate::model::Instance::kms_key].
264 ///
265 /// # Example
266 /// ```ignore,no_run
267 /// # use google_cloud_securesourcemanager_v1::model::Instance;
268 /// let x = Instance::new().set_kms_key("example");
269 /// ```
270 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
271 self.kms_key = v.into();
272 self
273 }
274
275 /// Sets the value of [host_config][crate::model::Instance::host_config].
276 ///
277 /// # Example
278 /// ```ignore,no_run
279 /// # use google_cloud_securesourcemanager_v1::model::Instance;
280 /// use google_cloud_securesourcemanager_v1::model::instance::HostConfig;
281 /// let x = Instance::new().set_host_config(HostConfig::default()/* use setters */);
282 /// ```
283 pub fn set_host_config<T>(mut self, v: T) -> Self
284 where
285 T: std::convert::Into<crate::model::instance::HostConfig>,
286 {
287 self.host_config = std::option::Option::Some(v.into());
288 self
289 }
290
291 /// Sets or clears the value of [host_config][crate::model::Instance::host_config].
292 ///
293 /// # Example
294 /// ```ignore,no_run
295 /// # use google_cloud_securesourcemanager_v1::model::Instance;
296 /// use google_cloud_securesourcemanager_v1::model::instance::HostConfig;
297 /// let x = Instance::new().set_or_clear_host_config(Some(HostConfig::default()/* use setters */));
298 /// let x = Instance::new().set_or_clear_host_config(None::<HostConfig>);
299 /// ```
300 pub fn set_or_clear_host_config<T>(mut self, v: std::option::Option<T>) -> Self
301 where
302 T: std::convert::Into<crate::model::instance::HostConfig>,
303 {
304 self.host_config = v.map(|x| x.into());
305 self
306 }
307
308 /// Sets the value of [workforce_identity_federation_config][crate::model::Instance::workforce_identity_federation_config].
309 ///
310 /// # Example
311 /// ```ignore,no_run
312 /// # use google_cloud_securesourcemanager_v1::model::Instance;
313 /// use google_cloud_securesourcemanager_v1::model::instance::WorkforceIdentityFederationConfig;
314 /// let x = Instance::new().set_workforce_identity_federation_config(WorkforceIdentityFederationConfig::default()/* use setters */);
315 /// ```
316 pub fn set_workforce_identity_federation_config<T>(mut self, v: T) -> Self
317 where
318 T: std::convert::Into<crate::model::instance::WorkforceIdentityFederationConfig>,
319 {
320 self.workforce_identity_federation_config = std::option::Option::Some(v.into());
321 self
322 }
323
324 /// Sets or clears the value of [workforce_identity_federation_config][crate::model::Instance::workforce_identity_federation_config].
325 ///
326 /// # Example
327 /// ```ignore,no_run
328 /// # use google_cloud_securesourcemanager_v1::model::Instance;
329 /// use google_cloud_securesourcemanager_v1::model::instance::WorkforceIdentityFederationConfig;
330 /// let x = Instance::new().set_or_clear_workforce_identity_federation_config(Some(WorkforceIdentityFederationConfig::default()/* use setters */));
331 /// let x = Instance::new().set_or_clear_workforce_identity_federation_config(None::<WorkforceIdentityFederationConfig>);
332 /// ```
333 pub fn set_or_clear_workforce_identity_federation_config<T>(
334 mut self,
335 v: std::option::Option<T>,
336 ) -> Self
337 where
338 T: std::convert::Into<crate::model::instance::WorkforceIdentityFederationConfig>,
339 {
340 self.workforce_identity_federation_config = v.map(|x| x.into());
341 self
342 }
343}
344
345impl wkt::message::Message for Instance {
346 fn typename() -> &'static str {
347 "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance"
348 }
349}
350
351/// Defines additional types related to [Instance].
352pub mod instance {
353 #[allow(unused_imports)]
354 use super::*;
355
356 /// HostConfig has different instance endpoints.
357 #[derive(Clone, Default, PartialEq)]
358 #[non_exhaustive]
359 pub struct HostConfig {
360 /// Output only. HTML hostname.
361 pub html: std::string::String,
362
363 /// Output only. API hostname.
364 pub api: std::string::String,
365
366 /// Output only. Git HTTP hostname.
367 pub git_http: std::string::String,
368
369 /// Output only. Git SSH hostname.
370 pub git_ssh: std::string::String,
371
372 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
373 }
374
375 impl HostConfig {
376 pub fn new() -> Self {
377 std::default::Default::default()
378 }
379
380 /// Sets the value of [html][crate::model::instance::HostConfig::html].
381 ///
382 /// # Example
383 /// ```ignore,no_run
384 /// # use google_cloud_securesourcemanager_v1::model::instance::HostConfig;
385 /// let x = HostConfig::new().set_html("example");
386 /// ```
387 pub fn set_html<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
388 self.html = v.into();
389 self
390 }
391
392 /// Sets the value of [api][crate::model::instance::HostConfig::api].
393 ///
394 /// # Example
395 /// ```ignore,no_run
396 /// # use google_cloud_securesourcemanager_v1::model::instance::HostConfig;
397 /// let x = HostConfig::new().set_api("example");
398 /// ```
399 pub fn set_api<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
400 self.api = v.into();
401 self
402 }
403
404 /// Sets the value of [git_http][crate::model::instance::HostConfig::git_http].
405 ///
406 /// # Example
407 /// ```ignore,no_run
408 /// # use google_cloud_securesourcemanager_v1::model::instance::HostConfig;
409 /// let x = HostConfig::new().set_git_http("example");
410 /// ```
411 pub fn set_git_http<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
412 self.git_http = v.into();
413 self
414 }
415
416 /// Sets the value of [git_ssh][crate::model::instance::HostConfig::git_ssh].
417 ///
418 /// # Example
419 /// ```ignore,no_run
420 /// # use google_cloud_securesourcemanager_v1::model::instance::HostConfig;
421 /// let x = HostConfig::new().set_git_ssh("example");
422 /// ```
423 pub fn set_git_ssh<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
424 self.git_ssh = v.into();
425 self
426 }
427 }
428
429 impl wkt::message::Message for HostConfig {
430 fn typename() -> &'static str {
431 "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance.HostConfig"
432 }
433 }
434
435 /// PrivateConfig includes settings for private instance.
436 #[derive(Clone, Default, PartialEq)]
437 #[non_exhaustive]
438 pub struct PrivateConfig {
439 /// Required. Immutable. Indicate if it's private instance.
440 pub is_private: bool,
441
442 /// Optional. Immutable. CA pool resource, resource must in the format of
443 /// `projects/{project}/locations/{location}/caPools/{ca_pool}`.
444 pub ca_pool: std::string::String,
445
446 /// Output only. Service Attachment for HTTP, resource is in the format of
447 /// `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`.
448 pub http_service_attachment: std::string::String,
449
450 /// Output only. Service Attachment for SSH, resource is in the format of
451 /// `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`.
452 pub ssh_service_attachment: std::string::String,
453
454 /// Optional. Additional allowed projects for setting up PSC connections.
455 /// Instance host project is automatically allowed and does not need to be
456 /// included in this list.
457 pub psc_allowed_projects: std::vec::Vec<std::string::String>,
458
459 /// Optional. Custom host config for the instance.
460 pub custom_host_config:
461 std::option::Option<crate::model::instance::private_config::CustomHostConfig>,
462
463 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
464 }
465
466 impl PrivateConfig {
467 pub fn new() -> Self {
468 std::default::Default::default()
469 }
470
471 /// Sets the value of [is_private][crate::model::instance::PrivateConfig::is_private].
472 ///
473 /// # Example
474 /// ```ignore,no_run
475 /// # use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
476 /// let x = PrivateConfig::new().set_is_private(true);
477 /// ```
478 pub fn set_is_private<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
479 self.is_private = v.into();
480 self
481 }
482
483 /// Sets the value of [ca_pool][crate::model::instance::PrivateConfig::ca_pool].
484 ///
485 /// # Example
486 /// ```ignore,no_run
487 /// # use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
488 /// let x = PrivateConfig::new().set_ca_pool("example");
489 /// ```
490 pub fn set_ca_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
491 self.ca_pool = v.into();
492 self
493 }
494
495 /// Sets the value of [http_service_attachment][crate::model::instance::PrivateConfig::http_service_attachment].
496 ///
497 /// # Example
498 /// ```ignore,no_run
499 /// # use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
500 /// let x = PrivateConfig::new().set_http_service_attachment("example");
501 /// ```
502 pub fn set_http_service_attachment<T: std::convert::Into<std::string::String>>(
503 mut self,
504 v: T,
505 ) -> Self {
506 self.http_service_attachment = v.into();
507 self
508 }
509
510 /// Sets the value of [ssh_service_attachment][crate::model::instance::PrivateConfig::ssh_service_attachment].
511 ///
512 /// # Example
513 /// ```ignore,no_run
514 /// # use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
515 /// let x = PrivateConfig::new().set_ssh_service_attachment("example");
516 /// ```
517 pub fn set_ssh_service_attachment<T: std::convert::Into<std::string::String>>(
518 mut self,
519 v: T,
520 ) -> Self {
521 self.ssh_service_attachment = v.into();
522 self
523 }
524
525 /// Sets the value of [psc_allowed_projects][crate::model::instance::PrivateConfig::psc_allowed_projects].
526 ///
527 /// # Example
528 /// ```ignore,no_run
529 /// # use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
530 /// let x = PrivateConfig::new().set_psc_allowed_projects(["a", "b", "c"]);
531 /// ```
532 pub fn set_psc_allowed_projects<T, V>(mut self, v: T) -> Self
533 where
534 T: std::iter::IntoIterator<Item = V>,
535 V: std::convert::Into<std::string::String>,
536 {
537 use std::iter::Iterator;
538 self.psc_allowed_projects = v.into_iter().map(|i| i.into()).collect();
539 self
540 }
541
542 /// Sets the value of [custom_host_config][crate::model::instance::PrivateConfig::custom_host_config].
543 ///
544 /// # Example
545 /// ```ignore,no_run
546 /// # use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
547 /// use google_cloud_securesourcemanager_v1::model::instance::private_config::CustomHostConfig;
548 /// let x = PrivateConfig::new().set_custom_host_config(CustomHostConfig::default()/* use setters */);
549 /// ```
550 pub fn set_custom_host_config<T>(mut self, v: T) -> Self
551 where
552 T: std::convert::Into<crate::model::instance::private_config::CustomHostConfig>,
553 {
554 self.custom_host_config = std::option::Option::Some(v.into());
555 self
556 }
557
558 /// Sets or clears the value of [custom_host_config][crate::model::instance::PrivateConfig::custom_host_config].
559 ///
560 /// # Example
561 /// ```ignore,no_run
562 /// # use google_cloud_securesourcemanager_v1::model::instance::PrivateConfig;
563 /// use google_cloud_securesourcemanager_v1::model::instance::private_config::CustomHostConfig;
564 /// let x = PrivateConfig::new().set_or_clear_custom_host_config(Some(CustomHostConfig::default()/* use setters */));
565 /// let x = PrivateConfig::new().set_or_clear_custom_host_config(None::<CustomHostConfig>);
566 /// ```
567 pub fn set_or_clear_custom_host_config<T>(mut self, v: std::option::Option<T>) -> Self
568 where
569 T: std::convert::Into<crate::model::instance::private_config::CustomHostConfig>,
570 {
571 self.custom_host_config = v.map(|x| x.into());
572 self
573 }
574 }
575
576 impl wkt::message::Message for PrivateConfig {
577 fn typename() -> &'static str {
578 "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance.PrivateConfig"
579 }
580 }
581
582 /// Defines additional types related to [PrivateConfig].
583 pub mod private_config {
584 #[allow(unused_imports)]
585 use super::*;
586
587 /// Custom host config for the instance.
588 #[derive(Clone, Default, PartialEq)]
589 #[non_exhaustive]
590 pub struct CustomHostConfig {
591 /// Required. The custom UI hostname for the instance, e.g.,
592 /// "git.source.internal.mycompany.com"
593 pub html: std::string::String,
594
595 /// Required. The custom API hostname for the instance, e.g.,
596 /// "api.source.internal.mycompany.com"
597 pub api: std::string::String,
598
599 /// Required. The custom git ssh hostname for the instance, e.g.,
600 /// "ssh.source.internal.mycompany.com"
601 pub git_ssh: std::string::String,
602
603 /// Required. The custom git http hostname for the instance, e.g.,
604 /// "git.source.internal.mycompany.com"
605 pub git_http: std::string::String,
606
607 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
608 }
609
610 impl CustomHostConfig {
611 pub fn new() -> Self {
612 std::default::Default::default()
613 }
614
615 /// Sets the value of [html][crate::model::instance::private_config::CustomHostConfig::html].
616 ///
617 /// # Example
618 /// ```ignore,no_run
619 /// # use google_cloud_securesourcemanager_v1::model::instance::private_config::CustomHostConfig;
620 /// let x = CustomHostConfig::new().set_html("example");
621 /// ```
622 pub fn set_html<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
623 self.html = v.into();
624 self
625 }
626
627 /// Sets the value of [api][crate::model::instance::private_config::CustomHostConfig::api].
628 ///
629 /// # Example
630 /// ```ignore,no_run
631 /// # use google_cloud_securesourcemanager_v1::model::instance::private_config::CustomHostConfig;
632 /// let x = CustomHostConfig::new().set_api("example");
633 /// ```
634 pub fn set_api<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
635 self.api = v.into();
636 self
637 }
638
639 /// Sets the value of [git_ssh][crate::model::instance::private_config::CustomHostConfig::git_ssh].
640 ///
641 /// # Example
642 /// ```ignore,no_run
643 /// # use google_cloud_securesourcemanager_v1::model::instance::private_config::CustomHostConfig;
644 /// let x = CustomHostConfig::new().set_git_ssh("example");
645 /// ```
646 pub fn set_git_ssh<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
647 self.git_ssh = v.into();
648 self
649 }
650
651 /// Sets the value of [git_http][crate::model::instance::private_config::CustomHostConfig::git_http].
652 ///
653 /// # Example
654 /// ```ignore,no_run
655 /// # use google_cloud_securesourcemanager_v1::model::instance::private_config::CustomHostConfig;
656 /// let x = CustomHostConfig::new().set_git_http("example");
657 /// ```
658 pub fn set_git_http<T: std::convert::Into<std::string::String>>(
659 mut self,
660 v: T,
661 ) -> Self {
662 self.git_http = v.into();
663 self
664 }
665 }
666
667 impl wkt::message::Message for CustomHostConfig {
668 fn typename() -> &'static str {
669 "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance.PrivateConfig.CustomHostConfig"
670 }
671 }
672 }
673
674 /// WorkforceIdentityFederationConfig allows this instance to support users
675 /// from external identity providers.
676 #[derive(Clone, Default, PartialEq)]
677 #[non_exhaustive]
678 pub struct WorkforceIdentityFederationConfig {
679 /// Optional. Immutable. Whether Workforce Identity Federation is enabled.
680 pub enabled: bool,
681
682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
683 }
684
685 impl WorkforceIdentityFederationConfig {
686 pub fn new() -> Self {
687 std::default::Default::default()
688 }
689
690 /// Sets the value of [enabled][crate::model::instance::WorkforceIdentityFederationConfig::enabled].
691 ///
692 /// # Example
693 /// ```ignore,no_run
694 /// # use google_cloud_securesourcemanager_v1::model::instance::WorkforceIdentityFederationConfig;
695 /// let x = WorkforceIdentityFederationConfig::new().set_enabled(true);
696 /// ```
697 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
698 self.enabled = v.into();
699 self
700 }
701 }
702
703 impl wkt::message::Message for WorkforceIdentityFederationConfig {
704 fn typename() -> &'static str {
705 "type.googleapis.com/google.cloud.securesourcemanager.v1.Instance.WorkforceIdentityFederationConfig"
706 }
707 }
708
709 /// Secure Source Manager instance state.
710 ///
711 /// # Working with unknown values
712 ///
713 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
714 /// additional enum variants at any time. Adding new variants is not considered
715 /// a breaking change. Applications should write their code in anticipation of:
716 ///
717 /// - New values appearing in future releases of the client library, **and**
718 /// - New values received dynamically, without application changes.
719 ///
720 /// Please consult the [Working with enums] section in the user guide for some
721 /// guidelines.
722 ///
723 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
724 #[derive(Clone, Debug, PartialEq)]
725 #[non_exhaustive]
726 pub enum State {
727 /// Not set. This should only be the case for incoming requests.
728 Unspecified,
729 /// Instance is being created.
730 Creating,
731 /// Instance is ready.
732 Active,
733 /// Instance is being deleted.
734 Deleting,
735 /// Instance is paused.
736 Paused,
737 /// Instance is unknown, we are not sure if it's functioning.
738 Unknown,
739 /// If set, the enum was initialized with an unknown value.
740 ///
741 /// Applications can examine the value using [State::value] or
742 /// [State::name].
743 UnknownValue(state::UnknownValue),
744 }
745
746 #[doc(hidden)]
747 pub mod state {
748 #[allow(unused_imports)]
749 use super::*;
750 #[derive(Clone, Debug, PartialEq)]
751 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
752 }
753
754 impl State {
755 /// Gets the enum value.
756 ///
757 /// Returns `None` if the enum contains an unknown value deserialized from
758 /// the string representation of enums.
759 pub fn value(&self) -> std::option::Option<i32> {
760 match self {
761 Self::Unspecified => std::option::Option::Some(0),
762 Self::Creating => std::option::Option::Some(1),
763 Self::Active => std::option::Option::Some(2),
764 Self::Deleting => std::option::Option::Some(3),
765 Self::Paused => std::option::Option::Some(4),
766 Self::Unknown => std::option::Option::Some(6),
767 Self::UnknownValue(u) => u.0.value(),
768 }
769 }
770
771 /// Gets the enum value as a string.
772 ///
773 /// Returns `None` if the enum contains an unknown value deserialized from
774 /// the integer representation of enums.
775 pub fn name(&self) -> std::option::Option<&str> {
776 match self {
777 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
778 Self::Creating => std::option::Option::Some("CREATING"),
779 Self::Active => std::option::Option::Some("ACTIVE"),
780 Self::Deleting => std::option::Option::Some("DELETING"),
781 Self::Paused => std::option::Option::Some("PAUSED"),
782 Self::Unknown => std::option::Option::Some("UNKNOWN"),
783 Self::UnknownValue(u) => u.0.name(),
784 }
785 }
786 }
787
788 impl std::default::Default for State {
789 fn default() -> Self {
790 use std::convert::From;
791 Self::from(0)
792 }
793 }
794
795 impl std::fmt::Display for State {
796 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
797 wkt::internal::display_enum(f, self.name(), self.value())
798 }
799 }
800
801 impl std::convert::From<i32> for State {
802 fn from(value: i32) -> Self {
803 match value {
804 0 => Self::Unspecified,
805 1 => Self::Creating,
806 2 => Self::Active,
807 3 => Self::Deleting,
808 4 => Self::Paused,
809 6 => Self::Unknown,
810 _ => Self::UnknownValue(state::UnknownValue(
811 wkt::internal::UnknownEnumValue::Integer(value),
812 )),
813 }
814 }
815 }
816
817 impl std::convert::From<&str> for State {
818 fn from(value: &str) -> Self {
819 use std::string::ToString;
820 match value {
821 "STATE_UNSPECIFIED" => Self::Unspecified,
822 "CREATING" => Self::Creating,
823 "ACTIVE" => Self::Active,
824 "DELETING" => Self::Deleting,
825 "PAUSED" => Self::Paused,
826 "UNKNOWN" => Self::Unknown,
827 _ => Self::UnknownValue(state::UnknownValue(
828 wkt::internal::UnknownEnumValue::String(value.to_string()),
829 )),
830 }
831 }
832 }
833
834 impl serde::ser::Serialize for State {
835 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
836 where
837 S: serde::Serializer,
838 {
839 match self {
840 Self::Unspecified => serializer.serialize_i32(0),
841 Self::Creating => serializer.serialize_i32(1),
842 Self::Active => serializer.serialize_i32(2),
843 Self::Deleting => serializer.serialize_i32(3),
844 Self::Paused => serializer.serialize_i32(4),
845 Self::Unknown => serializer.serialize_i32(6),
846 Self::UnknownValue(u) => u.0.serialize(serializer),
847 }
848 }
849 }
850
851 impl<'de> serde::de::Deserialize<'de> for State {
852 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
853 where
854 D: serde::Deserializer<'de>,
855 {
856 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
857 ".google.cloud.securesourcemanager.v1.Instance.State",
858 ))
859 }
860 }
861
862 /// Provides information about the current instance state.
863 ///
864 /// # Working with unknown values
865 ///
866 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
867 /// additional enum variants at any time. Adding new variants is not considered
868 /// a breaking change. Applications should write their code in anticipation of:
869 ///
870 /// - New values appearing in future releases of the client library, **and**
871 /// - New values received dynamically, without application changes.
872 ///
873 /// Please consult the [Working with enums] section in the user guide for some
874 /// guidelines.
875 ///
876 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
877 #[derive(Clone, Debug, PartialEq)]
878 #[non_exhaustive]
879 pub enum StateNote {
880 /// STATE_NOTE_UNSPECIFIED as the first value of State.
881 Unspecified,
882 /// CMEK access is unavailable.
883 PausedCmekUnavailable,
884 /// INSTANCE_RESUMING indicates that the instance was previously paused
885 /// and is under the process of being brought back.
886 #[deprecated]
887 InstanceResuming,
888 /// If set, the enum was initialized with an unknown value.
889 ///
890 /// Applications can examine the value using [StateNote::value] or
891 /// [StateNote::name].
892 UnknownValue(state_note::UnknownValue),
893 }
894
895 #[doc(hidden)]
896 pub mod state_note {
897 #[allow(unused_imports)]
898 use super::*;
899 #[derive(Clone, Debug, PartialEq)]
900 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
901 }
902
903 impl StateNote {
904 /// Gets the enum value.
905 ///
906 /// Returns `None` if the enum contains an unknown value deserialized from
907 /// the string representation of enums.
908 pub fn value(&self) -> std::option::Option<i32> {
909 match self {
910 Self::Unspecified => std::option::Option::Some(0),
911 Self::PausedCmekUnavailable => std::option::Option::Some(1),
912 Self::InstanceResuming => std::option::Option::Some(2),
913 Self::UnknownValue(u) => u.0.value(),
914 }
915 }
916
917 /// Gets the enum value as a string.
918 ///
919 /// Returns `None` if the enum contains an unknown value deserialized from
920 /// the integer representation of enums.
921 pub fn name(&self) -> std::option::Option<&str> {
922 match self {
923 Self::Unspecified => std::option::Option::Some("STATE_NOTE_UNSPECIFIED"),
924 Self::PausedCmekUnavailable => std::option::Option::Some("PAUSED_CMEK_UNAVAILABLE"),
925 Self::InstanceResuming => std::option::Option::Some("INSTANCE_RESUMING"),
926 Self::UnknownValue(u) => u.0.name(),
927 }
928 }
929 }
930
931 impl std::default::Default for StateNote {
932 fn default() -> Self {
933 use std::convert::From;
934 Self::from(0)
935 }
936 }
937
938 impl std::fmt::Display for StateNote {
939 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
940 wkt::internal::display_enum(f, self.name(), self.value())
941 }
942 }
943
944 impl std::convert::From<i32> for StateNote {
945 fn from(value: i32) -> Self {
946 match value {
947 0 => Self::Unspecified,
948 1 => Self::PausedCmekUnavailable,
949 2 => Self::InstanceResuming,
950 _ => Self::UnknownValue(state_note::UnknownValue(
951 wkt::internal::UnknownEnumValue::Integer(value),
952 )),
953 }
954 }
955 }
956
957 impl std::convert::From<&str> for StateNote {
958 fn from(value: &str) -> Self {
959 use std::string::ToString;
960 match value {
961 "STATE_NOTE_UNSPECIFIED" => Self::Unspecified,
962 "PAUSED_CMEK_UNAVAILABLE" => Self::PausedCmekUnavailable,
963 "INSTANCE_RESUMING" => Self::InstanceResuming,
964 _ => Self::UnknownValue(state_note::UnknownValue(
965 wkt::internal::UnknownEnumValue::String(value.to_string()),
966 )),
967 }
968 }
969 }
970
971 impl serde::ser::Serialize for StateNote {
972 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
973 where
974 S: serde::Serializer,
975 {
976 match self {
977 Self::Unspecified => serializer.serialize_i32(0),
978 Self::PausedCmekUnavailable => serializer.serialize_i32(1),
979 Self::InstanceResuming => serializer.serialize_i32(2),
980 Self::UnknownValue(u) => u.0.serialize(serializer),
981 }
982 }
983 }
984
985 impl<'de> serde::de::Deserialize<'de> for StateNote {
986 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
987 where
988 D: serde::Deserializer<'de>,
989 {
990 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StateNote>::new(
991 ".google.cloud.securesourcemanager.v1.Instance.StateNote",
992 ))
993 }
994 }
995}
996
997/// Metadata of a Secure Source Manager repository.
998#[derive(Clone, Default, PartialEq)]
999#[non_exhaustive]
1000pub struct Repository {
1001 /// Identifier. A unique identifier for a repository. The name should be of the
1002 /// format:
1003 /// `projects/{project}/locations/{location_id}/repositories/{repository_id}`
1004 pub name: std::string::String,
1005
1006 /// Optional. Description of the repository, which cannot exceed 500
1007 /// characters.
1008 pub description: std::string::String,
1009
1010 /// Optional. The name of the instance in which the repository is hosted,
1011 /// formatted as
1012 /// `projects/{project_number}/locations/{location_id}/instances/{instance_id}`
1013 /// When creating repository via securesourcemanager.googleapis.com, this field
1014 /// is used as input. When creating repository via *.sourcemanager.dev, this
1015 /// field is output only.
1016 pub instance: std::string::String,
1017
1018 /// Output only. Unique identifier of the repository.
1019 pub uid: std::string::String,
1020
1021 /// Output only. Create timestamp.
1022 pub create_time: std::option::Option<wkt::Timestamp>,
1023
1024 /// Output only. Update timestamp.
1025 pub update_time: std::option::Option<wkt::Timestamp>,
1026
1027 /// Optional. This checksum is computed by the server based on the value of
1028 /// other fields, and may be sent on update and delete requests to ensure the
1029 /// client has an up-to-date value before proceeding.
1030 pub etag: std::string::String,
1031
1032 /// Output only. URIs for the repository.
1033 pub uris: std::option::Option<crate::model::repository::URIs>,
1034
1035 /// Input only. Initial configurations for the repository.
1036 pub initial_config: std::option::Option<crate::model::repository::InitialConfig>,
1037
1038 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1039}
1040
1041impl Repository {
1042 pub fn new() -> Self {
1043 std::default::Default::default()
1044 }
1045
1046 /// Sets the value of [name][crate::model::Repository::name].
1047 ///
1048 /// # Example
1049 /// ```ignore,no_run
1050 /// # use google_cloud_securesourcemanager_v1::model::Repository;
1051 /// let x = Repository::new().set_name("example");
1052 /// ```
1053 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1054 self.name = v.into();
1055 self
1056 }
1057
1058 /// Sets the value of [description][crate::model::Repository::description].
1059 ///
1060 /// # Example
1061 /// ```ignore,no_run
1062 /// # use google_cloud_securesourcemanager_v1::model::Repository;
1063 /// let x = Repository::new().set_description("example");
1064 /// ```
1065 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1066 self.description = v.into();
1067 self
1068 }
1069
1070 /// Sets the value of [instance][crate::model::Repository::instance].
1071 ///
1072 /// # Example
1073 /// ```ignore,no_run
1074 /// # use google_cloud_securesourcemanager_v1::model::Repository;
1075 /// let x = Repository::new().set_instance("example");
1076 /// ```
1077 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1078 self.instance = v.into();
1079 self
1080 }
1081
1082 /// Sets the value of [uid][crate::model::Repository::uid].
1083 ///
1084 /// # Example
1085 /// ```ignore,no_run
1086 /// # use google_cloud_securesourcemanager_v1::model::Repository;
1087 /// let x = Repository::new().set_uid("example");
1088 /// ```
1089 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1090 self.uid = v.into();
1091 self
1092 }
1093
1094 /// Sets the value of [create_time][crate::model::Repository::create_time].
1095 ///
1096 /// # Example
1097 /// ```ignore,no_run
1098 /// # use google_cloud_securesourcemanager_v1::model::Repository;
1099 /// use wkt::Timestamp;
1100 /// let x = Repository::new().set_create_time(Timestamp::default()/* use setters */);
1101 /// ```
1102 pub fn set_create_time<T>(mut self, v: T) -> Self
1103 where
1104 T: std::convert::Into<wkt::Timestamp>,
1105 {
1106 self.create_time = std::option::Option::Some(v.into());
1107 self
1108 }
1109
1110 /// Sets or clears the value of [create_time][crate::model::Repository::create_time].
1111 ///
1112 /// # Example
1113 /// ```ignore,no_run
1114 /// # use google_cloud_securesourcemanager_v1::model::Repository;
1115 /// use wkt::Timestamp;
1116 /// let x = Repository::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1117 /// let x = Repository::new().set_or_clear_create_time(None::<Timestamp>);
1118 /// ```
1119 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1120 where
1121 T: std::convert::Into<wkt::Timestamp>,
1122 {
1123 self.create_time = v.map(|x| x.into());
1124 self
1125 }
1126
1127 /// Sets the value of [update_time][crate::model::Repository::update_time].
1128 ///
1129 /// # Example
1130 /// ```ignore,no_run
1131 /// # use google_cloud_securesourcemanager_v1::model::Repository;
1132 /// use wkt::Timestamp;
1133 /// let x = Repository::new().set_update_time(Timestamp::default()/* use setters */);
1134 /// ```
1135 pub fn set_update_time<T>(mut self, v: T) -> Self
1136 where
1137 T: std::convert::Into<wkt::Timestamp>,
1138 {
1139 self.update_time = std::option::Option::Some(v.into());
1140 self
1141 }
1142
1143 /// Sets or clears the value of [update_time][crate::model::Repository::update_time].
1144 ///
1145 /// # Example
1146 /// ```ignore,no_run
1147 /// # use google_cloud_securesourcemanager_v1::model::Repository;
1148 /// use wkt::Timestamp;
1149 /// let x = Repository::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1150 /// let x = Repository::new().set_or_clear_update_time(None::<Timestamp>);
1151 /// ```
1152 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1153 where
1154 T: std::convert::Into<wkt::Timestamp>,
1155 {
1156 self.update_time = v.map(|x| x.into());
1157 self
1158 }
1159
1160 /// Sets the value of [etag][crate::model::Repository::etag].
1161 ///
1162 /// # Example
1163 /// ```ignore,no_run
1164 /// # use google_cloud_securesourcemanager_v1::model::Repository;
1165 /// let x = Repository::new().set_etag("example");
1166 /// ```
1167 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1168 self.etag = v.into();
1169 self
1170 }
1171
1172 /// Sets the value of [uris][crate::model::Repository::uris].
1173 ///
1174 /// # Example
1175 /// ```ignore,no_run
1176 /// # use google_cloud_securesourcemanager_v1::model::Repository;
1177 /// use google_cloud_securesourcemanager_v1::model::repository::URIs;
1178 /// let x = Repository::new().set_uris(URIs::default()/* use setters */);
1179 /// ```
1180 pub fn set_uris<T>(mut self, v: T) -> Self
1181 where
1182 T: std::convert::Into<crate::model::repository::URIs>,
1183 {
1184 self.uris = std::option::Option::Some(v.into());
1185 self
1186 }
1187
1188 /// Sets or clears the value of [uris][crate::model::Repository::uris].
1189 ///
1190 /// # Example
1191 /// ```ignore,no_run
1192 /// # use google_cloud_securesourcemanager_v1::model::Repository;
1193 /// use google_cloud_securesourcemanager_v1::model::repository::URIs;
1194 /// let x = Repository::new().set_or_clear_uris(Some(URIs::default()/* use setters */));
1195 /// let x = Repository::new().set_or_clear_uris(None::<URIs>);
1196 /// ```
1197 pub fn set_or_clear_uris<T>(mut self, v: std::option::Option<T>) -> Self
1198 where
1199 T: std::convert::Into<crate::model::repository::URIs>,
1200 {
1201 self.uris = v.map(|x| x.into());
1202 self
1203 }
1204
1205 /// Sets the value of [initial_config][crate::model::Repository::initial_config].
1206 ///
1207 /// # Example
1208 /// ```ignore,no_run
1209 /// # use google_cloud_securesourcemanager_v1::model::Repository;
1210 /// use google_cloud_securesourcemanager_v1::model::repository::InitialConfig;
1211 /// let x = Repository::new().set_initial_config(InitialConfig::default()/* use setters */);
1212 /// ```
1213 pub fn set_initial_config<T>(mut self, v: T) -> Self
1214 where
1215 T: std::convert::Into<crate::model::repository::InitialConfig>,
1216 {
1217 self.initial_config = std::option::Option::Some(v.into());
1218 self
1219 }
1220
1221 /// Sets or clears the value of [initial_config][crate::model::Repository::initial_config].
1222 ///
1223 /// # Example
1224 /// ```ignore,no_run
1225 /// # use google_cloud_securesourcemanager_v1::model::Repository;
1226 /// use google_cloud_securesourcemanager_v1::model::repository::InitialConfig;
1227 /// let x = Repository::new().set_or_clear_initial_config(Some(InitialConfig::default()/* use setters */));
1228 /// let x = Repository::new().set_or_clear_initial_config(None::<InitialConfig>);
1229 /// ```
1230 pub fn set_or_clear_initial_config<T>(mut self, v: std::option::Option<T>) -> Self
1231 where
1232 T: std::convert::Into<crate::model::repository::InitialConfig>,
1233 {
1234 self.initial_config = v.map(|x| x.into());
1235 self
1236 }
1237}
1238
1239impl wkt::message::Message for Repository {
1240 fn typename() -> &'static str {
1241 "type.googleapis.com/google.cloud.securesourcemanager.v1.Repository"
1242 }
1243}
1244
1245/// Defines additional types related to [Repository].
1246pub mod repository {
1247 #[allow(unused_imports)]
1248 use super::*;
1249
1250 /// URIs for the repository.
1251 #[derive(Clone, Default, PartialEq)]
1252 #[non_exhaustive]
1253 pub struct URIs {
1254 /// Output only. HTML is the URI for user to view the repository in a
1255 /// browser.
1256 pub html: std::string::String,
1257
1258 /// Output only. git_https is the git HTTPS URI for git operations.
1259 pub git_https: std::string::String,
1260
1261 /// Output only. API is the URI for API access.
1262 pub api: std::string::String,
1263
1264 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1265 }
1266
1267 impl URIs {
1268 pub fn new() -> Self {
1269 std::default::Default::default()
1270 }
1271
1272 /// Sets the value of [html][crate::model::repository::URIs::html].
1273 ///
1274 /// # Example
1275 /// ```ignore,no_run
1276 /// # use google_cloud_securesourcemanager_v1::model::repository::URIs;
1277 /// let x = URIs::new().set_html("example");
1278 /// ```
1279 pub fn set_html<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1280 self.html = v.into();
1281 self
1282 }
1283
1284 /// Sets the value of [git_https][crate::model::repository::URIs::git_https].
1285 ///
1286 /// # Example
1287 /// ```ignore,no_run
1288 /// # use google_cloud_securesourcemanager_v1::model::repository::URIs;
1289 /// let x = URIs::new().set_git_https("example");
1290 /// ```
1291 pub fn set_git_https<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1292 self.git_https = v.into();
1293 self
1294 }
1295
1296 /// Sets the value of [api][crate::model::repository::URIs::api].
1297 ///
1298 /// # Example
1299 /// ```ignore,no_run
1300 /// # use google_cloud_securesourcemanager_v1::model::repository::URIs;
1301 /// let x = URIs::new().set_api("example");
1302 /// ```
1303 pub fn set_api<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1304 self.api = v.into();
1305 self
1306 }
1307 }
1308
1309 impl wkt::message::Message for URIs {
1310 fn typename() -> &'static str {
1311 "type.googleapis.com/google.cloud.securesourcemanager.v1.Repository.URIs"
1312 }
1313 }
1314
1315 /// Repository initialization configuration.
1316 #[derive(Clone, Default, PartialEq)]
1317 #[non_exhaustive]
1318 pub struct InitialConfig {
1319 /// Default branch name of the repository.
1320 pub default_branch: std::string::String,
1321
1322 /// List of gitignore template names user can choose from.
1323 /// Valid values: actionscript, ada, agda, android,
1324 /// anjuta, ansible, appcelerator-titanium, app-engine, archives,
1325 /// arch-linux-packages, atmel-studio, autotools, backup, bazaar, bazel,
1326 /// bitrix, bricx-cc, c, cake-php, calabash, cf-wheels, chef-cookbook,
1327 /// clojure, cloud9, c-make, code-igniter, code-kit, code-sniffer,
1328 /// common-lisp, composer, concrete5, coq, cordova, cpp, craft-cms, cuda,
1329 /// cvs, d, dart, dart-editor, delphi, diff, dm, dreamweaver, dropbox,
1330 /// drupal, drupal-7, eagle, eclipse, eiffel-studio, elisp, elixir, elm,
1331 /// emacs, ensime, epi-server, erlang, esp-idf, espresso, exercism,
1332 /// expression-engine, ext-js, fancy, finale, flex-builder, force-dot-com,
1333 /// fortran, fuel-php, gcov, git-book, gnome-shell-extension, go, godot, gpg,
1334 /// gradle, grails, gwt, haskell, hugo, iar-ewarm, idris, igor-pro, images,
1335 /// infor-cms, java, jboss, jboss-4, jboss-6, jdeveloper, jekyll,
1336 /// jenkins-home, jenv, jet-brains, jigsaw, joomla, julia, jupyter-notebooks,
1337 /// kate, kdevelop4, kentico, ki-cad, kohana, kotlin, lab-view, laravel,
1338 /// lazarus, leiningen, lemon-stand, libre-office, lilypond, linux, lithium,
1339 /// logtalk, lua, lyx, mac-os, magento, magento-1, magento-2, matlab, maven,
1340 /// mercurial, mercury, metals, meta-programming-system, meteor,
1341 /// microsoft-office, model-sim, momentics, mono-develop, nanoc, net-beans,
1342 /// nikola, nim, ninja, node, notepad-pp, nwjs, objective--c, ocaml, octave,
1343 /// opa, open-cart, openssl, oracle-forms, otto, packer, patch, perl, perl6,
1344 /// phalcon, phoenix, pimcore, play-framework, plone, prestashop, processing,
1345 /// psoc-creator, puppet, pure-script, putty, python, qooxdoo, qt, r, racket,
1346 /// rails, raku, red, redcar, redis, rhodes-rhomobile, ros, ruby, rust, sam,
1347 /// sass, sbt, scala, scheme, scons, scrivener, sdcc, seam-gen, sketch-up,
1348 /// slick-edit, smalltalk, snap, splunk, stata, stella, sublime-text,
1349 /// sugar-crm, svn, swift, symfony, symphony-cms, synopsys-vcs, tags,
1350 /// terraform, tex, text-mate, textpattern, think-php, tortoise-git,
1351 /// turbo-gears-2, typo3, umbraco, unity, unreal-engine, vagrant, vim,
1352 /// virtual-env, virtuoso, visual-studio, visual-studio-code, vue, vvvv, waf,
1353 /// web-methods, windows, word-press, xcode, xilinx, xilinx-ise, xojo,
1354 /// yeoman, yii, zend-framework, zephir.
1355 pub gitignores: std::vec::Vec<std::string::String>,
1356
1357 /// License template name user can choose from.
1358 /// Valid values: license-0bsd, license-389-exception, aal, abstyles,
1359 /// adobe-2006, adobe-glyph, adsl, afl-1-1, afl-1-2, afl-2-0, afl-2-1,
1360 /// afl-3-0, afmparse, agpl-1-0, agpl-1-0-only, agpl-1-0-or-later,
1361 /// agpl-3-0-only, agpl-3-0-or-later, aladdin, amdplpa, aml, ampas, antlr-pd,
1362 /// antlr-pd-fallback, apache-1-0, apache-1-1, apache-2-0, apafml, apl-1-0,
1363 /// apsl-1-0, apsl-1-1, apsl-1-2, apsl-2-0, artistic-1-0, artistic-1-0-cl8,
1364 /// artistic-1-0-perl, artistic-2-0, autoconf-exception-2-0,
1365 /// autoconf-exception-3-0, bahyph, barr, beerware, bison-exception-2-2,
1366 /// bittorrent-1-0, bittorrent-1-1, blessing, blueoak-1-0-0,
1367 /// bootloader-exception, borceux, bsd-1-clause, bsd-2-clause,
1368 /// bsd-2-clause-freebsd, bsd-2-clause-netbsd, bsd-2-clause-patent,
1369 /// bsd-2-clause-views, bsd-3-clause, bsd-3-clause-attribution,
1370 /// bsd-3-clause-clear, bsd-3-clause-lbnl, bsd-3-clause-modification,
1371 /// bsd-3-clause-no-nuclear-license, bsd-3-clause-no-nuclear-license-2014,
1372 /// bsd-3-clause-no-nuclear-warranty, bsd-3-clause-open-mpi, bsd-4-clause,
1373 /// bsd-4-clause-shortened, bsd-4-clause-uc, bsd-protection, bsd-source-code,
1374 /// bsl-1-0, busl-1-1, cal-1-0, cal-1-0-combined-work-exception, caldera,
1375 /// catosl-1-1, cc0-1-0, cc-by-1-0, cc-by-2-0, cc-by-3-0, cc-by-3-0-at,
1376 /// cc-by-3-0-us, cc-by-4-0, cc-by-nc-1-0, cc-by-nc-2-0, cc-by-nc-3-0,
1377 /// cc-by-nc-4-0, cc-by-nc-nd-1-0, cc-by-nc-nd-2-0, cc-by-nc-nd-3-0,
1378 /// cc-by-nc-nd-3-0-igo, cc-by-nc-nd-4-0, cc-by-nc-sa-1-0, cc-by-nc-sa-2-0,
1379 /// cc-by-nc-sa-3-0, cc-by-nc-sa-4-0, cc-by-nd-1-0, cc-by-nd-2-0,
1380 /// cc-by-nd-3-0, cc-by-nd-4-0, cc-by-sa-1-0, cc-by-sa-2-0, cc-by-sa-2-0-uk,
1381 /// cc-by-sa-2-1-jp, cc-by-sa-3-0, cc-by-sa-3-0-at, cc-by-sa-4-0, cc-pddc,
1382 /// cddl-1-0, cddl-1-1, cdla-permissive-1-0, cdla-sharing-1-0, cecill-1-0,
1383 /// cecill-1-1, cecill-2-0, cecill-2-1, cecill-b, cecill-c, cern-ohl-1-1,
1384 /// cern-ohl-1-2, cern-ohl-p-2-0, cern-ohl-s-2-0, cern-ohl-w-2-0, clartistic,
1385 /// classpath-exception-2-0, clisp-exception-2-0, cnri-jython, cnri-python,
1386 /// cnri-python-gpl-compatible, condor-1-1, copyleft-next-0-3-0,
1387 /// copyleft-next-0-3-1, cpal-1-0, cpl-1-0, cpol-1-02, crossword,
1388 /// crystal-stacker, cua-opl-1-0, cube, c-uda-1-0, curl, d-fsl-1-0, diffmark,
1389 /// digirule-foss-exception, doc, dotseqn, drl-1-0, dsdp, dvipdfm, ecl-1-0,
1390 /// ecl-2-0, ecos-exception-2-0, efl-1-0, efl-2-0, egenix, entessa, epics,
1391 /// epl-1-0, epl-2-0, erlpl-1-1, etalab-2-0, eu-datagrid, eupl-1-0, eupl-1-1,
1392 /// eupl-1-2, eurosym, fair, fawkes-runtime-exception, fltk-exception,
1393 /// font-exception-2-0, frameworx-1-0, freebsd-doc, freeimage,
1394 /// freertos-exception-2-0, fsfap, fsful, fsfullr, ftl, gcc-exception-2-0,
1395 /// gcc-exception-3-1, gd, gfdl-1-1-invariants-only,
1396 /// gfdl-1-1-invariants-or-later, gfdl-1-1-no-invariants-only,
1397 /// gfdl-1-1-no-invariants-or-later, gfdl-1-1-only, gfdl-1-1-or-later,
1398 /// gfdl-1-2-invariants-only, gfdl-1-2-invariants-or-later,
1399 /// gfdl-1-2-no-invariants-only, gfdl-1-2-no-invariants-or-later,
1400 /// gfdl-1-2-only, gfdl-1-2-or-later, gfdl-1-3-invariants-only,
1401 /// gfdl-1-3-invariants-or-later, gfdl-1-3-no-invariants-only,
1402 /// gfdl-1-3-no-invariants-or-later, gfdl-1-3-only, gfdl-1-3-or-later,
1403 /// giftware, gl2ps, glide, glulxe, glwtpl, gnu-javamail-exception, gnuplot,
1404 /// gpl-1-0-only, gpl-1-0-or-later, gpl-2-0-only, gpl-2-0-or-later,
1405 /// gpl-3-0-linking-exception, gpl-3-0-linking-source-exception,
1406 /// gpl-3-0-only, gpl-3-0-or-later, gpl-cc-1-0, gsoap-1-3b, haskell-report,
1407 /// hippocratic-2-1, hpnd, hpnd-sell-variant, htmltidy,
1408 /// i2p-gpl-java-exception, ibm-pibs, icu, ijg, image-magick, imatix, imlib2,
1409 /// info-zip, intel, intel-acpi, interbase-1-0, ipa, ipl-1-0, isc,
1410 /// jasper-2-0, jpnic, json, lal-1-2, lal-1-3, latex2e, leptonica,
1411 /// lgpl-2-0-only, lgpl-2-0-or-later, lgpl-2-1-only, lgpl-2-1-or-later,
1412 /// lgpl-3-0-linking-exception, lgpl-3-0-only, lgpl-3-0-or-later, lgpllr,
1413 /// libpng, libpng-2-0, libselinux-1-0, libtiff, libtool-exception,
1414 /// liliq-p-1-1, liliq-r-1-1, liliq-rplus-1-1, linux-openib,
1415 /// linux-syscall-note, llvm-exception, lpl-1-0, lpl-1-02, lppl-1-0,
1416 /// lppl-1-1, lppl-1-2, lppl-1-3a, lppl-1-3c, lzma-exception, make-index,
1417 /// mif-exception, miros, mit, mit-0, mit-advertising, mit-cmu, mit-enna,
1418 /// mit-feh, mit-modern-variant, mitnfa, mit-open-group, motosoto, mpich2,
1419 /// mpl-1-0, mpl-1-1, mpl-2-0, mpl-2-0-no-copyleft-exception, ms-pl, ms-rl,
1420 /// mtll, mulanpsl-1-0, mulanpsl-2-0, multics, mup, naist-2003, nasa-1-3,
1421 /// naumen, nbpl-1-0, ncgl-uk-2-0, ncsa, netcdf, net-snmp, newsletr, ngpl,
1422 /// nist-pd, nist-pd-fallback, nlod-1-0, nlpl, nokia, nokia-qt-exception-1-1,
1423 /// nosl, noweb, npl-1-0, npl-1-1, nposl-3-0, nrl, ntp, ntp-0,
1424 /// ocaml-lgpl-linking-exception, occt-exception-1-0, occt-pl, oclc-2-0,
1425 /// odbl-1-0, odc-by-1-0, ofl-1-0, ofl-1-0-no-rfn, ofl-1-0-rfn, ofl-1-1,
1426 /// ofl-1-1-no-rfn, ofl-1-1-rfn, ogc-1-0, ogdl-taiwan-1-0, ogl-canada-2-0,
1427 /// ogl-uk-1-0, ogl-uk-2-0, ogl-uk-3-0, ogtsl, oldap-1-1, oldap-1-2,
1428 /// oldap-1-3, oldap-1-4, oldap-2-0, oldap-2-0-1, oldap-2-1, oldap-2-2,
1429 /// oldap-2-2-1, oldap-2-2-2, oldap-2-3, oldap-2-4, oldap-2-7, oml,
1430 /// openjdk-assembly-exception-1-0, openssl, openvpn-openssl-exception,
1431 /// opl-1-0, oset-pl-2-1, osl-1-0, osl-1-1, osl-2-0, osl-2-1, osl-3-0,
1432 /// o-uda-1-0, parity-6-0-0, parity-7-0-0, pddl-1-0, php-3-0, php-3-01,
1433 /// plexus, polyform-noncommercial-1-0-0, polyform-small-business-1-0-0,
1434 /// postgresql, psf-2-0, psfrag, ps-or-pdf-font-exception-20170817, psutils,
1435 /// python-2-0, qhull, qpl-1-0, qt-gpl-exception-1-0, qt-lgpl-exception-1-1,
1436 /// qwt-exception-1-0, rdisc, rhecos-1-1, rpl-1-1, rpsl-1-0, rsa-md, rscpl,
1437 /// ruby, saxpath, sax-pd, scea, sendmail, sendmail-8-23, sgi-b-1-0,
1438 /// sgi-b-1-1, sgi-b-2-0, shl-0-51, shl-2-0, shl-2-1, simpl-2-0, sissl,
1439 /// sissl-1-2, sleepycat, smlnj, smppl, snia, spencer-86, spencer-94,
1440 /// spencer-99, spl-1-0, ssh-openssh, ssh-short, sspl-1-0, sugarcrm-1-1-3,
1441 /// swift-exception, swl, tapr-ohl-1-0, tcl, tcp-wrappers, tmate, torque-1-1,
1442 /// tosl, tu-berlin-1-0, tu-berlin-2-0, u-boot-exception-2-0, ucl-1-0,
1443 /// unicode-dfs-2015, unicode-dfs-2016, unicode-tou,
1444 /// universal-foss-exception-1-0, unlicense, upl-1-0, vim, vostrom, vsl-1-0,
1445 /// w3c, w3c-19980720, w3c-20150513, watcom-1-0, wsuipa, wtfpl,
1446 /// wxwindows-exception-3-1, x11, xerox, xfree86-1-1, xinetd, xnet, xpp,
1447 /// xskat, ypl-1-0, ypl-1-1, zed, zend-2-0, zimbra-1-3, zimbra-1-4, zlib,
1448 /// zlib-acknowledgement, zpl-1-1, zpl-2-0, zpl-2-1.
1449 pub license: std::string::String,
1450
1451 /// README template name.
1452 /// Valid template name(s) are: default.
1453 pub readme: std::string::String,
1454
1455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1456 }
1457
1458 impl InitialConfig {
1459 pub fn new() -> Self {
1460 std::default::Default::default()
1461 }
1462
1463 /// Sets the value of [default_branch][crate::model::repository::InitialConfig::default_branch].
1464 ///
1465 /// # Example
1466 /// ```ignore,no_run
1467 /// # use google_cloud_securesourcemanager_v1::model::repository::InitialConfig;
1468 /// let x = InitialConfig::new().set_default_branch("example");
1469 /// ```
1470 pub fn set_default_branch<T: std::convert::Into<std::string::String>>(
1471 mut self,
1472 v: T,
1473 ) -> Self {
1474 self.default_branch = v.into();
1475 self
1476 }
1477
1478 /// Sets the value of [gitignores][crate::model::repository::InitialConfig::gitignores].
1479 ///
1480 /// # Example
1481 /// ```ignore,no_run
1482 /// # use google_cloud_securesourcemanager_v1::model::repository::InitialConfig;
1483 /// let x = InitialConfig::new().set_gitignores(["a", "b", "c"]);
1484 /// ```
1485 pub fn set_gitignores<T, V>(mut self, v: T) -> Self
1486 where
1487 T: std::iter::IntoIterator<Item = V>,
1488 V: std::convert::Into<std::string::String>,
1489 {
1490 use std::iter::Iterator;
1491 self.gitignores = v.into_iter().map(|i| i.into()).collect();
1492 self
1493 }
1494
1495 /// Sets the value of [license][crate::model::repository::InitialConfig::license].
1496 ///
1497 /// # Example
1498 /// ```ignore,no_run
1499 /// # use google_cloud_securesourcemanager_v1::model::repository::InitialConfig;
1500 /// let x = InitialConfig::new().set_license("example");
1501 /// ```
1502 pub fn set_license<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1503 self.license = v.into();
1504 self
1505 }
1506
1507 /// Sets the value of [readme][crate::model::repository::InitialConfig::readme].
1508 ///
1509 /// # Example
1510 /// ```ignore,no_run
1511 /// # use google_cloud_securesourcemanager_v1::model::repository::InitialConfig;
1512 /// let x = InitialConfig::new().set_readme("example");
1513 /// ```
1514 pub fn set_readme<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1515 self.readme = v.into();
1516 self
1517 }
1518 }
1519
1520 impl wkt::message::Message for InitialConfig {
1521 fn typename() -> &'static str {
1522 "type.googleapis.com/google.cloud.securesourcemanager.v1.Repository.InitialConfig"
1523 }
1524 }
1525}
1526
1527/// Metadata of a Secure Source Manager Hook.
1528#[derive(Clone, Default, PartialEq)]
1529#[non_exhaustive]
1530pub struct Hook {
1531 /// Identifier. A unique identifier for a Hook. The name should be of the
1532 /// format:
1533 /// `projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`
1534 pub name: std::string::String,
1535
1536 /// Required. The target URI to which the payloads will be delivered.
1537 pub target_uri: std::string::String,
1538
1539 /// Optional. Determines if the hook disabled or not.
1540 /// Set to true to stop sending traffic.
1541 pub disabled: bool,
1542
1543 /// Optional. The events that trigger hook on.
1544 pub events: std::vec::Vec<crate::model::hook::HookEventType>,
1545
1546 /// Output only. Create timestamp.
1547 pub create_time: std::option::Option<wkt::Timestamp>,
1548
1549 /// Output only. Update timestamp.
1550 pub update_time: std::option::Option<wkt::Timestamp>,
1551
1552 /// Output only. Unique identifier of the hook.
1553 pub uid: std::string::String,
1554
1555 /// Optional. The trigger option for push events.
1556 pub push_option: std::option::Option<crate::model::hook::PushOption>,
1557
1558 /// Optional. The sensitive query string to be appended to the target URI.
1559 pub sensitive_query_string: std::string::String,
1560
1561 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1562}
1563
1564impl Hook {
1565 pub fn new() -> Self {
1566 std::default::Default::default()
1567 }
1568
1569 /// Sets the value of [name][crate::model::Hook::name].
1570 ///
1571 /// # Example
1572 /// ```ignore,no_run
1573 /// # use google_cloud_securesourcemanager_v1::model::Hook;
1574 /// let x = Hook::new().set_name("example");
1575 /// ```
1576 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1577 self.name = v.into();
1578 self
1579 }
1580
1581 /// Sets the value of [target_uri][crate::model::Hook::target_uri].
1582 ///
1583 /// # Example
1584 /// ```ignore,no_run
1585 /// # use google_cloud_securesourcemanager_v1::model::Hook;
1586 /// let x = Hook::new().set_target_uri("example");
1587 /// ```
1588 pub fn set_target_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1589 self.target_uri = v.into();
1590 self
1591 }
1592
1593 /// Sets the value of [disabled][crate::model::Hook::disabled].
1594 ///
1595 /// # Example
1596 /// ```ignore,no_run
1597 /// # use google_cloud_securesourcemanager_v1::model::Hook;
1598 /// let x = Hook::new().set_disabled(true);
1599 /// ```
1600 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1601 self.disabled = v.into();
1602 self
1603 }
1604
1605 /// Sets the value of [events][crate::model::Hook::events].
1606 ///
1607 /// # Example
1608 /// ```ignore,no_run
1609 /// # use google_cloud_securesourcemanager_v1::model::Hook;
1610 /// use google_cloud_securesourcemanager_v1::model::hook::HookEventType;
1611 /// let x = Hook::new().set_events([
1612 /// HookEventType::Push,
1613 /// HookEventType::PullRequest,
1614 /// ]);
1615 /// ```
1616 pub fn set_events<T, V>(mut self, v: T) -> Self
1617 where
1618 T: std::iter::IntoIterator<Item = V>,
1619 V: std::convert::Into<crate::model::hook::HookEventType>,
1620 {
1621 use std::iter::Iterator;
1622 self.events = v.into_iter().map(|i| i.into()).collect();
1623 self
1624 }
1625
1626 /// Sets the value of [create_time][crate::model::Hook::create_time].
1627 ///
1628 /// # Example
1629 /// ```ignore,no_run
1630 /// # use google_cloud_securesourcemanager_v1::model::Hook;
1631 /// use wkt::Timestamp;
1632 /// let x = Hook::new().set_create_time(Timestamp::default()/* use setters */);
1633 /// ```
1634 pub fn set_create_time<T>(mut self, v: T) -> Self
1635 where
1636 T: std::convert::Into<wkt::Timestamp>,
1637 {
1638 self.create_time = std::option::Option::Some(v.into());
1639 self
1640 }
1641
1642 /// Sets or clears the value of [create_time][crate::model::Hook::create_time].
1643 ///
1644 /// # Example
1645 /// ```ignore,no_run
1646 /// # use google_cloud_securesourcemanager_v1::model::Hook;
1647 /// use wkt::Timestamp;
1648 /// let x = Hook::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1649 /// let x = Hook::new().set_or_clear_create_time(None::<Timestamp>);
1650 /// ```
1651 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1652 where
1653 T: std::convert::Into<wkt::Timestamp>,
1654 {
1655 self.create_time = v.map(|x| x.into());
1656 self
1657 }
1658
1659 /// Sets the value of [update_time][crate::model::Hook::update_time].
1660 ///
1661 /// # Example
1662 /// ```ignore,no_run
1663 /// # use google_cloud_securesourcemanager_v1::model::Hook;
1664 /// use wkt::Timestamp;
1665 /// let x = Hook::new().set_update_time(Timestamp::default()/* use setters */);
1666 /// ```
1667 pub fn set_update_time<T>(mut self, v: T) -> Self
1668 where
1669 T: std::convert::Into<wkt::Timestamp>,
1670 {
1671 self.update_time = std::option::Option::Some(v.into());
1672 self
1673 }
1674
1675 /// Sets or clears the value of [update_time][crate::model::Hook::update_time].
1676 ///
1677 /// # Example
1678 /// ```ignore,no_run
1679 /// # use google_cloud_securesourcemanager_v1::model::Hook;
1680 /// use wkt::Timestamp;
1681 /// let x = Hook::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1682 /// let x = Hook::new().set_or_clear_update_time(None::<Timestamp>);
1683 /// ```
1684 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1685 where
1686 T: std::convert::Into<wkt::Timestamp>,
1687 {
1688 self.update_time = v.map(|x| x.into());
1689 self
1690 }
1691
1692 /// Sets the value of [uid][crate::model::Hook::uid].
1693 ///
1694 /// # Example
1695 /// ```ignore,no_run
1696 /// # use google_cloud_securesourcemanager_v1::model::Hook;
1697 /// let x = Hook::new().set_uid("example");
1698 /// ```
1699 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1700 self.uid = v.into();
1701 self
1702 }
1703
1704 /// Sets the value of [push_option][crate::model::Hook::push_option].
1705 ///
1706 /// # Example
1707 /// ```ignore,no_run
1708 /// # use google_cloud_securesourcemanager_v1::model::Hook;
1709 /// use google_cloud_securesourcemanager_v1::model::hook::PushOption;
1710 /// let x = Hook::new().set_push_option(PushOption::default()/* use setters */);
1711 /// ```
1712 pub fn set_push_option<T>(mut self, v: T) -> Self
1713 where
1714 T: std::convert::Into<crate::model::hook::PushOption>,
1715 {
1716 self.push_option = std::option::Option::Some(v.into());
1717 self
1718 }
1719
1720 /// Sets or clears the value of [push_option][crate::model::Hook::push_option].
1721 ///
1722 /// # Example
1723 /// ```ignore,no_run
1724 /// # use google_cloud_securesourcemanager_v1::model::Hook;
1725 /// use google_cloud_securesourcemanager_v1::model::hook::PushOption;
1726 /// let x = Hook::new().set_or_clear_push_option(Some(PushOption::default()/* use setters */));
1727 /// let x = Hook::new().set_or_clear_push_option(None::<PushOption>);
1728 /// ```
1729 pub fn set_or_clear_push_option<T>(mut self, v: std::option::Option<T>) -> Self
1730 where
1731 T: std::convert::Into<crate::model::hook::PushOption>,
1732 {
1733 self.push_option = v.map(|x| x.into());
1734 self
1735 }
1736
1737 /// Sets the value of [sensitive_query_string][crate::model::Hook::sensitive_query_string].
1738 ///
1739 /// # Example
1740 /// ```ignore,no_run
1741 /// # use google_cloud_securesourcemanager_v1::model::Hook;
1742 /// let x = Hook::new().set_sensitive_query_string("example");
1743 /// ```
1744 pub fn set_sensitive_query_string<T: std::convert::Into<std::string::String>>(
1745 mut self,
1746 v: T,
1747 ) -> Self {
1748 self.sensitive_query_string = v.into();
1749 self
1750 }
1751}
1752
1753impl wkt::message::Message for Hook {
1754 fn typename() -> &'static str {
1755 "type.googleapis.com/google.cloud.securesourcemanager.v1.Hook"
1756 }
1757}
1758
1759/// Defines additional types related to [Hook].
1760pub mod hook {
1761 #[allow(unused_imports)]
1762 use super::*;
1763
1764 #[derive(Clone, Default, PartialEq)]
1765 #[non_exhaustive]
1766 pub struct PushOption {
1767 /// Optional. Trigger hook for matching branches only.
1768 /// Specified as glob pattern. If empty or *, events for all branches are
1769 /// reported. Examples: main, {main,release*}.
1770 /// See <https://pkg.go.dev/github.com/gobwas/glob> documentation.
1771 pub branch_filter: std::string::String,
1772
1773 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1774 }
1775
1776 impl PushOption {
1777 pub fn new() -> Self {
1778 std::default::Default::default()
1779 }
1780
1781 /// Sets the value of [branch_filter][crate::model::hook::PushOption::branch_filter].
1782 ///
1783 /// # Example
1784 /// ```ignore,no_run
1785 /// # use google_cloud_securesourcemanager_v1::model::hook::PushOption;
1786 /// let x = PushOption::new().set_branch_filter("example");
1787 /// ```
1788 pub fn set_branch_filter<T: std::convert::Into<std::string::String>>(
1789 mut self,
1790 v: T,
1791 ) -> Self {
1792 self.branch_filter = v.into();
1793 self
1794 }
1795 }
1796
1797 impl wkt::message::Message for PushOption {
1798 fn typename() -> &'static str {
1799 "type.googleapis.com/google.cloud.securesourcemanager.v1.Hook.PushOption"
1800 }
1801 }
1802
1803 ///
1804 /// # Working with unknown values
1805 ///
1806 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1807 /// additional enum variants at any time. Adding new variants is not considered
1808 /// a breaking change. Applications should write their code in anticipation of:
1809 ///
1810 /// - New values appearing in future releases of the client library, **and**
1811 /// - New values received dynamically, without application changes.
1812 ///
1813 /// Please consult the [Working with enums] section in the user guide for some
1814 /// guidelines.
1815 ///
1816 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1817 #[derive(Clone, Debug, PartialEq)]
1818 #[non_exhaustive]
1819 pub enum HookEventType {
1820 /// Unspecified.
1821 Unspecified,
1822 /// Push events are triggered when pushing to the repository.
1823 Push,
1824 /// Pull request events are triggered when a pull request is opened, closed,
1825 /// reopened, or edited.
1826 PullRequest,
1827 /// If set, the enum was initialized with an unknown value.
1828 ///
1829 /// Applications can examine the value using [HookEventType::value] or
1830 /// [HookEventType::name].
1831 UnknownValue(hook_event_type::UnknownValue),
1832 }
1833
1834 #[doc(hidden)]
1835 pub mod hook_event_type {
1836 #[allow(unused_imports)]
1837 use super::*;
1838 #[derive(Clone, Debug, PartialEq)]
1839 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1840 }
1841
1842 impl HookEventType {
1843 /// Gets the enum value.
1844 ///
1845 /// Returns `None` if the enum contains an unknown value deserialized from
1846 /// the string representation of enums.
1847 pub fn value(&self) -> std::option::Option<i32> {
1848 match self {
1849 Self::Unspecified => std::option::Option::Some(0),
1850 Self::Push => std::option::Option::Some(1),
1851 Self::PullRequest => std::option::Option::Some(2),
1852 Self::UnknownValue(u) => u.0.value(),
1853 }
1854 }
1855
1856 /// Gets the enum value as a string.
1857 ///
1858 /// Returns `None` if the enum contains an unknown value deserialized from
1859 /// the integer representation of enums.
1860 pub fn name(&self) -> std::option::Option<&str> {
1861 match self {
1862 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
1863 Self::Push => std::option::Option::Some("PUSH"),
1864 Self::PullRequest => std::option::Option::Some("PULL_REQUEST"),
1865 Self::UnknownValue(u) => u.0.name(),
1866 }
1867 }
1868 }
1869
1870 impl std::default::Default for HookEventType {
1871 fn default() -> Self {
1872 use std::convert::From;
1873 Self::from(0)
1874 }
1875 }
1876
1877 impl std::fmt::Display for HookEventType {
1878 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1879 wkt::internal::display_enum(f, self.name(), self.value())
1880 }
1881 }
1882
1883 impl std::convert::From<i32> for HookEventType {
1884 fn from(value: i32) -> Self {
1885 match value {
1886 0 => Self::Unspecified,
1887 1 => Self::Push,
1888 2 => Self::PullRequest,
1889 _ => Self::UnknownValue(hook_event_type::UnknownValue(
1890 wkt::internal::UnknownEnumValue::Integer(value),
1891 )),
1892 }
1893 }
1894 }
1895
1896 impl std::convert::From<&str> for HookEventType {
1897 fn from(value: &str) -> Self {
1898 use std::string::ToString;
1899 match value {
1900 "UNSPECIFIED" => Self::Unspecified,
1901 "PUSH" => Self::Push,
1902 "PULL_REQUEST" => Self::PullRequest,
1903 _ => Self::UnknownValue(hook_event_type::UnknownValue(
1904 wkt::internal::UnknownEnumValue::String(value.to_string()),
1905 )),
1906 }
1907 }
1908 }
1909
1910 impl serde::ser::Serialize for HookEventType {
1911 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1912 where
1913 S: serde::Serializer,
1914 {
1915 match self {
1916 Self::Unspecified => serializer.serialize_i32(0),
1917 Self::Push => serializer.serialize_i32(1),
1918 Self::PullRequest => serializer.serialize_i32(2),
1919 Self::UnknownValue(u) => u.0.serialize(serializer),
1920 }
1921 }
1922 }
1923
1924 impl<'de> serde::de::Deserialize<'de> for HookEventType {
1925 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1926 where
1927 D: serde::Deserializer<'de>,
1928 {
1929 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HookEventType>::new(
1930 ".google.cloud.securesourcemanager.v1.Hook.HookEventType",
1931 ))
1932 }
1933 }
1934}
1935
1936/// Metadata of a BranchRule. BranchRule is the protection rule to enforce
1937/// pre-defined rules on designated branches within a repository.
1938#[derive(Clone, Default, PartialEq)]
1939#[non_exhaustive]
1940pub struct BranchRule {
1941 /// Identifier. A unique identifier for a BranchRule. The name should be of the
1942 /// format:
1943 /// `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`
1944 pub name: std::string::String,
1945
1946 /// Output only. Unique identifier of the repository.
1947 pub uid: std::string::String,
1948
1949 /// Output only. Create timestamp.
1950 pub create_time: std::option::Option<wkt::Timestamp>,
1951
1952 /// Output only. Update timestamp.
1953 pub update_time: std::option::Option<wkt::Timestamp>,
1954
1955 /// Optional. User annotations. These attributes can only be set and used by
1956 /// the user. See <https://google.aip.dev/128#annotations> for more details such
1957 /// as format and size limitations.
1958 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
1959
1960 /// Optional. This checksum is computed by the server based on the value of
1961 /// other fields, and may be sent on update and delete requests to ensure the
1962 /// client has an up-to-date value before proceeding.
1963 pub etag: std::string::String,
1964
1965 /// Optional. The pattern of the branch that can match to this BranchRule.
1966 /// Specified as regex.
1967 /// .* for all branches. Examples: main, (main|release.*).
1968 /// Current MVP phase only support `.*` for wildcard.
1969 pub include_pattern: std::string::String,
1970
1971 /// Optional. Determines if the branch rule is disabled or not.
1972 pub disabled: bool,
1973
1974 /// Optional. Determines if the branch rule requires a pull request or not.
1975 pub require_pull_request: bool,
1976
1977 /// Optional. The minimum number of reviews required for the branch rule to be
1978 /// matched.
1979 pub minimum_reviews_count: i32,
1980
1981 /// Optional. The minimum number of approvals required for the branch rule to
1982 /// be matched.
1983 pub minimum_approvals_count: i32,
1984
1985 /// Optional. Determines if code owners must approve before merging to the
1986 /// branch.
1987 pub require_code_owner_approval: bool,
1988
1989 /// Optional. Determines if require comments resolved before merging to the
1990 /// branch.
1991 pub require_comments_resolved: bool,
1992
1993 /// Optional. Determines if allow stale reviews or approvals before merging to
1994 /// the branch.
1995 pub allow_stale_reviews: bool,
1996
1997 /// Optional. Determines if require linear history before merging to the
1998 /// branch.
1999 pub require_linear_history: bool,
2000
2001 /// Optional. List of required status checks before merging to the branch.
2002 pub required_status_checks: std::vec::Vec<crate::model::branch_rule::Check>,
2003
2004 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2005}
2006
2007impl BranchRule {
2008 pub fn new() -> Self {
2009 std::default::Default::default()
2010 }
2011
2012 /// Sets the value of [name][crate::model::BranchRule::name].
2013 ///
2014 /// # Example
2015 /// ```ignore,no_run
2016 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2017 /// let x = BranchRule::new().set_name("example");
2018 /// ```
2019 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2020 self.name = v.into();
2021 self
2022 }
2023
2024 /// Sets the value of [uid][crate::model::BranchRule::uid].
2025 ///
2026 /// # Example
2027 /// ```ignore,no_run
2028 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2029 /// let x = BranchRule::new().set_uid("example");
2030 /// ```
2031 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2032 self.uid = v.into();
2033 self
2034 }
2035
2036 /// Sets the value of [create_time][crate::model::BranchRule::create_time].
2037 ///
2038 /// # Example
2039 /// ```ignore,no_run
2040 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2041 /// use wkt::Timestamp;
2042 /// let x = BranchRule::new().set_create_time(Timestamp::default()/* use setters */);
2043 /// ```
2044 pub fn set_create_time<T>(mut self, v: T) -> Self
2045 where
2046 T: std::convert::Into<wkt::Timestamp>,
2047 {
2048 self.create_time = std::option::Option::Some(v.into());
2049 self
2050 }
2051
2052 /// Sets or clears the value of [create_time][crate::model::BranchRule::create_time].
2053 ///
2054 /// # Example
2055 /// ```ignore,no_run
2056 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2057 /// use wkt::Timestamp;
2058 /// let x = BranchRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2059 /// let x = BranchRule::new().set_or_clear_create_time(None::<Timestamp>);
2060 /// ```
2061 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2062 where
2063 T: std::convert::Into<wkt::Timestamp>,
2064 {
2065 self.create_time = v.map(|x| x.into());
2066 self
2067 }
2068
2069 /// Sets the value of [update_time][crate::model::BranchRule::update_time].
2070 ///
2071 /// # Example
2072 /// ```ignore,no_run
2073 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2074 /// use wkt::Timestamp;
2075 /// let x = BranchRule::new().set_update_time(Timestamp::default()/* use setters */);
2076 /// ```
2077 pub fn set_update_time<T>(mut self, v: T) -> Self
2078 where
2079 T: std::convert::Into<wkt::Timestamp>,
2080 {
2081 self.update_time = std::option::Option::Some(v.into());
2082 self
2083 }
2084
2085 /// Sets or clears the value of [update_time][crate::model::BranchRule::update_time].
2086 ///
2087 /// # Example
2088 /// ```ignore,no_run
2089 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2090 /// use wkt::Timestamp;
2091 /// let x = BranchRule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2092 /// let x = BranchRule::new().set_or_clear_update_time(None::<Timestamp>);
2093 /// ```
2094 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2095 where
2096 T: std::convert::Into<wkt::Timestamp>,
2097 {
2098 self.update_time = v.map(|x| x.into());
2099 self
2100 }
2101
2102 /// Sets the value of [annotations][crate::model::BranchRule::annotations].
2103 ///
2104 /// # Example
2105 /// ```ignore,no_run
2106 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2107 /// let x = BranchRule::new().set_annotations([
2108 /// ("key0", "abc"),
2109 /// ("key1", "xyz"),
2110 /// ]);
2111 /// ```
2112 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
2113 where
2114 T: std::iter::IntoIterator<Item = (K, V)>,
2115 K: std::convert::Into<std::string::String>,
2116 V: std::convert::Into<std::string::String>,
2117 {
2118 use std::iter::Iterator;
2119 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2120 self
2121 }
2122
2123 /// Sets the value of [etag][crate::model::BranchRule::etag].
2124 ///
2125 /// # Example
2126 /// ```ignore,no_run
2127 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2128 /// let x = BranchRule::new().set_etag("example");
2129 /// ```
2130 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2131 self.etag = v.into();
2132 self
2133 }
2134
2135 /// Sets the value of [include_pattern][crate::model::BranchRule::include_pattern].
2136 ///
2137 /// # Example
2138 /// ```ignore,no_run
2139 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2140 /// let x = BranchRule::new().set_include_pattern("example");
2141 /// ```
2142 pub fn set_include_pattern<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2143 self.include_pattern = v.into();
2144 self
2145 }
2146
2147 /// Sets the value of [disabled][crate::model::BranchRule::disabled].
2148 ///
2149 /// # Example
2150 /// ```ignore,no_run
2151 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2152 /// let x = BranchRule::new().set_disabled(true);
2153 /// ```
2154 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2155 self.disabled = v.into();
2156 self
2157 }
2158
2159 /// Sets the value of [require_pull_request][crate::model::BranchRule::require_pull_request].
2160 ///
2161 /// # Example
2162 /// ```ignore,no_run
2163 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2164 /// let x = BranchRule::new().set_require_pull_request(true);
2165 /// ```
2166 pub fn set_require_pull_request<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2167 self.require_pull_request = v.into();
2168 self
2169 }
2170
2171 /// Sets the value of [minimum_reviews_count][crate::model::BranchRule::minimum_reviews_count].
2172 ///
2173 /// # Example
2174 /// ```ignore,no_run
2175 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2176 /// let x = BranchRule::new().set_minimum_reviews_count(42);
2177 /// ```
2178 pub fn set_minimum_reviews_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2179 self.minimum_reviews_count = v.into();
2180 self
2181 }
2182
2183 /// Sets the value of [minimum_approvals_count][crate::model::BranchRule::minimum_approvals_count].
2184 ///
2185 /// # Example
2186 /// ```ignore,no_run
2187 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2188 /// let x = BranchRule::new().set_minimum_approvals_count(42);
2189 /// ```
2190 pub fn set_minimum_approvals_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2191 self.minimum_approvals_count = v.into();
2192 self
2193 }
2194
2195 /// Sets the value of [require_code_owner_approval][crate::model::BranchRule::require_code_owner_approval].
2196 ///
2197 /// # Example
2198 /// ```ignore,no_run
2199 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2200 /// let x = BranchRule::new().set_require_code_owner_approval(true);
2201 /// ```
2202 pub fn set_require_code_owner_approval<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2203 self.require_code_owner_approval = v.into();
2204 self
2205 }
2206
2207 /// Sets the value of [require_comments_resolved][crate::model::BranchRule::require_comments_resolved].
2208 ///
2209 /// # Example
2210 /// ```ignore,no_run
2211 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2212 /// let x = BranchRule::new().set_require_comments_resolved(true);
2213 /// ```
2214 pub fn set_require_comments_resolved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2215 self.require_comments_resolved = v.into();
2216 self
2217 }
2218
2219 /// Sets the value of [allow_stale_reviews][crate::model::BranchRule::allow_stale_reviews].
2220 ///
2221 /// # Example
2222 /// ```ignore,no_run
2223 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2224 /// let x = BranchRule::new().set_allow_stale_reviews(true);
2225 /// ```
2226 pub fn set_allow_stale_reviews<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2227 self.allow_stale_reviews = v.into();
2228 self
2229 }
2230
2231 /// Sets the value of [require_linear_history][crate::model::BranchRule::require_linear_history].
2232 ///
2233 /// # Example
2234 /// ```ignore,no_run
2235 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2236 /// let x = BranchRule::new().set_require_linear_history(true);
2237 /// ```
2238 pub fn set_require_linear_history<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2239 self.require_linear_history = v.into();
2240 self
2241 }
2242
2243 /// Sets the value of [required_status_checks][crate::model::BranchRule::required_status_checks].
2244 ///
2245 /// # Example
2246 /// ```ignore,no_run
2247 /// # use google_cloud_securesourcemanager_v1::model::BranchRule;
2248 /// use google_cloud_securesourcemanager_v1::model::branch_rule::Check;
2249 /// let x = BranchRule::new()
2250 /// .set_required_status_checks([
2251 /// Check::default()/* use setters */,
2252 /// Check::default()/* use (different) setters */,
2253 /// ]);
2254 /// ```
2255 pub fn set_required_status_checks<T, V>(mut self, v: T) -> Self
2256 where
2257 T: std::iter::IntoIterator<Item = V>,
2258 V: std::convert::Into<crate::model::branch_rule::Check>,
2259 {
2260 use std::iter::Iterator;
2261 self.required_status_checks = v.into_iter().map(|i| i.into()).collect();
2262 self
2263 }
2264}
2265
2266impl wkt::message::Message for BranchRule {
2267 fn typename() -> &'static str {
2268 "type.googleapis.com/google.cloud.securesourcemanager.v1.BranchRule"
2269 }
2270}
2271
2272/// Defines additional types related to [BranchRule].
2273pub mod branch_rule {
2274 #[allow(unused_imports)]
2275 use super::*;
2276
2277 /// Check is a type for status check.
2278 #[derive(Clone, Default, PartialEq)]
2279 #[non_exhaustive]
2280 pub struct Check {
2281 /// Required. The context of the check.
2282 pub context: std::string::String,
2283
2284 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2285 }
2286
2287 impl Check {
2288 pub fn new() -> Self {
2289 std::default::Default::default()
2290 }
2291
2292 /// Sets the value of [context][crate::model::branch_rule::Check::context].
2293 ///
2294 /// # Example
2295 /// ```ignore,no_run
2296 /// # use google_cloud_securesourcemanager_v1::model::branch_rule::Check;
2297 /// let x = Check::new().set_context("example");
2298 /// ```
2299 pub fn set_context<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2300 self.context = v.into();
2301 self
2302 }
2303 }
2304
2305 impl wkt::message::Message for Check {
2306 fn typename() -> &'static str {
2307 "type.googleapis.com/google.cloud.securesourcemanager.v1.BranchRule.Check"
2308 }
2309 }
2310}
2311
2312/// Metadata of a PullRequest. PullRequest is the request
2313/// from a user to merge a branch (head) into another branch (base).
2314#[derive(Clone, Default, PartialEq)]
2315#[non_exhaustive]
2316pub struct PullRequest {
2317 /// Output only. Identifier. A unique identifier for a PullRequest. The number
2318 /// appended at the end is generated by the server. Format:
2319 /// `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request_id}`
2320 pub name: std::string::String,
2321
2322 /// Required. The pull request title.
2323 pub title: std::string::String,
2324
2325 /// Optional. The pull request body. Provides a detailed description of the
2326 /// changes.
2327 pub body: std::string::String,
2328
2329 /// Required. The branch to merge changes in.
2330 pub base: std::option::Option<crate::model::pull_request::Branch>,
2331
2332 /// Immutable. The branch containing the changes to be merged.
2333 pub head: std::option::Option<crate::model::pull_request::Branch>,
2334
2335 /// Output only. State of the pull request (open, closed or merged).
2336 pub state: crate::model::pull_request::State,
2337
2338 /// Output only. Creation timestamp.
2339 pub create_time: std::option::Option<wkt::Timestamp>,
2340
2341 /// Output only. Last updated timestamp.
2342 pub update_time: std::option::Option<wkt::Timestamp>,
2343
2344 /// Output only. Close timestamp (if closed or merged). Cleared when pull
2345 /// request is re-opened.
2346 pub close_time: std::option::Option<wkt::Timestamp>,
2347
2348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2349}
2350
2351impl PullRequest {
2352 pub fn new() -> Self {
2353 std::default::Default::default()
2354 }
2355
2356 /// Sets the value of [name][crate::model::PullRequest::name].
2357 ///
2358 /// # Example
2359 /// ```ignore,no_run
2360 /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2361 /// let x = PullRequest::new().set_name("example");
2362 /// ```
2363 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2364 self.name = v.into();
2365 self
2366 }
2367
2368 /// Sets the value of [title][crate::model::PullRequest::title].
2369 ///
2370 /// # Example
2371 /// ```ignore,no_run
2372 /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2373 /// let x = PullRequest::new().set_title("example");
2374 /// ```
2375 pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2376 self.title = v.into();
2377 self
2378 }
2379
2380 /// Sets the value of [body][crate::model::PullRequest::body].
2381 ///
2382 /// # Example
2383 /// ```ignore,no_run
2384 /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2385 /// let x = PullRequest::new().set_body("example");
2386 /// ```
2387 pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2388 self.body = v.into();
2389 self
2390 }
2391
2392 /// Sets the value of [base][crate::model::PullRequest::base].
2393 ///
2394 /// # Example
2395 /// ```ignore,no_run
2396 /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2397 /// use google_cloud_securesourcemanager_v1::model::pull_request::Branch;
2398 /// let x = PullRequest::new().set_base(Branch::default()/* use setters */);
2399 /// ```
2400 pub fn set_base<T>(mut self, v: T) -> Self
2401 where
2402 T: std::convert::Into<crate::model::pull_request::Branch>,
2403 {
2404 self.base = std::option::Option::Some(v.into());
2405 self
2406 }
2407
2408 /// Sets or clears the value of [base][crate::model::PullRequest::base].
2409 ///
2410 /// # Example
2411 /// ```ignore,no_run
2412 /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2413 /// use google_cloud_securesourcemanager_v1::model::pull_request::Branch;
2414 /// let x = PullRequest::new().set_or_clear_base(Some(Branch::default()/* use setters */));
2415 /// let x = PullRequest::new().set_or_clear_base(None::<Branch>);
2416 /// ```
2417 pub fn set_or_clear_base<T>(mut self, v: std::option::Option<T>) -> Self
2418 where
2419 T: std::convert::Into<crate::model::pull_request::Branch>,
2420 {
2421 self.base = v.map(|x| x.into());
2422 self
2423 }
2424
2425 /// Sets the value of [head][crate::model::PullRequest::head].
2426 ///
2427 /// # Example
2428 /// ```ignore,no_run
2429 /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2430 /// use google_cloud_securesourcemanager_v1::model::pull_request::Branch;
2431 /// let x = PullRequest::new().set_head(Branch::default()/* use setters */);
2432 /// ```
2433 pub fn set_head<T>(mut self, v: T) -> Self
2434 where
2435 T: std::convert::Into<crate::model::pull_request::Branch>,
2436 {
2437 self.head = std::option::Option::Some(v.into());
2438 self
2439 }
2440
2441 /// Sets or clears the value of [head][crate::model::PullRequest::head].
2442 ///
2443 /// # Example
2444 /// ```ignore,no_run
2445 /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2446 /// use google_cloud_securesourcemanager_v1::model::pull_request::Branch;
2447 /// let x = PullRequest::new().set_or_clear_head(Some(Branch::default()/* use setters */));
2448 /// let x = PullRequest::new().set_or_clear_head(None::<Branch>);
2449 /// ```
2450 pub fn set_or_clear_head<T>(mut self, v: std::option::Option<T>) -> Self
2451 where
2452 T: std::convert::Into<crate::model::pull_request::Branch>,
2453 {
2454 self.head = v.map(|x| x.into());
2455 self
2456 }
2457
2458 /// Sets the value of [state][crate::model::PullRequest::state].
2459 ///
2460 /// # Example
2461 /// ```ignore,no_run
2462 /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2463 /// use google_cloud_securesourcemanager_v1::model::pull_request::State;
2464 /// let x0 = PullRequest::new().set_state(State::Open);
2465 /// let x1 = PullRequest::new().set_state(State::Closed);
2466 /// let x2 = PullRequest::new().set_state(State::Merged);
2467 /// ```
2468 pub fn set_state<T: std::convert::Into<crate::model::pull_request::State>>(
2469 mut self,
2470 v: T,
2471 ) -> Self {
2472 self.state = v.into();
2473 self
2474 }
2475
2476 /// Sets the value of [create_time][crate::model::PullRequest::create_time].
2477 ///
2478 /// # Example
2479 /// ```ignore,no_run
2480 /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2481 /// use wkt::Timestamp;
2482 /// let x = PullRequest::new().set_create_time(Timestamp::default()/* use setters */);
2483 /// ```
2484 pub fn set_create_time<T>(mut self, v: T) -> Self
2485 where
2486 T: std::convert::Into<wkt::Timestamp>,
2487 {
2488 self.create_time = std::option::Option::Some(v.into());
2489 self
2490 }
2491
2492 /// Sets or clears the value of [create_time][crate::model::PullRequest::create_time].
2493 ///
2494 /// # Example
2495 /// ```ignore,no_run
2496 /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2497 /// use wkt::Timestamp;
2498 /// let x = PullRequest::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2499 /// let x = PullRequest::new().set_or_clear_create_time(None::<Timestamp>);
2500 /// ```
2501 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2502 where
2503 T: std::convert::Into<wkt::Timestamp>,
2504 {
2505 self.create_time = v.map(|x| x.into());
2506 self
2507 }
2508
2509 /// Sets the value of [update_time][crate::model::PullRequest::update_time].
2510 ///
2511 /// # Example
2512 /// ```ignore,no_run
2513 /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2514 /// use wkt::Timestamp;
2515 /// let x = PullRequest::new().set_update_time(Timestamp::default()/* use setters */);
2516 /// ```
2517 pub fn set_update_time<T>(mut self, v: T) -> Self
2518 where
2519 T: std::convert::Into<wkt::Timestamp>,
2520 {
2521 self.update_time = std::option::Option::Some(v.into());
2522 self
2523 }
2524
2525 /// Sets or clears the value of [update_time][crate::model::PullRequest::update_time].
2526 ///
2527 /// # Example
2528 /// ```ignore,no_run
2529 /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2530 /// use wkt::Timestamp;
2531 /// let x = PullRequest::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2532 /// let x = PullRequest::new().set_or_clear_update_time(None::<Timestamp>);
2533 /// ```
2534 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2535 where
2536 T: std::convert::Into<wkt::Timestamp>,
2537 {
2538 self.update_time = v.map(|x| x.into());
2539 self
2540 }
2541
2542 /// Sets the value of [close_time][crate::model::PullRequest::close_time].
2543 ///
2544 /// # Example
2545 /// ```ignore,no_run
2546 /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2547 /// use wkt::Timestamp;
2548 /// let x = PullRequest::new().set_close_time(Timestamp::default()/* use setters */);
2549 /// ```
2550 pub fn set_close_time<T>(mut self, v: T) -> Self
2551 where
2552 T: std::convert::Into<wkt::Timestamp>,
2553 {
2554 self.close_time = std::option::Option::Some(v.into());
2555 self
2556 }
2557
2558 /// Sets or clears the value of [close_time][crate::model::PullRequest::close_time].
2559 ///
2560 /// # Example
2561 /// ```ignore,no_run
2562 /// # use google_cloud_securesourcemanager_v1::model::PullRequest;
2563 /// use wkt::Timestamp;
2564 /// let x = PullRequest::new().set_or_clear_close_time(Some(Timestamp::default()/* use setters */));
2565 /// let x = PullRequest::new().set_or_clear_close_time(None::<Timestamp>);
2566 /// ```
2567 pub fn set_or_clear_close_time<T>(mut self, v: std::option::Option<T>) -> Self
2568 where
2569 T: std::convert::Into<wkt::Timestamp>,
2570 {
2571 self.close_time = v.map(|x| x.into());
2572 self
2573 }
2574}
2575
2576impl wkt::message::Message for PullRequest {
2577 fn typename() -> &'static str {
2578 "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequest"
2579 }
2580}
2581
2582/// Defines additional types related to [PullRequest].
2583pub mod pull_request {
2584 #[allow(unused_imports)]
2585 use super::*;
2586
2587 /// Branch represents a branch involved in a pull request.
2588 #[derive(Clone, Default, PartialEq)]
2589 #[non_exhaustive]
2590 pub struct Branch {
2591 /// Required. Name of the branch.
2592 pub r#ref: std::string::String,
2593
2594 /// Output only. The commit at the tip of the branch.
2595 pub sha: std::string::String,
2596
2597 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2598 }
2599
2600 impl Branch {
2601 pub fn new() -> Self {
2602 std::default::Default::default()
2603 }
2604
2605 /// Sets the value of [r#ref][crate::model::pull_request::Branch::ref].
2606 ///
2607 /// # Example
2608 /// ```ignore,no_run
2609 /// # use google_cloud_securesourcemanager_v1::model::pull_request::Branch;
2610 /// let x = Branch::new().set_ref("example");
2611 /// ```
2612 pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2613 self.r#ref = v.into();
2614 self
2615 }
2616
2617 /// Sets the value of [sha][crate::model::pull_request::Branch::sha].
2618 ///
2619 /// # Example
2620 /// ```ignore,no_run
2621 /// # use google_cloud_securesourcemanager_v1::model::pull_request::Branch;
2622 /// let x = Branch::new().set_sha("example");
2623 /// ```
2624 pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2625 self.sha = v.into();
2626 self
2627 }
2628 }
2629
2630 impl wkt::message::Message for Branch {
2631 fn typename() -> &'static str {
2632 "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequest.Branch"
2633 }
2634 }
2635
2636 /// State of the pull request.
2637 ///
2638 /// # Working with unknown values
2639 ///
2640 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2641 /// additional enum variants at any time. Adding new variants is not considered
2642 /// a breaking change. Applications should write their code in anticipation of:
2643 ///
2644 /// - New values appearing in future releases of the client library, **and**
2645 /// - New values received dynamically, without application changes.
2646 ///
2647 /// Please consult the [Working with enums] section in the user guide for some
2648 /// guidelines.
2649 ///
2650 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2651 #[derive(Clone, Debug, PartialEq)]
2652 #[non_exhaustive]
2653 pub enum State {
2654 /// Unspecified.
2655 Unspecified,
2656 /// An open pull request.
2657 Open,
2658 /// A closed pull request.
2659 Closed,
2660 /// A merged pull request.
2661 Merged,
2662 /// If set, the enum was initialized with an unknown value.
2663 ///
2664 /// Applications can examine the value using [State::value] or
2665 /// [State::name].
2666 UnknownValue(state::UnknownValue),
2667 }
2668
2669 #[doc(hidden)]
2670 pub mod state {
2671 #[allow(unused_imports)]
2672 use super::*;
2673 #[derive(Clone, Debug, PartialEq)]
2674 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2675 }
2676
2677 impl State {
2678 /// Gets the enum value.
2679 ///
2680 /// Returns `None` if the enum contains an unknown value deserialized from
2681 /// the string representation of enums.
2682 pub fn value(&self) -> std::option::Option<i32> {
2683 match self {
2684 Self::Unspecified => std::option::Option::Some(0),
2685 Self::Open => std::option::Option::Some(1),
2686 Self::Closed => std::option::Option::Some(2),
2687 Self::Merged => std::option::Option::Some(3),
2688 Self::UnknownValue(u) => u.0.value(),
2689 }
2690 }
2691
2692 /// Gets the enum value as a string.
2693 ///
2694 /// Returns `None` if the enum contains an unknown value deserialized from
2695 /// the integer representation of enums.
2696 pub fn name(&self) -> std::option::Option<&str> {
2697 match self {
2698 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2699 Self::Open => std::option::Option::Some("OPEN"),
2700 Self::Closed => std::option::Option::Some("CLOSED"),
2701 Self::Merged => std::option::Option::Some("MERGED"),
2702 Self::UnknownValue(u) => u.0.name(),
2703 }
2704 }
2705 }
2706
2707 impl std::default::Default for State {
2708 fn default() -> Self {
2709 use std::convert::From;
2710 Self::from(0)
2711 }
2712 }
2713
2714 impl std::fmt::Display for State {
2715 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2716 wkt::internal::display_enum(f, self.name(), self.value())
2717 }
2718 }
2719
2720 impl std::convert::From<i32> for State {
2721 fn from(value: i32) -> Self {
2722 match value {
2723 0 => Self::Unspecified,
2724 1 => Self::Open,
2725 2 => Self::Closed,
2726 3 => Self::Merged,
2727 _ => Self::UnknownValue(state::UnknownValue(
2728 wkt::internal::UnknownEnumValue::Integer(value),
2729 )),
2730 }
2731 }
2732 }
2733
2734 impl std::convert::From<&str> for State {
2735 fn from(value: &str) -> Self {
2736 use std::string::ToString;
2737 match value {
2738 "STATE_UNSPECIFIED" => Self::Unspecified,
2739 "OPEN" => Self::Open,
2740 "CLOSED" => Self::Closed,
2741 "MERGED" => Self::Merged,
2742 _ => Self::UnknownValue(state::UnknownValue(
2743 wkt::internal::UnknownEnumValue::String(value.to_string()),
2744 )),
2745 }
2746 }
2747 }
2748
2749 impl serde::ser::Serialize for State {
2750 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2751 where
2752 S: serde::Serializer,
2753 {
2754 match self {
2755 Self::Unspecified => serializer.serialize_i32(0),
2756 Self::Open => serializer.serialize_i32(1),
2757 Self::Closed => serializer.serialize_i32(2),
2758 Self::Merged => serializer.serialize_i32(3),
2759 Self::UnknownValue(u) => u.0.serialize(serializer),
2760 }
2761 }
2762 }
2763
2764 impl<'de> serde::de::Deserialize<'de> for State {
2765 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2766 where
2767 D: serde::Deserializer<'de>,
2768 {
2769 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2770 ".google.cloud.securesourcemanager.v1.PullRequest.State",
2771 ))
2772 }
2773 }
2774}
2775
2776/// Metadata of a FileDiff. FileDiff represents a single file diff in a pull
2777/// request.
2778#[derive(Clone, Default, PartialEq)]
2779#[non_exhaustive]
2780pub struct FileDiff {
2781 /// Output only. The name of the file.
2782 pub name: std::string::String,
2783
2784 /// Output only. The action taken on the file (eg. added, modified, deleted).
2785 pub action: crate::model::file_diff::Action,
2786
2787 /// Output only. The commit pointing to the file changes.
2788 pub sha: std::string::String,
2789
2790 /// Output only. The git patch containing the file changes.
2791 pub patch: std::string::String,
2792
2793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2794}
2795
2796impl FileDiff {
2797 pub fn new() -> Self {
2798 std::default::Default::default()
2799 }
2800
2801 /// Sets the value of [name][crate::model::FileDiff::name].
2802 ///
2803 /// # Example
2804 /// ```ignore,no_run
2805 /// # use google_cloud_securesourcemanager_v1::model::FileDiff;
2806 /// let x = FileDiff::new().set_name("example");
2807 /// ```
2808 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2809 self.name = v.into();
2810 self
2811 }
2812
2813 /// Sets the value of [action][crate::model::FileDiff::action].
2814 ///
2815 /// # Example
2816 /// ```ignore,no_run
2817 /// # use google_cloud_securesourcemanager_v1::model::FileDiff;
2818 /// use google_cloud_securesourcemanager_v1::model::file_diff::Action;
2819 /// let x0 = FileDiff::new().set_action(Action::Added);
2820 /// let x1 = FileDiff::new().set_action(Action::Modified);
2821 /// let x2 = FileDiff::new().set_action(Action::Deleted);
2822 /// ```
2823 pub fn set_action<T: std::convert::Into<crate::model::file_diff::Action>>(
2824 mut self,
2825 v: T,
2826 ) -> Self {
2827 self.action = v.into();
2828 self
2829 }
2830
2831 /// Sets the value of [sha][crate::model::FileDiff::sha].
2832 ///
2833 /// # Example
2834 /// ```ignore,no_run
2835 /// # use google_cloud_securesourcemanager_v1::model::FileDiff;
2836 /// let x = FileDiff::new().set_sha("example");
2837 /// ```
2838 pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2839 self.sha = v.into();
2840 self
2841 }
2842
2843 /// Sets the value of [patch][crate::model::FileDiff::patch].
2844 ///
2845 /// # Example
2846 /// ```ignore,no_run
2847 /// # use google_cloud_securesourcemanager_v1::model::FileDiff;
2848 /// let x = FileDiff::new().set_patch("example");
2849 /// ```
2850 pub fn set_patch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2851 self.patch = v.into();
2852 self
2853 }
2854}
2855
2856impl wkt::message::Message for FileDiff {
2857 fn typename() -> &'static str {
2858 "type.googleapis.com/google.cloud.securesourcemanager.v1.FileDiff"
2859 }
2860}
2861
2862/// Defines additional types related to [FileDiff].
2863pub mod file_diff {
2864 #[allow(unused_imports)]
2865 use super::*;
2866
2867 /// Action taken on the file.
2868 ///
2869 /// # Working with unknown values
2870 ///
2871 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2872 /// additional enum variants at any time. Adding new variants is not considered
2873 /// a breaking change. Applications should write their code in anticipation of:
2874 ///
2875 /// - New values appearing in future releases of the client library, **and**
2876 /// - New values received dynamically, without application changes.
2877 ///
2878 /// Please consult the [Working with enums] section in the user guide for some
2879 /// guidelines.
2880 ///
2881 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2882 #[derive(Clone, Debug, PartialEq)]
2883 #[non_exhaustive]
2884 pub enum Action {
2885 /// Unspecified.
2886 Unspecified,
2887 /// The file was added.
2888 Added,
2889 /// The file was modified.
2890 Modified,
2891 /// The file was deleted.
2892 Deleted,
2893 /// If set, the enum was initialized with an unknown value.
2894 ///
2895 /// Applications can examine the value using [Action::value] or
2896 /// [Action::name].
2897 UnknownValue(action::UnknownValue),
2898 }
2899
2900 #[doc(hidden)]
2901 pub mod action {
2902 #[allow(unused_imports)]
2903 use super::*;
2904 #[derive(Clone, Debug, PartialEq)]
2905 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2906 }
2907
2908 impl Action {
2909 /// Gets the enum value.
2910 ///
2911 /// Returns `None` if the enum contains an unknown value deserialized from
2912 /// the string representation of enums.
2913 pub fn value(&self) -> std::option::Option<i32> {
2914 match self {
2915 Self::Unspecified => std::option::Option::Some(0),
2916 Self::Added => std::option::Option::Some(1),
2917 Self::Modified => std::option::Option::Some(2),
2918 Self::Deleted => std::option::Option::Some(3),
2919 Self::UnknownValue(u) => u.0.value(),
2920 }
2921 }
2922
2923 /// Gets the enum value as a string.
2924 ///
2925 /// Returns `None` if the enum contains an unknown value deserialized from
2926 /// the integer representation of enums.
2927 pub fn name(&self) -> std::option::Option<&str> {
2928 match self {
2929 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
2930 Self::Added => std::option::Option::Some("ADDED"),
2931 Self::Modified => std::option::Option::Some("MODIFIED"),
2932 Self::Deleted => std::option::Option::Some("DELETED"),
2933 Self::UnknownValue(u) => u.0.name(),
2934 }
2935 }
2936 }
2937
2938 impl std::default::Default for Action {
2939 fn default() -> Self {
2940 use std::convert::From;
2941 Self::from(0)
2942 }
2943 }
2944
2945 impl std::fmt::Display for Action {
2946 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2947 wkt::internal::display_enum(f, self.name(), self.value())
2948 }
2949 }
2950
2951 impl std::convert::From<i32> for Action {
2952 fn from(value: i32) -> Self {
2953 match value {
2954 0 => Self::Unspecified,
2955 1 => Self::Added,
2956 2 => Self::Modified,
2957 3 => Self::Deleted,
2958 _ => Self::UnknownValue(action::UnknownValue(
2959 wkt::internal::UnknownEnumValue::Integer(value),
2960 )),
2961 }
2962 }
2963 }
2964
2965 impl std::convert::From<&str> for Action {
2966 fn from(value: &str) -> Self {
2967 use std::string::ToString;
2968 match value {
2969 "ACTION_UNSPECIFIED" => Self::Unspecified,
2970 "ADDED" => Self::Added,
2971 "MODIFIED" => Self::Modified,
2972 "DELETED" => Self::Deleted,
2973 _ => Self::UnknownValue(action::UnknownValue(
2974 wkt::internal::UnknownEnumValue::String(value.to_string()),
2975 )),
2976 }
2977 }
2978 }
2979
2980 impl serde::ser::Serialize for Action {
2981 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2982 where
2983 S: serde::Serializer,
2984 {
2985 match self {
2986 Self::Unspecified => serializer.serialize_i32(0),
2987 Self::Added => serializer.serialize_i32(1),
2988 Self::Modified => serializer.serialize_i32(2),
2989 Self::Deleted => serializer.serialize_i32(3),
2990 Self::UnknownValue(u) => u.0.serialize(serializer),
2991 }
2992 }
2993 }
2994
2995 impl<'de> serde::de::Deserialize<'de> for Action {
2996 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2997 where
2998 D: serde::Deserializer<'de>,
2999 {
3000 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
3001 ".google.cloud.securesourcemanager.v1.FileDiff.Action",
3002 ))
3003 }
3004 }
3005}
3006
3007/// Metadata of an Issue.
3008#[derive(Clone, Default, PartialEq)]
3009#[non_exhaustive]
3010pub struct Issue {
3011 /// Identifier. Unique identifier for an issue. The issue id is generated by
3012 /// the server. Format:
3013 /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`
3014 pub name: std::string::String,
3015
3016 /// Required. Issue title.
3017 pub title: std::string::String,
3018
3019 /// Optional. Issue body. Provides a detailed description of the issue.
3020 pub body: std::string::String,
3021
3022 /// Output only. State of the issue.
3023 pub state: crate::model::issue::State,
3024
3025 /// Output only. Creation timestamp.
3026 pub create_time: std::option::Option<wkt::Timestamp>,
3027
3028 /// Output only. Last updated timestamp.
3029 pub update_time: std::option::Option<wkt::Timestamp>,
3030
3031 /// Output only. Close timestamp (if closed). Cleared when is re-opened.
3032 pub close_time: std::option::Option<wkt::Timestamp>,
3033
3034 /// Optional. This checksum is computed by the server based on the value of
3035 /// other fields, and may be sent on update and delete requests to ensure the
3036 /// client has an up-to-date value before proceeding.
3037 pub etag: std::string::String,
3038
3039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3040}
3041
3042impl Issue {
3043 pub fn new() -> Self {
3044 std::default::Default::default()
3045 }
3046
3047 /// Sets the value of [name][crate::model::Issue::name].
3048 ///
3049 /// # Example
3050 /// ```ignore,no_run
3051 /// # use google_cloud_securesourcemanager_v1::model::Issue;
3052 /// let x = Issue::new().set_name("example");
3053 /// ```
3054 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3055 self.name = v.into();
3056 self
3057 }
3058
3059 /// Sets the value of [title][crate::model::Issue::title].
3060 ///
3061 /// # Example
3062 /// ```ignore,no_run
3063 /// # use google_cloud_securesourcemanager_v1::model::Issue;
3064 /// let x = Issue::new().set_title("example");
3065 /// ```
3066 pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3067 self.title = v.into();
3068 self
3069 }
3070
3071 /// Sets the value of [body][crate::model::Issue::body].
3072 ///
3073 /// # Example
3074 /// ```ignore,no_run
3075 /// # use google_cloud_securesourcemanager_v1::model::Issue;
3076 /// let x = Issue::new().set_body("example");
3077 /// ```
3078 pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3079 self.body = v.into();
3080 self
3081 }
3082
3083 /// Sets the value of [state][crate::model::Issue::state].
3084 ///
3085 /// # Example
3086 /// ```ignore,no_run
3087 /// # use google_cloud_securesourcemanager_v1::model::Issue;
3088 /// use google_cloud_securesourcemanager_v1::model::issue::State;
3089 /// let x0 = Issue::new().set_state(State::Open);
3090 /// let x1 = Issue::new().set_state(State::Closed);
3091 /// ```
3092 pub fn set_state<T: std::convert::Into<crate::model::issue::State>>(mut self, v: T) -> Self {
3093 self.state = v.into();
3094 self
3095 }
3096
3097 /// Sets the value of [create_time][crate::model::Issue::create_time].
3098 ///
3099 /// # Example
3100 /// ```ignore,no_run
3101 /// # use google_cloud_securesourcemanager_v1::model::Issue;
3102 /// use wkt::Timestamp;
3103 /// let x = Issue::new().set_create_time(Timestamp::default()/* use setters */);
3104 /// ```
3105 pub fn set_create_time<T>(mut self, v: T) -> Self
3106 where
3107 T: std::convert::Into<wkt::Timestamp>,
3108 {
3109 self.create_time = std::option::Option::Some(v.into());
3110 self
3111 }
3112
3113 /// Sets or clears the value of [create_time][crate::model::Issue::create_time].
3114 ///
3115 /// # Example
3116 /// ```ignore,no_run
3117 /// # use google_cloud_securesourcemanager_v1::model::Issue;
3118 /// use wkt::Timestamp;
3119 /// let x = Issue::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3120 /// let x = Issue::new().set_or_clear_create_time(None::<Timestamp>);
3121 /// ```
3122 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3123 where
3124 T: std::convert::Into<wkt::Timestamp>,
3125 {
3126 self.create_time = v.map(|x| x.into());
3127 self
3128 }
3129
3130 /// Sets the value of [update_time][crate::model::Issue::update_time].
3131 ///
3132 /// # Example
3133 /// ```ignore,no_run
3134 /// # use google_cloud_securesourcemanager_v1::model::Issue;
3135 /// use wkt::Timestamp;
3136 /// let x = Issue::new().set_update_time(Timestamp::default()/* use setters */);
3137 /// ```
3138 pub fn set_update_time<T>(mut self, v: T) -> Self
3139 where
3140 T: std::convert::Into<wkt::Timestamp>,
3141 {
3142 self.update_time = std::option::Option::Some(v.into());
3143 self
3144 }
3145
3146 /// Sets or clears the value of [update_time][crate::model::Issue::update_time].
3147 ///
3148 /// # Example
3149 /// ```ignore,no_run
3150 /// # use google_cloud_securesourcemanager_v1::model::Issue;
3151 /// use wkt::Timestamp;
3152 /// let x = Issue::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3153 /// let x = Issue::new().set_or_clear_update_time(None::<Timestamp>);
3154 /// ```
3155 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3156 where
3157 T: std::convert::Into<wkt::Timestamp>,
3158 {
3159 self.update_time = v.map(|x| x.into());
3160 self
3161 }
3162
3163 /// Sets the value of [close_time][crate::model::Issue::close_time].
3164 ///
3165 /// # Example
3166 /// ```ignore,no_run
3167 /// # use google_cloud_securesourcemanager_v1::model::Issue;
3168 /// use wkt::Timestamp;
3169 /// let x = Issue::new().set_close_time(Timestamp::default()/* use setters */);
3170 /// ```
3171 pub fn set_close_time<T>(mut self, v: T) -> Self
3172 where
3173 T: std::convert::Into<wkt::Timestamp>,
3174 {
3175 self.close_time = std::option::Option::Some(v.into());
3176 self
3177 }
3178
3179 /// Sets or clears the value of [close_time][crate::model::Issue::close_time].
3180 ///
3181 /// # Example
3182 /// ```ignore,no_run
3183 /// # use google_cloud_securesourcemanager_v1::model::Issue;
3184 /// use wkt::Timestamp;
3185 /// let x = Issue::new().set_or_clear_close_time(Some(Timestamp::default()/* use setters */));
3186 /// let x = Issue::new().set_or_clear_close_time(None::<Timestamp>);
3187 /// ```
3188 pub fn set_or_clear_close_time<T>(mut self, v: std::option::Option<T>) -> Self
3189 where
3190 T: std::convert::Into<wkt::Timestamp>,
3191 {
3192 self.close_time = v.map(|x| x.into());
3193 self
3194 }
3195
3196 /// Sets the value of [etag][crate::model::Issue::etag].
3197 ///
3198 /// # Example
3199 /// ```ignore,no_run
3200 /// # use google_cloud_securesourcemanager_v1::model::Issue;
3201 /// let x = Issue::new().set_etag("example");
3202 /// ```
3203 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3204 self.etag = v.into();
3205 self
3206 }
3207}
3208
3209impl wkt::message::Message for Issue {
3210 fn typename() -> &'static str {
3211 "type.googleapis.com/google.cloud.securesourcemanager.v1.Issue"
3212 }
3213}
3214
3215/// Defines additional types related to [Issue].
3216pub mod issue {
3217 #[allow(unused_imports)]
3218 use super::*;
3219
3220 /// Possible states of an issue.
3221 ///
3222 /// # Working with unknown values
3223 ///
3224 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3225 /// additional enum variants at any time. Adding new variants is not considered
3226 /// a breaking change. Applications should write their code in anticipation of:
3227 ///
3228 /// - New values appearing in future releases of the client library, **and**
3229 /// - New values received dynamically, without application changes.
3230 ///
3231 /// Please consult the [Working with enums] section in the user guide for some
3232 /// guidelines.
3233 ///
3234 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3235 #[derive(Clone, Debug, PartialEq)]
3236 #[non_exhaustive]
3237 pub enum State {
3238 /// Unspecified.
3239 Unspecified,
3240 /// An open issue.
3241 Open,
3242 /// A closed issue.
3243 Closed,
3244 /// If set, the enum was initialized with an unknown value.
3245 ///
3246 /// Applications can examine the value using [State::value] or
3247 /// [State::name].
3248 UnknownValue(state::UnknownValue),
3249 }
3250
3251 #[doc(hidden)]
3252 pub mod state {
3253 #[allow(unused_imports)]
3254 use super::*;
3255 #[derive(Clone, Debug, PartialEq)]
3256 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3257 }
3258
3259 impl State {
3260 /// Gets the enum value.
3261 ///
3262 /// Returns `None` if the enum contains an unknown value deserialized from
3263 /// the string representation of enums.
3264 pub fn value(&self) -> std::option::Option<i32> {
3265 match self {
3266 Self::Unspecified => std::option::Option::Some(0),
3267 Self::Open => std::option::Option::Some(1),
3268 Self::Closed => std::option::Option::Some(2),
3269 Self::UnknownValue(u) => u.0.value(),
3270 }
3271 }
3272
3273 /// Gets the enum value as a string.
3274 ///
3275 /// Returns `None` if the enum contains an unknown value deserialized from
3276 /// the integer representation of enums.
3277 pub fn name(&self) -> std::option::Option<&str> {
3278 match self {
3279 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3280 Self::Open => std::option::Option::Some("OPEN"),
3281 Self::Closed => std::option::Option::Some("CLOSED"),
3282 Self::UnknownValue(u) => u.0.name(),
3283 }
3284 }
3285 }
3286
3287 impl std::default::Default for State {
3288 fn default() -> Self {
3289 use std::convert::From;
3290 Self::from(0)
3291 }
3292 }
3293
3294 impl std::fmt::Display for State {
3295 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3296 wkt::internal::display_enum(f, self.name(), self.value())
3297 }
3298 }
3299
3300 impl std::convert::From<i32> for State {
3301 fn from(value: i32) -> Self {
3302 match value {
3303 0 => Self::Unspecified,
3304 1 => Self::Open,
3305 2 => Self::Closed,
3306 _ => Self::UnknownValue(state::UnknownValue(
3307 wkt::internal::UnknownEnumValue::Integer(value),
3308 )),
3309 }
3310 }
3311 }
3312
3313 impl std::convert::From<&str> for State {
3314 fn from(value: &str) -> Self {
3315 use std::string::ToString;
3316 match value {
3317 "STATE_UNSPECIFIED" => Self::Unspecified,
3318 "OPEN" => Self::Open,
3319 "CLOSED" => Self::Closed,
3320 _ => Self::UnknownValue(state::UnknownValue(
3321 wkt::internal::UnknownEnumValue::String(value.to_string()),
3322 )),
3323 }
3324 }
3325 }
3326
3327 impl serde::ser::Serialize for State {
3328 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3329 where
3330 S: serde::Serializer,
3331 {
3332 match self {
3333 Self::Unspecified => serializer.serialize_i32(0),
3334 Self::Open => serializer.serialize_i32(1),
3335 Self::Closed => serializer.serialize_i32(2),
3336 Self::UnknownValue(u) => u.0.serialize(serializer),
3337 }
3338 }
3339 }
3340
3341 impl<'de> serde::de::Deserialize<'de> for State {
3342 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3343 where
3344 D: serde::Deserializer<'de>,
3345 {
3346 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3347 ".google.cloud.securesourcemanager.v1.Issue.State",
3348 ))
3349 }
3350 }
3351}
3352
3353/// IssueComment represents a comment on an issue.
3354#[derive(Clone, Default, PartialEq)]
3355#[non_exhaustive]
3356pub struct IssueComment {
3357 /// Identifier. Unique identifier for an issue comment. The comment id is
3358 /// generated by the server. Format:
3359 /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue}/issueComments/{comment_id}`
3360 pub name: std::string::String,
3361
3362 /// Required. The comment body.
3363 pub body: std::string::String,
3364
3365 /// Output only. Creation timestamp.
3366 pub create_time: std::option::Option<wkt::Timestamp>,
3367
3368 /// Output only. Last updated timestamp.
3369 pub update_time: std::option::Option<wkt::Timestamp>,
3370
3371 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3372}
3373
3374impl IssueComment {
3375 pub fn new() -> Self {
3376 std::default::Default::default()
3377 }
3378
3379 /// Sets the value of [name][crate::model::IssueComment::name].
3380 ///
3381 /// # Example
3382 /// ```ignore,no_run
3383 /// # use google_cloud_securesourcemanager_v1::model::IssueComment;
3384 /// let x = IssueComment::new().set_name("example");
3385 /// ```
3386 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3387 self.name = v.into();
3388 self
3389 }
3390
3391 /// Sets the value of [body][crate::model::IssueComment::body].
3392 ///
3393 /// # Example
3394 /// ```ignore,no_run
3395 /// # use google_cloud_securesourcemanager_v1::model::IssueComment;
3396 /// let x = IssueComment::new().set_body("example");
3397 /// ```
3398 pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3399 self.body = v.into();
3400 self
3401 }
3402
3403 /// Sets the value of [create_time][crate::model::IssueComment::create_time].
3404 ///
3405 /// # Example
3406 /// ```ignore,no_run
3407 /// # use google_cloud_securesourcemanager_v1::model::IssueComment;
3408 /// use wkt::Timestamp;
3409 /// let x = IssueComment::new().set_create_time(Timestamp::default()/* use setters */);
3410 /// ```
3411 pub fn set_create_time<T>(mut self, v: T) -> Self
3412 where
3413 T: std::convert::Into<wkt::Timestamp>,
3414 {
3415 self.create_time = std::option::Option::Some(v.into());
3416 self
3417 }
3418
3419 /// Sets or clears the value of [create_time][crate::model::IssueComment::create_time].
3420 ///
3421 /// # Example
3422 /// ```ignore,no_run
3423 /// # use google_cloud_securesourcemanager_v1::model::IssueComment;
3424 /// use wkt::Timestamp;
3425 /// let x = IssueComment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3426 /// let x = IssueComment::new().set_or_clear_create_time(None::<Timestamp>);
3427 /// ```
3428 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3429 where
3430 T: std::convert::Into<wkt::Timestamp>,
3431 {
3432 self.create_time = v.map(|x| x.into());
3433 self
3434 }
3435
3436 /// Sets the value of [update_time][crate::model::IssueComment::update_time].
3437 ///
3438 /// # Example
3439 /// ```ignore,no_run
3440 /// # use google_cloud_securesourcemanager_v1::model::IssueComment;
3441 /// use wkt::Timestamp;
3442 /// let x = IssueComment::new().set_update_time(Timestamp::default()/* use setters */);
3443 /// ```
3444 pub fn set_update_time<T>(mut self, v: T) -> Self
3445 where
3446 T: std::convert::Into<wkt::Timestamp>,
3447 {
3448 self.update_time = std::option::Option::Some(v.into());
3449 self
3450 }
3451
3452 /// Sets or clears the value of [update_time][crate::model::IssueComment::update_time].
3453 ///
3454 /// # Example
3455 /// ```ignore,no_run
3456 /// # use google_cloud_securesourcemanager_v1::model::IssueComment;
3457 /// use wkt::Timestamp;
3458 /// let x = IssueComment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3459 /// let x = IssueComment::new().set_or_clear_update_time(None::<Timestamp>);
3460 /// ```
3461 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3462 where
3463 T: std::convert::Into<wkt::Timestamp>,
3464 {
3465 self.update_time = v.map(|x| x.into());
3466 self
3467 }
3468}
3469
3470impl wkt::message::Message for IssueComment {
3471 fn typename() -> &'static str {
3472 "type.googleapis.com/google.cloud.securesourcemanager.v1.IssueComment"
3473 }
3474}
3475
3476/// PullRequestComment represents a comment on a pull request.
3477#[derive(Clone, Default, PartialEq)]
3478#[non_exhaustive]
3479pub struct PullRequestComment {
3480 /// Identifier. Unique identifier for the pull request comment. The comment id
3481 /// is generated by the server. Format:
3482 /// `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}/pullRequestComments/{comment_id}`
3483 pub name: std::string::String,
3484
3485 /// Output only. Creation timestamp.
3486 pub create_time: std::option::Option<wkt::Timestamp>,
3487
3488 /// Output only. Last updated timestamp.
3489 pub update_time: std::option::Option<wkt::Timestamp>,
3490
3491 /// The comment detail. A comment can be a review, a general comment, or a
3492 /// code comment.
3493 pub comment_detail: std::option::Option<crate::model::pull_request_comment::CommentDetail>,
3494
3495 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3496}
3497
3498impl PullRequestComment {
3499 pub fn new() -> Self {
3500 std::default::Default::default()
3501 }
3502
3503 /// Sets the value of [name][crate::model::PullRequestComment::name].
3504 ///
3505 /// # Example
3506 /// ```ignore,no_run
3507 /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3508 /// let x = PullRequestComment::new().set_name("example");
3509 /// ```
3510 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3511 self.name = v.into();
3512 self
3513 }
3514
3515 /// Sets the value of [create_time][crate::model::PullRequestComment::create_time].
3516 ///
3517 /// # Example
3518 /// ```ignore,no_run
3519 /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3520 /// use wkt::Timestamp;
3521 /// let x = PullRequestComment::new().set_create_time(Timestamp::default()/* use setters */);
3522 /// ```
3523 pub fn set_create_time<T>(mut self, v: T) -> Self
3524 where
3525 T: std::convert::Into<wkt::Timestamp>,
3526 {
3527 self.create_time = std::option::Option::Some(v.into());
3528 self
3529 }
3530
3531 /// Sets or clears the value of [create_time][crate::model::PullRequestComment::create_time].
3532 ///
3533 /// # Example
3534 /// ```ignore,no_run
3535 /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3536 /// use wkt::Timestamp;
3537 /// let x = PullRequestComment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3538 /// let x = PullRequestComment::new().set_or_clear_create_time(None::<Timestamp>);
3539 /// ```
3540 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3541 where
3542 T: std::convert::Into<wkt::Timestamp>,
3543 {
3544 self.create_time = v.map(|x| x.into());
3545 self
3546 }
3547
3548 /// Sets the value of [update_time][crate::model::PullRequestComment::update_time].
3549 ///
3550 /// # Example
3551 /// ```ignore,no_run
3552 /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3553 /// use wkt::Timestamp;
3554 /// let x = PullRequestComment::new().set_update_time(Timestamp::default()/* use setters */);
3555 /// ```
3556 pub fn set_update_time<T>(mut self, v: T) -> Self
3557 where
3558 T: std::convert::Into<wkt::Timestamp>,
3559 {
3560 self.update_time = std::option::Option::Some(v.into());
3561 self
3562 }
3563
3564 /// Sets or clears the value of [update_time][crate::model::PullRequestComment::update_time].
3565 ///
3566 /// # Example
3567 /// ```ignore,no_run
3568 /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3569 /// use wkt::Timestamp;
3570 /// let x = PullRequestComment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3571 /// let x = PullRequestComment::new().set_or_clear_update_time(None::<Timestamp>);
3572 /// ```
3573 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3574 where
3575 T: std::convert::Into<wkt::Timestamp>,
3576 {
3577 self.update_time = v.map(|x| x.into());
3578 self
3579 }
3580
3581 /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail].
3582 ///
3583 /// Note that all the setters affecting `comment_detail` are mutually
3584 /// exclusive.
3585 ///
3586 /// # Example
3587 /// ```ignore,no_run
3588 /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3589 /// use google_cloud_securesourcemanager_v1::model::pull_request_comment::Review;
3590 /// let x = PullRequestComment::new().set_comment_detail(Some(
3591 /// google_cloud_securesourcemanager_v1::model::pull_request_comment::CommentDetail::Review(Review::default().into())));
3592 /// ```
3593 pub fn set_comment_detail<
3594 T: std::convert::Into<std::option::Option<crate::model::pull_request_comment::CommentDetail>>,
3595 >(
3596 mut self,
3597 v: T,
3598 ) -> Self {
3599 self.comment_detail = v.into();
3600 self
3601 }
3602
3603 /// The value of [comment_detail][crate::model::PullRequestComment::comment_detail]
3604 /// if it holds a `Review`, `None` if the field is not set or
3605 /// holds a different branch.
3606 pub fn review(
3607 &self,
3608 ) -> std::option::Option<&std::boxed::Box<crate::model::pull_request_comment::Review>> {
3609 #[allow(unreachable_patterns)]
3610 self.comment_detail.as_ref().and_then(|v| match v {
3611 crate::model::pull_request_comment::CommentDetail::Review(v) => {
3612 std::option::Option::Some(v)
3613 }
3614 _ => std::option::Option::None,
3615 })
3616 }
3617
3618 /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail]
3619 /// to hold a `Review`.
3620 ///
3621 /// Note that all the setters affecting `comment_detail` are
3622 /// mutually exclusive.
3623 ///
3624 /// # Example
3625 /// ```ignore,no_run
3626 /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3627 /// use google_cloud_securesourcemanager_v1::model::pull_request_comment::Review;
3628 /// let x = PullRequestComment::new().set_review(Review::default()/* use setters */);
3629 /// assert!(x.review().is_some());
3630 /// assert!(x.comment().is_none());
3631 /// assert!(x.code().is_none());
3632 /// ```
3633 pub fn set_review<
3634 T: std::convert::Into<std::boxed::Box<crate::model::pull_request_comment::Review>>,
3635 >(
3636 mut self,
3637 v: T,
3638 ) -> Self {
3639 self.comment_detail = std::option::Option::Some(
3640 crate::model::pull_request_comment::CommentDetail::Review(v.into()),
3641 );
3642 self
3643 }
3644
3645 /// The value of [comment_detail][crate::model::PullRequestComment::comment_detail]
3646 /// if it holds a `Comment`, `None` if the field is not set or
3647 /// holds a different branch.
3648 pub fn comment(
3649 &self,
3650 ) -> std::option::Option<&std::boxed::Box<crate::model::pull_request_comment::Comment>> {
3651 #[allow(unreachable_patterns)]
3652 self.comment_detail.as_ref().and_then(|v| match v {
3653 crate::model::pull_request_comment::CommentDetail::Comment(v) => {
3654 std::option::Option::Some(v)
3655 }
3656 _ => std::option::Option::None,
3657 })
3658 }
3659
3660 /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail]
3661 /// to hold a `Comment`.
3662 ///
3663 /// Note that all the setters affecting `comment_detail` are
3664 /// mutually exclusive.
3665 ///
3666 /// # Example
3667 /// ```ignore,no_run
3668 /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3669 /// use google_cloud_securesourcemanager_v1::model::pull_request_comment::Comment;
3670 /// let x = PullRequestComment::new().set_comment(Comment::default()/* use setters */);
3671 /// assert!(x.comment().is_some());
3672 /// assert!(x.review().is_none());
3673 /// assert!(x.code().is_none());
3674 /// ```
3675 pub fn set_comment<
3676 T: std::convert::Into<std::boxed::Box<crate::model::pull_request_comment::Comment>>,
3677 >(
3678 mut self,
3679 v: T,
3680 ) -> Self {
3681 self.comment_detail = std::option::Option::Some(
3682 crate::model::pull_request_comment::CommentDetail::Comment(v.into()),
3683 );
3684 self
3685 }
3686
3687 /// The value of [comment_detail][crate::model::PullRequestComment::comment_detail]
3688 /// if it holds a `Code`, `None` if the field is not set or
3689 /// holds a different branch.
3690 pub fn code(
3691 &self,
3692 ) -> std::option::Option<&std::boxed::Box<crate::model::pull_request_comment::Code>> {
3693 #[allow(unreachable_patterns)]
3694 self.comment_detail.as_ref().and_then(|v| match v {
3695 crate::model::pull_request_comment::CommentDetail::Code(v) => {
3696 std::option::Option::Some(v)
3697 }
3698 _ => std::option::Option::None,
3699 })
3700 }
3701
3702 /// Sets the value of [comment_detail][crate::model::PullRequestComment::comment_detail]
3703 /// to hold a `Code`.
3704 ///
3705 /// Note that all the setters affecting `comment_detail` are
3706 /// mutually exclusive.
3707 ///
3708 /// # Example
3709 /// ```ignore,no_run
3710 /// # use google_cloud_securesourcemanager_v1::model::PullRequestComment;
3711 /// use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
3712 /// let x = PullRequestComment::new().set_code(Code::default()/* use setters */);
3713 /// assert!(x.code().is_some());
3714 /// assert!(x.review().is_none());
3715 /// assert!(x.comment().is_none());
3716 /// ```
3717 pub fn set_code<
3718 T: std::convert::Into<std::boxed::Box<crate::model::pull_request_comment::Code>>,
3719 >(
3720 mut self,
3721 v: T,
3722 ) -> Self {
3723 self.comment_detail = std::option::Option::Some(
3724 crate::model::pull_request_comment::CommentDetail::Code(v.into()),
3725 );
3726 self
3727 }
3728}
3729
3730impl wkt::message::Message for PullRequestComment {
3731 fn typename() -> &'static str {
3732 "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment"
3733 }
3734}
3735
3736/// Defines additional types related to [PullRequestComment].
3737pub mod pull_request_comment {
3738 #[allow(unused_imports)]
3739 use super::*;
3740
3741 /// The review summary comment.
3742 #[derive(Clone, Default, PartialEq)]
3743 #[non_exhaustive]
3744 pub struct Review {
3745 /// Required. The review action type.
3746 pub action_type: crate::model::pull_request_comment::review::ActionType,
3747
3748 /// Optional. The comment body.
3749 pub body: std::string::String,
3750
3751 /// Output only. The effective commit sha this review is pointing to.
3752 pub effective_commit_sha: std::string::String,
3753
3754 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3755 }
3756
3757 impl Review {
3758 pub fn new() -> Self {
3759 std::default::Default::default()
3760 }
3761
3762 /// Sets the value of [action_type][crate::model::pull_request_comment::Review::action_type].
3763 ///
3764 /// # Example
3765 /// ```ignore,no_run
3766 /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Review;
3767 /// use google_cloud_securesourcemanager_v1::model::pull_request_comment::review::ActionType;
3768 /// let x0 = Review::new().set_action_type(ActionType::Comment);
3769 /// let x1 = Review::new().set_action_type(ActionType::ChangeRequested);
3770 /// let x2 = Review::new().set_action_type(ActionType::Approved);
3771 /// ```
3772 pub fn set_action_type<
3773 T: std::convert::Into<crate::model::pull_request_comment::review::ActionType>,
3774 >(
3775 mut self,
3776 v: T,
3777 ) -> Self {
3778 self.action_type = v.into();
3779 self
3780 }
3781
3782 /// Sets the value of [body][crate::model::pull_request_comment::Review::body].
3783 ///
3784 /// # Example
3785 /// ```ignore,no_run
3786 /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Review;
3787 /// let x = Review::new().set_body("example");
3788 /// ```
3789 pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3790 self.body = v.into();
3791 self
3792 }
3793
3794 /// Sets the value of [effective_commit_sha][crate::model::pull_request_comment::Review::effective_commit_sha].
3795 ///
3796 /// # Example
3797 /// ```ignore,no_run
3798 /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Review;
3799 /// let x = Review::new().set_effective_commit_sha("example");
3800 /// ```
3801 pub fn set_effective_commit_sha<T: std::convert::Into<std::string::String>>(
3802 mut self,
3803 v: T,
3804 ) -> Self {
3805 self.effective_commit_sha = v.into();
3806 self
3807 }
3808 }
3809
3810 impl wkt::message::Message for Review {
3811 fn typename() -> &'static str {
3812 "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Review"
3813 }
3814 }
3815
3816 /// Defines additional types related to [Review].
3817 pub mod review {
3818 #[allow(unused_imports)]
3819 use super::*;
3820
3821 /// The review action type.
3822 ///
3823 /// # Working with unknown values
3824 ///
3825 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3826 /// additional enum variants at any time. Adding new variants is not considered
3827 /// a breaking change. Applications should write their code in anticipation of:
3828 ///
3829 /// - New values appearing in future releases of the client library, **and**
3830 /// - New values received dynamically, without application changes.
3831 ///
3832 /// Please consult the [Working with enums] section in the user guide for some
3833 /// guidelines.
3834 ///
3835 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3836 #[derive(Clone, Debug, PartialEq)]
3837 #[non_exhaustive]
3838 pub enum ActionType {
3839 /// Unspecified.
3840 Unspecified,
3841 /// A general review comment.
3842 Comment,
3843 /// Change required from this review.
3844 ChangeRequested,
3845 /// Change approved from this review.
3846 Approved,
3847 /// If set, the enum was initialized with an unknown value.
3848 ///
3849 /// Applications can examine the value using [ActionType::value] or
3850 /// [ActionType::name].
3851 UnknownValue(action_type::UnknownValue),
3852 }
3853
3854 #[doc(hidden)]
3855 pub mod action_type {
3856 #[allow(unused_imports)]
3857 use super::*;
3858 #[derive(Clone, Debug, PartialEq)]
3859 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3860 }
3861
3862 impl ActionType {
3863 /// Gets the enum value.
3864 ///
3865 /// Returns `None` if the enum contains an unknown value deserialized from
3866 /// the string representation of enums.
3867 pub fn value(&self) -> std::option::Option<i32> {
3868 match self {
3869 Self::Unspecified => std::option::Option::Some(0),
3870 Self::Comment => std::option::Option::Some(1),
3871 Self::ChangeRequested => std::option::Option::Some(2),
3872 Self::Approved => std::option::Option::Some(3),
3873 Self::UnknownValue(u) => u.0.value(),
3874 }
3875 }
3876
3877 /// Gets the enum value as a string.
3878 ///
3879 /// Returns `None` if the enum contains an unknown value deserialized from
3880 /// the integer representation of enums.
3881 pub fn name(&self) -> std::option::Option<&str> {
3882 match self {
3883 Self::Unspecified => std::option::Option::Some("ACTION_TYPE_UNSPECIFIED"),
3884 Self::Comment => std::option::Option::Some("COMMENT"),
3885 Self::ChangeRequested => std::option::Option::Some("CHANGE_REQUESTED"),
3886 Self::Approved => std::option::Option::Some("APPROVED"),
3887 Self::UnknownValue(u) => u.0.name(),
3888 }
3889 }
3890 }
3891
3892 impl std::default::Default for ActionType {
3893 fn default() -> Self {
3894 use std::convert::From;
3895 Self::from(0)
3896 }
3897 }
3898
3899 impl std::fmt::Display for ActionType {
3900 fn fmt(
3901 &self,
3902 f: &mut std::fmt::Formatter<'_>,
3903 ) -> std::result::Result<(), std::fmt::Error> {
3904 wkt::internal::display_enum(f, self.name(), self.value())
3905 }
3906 }
3907
3908 impl std::convert::From<i32> for ActionType {
3909 fn from(value: i32) -> Self {
3910 match value {
3911 0 => Self::Unspecified,
3912 1 => Self::Comment,
3913 2 => Self::ChangeRequested,
3914 3 => Self::Approved,
3915 _ => Self::UnknownValue(action_type::UnknownValue(
3916 wkt::internal::UnknownEnumValue::Integer(value),
3917 )),
3918 }
3919 }
3920 }
3921
3922 impl std::convert::From<&str> for ActionType {
3923 fn from(value: &str) -> Self {
3924 use std::string::ToString;
3925 match value {
3926 "ACTION_TYPE_UNSPECIFIED" => Self::Unspecified,
3927 "COMMENT" => Self::Comment,
3928 "CHANGE_REQUESTED" => Self::ChangeRequested,
3929 "APPROVED" => Self::Approved,
3930 _ => Self::UnknownValue(action_type::UnknownValue(
3931 wkt::internal::UnknownEnumValue::String(value.to_string()),
3932 )),
3933 }
3934 }
3935 }
3936
3937 impl serde::ser::Serialize for ActionType {
3938 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3939 where
3940 S: serde::Serializer,
3941 {
3942 match self {
3943 Self::Unspecified => serializer.serialize_i32(0),
3944 Self::Comment => serializer.serialize_i32(1),
3945 Self::ChangeRequested => serializer.serialize_i32(2),
3946 Self::Approved => serializer.serialize_i32(3),
3947 Self::UnknownValue(u) => u.0.serialize(serializer),
3948 }
3949 }
3950 }
3951
3952 impl<'de> serde::de::Deserialize<'de> for ActionType {
3953 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3954 where
3955 D: serde::Deserializer<'de>,
3956 {
3957 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActionType>::new(
3958 ".google.cloud.securesourcemanager.v1.PullRequestComment.Review.ActionType",
3959 ))
3960 }
3961 }
3962 }
3963
3964 /// The general pull request comment.
3965 #[derive(Clone, Default, PartialEq)]
3966 #[non_exhaustive]
3967 pub struct Comment {
3968 /// Required. The comment body.
3969 pub body: std::string::String,
3970
3971 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3972 }
3973
3974 impl Comment {
3975 pub fn new() -> Self {
3976 std::default::Default::default()
3977 }
3978
3979 /// Sets the value of [body][crate::model::pull_request_comment::Comment::body].
3980 ///
3981 /// # Example
3982 /// ```ignore,no_run
3983 /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Comment;
3984 /// let x = Comment::new().set_body("example");
3985 /// ```
3986 pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3987 self.body = v.into();
3988 self
3989 }
3990 }
3991
3992 impl wkt::message::Message for Comment {
3993 fn typename() -> &'static str {
3994 "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Comment"
3995 }
3996 }
3997
3998 /// The comment on a code line.
3999 #[derive(Clone, Default, PartialEq)]
4000 #[non_exhaustive]
4001 pub struct Code {
4002 /// Required. The comment body.
4003 pub body: std::string::String,
4004
4005 /// Optional. Input only. The PullRequestComment resource name that this
4006 /// comment is replying to.
4007 pub reply: std::string::String,
4008
4009 /// Optional. The position of the comment.
4010 pub position: std::option::Option<crate::model::pull_request_comment::Position>,
4011
4012 /// Output only. The root comment of the conversation, derived from the reply
4013 /// field.
4014 pub effective_root_comment: std::string::String,
4015
4016 /// Output only. Boolean indicator if the comment is resolved.
4017 pub resolved: bool,
4018
4019 /// Output only. The effective commit sha this code comment is pointing to.
4020 pub effective_commit_sha: std::string::String,
4021
4022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4023 }
4024
4025 impl Code {
4026 pub fn new() -> Self {
4027 std::default::Default::default()
4028 }
4029
4030 /// Sets the value of [body][crate::model::pull_request_comment::Code::body].
4031 ///
4032 /// # Example
4033 /// ```ignore,no_run
4034 /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
4035 /// let x = Code::new().set_body("example");
4036 /// ```
4037 pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4038 self.body = v.into();
4039 self
4040 }
4041
4042 /// Sets the value of [reply][crate::model::pull_request_comment::Code::reply].
4043 ///
4044 /// # Example
4045 /// ```ignore,no_run
4046 /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
4047 /// let x = Code::new().set_reply("example");
4048 /// ```
4049 pub fn set_reply<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4050 self.reply = v.into();
4051 self
4052 }
4053
4054 /// Sets the value of [position][crate::model::pull_request_comment::Code::position].
4055 ///
4056 /// # Example
4057 /// ```ignore,no_run
4058 /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
4059 /// use google_cloud_securesourcemanager_v1::model::pull_request_comment::Position;
4060 /// let x = Code::new().set_position(Position::default()/* use setters */);
4061 /// ```
4062 pub fn set_position<T>(mut self, v: T) -> Self
4063 where
4064 T: std::convert::Into<crate::model::pull_request_comment::Position>,
4065 {
4066 self.position = std::option::Option::Some(v.into());
4067 self
4068 }
4069
4070 /// Sets or clears the value of [position][crate::model::pull_request_comment::Code::position].
4071 ///
4072 /// # Example
4073 /// ```ignore,no_run
4074 /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
4075 /// use google_cloud_securesourcemanager_v1::model::pull_request_comment::Position;
4076 /// let x = Code::new().set_or_clear_position(Some(Position::default()/* use setters */));
4077 /// let x = Code::new().set_or_clear_position(None::<Position>);
4078 /// ```
4079 pub fn set_or_clear_position<T>(mut self, v: std::option::Option<T>) -> Self
4080 where
4081 T: std::convert::Into<crate::model::pull_request_comment::Position>,
4082 {
4083 self.position = v.map(|x| x.into());
4084 self
4085 }
4086
4087 /// Sets the value of [effective_root_comment][crate::model::pull_request_comment::Code::effective_root_comment].
4088 ///
4089 /// # Example
4090 /// ```ignore,no_run
4091 /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
4092 /// let x = Code::new().set_effective_root_comment("example");
4093 /// ```
4094 pub fn set_effective_root_comment<T: std::convert::Into<std::string::String>>(
4095 mut self,
4096 v: T,
4097 ) -> Self {
4098 self.effective_root_comment = v.into();
4099 self
4100 }
4101
4102 /// Sets the value of [resolved][crate::model::pull_request_comment::Code::resolved].
4103 ///
4104 /// # Example
4105 /// ```ignore,no_run
4106 /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
4107 /// let x = Code::new().set_resolved(true);
4108 /// ```
4109 pub fn set_resolved<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4110 self.resolved = v.into();
4111 self
4112 }
4113
4114 /// Sets the value of [effective_commit_sha][crate::model::pull_request_comment::Code::effective_commit_sha].
4115 ///
4116 /// # Example
4117 /// ```ignore,no_run
4118 /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Code;
4119 /// let x = Code::new().set_effective_commit_sha("example");
4120 /// ```
4121 pub fn set_effective_commit_sha<T: std::convert::Into<std::string::String>>(
4122 mut self,
4123 v: T,
4124 ) -> Self {
4125 self.effective_commit_sha = v.into();
4126 self
4127 }
4128 }
4129
4130 impl wkt::message::Message for Code {
4131 fn typename() -> &'static str {
4132 "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Code"
4133 }
4134 }
4135
4136 /// The position of the code comment.
4137 #[derive(Clone, Default, PartialEq)]
4138 #[non_exhaustive]
4139 pub struct Position {
4140 /// Required. The path of the file.
4141 pub path: std::string::String,
4142
4143 /// Required. The line number of the comment. Positive value means it's on
4144 /// the new side of the diff, negative value means it's on the old side.
4145 pub line: i64,
4146
4147 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4148 }
4149
4150 impl Position {
4151 pub fn new() -> Self {
4152 std::default::Default::default()
4153 }
4154
4155 /// Sets the value of [path][crate::model::pull_request_comment::Position::path].
4156 ///
4157 /// # Example
4158 /// ```ignore,no_run
4159 /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Position;
4160 /// let x = Position::new().set_path("example");
4161 /// ```
4162 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4163 self.path = v.into();
4164 self
4165 }
4166
4167 /// Sets the value of [line][crate::model::pull_request_comment::Position::line].
4168 ///
4169 /// # Example
4170 /// ```ignore,no_run
4171 /// # use google_cloud_securesourcemanager_v1::model::pull_request_comment::Position;
4172 /// let x = Position::new().set_line(42);
4173 /// ```
4174 pub fn set_line<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4175 self.line = v.into();
4176 self
4177 }
4178 }
4179
4180 impl wkt::message::Message for Position {
4181 fn typename() -> &'static str {
4182 "type.googleapis.com/google.cloud.securesourcemanager.v1.PullRequestComment.Position"
4183 }
4184 }
4185
4186 /// The comment detail. A comment can be a review, a general comment, or a
4187 /// code comment.
4188 #[derive(Clone, Debug, PartialEq)]
4189 #[non_exhaustive]
4190 pub enum CommentDetail {
4191 /// Optional. The review summary comment.
4192 Review(std::boxed::Box<crate::model::pull_request_comment::Review>),
4193 /// Optional. The general pull request comment.
4194 Comment(std::boxed::Box<crate::model::pull_request_comment::Comment>),
4195 /// Optional. The comment on a code line.
4196 Code(std::boxed::Box<crate::model::pull_request_comment::Code>),
4197 }
4198}
4199
4200/// ListInstancesRequest is the request to list instances.
4201#[derive(Clone, Default, PartialEq)]
4202#[non_exhaustive]
4203pub struct ListInstancesRequest {
4204 /// Required. Parent value for ListInstancesRequest.
4205 pub parent: std::string::String,
4206
4207 /// Optional. Requested page size. Server may return fewer items than
4208 /// requested. If unspecified, server will pick an appropriate default.
4209 pub page_size: i32,
4210
4211 /// Optional. A token identifying a page of results the server should return.
4212 pub page_token: std::string::String,
4213
4214 /// Optional. Filter for filtering results.
4215 pub filter: std::string::String,
4216
4217 /// Optional. Hint for how to order the results.
4218 pub order_by: std::string::String,
4219
4220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4221}
4222
4223impl ListInstancesRequest {
4224 pub fn new() -> Self {
4225 std::default::Default::default()
4226 }
4227
4228 /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
4229 ///
4230 /// # Example
4231 /// ```ignore,no_run
4232 /// # use google_cloud_securesourcemanager_v1::model::ListInstancesRequest;
4233 /// let x = ListInstancesRequest::new().set_parent("example");
4234 /// ```
4235 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4236 self.parent = v.into();
4237 self
4238 }
4239
4240 /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
4241 ///
4242 /// # Example
4243 /// ```ignore,no_run
4244 /// # use google_cloud_securesourcemanager_v1::model::ListInstancesRequest;
4245 /// let x = ListInstancesRequest::new().set_page_size(42);
4246 /// ```
4247 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4248 self.page_size = v.into();
4249 self
4250 }
4251
4252 /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
4253 ///
4254 /// # Example
4255 /// ```ignore,no_run
4256 /// # use google_cloud_securesourcemanager_v1::model::ListInstancesRequest;
4257 /// let x = ListInstancesRequest::new().set_page_token("example");
4258 /// ```
4259 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4260 self.page_token = v.into();
4261 self
4262 }
4263
4264 /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
4265 ///
4266 /// # Example
4267 /// ```ignore,no_run
4268 /// # use google_cloud_securesourcemanager_v1::model::ListInstancesRequest;
4269 /// let x = ListInstancesRequest::new().set_filter("example");
4270 /// ```
4271 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4272 self.filter = v.into();
4273 self
4274 }
4275
4276 /// Sets the value of [order_by][crate::model::ListInstancesRequest::order_by].
4277 ///
4278 /// # Example
4279 /// ```ignore,no_run
4280 /// # use google_cloud_securesourcemanager_v1::model::ListInstancesRequest;
4281 /// let x = ListInstancesRequest::new().set_order_by("example");
4282 /// ```
4283 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4284 self.order_by = v.into();
4285 self
4286 }
4287}
4288
4289impl wkt::message::Message for ListInstancesRequest {
4290 fn typename() -> &'static str {
4291 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListInstancesRequest"
4292 }
4293}
4294
4295#[derive(Clone, Default, PartialEq)]
4296#[non_exhaustive]
4297pub struct ListInstancesResponse {
4298 /// The list of instances.
4299 pub instances: std::vec::Vec<crate::model::Instance>,
4300
4301 /// A token identifying a page of results the server should return.
4302 pub next_page_token: std::string::String,
4303
4304 /// Locations that could not be reached.
4305 pub unreachable: std::vec::Vec<std::string::String>,
4306
4307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4308}
4309
4310impl ListInstancesResponse {
4311 pub fn new() -> Self {
4312 std::default::Default::default()
4313 }
4314
4315 /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
4316 ///
4317 /// # Example
4318 /// ```ignore,no_run
4319 /// # use google_cloud_securesourcemanager_v1::model::ListInstancesResponse;
4320 /// use google_cloud_securesourcemanager_v1::model::Instance;
4321 /// let x = ListInstancesResponse::new()
4322 /// .set_instances([
4323 /// Instance::default()/* use setters */,
4324 /// Instance::default()/* use (different) setters */,
4325 /// ]);
4326 /// ```
4327 pub fn set_instances<T, V>(mut self, v: T) -> Self
4328 where
4329 T: std::iter::IntoIterator<Item = V>,
4330 V: std::convert::Into<crate::model::Instance>,
4331 {
4332 use std::iter::Iterator;
4333 self.instances = v.into_iter().map(|i| i.into()).collect();
4334 self
4335 }
4336
4337 /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
4338 ///
4339 /// # Example
4340 /// ```ignore,no_run
4341 /// # use google_cloud_securesourcemanager_v1::model::ListInstancesResponse;
4342 /// let x = ListInstancesResponse::new().set_next_page_token("example");
4343 /// ```
4344 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4345 self.next_page_token = v.into();
4346 self
4347 }
4348
4349 /// Sets the value of [unreachable][crate::model::ListInstancesResponse::unreachable].
4350 ///
4351 /// # Example
4352 /// ```ignore,no_run
4353 /// # use google_cloud_securesourcemanager_v1::model::ListInstancesResponse;
4354 /// let x = ListInstancesResponse::new().set_unreachable(["a", "b", "c"]);
4355 /// ```
4356 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4357 where
4358 T: std::iter::IntoIterator<Item = V>,
4359 V: std::convert::Into<std::string::String>,
4360 {
4361 use std::iter::Iterator;
4362 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4363 self
4364 }
4365}
4366
4367impl wkt::message::Message for ListInstancesResponse {
4368 fn typename() -> &'static str {
4369 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListInstancesResponse"
4370 }
4371}
4372
4373#[doc(hidden)]
4374impl google_cloud_gax::paginator::internal::PageableResponse for ListInstancesResponse {
4375 type PageItem = crate::model::Instance;
4376
4377 fn items(self) -> std::vec::Vec<Self::PageItem> {
4378 self.instances
4379 }
4380
4381 fn next_page_token(&self) -> std::string::String {
4382 use std::clone::Clone;
4383 self.next_page_token.clone()
4384 }
4385}
4386
4387/// GetInstanceRequest is the request for getting an instance.
4388#[derive(Clone, Default, PartialEq)]
4389#[non_exhaustive]
4390pub struct GetInstanceRequest {
4391 /// Required. Name of the resource.
4392 pub name: std::string::String,
4393
4394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4395}
4396
4397impl GetInstanceRequest {
4398 pub fn new() -> Self {
4399 std::default::Default::default()
4400 }
4401
4402 /// Sets the value of [name][crate::model::GetInstanceRequest::name].
4403 ///
4404 /// # Example
4405 /// ```ignore,no_run
4406 /// # use google_cloud_securesourcemanager_v1::model::GetInstanceRequest;
4407 /// let x = GetInstanceRequest::new().set_name("example");
4408 /// ```
4409 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4410 self.name = v.into();
4411 self
4412 }
4413}
4414
4415impl wkt::message::Message for GetInstanceRequest {
4416 fn typename() -> &'static str {
4417 "type.googleapis.com/google.cloud.securesourcemanager.v1.GetInstanceRequest"
4418 }
4419}
4420
4421/// CreateInstanceRequest is the request for creating an instance.
4422#[derive(Clone, Default, PartialEq)]
4423#[non_exhaustive]
4424pub struct CreateInstanceRequest {
4425 /// Required. Value for parent.
4426 pub parent: std::string::String,
4427
4428 /// Required. ID of the instance to be created.
4429 pub instance_id: std::string::String,
4430
4431 /// Required. The resource being created.
4432 pub instance: std::option::Option<crate::model::Instance>,
4433
4434 /// Optional. An optional request ID to identify requests. Specify a unique
4435 /// request ID so that if you must retry your request, the server will know to
4436 /// ignore the request if it has already been completed. The server will
4437 /// guarantee that for at least 60 minutes since the first request.
4438 ///
4439 /// For example, consider a situation where you make an initial request and
4440 /// the request times out. If you make the request again with the same request
4441 /// ID, the server can check if original operation with the same request ID
4442 /// was received, and if so, will ignore the second request. This prevents
4443 /// clients from accidentally creating duplicate commitments.
4444 ///
4445 /// The request ID must be a valid UUID with the exception that zero UUID is
4446 /// not supported (00000000-0000-0000-0000-000000000000).
4447 pub request_id: std::string::String,
4448
4449 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4450}
4451
4452impl CreateInstanceRequest {
4453 pub fn new() -> Self {
4454 std::default::Default::default()
4455 }
4456
4457 /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
4458 ///
4459 /// # Example
4460 /// ```ignore,no_run
4461 /// # use google_cloud_securesourcemanager_v1::model::CreateInstanceRequest;
4462 /// let x = CreateInstanceRequest::new().set_parent("example");
4463 /// ```
4464 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4465 self.parent = v.into();
4466 self
4467 }
4468
4469 /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
4470 ///
4471 /// # Example
4472 /// ```ignore,no_run
4473 /// # use google_cloud_securesourcemanager_v1::model::CreateInstanceRequest;
4474 /// let x = CreateInstanceRequest::new().set_instance_id("example");
4475 /// ```
4476 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4477 self.instance_id = v.into();
4478 self
4479 }
4480
4481 /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
4482 ///
4483 /// # Example
4484 /// ```ignore,no_run
4485 /// # use google_cloud_securesourcemanager_v1::model::CreateInstanceRequest;
4486 /// use google_cloud_securesourcemanager_v1::model::Instance;
4487 /// let x = CreateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
4488 /// ```
4489 pub fn set_instance<T>(mut self, v: T) -> Self
4490 where
4491 T: std::convert::Into<crate::model::Instance>,
4492 {
4493 self.instance = std::option::Option::Some(v.into());
4494 self
4495 }
4496
4497 /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
4498 ///
4499 /// # Example
4500 /// ```ignore,no_run
4501 /// # use google_cloud_securesourcemanager_v1::model::CreateInstanceRequest;
4502 /// use google_cloud_securesourcemanager_v1::model::Instance;
4503 /// let x = CreateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
4504 /// let x = CreateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
4505 /// ```
4506 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
4507 where
4508 T: std::convert::Into<crate::model::Instance>,
4509 {
4510 self.instance = v.map(|x| x.into());
4511 self
4512 }
4513
4514 /// Sets the value of [request_id][crate::model::CreateInstanceRequest::request_id].
4515 ///
4516 /// # Example
4517 /// ```ignore,no_run
4518 /// # use google_cloud_securesourcemanager_v1::model::CreateInstanceRequest;
4519 /// let x = CreateInstanceRequest::new().set_request_id("example");
4520 /// ```
4521 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4522 self.request_id = v.into();
4523 self
4524 }
4525}
4526
4527impl wkt::message::Message for CreateInstanceRequest {
4528 fn typename() -> &'static str {
4529 "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateInstanceRequest"
4530 }
4531}
4532
4533/// DeleteInstanceRequest is the request for deleting an instance.
4534#[derive(Clone, Default, PartialEq)]
4535#[non_exhaustive]
4536pub struct DeleteInstanceRequest {
4537 /// Required. Name of the resource.
4538 pub name: std::string::String,
4539
4540 /// Optional. An optional request ID to identify requests. Specify a unique
4541 /// request ID so that if you must retry your request, the server will know to
4542 /// ignore the request if it has already been completed. The server will
4543 /// guarantee that for at least 60 minutes after the first request.
4544 ///
4545 /// For example, consider a situation where you make an initial request and
4546 /// the request times out. If you make the request again with the same request
4547 /// ID, the server can check if original operation with the same request ID
4548 /// was received, and if so, will ignore the second request. This prevents
4549 /// clients from accidentally creating duplicate commitments.
4550 ///
4551 /// The request ID must be a valid UUID with the exception that zero UUID is
4552 /// not supported (00000000-0000-0000-0000-000000000000).
4553 pub request_id: std::string::String,
4554
4555 /// Optional. If set to true, will force the deletion of the instance.
4556 pub force: bool,
4557
4558 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4559}
4560
4561impl DeleteInstanceRequest {
4562 pub fn new() -> Self {
4563 std::default::Default::default()
4564 }
4565
4566 /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
4567 ///
4568 /// # Example
4569 /// ```ignore,no_run
4570 /// # use google_cloud_securesourcemanager_v1::model::DeleteInstanceRequest;
4571 /// let x = DeleteInstanceRequest::new().set_name("example");
4572 /// ```
4573 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4574 self.name = v.into();
4575 self
4576 }
4577
4578 /// Sets the value of [request_id][crate::model::DeleteInstanceRequest::request_id].
4579 ///
4580 /// # Example
4581 /// ```ignore,no_run
4582 /// # use google_cloud_securesourcemanager_v1::model::DeleteInstanceRequest;
4583 /// let x = DeleteInstanceRequest::new().set_request_id("example");
4584 /// ```
4585 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4586 self.request_id = v.into();
4587 self
4588 }
4589
4590 /// Sets the value of [force][crate::model::DeleteInstanceRequest::force].
4591 ///
4592 /// # Example
4593 /// ```ignore,no_run
4594 /// # use google_cloud_securesourcemanager_v1::model::DeleteInstanceRequest;
4595 /// let x = DeleteInstanceRequest::new().set_force(true);
4596 /// ```
4597 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4598 self.force = v.into();
4599 self
4600 }
4601}
4602
4603impl wkt::message::Message for DeleteInstanceRequest {
4604 fn typename() -> &'static str {
4605 "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteInstanceRequest"
4606 }
4607}
4608
4609/// Represents the metadata of the long-running operation.
4610#[derive(Clone, Default, PartialEq)]
4611#[non_exhaustive]
4612pub struct OperationMetadata {
4613 /// Output only. The time the operation was created.
4614 pub create_time: std::option::Option<wkt::Timestamp>,
4615
4616 /// Output only. The time the operation finished running.
4617 pub end_time: std::option::Option<wkt::Timestamp>,
4618
4619 /// Output only. Server-defined resource path for the target of the operation.
4620 pub target: std::string::String,
4621
4622 /// Output only. Name of the verb executed by the operation.
4623 pub verb: std::string::String,
4624
4625 /// Output only. Human-readable status of the operation, if any.
4626 pub status_message: std::string::String,
4627
4628 /// Output only. Identifies whether the user has requested cancellation
4629 /// of the operation. Operations that have successfully been cancelled
4630 /// have [Operation.error][google.longrunning.Operation.error] value with a
4631 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
4632 /// `Code.CANCELLED`.
4633 ///
4634 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
4635 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
4636 pub requested_cancellation: bool,
4637
4638 /// Output only. API version used to start the operation.
4639 pub api_version: std::string::String,
4640
4641 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4642}
4643
4644impl OperationMetadata {
4645 pub fn new() -> Self {
4646 std::default::Default::default()
4647 }
4648
4649 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4650 ///
4651 /// # Example
4652 /// ```ignore,no_run
4653 /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
4654 /// use wkt::Timestamp;
4655 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4656 /// ```
4657 pub fn set_create_time<T>(mut self, v: T) -> Self
4658 where
4659 T: std::convert::Into<wkt::Timestamp>,
4660 {
4661 self.create_time = std::option::Option::Some(v.into());
4662 self
4663 }
4664
4665 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4666 ///
4667 /// # Example
4668 /// ```ignore,no_run
4669 /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
4670 /// use wkt::Timestamp;
4671 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4672 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4673 /// ```
4674 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4675 where
4676 T: std::convert::Into<wkt::Timestamp>,
4677 {
4678 self.create_time = v.map(|x| x.into());
4679 self
4680 }
4681
4682 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4683 ///
4684 /// # Example
4685 /// ```ignore,no_run
4686 /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
4687 /// use wkt::Timestamp;
4688 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4689 /// ```
4690 pub fn set_end_time<T>(mut self, v: T) -> Self
4691 where
4692 T: std::convert::Into<wkt::Timestamp>,
4693 {
4694 self.end_time = std::option::Option::Some(v.into());
4695 self
4696 }
4697
4698 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4699 ///
4700 /// # Example
4701 /// ```ignore,no_run
4702 /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
4703 /// use wkt::Timestamp;
4704 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4705 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4706 /// ```
4707 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4708 where
4709 T: std::convert::Into<wkt::Timestamp>,
4710 {
4711 self.end_time = v.map(|x| x.into());
4712 self
4713 }
4714
4715 /// Sets the value of [target][crate::model::OperationMetadata::target].
4716 ///
4717 /// # Example
4718 /// ```ignore,no_run
4719 /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
4720 /// let x = OperationMetadata::new().set_target("example");
4721 /// ```
4722 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4723 self.target = v.into();
4724 self
4725 }
4726
4727 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4728 ///
4729 /// # Example
4730 /// ```ignore,no_run
4731 /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
4732 /// let x = OperationMetadata::new().set_verb("example");
4733 /// ```
4734 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4735 self.verb = v.into();
4736 self
4737 }
4738
4739 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4740 ///
4741 /// # Example
4742 /// ```ignore,no_run
4743 /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
4744 /// let x = OperationMetadata::new().set_status_message("example");
4745 /// ```
4746 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4747 self.status_message = v.into();
4748 self
4749 }
4750
4751 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4752 ///
4753 /// # Example
4754 /// ```ignore,no_run
4755 /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
4756 /// let x = OperationMetadata::new().set_requested_cancellation(true);
4757 /// ```
4758 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4759 self.requested_cancellation = v.into();
4760 self
4761 }
4762
4763 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4764 ///
4765 /// # Example
4766 /// ```ignore,no_run
4767 /// # use google_cloud_securesourcemanager_v1::model::OperationMetadata;
4768 /// let x = OperationMetadata::new().set_api_version("example");
4769 /// ```
4770 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4771 self.api_version = v.into();
4772 self
4773 }
4774}
4775
4776impl wkt::message::Message for OperationMetadata {
4777 fn typename() -> &'static str {
4778 "type.googleapis.com/google.cloud.securesourcemanager.v1.OperationMetadata"
4779 }
4780}
4781
4782/// ListRepositoriesRequest is request to list repositories.
4783#[derive(Clone, Default, PartialEq)]
4784#[non_exhaustive]
4785pub struct ListRepositoriesRequest {
4786 /// Required. Parent value for ListRepositoriesRequest.
4787 pub parent: std::string::String,
4788
4789 /// Optional. Requested page size. If unspecified, a default size of 30 will be
4790 /// used. The maximum value is 100; values above 100 will be coerced to 100.
4791 pub page_size: i32,
4792
4793 /// Optional. A token identifying a page of results the server should return.
4794 pub page_token: std::string::String,
4795
4796 /// Optional. Filter results.
4797 pub filter: std::string::String,
4798
4799 /// Optional. The name of the instance in which the repository is hosted,
4800 /// formatted as
4801 /// `projects/{project_number}/locations/{location_id}/instances/{instance_id}`.
4802 /// When listing repositories via securesourcemanager.googleapis.com, this
4803 /// field is required. When listing repositories via *.sourcemanager.dev, this
4804 /// field is ignored.
4805 pub instance: std::string::String,
4806
4807 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4808}
4809
4810impl ListRepositoriesRequest {
4811 pub fn new() -> Self {
4812 std::default::Default::default()
4813 }
4814
4815 /// Sets the value of [parent][crate::model::ListRepositoriesRequest::parent].
4816 ///
4817 /// # Example
4818 /// ```ignore,no_run
4819 /// # use google_cloud_securesourcemanager_v1::model::ListRepositoriesRequest;
4820 /// let x = ListRepositoriesRequest::new().set_parent("example");
4821 /// ```
4822 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4823 self.parent = v.into();
4824 self
4825 }
4826
4827 /// Sets the value of [page_size][crate::model::ListRepositoriesRequest::page_size].
4828 ///
4829 /// # Example
4830 /// ```ignore,no_run
4831 /// # use google_cloud_securesourcemanager_v1::model::ListRepositoriesRequest;
4832 /// let x = ListRepositoriesRequest::new().set_page_size(42);
4833 /// ```
4834 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4835 self.page_size = v.into();
4836 self
4837 }
4838
4839 /// Sets the value of [page_token][crate::model::ListRepositoriesRequest::page_token].
4840 ///
4841 /// # Example
4842 /// ```ignore,no_run
4843 /// # use google_cloud_securesourcemanager_v1::model::ListRepositoriesRequest;
4844 /// let x = ListRepositoriesRequest::new().set_page_token("example");
4845 /// ```
4846 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4847 self.page_token = v.into();
4848 self
4849 }
4850
4851 /// Sets the value of [filter][crate::model::ListRepositoriesRequest::filter].
4852 ///
4853 /// # Example
4854 /// ```ignore,no_run
4855 /// # use google_cloud_securesourcemanager_v1::model::ListRepositoriesRequest;
4856 /// let x = ListRepositoriesRequest::new().set_filter("example");
4857 /// ```
4858 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4859 self.filter = v.into();
4860 self
4861 }
4862
4863 /// Sets the value of [instance][crate::model::ListRepositoriesRequest::instance].
4864 ///
4865 /// # Example
4866 /// ```ignore,no_run
4867 /// # use google_cloud_securesourcemanager_v1::model::ListRepositoriesRequest;
4868 /// let x = ListRepositoriesRequest::new().set_instance("example");
4869 /// ```
4870 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4871 self.instance = v.into();
4872 self
4873 }
4874}
4875
4876impl wkt::message::Message for ListRepositoriesRequest {
4877 fn typename() -> &'static str {
4878 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListRepositoriesRequest"
4879 }
4880}
4881
4882#[derive(Clone, Default, PartialEq)]
4883#[non_exhaustive]
4884pub struct ListRepositoriesResponse {
4885 /// The list of repositories.
4886 pub repositories: std::vec::Vec<crate::model::Repository>,
4887
4888 /// A token identifying a page of results the server should return.
4889 pub next_page_token: std::string::String,
4890
4891 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4892}
4893
4894impl ListRepositoriesResponse {
4895 pub fn new() -> Self {
4896 std::default::Default::default()
4897 }
4898
4899 /// Sets the value of [repositories][crate::model::ListRepositoriesResponse::repositories].
4900 ///
4901 /// # Example
4902 /// ```ignore,no_run
4903 /// # use google_cloud_securesourcemanager_v1::model::ListRepositoriesResponse;
4904 /// use google_cloud_securesourcemanager_v1::model::Repository;
4905 /// let x = ListRepositoriesResponse::new()
4906 /// .set_repositories([
4907 /// Repository::default()/* use setters */,
4908 /// Repository::default()/* use (different) setters */,
4909 /// ]);
4910 /// ```
4911 pub fn set_repositories<T, V>(mut self, v: T) -> Self
4912 where
4913 T: std::iter::IntoIterator<Item = V>,
4914 V: std::convert::Into<crate::model::Repository>,
4915 {
4916 use std::iter::Iterator;
4917 self.repositories = v.into_iter().map(|i| i.into()).collect();
4918 self
4919 }
4920
4921 /// Sets the value of [next_page_token][crate::model::ListRepositoriesResponse::next_page_token].
4922 ///
4923 /// # Example
4924 /// ```ignore,no_run
4925 /// # use google_cloud_securesourcemanager_v1::model::ListRepositoriesResponse;
4926 /// let x = ListRepositoriesResponse::new().set_next_page_token("example");
4927 /// ```
4928 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4929 self.next_page_token = v.into();
4930 self
4931 }
4932}
4933
4934impl wkt::message::Message for ListRepositoriesResponse {
4935 fn typename() -> &'static str {
4936 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListRepositoriesResponse"
4937 }
4938}
4939
4940#[doc(hidden)]
4941impl google_cloud_gax::paginator::internal::PageableResponse for ListRepositoriesResponse {
4942 type PageItem = crate::model::Repository;
4943
4944 fn items(self) -> std::vec::Vec<Self::PageItem> {
4945 self.repositories
4946 }
4947
4948 fn next_page_token(&self) -> std::string::String {
4949 use std::clone::Clone;
4950 self.next_page_token.clone()
4951 }
4952}
4953
4954/// GetRepositoryRequest is the request for getting a repository.
4955#[derive(Clone, Default, PartialEq)]
4956#[non_exhaustive]
4957pub struct GetRepositoryRequest {
4958 /// Required. Name of the repository to retrieve.
4959 /// The format is
4960 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
4961 pub name: std::string::String,
4962
4963 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4964}
4965
4966impl GetRepositoryRequest {
4967 pub fn new() -> Self {
4968 std::default::Default::default()
4969 }
4970
4971 /// Sets the value of [name][crate::model::GetRepositoryRequest::name].
4972 ///
4973 /// # Example
4974 /// ```ignore,no_run
4975 /// # use google_cloud_securesourcemanager_v1::model::GetRepositoryRequest;
4976 /// let x = GetRepositoryRequest::new().set_name("example");
4977 /// ```
4978 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4979 self.name = v.into();
4980 self
4981 }
4982}
4983
4984impl wkt::message::Message for GetRepositoryRequest {
4985 fn typename() -> &'static str {
4986 "type.googleapis.com/google.cloud.securesourcemanager.v1.GetRepositoryRequest"
4987 }
4988}
4989
4990/// CreateRepositoryRequest is the request for creating a repository.
4991#[derive(Clone, Default, PartialEq)]
4992#[non_exhaustive]
4993pub struct CreateRepositoryRequest {
4994 /// Required. The project in which to create the repository. Values are of the
4995 /// form `projects/{project_number}/locations/{location_id}`
4996 pub parent: std::string::String,
4997
4998 /// Required. The resource being created.
4999 pub repository: std::option::Option<crate::model::Repository>,
5000
5001 /// Required. The ID to use for the repository, which will become the final
5002 /// component of the repository's resource name. This value should be 4-63
5003 /// characters, and valid characters are /[a-z][0-9]-/.
5004 pub repository_id: std::string::String,
5005
5006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5007}
5008
5009impl CreateRepositoryRequest {
5010 pub fn new() -> Self {
5011 std::default::Default::default()
5012 }
5013
5014 /// Sets the value of [parent][crate::model::CreateRepositoryRequest::parent].
5015 ///
5016 /// # Example
5017 /// ```ignore,no_run
5018 /// # use google_cloud_securesourcemanager_v1::model::CreateRepositoryRequest;
5019 /// let x = CreateRepositoryRequest::new().set_parent("example");
5020 /// ```
5021 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5022 self.parent = v.into();
5023 self
5024 }
5025
5026 /// Sets the value of [repository][crate::model::CreateRepositoryRequest::repository].
5027 ///
5028 /// # Example
5029 /// ```ignore,no_run
5030 /// # use google_cloud_securesourcemanager_v1::model::CreateRepositoryRequest;
5031 /// use google_cloud_securesourcemanager_v1::model::Repository;
5032 /// let x = CreateRepositoryRequest::new().set_repository(Repository::default()/* use setters */);
5033 /// ```
5034 pub fn set_repository<T>(mut self, v: T) -> Self
5035 where
5036 T: std::convert::Into<crate::model::Repository>,
5037 {
5038 self.repository = std::option::Option::Some(v.into());
5039 self
5040 }
5041
5042 /// Sets or clears the value of [repository][crate::model::CreateRepositoryRequest::repository].
5043 ///
5044 /// # Example
5045 /// ```ignore,no_run
5046 /// # use google_cloud_securesourcemanager_v1::model::CreateRepositoryRequest;
5047 /// use google_cloud_securesourcemanager_v1::model::Repository;
5048 /// let x = CreateRepositoryRequest::new().set_or_clear_repository(Some(Repository::default()/* use setters */));
5049 /// let x = CreateRepositoryRequest::new().set_or_clear_repository(None::<Repository>);
5050 /// ```
5051 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
5052 where
5053 T: std::convert::Into<crate::model::Repository>,
5054 {
5055 self.repository = v.map(|x| x.into());
5056 self
5057 }
5058
5059 /// Sets the value of [repository_id][crate::model::CreateRepositoryRequest::repository_id].
5060 ///
5061 /// # Example
5062 /// ```ignore,no_run
5063 /// # use google_cloud_securesourcemanager_v1::model::CreateRepositoryRequest;
5064 /// let x = CreateRepositoryRequest::new().set_repository_id("example");
5065 /// ```
5066 pub fn set_repository_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5067 self.repository_id = v.into();
5068 self
5069 }
5070}
5071
5072impl wkt::message::Message for CreateRepositoryRequest {
5073 fn typename() -> &'static str {
5074 "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateRepositoryRequest"
5075 }
5076}
5077
5078/// UpdateRepositoryRequest is the request to update a repository.
5079#[derive(Clone, Default, PartialEq)]
5080#[non_exhaustive]
5081pub struct UpdateRepositoryRequest {
5082 /// Optional. Field mask is used to specify the fields to be overwritten in the
5083 /// repository resource by the update.
5084 /// The fields specified in the update_mask are relative to the resource, not
5085 /// the full request. A field will be overwritten if it is in the mask. If the
5086 /// user does not provide a mask then all fields will be overwritten.
5087 pub update_mask: std::option::Option<wkt::FieldMask>,
5088
5089 /// Required. The repository being updated.
5090 pub repository: std::option::Option<crate::model::Repository>,
5091
5092 /// Optional. False by default. If set to true, the request is validated and
5093 /// the user is provided with an expected result, but no actual change is made.
5094 pub validate_only: bool,
5095
5096 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5097}
5098
5099impl UpdateRepositoryRequest {
5100 pub fn new() -> Self {
5101 std::default::Default::default()
5102 }
5103
5104 /// Sets the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
5105 ///
5106 /// # Example
5107 /// ```ignore,no_run
5108 /// # use google_cloud_securesourcemanager_v1::model::UpdateRepositoryRequest;
5109 /// use wkt::FieldMask;
5110 /// let x = UpdateRepositoryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5111 /// ```
5112 pub fn set_update_mask<T>(mut self, v: T) -> Self
5113 where
5114 T: std::convert::Into<wkt::FieldMask>,
5115 {
5116 self.update_mask = std::option::Option::Some(v.into());
5117 self
5118 }
5119
5120 /// Sets or clears the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
5121 ///
5122 /// # Example
5123 /// ```ignore,no_run
5124 /// # use google_cloud_securesourcemanager_v1::model::UpdateRepositoryRequest;
5125 /// use wkt::FieldMask;
5126 /// let x = UpdateRepositoryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5127 /// let x = UpdateRepositoryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5128 /// ```
5129 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5130 where
5131 T: std::convert::Into<wkt::FieldMask>,
5132 {
5133 self.update_mask = v.map(|x| x.into());
5134 self
5135 }
5136
5137 /// Sets the value of [repository][crate::model::UpdateRepositoryRequest::repository].
5138 ///
5139 /// # Example
5140 /// ```ignore,no_run
5141 /// # use google_cloud_securesourcemanager_v1::model::UpdateRepositoryRequest;
5142 /// use google_cloud_securesourcemanager_v1::model::Repository;
5143 /// let x = UpdateRepositoryRequest::new().set_repository(Repository::default()/* use setters */);
5144 /// ```
5145 pub fn set_repository<T>(mut self, v: T) -> Self
5146 where
5147 T: std::convert::Into<crate::model::Repository>,
5148 {
5149 self.repository = std::option::Option::Some(v.into());
5150 self
5151 }
5152
5153 /// Sets or clears the value of [repository][crate::model::UpdateRepositoryRequest::repository].
5154 ///
5155 /// # Example
5156 /// ```ignore,no_run
5157 /// # use google_cloud_securesourcemanager_v1::model::UpdateRepositoryRequest;
5158 /// use google_cloud_securesourcemanager_v1::model::Repository;
5159 /// let x = UpdateRepositoryRequest::new().set_or_clear_repository(Some(Repository::default()/* use setters */));
5160 /// let x = UpdateRepositoryRequest::new().set_or_clear_repository(None::<Repository>);
5161 /// ```
5162 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
5163 where
5164 T: std::convert::Into<crate::model::Repository>,
5165 {
5166 self.repository = v.map(|x| x.into());
5167 self
5168 }
5169
5170 /// Sets the value of [validate_only][crate::model::UpdateRepositoryRequest::validate_only].
5171 ///
5172 /// # Example
5173 /// ```ignore,no_run
5174 /// # use google_cloud_securesourcemanager_v1::model::UpdateRepositoryRequest;
5175 /// let x = UpdateRepositoryRequest::new().set_validate_only(true);
5176 /// ```
5177 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5178 self.validate_only = v.into();
5179 self
5180 }
5181}
5182
5183impl wkt::message::Message for UpdateRepositoryRequest {
5184 fn typename() -> &'static str {
5185 "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateRepositoryRequest"
5186 }
5187}
5188
5189/// DeleteRepositoryRequest is the request to delete a repository.
5190#[derive(Clone, Default, PartialEq)]
5191#[non_exhaustive]
5192pub struct DeleteRepositoryRequest {
5193 /// Required. Name of the repository to delete.
5194 /// The format is
5195 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
5196 pub name: std::string::String,
5197
5198 /// Optional. If set to true, and the repository is not found, the request will
5199 /// succeed but no action will be taken on the server.
5200 pub allow_missing: bool,
5201
5202 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5203}
5204
5205impl DeleteRepositoryRequest {
5206 pub fn new() -> Self {
5207 std::default::Default::default()
5208 }
5209
5210 /// Sets the value of [name][crate::model::DeleteRepositoryRequest::name].
5211 ///
5212 /// # Example
5213 /// ```ignore,no_run
5214 /// # use google_cloud_securesourcemanager_v1::model::DeleteRepositoryRequest;
5215 /// let x = DeleteRepositoryRequest::new().set_name("example");
5216 /// ```
5217 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5218 self.name = v.into();
5219 self
5220 }
5221
5222 /// Sets the value of [allow_missing][crate::model::DeleteRepositoryRequest::allow_missing].
5223 ///
5224 /// # Example
5225 /// ```ignore,no_run
5226 /// # use google_cloud_securesourcemanager_v1::model::DeleteRepositoryRequest;
5227 /// let x = DeleteRepositoryRequest::new().set_allow_missing(true);
5228 /// ```
5229 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5230 self.allow_missing = v.into();
5231 self
5232 }
5233}
5234
5235impl wkt::message::Message for DeleteRepositoryRequest {
5236 fn typename() -> &'static str {
5237 "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteRepositoryRequest"
5238 }
5239}
5240
5241/// ListHooksRequest is request to list hooks.
5242#[derive(Clone, Default, PartialEq)]
5243#[non_exhaustive]
5244pub struct ListHooksRequest {
5245 /// Required. Parent value for ListHooksRequest.
5246 pub parent: std::string::String,
5247
5248 /// Optional. Requested page size. If unspecified, a default size of 30 will be
5249 /// used. The maximum value is 100; values above 100 will be coerced to 100.
5250 pub page_size: i32,
5251
5252 /// Optional. A token identifying a page of results the server should return.
5253 pub page_token: std::string::String,
5254
5255 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5256}
5257
5258impl ListHooksRequest {
5259 pub fn new() -> Self {
5260 std::default::Default::default()
5261 }
5262
5263 /// Sets the value of [parent][crate::model::ListHooksRequest::parent].
5264 ///
5265 /// # Example
5266 /// ```ignore,no_run
5267 /// # use google_cloud_securesourcemanager_v1::model::ListHooksRequest;
5268 /// let x = ListHooksRequest::new().set_parent("example");
5269 /// ```
5270 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5271 self.parent = v.into();
5272 self
5273 }
5274
5275 /// Sets the value of [page_size][crate::model::ListHooksRequest::page_size].
5276 ///
5277 /// # Example
5278 /// ```ignore,no_run
5279 /// # use google_cloud_securesourcemanager_v1::model::ListHooksRequest;
5280 /// let x = ListHooksRequest::new().set_page_size(42);
5281 /// ```
5282 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5283 self.page_size = v.into();
5284 self
5285 }
5286
5287 /// Sets the value of [page_token][crate::model::ListHooksRequest::page_token].
5288 ///
5289 /// # Example
5290 /// ```ignore,no_run
5291 /// # use google_cloud_securesourcemanager_v1::model::ListHooksRequest;
5292 /// let x = ListHooksRequest::new().set_page_token("example");
5293 /// ```
5294 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5295 self.page_token = v.into();
5296 self
5297 }
5298}
5299
5300impl wkt::message::Message for ListHooksRequest {
5301 fn typename() -> &'static str {
5302 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListHooksRequest"
5303 }
5304}
5305
5306/// ListHooksResponse is response to list hooks.
5307#[derive(Clone, Default, PartialEq)]
5308#[non_exhaustive]
5309pub struct ListHooksResponse {
5310 /// The list of hooks.
5311 pub hooks: std::vec::Vec<crate::model::Hook>,
5312
5313 /// A token identifying a page of results the server should return.
5314 pub next_page_token: std::string::String,
5315
5316 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5317}
5318
5319impl ListHooksResponse {
5320 pub fn new() -> Self {
5321 std::default::Default::default()
5322 }
5323
5324 /// Sets the value of [hooks][crate::model::ListHooksResponse::hooks].
5325 ///
5326 /// # Example
5327 /// ```ignore,no_run
5328 /// # use google_cloud_securesourcemanager_v1::model::ListHooksResponse;
5329 /// use google_cloud_securesourcemanager_v1::model::Hook;
5330 /// let x = ListHooksResponse::new()
5331 /// .set_hooks([
5332 /// Hook::default()/* use setters */,
5333 /// Hook::default()/* use (different) setters */,
5334 /// ]);
5335 /// ```
5336 pub fn set_hooks<T, V>(mut self, v: T) -> Self
5337 where
5338 T: std::iter::IntoIterator<Item = V>,
5339 V: std::convert::Into<crate::model::Hook>,
5340 {
5341 use std::iter::Iterator;
5342 self.hooks = v.into_iter().map(|i| i.into()).collect();
5343 self
5344 }
5345
5346 /// Sets the value of [next_page_token][crate::model::ListHooksResponse::next_page_token].
5347 ///
5348 /// # Example
5349 /// ```ignore,no_run
5350 /// # use google_cloud_securesourcemanager_v1::model::ListHooksResponse;
5351 /// let x = ListHooksResponse::new().set_next_page_token("example");
5352 /// ```
5353 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5354 self.next_page_token = v.into();
5355 self
5356 }
5357}
5358
5359impl wkt::message::Message for ListHooksResponse {
5360 fn typename() -> &'static str {
5361 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListHooksResponse"
5362 }
5363}
5364
5365#[doc(hidden)]
5366impl google_cloud_gax::paginator::internal::PageableResponse for ListHooksResponse {
5367 type PageItem = crate::model::Hook;
5368
5369 fn items(self) -> std::vec::Vec<Self::PageItem> {
5370 self.hooks
5371 }
5372
5373 fn next_page_token(&self) -> std::string::String {
5374 use std::clone::Clone;
5375 self.next_page_token.clone()
5376 }
5377}
5378
5379/// GetHookRequest is the request for getting a hook.
5380#[derive(Clone, Default, PartialEq)]
5381#[non_exhaustive]
5382pub struct GetHookRequest {
5383 /// Required. Name of the hook to retrieve.
5384 /// The format is
5385 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`.
5386 pub name: std::string::String,
5387
5388 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5389}
5390
5391impl GetHookRequest {
5392 pub fn new() -> Self {
5393 std::default::Default::default()
5394 }
5395
5396 /// Sets the value of [name][crate::model::GetHookRequest::name].
5397 ///
5398 /// # Example
5399 /// ```ignore,no_run
5400 /// # use google_cloud_securesourcemanager_v1::model::GetHookRequest;
5401 /// let x = GetHookRequest::new().set_name("example");
5402 /// ```
5403 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5404 self.name = v.into();
5405 self
5406 }
5407}
5408
5409impl wkt::message::Message for GetHookRequest {
5410 fn typename() -> &'static str {
5411 "type.googleapis.com/google.cloud.securesourcemanager.v1.GetHookRequest"
5412 }
5413}
5414
5415/// CreateHookRequest is the request for creating a hook.
5416#[derive(Clone, Default, PartialEq)]
5417#[non_exhaustive]
5418pub struct CreateHookRequest {
5419 /// Required. The repository in which to create the hook. Values are of the
5420 /// form
5421 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
5422 pub parent: std::string::String,
5423
5424 /// Required. The resource being created.
5425 pub hook: std::option::Option<crate::model::Hook>,
5426
5427 /// Required. The ID to use for the hook, which will become the final component
5428 /// of the hook's resource name. This value restricts to lower-case letters,
5429 /// numbers, and hyphen, with the first character a letter, the last a letter
5430 /// or a number, and a 63 character maximum.
5431 pub hook_id: std::string::String,
5432
5433 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5434}
5435
5436impl CreateHookRequest {
5437 pub fn new() -> Self {
5438 std::default::Default::default()
5439 }
5440
5441 /// Sets the value of [parent][crate::model::CreateHookRequest::parent].
5442 ///
5443 /// # Example
5444 /// ```ignore,no_run
5445 /// # use google_cloud_securesourcemanager_v1::model::CreateHookRequest;
5446 /// let x = CreateHookRequest::new().set_parent("example");
5447 /// ```
5448 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5449 self.parent = v.into();
5450 self
5451 }
5452
5453 /// Sets the value of [hook][crate::model::CreateHookRequest::hook].
5454 ///
5455 /// # Example
5456 /// ```ignore,no_run
5457 /// # use google_cloud_securesourcemanager_v1::model::CreateHookRequest;
5458 /// use google_cloud_securesourcemanager_v1::model::Hook;
5459 /// let x = CreateHookRequest::new().set_hook(Hook::default()/* use setters */);
5460 /// ```
5461 pub fn set_hook<T>(mut self, v: T) -> Self
5462 where
5463 T: std::convert::Into<crate::model::Hook>,
5464 {
5465 self.hook = std::option::Option::Some(v.into());
5466 self
5467 }
5468
5469 /// Sets or clears the value of [hook][crate::model::CreateHookRequest::hook].
5470 ///
5471 /// # Example
5472 /// ```ignore,no_run
5473 /// # use google_cloud_securesourcemanager_v1::model::CreateHookRequest;
5474 /// use google_cloud_securesourcemanager_v1::model::Hook;
5475 /// let x = CreateHookRequest::new().set_or_clear_hook(Some(Hook::default()/* use setters */));
5476 /// let x = CreateHookRequest::new().set_or_clear_hook(None::<Hook>);
5477 /// ```
5478 pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
5479 where
5480 T: std::convert::Into<crate::model::Hook>,
5481 {
5482 self.hook = v.map(|x| x.into());
5483 self
5484 }
5485
5486 /// Sets the value of [hook_id][crate::model::CreateHookRequest::hook_id].
5487 ///
5488 /// # Example
5489 /// ```ignore,no_run
5490 /// # use google_cloud_securesourcemanager_v1::model::CreateHookRequest;
5491 /// let x = CreateHookRequest::new().set_hook_id("example");
5492 /// ```
5493 pub fn set_hook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5494 self.hook_id = v.into();
5495 self
5496 }
5497}
5498
5499impl wkt::message::Message for CreateHookRequest {
5500 fn typename() -> &'static str {
5501 "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateHookRequest"
5502 }
5503}
5504
5505/// UpdateHookRequest is the request to update a hook.
5506#[derive(Clone, Default, PartialEq)]
5507#[non_exhaustive]
5508pub struct UpdateHookRequest {
5509 /// Optional. Field mask is used to specify the fields to be overwritten in the
5510 /// hook resource by the update.
5511 /// The fields specified in the update_mask are relative to the resource, not
5512 /// the full request. A field will be overwritten if it is in the mask.
5513 /// The special value "*" means full replacement.
5514 pub update_mask: std::option::Option<wkt::FieldMask>,
5515
5516 /// Required. The hook being updated.
5517 pub hook: std::option::Option<crate::model::Hook>,
5518
5519 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5520}
5521
5522impl UpdateHookRequest {
5523 pub fn new() -> Self {
5524 std::default::Default::default()
5525 }
5526
5527 /// Sets the value of [update_mask][crate::model::UpdateHookRequest::update_mask].
5528 ///
5529 /// # Example
5530 /// ```ignore,no_run
5531 /// # use google_cloud_securesourcemanager_v1::model::UpdateHookRequest;
5532 /// use wkt::FieldMask;
5533 /// let x = UpdateHookRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5534 /// ```
5535 pub fn set_update_mask<T>(mut self, v: T) -> Self
5536 where
5537 T: std::convert::Into<wkt::FieldMask>,
5538 {
5539 self.update_mask = std::option::Option::Some(v.into());
5540 self
5541 }
5542
5543 /// Sets or clears the value of [update_mask][crate::model::UpdateHookRequest::update_mask].
5544 ///
5545 /// # Example
5546 /// ```ignore,no_run
5547 /// # use google_cloud_securesourcemanager_v1::model::UpdateHookRequest;
5548 /// use wkt::FieldMask;
5549 /// let x = UpdateHookRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5550 /// let x = UpdateHookRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5551 /// ```
5552 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5553 where
5554 T: std::convert::Into<wkt::FieldMask>,
5555 {
5556 self.update_mask = v.map(|x| x.into());
5557 self
5558 }
5559
5560 /// Sets the value of [hook][crate::model::UpdateHookRequest::hook].
5561 ///
5562 /// # Example
5563 /// ```ignore,no_run
5564 /// # use google_cloud_securesourcemanager_v1::model::UpdateHookRequest;
5565 /// use google_cloud_securesourcemanager_v1::model::Hook;
5566 /// let x = UpdateHookRequest::new().set_hook(Hook::default()/* use setters */);
5567 /// ```
5568 pub fn set_hook<T>(mut self, v: T) -> Self
5569 where
5570 T: std::convert::Into<crate::model::Hook>,
5571 {
5572 self.hook = std::option::Option::Some(v.into());
5573 self
5574 }
5575
5576 /// Sets or clears the value of [hook][crate::model::UpdateHookRequest::hook].
5577 ///
5578 /// # Example
5579 /// ```ignore,no_run
5580 /// # use google_cloud_securesourcemanager_v1::model::UpdateHookRequest;
5581 /// use google_cloud_securesourcemanager_v1::model::Hook;
5582 /// let x = UpdateHookRequest::new().set_or_clear_hook(Some(Hook::default()/* use setters */));
5583 /// let x = UpdateHookRequest::new().set_or_clear_hook(None::<Hook>);
5584 /// ```
5585 pub fn set_or_clear_hook<T>(mut self, v: std::option::Option<T>) -> Self
5586 where
5587 T: std::convert::Into<crate::model::Hook>,
5588 {
5589 self.hook = v.map(|x| x.into());
5590 self
5591 }
5592}
5593
5594impl wkt::message::Message for UpdateHookRequest {
5595 fn typename() -> &'static str {
5596 "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateHookRequest"
5597 }
5598}
5599
5600/// DeleteHookRequest is the request to delete a hook.
5601#[derive(Clone, Default, PartialEq)]
5602#[non_exhaustive]
5603pub struct DeleteHookRequest {
5604 /// Required. Name of the hook to delete.
5605 /// The format is
5606 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`.
5607 pub name: std::string::String,
5608
5609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5610}
5611
5612impl DeleteHookRequest {
5613 pub fn new() -> Self {
5614 std::default::Default::default()
5615 }
5616
5617 /// Sets the value of [name][crate::model::DeleteHookRequest::name].
5618 ///
5619 /// # Example
5620 /// ```ignore,no_run
5621 /// # use google_cloud_securesourcemanager_v1::model::DeleteHookRequest;
5622 /// let x = DeleteHookRequest::new().set_name("example");
5623 /// ```
5624 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5625 self.name = v.into();
5626 self
5627 }
5628}
5629
5630impl wkt::message::Message for DeleteHookRequest {
5631 fn typename() -> &'static str {
5632 "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteHookRequest"
5633 }
5634}
5635
5636/// GetBranchRuleRequest is the request for getting a branch rule.
5637#[derive(Clone, Default, PartialEq)]
5638#[non_exhaustive]
5639pub struct GetBranchRuleRequest {
5640 /// Required. Name of the repository to retrieve.
5641 /// The format is
5642 /// `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`.
5643 pub name: std::string::String,
5644
5645 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5646}
5647
5648impl GetBranchRuleRequest {
5649 pub fn new() -> Self {
5650 std::default::Default::default()
5651 }
5652
5653 /// Sets the value of [name][crate::model::GetBranchRuleRequest::name].
5654 ///
5655 /// # Example
5656 /// ```ignore,no_run
5657 /// # use google_cloud_securesourcemanager_v1::model::GetBranchRuleRequest;
5658 /// let x = GetBranchRuleRequest::new().set_name("example");
5659 /// ```
5660 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5661 self.name = v.into();
5662 self
5663 }
5664}
5665
5666impl wkt::message::Message for GetBranchRuleRequest {
5667 fn typename() -> &'static str {
5668 "type.googleapis.com/google.cloud.securesourcemanager.v1.GetBranchRuleRequest"
5669 }
5670}
5671
5672/// CreateBranchRuleRequest is the request to create a branch rule.
5673#[derive(Clone, Default, PartialEq)]
5674#[non_exhaustive]
5675pub struct CreateBranchRuleRequest {
5676 pub parent: std::string::String,
5677
5678 pub branch_rule: std::option::Option<crate::model::BranchRule>,
5679
5680 pub branch_rule_id: std::string::String,
5681
5682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5683}
5684
5685impl CreateBranchRuleRequest {
5686 pub fn new() -> Self {
5687 std::default::Default::default()
5688 }
5689
5690 /// Sets the value of [parent][crate::model::CreateBranchRuleRequest::parent].
5691 ///
5692 /// # Example
5693 /// ```ignore,no_run
5694 /// # use google_cloud_securesourcemanager_v1::model::CreateBranchRuleRequest;
5695 /// let x = CreateBranchRuleRequest::new().set_parent("example");
5696 /// ```
5697 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5698 self.parent = v.into();
5699 self
5700 }
5701
5702 /// Sets the value of [branch_rule][crate::model::CreateBranchRuleRequest::branch_rule].
5703 ///
5704 /// # Example
5705 /// ```ignore,no_run
5706 /// # use google_cloud_securesourcemanager_v1::model::CreateBranchRuleRequest;
5707 /// use google_cloud_securesourcemanager_v1::model::BranchRule;
5708 /// let x = CreateBranchRuleRequest::new().set_branch_rule(BranchRule::default()/* use setters */);
5709 /// ```
5710 pub fn set_branch_rule<T>(mut self, v: T) -> Self
5711 where
5712 T: std::convert::Into<crate::model::BranchRule>,
5713 {
5714 self.branch_rule = std::option::Option::Some(v.into());
5715 self
5716 }
5717
5718 /// Sets or clears the value of [branch_rule][crate::model::CreateBranchRuleRequest::branch_rule].
5719 ///
5720 /// # Example
5721 /// ```ignore,no_run
5722 /// # use google_cloud_securesourcemanager_v1::model::CreateBranchRuleRequest;
5723 /// use google_cloud_securesourcemanager_v1::model::BranchRule;
5724 /// let x = CreateBranchRuleRequest::new().set_or_clear_branch_rule(Some(BranchRule::default()/* use setters */));
5725 /// let x = CreateBranchRuleRequest::new().set_or_clear_branch_rule(None::<BranchRule>);
5726 /// ```
5727 pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
5728 where
5729 T: std::convert::Into<crate::model::BranchRule>,
5730 {
5731 self.branch_rule = v.map(|x| x.into());
5732 self
5733 }
5734
5735 /// Sets the value of [branch_rule_id][crate::model::CreateBranchRuleRequest::branch_rule_id].
5736 ///
5737 /// # Example
5738 /// ```ignore,no_run
5739 /// # use google_cloud_securesourcemanager_v1::model::CreateBranchRuleRequest;
5740 /// let x = CreateBranchRuleRequest::new().set_branch_rule_id("example");
5741 /// ```
5742 pub fn set_branch_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5743 self.branch_rule_id = v.into();
5744 self
5745 }
5746}
5747
5748impl wkt::message::Message for CreateBranchRuleRequest {
5749 fn typename() -> &'static str {
5750 "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateBranchRuleRequest"
5751 }
5752}
5753
5754/// ListBranchRulesRequest is the request to list branch rules.
5755#[derive(Clone, Default, PartialEq)]
5756#[non_exhaustive]
5757pub struct ListBranchRulesRequest {
5758 pub parent: std::string::String,
5759
5760 /// Optional. Requested page size. If unspecified, a default size of 30 will be
5761 /// used. The maximum value is 100; values above 100 will be coerced to 100.
5762 pub page_size: i32,
5763
5764 /// Optional. A token identifying a page of results the server should return.
5765 pub page_token: std::string::String,
5766
5767 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5768}
5769
5770impl ListBranchRulesRequest {
5771 pub fn new() -> Self {
5772 std::default::Default::default()
5773 }
5774
5775 /// Sets the value of [parent][crate::model::ListBranchRulesRequest::parent].
5776 ///
5777 /// # Example
5778 /// ```ignore,no_run
5779 /// # use google_cloud_securesourcemanager_v1::model::ListBranchRulesRequest;
5780 /// let x = ListBranchRulesRequest::new().set_parent("example");
5781 /// ```
5782 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5783 self.parent = v.into();
5784 self
5785 }
5786
5787 /// Sets the value of [page_size][crate::model::ListBranchRulesRequest::page_size].
5788 ///
5789 /// # Example
5790 /// ```ignore,no_run
5791 /// # use google_cloud_securesourcemanager_v1::model::ListBranchRulesRequest;
5792 /// let x = ListBranchRulesRequest::new().set_page_size(42);
5793 /// ```
5794 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5795 self.page_size = v.into();
5796 self
5797 }
5798
5799 /// Sets the value of [page_token][crate::model::ListBranchRulesRequest::page_token].
5800 ///
5801 /// # Example
5802 /// ```ignore,no_run
5803 /// # use google_cloud_securesourcemanager_v1::model::ListBranchRulesRequest;
5804 /// let x = ListBranchRulesRequest::new().set_page_token("example");
5805 /// ```
5806 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5807 self.page_token = v.into();
5808 self
5809 }
5810}
5811
5812impl wkt::message::Message for ListBranchRulesRequest {
5813 fn typename() -> &'static str {
5814 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListBranchRulesRequest"
5815 }
5816}
5817
5818/// DeleteBranchRuleRequest is the request to delete a branch rule.
5819#[derive(Clone, Default, PartialEq)]
5820#[non_exhaustive]
5821pub struct DeleteBranchRuleRequest {
5822 pub name: std::string::String,
5823
5824 /// Optional. If set to true, and the branch rule is not found, the request
5825 /// will succeed but no action will be taken on the server.
5826 pub allow_missing: bool,
5827
5828 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5829}
5830
5831impl DeleteBranchRuleRequest {
5832 pub fn new() -> Self {
5833 std::default::Default::default()
5834 }
5835
5836 /// Sets the value of [name][crate::model::DeleteBranchRuleRequest::name].
5837 ///
5838 /// # Example
5839 /// ```ignore,no_run
5840 /// # use google_cloud_securesourcemanager_v1::model::DeleteBranchRuleRequest;
5841 /// let x = DeleteBranchRuleRequest::new().set_name("example");
5842 /// ```
5843 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5844 self.name = v.into();
5845 self
5846 }
5847
5848 /// Sets the value of [allow_missing][crate::model::DeleteBranchRuleRequest::allow_missing].
5849 ///
5850 /// # Example
5851 /// ```ignore,no_run
5852 /// # use google_cloud_securesourcemanager_v1::model::DeleteBranchRuleRequest;
5853 /// let x = DeleteBranchRuleRequest::new().set_allow_missing(true);
5854 /// ```
5855 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5856 self.allow_missing = v.into();
5857 self
5858 }
5859}
5860
5861impl wkt::message::Message for DeleteBranchRuleRequest {
5862 fn typename() -> &'static str {
5863 "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteBranchRuleRequest"
5864 }
5865}
5866
5867/// UpdateBranchRuleRequest is the request to update a branchRule.
5868#[derive(Clone, Default, PartialEq)]
5869#[non_exhaustive]
5870pub struct UpdateBranchRuleRequest {
5871 pub branch_rule: std::option::Option<crate::model::BranchRule>,
5872
5873 /// Optional. If set, validate the request and preview the review, but do not
5874 /// actually post it. (<https://google.aip.dev/163>, for declarative friendly)
5875 pub validate_only: bool,
5876
5877 /// Optional. Field mask is used to specify the fields to be overwritten in the
5878 /// branchRule resource by the update.
5879 /// The fields specified in the update_mask are relative to the resource, not
5880 /// the full request. A field will be overwritten if it is in the mask.
5881 /// The special value "*" means full replacement.
5882 pub update_mask: std::option::Option<wkt::FieldMask>,
5883
5884 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5885}
5886
5887impl UpdateBranchRuleRequest {
5888 pub fn new() -> Self {
5889 std::default::Default::default()
5890 }
5891
5892 /// Sets the value of [branch_rule][crate::model::UpdateBranchRuleRequest::branch_rule].
5893 ///
5894 /// # Example
5895 /// ```ignore,no_run
5896 /// # use google_cloud_securesourcemanager_v1::model::UpdateBranchRuleRequest;
5897 /// use google_cloud_securesourcemanager_v1::model::BranchRule;
5898 /// let x = UpdateBranchRuleRequest::new().set_branch_rule(BranchRule::default()/* use setters */);
5899 /// ```
5900 pub fn set_branch_rule<T>(mut self, v: T) -> Self
5901 where
5902 T: std::convert::Into<crate::model::BranchRule>,
5903 {
5904 self.branch_rule = std::option::Option::Some(v.into());
5905 self
5906 }
5907
5908 /// Sets or clears the value of [branch_rule][crate::model::UpdateBranchRuleRequest::branch_rule].
5909 ///
5910 /// # Example
5911 /// ```ignore,no_run
5912 /// # use google_cloud_securesourcemanager_v1::model::UpdateBranchRuleRequest;
5913 /// use google_cloud_securesourcemanager_v1::model::BranchRule;
5914 /// let x = UpdateBranchRuleRequest::new().set_or_clear_branch_rule(Some(BranchRule::default()/* use setters */));
5915 /// let x = UpdateBranchRuleRequest::new().set_or_clear_branch_rule(None::<BranchRule>);
5916 /// ```
5917 pub fn set_or_clear_branch_rule<T>(mut self, v: std::option::Option<T>) -> Self
5918 where
5919 T: std::convert::Into<crate::model::BranchRule>,
5920 {
5921 self.branch_rule = v.map(|x| x.into());
5922 self
5923 }
5924
5925 /// Sets the value of [validate_only][crate::model::UpdateBranchRuleRequest::validate_only].
5926 ///
5927 /// # Example
5928 /// ```ignore,no_run
5929 /// # use google_cloud_securesourcemanager_v1::model::UpdateBranchRuleRequest;
5930 /// let x = UpdateBranchRuleRequest::new().set_validate_only(true);
5931 /// ```
5932 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5933 self.validate_only = v.into();
5934 self
5935 }
5936
5937 /// Sets the value of [update_mask][crate::model::UpdateBranchRuleRequest::update_mask].
5938 ///
5939 /// # Example
5940 /// ```ignore,no_run
5941 /// # use google_cloud_securesourcemanager_v1::model::UpdateBranchRuleRequest;
5942 /// use wkt::FieldMask;
5943 /// let x = UpdateBranchRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5944 /// ```
5945 pub fn set_update_mask<T>(mut self, v: T) -> Self
5946 where
5947 T: std::convert::Into<wkt::FieldMask>,
5948 {
5949 self.update_mask = std::option::Option::Some(v.into());
5950 self
5951 }
5952
5953 /// Sets or clears the value of [update_mask][crate::model::UpdateBranchRuleRequest::update_mask].
5954 ///
5955 /// # Example
5956 /// ```ignore,no_run
5957 /// # use google_cloud_securesourcemanager_v1::model::UpdateBranchRuleRequest;
5958 /// use wkt::FieldMask;
5959 /// let x = UpdateBranchRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5960 /// let x = UpdateBranchRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5961 /// ```
5962 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5963 where
5964 T: std::convert::Into<wkt::FieldMask>,
5965 {
5966 self.update_mask = v.map(|x| x.into());
5967 self
5968 }
5969}
5970
5971impl wkt::message::Message for UpdateBranchRuleRequest {
5972 fn typename() -> &'static str {
5973 "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateBranchRuleRequest"
5974 }
5975}
5976
5977/// ListBranchRulesResponse is the response to listing branchRules.
5978#[derive(Clone, Default, PartialEq)]
5979#[non_exhaustive]
5980pub struct ListBranchRulesResponse {
5981 /// The list of branch rules.
5982 pub branch_rules: std::vec::Vec<crate::model::BranchRule>,
5983
5984 /// A token identifying a page of results the server should return.
5985 pub next_page_token: std::string::String,
5986
5987 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5988}
5989
5990impl ListBranchRulesResponse {
5991 pub fn new() -> Self {
5992 std::default::Default::default()
5993 }
5994
5995 /// Sets the value of [branch_rules][crate::model::ListBranchRulesResponse::branch_rules].
5996 ///
5997 /// # Example
5998 /// ```ignore,no_run
5999 /// # use google_cloud_securesourcemanager_v1::model::ListBranchRulesResponse;
6000 /// use google_cloud_securesourcemanager_v1::model::BranchRule;
6001 /// let x = ListBranchRulesResponse::new()
6002 /// .set_branch_rules([
6003 /// BranchRule::default()/* use setters */,
6004 /// BranchRule::default()/* use (different) setters */,
6005 /// ]);
6006 /// ```
6007 pub fn set_branch_rules<T, V>(mut self, v: T) -> Self
6008 where
6009 T: std::iter::IntoIterator<Item = V>,
6010 V: std::convert::Into<crate::model::BranchRule>,
6011 {
6012 use std::iter::Iterator;
6013 self.branch_rules = v.into_iter().map(|i| i.into()).collect();
6014 self
6015 }
6016
6017 /// Sets the value of [next_page_token][crate::model::ListBranchRulesResponse::next_page_token].
6018 ///
6019 /// # Example
6020 /// ```ignore,no_run
6021 /// # use google_cloud_securesourcemanager_v1::model::ListBranchRulesResponse;
6022 /// let x = ListBranchRulesResponse::new().set_next_page_token("example");
6023 /// ```
6024 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6025 self.next_page_token = v.into();
6026 self
6027 }
6028}
6029
6030impl wkt::message::Message for ListBranchRulesResponse {
6031 fn typename() -> &'static str {
6032 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListBranchRulesResponse"
6033 }
6034}
6035
6036#[doc(hidden)]
6037impl google_cloud_gax::paginator::internal::PageableResponse for ListBranchRulesResponse {
6038 type PageItem = crate::model::BranchRule;
6039
6040 fn items(self) -> std::vec::Vec<Self::PageItem> {
6041 self.branch_rules
6042 }
6043
6044 fn next_page_token(&self) -> std::string::String {
6045 use std::clone::Clone;
6046 self.next_page_token.clone()
6047 }
6048}
6049
6050/// CreatePullRequestRequest is the request to create a pull request.
6051#[derive(Clone, Default, PartialEq)]
6052#[non_exhaustive]
6053pub struct CreatePullRequestRequest {
6054 /// Required. The repository that the pull request is created from. Format:
6055 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
6056 pub parent: std::string::String,
6057
6058 /// Required. The pull request to create.
6059 pub pull_request: std::option::Option<crate::model::PullRequest>,
6060
6061 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6062}
6063
6064impl CreatePullRequestRequest {
6065 pub fn new() -> Self {
6066 std::default::Default::default()
6067 }
6068
6069 /// Sets the value of [parent][crate::model::CreatePullRequestRequest::parent].
6070 ///
6071 /// # Example
6072 /// ```ignore,no_run
6073 /// # use google_cloud_securesourcemanager_v1::model::CreatePullRequestRequest;
6074 /// let x = CreatePullRequestRequest::new().set_parent("example");
6075 /// ```
6076 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6077 self.parent = v.into();
6078 self
6079 }
6080
6081 /// Sets the value of [pull_request][crate::model::CreatePullRequestRequest::pull_request].
6082 ///
6083 /// # Example
6084 /// ```ignore,no_run
6085 /// # use google_cloud_securesourcemanager_v1::model::CreatePullRequestRequest;
6086 /// use google_cloud_securesourcemanager_v1::model::PullRequest;
6087 /// let x = CreatePullRequestRequest::new().set_pull_request(PullRequest::default()/* use setters */);
6088 /// ```
6089 pub fn set_pull_request<T>(mut self, v: T) -> Self
6090 where
6091 T: std::convert::Into<crate::model::PullRequest>,
6092 {
6093 self.pull_request = std::option::Option::Some(v.into());
6094 self
6095 }
6096
6097 /// Sets or clears the value of [pull_request][crate::model::CreatePullRequestRequest::pull_request].
6098 ///
6099 /// # Example
6100 /// ```ignore,no_run
6101 /// # use google_cloud_securesourcemanager_v1::model::CreatePullRequestRequest;
6102 /// use google_cloud_securesourcemanager_v1::model::PullRequest;
6103 /// let x = CreatePullRequestRequest::new().set_or_clear_pull_request(Some(PullRequest::default()/* use setters */));
6104 /// let x = CreatePullRequestRequest::new().set_or_clear_pull_request(None::<PullRequest>);
6105 /// ```
6106 pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
6107 where
6108 T: std::convert::Into<crate::model::PullRequest>,
6109 {
6110 self.pull_request = v.map(|x| x.into());
6111 self
6112 }
6113}
6114
6115impl wkt::message::Message for CreatePullRequestRequest {
6116 fn typename() -> &'static str {
6117 "type.googleapis.com/google.cloud.securesourcemanager.v1.CreatePullRequestRequest"
6118 }
6119}
6120
6121/// GetPullRequestRequest is the request to get a pull request.
6122#[derive(Clone, Default, PartialEq)]
6123#[non_exhaustive]
6124pub struct GetPullRequestRequest {
6125 /// Required. Name of the pull request to retrieve.
6126 /// The format is
6127 /// `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}`.
6128 pub name: std::string::String,
6129
6130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6131}
6132
6133impl GetPullRequestRequest {
6134 pub fn new() -> Self {
6135 std::default::Default::default()
6136 }
6137
6138 /// Sets the value of [name][crate::model::GetPullRequestRequest::name].
6139 ///
6140 /// # Example
6141 /// ```ignore,no_run
6142 /// # use google_cloud_securesourcemanager_v1::model::GetPullRequestRequest;
6143 /// let x = GetPullRequestRequest::new().set_name("example");
6144 /// ```
6145 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6146 self.name = v.into();
6147 self
6148 }
6149}
6150
6151impl wkt::message::Message for GetPullRequestRequest {
6152 fn typename() -> &'static str {
6153 "type.googleapis.com/google.cloud.securesourcemanager.v1.GetPullRequestRequest"
6154 }
6155}
6156
6157/// ListPullRequestsRequest is the request to list pull requests.
6158#[derive(Clone, Default, PartialEq)]
6159#[non_exhaustive]
6160pub struct ListPullRequestsRequest {
6161 /// Required. The repository in which to list pull requests. Format:
6162 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
6163 pub parent: std::string::String,
6164
6165 /// Optional. Requested page size. If unspecified, a default size of 30 will be
6166 /// used. The maximum value is 100; values above 100 will be coerced to 100.
6167 pub page_size: i32,
6168
6169 /// Optional. A token identifying a page of results the server should return.
6170 pub page_token: std::string::String,
6171
6172 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6173}
6174
6175impl ListPullRequestsRequest {
6176 pub fn new() -> Self {
6177 std::default::Default::default()
6178 }
6179
6180 /// Sets the value of [parent][crate::model::ListPullRequestsRequest::parent].
6181 ///
6182 /// # Example
6183 /// ```ignore,no_run
6184 /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestsRequest;
6185 /// let x = ListPullRequestsRequest::new().set_parent("example");
6186 /// ```
6187 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6188 self.parent = v.into();
6189 self
6190 }
6191
6192 /// Sets the value of [page_size][crate::model::ListPullRequestsRequest::page_size].
6193 ///
6194 /// # Example
6195 /// ```ignore,no_run
6196 /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestsRequest;
6197 /// let x = ListPullRequestsRequest::new().set_page_size(42);
6198 /// ```
6199 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6200 self.page_size = v.into();
6201 self
6202 }
6203
6204 /// Sets the value of [page_token][crate::model::ListPullRequestsRequest::page_token].
6205 ///
6206 /// # Example
6207 /// ```ignore,no_run
6208 /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestsRequest;
6209 /// let x = ListPullRequestsRequest::new().set_page_token("example");
6210 /// ```
6211 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6212 self.page_token = v.into();
6213 self
6214 }
6215}
6216
6217impl wkt::message::Message for ListPullRequestsRequest {
6218 fn typename() -> &'static str {
6219 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestsRequest"
6220 }
6221}
6222
6223/// ListPullRequestsResponse is the response to list pull requests.
6224#[derive(Clone, Default, PartialEq)]
6225#[non_exhaustive]
6226pub struct ListPullRequestsResponse {
6227 /// The list of pull requests.
6228 pub pull_requests: std::vec::Vec<crate::model::PullRequest>,
6229
6230 /// A token identifying a page of results the server should return.
6231 pub next_page_token: std::string::String,
6232
6233 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6234}
6235
6236impl ListPullRequestsResponse {
6237 pub fn new() -> Self {
6238 std::default::Default::default()
6239 }
6240
6241 /// Sets the value of [pull_requests][crate::model::ListPullRequestsResponse::pull_requests].
6242 ///
6243 /// # Example
6244 /// ```ignore,no_run
6245 /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestsResponse;
6246 /// use google_cloud_securesourcemanager_v1::model::PullRequest;
6247 /// let x = ListPullRequestsResponse::new()
6248 /// .set_pull_requests([
6249 /// PullRequest::default()/* use setters */,
6250 /// PullRequest::default()/* use (different) setters */,
6251 /// ]);
6252 /// ```
6253 pub fn set_pull_requests<T, V>(mut self, v: T) -> Self
6254 where
6255 T: std::iter::IntoIterator<Item = V>,
6256 V: std::convert::Into<crate::model::PullRequest>,
6257 {
6258 use std::iter::Iterator;
6259 self.pull_requests = v.into_iter().map(|i| i.into()).collect();
6260 self
6261 }
6262
6263 /// Sets the value of [next_page_token][crate::model::ListPullRequestsResponse::next_page_token].
6264 ///
6265 /// # Example
6266 /// ```ignore,no_run
6267 /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestsResponse;
6268 /// let x = ListPullRequestsResponse::new().set_next_page_token("example");
6269 /// ```
6270 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6271 self.next_page_token = v.into();
6272 self
6273 }
6274}
6275
6276impl wkt::message::Message for ListPullRequestsResponse {
6277 fn typename() -> &'static str {
6278 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestsResponse"
6279 }
6280}
6281
6282#[doc(hidden)]
6283impl google_cloud_gax::paginator::internal::PageableResponse for ListPullRequestsResponse {
6284 type PageItem = crate::model::PullRequest;
6285
6286 fn items(self) -> std::vec::Vec<Self::PageItem> {
6287 self.pull_requests
6288 }
6289
6290 fn next_page_token(&self) -> std::string::String {
6291 use std::clone::Clone;
6292 self.next_page_token.clone()
6293 }
6294}
6295
6296/// UpdatePullRequestRequest is the request to update a pull request.
6297#[derive(Clone, Default, PartialEq)]
6298#[non_exhaustive]
6299pub struct UpdatePullRequestRequest {
6300 /// Required. The pull request to update.
6301 pub pull_request: std::option::Option<crate::model::PullRequest>,
6302
6303 /// Optional. Field mask is used to specify the fields to be overwritten in the
6304 /// pull request resource by the update.
6305 /// The fields specified in the update_mask are relative to the resource, not
6306 /// the full request. A field will be overwritten if it is in the mask.
6307 /// The special value "*" means full replacement.
6308 pub update_mask: std::option::Option<wkt::FieldMask>,
6309
6310 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6311}
6312
6313impl UpdatePullRequestRequest {
6314 pub fn new() -> Self {
6315 std::default::Default::default()
6316 }
6317
6318 /// Sets the value of [pull_request][crate::model::UpdatePullRequestRequest::pull_request].
6319 ///
6320 /// # Example
6321 /// ```ignore,no_run
6322 /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestRequest;
6323 /// use google_cloud_securesourcemanager_v1::model::PullRequest;
6324 /// let x = UpdatePullRequestRequest::new().set_pull_request(PullRequest::default()/* use setters */);
6325 /// ```
6326 pub fn set_pull_request<T>(mut self, v: T) -> Self
6327 where
6328 T: std::convert::Into<crate::model::PullRequest>,
6329 {
6330 self.pull_request = std::option::Option::Some(v.into());
6331 self
6332 }
6333
6334 /// Sets or clears the value of [pull_request][crate::model::UpdatePullRequestRequest::pull_request].
6335 ///
6336 /// # Example
6337 /// ```ignore,no_run
6338 /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestRequest;
6339 /// use google_cloud_securesourcemanager_v1::model::PullRequest;
6340 /// let x = UpdatePullRequestRequest::new().set_or_clear_pull_request(Some(PullRequest::default()/* use setters */));
6341 /// let x = UpdatePullRequestRequest::new().set_or_clear_pull_request(None::<PullRequest>);
6342 /// ```
6343 pub fn set_or_clear_pull_request<T>(mut self, v: std::option::Option<T>) -> Self
6344 where
6345 T: std::convert::Into<crate::model::PullRequest>,
6346 {
6347 self.pull_request = v.map(|x| x.into());
6348 self
6349 }
6350
6351 /// Sets the value of [update_mask][crate::model::UpdatePullRequestRequest::update_mask].
6352 ///
6353 /// # Example
6354 /// ```ignore,no_run
6355 /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestRequest;
6356 /// use wkt::FieldMask;
6357 /// let x = UpdatePullRequestRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6358 /// ```
6359 pub fn set_update_mask<T>(mut self, v: T) -> Self
6360 where
6361 T: std::convert::Into<wkt::FieldMask>,
6362 {
6363 self.update_mask = std::option::Option::Some(v.into());
6364 self
6365 }
6366
6367 /// Sets or clears the value of [update_mask][crate::model::UpdatePullRequestRequest::update_mask].
6368 ///
6369 /// # Example
6370 /// ```ignore,no_run
6371 /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestRequest;
6372 /// use wkt::FieldMask;
6373 /// let x = UpdatePullRequestRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6374 /// let x = UpdatePullRequestRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6375 /// ```
6376 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6377 where
6378 T: std::convert::Into<wkt::FieldMask>,
6379 {
6380 self.update_mask = v.map(|x| x.into());
6381 self
6382 }
6383}
6384
6385impl wkt::message::Message for UpdatePullRequestRequest {
6386 fn typename() -> &'static str {
6387 "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdatePullRequestRequest"
6388 }
6389}
6390
6391/// MergePullRequestRequest is the request to merge a pull request.
6392#[derive(Clone, Default, PartialEq)]
6393#[non_exhaustive]
6394pub struct MergePullRequestRequest {
6395 /// Required. The pull request to merge.
6396 /// Format:
6397 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
6398 pub name: std::string::String,
6399
6400 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6401}
6402
6403impl MergePullRequestRequest {
6404 pub fn new() -> Self {
6405 std::default::Default::default()
6406 }
6407
6408 /// Sets the value of [name][crate::model::MergePullRequestRequest::name].
6409 ///
6410 /// # Example
6411 /// ```ignore,no_run
6412 /// # use google_cloud_securesourcemanager_v1::model::MergePullRequestRequest;
6413 /// let x = MergePullRequestRequest::new().set_name("example");
6414 /// ```
6415 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6416 self.name = v.into();
6417 self
6418 }
6419}
6420
6421impl wkt::message::Message for MergePullRequestRequest {
6422 fn typename() -> &'static str {
6423 "type.googleapis.com/google.cloud.securesourcemanager.v1.MergePullRequestRequest"
6424 }
6425}
6426
6427/// OpenPullRequestRequest is the request to open a pull request.
6428#[derive(Clone, Default, PartialEq)]
6429#[non_exhaustive]
6430pub struct OpenPullRequestRequest {
6431 /// Required. The pull request to open.
6432 /// Format:
6433 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
6434 pub name: std::string::String,
6435
6436 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6437}
6438
6439impl OpenPullRequestRequest {
6440 pub fn new() -> Self {
6441 std::default::Default::default()
6442 }
6443
6444 /// Sets the value of [name][crate::model::OpenPullRequestRequest::name].
6445 ///
6446 /// # Example
6447 /// ```ignore,no_run
6448 /// # use google_cloud_securesourcemanager_v1::model::OpenPullRequestRequest;
6449 /// let x = OpenPullRequestRequest::new().set_name("example");
6450 /// ```
6451 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6452 self.name = v.into();
6453 self
6454 }
6455}
6456
6457impl wkt::message::Message for OpenPullRequestRequest {
6458 fn typename() -> &'static str {
6459 "type.googleapis.com/google.cloud.securesourcemanager.v1.OpenPullRequestRequest"
6460 }
6461}
6462
6463/// ClosePullRequestRequest is the request to close a pull request.
6464#[derive(Clone, Default, PartialEq)]
6465#[non_exhaustive]
6466pub struct ClosePullRequestRequest {
6467 /// Required. The pull request to close.
6468 /// Format:
6469 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
6470 pub name: std::string::String,
6471
6472 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6473}
6474
6475impl ClosePullRequestRequest {
6476 pub fn new() -> Self {
6477 std::default::Default::default()
6478 }
6479
6480 /// Sets the value of [name][crate::model::ClosePullRequestRequest::name].
6481 ///
6482 /// # Example
6483 /// ```ignore,no_run
6484 /// # use google_cloud_securesourcemanager_v1::model::ClosePullRequestRequest;
6485 /// let x = ClosePullRequestRequest::new().set_name("example");
6486 /// ```
6487 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6488 self.name = v.into();
6489 self
6490 }
6491}
6492
6493impl wkt::message::Message for ClosePullRequestRequest {
6494 fn typename() -> &'static str {
6495 "type.googleapis.com/google.cloud.securesourcemanager.v1.ClosePullRequestRequest"
6496 }
6497}
6498
6499/// ListPullRequestFileDiffsRequest is the request to list pull request file
6500/// diffs.
6501#[derive(Clone, Default, PartialEq)]
6502#[non_exhaustive]
6503pub struct ListPullRequestFileDiffsRequest {
6504 /// Required. The pull request to list file diffs for.
6505 /// Format:
6506 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
6507 pub name: std::string::String,
6508
6509 /// Optional. Requested page size. If unspecified, a default size of 30 will be
6510 /// used. The maximum value is 100; values above 100 will be coerced to 100.
6511 pub page_size: i32,
6512
6513 /// Optional. A token identifying a page of results the server should return.
6514 pub page_token: std::string::String,
6515
6516 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6517}
6518
6519impl ListPullRequestFileDiffsRequest {
6520 pub fn new() -> Self {
6521 std::default::Default::default()
6522 }
6523
6524 /// Sets the value of [name][crate::model::ListPullRequestFileDiffsRequest::name].
6525 ///
6526 /// # Example
6527 /// ```ignore,no_run
6528 /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestFileDiffsRequest;
6529 /// let x = ListPullRequestFileDiffsRequest::new().set_name("example");
6530 /// ```
6531 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6532 self.name = v.into();
6533 self
6534 }
6535
6536 /// Sets the value of [page_size][crate::model::ListPullRequestFileDiffsRequest::page_size].
6537 ///
6538 /// # Example
6539 /// ```ignore,no_run
6540 /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestFileDiffsRequest;
6541 /// let x = ListPullRequestFileDiffsRequest::new().set_page_size(42);
6542 /// ```
6543 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6544 self.page_size = v.into();
6545 self
6546 }
6547
6548 /// Sets the value of [page_token][crate::model::ListPullRequestFileDiffsRequest::page_token].
6549 ///
6550 /// # Example
6551 /// ```ignore,no_run
6552 /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestFileDiffsRequest;
6553 /// let x = ListPullRequestFileDiffsRequest::new().set_page_token("example");
6554 /// ```
6555 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6556 self.page_token = v.into();
6557 self
6558 }
6559}
6560
6561impl wkt::message::Message for ListPullRequestFileDiffsRequest {
6562 fn typename() -> &'static str {
6563 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsRequest"
6564 }
6565}
6566
6567/// ListPullRequestFileDiffsResponse is the response containing file diffs
6568/// returned from ListPullRequestFileDiffs.
6569#[derive(Clone, Default, PartialEq)]
6570#[non_exhaustive]
6571pub struct ListPullRequestFileDiffsResponse {
6572 /// The list of pull request file diffs.
6573 pub file_diffs: std::vec::Vec<crate::model::FileDiff>,
6574
6575 /// A token identifying a page of results the server should return.
6576 pub next_page_token: std::string::String,
6577
6578 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6579}
6580
6581impl ListPullRequestFileDiffsResponse {
6582 pub fn new() -> Self {
6583 std::default::Default::default()
6584 }
6585
6586 /// Sets the value of [file_diffs][crate::model::ListPullRequestFileDiffsResponse::file_diffs].
6587 ///
6588 /// # Example
6589 /// ```ignore,no_run
6590 /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestFileDiffsResponse;
6591 /// use google_cloud_securesourcemanager_v1::model::FileDiff;
6592 /// let x = ListPullRequestFileDiffsResponse::new()
6593 /// .set_file_diffs([
6594 /// FileDiff::default()/* use setters */,
6595 /// FileDiff::default()/* use (different) setters */,
6596 /// ]);
6597 /// ```
6598 pub fn set_file_diffs<T, V>(mut self, v: T) -> Self
6599 where
6600 T: std::iter::IntoIterator<Item = V>,
6601 V: std::convert::Into<crate::model::FileDiff>,
6602 {
6603 use std::iter::Iterator;
6604 self.file_diffs = v.into_iter().map(|i| i.into()).collect();
6605 self
6606 }
6607
6608 /// Sets the value of [next_page_token][crate::model::ListPullRequestFileDiffsResponse::next_page_token].
6609 ///
6610 /// # Example
6611 /// ```ignore,no_run
6612 /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestFileDiffsResponse;
6613 /// let x = ListPullRequestFileDiffsResponse::new().set_next_page_token("example");
6614 /// ```
6615 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6616 self.next_page_token = v.into();
6617 self
6618 }
6619}
6620
6621impl wkt::message::Message for ListPullRequestFileDiffsResponse {
6622 fn typename() -> &'static str {
6623 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestFileDiffsResponse"
6624 }
6625}
6626
6627#[doc(hidden)]
6628impl google_cloud_gax::paginator::internal::PageableResponse for ListPullRequestFileDiffsResponse {
6629 type PageItem = crate::model::FileDiff;
6630
6631 fn items(self) -> std::vec::Vec<Self::PageItem> {
6632 self.file_diffs
6633 }
6634
6635 fn next_page_token(&self) -> std::string::String {
6636 use std::clone::Clone;
6637 self.next_page_token.clone()
6638 }
6639}
6640
6641/// The request to create an issue.
6642#[derive(Clone, Default, PartialEq)]
6643#[non_exhaustive]
6644pub struct CreateIssueRequest {
6645 /// Required. The repository in which to create the issue. Format:
6646 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
6647 pub parent: std::string::String,
6648
6649 /// Required. The issue to create.
6650 pub issue: std::option::Option<crate::model::Issue>,
6651
6652 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6653}
6654
6655impl CreateIssueRequest {
6656 pub fn new() -> Self {
6657 std::default::Default::default()
6658 }
6659
6660 /// Sets the value of [parent][crate::model::CreateIssueRequest::parent].
6661 ///
6662 /// # Example
6663 /// ```ignore,no_run
6664 /// # use google_cloud_securesourcemanager_v1::model::CreateIssueRequest;
6665 /// let x = CreateIssueRequest::new().set_parent("example");
6666 /// ```
6667 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6668 self.parent = v.into();
6669 self
6670 }
6671
6672 /// Sets the value of [issue][crate::model::CreateIssueRequest::issue].
6673 ///
6674 /// # Example
6675 /// ```ignore,no_run
6676 /// # use google_cloud_securesourcemanager_v1::model::CreateIssueRequest;
6677 /// use google_cloud_securesourcemanager_v1::model::Issue;
6678 /// let x = CreateIssueRequest::new().set_issue(Issue::default()/* use setters */);
6679 /// ```
6680 pub fn set_issue<T>(mut self, v: T) -> Self
6681 where
6682 T: std::convert::Into<crate::model::Issue>,
6683 {
6684 self.issue = std::option::Option::Some(v.into());
6685 self
6686 }
6687
6688 /// Sets or clears the value of [issue][crate::model::CreateIssueRequest::issue].
6689 ///
6690 /// # Example
6691 /// ```ignore,no_run
6692 /// # use google_cloud_securesourcemanager_v1::model::CreateIssueRequest;
6693 /// use google_cloud_securesourcemanager_v1::model::Issue;
6694 /// let x = CreateIssueRequest::new().set_or_clear_issue(Some(Issue::default()/* use setters */));
6695 /// let x = CreateIssueRequest::new().set_or_clear_issue(None::<Issue>);
6696 /// ```
6697 pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
6698 where
6699 T: std::convert::Into<crate::model::Issue>,
6700 {
6701 self.issue = v.map(|x| x.into());
6702 self
6703 }
6704}
6705
6706impl wkt::message::Message for CreateIssueRequest {
6707 fn typename() -> &'static str {
6708 "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateIssueRequest"
6709 }
6710}
6711
6712/// The request to get an issue.
6713#[derive(Clone, Default, PartialEq)]
6714#[non_exhaustive]
6715pub struct GetIssueRequest {
6716 /// Required. Name of the issue to retrieve.
6717 /// The format is
6718 /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`.
6719 pub name: std::string::String,
6720
6721 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6722}
6723
6724impl GetIssueRequest {
6725 pub fn new() -> Self {
6726 std::default::Default::default()
6727 }
6728
6729 /// Sets the value of [name][crate::model::GetIssueRequest::name].
6730 ///
6731 /// # Example
6732 /// ```ignore,no_run
6733 /// # use google_cloud_securesourcemanager_v1::model::GetIssueRequest;
6734 /// let x = GetIssueRequest::new().set_name("example");
6735 /// ```
6736 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6737 self.name = v.into();
6738 self
6739 }
6740}
6741
6742impl wkt::message::Message for GetIssueRequest {
6743 fn typename() -> &'static str {
6744 "type.googleapis.com/google.cloud.securesourcemanager.v1.GetIssueRequest"
6745 }
6746}
6747
6748/// The request to list issues.
6749#[derive(Clone, Default, PartialEq)]
6750#[non_exhaustive]
6751pub struct ListIssuesRequest {
6752 /// Required. The repository in which to list issues. Format:
6753 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
6754 pub parent: std::string::String,
6755
6756 /// Optional. Requested page size. If unspecified, a default size of 30 will be
6757 /// used. The maximum value is 100; values above 100 will be coerced to 100.
6758 pub page_size: i32,
6759
6760 /// Optional. A token identifying a page of results the server should return.
6761 pub page_token: std::string::String,
6762
6763 /// Optional. Used to filter the resulting issues list.
6764 pub filter: std::string::String,
6765
6766 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6767}
6768
6769impl ListIssuesRequest {
6770 pub fn new() -> Self {
6771 std::default::Default::default()
6772 }
6773
6774 /// Sets the value of [parent][crate::model::ListIssuesRequest::parent].
6775 ///
6776 /// # Example
6777 /// ```ignore,no_run
6778 /// # use google_cloud_securesourcemanager_v1::model::ListIssuesRequest;
6779 /// let x = ListIssuesRequest::new().set_parent("example");
6780 /// ```
6781 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6782 self.parent = v.into();
6783 self
6784 }
6785
6786 /// Sets the value of [page_size][crate::model::ListIssuesRequest::page_size].
6787 ///
6788 /// # Example
6789 /// ```ignore,no_run
6790 /// # use google_cloud_securesourcemanager_v1::model::ListIssuesRequest;
6791 /// let x = ListIssuesRequest::new().set_page_size(42);
6792 /// ```
6793 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6794 self.page_size = v.into();
6795 self
6796 }
6797
6798 /// Sets the value of [page_token][crate::model::ListIssuesRequest::page_token].
6799 ///
6800 /// # Example
6801 /// ```ignore,no_run
6802 /// # use google_cloud_securesourcemanager_v1::model::ListIssuesRequest;
6803 /// let x = ListIssuesRequest::new().set_page_token("example");
6804 /// ```
6805 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6806 self.page_token = v.into();
6807 self
6808 }
6809
6810 /// Sets the value of [filter][crate::model::ListIssuesRequest::filter].
6811 ///
6812 /// # Example
6813 /// ```ignore,no_run
6814 /// # use google_cloud_securesourcemanager_v1::model::ListIssuesRequest;
6815 /// let x = ListIssuesRequest::new().set_filter("example");
6816 /// ```
6817 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6818 self.filter = v.into();
6819 self
6820 }
6821}
6822
6823impl wkt::message::Message for ListIssuesRequest {
6824 fn typename() -> &'static str {
6825 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssuesRequest"
6826 }
6827}
6828
6829/// The response to list issues.
6830#[derive(Clone, Default, PartialEq)]
6831#[non_exhaustive]
6832pub struct ListIssuesResponse {
6833 /// The list of issues.
6834 pub issues: std::vec::Vec<crate::model::Issue>,
6835
6836 /// A token identifying a page of results the server should return.
6837 pub next_page_token: std::string::String,
6838
6839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6840}
6841
6842impl ListIssuesResponse {
6843 pub fn new() -> Self {
6844 std::default::Default::default()
6845 }
6846
6847 /// Sets the value of [issues][crate::model::ListIssuesResponse::issues].
6848 ///
6849 /// # Example
6850 /// ```ignore,no_run
6851 /// # use google_cloud_securesourcemanager_v1::model::ListIssuesResponse;
6852 /// use google_cloud_securesourcemanager_v1::model::Issue;
6853 /// let x = ListIssuesResponse::new()
6854 /// .set_issues([
6855 /// Issue::default()/* use setters */,
6856 /// Issue::default()/* use (different) setters */,
6857 /// ]);
6858 /// ```
6859 pub fn set_issues<T, V>(mut self, v: T) -> Self
6860 where
6861 T: std::iter::IntoIterator<Item = V>,
6862 V: std::convert::Into<crate::model::Issue>,
6863 {
6864 use std::iter::Iterator;
6865 self.issues = v.into_iter().map(|i| i.into()).collect();
6866 self
6867 }
6868
6869 /// Sets the value of [next_page_token][crate::model::ListIssuesResponse::next_page_token].
6870 ///
6871 /// # Example
6872 /// ```ignore,no_run
6873 /// # use google_cloud_securesourcemanager_v1::model::ListIssuesResponse;
6874 /// let x = ListIssuesResponse::new().set_next_page_token("example");
6875 /// ```
6876 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6877 self.next_page_token = v.into();
6878 self
6879 }
6880}
6881
6882impl wkt::message::Message for ListIssuesResponse {
6883 fn typename() -> &'static str {
6884 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssuesResponse"
6885 }
6886}
6887
6888#[doc(hidden)]
6889impl google_cloud_gax::paginator::internal::PageableResponse for ListIssuesResponse {
6890 type PageItem = crate::model::Issue;
6891
6892 fn items(self) -> std::vec::Vec<Self::PageItem> {
6893 self.issues
6894 }
6895
6896 fn next_page_token(&self) -> std::string::String {
6897 use std::clone::Clone;
6898 self.next_page_token.clone()
6899 }
6900}
6901
6902/// The request to update an issue.
6903#[derive(Clone, Default, PartialEq)]
6904#[non_exhaustive]
6905pub struct UpdateIssueRequest {
6906 /// Required. The issue to update.
6907 pub issue: std::option::Option<crate::model::Issue>,
6908
6909 /// Optional. Field mask is used to specify the fields to be overwritten in the
6910 /// issue resource by the update.
6911 /// The fields specified in the update_mask are relative to the resource, not
6912 /// the full request. A field will be overwritten if it is in the mask.
6913 /// The special value "*" means full replacement.
6914 pub update_mask: std::option::Option<wkt::FieldMask>,
6915
6916 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6917}
6918
6919impl UpdateIssueRequest {
6920 pub fn new() -> Self {
6921 std::default::Default::default()
6922 }
6923
6924 /// Sets the value of [issue][crate::model::UpdateIssueRequest::issue].
6925 ///
6926 /// # Example
6927 /// ```ignore,no_run
6928 /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueRequest;
6929 /// use google_cloud_securesourcemanager_v1::model::Issue;
6930 /// let x = UpdateIssueRequest::new().set_issue(Issue::default()/* use setters */);
6931 /// ```
6932 pub fn set_issue<T>(mut self, v: T) -> Self
6933 where
6934 T: std::convert::Into<crate::model::Issue>,
6935 {
6936 self.issue = std::option::Option::Some(v.into());
6937 self
6938 }
6939
6940 /// Sets or clears the value of [issue][crate::model::UpdateIssueRequest::issue].
6941 ///
6942 /// # Example
6943 /// ```ignore,no_run
6944 /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueRequest;
6945 /// use google_cloud_securesourcemanager_v1::model::Issue;
6946 /// let x = UpdateIssueRequest::new().set_or_clear_issue(Some(Issue::default()/* use setters */));
6947 /// let x = UpdateIssueRequest::new().set_or_clear_issue(None::<Issue>);
6948 /// ```
6949 pub fn set_or_clear_issue<T>(mut self, v: std::option::Option<T>) -> Self
6950 where
6951 T: std::convert::Into<crate::model::Issue>,
6952 {
6953 self.issue = v.map(|x| x.into());
6954 self
6955 }
6956
6957 /// Sets the value of [update_mask][crate::model::UpdateIssueRequest::update_mask].
6958 ///
6959 /// # Example
6960 /// ```ignore,no_run
6961 /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueRequest;
6962 /// use wkt::FieldMask;
6963 /// let x = UpdateIssueRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6964 /// ```
6965 pub fn set_update_mask<T>(mut self, v: T) -> Self
6966 where
6967 T: std::convert::Into<wkt::FieldMask>,
6968 {
6969 self.update_mask = std::option::Option::Some(v.into());
6970 self
6971 }
6972
6973 /// Sets or clears the value of [update_mask][crate::model::UpdateIssueRequest::update_mask].
6974 ///
6975 /// # Example
6976 /// ```ignore,no_run
6977 /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueRequest;
6978 /// use wkt::FieldMask;
6979 /// let x = UpdateIssueRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6980 /// let x = UpdateIssueRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6981 /// ```
6982 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6983 where
6984 T: std::convert::Into<wkt::FieldMask>,
6985 {
6986 self.update_mask = v.map(|x| x.into());
6987 self
6988 }
6989}
6990
6991impl wkt::message::Message for UpdateIssueRequest {
6992 fn typename() -> &'static str {
6993 "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateIssueRequest"
6994 }
6995}
6996
6997/// The request to delete an issue.
6998#[derive(Clone, Default, PartialEq)]
6999#[non_exhaustive]
7000pub struct DeleteIssueRequest {
7001 /// Required. Name of the issue to delete.
7002 /// The format is
7003 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`.
7004 pub name: std::string::String,
7005
7006 /// Optional. The current etag of the issue.
7007 /// If the etag is provided and does not match the current etag of the issue,
7008 /// deletion will be blocked and an ABORTED error will be returned.
7009 pub etag: std::string::String,
7010
7011 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7012}
7013
7014impl DeleteIssueRequest {
7015 pub fn new() -> Self {
7016 std::default::Default::default()
7017 }
7018
7019 /// Sets the value of [name][crate::model::DeleteIssueRequest::name].
7020 ///
7021 /// # Example
7022 /// ```ignore,no_run
7023 /// # use google_cloud_securesourcemanager_v1::model::DeleteIssueRequest;
7024 /// let x = DeleteIssueRequest::new().set_name("example");
7025 /// ```
7026 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7027 self.name = v.into();
7028 self
7029 }
7030
7031 /// Sets the value of [etag][crate::model::DeleteIssueRequest::etag].
7032 ///
7033 /// # Example
7034 /// ```ignore,no_run
7035 /// # use google_cloud_securesourcemanager_v1::model::DeleteIssueRequest;
7036 /// let x = DeleteIssueRequest::new().set_etag("example");
7037 /// ```
7038 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7039 self.etag = v.into();
7040 self
7041 }
7042}
7043
7044impl wkt::message::Message for DeleteIssueRequest {
7045 fn typename() -> &'static str {
7046 "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteIssueRequest"
7047 }
7048}
7049
7050/// The request to close an issue.
7051#[derive(Clone, Default, PartialEq)]
7052#[non_exhaustive]
7053pub struct CloseIssueRequest {
7054 /// Required. Name of the issue to close.
7055 /// The format is
7056 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`.
7057 pub name: std::string::String,
7058
7059 /// Optional. The current etag of the issue.
7060 /// If the etag is provided and does not match the current etag of the issue,
7061 /// closing will be blocked and an ABORTED error will be returned.
7062 pub etag: std::string::String,
7063
7064 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7065}
7066
7067impl CloseIssueRequest {
7068 pub fn new() -> Self {
7069 std::default::Default::default()
7070 }
7071
7072 /// Sets the value of [name][crate::model::CloseIssueRequest::name].
7073 ///
7074 /// # Example
7075 /// ```ignore,no_run
7076 /// # use google_cloud_securesourcemanager_v1::model::CloseIssueRequest;
7077 /// let x = CloseIssueRequest::new().set_name("example");
7078 /// ```
7079 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7080 self.name = v.into();
7081 self
7082 }
7083
7084 /// Sets the value of [etag][crate::model::CloseIssueRequest::etag].
7085 ///
7086 /// # Example
7087 /// ```ignore,no_run
7088 /// # use google_cloud_securesourcemanager_v1::model::CloseIssueRequest;
7089 /// let x = CloseIssueRequest::new().set_etag("example");
7090 /// ```
7091 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7092 self.etag = v.into();
7093 self
7094 }
7095}
7096
7097impl wkt::message::Message for CloseIssueRequest {
7098 fn typename() -> &'static str {
7099 "type.googleapis.com/google.cloud.securesourcemanager.v1.CloseIssueRequest"
7100 }
7101}
7102
7103/// The request to open an issue.
7104#[derive(Clone, Default, PartialEq)]
7105#[non_exhaustive]
7106pub struct OpenIssueRequest {
7107 /// Required. Name of the issue to open.
7108 /// The format is
7109 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`.
7110 pub name: std::string::String,
7111
7112 /// Optional. The current etag of the issue.
7113 /// If the etag is provided and does not match the current etag of the issue,
7114 /// opening will be blocked and an ABORTED error will be returned.
7115 pub etag: std::string::String,
7116
7117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7118}
7119
7120impl OpenIssueRequest {
7121 pub fn new() -> Self {
7122 std::default::Default::default()
7123 }
7124
7125 /// Sets the value of [name][crate::model::OpenIssueRequest::name].
7126 ///
7127 /// # Example
7128 /// ```ignore,no_run
7129 /// # use google_cloud_securesourcemanager_v1::model::OpenIssueRequest;
7130 /// let x = OpenIssueRequest::new().set_name("example");
7131 /// ```
7132 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7133 self.name = v.into();
7134 self
7135 }
7136
7137 /// Sets the value of [etag][crate::model::OpenIssueRequest::etag].
7138 ///
7139 /// # Example
7140 /// ```ignore,no_run
7141 /// # use google_cloud_securesourcemanager_v1::model::OpenIssueRequest;
7142 /// let x = OpenIssueRequest::new().set_etag("example");
7143 /// ```
7144 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7145 self.etag = v.into();
7146 self
7147 }
7148}
7149
7150impl wkt::message::Message for OpenIssueRequest {
7151 fn typename() -> &'static str {
7152 "type.googleapis.com/google.cloud.securesourcemanager.v1.OpenIssueRequest"
7153 }
7154}
7155
7156/// Represents an entry within a tree structure (like a Git tree).
7157#[derive(Clone, Default, PartialEq)]
7158#[non_exhaustive]
7159pub struct TreeEntry {
7160 /// Output only. The type of the object (TREE, BLOB, COMMIT). Output-only.
7161 pub r#type: crate::model::tree_entry::ObjectType,
7162
7163 /// Output only. The SHA-1 hash of the object (unique identifier). Output-only.
7164 pub sha: std::string::String,
7165
7166 /// Output only. The path of the file or directory within the tree (e.g.,
7167 /// "src/main/java/MyClass.java"). Output-only.
7168 pub path: std::string::String,
7169
7170 /// Output only. The file mode as a string (e.g., "100644"). Indicates file
7171 /// type. Output-only.
7172 pub mode: std::string::String,
7173
7174 /// Output only. The size of the object in bytes (only for blobs). Output-only.
7175 pub size: i64,
7176
7177 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7178}
7179
7180impl TreeEntry {
7181 pub fn new() -> Self {
7182 std::default::Default::default()
7183 }
7184
7185 /// Sets the value of [r#type][crate::model::TreeEntry::type].
7186 ///
7187 /// # Example
7188 /// ```ignore,no_run
7189 /// # use google_cloud_securesourcemanager_v1::model::TreeEntry;
7190 /// use google_cloud_securesourcemanager_v1::model::tree_entry::ObjectType;
7191 /// let x0 = TreeEntry::new().set_type(ObjectType::Tree);
7192 /// let x1 = TreeEntry::new().set_type(ObjectType::Blob);
7193 /// let x2 = TreeEntry::new().set_type(ObjectType::Commit);
7194 /// ```
7195 pub fn set_type<T: std::convert::Into<crate::model::tree_entry::ObjectType>>(
7196 mut self,
7197 v: T,
7198 ) -> Self {
7199 self.r#type = v.into();
7200 self
7201 }
7202
7203 /// Sets the value of [sha][crate::model::TreeEntry::sha].
7204 ///
7205 /// # Example
7206 /// ```ignore,no_run
7207 /// # use google_cloud_securesourcemanager_v1::model::TreeEntry;
7208 /// let x = TreeEntry::new().set_sha("example");
7209 /// ```
7210 pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7211 self.sha = v.into();
7212 self
7213 }
7214
7215 /// Sets the value of [path][crate::model::TreeEntry::path].
7216 ///
7217 /// # Example
7218 /// ```ignore,no_run
7219 /// # use google_cloud_securesourcemanager_v1::model::TreeEntry;
7220 /// let x = TreeEntry::new().set_path("example");
7221 /// ```
7222 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7223 self.path = v.into();
7224 self
7225 }
7226
7227 /// Sets the value of [mode][crate::model::TreeEntry::mode].
7228 ///
7229 /// # Example
7230 /// ```ignore,no_run
7231 /// # use google_cloud_securesourcemanager_v1::model::TreeEntry;
7232 /// let x = TreeEntry::new().set_mode("example");
7233 /// ```
7234 pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7235 self.mode = v.into();
7236 self
7237 }
7238
7239 /// Sets the value of [size][crate::model::TreeEntry::size].
7240 ///
7241 /// # Example
7242 /// ```ignore,no_run
7243 /// # use google_cloud_securesourcemanager_v1::model::TreeEntry;
7244 /// let x = TreeEntry::new().set_size(42);
7245 /// ```
7246 pub fn set_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
7247 self.size = v.into();
7248 self
7249 }
7250}
7251
7252impl wkt::message::Message for TreeEntry {
7253 fn typename() -> &'static str {
7254 "type.googleapis.com/google.cloud.securesourcemanager.v1.TreeEntry"
7255 }
7256}
7257
7258/// Defines additional types related to [TreeEntry].
7259pub mod tree_entry {
7260 #[allow(unused_imports)]
7261 use super::*;
7262
7263 /// Defines the type of object the TreeEntry represents.
7264 ///
7265 /// # Working with unknown values
7266 ///
7267 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7268 /// additional enum variants at any time. Adding new variants is not considered
7269 /// a breaking change. Applications should write their code in anticipation of:
7270 ///
7271 /// - New values appearing in future releases of the client library, **and**
7272 /// - New values received dynamically, without application changes.
7273 ///
7274 /// Please consult the [Working with enums] section in the user guide for some
7275 /// guidelines.
7276 ///
7277 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7278 #[derive(Clone, Debug, PartialEq)]
7279 #[non_exhaustive]
7280 pub enum ObjectType {
7281 /// Default value, indicating the object type is unspecified.
7282 Unspecified,
7283 /// Represents a directory (folder).
7284 Tree,
7285 /// Represents a file (contains file data).
7286 Blob,
7287 /// Represents a pointer to another repository (submodule).
7288 Commit,
7289 /// If set, the enum was initialized with an unknown value.
7290 ///
7291 /// Applications can examine the value using [ObjectType::value] or
7292 /// [ObjectType::name].
7293 UnknownValue(object_type::UnknownValue),
7294 }
7295
7296 #[doc(hidden)]
7297 pub mod object_type {
7298 #[allow(unused_imports)]
7299 use super::*;
7300 #[derive(Clone, Debug, PartialEq)]
7301 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7302 }
7303
7304 impl ObjectType {
7305 /// Gets the enum value.
7306 ///
7307 /// Returns `None` if the enum contains an unknown value deserialized from
7308 /// the string representation of enums.
7309 pub fn value(&self) -> std::option::Option<i32> {
7310 match self {
7311 Self::Unspecified => std::option::Option::Some(0),
7312 Self::Tree => std::option::Option::Some(1),
7313 Self::Blob => std::option::Option::Some(2),
7314 Self::Commit => std::option::Option::Some(3),
7315 Self::UnknownValue(u) => u.0.value(),
7316 }
7317 }
7318
7319 /// Gets the enum value as a string.
7320 ///
7321 /// Returns `None` if the enum contains an unknown value deserialized from
7322 /// the integer representation of enums.
7323 pub fn name(&self) -> std::option::Option<&str> {
7324 match self {
7325 Self::Unspecified => std::option::Option::Some("OBJECT_TYPE_UNSPECIFIED"),
7326 Self::Tree => std::option::Option::Some("TREE"),
7327 Self::Blob => std::option::Option::Some("BLOB"),
7328 Self::Commit => std::option::Option::Some("COMMIT"),
7329 Self::UnknownValue(u) => u.0.name(),
7330 }
7331 }
7332 }
7333
7334 impl std::default::Default for ObjectType {
7335 fn default() -> Self {
7336 use std::convert::From;
7337 Self::from(0)
7338 }
7339 }
7340
7341 impl std::fmt::Display for ObjectType {
7342 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7343 wkt::internal::display_enum(f, self.name(), self.value())
7344 }
7345 }
7346
7347 impl std::convert::From<i32> for ObjectType {
7348 fn from(value: i32) -> Self {
7349 match value {
7350 0 => Self::Unspecified,
7351 1 => Self::Tree,
7352 2 => Self::Blob,
7353 3 => Self::Commit,
7354 _ => Self::UnknownValue(object_type::UnknownValue(
7355 wkt::internal::UnknownEnumValue::Integer(value),
7356 )),
7357 }
7358 }
7359 }
7360
7361 impl std::convert::From<&str> for ObjectType {
7362 fn from(value: &str) -> Self {
7363 use std::string::ToString;
7364 match value {
7365 "OBJECT_TYPE_UNSPECIFIED" => Self::Unspecified,
7366 "TREE" => Self::Tree,
7367 "BLOB" => Self::Blob,
7368 "COMMIT" => Self::Commit,
7369 _ => Self::UnknownValue(object_type::UnknownValue(
7370 wkt::internal::UnknownEnumValue::String(value.to_string()),
7371 )),
7372 }
7373 }
7374 }
7375
7376 impl serde::ser::Serialize for ObjectType {
7377 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7378 where
7379 S: serde::Serializer,
7380 {
7381 match self {
7382 Self::Unspecified => serializer.serialize_i32(0),
7383 Self::Tree => serializer.serialize_i32(1),
7384 Self::Blob => serializer.serialize_i32(2),
7385 Self::Commit => serializer.serialize_i32(3),
7386 Self::UnknownValue(u) => u.0.serialize(serializer),
7387 }
7388 }
7389 }
7390
7391 impl<'de> serde::de::Deserialize<'de> for ObjectType {
7392 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7393 where
7394 D: serde::Deserializer<'de>,
7395 {
7396 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ObjectType>::new(
7397 ".google.cloud.securesourcemanager.v1.TreeEntry.ObjectType",
7398 ))
7399 }
7400 }
7401}
7402
7403/// Request message for fetching a tree structure from a repository.
7404#[derive(Clone, Default, PartialEq)]
7405#[non_exhaustive]
7406pub struct FetchTreeRequest {
7407 /// Required. The format is
7408 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
7409 /// Specifies the repository to fetch the tree from.
7410 pub repository: std::string::String,
7411
7412 /// Optional. `ref` can be a SHA-1 hash, a branch name, or a tag. Specifies
7413 /// which tree to fetch. If not specified, the default branch will be used.
7414 pub r#ref: std::string::String,
7415
7416 /// Optional. If true, include all subfolders and their files in the response.
7417 /// If false, only the immediate children are returned.
7418 pub recursive: bool,
7419
7420 /// Optional. Requested page size. Server may return fewer items than
7421 /// requested. If unspecified, at most 10,000 items will be returned.
7422 pub page_size: i32,
7423
7424 /// Optional. A token identifying a page of results the server should return.
7425 pub page_token: std::string::String,
7426
7427 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7428}
7429
7430impl FetchTreeRequest {
7431 pub fn new() -> Self {
7432 std::default::Default::default()
7433 }
7434
7435 /// Sets the value of [repository][crate::model::FetchTreeRequest::repository].
7436 ///
7437 /// # Example
7438 /// ```ignore,no_run
7439 /// # use google_cloud_securesourcemanager_v1::model::FetchTreeRequest;
7440 /// let x = FetchTreeRequest::new().set_repository("example");
7441 /// ```
7442 pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7443 self.repository = v.into();
7444 self
7445 }
7446
7447 /// Sets the value of [r#ref][crate::model::FetchTreeRequest::ref].
7448 ///
7449 /// # Example
7450 /// ```ignore,no_run
7451 /// # use google_cloud_securesourcemanager_v1::model::FetchTreeRequest;
7452 /// let x = FetchTreeRequest::new().set_ref("example");
7453 /// ```
7454 pub fn set_ref<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7455 self.r#ref = v.into();
7456 self
7457 }
7458
7459 /// Sets the value of [recursive][crate::model::FetchTreeRequest::recursive].
7460 ///
7461 /// # Example
7462 /// ```ignore,no_run
7463 /// # use google_cloud_securesourcemanager_v1::model::FetchTreeRequest;
7464 /// let x = FetchTreeRequest::new().set_recursive(true);
7465 /// ```
7466 pub fn set_recursive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7467 self.recursive = v.into();
7468 self
7469 }
7470
7471 /// Sets the value of [page_size][crate::model::FetchTreeRequest::page_size].
7472 ///
7473 /// # Example
7474 /// ```ignore,no_run
7475 /// # use google_cloud_securesourcemanager_v1::model::FetchTreeRequest;
7476 /// let x = FetchTreeRequest::new().set_page_size(42);
7477 /// ```
7478 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7479 self.page_size = v.into();
7480 self
7481 }
7482
7483 /// Sets the value of [page_token][crate::model::FetchTreeRequest::page_token].
7484 ///
7485 /// # Example
7486 /// ```ignore,no_run
7487 /// # use google_cloud_securesourcemanager_v1::model::FetchTreeRequest;
7488 /// let x = FetchTreeRequest::new().set_page_token("example");
7489 /// ```
7490 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7491 self.page_token = v.into();
7492 self
7493 }
7494}
7495
7496impl wkt::message::Message for FetchTreeRequest {
7497 fn typename() -> &'static str {
7498 "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchTreeRequest"
7499 }
7500}
7501
7502/// Response message containing a list of TreeEntry objects.
7503#[derive(Clone, Default, PartialEq)]
7504#[non_exhaustive]
7505pub struct FetchTreeResponse {
7506 /// The list of TreeEntry objects.
7507 pub tree_entries: std::vec::Vec<crate::model::TreeEntry>,
7508
7509 /// A token identifying a page of results the server should return.
7510 pub next_page_token: std::string::String,
7511
7512 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7513}
7514
7515impl FetchTreeResponse {
7516 pub fn new() -> Self {
7517 std::default::Default::default()
7518 }
7519
7520 /// Sets the value of [tree_entries][crate::model::FetchTreeResponse::tree_entries].
7521 ///
7522 /// # Example
7523 /// ```ignore,no_run
7524 /// # use google_cloud_securesourcemanager_v1::model::FetchTreeResponse;
7525 /// use google_cloud_securesourcemanager_v1::model::TreeEntry;
7526 /// let x = FetchTreeResponse::new()
7527 /// .set_tree_entries([
7528 /// TreeEntry::default()/* use setters */,
7529 /// TreeEntry::default()/* use (different) setters */,
7530 /// ]);
7531 /// ```
7532 pub fn set_tree_entries<T, V>(mut self, v: T) -> Self
7533 where
7534 T: std::iter::IntoIterator<Item = V>,
7535 V: std::convert::Into<crate::model::TreeEntry>,
7536 {
7537 use std::iter::Iterator;
7538 self.tree_entries = v.into_iter().map(|i| i.into()).collect();
7539 self
7540 }
7541
7542 /// Sets the value of [next_page_token][crate::model::FetchTreeResponse::next_page_token].
7543 ///
7544 /// # Example
7545 /// ```ignore,no_run
7546 /// # use google_cloud_securesourcemanager_v1::model::FetchTreeResponse;
7547 /// let x = FetchTreeResponse::new().set_next_page_token("example");
7548 /// ```
7549 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7550 self.next_page_token = v.into();
7551 self
7552 }
7553}
7554
7555impl wkt::message::Message for FetchTreeResponse {
7556 fn typename() -> &'static str {
7557 "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchTreeResponse"
7558 }
7559}
7560
7561#[doc(hidden)]
7562impl google_cloud_gax::paginator::internal::PageableResponse for FetchTreeResponse {
7563 type PageItem = crate::model::TreeEntry;
7564
7565 fn items(self) -> std::vec::Vec<Self::PageItem> {
7566 self.tree_entries
7567 }
7568
7569 fn next_page_token(&self) -> std::string::String {
7570 use std::clone::Clone;
7571 self.next_page_token.clone()
7572 }
7573}
7574
7575/// Request message for fetching a blob (file content) from a repository.
7576#[derive(Clone, Default, PartialEq)]
7577#[non_exhaustive]
7578pub struct FetchBlobRequest {
7579 /// Required. The format is
7580 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
7581 /// Specifies the repository containing the blob.
7582 pub repository: std::string::String,
7583
7584 /// Required. The SHA-1 hash of the blob to retrieve.
7585 pub sha: std::string::String,
7586
7587 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7588}
7589
7590impl FetchBlobRequest {
7591 pub fn new() -> Self {
7592 std::default::Default::default()
7593 }
7594
7595 /// Sets the value of [repository][crate::model::FetchBlobRequest::repository].
7596 ///
7597 /// # Example
7598 /// ```ignore,no_run
7599 /// # use google_cloud_securesourcemanager_v1::model::FetchBlobRequest;
7600 /// let x = FetchBlobRequest::new().set_repository("example");
7601 /// ```
7602 pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7603 self.repository = v.into();
7604 self
7605 }
7606
7607 /// Sets the value of [sha][crate::model::FetchBlobRequest::sha].
7608 ///
7609 /// # Example
7610 /// ```ignore,no_run
7611 /// # use google_cloud_securesourcemanager_v1::model::FetchBlobRequest;
7612 /// let x = FetchBlobRequest::new().set_sha("example");
7613 /// ```
7614 pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7615 self.sha = v.into();
7616 self
7617 }
7618}
7619
7620impl wkt::message::Message for FetchBlobRequest {
7621 fn typename() -> &'static str {
7622 "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchBlobRequest"
7623 }
7624}
7625
7626/// Response message containing the content of a blob.
7627#[derive(Clone, Default, PartialEq)]
7628#[non_exhaustive]
7629pub struct FetchBlobResponse {
7630 /// The SHA-1 hash of the blob.
7631 pub sha: std::string::String,
7632
7633 /// The content of the blob, encoded as base64.
7634 pub content: std::string::String,
7635
7636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7637}
7638
7639impl FetchBlobResponse {
7640 pub fn new() -> Self {
7641 std::default::Default::default()
7642 }
7643
7644 /// Sets the value of [sha][crate::model::FetchBlobResponse::sha].
7645 ///
7646 /// # Example
7647 /// ```ignore,no_run
7648 /// # use google_cloud_securesourcemanager_v1::model::FetchBlobResponse;
7649 /// let x = FetchBlobResponse::new().set_sha("example");
7650 /// ```
7651 pub fn set_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7652 self.sha = v.into();
7653 self
7654 }
7655
7656 /// Sets the value of [content][crate::model::FetchBlobResponse::content].
7657 ///
7658 /// # Example
7659 /// ```ignore,no_run
7660 /// # use google_cloud_securesourcemanager_v1::model::FetchBlobResponse;
7661 /// let x = FetchBlobResponse::new().set_content("example");
7662 /// ```
7663 pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7664 self.content = v.into();
7665 self
7666 }
7667}
7668
7669impl wkt::message::Message for FetchBlobResponse {
7670 fn typename() -> &'static str {
7671 "type.googleapis.com/google.cloud.securesourcemanager.v1.FetchBlobResponse"
7672 }
7673}
7674
7675/// The request to list pull request comments.
7676#[derive(Clone, Default, PartialEq)]
7677#[non_exhaustive]
7678pub struct ListPullRequestCommentsRequest {
7679 /// Required. The pull request in which to list pull request comments. Format:
7680 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
7681 pub parent: std::string::String,
7682
7683 /// Optional. Requested page size. If unspecified, a default size of 30 will be
7684 /// used. The maximum value is 100; values above 100 will be coerced to 100.
7685 pub page_size: i32,
7686
7687 /// Optional. A token identifying a page of results the server should return.
7688 pub page_token: std::string::String,
7689
7690 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7691}
7692
7693impl ListPullRequestCommentsRequest {
7694 pub fn new() -> Self {
7695 std::default::Default::default()
7696 }
7697
7698 /// Sets the value of [parent][crate::model::ListPullRequestCommentsRequest::parent].
7699 ///
7700 /// # Example
7701 /// ```ignore,no_run
7702 /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestCommentsRequest;
7703 /// let x = ListPullRequestCommentsRequest::new().set_parent("example");
7704 /// ```
7705 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7706 self.parent = v.into();
7707 self
7708 }
7709
7710 /// Sets the value of [page_size][crate::model::ListPullRequestCommentsRequest::page_size].
7711 ///
7712 /// # Example
7713 /// ```ignore,no_run
7714 /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestCommentsRequest;
7715 /// let x = ListPullRequestCommentsRequest::new().set_page_size(42);
7716 /// ```
7717 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7718 self.page_size = v.into();
7719 self
7720 }
7721
7722 /// Sets the value of [page_token][crate::model::ListPullRequestCommentsRequest::page_token].
7723 ///
7724 /// # Example
7725 /// ```ignore,no_run
7726 /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestCommentsRequest;
7727 /// let x = ListPullRequestCommentsRequest::new().set_page_token("example");
7728 /// ```
7729 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7730 self.page_token = v.into();
7731 self
7732 }
7733}
7734
7735impl wkt::message::Message for ListPullRequestCommentsRequest {
7736 fn typename() -> &'static str {
7737 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestCommentsRequest"
7738 }
7739}
7740
7741/// The response to list pull request comments.
7742#[derive(Clone, Default, PartialEq)]
7743#[non_exhaustive]
7744pub struct ListPullRequestCommentsResponse {
7745 /// The list of pull request comments.
7746 pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,
7747
7748 /// A token to set as page_token to retrieve the next page. If this field is
7749 /// omitted, there are no subsequent pages.
7750 pub next_page_token: std::string::String,
7751
7752 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7753}
7754
7755impl ListPullRequestCommentsResponse {
7756 pub fn new() -> Self {
7757 std::default::Default::default()
7758 }
7759
7760 /// Sets the value of [pull_request_comments][crate::model::ListPullRequestCommentsResponse::pull_request_comments].
7761 ///
7762 /// # Example
7763 /// ```ignore,no_run
7764 /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestCommentsResponse;
7765 /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
7766 /// let x = ListPullRequestCommentsResponse::new()
7767 /// .set_pull_request_comments([
7768 /// PullRequestComment::default()/* use setters */,
7769 /// PullRequestComment::default()/* use (different) setters */,
7770 /// ]);
7771 /// ```
7772 pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
7773 where
7774 T: std::iter::IntoIterator<Item = V>,
7775 V: std::convert::Into<crate::model::PullRequestComment>,
7776 {
7777 use std::iter::Iterator;
7778 self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
7779 self
7780 }
7781
7782 /// Sets the value of [next_page_token][crate::model::ListPullRequestCommentsResponse::next_page_token].
7783 ///
7784 /// # Example
7785 /// ```ignore,no_run
7786 /// # use google_cloud_securesourcemanager_v1::model::ListPullRequestCommentsResponse;
7787 /// let x = ListPullRequestCommentsResponse::new().set_next_page_token("example");
7788 /// ```
7789 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7790 self.next_page_token = v.into();
7791 self
7792 }
7793}
7794
7795impl wkt::message::Message for ListPullRequestCommentsResponse {
7796 fn typename() -> &'static str {
7797 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListPullRequestCommentsResponse"
7798 }
7799}
7800
7801#[doc(hidden)]
7802impl google_cloud_gax::paginator::internal::PageableResponse for ListPullRequestCommentsResponse {
7803 type PageItem = crate::model::PullRequestComment;
7804
7805 fn items(self) -> std::vec::Vec<Self::PageItem> {
7806 self.pull_request_comments
7807 }
7808
7809 fn next_page_token(&self) -> std::string::String {
7810 use std::clone::Clone;
7811 self.next_page_token.clone()
7812 }
7813}
7814
7815/// The request to create a pull request comment.
7816#[derive(Clone, Default, PartialEq)]
7817#[non_exhaustive]
7818pub struct CreatePullRequestCommentRequest {
7819 /// Required. The pull request in which to create the pull request comment.
7820 /// Format:
7821 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
7822 pub parent: std::string::String,
7823
7824 /// Required. The pull request comment to create.
7825 pub pull_request_comment: std::option::Option<crate::model::PullRequestComment>,
7826
7827 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7828}
7829
7830impl CreatePullRequestCommentRequest {
7831 pub fn new() -> Self {
7832 std::default::Default::default()
7833 }
7834
7835 /// Sets the value of [parent][crate::model::CreatePullRequestCommentRequest::parent].
7836 ///
7837 /// # Example
7838 /// ```ignore,no_run
7839 /// # use google_cloud_securesourcemanager_v1::model::CreatePullRequestCommentRequest;
7840 /// let x = CreatePullRequestCommentRequest::new().set_parent("example");
7841 /// ```
7842 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7843 self.parent = v.into();
7844 self
7845 }
7846
7847 /// Sets the value of [pull_request_comment][crate::model::CreatePullRequestCommentRequest::pull_request_comment].
7848 ///
7849 /// # Example
7850 /// ```ignore,no_run
7851 /// # use google_cloud_securesourcemanager_v1::model::CreatePullRequestCommentRequest;
7852 /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
7853 /// let x = CreatePullRequestCommentRequest::new().set_pull_request_comment(PullRequestComment::default()/* use setters */);
7854 /// ```
7855 pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
7856 where
7857 T: std::convert::Into<crate::model::PullRequestComment>,
7858 {
7859 self.pull_request_comment = std::option::Option::Some(v.into());
7860 self
7861 }
7862
7863 /// Sets or clears the value of [pull_request_comment][crate::model::CreatePullRequestCommentRequest::pull_request_comment].
7864 ///
7865 /// # Example
7866 /// ```ignore,no_run
7867 /// # use google_cloud_securesourcemanager_v1::model::CreatePullRequestCommentRequest;
7868 /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
7869 /// let x = CreatePullRequestCommentRequest::new().set_or_clear_pull_request_comment(Some(PullRequestComment::default()/* use setters */));
7870 /// let x = CreatePullRequestCommentRequest::new().set_or_clear_pull_request_comment(None::<PullRequestComment>);
7871 /// ```
7872 pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
7873 where
7874 T: std::convert::Into<crate::model::PullRequestComment>,
7875 {
7876 self.pull_request_comment = v.map(|x| x.into());
7877 self
7878 }
7879}
7880
7881impl wkt::message::Message for CreatePullRequestCommentRequest {
7882 fn typename() -> &'static str {
7883 "type.googleapis.com/google.cloud.securesourcemanager.v1.CreatePullRequestCommentRequest"
7884 }
7885}
7886
7887/// The request to batch create pull request comments.
7888#[derive(Clone, Default, PartialEq)]
7889#[non_exhaustive]
7890pub struct BatchCreatePullRequestCommentsRequest {
7891 /// Required. The pull request in which to create the pull request comments.
7892 /// Format:
7893 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
7894 pub parent: std::string::String,
7895
7896 /// Required. The request message specifying the resources to create. There
7897 /// should be exactly one CreatePullRequestCommentRequest with CommentDetail
7898 /// being REVIEW in the list, and no more than 100
7899 /// CreatePullRequestCommentRequests with CommentDetail being CODE in the list
7900 pub requests: std::vec::Vec<crate::model::CreatePullRequestCommentRequest>,
7901
7902 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7903}
7904
7905impl BatchCreatePullRequestCommentsRequest {
7906 pub fn new() -> Self {
7907 std::default::Default::default()
7908 }
7909
7910 /// Sets the value of [parent][crate::model::BatchCreatePullRequestCommentsRequest::parent].
7911 ///
7912 /// # Example
7913 /// ```ignore,no_run
7914 /// # use google_cloud_securesourcemanager_v1::model::BatchCreatePullRequestCommentsRequest;
7915 /// let x = BatchCreatePullRequestCommentsRequest::new().set_parent("example");
7916 /// ```
7917 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7918 self.parent = v.into();
7919 self
7920 }
7921
7922 /// Sets the value of [requests][crate::model::BatchCreatePullRequestCommentsRequest::requests].
7923 ///
7924 /// # Example
7925 /// ```ignore,no_run
7926 /// # use google_cloud_securesourcemanager_v1::model::BatchCreatePullRequestCommentsRequest;
7927 /// use google_cloud_securesourcemanager_v1::model::CreatePullRequestCommentRequest;
7928 /// let x = BatchCreatePullRequestCommentsRequest::new()
7929 /// .set_requests([
7930 /// CreatePullRequestCommentRequest::default()/* use setters */,
7931 /// CreatePullRequestCommentRequest::default()/* use (different) setters */,
7932 /// ]);
7933 /// ```
7934 pub fn set_requests<T, V>(mut self, v: T) -> Self
7935 where
7936 T: std::iter::IntoIterator<Item = V>,
7937 V: std::convert::Into<crate::model::CreatePullRequestCommentRequest>,
7938 {
7939 use std::iter::Iterator;
7940 self.requests = v.into_iter().map(|i| i.into()).collect();
7941 self
7942 }
7943}
7944
7945impl wkt::message::Message for BatchCreatePullRequestCommentsRequest {
7946 fn typename() -> &'static str {
7947 "type.googleapis.com/google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsRequest"
7948 }
7949}
7950
7951/// The response to batch create pull request comments.
7952#[derive(Clone, Default, PartialEq)]
7953#[non_exhaustive]
7954pub struct BatchCreatePullRequestCommentsResponse {
7955 /// The list of pull request comments created.
7956 pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,
7957
7958 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7959}
7960
7961impl BatchCreatePullRequestCommentsResponse {
7962 pub fn new() -> Self {
7963 std::default::Default::default()
7964 }
7965
7966 /// Sets the value of [pull_request_comments][crate::model::BatchCreatePullRequestCommentsResponse::pull_request_comments].
7967 ///
7968 /// # Example
7969 /// ```ignore,no_run
7970 /// # use google_cloud_securesourcemanager_v1::model::BatchCreatePullRequestCommentsResponse;
7971 /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
7972 /// let x = BatchCreatePullRequestCommentsResponse::new()
7973 /// .set_pull_request_comments([
7974 /// PullRequestComment::default()/* use setters */,
7975 /// PullRequestComment::default()/* use (different) setters */,
7976 /// ]);
7977 /// ```
7978 pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
7979 where
7980 T: std::iter::IntoIterator<Item = V>,
7981 V: std::convert::Into<crate::model::PullRequestComment>,
7982 {
7983 use std::iter::Iterator;
7984 self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
7985 self
7986 }
7987}
7988
7989impl wkt::message::Message for BatchCreatePullRequestCommentsResponse {
7990 fn typename() -> &'static str {
7991 "type.googleapis.com/google.cloud.securesourcemanager.v1.BatchCreatePullRequestCommentsResponse"
7992 }
7993}
7994
7995/// The request to update a pull request comment.
7996#[derive(Clone, Default, PartialEq)]
7997#[non_exhaustive]
7998pub struct UpdatePullRequestCommentRequest {
7999 /// Required. The pull request comment to update.
8000 pub pull_request_comment: std::option::Option<crate::model::PullRequestComment>,
8001
8002 /// Optional. Field mask is used to specify the fields to be overwritten in the
8003 /// pull request comment resource by the update. Updatable fields are
8004 /// `body`.
8005 pub update_mask: std::option::Option<wkt::FieldMask>,
8006
8007 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8008}
8009
8010impl UpdatePullRequestCommentRequest {
8011 pub fn new() -> Self {
8012 std::default::Default::default()
8013 }
8014
8015 /// Sets the value of [pull_request_comment][crate::model::UpdatePullRequestCommentRequest::pull_request_comment].
8016 ///
8017 /// # Example
8018 /// ```ignore,no_run
8019 /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestCommentRequest;
8020 /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
8021 /// let x = UpdatePullRequestCommentRequest::new().set_pull_request_comment(PullRequestComment::default()/* use setters */);
8022 /// ```
8023 pub fn set_pull_request_comment<T>(mut self, v: T) -> Self
8024 where
8025 T: std::convert::Into<crate::model::PullRequestComment>,
8026 {
8027 self.pull_request_comment = std::option::Option::Some(v.into());
8028 self
8029 }
8030
8031 /// Sets or clears the value of [pull_request_comment][crate::model::UpdatePullRequestCommentRequest::pull_request_comment].
8032 ///
8033 /// # Example
8034 /// ```ignore,no_run
8035 /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestCommentRequest;
8036 /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
8037 /// let x = UpdatePullRequestCommentRequest::new().set_or_clear_pull_request_comment(Some(PullRequestComment::default()/* use setters */));
8038 /// let x = UpdatePullRequestCommentRequest::new().set_or_clear_pull_request_comment(None::<PullRequestComment>);
8039 /// ```
8040 pub fn set_or_clear_pull_request_comment<T>(mut self, v: std::option::Option<T>) -> Self
8041 where
8042 T: std::convert::Into<crate::model::PullRequestComment>,
8043 {
8044 self.pull_request_comment = v.map(|x| x.into());
8045 self
8046 }
8047
8048 /// Sets the value of [update_mask][crate::model::UpdatePullRequestCommentRequest::update_mask].
8049 ///
8050 /// # Example
8051 /// ```ignore,no_run
8052 /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestCommentRequest;
8053 /// use wkt::FieldMask;
8054 /// let x = UpdatePullRequestCommentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8055 /// ```
8056 pub fn set_update_mask<T>(mut self, v: T) -> Self
8057 where
8058 T: std::convert::Into<wkt::FieldMask>,
8059 {
8060 self.update_mask = std::option::Option::Some(v.into());
8061 self
8062 }
8063
8064 /// Sets or clears the value of [update_mask][crate::model::UpdatePullRequestCommentRequest::update_mask].
8065 ///
8066 /// # Example
8067 /// ```ignore,no_run
8068 /// # use google_cloud_securesourcemanager_v1::model::UpdatePullRequestCommentRequest;
8069 /// use wkt::FieldMask;
8070 /// let x = UpdatePullRequestCommentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8071 /// let x = UpdatePullRequestCommentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8072 /// ```
8073 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8074 where
8075 T: std::convert::Into<wkt::FieldMask>,
8076 {
8077 self.update_mask = v.map(|x| x.into());
8078 self
8079 }
8080}
8081
8082impl wkt::message::Message for UpdatePullRequestCommentRequest {
8083 fn typename() -> &'static str {
8084 "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdatePullRequestCommentRequest"
8085 }
8086}
8087
8088/// The request to delete a pull request comment. A Review PullRequestComment
8089/// cannot be deleted.
8090#[derive(Clone, Default, PartialEq)]
8091#[non_exhaustive]
8092pub struct DeletePullRequestCommentRequest {
8093 /// Required. Name of the pull request comment to delete.
8094 /// The format is
8095 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`.
8096 pub name: std::string::String,
8097
8098 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8099}
8100
8101impl DeletePullRequestCommentRequest {
8102 pub fn new() -> Self {
8103 std::default::Default::default()
8104 }
8105
8106 /// Sets the value of [name][crate::model::DeletePullRequestCommentRequest::name].
8107 ///
8108 /// # Example
8109 /// ```ignore,no_run
8110 /// # use google_cloud_securesourcemanager_v1::model::DeletePullRequestCommentRequest;
8111 /// let x = DeletePullRequestCommentRequest::new().set_name("example");
8112 /// ```
8113 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8114 self.name = v.into();
8115 self
8116 }
8117}
8118
8119impl wkt::message::Message for DeletePullRequestCommentRequest {
8120 fn typename() -> &'static str {
8121 "type.googleapis.com/google.cloud.securesourcemanager.v1.DeletePullRequestCommentRequest"
8122 }
8123}
8124
8125/// The request to get a pull request comment.
8126#[derive(Clone, Default, PartialEq)]
8127#[non_exhaustive]
8128pub struct GetPullRequestCommentRequest {
8129 /// Required. Name of the pull request comment to retrieve.
8130 /// The format is
8131 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`.
8132 pub name: std::string::String,
8133
8134 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8135}
8136
8137impl GetPullRequestCommentRequest {
8138 pub fn new() -> Self {
8139 std::default::Default::default()
8140 }
8141
8142 /// Sets the value of [name][crate::model::GetPullRequestCommentRequest::name].
8143 ///
8144 /// # Example
8145 /// ```ignore,no_run
8146 /// # use google_cloud_securesourcemanager_v1::model::GetPullRequestCommentRequest;
8147 /// let x = GetPullRequestCommentRequest::new().set_name("example");
8148 /// ```
8149 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8150 self.name = v.into();
8151 self
8152 }
8153}
8154
8155impl wkt::message::Message for GetPullRequestCommentRequest {
8156 fn typename() -> &'static str {
8157 "type.googleapis.com/google.cloud.securesourcemanager.v1.GetPullRequestCommentRequest"
8158 }
8159}
8160
8161/// The request to resolve multiple pull request comments.
8162#[derive(Clone, Default, PartialEq)]
8163#[non_exhaustive]
8164pub struct ResolvePullRequestCommentsRequest {
8165 /// Required. The pull request in which to resolve the pull request comments.
8166 /// Format:
8167 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
8168 pub parent: std::string::String,
8169
8170 /// Required. The names of the pull request comments to resolve. Format:
8171 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`
8172 /// Only comments from the same threads are allowed in the same request.
8173 pub names: std::vec::Vec<std::string::String>,
8174
8175 /// Optional. If set, at least one comment in a thread is required, rest of the
8176 /// comments in the same thread will be automatically updated to resolved. If
8177 /// unset, all comments in the same thread need be present.
8178 pub auto_fill: bool,
8179
8180 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8181}
8182
8183impl ResolvePullRequestCommentsRequest {
8184 pub fn new() -> Self {
8185 std::default::Default::default()
8186 }
8187
8188 /// Sets the value of [parent][crate::model::ResolvePullRequestCommentsRequest::parent].
8189 ///
8190 /// # Example
8191 /// ```ignore,no_run
8192 /// # use google_cloud_securesourcemanager_v1::model::ResolvePullRequestCommentsRequest;
8193 /// let x = ResolvePullRequestCommentsRequest::new().set_parent("example");
8194 /// ```
8195 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8196 self.parent = v.into();
8197 self
8198 }
8199
8200 /// Sets the value of [names][crate::model::ResolvePullRequestCommentsRequest::names].
8201 ///
8202 /// # Example
8203 /// ```ignore,no_run
8204 /// # use google_cloud_securesourcemanager_v1::model::ResolvePullRequestCommentsRequest;
8205 /// let x = ResolvePullRequestCommentsRequest::new().set_names(["a", "b", "c"]);
8206 /// ```
8207 pub fn set_names<T, V>(mut self, v: T) -> Self
8208 where
8209 T: std::iter::IntoIterator<Item = V>,
8210 V: std::convert::Into<std::string::String>,
8211 {
8212 use std::iter::Iterator;
8213 self.names = v.into_iter().map(|i| i.into()).collect();
8214 self
8215 }
8216
8217 /// Sets the value of [auto_fill][crate::model::ResolvePullRequestCommentsRequest::auto_fill].
8218 ///
8219 /// # Example
8220 /// ```ignore,no_run
8221 /// # use google_cloud_securesourcemanager_v1::model::ResolvePullRequestCommentsRequest;
8222 /// let x = ResolvePullRequestCommentsRequest::new().set_auto_fill(true);
8223 /// ```
8224 pub fn set_auto_fill<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8225 self.auto_fill = v.into();
8226 self
8227 }
8228}
8229
8230impl wkt::message::Message for ResolvePullRequestCommentsRequest {
8231 fn typename() -> &'static str {
8232 "type.googleapis.com/google.cloud.securesourcemanager.v1.ResolvePullRequestCommentsRequest"
8233 }
8234}
8235
8236/// The response to resolve multiple pull request comments.
8237#[derive(Clone, Default, PartialEq)]
8238#[non_exhaustive]
8239pub struct ResolvePullRequestCommentsResponse {
8240 /// The list of pull request comments resolved.
8241 pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,
8242
8243 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8244}
8245
8246impl ResolvePullRequestCommentsResponse {
8247 pub fn new() -> Self {
8248 std::default::Default::default()
8249 }
8250
8251 /// Sets the value of [pull_request_comments][crate::model::ResolvePullRequestCommentsResponse::pull_request_comments].
8252 ///
8253 /// # Example
8254 /// ```ignore,no_run
8255 /// # use google_cloud_securesourcemanager_v1::model::ResolvePullRequestCommentsResponse;
8256 /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
8257 /// let x = ResolvePullRequestCommentsResponse::new()
8258 /// .set_pull_request_comments([
8259 /// PullRequestComment::default()/* use setters */,
8260 /// PullRequestComment::default()/* use (different) setters */,
8261 /// ]);
8262 /// ```
8263 pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
8264 where
8265 T: std::iter::IntoIterator<Item = V>,
8266 V: std::convert::Into<crate::model::PullRequestComment>,
8267 {
8268 use std::iter::Iterator;
8269 self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
8270 self
8271 }
8272}
8273
8274impl wkt::message::Message for ResolvePullRequestCommentsResponse {
8275 fn typename() -> &'static str {
8276 "type.googleapis.com/google.cloud.securesourcemanager.v1.ResolvePullRequestCommentsResponse"
8277 }
8278}
8279
8280/// The request to unresolve multiple pull request comments.
8281#[derive(Clone, Default, PartialEq)]
8282#[non_exhaustive]
8283pub struct UnresolvePullRequestCommentsRequest {
8284 /// Required. The pull request in which to resolve the pull request comments.
8285 /// Format:
8286 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
8287 pub parent: std::string::String,
8288
8289 /// Required. The names of the pull request comments to unresolve. Format:
8290 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`
8291 /// Only comments from the same threads are allowed in the same request.
8292 pub names: std::vec::Vec<std::string::String>,
8293
8294 /// Optional. If set, at least one comment in a thread is required, rest of the
8295 /// comments in the same thread will be automatically updated to unresolved. If
8296 /// unset, all comments in the same thread need be present.
8297 pub auto_fill: bool,
8298
8299 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8300}
8301
8302impl UnresolvePullRequestCommentsRequest {
8303 pub fn new() -> Self {
8304 std::default::Default::default()
8305 }
8306
8307 /// Sets the value of [parent][crate::model::UnresolvePullRequestCommentsRequest::parent].
8308 ///
8309 /// # Example
8310 /// ```ignore,no_run
8311 /// # use google_cloud_securesourcemanager_v1::model::UnresolvePullRequestCommentsRequest;
8312 /// let x = UnresolvePullRequestCommentsRequest::new().set_parent("example");
8313 /// ```
8314 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8315 self.parent = v.into();
8316 self
8317 }
8318
8319 /// Sets the value of [names][crate::model::UnresolvePullRequestCommentsRequest::names].
8320 ///
8321 /// # Example
8322 /// ```ignore,no_run
8323 /// # use google_cloud_securesourcemanager_v1::model::UnresolvePullRequestCommentsRequest;
8324 /// let x = UnresolvePullRequestCommentsRequest::new().set_names(["a", "b", "c"]);
8325 /// ```
8326 pub fn set_names<T, V>(mut self, v: T) -> Self
8327 where
8328 T: std::iter::IntoIterator<Item = V>,
8329 V: std::convert::Into<std::string::String>,
8330 {
8331 use std::iter::Iterator;
8332 self.names = v.into_iter().map(|i| i.into()).collect();
8333 self
8334 }
8335
8336 /// Sets the value of [auto_fill][crate::model::UnresolvePullRequestCommentsRequest::auto_fill].
8337 ///
8338 /// # Example
8339 /// ```ignore,no_run
8340 /// # use google_cloud_securesourcemanager_v1::model::UnresolvePullRequestCommentsRequest;
8341 /// let x = UnresolvePullRequestCommentsRequest::new().set_auto_fill(true);
8342 /// ```
8343 pub fn set_auto_fill<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8344 self.auto_fill = v.into();
8345 self
8346 }
8347}
8348
8349impl wkt::message::Message for UnresolvePullRequestCommentsRequest {
8350 fn typename() -> &'static str {
8351 "type.googleapis.com/google.cloud.securesourcemanager.v1.UnresolvePullRequestCommentsRequest"
8352 }
8353}
8354
8355/// The response to unresolve multiple pull request comments.
8356#[derive(Clone, Default, PartialEq)]
8357#[non_exhaustive]
8358pub struct UnresolvePullRequestCommentsResponse {
8359 /// The list of pull request comments unresolved.
8360 pub pull_request_comments: std::vec::Vec<crate::model::PullRequestComment>,
8361
8362 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8363}
8364
8365impl UnresolvePullRequestCommentsResponse {
8366 pub fn new() -> Self {
8367 std::default::Default::default()
8368 }
8369
8370 /// Sets the value of [pull_request_comments][crate::model::UnresolvePullRequestCommentsResponse::pull_request_comments].
8371 ///
8372 /// # Example
8373 /// ```ignore,no_run
8374 /// # use google_cloud_securesourcemanager_v1::model::UnresolvePullRequestCommentsResponse;
8375 /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
8376 /// let x = UnresolvePullRequestCommentsResponse::new()
8377 /// .set_pull_request_comments([
8378 /// PullRequestComment::default()/* use setters */,
8379 /// PullRequestComment::default()/* use (different) setters */,
8380 /// ]);
8381 /// ```
8382 pub fn set_pull_request_comments<T, V>(mut self, v: T) -> Self
8383 where
8384 T: std::iter::IntoIterator<Item = V>,
8385 V: std::convert::Into<crate::model::PullRequestComment>,
8386 {
8387 use std::iter::Iterator;
8388 self.pull_request_comments = v.into_iter().map(|i| i.into()).collect();
8389 self
8390 }
8391}
8392
8393impl wkt::message::Message for UnresolvePullRequestCommentsResponse {
8394 fn typename() -> &'static str {
8395 "type.googleapis.com/google.cloud.securesourcemanager.v1.UnresolvePullRequestCommentsResponse"
8396 }
8397}
8398
8399/// The request to create an issue comment.
8400#[derive(Clone, Default, PartialEq)]
8401#[non_exhaustive]
8402pub struct CreateIssueCommentRequest {
8403 /// Required. The issue in which to create the issue comment. Format:
8404 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`
8405 pub parent: std::string::String,
8406
8407 /// Required. The issue comment to create.
8408 pub issue_comment: std::option::Option<crate::model::IssueComment>,
8409
8410 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8411}
8412
8413impl CreateIssueCommentRequest {
8414 pub fn new() -> Self {
8415 std::default::Default::default()
8416 }
8417
8418 /// Sets the value of [parent][crate::model::CreateIssueCommentRequest::parent].
8419 ///
8420 /// # Example
8421 /// ```ignore,no_run
8422 /// # use google_cloud_securesourcemanager_v1::model::CreateIssueCommentRequest;
8423 /// let x = CreateIssueCommentRequest::new().set_parent("example");
8424 /// ```
8425 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8426 self.parent = v.into();
8427 self
8428 }
8429
8430 /// Sets the value of [issue_comment][crate::model::CreateIssueCommentRequest::issue_comment].
8431 ///
8432 /// # Example
8433 /// ```ignore,no_run
8434 /// # use google_cloud_securesourcemanager_v1::model::CreateIssueCommentRequest;
8435 /// use google_cloud_securesourcemanager_v1::model::IssueComment;
8436 /// let x = CreateIssueCommentRequest::new().set_issue_comment(IssueComment::default()/* use setters */);
8437 /// ```
8438 pub fn set_issue_comment<T>(mut self, v: T) -> Self
8439 where
8440 T: std::convert::Into<crate::model::IssueComment>,
8441 {
8442 self.issue_comment = std::option::Option::Some(v.into());
8443 self
8444 }
8445
8446 /// Sets or clears the value of [issue_comment][crate::model::CreateIssueCommentRequest::issue_comment].
8447 ///
8448 /// # Example
8449 /// ```ignore,no_run
8450 /// # use google_cloud_securesourcemanager_v1::model::CreateIssueCommentRequest;
8451 /// use google_cloud_securesourcemanager_v1::model::IssueComment;
8452 /// let x = CreateIssueCommentRequest::new().set_or_clear_issue_comment(Some(IssueComment::default()/* use setters */));
8453 /// let x = CreateIssueCommentRequest::new().set_or_clear_issue_comment(None::<IssueComment>);
8454 /// ```
8455 pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
8456 where
8457 T: std::convert::Into<crate::model::IssueComment>,
8458 {
8459 self.issue_comment = v.map(|x| x.into());
8460 self
8461 }
8462}
8463
8464impl wkt::message::Message for CreateIssueCommentRequest {
8465 fn typename() -> &'static str {
8466 "type.googleapis.com/google.cloud.securesourcemanager.v1.CreateIssueCommentRequest"
8467 }
8468}
8469
8470/// The request to get an issue comment.
8471#[derive(Clone, Default, PartialEq)]
8472#[non_exhaustive]
8473pub struct GetIssueCommentRequest {
8474 /// Required. Name of the issue comment to retrieve.
8475 /// The format is
8476 /// `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}/issueComments/{comment_id}`.
8477 pub name: std::string::String,
8478
8479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8480}
8481
8482impl GetIssueCommentRequest {
8483 pub fn new() -> Self {
8484 std::default::Default::default()
8485 }
8486
8487 /// Sets the value of [name][crate::model::GetIssueCommentRequest::name].
8488 ///
8489 /// # Example
8490 /// ```ignore,no_run
8491 /// # use google_cloud_securesourcemanager_v1::model::GetIssueCommentRequest;
8492 /// let x = GetIssueCommentRequest::new().set_name("example");
8493 /// ```
8494 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8495 self.name = v.into();
8496 self
8497 }
8498}
8499
8500impl wkt::message::Message for GetIssueCommentRequest {
8501 fn typename() -> &'static str {
8502 "type.googleapis.com/google.cloud.securesourcemanager.v1.GetIssueCommentRequest"
8503 }
8504}
8505
8506/// The request to list issue comments.
8507#[derive(Clone, Default, PartialEq)]
8508#[non_exhaustive]
8509pub struct ListIssueCommentsRequest {
8510 /// Required. The issue in which to list the comments. Format:
8511 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`
8512 pub parent: std::string::String,
8513
8514 /// Optional. Requested page size. If unspecified, a default size of 30 will be
8515 /// used. The maximum value is 100; values above 100 will be coerced to 100.
8516 pub page_size: i32,
8517
8518 /// Optional. A token identifying a page of results the server should return.
8519 pub page_token: std::string::String,
8520
8521 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8522}
8523
8524impl ListIssueCommentsRequest {
8525 pub fn new() -> Self {
8526 std::default::Default::default()
8527 }
8528
8529 /// Sets the value of [parent][crate::model::ListIssueCommentsRequest::parent].
8530 ///
8531 /// # Example
8532 /// ```ignore,no_run
8533 /// # use google_cloud_securesourcemanager_v1::model::ListIssueCommentsRequest;
8534 /// let x = ListIssueCommentsRequest::new().set_parent("example");
8535 /// ```
8536 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8537 self.parent = v.into();
8538 self
8539 }
8540
8541 /// Sets the value of [page_size][crate::model::ListIssueCommentsRequest::page_size].
8542 ///
8543 /// # Example
8544 /// ```ignore,no_run
8545 /// # use google_cloud_securesourcemanager_v1::model::ListIssueCommentsRequest;
8546 /// let x = ListIssueCommentsRequest::new().set_page_size(42);
8547 /// ```
8548 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8549 self.page_size = v.into();
8550 self
8551 }
8552
8553 /// Sets the value of [page_token][crate::model::ListIssueCommentsRequest::page_token].
8554 ///
8555 /// # Example
8556 /// ```ignore,no_run
8557 /// # use google_cloud_securesourcemanager_v1::model::ListIssueCommentsRequest;
8558 /// let x = ListIssueCommentsRequest::new().set_page_token("example");
8559 /// ```
8560 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8561 self.page_token = v.into();
8562 self
8563 }
8564}
8565
8566impl wkt::message::Message for ListIssueCommentsRequest {
8567 fn typename() -> &'static str {
8568 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssueCommentsRequest"
8569 }
8570}
8571
8572/// The response to list issue comments.
8573#[derive(Clone, Default, PartialEq)]
8574#[non_exhaustive]
8575pub struct ListIssueCommentsResponse {
8576 /// The list of issue comments.
8577 pub issue_comments: std::vec::Vec<crate::model::IssueComment>,
8578
8579 /// A token identifying a page of results the server should return.
8580 pub next_page_token: std::string::String,
8581
8582 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8583}
8584
8585impl ListIssueCommentsResponse {
8586 pub fn new() -> Self {
8587 std::default::Default::default()
8588 }
8589
8590 /// Sets the value of [issue_comments][crate::model::ListIssueCommentsResponse::issue_comments].
8591 ///
8592 /// # Example
8593 /// ```ignore,no_run
8594 /// # use google_cloud_securesourcemanager_v1::model::ListIssueCommentsResponse;
8595 /// use google_cloud_securesourcemanager_v1::model::IssueComment;
8596 /// let x = ListIssueCommentsResponse::new()
8597 /// .set_issue_comments([
8598 /// IssueComment::default()/* use setters */,
8599 /// IssueComment::default()/* use (different) setters */,
8600 /// ]);
8601 /// ```
8602 pub fn set_issue_comments<T, V>(mut self, v: T) -> Self
8603 where
8604 T: std::iter::IntoIterator<Item = V>,
8605 V: std::convert::Into<crate::model::IssueComment>,
8606 {
8607 use std::iter::Iterator;
8608 self.issue_comments = v.into_iter().map(|i| i.into()).collect();
8609 self
8610 }
8611
8612 /// Sets the value of [next_page_token][crate::model::ListIssueCommentsResponse::next_page_token].
8613 ///
8614 /// # Example
8615 /// ```ignore,no_run
8616 /// # use google_cloud_securesourcemanager_v1::model::ListIssueCommentsResponse;
8617 /// let x = ListIssueCommentsResponse::new().set_next_page_token("example");
8618 /// ```
8619 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8620 self.next_page_token = v.into();
8621 self
8622 }
8623}
8624
8625impl wkt::message::Message for ListIssueCommentsResponse {
8626 fn typename() -> &'static str {
8627 "type.googleapis.com/google.cloud.securesourcemanager.v1.ListIssueCommentsResponse"
8628 }
8629}
8630
8631#[doc(hidden)]
8632impl google_cloud_gax::paginator::internal::PageableResponse for ListIssueCommentsResponse {
8633 type PageItem = crate::model::IssueComment;
8634
8635 fn items(self) -> std::vec::Vec<Self::PageItem> {
8636 self.issue_comments
8637 }
8638
8639 fn next_page_token(&self) -> std::string::String {
8640 use std::clone::Clone;
8641 self.next_page_token.clone()
8642 }
8643}
8644
8645/// The request to update an issue comment.
8646#[derive(Clone, Default, PartialEq)]
8647#[non_exhaustive]
8648pub struct UpdateIssueCommentRequest {
8649 /// Required. The issue comment to update.
8650 pub issue_comment: std::option::Option<crate::model::IssueComment>,
8651
8652 /// Optional. Field mask is used to specify the fields to be overwritten in the
8653 /// issue comment resource by the update.
8654 /// The fields specified in the update_mask are relative to the resource, not
8655 /// the full request. A field will be overwritten if it is in the mask.
8656 /// The special value "*" means full replacement.
8657 pub update_mask: std::option::Option<wkt::FieldMask>,
8658
8659 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8660}
8661
8662impl UpdateIssueCommentRequest {
8663 pub fn new() -> Self {
8664 std::default::Default::default()
8665 }
8666
8667 /// Sets the value of [issue_comment][crate::model::UpdateIssueCommentRequest::issue_comment].
8668 ///
8669 /// # Example
8670 /// ```ignore,no_run
8671 /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueCommentRequest;
8672 /// use google_cloud_securesourcemanager_v1::model::IssueComment;
8673 /// let x = UpdateIssueCommentRequest::new().set_issue_comment(IssueComment::default()/* use setters */);
8674 /// ```
8675 pub fn set_issue_comment<T>(mut self, v: T) -> Self
8676 where
8677 T: std::convert::Into<crate::model::IssueComment>,
8678 {
8679 self.issue_comment = std::option::Option::Some(v.into());
8680 self
8681 }
8682
8683 /// Sets or clears the value of [issue_comment][crate::model::UpdateIssueCommentRequest::issue_comment].
8684 ///
8685 /// # Example
8686 /// ```ignore,no_run
8687 /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueCommentRequest;
8688 /// use google_cloud_securesourcemanager_v1::model::IssueComment;
8689 /// let x = UpdateIssueCommentRequest::new().set_or_clear_issue_comment(Some(IssueComment::default()/* use setters */));
8690 /// let x = UpdateIssueCommentRequest::new().set_or_clear_issue_comment(None::<IssueComment>);
8691 /// ```
8692 pub fn set_or_clear_issue_comment<T>(mut self, v: std::option::Option<T>) -> Self
8693 where
8694 T: std::convert::Into<crate::model::IssueComment>,
8695 {
8696 self.issue_comment = v.map(|x| x.into());
8697 self
8698 }
8699
8700 /// Sets the value of [update_mask][crate::model::UpdateIssueCommentRequest::update_mask].
8701 ///
8702 /// # Example
8703 /// ```ignore,no_run
8704 /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueCommentRequest;
8705 /// use wkt::FieldMask;
8706 /// let x = UpdateIssueCommentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8707 /// ```
8708 pub fn set_update_mask<T>(mut self, v: T) -> Self
8709 where
8710 T: std::convert::Into<wkt::FieldMask>,
8711 {
8712 self.update_mask = std::option::Option::Some(v.into());
8713 self
8714 }
8715
8716 /// Sets or clears the value of [update_mask][crate::model::UpdateIssueCommentRequest::update_mask].
8717 ///
8718 /// # Example
8719 /// ```ignore,no_run
8720 /// # use google_cloud_securesourcemanager_v1::model::UpdateIssueCommentRequest;
8721 /// use wkt::FieldMask;
8722 /// let x = UpdateIssueCommentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8723 /// let x = UpdateIssueCommentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8724 /// ```
8725 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8726 where
8727 T: std::convert::Into<wkt::FieldMask>,
8728 {
8729 self.update_mask = v.map(|x| x.into());
8730 self
8731 }
8732}
8733
8734impl wkt::message::Message for UpdateIssueCommentRequest {
8735 fn typename() -> &'static str {
8736 "type.googleapis.com/google.cloud.securesourcemanager.v1.UpdateIssueCommentRequest"
8737 }
8738}
8739
8740/// The request to delete an issue comment.
8741#[derive(Clone, Default, PartialEq)]
8742#[non_exhaustive]
8743pub struct DeleteIssueCommentRequest {
8744 /// Required. Name of the issue comment to delete.
8745 /// The format is
8746 /// `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}`.
8747 pub name: std::string::String,
8748
8749 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8750}
8751
8752impl DeleteIssueCommentRequest {
8753 pub fn new() -> Self {
8754 std::default::Default::default()
8755 }
8756
8757 /// Sets the value of [name][crate::model::DeleteIssueCommentRequest::name].
8758 ///
8759 /// # Example
8760 /// ```ignore,no_run
8761 /// # use google_cloud_securesourcemanager_v1::model::DeleteIssueCommentRequest;
8762 /// let x = DeleteIssueCommentRequest::new().set_name("example");
8763 /// ```
8764 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8765 self.name = v.into();
8766 self
8767 }
8768}
8769
8770impl wkt::message::Message for DeleteIssueCommentRequest {
8771 fn typename() -> &'static str {
8772 "type.googleapis.com/google.cloud.securesourcemanager.v1.DeleteIssueCommentRequest"
8773 }
8774}