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