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