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