google_cloud_securitycenter_v2/builder.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
17pub mod security_center {
18 use crate::Result;
19
20 /// A builder for [SecurityCenter][crate::client::SecurityCenter].
21 ///
22 /// ```
23 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
24 /// # use google_cloud_securitycenter_v2::*;
25 /// # use builder::security_center::ClientBuilder;
26 /// # use client::SecurityCenter;
27 /// let builder : ClientBuilder = SecurityCenter::builder();
28 /// let client = builder
29 /// .with_endpoint("https://securitycenter.googleapis.com")
30 /// .build().await?;
31 /// # Ok(()) }
32 /// ```
33 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::SecurityCenter;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = SecurityCenter;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 /// Common implementation for [crate::client::SecurityCenter] request builders.
51 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 /// The request builder for [SecurityCenter::batch_create_resource_value_configs][crate::client::SecurityCenter::batch_create_resource_value_configs] calls.
74 ///
75 /// # Example
76 /// ```
77 /// # use google_cloud_securitycenter_v2::builder::security_center::BatchCreateResourceValueConfigs;
78 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
79 ///
80 /// let builder = prepare_request_builder();
81 /// let response = builder.send().await?;
82 /// # Ok(()) }
83 ///
84 /// fn prepare_request_builder() -> BatchCreateResourceValueConfigs {
85 /// # panic!();
86 /// // ... details omitted ...
87 /// }
88 /// ```
89 #[derive(Clone, Debug)]
90 pub struct BatchCreateResourceValueConfigs(
91 RequestBuilder<crate::model::BatchCreateResourceValueConfigsRequest>,
92 );
93
94 impl BatchCreateResourceValueConfigs {
95 pub(crate) fn new(
96 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
97 ) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 /// Sets the full request, replacing any prior values.
102 pub fn with_request<V: Into<crate::model::BatchCreateResourceValueConfigsRequest>>(
103 mut self,
104 v: V,
105 ) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 /// Sets all the options, replacing any prior values.
111 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 /// Sends the request.
117 pub async fn send(self) -> Result<crate::model::BatchCreateResourceValueConfigsResponse> {
118 (*self.0.stub)
119 .batch_create_resource_value_configs(self.0.request, self.0.options)
120 .await
121 .map(crate::Response::into_body)
122 }
123
124 /// Sets the value of [parent][crate::model::BatchCreateResourceValueConfigsRequest::parent].
125 ///
126 /// This is a **required** field for requests.
127 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
128 self.0.request.parent = v.into();
129 self
130 }
131
132 /// Sets the value of [requests][crate::model::BatchCreateResourceValueConfigsRequest::requests].
133 ///
134 /// This is a **required** field for requests.
135 pub fn set_requests<T, V>(mut self, v: T) -> Self
136 where
137 T: std::iter::IntoIterator<Item = V>,
138 V: std::convert::Into<crate::model::CreateResourceValueConfigRequest>,
139 {
140 use std::iter::Iterator;
141 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
142 self
143 }
144 }
145
146 #[doc(hidden)]
147 impl crate::RequestBuilder for BatchCreateResourceValueConfigs {
148 fn request_options(&mut self) -> &mut crate::RequestOptions {
149 &mut self.0.options
150 }
151 }
152
153 /// The request builder for [SecurityCenter::bulk_mute_findings][crate::client::SecurityCenter::bulk_mute_findings] calls.
154 ///
155 /// # Example
156 /// ```
157 /// # use google_cloud_securitycenter_v2::builder::security_center::BulkMuteFindings;
158 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
159 /// use google_cloud_lro::Poller;
160 ///
161 /// let builder = prepare_request_builder();
162 /// let response = builder.poller().until_done().await?;
163 /// # Ok(()) }
164 ///
165 /// fn prepare_request_builder() -> BulkMuteFindings {
166 /// # panic!();
167 /// // ... details omitted ...
168 /// }
169 /// ```
170 #[derive(Clone, Debug)]
171 pub struct BulkMuteFindings(RequestBuilder<crate::model::BulkMuteFindingsRequest>);
172
173 impl BulkMuteFindings {
174 pub(crate) fn new(
175 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
176 ) -> Self {
177 Self(RequestBuilder::new(stub))
178 }
179
180 /// Sets the full request, replacing any prior values.
181 pub fn with_request<V: Into<crate::model::BulkMuteFindingsRequest>>(
182 mut self,
183 v: V,
184 ) -> Self {
185 self.0.request = v.into();
186 self
187 }
188
189 /// Sets all the options, replacing any prior values.
190 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
191 self.0.options = v.into();
192 self
193 }
194
195 /// Sends the request.
196 ///
197 /// # Long running operations
198 ///
199 /// This starts, but does not poll, a longrunning operation. More information
200 /// on [bulk_mute_findings][crate::client::SecurityCenter::bulk_mute_findings].
201 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
202 (*self.0.stub)
203 .bulk_mute_findings(self.0.request, self.0.options)
204 .await
205 .map(crate::Response::into_body)
206 }
207
208 /// Creates a [Poller][google_cloud_lro::Poller] to work with `bulk_mute_findings`.
209 pub fn poller(
210 self,
211 ) -> impl google_cloud_lro::Poller<crate::model::BulkMuteFindingsResponse, ()> {
212 type Operation = google_cloud_lro::internal::Operation<
213 crate::model::BulkMuteFindingsResponse,
214 wkt::Empty,
215 >;
216 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
217 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
218
219 let stub = self.0.stub.clone();
220 let mut options = self.0.options.clone();
221 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
222 let query = move |name| {
223 let stub = stub.clone();
224 let options = options.clone();
225 async {
226 let op = GetOperation::new(stub)
227 .set_name(name)
228 .with_options(options)
229 .send()
230 .await?;
231 Ok(Operation::new(op))
232 }
233 };
234
235 let start = move || async {
236 let op = self.send().await?;
237 Ok(Operation::new(op))
238 };
239
240 google_cloud_lro::internal::new_unit_metadata_poller(
241 polling_error_policy,
242 polling_backoff_policy,
243 start,
244 query,
245 )
246 }
247
248 /// Sets the value of [parent][crate::model::BulkMuteFindingsRequest::parent].
249 ///
250 /// This is a **required** field for requests.
251 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
252 self.0.request.parent = v.into();
253 self
254 }
255
256 /// Sets the value of [filter][crate::model::BulkMuteFindingsRequest::filter].
257 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
258 self.0.request.filter = v.into();
259 self
260 }
261
262 /// Sets the value of [mute_state][crate::model::BulkMuteFindingsRequest::mute_state].
263 pub fn set_mute_state<T: Into<crate::model::bulk_mute_findings_request::MuteState>>(
264 mut self,
265 v: T,
266 ) -> Self {
267 self.0.request.mute_state = v.into();
268 self
269 }
270 }
271
272 #[doc(hidden)]
273 impl crate::RequestBuilder for BulkMuteFindings {
274 fn request_options(&mut self) -> &mut crate::RequestOptions {
275 &mut self.0.options
276 }
277 }
278
279 /// The request builder for [SecurityCenter::create_big_query_export][crate::client::SecurityCenter::create_big_query_export] calls.
280 ///
281 /// # Example
282 /// ```
283 /// # use google_cloud_securitycenter_v2::builder::security_center::CreateBigQueryExport;
284 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
285 ///
286 /// let builder = prepare_request_builder();
287 /// let response = builder.send().await?;
288 /// # Ok(()) }
289 ///
290 /// fn prepare_request_builder() -> CreateBigQueryExport {
291 /// # panic!();
292 /// // ... details omitted ...
293 /// }
294 /// ```
295 #[derive(Clone, Debug)]
296 pub struct CreateBigQueryExport(RequestBuilder<crate::model::CreateBigQueryExportRequest>);
297
298 impl CreateBigQueryExport {
299 pub(crate) fn new(
300 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
301 ) -> Self {
302 Self(RequestBuilder::new(stub))
303 }
304
305 /// Sets the full request, replacing any prior values.
306 pub fn with_request<V: Into<crate::model::CreateBigQueryExportRequest>>(
307 mut self,
308 v: V,
309 ) -> Self {
310 self.0.request = v.into();
311 self
312 }
313
314 /// Sets all the options, replacing any prior values.
315 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
316 self.0.options = v.into();
317 self
318 }
319
320 /// Sends the request.
321 pub async fn send(self) -> Result<crate::model::BigQueryExport> {
322 (*self.0.stub)
323 .create_big_query_export(self.0.request, self.0.options)
324 .await
325 .map(crate::Response::into_body)
326 }
327
328 /// Sets the value of [parent][crate::model::CreateBigQueryExportRequest::parent].
329 ///
330 /// This is a **required** field for requests.
331 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
332 self.0.request.parent = v.into();
333 self
334 }
335
336 /// Sets the value of [big_query_export][crate::model::CreateBigQueryExportRequest::big_query_export].
337 ///
338 /// This is a **required** field for requests.
339 pub fn set_big_query_export<T>(mut self, v: T) -> Self
340 where
341 T: std::convert::Into<crate::model::BigQueryExport>,
342 {
343 self.0.request.big_query_export = std::option::Option::Some(v.into());
344 self
345 }
346
347 /// Sets or clears the value of [big_query_export][crate::model::CreateBigQueryExportRequest::big_query_export].
348 ///
349 /// This is a **required** field for requests.
350 pub fn set_or_clear_big_query_export<T>(mut self, v: std::option::Option<T>) -> Self
351 where
352 T: std::convert::Into<crate::model::BigQueryExport>,
353 {
354 self.0.request.big_query_export = v.map(|x| x.into());
355 self
356 }
357
358 /// Sets the value of [big_query_export_id][crate::model::CreateBigQueryExportRequest::big_query_export_id].
359 ///
360 /// This is a **required** field for requests.
361 pub fn set_big_query_export_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
362 self.0.request.big_query_export_id = v.into();
363 self
364 }
365 }
366
367 #[doc(hidden)]
368 impl crate::RequestBuilder for CreateBigQueryExport {
369 fn request_options(&mut self) -> &mut crate::RequestOptions {
370 &mut self.0.options
371 }
372 }
373
374 /// The request builder for [SecurityCenter::create_finding][crate::client::SecurityCenter::create_finding] calls.
375 ///
376 /// # Example
377 /// ```
378 /// # use google_cloud_securitycenter_v2::builder::security_center::CreateFinding;
379 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
380 ///
381 /// let builder = prepare_request_builder();
382 /// let response = builder.send().await?;
383 /// # Ok(()) }
384 ///
385 /// fn prepare_request_builder() -> CreateFinding {
386 /// # panic!();
387 /// // ... details omitted ...
388 /// }
389 /// ```
390 #[derive(Clone, Debug)]
391 pub struct CreateFinding(RequestBuilder<crate::model::CreateFindingRequest>);
392
393 impl CreateFinding {
394 pub(crate) fn new(
395 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
396 ) -> Self {
397 Self(RequestBuilder::new(stub))
398 }
399
400 /// Sets the full request, replacing any prior values.
401 pub fn with_request<V: Into<crate::model::CreateFindingRequest>>(mut self, v: V) -> Self {
402 self.0.request = v.into();
403 self
404 }
405
406 /// Sets all the options, replacing any prior values.
407 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
408 self.0.options = v.into();
409 self
410 }
411
412 /// Sends the request.
413 pub async fn send(self) -> Result<crate::model::Finding> {
414 (*self.0.stub)
415 .create_finding(self.0.request, self.0.options)
416 .await
417 .map(crate::Response::into_body)
418 }
419
420 /// Sets the value of [parent][crate::model::CreateFindingRequest::parent].
421 ///
422 /// This is a **required** field for requests.
423 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
424 self.0.request.parent = v.into();
425 self
426 }
427
428 /// Sets the value of [finding_id][crate::model::CreateFindingRequest::finding_id].
429 ///
430 /// This is a **required** field for requests.
431 pub fn set_finding_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
432 self.0.request.finding_id = v.into();
433 self
434 }
435
436 /// Sets the value of [finding][crate::model::CreateFindingRequest::finding].
437 ///
438 /// This is a **required** field for requests.
439 pub fn set_finding<T>(mut self, v: T) -> Self
440 where
441 T: std::convert::Into<crate::model::Finding>,
442 {
443 self.0.request.finding = std::option::Option::Some(v.into());
444 self
445 }
446
447 /// Sets or clears the value of [finding][crate::model::CreateFindingRequest::finding].
448 ///
449 /// This is a **required** field for requests.
450 pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
451 where
452 T: std::convert::Into<crate::model::Finding>,
453 {
454 self.0.request.finding = v.map(|x| x.into());
455 self
456 }
457 }
458
459 #[doc(hidden)]
460 impl crate::RequestBuilder for CreateFinding {
461 fn request_options(&mut self) -> &mut crate::RequestOptions {
462 &mut self.0.options
463 }
464 }
465
466 /// The request builder for [SecurityCenter::create_mute_config][crate::client::SecurityCenter::create_mute_config] calls.
467 ///
468 /// # Example
469 /// ```
470 /// # use google_cloud_securitycenter_v2::builder::security_center::CreateMuteConfig;
471 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
472 ///
473 /// let builder = prepare_request_builder();
474 /// let response = builder.send().await?;
475 /// # Ok(()) }
476 ///
477 /// fn prepare_request_builder() -> CreateMuteConfig {
478 /// # panic!();
479 /// // ... details omitted ...
480 /// }
481 /// ```
482 #[derive(Clone, Debug)]
483 pub struct CreateMuteConfig(RequestBuilder<crate::model::CreateMuteConfigRequest>);
484
485 impl CreateMuteConfig {
486 pub(crate) fn new(
487 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
488 ) -> Self {
489 Self(RequestBuilder::new(stub))
490 }
491
492 /// Sets the full request, replacing any prior values.
493 pub fn with_request<V: Into<crate::model::CreateMuteConfigRequest>>(
494 mut self,
495 v: V,
496 ) -> Self {
497 self.0.request = v.into();
498 self
499 }
500
501 /// Sets all the options, replacing any prior values.
502 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
503 self.0.options = v.into();
504 self
505 }
506
507 /// Sends the request.
508 pub async fn send(self) -> Result<crate::model::MuteConfig> {
509 (*self.0.stub)
510 .create_mute_config(self.0.request, self.0.options)
511 .await
512 .map(crate::Response::into_body)
513 }
514
515 /// Sets the value of [parent][crate::model::CreateMuteConfigRequest::parent].
516 ///
517 /// This is a **required** field for requests.
518 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
519 self.0.request.parent = v.into();
520 self
521 }
522
523 /// Sets the value of [mute_config][crate::model::CreateMuteConfigRequest::mute_config].
524 ///
525 /// This is a **required** field for requests.
526 pub fn set_mute_config<T>(mut self, v: T) -> Self
527 where
528 T: std::convert::Into<crate::model::MuteConfig>,
529 {
530 self.0.request.mute_config = std::option::Option::Some(v.into());
531 self
532 }
533
534 /// Sets or clears the value of [mute_config][crate::model::CreateMuteConfigRequest::mute_config].
535 ///
536 /// This is a **required** field for requests.
537 pub fn set_or_clear_mute_config<T>(mut self, v: std::option::Option<T>) -> Self
538 where
539 T: std::convert::Into<crate::model::MuteConfig>,
540 {
541 self.0.request.mute_config = v.map(|x| x.into());
542 self
543 }
544
545 /// Sets the value of [mute_config_id][crate::model::CreateMuteConfigRequest::mute_config_id].
546 ///
547 /// This is a **required** field for requests.
548 pub fn set_mute_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
549 self.0.request.mute_config_id = v.into();
550 self
551 }
552 }
553
554 #[doc(hidden)]
555 impl crate::RequestBuilder for CreateMuteConfig {
556 fn request_options(&mut self) -> &mut crate::RequestOptions {
557 &mut self.0.options
558 }
559 }
560
561 /// The request builder for [SecurityCenter::create_notification_config][crate::client::SecurityCenter::create_notification_config] calls.
562 ///
563 /// # Example
564 /// ```
565 /// # use google_cloud_securitycenter_v2::builder::security_center::CreateNotificationConfig;
566 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
567 ///
568 /// let builder = prepare_request_builder();
569 /// let response = builder.send().await?;
570 /// # Ok(()) }
571 ///
572 /// fn prepare_request_builder() -> CreateNotificationConfig {
573 /// # panic!();
574 /// // ... details omitted ...
575 /// }
576 /// ```
577 #[derive(Clone, Debug)]
578 pub struct CreateNotificationConfig(
579 RequestBuilder<crate::model::CreateNotificationConfigRequest>,
580 );
581
582 impl CreateNotificationConfig {
583 pub(crate) fn new(
584 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
585 ) -> Self {
586 Self(RequestBuilder::new(stub))
587 }
588
589 /// Sets the full request, replacing any prior values.
590 pub fn with_request<V: Into<crate::model::CreateNotificationConfigRequest>>(
591 mut self,
592 v: V,
593 ) -> Self {
594 self.0.request = v.into();
595 self
596 }
597
598 /// Sets all the options, replacing any prior values.
599 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
600 self.0.options = v.into();
601 self
602 }
603
604 /// Sends the request.
605 pub async fn send(self) -> Result<crate::model::NotificationConfig> {
606 (*self.0.stub)
607 .create_notification_config(self.0.request, self.0.options)
608 .await
609 .map(crate::Response::into_body)
610 }
611
612 /// Sets the value of [parent][crate::model::CreateNotificationConfigRequest::parent].
613 ///
614 /// This is a **required** field for requests.
615 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
616 self.0.request.parent = v.into();
617 self
618 }
619
620 /// Sets the value of [config_id][crate::model::CreateNotificationConfigRequest::config_id].
621 ///
622 /// This is a **required** field for requests.
623 pub fn set_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
624 self.0.request.config_id = v.into();
625 self
626 }
627
628 /// Sets the value of [notification_config][crate::model::CreateNotificationConfigRequest::notification_config].
629 ///
630 /// This is a **required** field for requests.
631 pub fn set_notification_config<T>(mut self, v: T) -> Self
632 where
633 T: std::convert::Into<crate::model::NotificationConfig>,
634 {
635 self.0.request.notification_config = std::option::Option::Some(v.into());
636 self
637 }
638
639 /// Sets or clears the value of [notification_config][crate::model::CreateNotificationConfigRequest::notification_config].
640 ///
641 /// This is a **required** field for requests.
642 pub fn set_or_clear_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
643 where
644 T: std::convert::Into<crate::model::NotificationConfig>,
645 {
646 self.0.request.notification_config = v.map(|x| x.into());
647 self
648 }
649 }
650
651 #[doc(hidden)]
652 impl crate::RequestBuilder for CreateNotificationConfig {
653 fn request_options(&mut self) -> &mut crate::RequestOptions {
654 &mut self.0.options
655 }
656 }
657
658 /// The request builder for [SecurityCenter::create_source][crate::client::SecurityCenter::create_source] calls.
659 ///
660 /// # Example
661 /// ```
662 /// # use google_cloud_securitycenter_v2::builder::security_center::CreateSource;
663 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
664 ///
665 /// let builder = prepare_request_builder();
666 /// let response = builder.send().await?;
667 /// # Ok(()) }
668 ///
669 /// fn prepare_request_builder() -> CreateSource {
670 /// # panic!();
671 /// // ... details omitted ...
672 /// }
673 /// ```
674 #[derive(Clone, Debug)]
675 pub struct CreateSource(RequestBuilder<crate::model::CreateSourceRequest>);
676
677 impl CreateSource {
678 pub(crate) fn new(
679 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
680 ) -> Self {
681 Self(RequestBuilder::new(stub))
682 }
683
684 /// Sets the full request, replacing any prior values.
685 pub fn with_request<V: Into<crate::model::CreateSourceRequest>>(mut self, v: V) -> Self {
686 self.0.request = v.into();
687 self
688 }
689
690 /// Sets all the options, replacing any prior values.
691 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
692 self.0.options = v.into();
693 self
694 }
695
696 /// Sends the request.
697 pub async fn send(self) -> Result<crate::model::Source> {
698 (*self.0.stub)
699 .create_source(self.0.request, self.0.options)
700 .await
701 .map(crate::Response::into_body)
702 }
703
704 /// Sets the value of [parent][crate::model::CreateSourceRequest::parent].
705 ///
706 /// This is a **required** field for requests.
707 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
708 self.0.request.parent = v.into();
709 self
710 }
711
712 /// Sets the value of [source][crate::model::CreateSourceRequest::source].
713 ///
714 /// This is a **required** field for requests.
715 pub fn set_source<T>(mut self, v: T) -> Self
716 where
717 T: std::convert::Into<crate::model::Source>,
718 {
719 self.0.request.source = std::option::Option::Some(v.into());
720 self
721 }
722
723 /// Sets or clears the value of [source][crate::model::CreateSourceRequest::source].
724 ///
725 /// This is a **required** field for requests.
726 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
727 where
728 T: std::convert::Into<crate::model::Source>,
729 {
730 self.0.request.source = v.map(|x| x.into());
731 self
732 }
733 }
734
735 #[doc(hidden)]
736 impl crate::RequestBuilder for CreateSource {
737 fn request_options(&mut self) -> &mut crate::RequestOptions {
738 &mut self.0.options
739 }
740 }
741
742 /// The request builder for [SecurityCenter::delete_big_query_export][crate::client::SecurityCenter::delete_big_query_export] calls.
743 ///
744 /// # Example
745 /// ```
746 /// # use google_cloud_securitycenter_v2::builder::security_center::DeleteBigQueryExport;
747 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
748 ///
749 /// let builder = prepare_request_builder();
750 /// let response = builder.send().await?;
751 /// # Ok(()) }
752 ///
753 /// fn prepare_request_builder() -> DeleteBigQueryExport {
754 /// # panic!();
755 /// // ... details omitted ...
756 /// }
757 /// ```
758 #[derive(Clone, Debug)]
759 pub struct DeleteBigQueryExport(RequestBuilder<crate::model::DeleteBigQueryExportRequest>);
760
761 impl DeleteBigQueryExport {
762 pub(crate) fn new(
763 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
764 ) -> Self {
765 Self(RequestBuilder::new(stub))
766 }
767
768 /// Sets the full request, replacing any prior values.
769 pub fn with_request<V: Into<crate::model::DeleteBigQueryExportRequest>>(
770 mut self,
771 v: V,
772 ) -> Self {
773 self.0.request = v.into();
774 self
775 }
776
777 /// Sets all the options, replacing any prior values.
778 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
779 self.0.options = v.into();
780 self
781 }
782
783 /// Sends the request.
784 pub async fn send(self) -> Result<()> {
785 (*self.0.stub)
786 .delete_big_query_export(self.0.request, self.0.options)
787 .await
788 .map(crate::Response::into_body)
789 }
790
791 /// Sets the value of [name][crate::model::DeleteBigQueryExportRequest::name].
792 ///
793 /// This is a **required** field for requests.
794 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
795 self.0.request.name = v.into();
796 self
797 }
798 }
799
800 #[doc(hidden)]
801 impl crate::RequestBuilder for DeleteBigQueryExport {
802 fn request_options(&mut self) -> &mut crate::RequestOptions {
803 &mut self.0.options
804 }
805 }
806
807 /// The request builder for [SecurityCenter::delete_mute_config][crate::client::SecurityCenter::delete_mute_config] calls.
808 ///
809 /// # Example
810 /// ```
811 /// # use google_cloud_securitycenter_v2::builder::security_center::DeleteMuteConfig;
812 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
813 ///
814 /// let builder = prepare_request_builder();
815 /// let response = builder.send().await?;
816 /// # Ok(()) }
817 ///
818 /// fn prepare_request_builder() -> DeleteMuteConfig {
819 /// # panic!();
820 /// // ... details omitted ...
821 /// }
822 /// ```
823 #[derive(Clone, Debug)]
824 pub struct DeleteMuteConfig(RequestBuilder<crate::model::DeleteMuteConfigRequest>);
825
826 impl DeleteMuteConfig {
827 pub(crate) fn new(
828 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
829 ) -> Self {
830 Self(RequestBuilder::new(stub))
831 }
832
833 /// Sets the full request, replacing any prior values.
834 pub fn with_request<V: Into<crate::model::DeleteMuteConfigRequest>>(
835 mut self,
836 v: V,
837 ) -> Self {
838 self.0.request = v.into();
839 self
840 }
841
842 /// Sets all the options, replacing any prior values.
843 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
844 self.0.options = v.into();
845 self
846 }
847
848 /// Sends the request.
849 pub async fn send(self) -> Result<()> {
850 (*self.0.stub)
851 .delete_mute_config(self.0.request, self.0.options)
852 .await
853 .map(crate::Response::into_body)
854 }
855
856 /// Sets the value of [name][crate::model::DeleteMuteConfigRequest::name].
857 ///
858 /// This is a **required** field for requests.
859 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
860 self.0.request.name = v.into();
861 self
862 }
863 }
864
865 #[doc(hidden)]
866 impl crate::RequestBuilder for DeleteMuteConfig {
867 fn request_options(&mut self) -> &mut crate::RequestOptions {
868 &mut self.0.options
869 }
870 }
871
872 /// The request builder for [SecurityCenter::delete_notification_config][crate::client::SecurityCenter::delete_notification_config] calls.
873 ///
874 /// # Example
875 /// ```
876 /// # use google_cloud_securitycenter_v2::builder::security_center::DeleteNotificationConfig;
877 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
878 ///
879 /// let builder = prepare_request_builder();
880 /// let response = builder.send().await?;
881 /// # Ok(()) }
882 ///
883 /// fn prepare_request_builder() -> DeleteNotificationConfig {
884 /// # panic!();
885 /// // ... details omitted ...
886 /// }
887 /// ```
888 #[derive(Clone, Debug)]
889 pub struct DeleteNotificationConfig(
890 RequestBuilder<crate::model::DeleteNotificationConfigRequest>,
891 );
892
893 impl DeleteNotificationConfig {
894 pub(crate) fn new(
895 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
896 ) -> Self {
897 Self(RequestBuilder::new(stub))
898 }
899
900 /// Sets the full request, replacing any prior values.
901 pub fn with_request<V: Into<crate::model::DeleteNotificationConfigRequest>>(
902 mut self,
903 v: V,
904 ) -> Self {
905 self.0.request = v.into();
906 self
907 }
908
909 /// Sets all the options, replacing any prior values.
910 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
911 self.0.options = v.into();
912 self
913 }
914
915 /// Sends the request.
916 pub async fn send(self) -> Result<()> {
917 (*self.0.stub)
918 .delete_notification_config(self.0.request, self.0.options)
919 .await
920 .map(crate::Response::into_body)
921 }
922
923 /// Sets the value of [name][crate::model::DeleteNotificationConfigRequest::name].
924 ///
925 /// This is a **required** field for requests.
926 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
927 self.0.request.name = v.into();
928 self
929 }
930 }
931
932 #[doc(hidden)]
933 impl crate::RequestBuilder for DeleteNotificationConfig {
934 fn request_options(&mut self) -> &mut crate::RequestOptions {
935 &mut self.0.options
936 }
937 }
938
939 /// The request builder for [SecurityCenter::delete_resource_value_config][crate::client::SecurityCenter::delete_resource_value_config] calls.
940 ///
941 /// # Example
942 /// ```
943 /// # use google_cloud_securitycenter_v2::builder::security_center::DeleteResourceValueConfig;
944 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
945 ///
946 /// let builder = prepare_request_builder();
947 /// let response = builder.send().await?;
948 /// # Ok(()) }
949 ///
950 /// fn prepare_request_builder() -> DeleteResourceValueConfig {
951 /// # panic!();
952 /// // ... details omitted ...
953 /// }
954 /// ```
955 #[derive(Clone, Debug)]
956 pub struct DeleteResourceValueConfig(
957 RequestBuilder<crate::model::DeleteResourceValueConfigRequest>,
958 );
959
960 impl DeleteResourceValueConfig {
961 pub(crate) fn new(
962 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
963 ) -> Self {
964 Self(RequestBuilder::new(stub))
965 }
966
967 /// Sets the full request, replacing any prior values.
968 pub fn with_request<V: Into<crate::model::DeleteResourceValueConfigRequest>>(
969 mut self,
970 v: V,
971 ) -> Self {
972 self.0.request = v.into();
973 self
974 }
975
976 /// Sets all the options, replacing any prior values.
977 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
978 self.0.options = v.into();
979 self
980 }
981
982 /// Sends the request.
983 pub async fn send(self) -> Result<()> {
984 (*self.0.stub)
985 .delete_resource_value_config(self.0.request, self.0.options)
986 .await
987 .map(crate::Response::into_body)
988 }
989
990 /// Sets the value of [name][crate::model::DeleteResourceValueConfigRequest::name].
991 ///
992 /// This is a **required** field for requests.
993 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
994 self.0.request.name = v.into();
995 self
996 }
997 }
998
999 #[doc(hidden)]
1000 impl crate::RequestBuilder for DeleteResourceValueConfig {
1001 fn request_options(&mut self) -> &mut crate::RequestOptions {
1002 &mut self.0.options
1003 }
1004 }
1005
1006 /// The request builder for [SecurityCenter::get_big_query_export][crate::client::SecurityCenter::get_big_query_export] calls.
1007 ///
1008 /// # Example
1009 /// ```
1010 /// # use google_cloud_securitycenter_v2::builder::security_center::GetBigQueryExport;
1011 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
1012 ///
1013 /// let builder = prepare_request_builder();
1014 /// let response = builder.send().await?;
1015 /// # Ok(()) }
1016 ///
1017 /// fn prepare_request_builder() -> GetBigQueryExport {
1018 /// # panic!();
1019 /// // ... details omitted ...
1020 /// }
1021 /// ```
1022 #[derive(Clone, Debug)]
1023 pub struct GetBigQueryExport(RequestBuilder<crate::model::GetBigQueryExportRequest>);
1024
1025 impl GetBigQueryExport {
1026 pub(crate) fn new(
1027 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
1028 ) -> Self {
1029 Self(RequestBuilder::new(stub))
1030 }
1031
1032 /// Sets the full request, replacing any prior values.
1033 pub fn with_request<V: Into<crate::model::GetBigQueryExportRequest>>(
1034 mut self,
1035 v: V,
1036 ) -> Self {
1037 self.0.request = v.into();
1038 self
1039 }
1040
1041 /// Sets all the options, replacing any prior values.
1042 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1043 self.0.options = v.into();
1044 self
1045 }
1046
1047 /// Sends the request.
1048 pub async fn send(self) -> Result<crate::model::BigQueryExport> {
1049 (*self.0.stub)
1050 .get_big_query_export(self.0.request, self.0.options)
1051 .await
1052 .map(crate::Response::into_body)
1053 }
1054
1055 /// Sets the value of [name][crate::model::GetBigQueryExportRequest::name].
1056 ///
1057 /// This is a **required** field for requests.
1058 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1059 self.0.request.name = v.into();
1060 self
1061 }
1062 }
1063
1064 #[doc(hidden)]
1065 impl crate::RequestBuilder for GetBigQueryExport {
1066 fn request_options(&mut self) -> &mut crate::RequestOptions {
1067 &mut self.0.options
1068 }
1069 }
1070
1071 /// The request builder for [SecurityCenter::get_simulation][crate::client::SecurityCenter::get_simulation] calls.
1072 ///
1073 /// # Example
1074 /// ```
1075 /// # use google_cloud_securitycenter_v2::builder::security_center::GetSimulation;
1076 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
1077 ///
1078 /// let builder = prepare_request_builder();
1079 /// let response = builder.send().await?;
1080 /// # Ok(()) }
1081 ///
1082 /// fn prepare_request_builder() -> GetSimulation {
1083 /// # panic!();
1084 /// // ... details omitted ...
1085 /// }
1086 /// ```
1087 #[derive(Clone, Debug)]
1088 pub struct GetSimulation(RequestBuilder<crate::model::GetSimulationRequest>);
1089
1090 impl GetSimulation {
1091 pub(crate) fn new(
1092 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
1093 ) -> Self {
1094 Self(RequestBuilder::new(stub))
1095 }
1096
1097 /// Sets the full request, replacing any prior values.
1098 pub fn with_request<V: Into<crate::model::GetSimulationRequest>>(mut self, v: V) -> Self {
1099 self.0.request = v.into();
1100 self
1101 }
1102
1103 /// Sets all the options, replacing any prior values.
1104 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1105 self.0.options = v.into();
1106 self
1107 }
1108
1109 /// Sends the request.
1110 pub async fn send(self) -> Result<crate::model::Simulation> {
1111 (*self.0.stub)
1112 .get_simulation(self.0.request, self.0.options)
1113 .await
1114 .map(crate::Response::into_body)
1115 }
1116
1117 /// Sets the value of [name][crate::model::GetSimulationRequest::name].
1118 ///
1119 /// This is a **required** field for requests.
1120 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1121 self.0.request.name = v.into();
1122 self
1123 }
1124 }
1125
1126 #[doc(hidden)]
1127 impl crate::RequestBuilder for GetSimulation {
1128 fn request_options(&mut self) -> &mut crate::RequestOptions {
1129 &mut self.0.options
1130 }
1131 }
1132
1133 /// The request builder for [SecurityCenter::get_valued_resource][crate::client::SecurityCenter::get_valued_resource] calls.
1134 ///
1135 /// # Example
1136 /// ```
1137 /// # use google_cloud_securitycenter_v2::builder::security_center::GetValuedResource;
1138 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
1139 ///
1140 /// let builder = prepare_request_builder();
1141 /// let response = builder.send().await?;
1142 /// # Ok(()) }
1143 ///
1144 /// fn prepare_request_builder() -> GetValuedResource {
1145 /// # panic!();
1146 /// // ... details omitted ...
1147 /// }
1148 /// ```
1149 #[derive(Clone, Debug)]
1150 pub struct GetValuedResource(RequestBuilder<crate::model::GetValuedResourceRequest>);
1151
1152 impl GetValuedResource {
1153 pub(crate) fn new(
1154 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
1155 ) -> Self {
1156 Self(RequestBuilder::new(stub))
1157 }
1158
1159 /// Sets the full request, replacing any prior values.
1160 pub fn with_request<V: Into<crate::model::GetValuedResourceRequest>>(
1161 mut self,
1162 v: V,
1163 ) -> Self {
1164 self.0.request = v.into();
1165 self
1166 }
1167
1168 /// Sets all the options, replacing any prior values.
1169 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1170 self.0.options = v.into();
1171 self
1172 }
1173
1174 /// Sends the request.
1175 pub async fn send(self) -> Result<crate::model::ValuedResource> {
1176 (*self.0.stub)
1177 .get_valued_resource(self.0.request, self.0.options)
1178 .await
1179 .map(crate::Response::into_body)
1180 }
1181
1182 /// Sets the value of [name][crate::model::GetValuedResourceRequest::name].
1183 ///
1184 /// This is a **required** field for requests.
1185 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1186 self.0.request.name = v.into();
1187 self
1188 }
1189 }
1190
1191 #[doc(hidden)]
1192 impl crate::RequestBuilder for GetValuedResource {
1193 fn request_options(&mut self) -> &mut crate::RequestOptions {
1194 &mut self.0.options
1195 }
1196 }
1197
1198 /// The request builder for [SecurityCenter::get_iam_policy][crate::client::SecurityCenter::get_iam_policy] calls.
1199 ///
1200 /// # Example
1201 /// ```
1202 /// # use google_cloud_securitycenter_v2::builder::security_center::GetIamPolicy;
1203 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
1204 ///
1205 /// let builder = prepare_request_builder();
1206 /// let response = builder.send().await?;
1207 /// # Ok(()) }
1208 ///
1209 /// fn prepare_request_builder() -> GetIamPolicy {
1210 /// # panic!();
1211 /// // ... details omitted ...
1212 /// }
1213 /// ```
1214 #[derive(Clone, Debug)]
1215 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1216
1217 impl GetIamPolicy {
1218 pub(crate) fn new(
1219 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
1220 ) -> Self {
1221 Self(RequestBuilder::new(stub))
1222 }
1223
1224 /// Sets the full request, replacing any prior values.
1225 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1226 mut self,
1227 v: V,
1228 ) -> Self {
1229 self.0.request = v.into();
1230 self
1231 }
1232
1233 /// Sets all the options, replacing any prior values.
1234 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1235 self.0.options = v.into();
1236 self
1237 }
1238
1239 /// Sends the request.
1240 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1241 (*self.0.stub)
1242 .get_iam_policy(self.0.request, self.0.options)
1243 .await
1244 .map(crate::Response::into_body)
1245 }
1246
1247 /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
1248 ///
1249 /// This is a **required** field for requests.
1250 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1251 self.0.request.resource = v.into();
1252 self
1253 }
1254
1255 /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1256 pub fn set_options<T>(mut self, v: T) -> Self
1257 where
1258 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1259 {
1260 self.0.request.options = std::option::Option::Some(v.into());
1261 self
1262 }
1263
1264 /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1265 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1266 where
1267 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1268 {
1269 self.0.request.options = v.map(|x| x.into());
1270 self
1271 }
1272 }
1273
1274 #[doc(hidden)]
1275 impl crate::RequestBuilder for GetIamPolicy {
1276 fn request_options(&mut self) -> &mut crate::RequestOptions {
1277 &mut self.0.options
1278 }
1279 }
1280
1281 /// The request builder for [SecurityCenter::get_mute_config][crate::client::SecurityCenter::get_mute_config] calls.
1282 ///
1283 /// # Example
1284 /// ```
1285 /// # use google_cloud_securitycenter_v2::builder::security_center::GetMuteConfig;
1286 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
1287 ///
1288 /// let builder = prepare_request_builder();
1289 /// let response = builder.send().await?;
1290 /// # Ok(()) }
1291 ///
1292 /// fn prepare_request_builder() -> GetMuteConfig {
1293 /// # panic!();
1294 /// // ... details omitted ...
1295 /// }
1296 /// ```
1297 #[derive(Clone, Debug)]
1298 pub struct GetMuteConfig(RequestBuilder<crate::model::GetMuteConfigRequest>);
1299
1300 impl GetMuteConfig {
1301 pub(crate) fn new(
1302 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
1303 ) -> Self {
1304 Self(RequestBuilder::new(stub))
1305 }
1306
1307 /// Sets the full request, replacing any prior values.
1308 pub fn with_request<V: Into<crate::model::GetMuteConfigRequest>>(mut self, v: V) -> Self {
1309 self.0.request = v.into();
1310 self
1311 }
1312
1313 /// Sets all the options, replacing any prior values.
1314 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1315 self.0.options = v.into();
1316 self
1317 }
1318
1319 /// Sends the request.
1320 pub async fn send(self) -> Result<crate::model::MuteConfig> {
1321 (*self.0.stub)
1322 .get_mute_config(self.0.request, self.0.options)
1323 .await
1324 .map(crate::Response::into_body)
1325 }
1326
1327 /// Sets the value of [name][crate::model::GetMuteConfigRequest::name].
1328 ///
1329 /// This is a **required** field for requests.
1330 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1331 self.0.request.name = v.into();
1332 self
1333 }
1334 }
1335
1336 #[doc(hidden)]
1337 impl crate::RequestBuilder for GetMuteConfig {
1338 fn request_options(&mut self) -> &mut crate::RequestOptions {
1339 &mut self.0.options
1340 }
1341 }
1342
1343 /// The request builder for [SecurityCenter::get_notification_config][crate::client::SecurityCenter::get_notification_config] calls.
1344 ///
1345 /// # Example
1346 /// ```
1347 /// # use google_cloud_securitycenter_v2::builder::security_center::GetNotificationConfig;
1348 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
1349 ///
1350 /// let builder = prepare_request_builder();
1351 /// let response = builder.send().await?;
1352 /// # Ok(()) }
1353 ///
1354 /// fn prepare_request_builder() -> GetNotificationConfig {
1355 /// # panic!();
1356 /// // ... details omitted ...
1357 /// }
1358 /// ```
1359 #[derive(Clone, Debug)]
1360 pub struct GetNotificationConfig(RequestBuilder<crate::model::GetNotificationConfigRequest>);
1361
1362 impl GetNotificationConfig {
1363 pub(crate) fn new(
1364 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
1365 ) -> Self {
1366 Self(RequestBuilder::new(stub))
1367 }
1368
1369 /// Sets the full request, replacing any prior values.
1370 pub fn with_request<V: Into<crate::model::GetNotificationConfigRequest>>(
1371 mut self,
1372 v: V,
1373 ) -> Self {
1374 self.0.request = v.into();
1375 self
1376 }
1377
1378 /// Sets all the options, replacing any prior values.
1379 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1380 self.0.options = v.into();
1381 self
1382 }
1383
1384 /// Sends the request.
1385 pub async fn send(self) -> Result<crate::model::NotificationConfig> {
1386 (*self.0.stub)
1387 .get_notification_config(self.0.request, self.0.options)
1388 .await
1389 .map(crate::Response::into_body)
1390 }
1391
1392 /// Sets the value of [name][crate::model::GetNotificationConfigRequest::name].
1393 ///
1394 /// This is a **required** field for requests.
1395 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1396 self.0.request.name = v.into();
1397 self
1398 }
1399 }
1400
1401 #[doc(hidden)]
1402 impl crate::RequestBuilder for GetNotificationConfig {
1403 fn request_options(&mut self) -> &mut crate::RequestOptions {
1404 &mut self.0.options
1405 }
1406 }
1407
1408 /// The request builder for [SecurityCenter::get_resource_value_config][crate::client::SecurityCenter::get_resource_value_config] calls.
1409 ///
1410 /// # Example
1411 /// ```
1412 /// # use google_cloud_securitycenter_v2::builder::security_center::GetResourceValueConfig;
1413 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
1414 ///
1415 /// let builder = prepare_request_builder();
1416 /// let response = builder.send().await?;
1417 /// # Ok(()) }
1418 ///
1419 /// fn prepare_request_builder() -> GetResourceValueConfig {
1420 /// # panic!();
1421 /// // ... details omitted ...
1422 /// }
1423 /// ```
1424 #[derive(Clone, Debug)]
1425 pub struct GetResourceValueConfig(RequestBuilder<crate::model::GetResourceValueConfigRequest>);
1426
1427 impl GetResourceValueConfig {
1428 pub(crate) fn new(
1429 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
1430 ) -> Self {
1431 Self(RequestBuilder::new(stub))
1432 }
1433
1434 /// Sets the full request, replacing any prior values.
1435 pub fn with_request<V: Into<crate::model::GetResourceValueConfigRequest>>(
1436 mut self,
1437 v: V,
1438 ) -> Self {
1439 self.0.request = v.into();
1440 self
1441 }
1442
1443 /// Sets all the options, replacing any prior values.
1444 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1445 self.0.options = v.into();
1446 self
1447 }
1448
1449 /// Sends the request.
1450 pub async fn send(self) -> Result<crate::model::ResourceValueConfig> {
1451 (*self.0.stub)
1452 .get_resource_value_config(self.0.request, self.0.options)
1453 .await
1454 .map(crate::Response::into_body)
1455 }
1456
1457 /// Sets the value of [name][crate::model::GetResourceValueConfigRequest::name].
1458 ///
1459 /// This is a **required** field for requests.
1460 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1461 self.0.request.name = v.into();
1462 self
1463 }
1464 }
1465
1466 #[doc(hidden)]
1467 impl crate::RequestBuilder for GetResourceValueConfig {
1468 fn request_options(&mut self) -> &mut crate::RequestOptions {
1469 &mut self.0.options
1470 }
1471 }
1472
1473 /// The request builder for [SecurityCenter::get_source][crate::client::SecurityCenter::get_source] calls.
1474 ///
1475 /// # Example
1476 /// ```
1477 /// # use google_cloud_securitycenter_v2::builder::security_center::GetSource;
1478 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
1479 ///
1480 /// let builder = prepare_request_builder();
1481 /// let response = builder.send().await?;
1482 /// # Ok(()) }
1483 ///
1484 /// fn prepare_request_builder() -> GetSource {
1485 /// # panic!();
1486 /// // ... details omitted ...
1487 /// }
1488 /// ```
1489 #[derive(Clone, Debug)]
1490 pub struct GetSource(RequestBuilder<crate::model::GetSourceRequest>);
1491
1492 impl GetSource {
1493 pub(crate) fn new(
1494 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
1495 ) -> Self {
1496 Self(RequestBuilder::new(stub))
1497 }
1498
1499 /// Sets the full request, replacing any prior values.
1500 pub fn with_request<V: Into<crate::model::GetSourceRequest>>(mut self, v: V) -> Self {
1501 self.0.request = v.into();
1502 self
1503 }
1504
1505 /// Sets all the options, replacing any prior values.
1506 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1507 self.0.options = v.into();
1508 self
1509 }
1510
1511 /// Sends the request.
1512 pub async fn send(self) -> Result<crate::model::Source> {
1513 (*self.0.stub)
1514 .get_source(self.0.request, self.0.options)
1515 .await
1516 .map(crate::Response::into_body)
1517 }
1518
1519 /// Sets the value of [name][crate::model::GetSourceRequest::name].
1520 ///
1521 /// This is a **required** field for requests.
1522 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1523 self.0.request.name = v.into();
1524 self
1525 }
1526 }
1527
1528 #[doc(hidden)]
1529 impl crate::RequestBuilder for GetSource {
1530 fn request_options(&mut self) -> &mut crate::RequestOptions {
1531 &mut self.0.options
1532 }
1533 }
1534
1535 /// The request builder for [SecurityCenter::group_findings][crate::client::SecurityCenter::group_findings] calls.
1536 ///
1537 /// # Example
1538 /// ```
1539 /// # use google_cloud_securitycenter_v2::builder::security_center::GroupFindings;
1540 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
1541 /// use google_cloud_gax::paginator::ItemPaginator;
1542 ///
1543 /// let builder = prepare_request_builder();
1544 /// let mut items = builder.by_item();
1545 /// while let Some(result) = items.next().await {
1546 /// let item = result?;
1547 /// }
1548 /// # Ok(()) }
1549 ///
1550 /// fn prepare_request_builder() -> GroupFindings {
1551 /// # panic!();
1552 /// // ... details omitted ...
1553 /// }
1554 /// ```
1555 #[derive(Clone, Debug)]
1556 pub struct GroupFindings(RequestBuilder<crate::model::GroupFindingsRequest>);
1557
1558 impl GroupFindings {
1559 pub(crate) fn new(
1560 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
1561 ) -> Self {
1562 Self(RequestBuilder::new(stub))
1563 }
1564
1565 /// Sets the full request, replacing any prior values.
1566 pub fn with_request<V: Into<crate::model::GroupFindingsRequest>>(mut self, v: V) -> Self {
1567 self.0.request = v.into();
1568 self
1569 }
1570
1571 /// Sets all the options, replacing any prior values.
1572 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1573 self.0.options = v.into();
1574 self
1575 }
1576
1577 /// Sends the request.
1578 pub async fn send(self) -> Result<crate::model::GroupFindingsResponse> {
1579 (*self.0.stub)
1580 .group_findings(self.0.request, self.0.options)
1581 .await
1582 .map(crate::Response::into_body)
1583 }
1584
1585 /// Streams each page in the collection.
1586 pub fn by_page(
1587 self,
1588 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::GroupFindingsResponse, crate::Error>
1589 {
1590 use std::clone::Clone;
1591 let token = self.0.request.page_token.clone();
1592 let execute = move |token: String| {
1593 let mut builder = self.clone();
1594 builder.0.request = builder.0.request.set_page_token(token);
1595 builder.send()
1596 };
1597 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1598 }
1599
1600 /// Streams each item in the collection.
1601 pub fn by_item(
1602 self,
1603 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1604 crate::model::GroupFindingsResponse,
1605 crate::Error,
1606 > {
1607 use google_cloud_gax::paginator::Paginator;
1608 self.by_page().items()
1609 }
1610
1611 /// Sets the value of [parent][crate::model::GroupFindingsRequest::parent].
1612 ///
1613 /// This is a **required** field for requests.
1614 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1615 self.0.request.parent = v.into();
1616 self
1617 }
1618
1619 /// Sets the value of [filter][crate::model::GroupFindingsRequest::filter].
1620 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1621 self.0.request.filter = v.into();
1622 self
1623 }
1624
1625 /// Sets the value of [group_by][crate::model::GroupFindingsRequest::group_by].
1626 ///
1627 /// This is a **required** field for requests.
1628 pub fn set_group_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1629 self.0.request.group_by = v.into();
1630 self
1631 }
1632
1633 /// Sets the value of [page_token][crate::model::GroupFindingsRequest::page_token].
1634 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1635 self.0.request.page_token = v.into();
1636 self
1637 }
1638
1639 /// Sets the value of [page_size][crate::model::GroupFindingsRequest::page_size].
1640 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1641 self.0.request.page_size = v.into();
1642 self
1643 }
1644 }
1645
1646 #[doc(hidden)]
1647 impl crate::RequestBuilder for GroupFindings {
1648 fn request_options(&mut self) -> &mut crate::RequestOptions {
1649 &mut self.0.options
1650 }
1651 }
1652
1653 /// The request builder for [SecurityCenter::list_attack_paths][crate::client::SecurityCenter::list_attack_paths] calls.
1654 ///
1655 /// # Example
1656 /// ```
1657 /// # use google_cloud_securitycenter_v2::builder::security_center::ListAttackPaths;
1658 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
1659 /// use google_cloud_gax::paginator::ItemPaginator;
1660 ///
1661 /// let builder = prepare_request_builder();
1662 /// let mut items = builder.by_item();
1663 /// while let Some(result) = items.next().await {
1664 /// let item = result?;
1665 /// }
1666 /// # Ok(()) }
1667 ///
1668 /// fn prepare_request_builder() -> ListAttackPaths {
1669 /// # panic!();
1670 /// // ... details omitted ...
1671 /// }
1672 /// ```
1673 #[derive(Clone, Debug)]
1674 pub struct ListAttackPaths(RequestBuilder<crate::model::ListAttackPathsRequest>);
1675
1676 impl ListAttackPaths {
1677 pub(crate) fn new(
1678 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
1679 ) -> Self {
1680 Self(RequestBuilder::new(stub))
1681 }
1682
1683 /// Sets the full request, replacing any prior values.
1684 pub fn with_request<V: Into<crate::model::ListAttackPathsRequest>>(mut self, v: V) -> Self {
1685 self.0.request = v.into();
1686 self
1687 }
1688
1689 /// Sets all the options, replacing any prior values.
1690 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1691 self.0.options = v.into();
1692 self
1693 }
1694
1695 /// Sends the request.
1696 pub async fn send(self) -> Result<crate::model::ListAttackPathsResponse> {
1697 (*self.0.stub)
1698 .list_attack_paths(self.0.request, self.0.options)
1699 .await
1700 .map(crate::Response::into_body)
1701 }
1702
1703 /// Streams each page in the collection.
1704 pub fn by_page(
1705 self,
1706 ) -> impl google_cloud_gax::paginator::Paginator<
1707 crate::model::ListAttackPathsResponse,
1708 crate::Error,
1709 > {
1710 use std::clone::Clone;
1711 let token = self.0.request.page_token.clone();
1712 let execute = move |token: String| {
1713 let mut builder = self.clone();
1714 builder.0.request = builder.0.request.set_page_token(token);
1715 builder.send()
1716 };
1717 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1718 }
1719
1720 /// Streams each item in the collection.
1721 pub fn by_item(
1722 self,
1723 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1724 crate::model::ListAttackPathsResponse,
1725 crate::Error,
1726 > {
1727 use google_cloud_gax::paginator::Paginator;
1728 self.by_page().items()
1729 }
1730
1731 /// Sets the value of [parent][crate::model::ListAttackPathsRequest::parent].
1732 ///
1733 /// This is a **required** field for requests.
1734 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1735 self.0.request.parent = v.into();
1736 self
1737 }
1738
1739 /// Sets the value of [filter][crate::model::ListAttackPathsRequest::filter].
1740 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1741 self.0.request.filter = v.into();
1742 self
1743 }
1744
1745 /// Sets the value of [page_token][crate::model::ListAttackPathsRequest::page_token].
1746 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1747 self.0.request.page_token = v.into();
1748 self
1749 }
1750
1751 /// Sets the value of [page_size][crate::model::ListAttackPathsRequest::page_size].
1752 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1753 self.0.request.page_size = v.into();
1754 self
1755 }
1756 }
1757
1758 #[doc(hidden)]
1759 impl crate::RequestBuilder for ListAttackPaths {
1760 fn request_options(&mut self) -> &mut crate::RequestOptions {
1761 &mut self.0.options
1762 }
1763 }
1764
1765 /// The request builder for [SecurityCenter::list_big_query_exports][crate::client::SecurityCenter::list_big_query_exports] calls.
1766 ///
1767 /// # Example
1768 /// ```
1769 /// # use google_cloud_securitycenter_v2::builder::security_center::ListBigQueryExports;
1770 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
1771 /// use google_cloud_gax::paginator::ItemPaginator;
1772 ///
1773 /// let builder = prepare_request_builder();
1774 /// let mut items = builder.by_item();
1775 /// while let Some(result) = items.next().await {
1776 /// let item = result?;
1777 /// }
1778 /// # Ok(()) }
1779 ///
1780 /// fn prepare_request_builder() -> ListBigQueryExports {
1781 /// # panic!();
1782 /// // ... details omitted ...
1783 /// }
1784 /// ```
1785 #[derive(Clone, Debug)]
1786 pub struct ListBigQueryExports(RequestBuilder<crate::model::ListBigQueryExportsRequest>);
1787
1788 impl ListBigQueryExports {
1789 pub(crate) fn new(
1790 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
1791 ) -> Self {
1792 Self(RequestBuilder::new(stub))
1793 }
1794
1795 /// Sets the full request, replacing any prior values.
1796 pub fn with_request<V: Into<crate::model::ListBigQueryExportsRequest>>(
1797 mut self,
1798 v: V,
1799 ) -> Self {
1800 self.0.request = v.into();
1801 self
1802 }
1803
1804 /// Sets all the options, replacing any prior values.
1805 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1806 self.0.options = v.into();
1807 self
1808 }
1809
1810 /// Sends the request.
1811 pub async fn send(self) -> Result<crate::model::ListBigQueryExportsResponse> {
1812 (*self.0.stub)
1813 .list_big_query_exports(self.0.request, self.0.options)
1814 .await
1815 .map(crate::Response::into_body)
1816 }
1817
1818 /// Streams each page in the collection.
1819 pub fn by_page(
1820 self,
1821 ) -> impl google_cloud_gax::paginator::Paginator<
1822 crate::model::ListBigQueryExportsResponse,
1823 crate::Error,
1824 > {
1825 use std::clone::Clone;
1826 let token = self.0.request.page_token.clone();
1827 let execute = move |token: String| {
1828 let mut builder = self.clone();
1829 builder.0.request = builder.0.request.set_page_token(token);
1830 builder.send()
1831 };
1832 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1833 }
1834
1835 /// Streams each item in the collection.
1836 pub fn by_item(
1837 self,
1838 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1839 crate::model::ListBigQueryExportsResponse,
1840 crate::Error,
1841 > {
1842 use google_cloud_gax::paginator::Paginator;
1843 self.by_page().items()
1844 }
1845
1846 /// Sets the value of [parent][crate::model::ListBigQueryExportsRequest::parent].
1847 ///
1848 /// This is a **required** field for requests.
1849 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1850 self.0.request.parent = v.into();
1851 self
1852 }
1853
1854 /// Sets the value of [page_size][crate::model::ListBigQueryExportsRequest::page_size].
1855 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1856 self.0.request.page_size = v.into();
1857 self
1858 }
1859
1860 /// Sets the value of [page_token][crate::model::ListBigQueryExportsRequest::page_token].
1861 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1862 self.0.request.page_token = v.into();
1863 self
1864 }
1865 }
1866
1867 #[doc(hidden)]
1868 impl crate::RequestBuilder for ListBigQueryExports {
1869 fn request_options(&mut self) -> &mut crate::RequestOptions {
1870 &mut self.0.options
1871 }
1872 }
1873
1874 /// The request builder for [SecurityCenter::list_findings][crate::client::SecurityCenter::list_findings] calls.
1875 ///
1876 /// # Example
1877 /// ```
1878 /// # use google_cloud_securitycenter_v2::builder::security_center::ListFindings;
1879 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
1880 /// use google_cloud_gax::paginator::ItemPaginator;
1881 ///
1882 /// let builder = prepare_request_builder();
1883 /// let mut items = builder.by_item();
1884 /// while let Some(result) = items.next().await {
1885 /// let item = result?;
1886 /// }
1887 /// # Ok(()) }
1888 ///
1889 /// fn prepare_request_builder() -> ListFindings {
1890 /// # panic!();
1891 /// // ... details omitted ...
1892 /// }
1893 /// ```
1894 #[derive(Clone, Debug)]
1895 pub struct ListFindings(RequestBuilder<crate::model::ListFindingsRequest>);
1896
1897 impl ListFindings {
1898 pub(crate) fn new(
1899 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
1900 ) -> Self {
1901 Self(RequestBuilder::new(stub))
1902 }
1903
1904 /// Sets the full request, replacing any prior values.
1905 pub fn with_request<V: Into<crate::model::ListFindingsRequest>>(mut self, v: V) -> Self {
1906 self.0.request = v.into();
1907 self
1908 }
1909
1910 /// Sets all the options, replacing any prior values.
1911 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1912 self.0.options = v.into();
1913 self
1914 }
1915
1916 /// Sends the request.
1917 pub async fn send(self) -> Result<crate::model::ListFindingsResponse> {
1918 (*self.0.stub)
1919 .list_findings(self.0.request, self.0.options)
1920 .await
1921 .map(crate::Response::into_body)
1922 }
1923
1924 /// Streams each page in the collection.
1925 pub fn by_page(
1926 self,
1927 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListFindingsResponse, crate::Error>
1928 {
1929 use std::clone::Clone;
1930 let token = self.0.request.page_token.clone();
1931 let execute = move |token: String| {
1932 let mut builder = self.clone();
1933 builder.0.request = builder.0.request.set_page_token(token);
1934 builder.send()
1935 };
1936 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1937 }
1938
1939 /// Streams each item in the collection.
1940 pub fn by_item(
1941 self,
1942 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1943 crate::model::ListFindingsResponse,
1944 crate::Error,
1945 > {
1946 use google_cloud_gax::paginator::Paginator;
1947 self.by_page().items()
1948 }
1949
1950 /// Sets the value of [parent][crate::model::ListFindingsRequest::parent].
1951 ///
1952 /// This is a **required** field for requests.
1953 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1954 self.0.request.parent = v.into();
1955 self
1956 }
1957
1958 /// Sets the value of [filter][crate::model::ListFindingsRequest::filter].
1959 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1960 self.0.request.filter = v.into();
1961 self
1962 }
1963
1964 /// Sets the value of [order_by][crate::model::ListFindingsRequest::order_by].
1965 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1966 self.0.request.order_by = v.into();
1967 self
1968 }
1969
1970 /// Sets the value of [field_mask][crate::model::ListFindingsRequest::field_mask].
1971 pub fn set_field_mask<T>(mut self, v: T) -> Self
1972 where
1973 T: std::convert::Into<wkt::FieldMask>,
1974 {
1975 self.0.request.field_mask = std::option::Option::Some(v.into());
1976 self
1977 }
1978
1979 /// Sets or clears the value of [field_mask][crate::model::ListFindingsRequest::field_mask].
1980 pub fn set_or_clear_field_mask<T>(mut self, v: std::option::Option<T>) -> Self
1981 where
1982 T: std::convert::Into<wkt::FieldMask>,
1983 {
1984 self.0.request.field_mask = v.map(|x| x.into());
1985 self
1986 }
1987
1988 /// Sets the value of [page_token][crate::model::ListFindingsRequest::page_token].
1989 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1990 self.0.request.page_token = v.into();
1991 self
1992 }
1993
1994 /// Sets the value of [page_size][crate::model::ListFindingsRequest::page_size].
1995 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1996 self.0.request.page_size = v.into();
1997 self
1998 }
1999 }
2000
2001 #[doc(hidden)]
2002 impl crate::RequestBuilder for ListFindings {
2003 fn request_options(&mut self) -> &mut crate::RequestOptions {
2004 &mut self.0.options
2005 }
2006 }
2007
2008 /// The request builder for [SecurityCenter::list_mute_configs][crate::client::SecurityCenter::list_mute_configs] calls.
2009 ///
2010 /// # Example
2011 /// ```
2012 /// # use google_cloud_securitycenter_v2::builder::security_center::ListMuteConfigs;
2013 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
2014 /// use google_cloud_gax::paginator::ItemPaginator;
2015 ///
2016 /// let builder = prepare_request_builder();
2017 /// let mut items = builder.by_item();
2018 /// while let Some(result) = items.next().await {
2019 /// let item = result?;
2020 /// }
2021 /// # Ok(()) }
2022 ///
2023 /// fn prepare_request_builder() -> ListMuteConfigs {
2024 /// # panic!();
2025 /// // ... details omitted ...
2026 /// }
2027 /// ```
2028 #[derive(Clone, Debug)]
2029 pub struct ListMuteConfigs(RequestBuilder<crate::model::ListMuteConfigsRequest>);
2030
2031 impl ListMuteConfigs {
2032 pub(crate) fn new(
2033 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
2034 ) -> Self {
2035 Self(RequestBuilder::new(stub))
2036 }
2037
2038 /// Sets the full request, replacing any prior values.
2039 pub fn with_request<V: Into<crate::model::ListMuteConfigsRequest>>(mut self, v: V) -> Self {
2040 self.0.request = v.into();
2041 self
2042 }
2043
2044 /// Sets all the options, replacing any prior values.
2045 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2046 self.0.options = v.into();
2047 self
2048 }
2049
2050 /// Sends the request.
2051 pub async fn send(self) -> Result<crate::model::ListMuteConfigsResponse> {
2052 (*self.0.stub)
2053 .list_mute_configs(self.0.request, self.0.options)
2054 .await
2055 .map(crate::Response::into_body)
2056 }
2057
2058 /// Streams each page in the collection.
2059 pub fn by_page(
2060 self,
2061 ) -> impl google_cloud_gax::paginator::Paginator<
2062 crate::model::ListMuteConfigsResponse,
2063 crate::Error,
2064 > {
2065 use std::clone::Clone;
2066 let token = self.0.request.page_token.clone();
2067 let execute = move |token: String| {
2068 let mut builder = self.clone();
2069 builder.0.request = builder.0.request.set_page_token(token);
2070 builder.send()
2071 };
2072 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2073 }
2074
2075 /// Streams each item in the collection.
2076 pub fn by_item(
2077 self,
2078 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2079 crate::model::ListMuteConfigsResponse,
2080 crate::Error,
2081 > {
2082 use google_cloud_gax::paginator::Paginator;
2083 self.by_page().items()
2084 }
2085
2086 /// Sets the value of [parent][crate::model::ListMuteConfigsRequest::parent].
2087 ///
2088 /// This is a **required** field for requests.
2089 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2090 self.0.request.parent = v.into();
2091 self
2092 }
2093
2094 /// Sets the value of [page_size][crate::model::ListMuteConfigsRequest::page_size].
2095 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2096 self.0.request.page_size = v.into();
2097 self
2098 }
2099
2100 /// Sets the value of [page_token][crate::model::ListMuteConfigsRequest::page_token].
2101 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2102 self.0.request.page_token = v.into();
2103 self
2104 }
2105 }
2106
2107 #[doc(hidden)]
2108 impl crate::RequestBuilder for ListMuteConfigs {
2109 fn request_options(&mut self) -> &mut crate::RequestOptions {
2110 &mut self.0.options
2111 }
2112 }
2113
2114 /// The request builder for [SecurityCenter::list_notification_configs][crate::client::SecurityCenter::list_notification_configs] calls.
2115 ///
2116 /// # Example
2117 /// ```
2118 /// # use google_cloud_securitycenter_v2::builder::security_center::ListNotificationConfigs;
2119 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
2120 /// use google_cloud_gax::paginator::ItemPaginator;
2121 ///
2122 /// let builder = prepare_request_builder();
2123 /// let mut items = builder.by_item();
2124 /// while let Some(result) = items.next().await {
2125 /// let item = result?;
2126 /// }
2127 /// # Ok(()) }
2128 ///
2129 /// fn prepare_request_builder() -> ListNotificationConfigs {
2130 /// # panic!();
2131 /// // ... details omitted ...
2132 /// }
2133 /// ```
2134 #[derive(Clone, Debug)]
2135 pub struct ListNotificationConfigs(
2136 RequestBuilder<crate::model::ListNotificationConfigsRequest>,
2137 );
2138
2139 impl ListNotificationConfigs {
2140 pub(crate) fn new(
2141 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
2142 ) -> Self {
2143 Self(RequestBuilder::new(stub))
2144 }
2145
2146 /// Sets the full request, replacing any prior values.
2147 pub fn with_request<V: Into<crate::model::ListNotificationConfigsRequest>>(
2148 mut self,
2149 v: V,
2150 ) -> Self {
2151 self.0.request = v.into();
2152 self
2153 }
2154
2155 /// Sets all the options, replacing any prior values.
2156 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2157 self.0.options = v.into();
2158 self
2159 }
2160
2161 /// Sends the request.
2162 pub async fn send(self) -> Result<crate::model::ListNotificationConfigsResponse> {
2163 (*self.0.stub)
2164 .list_notification_configs(self.0.request, self.0.options)
2165 .await
2166 .map(crate::Response::into_body)
2167 }
2168
2169 /// Streams each page in the collection.
2170 pub fn by_page(
2171 self,
2172 ) -> impl google_cloud_gax::paginator::Paginator<
2173 crate::model::ListNotificationConfigsResponse,
2174 crate::Error,
2175 > {
2176 use std::clone::Clone;
2177 let token = self.0.request.page_token.clone();
2178 let execute = move |token: String| {
2179 let mut builder = self.clone();
2180 builder.0.request = builder.0.request.set_page_token(token);
2181 builder.send()
2182 };
2183 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2184 }
2185
2186 /// Streams each item in the collection.
2187 pub fn by_item(
2188 self,
2189 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2190 crate::model::ListNotificationConfigsResponse,
2191 crate::Error,
2192 > {
2193 use google_cloud_gax::paginator::Paginator;
2194 self.by_page().items()
2195 }
2196
2197 /// Sets the value of [parent][crate::model::ListNotificationConfigsRequest::parent].
2198 ///
2199 /// This is a **required** field for requests.
2200 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2201 self.0.request.parent = v.into();
2202 self
2203 }
2204
2205 /// Sets the value of [page_token][crate::model::ListNotificationConfigsRequest::page_token].
2206 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2207 self.0.request.page_token = v.into();
2208 self
2209 }
2210
2211 /// Sets the value of [page_size][crate::model::ListNotificationConfigsRequest::page_size].
2212 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2213 self.0.request.page_size = v.into();
2214 self
2215 }
2216 }
2217
2218 #[doc(hidden)]
2219 impl crate::RequestBuilder for ListNotificationConfigs {
2220 fn request_options(&mut self) -> &mut crate::RequestOptions {
2221 &mut self.0.options
2222 }
2223 }
2224
2225 /// The request builder for [SecurityCenter::list_resource_value_configs][crate::client::SecurityCenter::list_resource_value_configs] calls.
2226 ///
2227 /// # Example
2228 /// ```
2229 /// # use google_cloud_securitycenter_v2::builder::security_center::ListResourceValueConfigs;
2230 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
2231 /// use google_cloud_gax::paginator::ItemPaginator;
2232 ///
2233 /// let builder = prepare_request_builder();
2234 /// let mut items = builder.by_item();
2235 /// while let Some(result) = items.next().await {
2236 /// let item = result?;
2237 /// }
2238 /// # Ok(()) }
2239 ///
2240 /// fn prepare_request_builder() -> ListResourceValueConfigs {
2241 /// # panic!();
2242 /// // ... details omitted ...
2243 /// }
2244 /// ```
2245 #[derive(Clone, Debug)]
2246 pub struct ListResourceValueConfigs(
2247 RequestBuilder<crate::model::ListResourceValueConfigsRequest>,
2248 );
2249
2250 impl ListResourceValueConfigs {
2251 pub(crate) fn new(
2252 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
2253 ) -> Self {
2254 Self(RequestBuilder::new(stub))
2255 }
2256
2257 /// Sets the full request, replacing any prior values.
2258 pub fn with_request<V: Into<crate::model::ListResourceValueConfigsRequest>>(
2259 mut self,
2260 v: V,
2261 ) -> Self {
2262 self.0.request = v.into();
2263 self
2264 }
2265
2266 /// Sets all the options, replacing any prior values.
2267 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2268 self.0.options = v.into();
2269 self
2270 }
2271
2272 /// Sends the request.
2273 pub async fn send(self) -> Result<crate::model::ListResourceValueConfigsResponse> {
2274 (*self.0.stub)
2275 .list_resource_value_configs(self.0.request, self.0.options)
2276 .await
2277 .map(crate::Response::into_body)
2278 }
2279
2280 /// Streams each page in the collection.
2281 pub fn by_page(
2282 self,
2283 ) -> impl google_cloud_gax::paginator::Paginator<
2284 crate::model::ListResourceValueConfigsResponse,
2285 crate::Error,
2286 > {
2287 use std::clone::Clone;
2288 let token = self.0.request.page_token.clone();
2289 let execute = move |token: String| {
2290 let mut builder = self.clone();
2291 builder.0.request = builder.0.request.set_page_token(token);
2292 builder.send()
2293 };
2294 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2295 }
2296
2297 /// Streams each item in the collection.
2298 pub fn by_item(
2299 self,
2300 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2301 crate::model::ListResourceValueConfigsResponse,
2302 crate::Error,
2303 > {
2304 use google_cloud_gax::paginator::Paginator;
2305 self.by_page().items()
2306 }
2307
2308 /// Sets the value of [parent][crate::model::ListResourceValueConfigsRequest::parent].
2309 ///
2310 /// This is a **required** field for requests.
2311 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2312 self.0.request.parent = v.into();
2313 self
2314 }
2315
2316 /// Sets the value of [page_size][crate::model::ListResourceValueConfigsRequest::page_size].
2317 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2318 self.0.request.page_size = v.into();
2319 self
2320 }
2321
2322 /// Sets the value of [page_token][crate::model::ListResourceValueConfigsRequest::page_token].
2323 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2324 self.0.request.page_token = v.into();
2325 self
2326 }
2327 }
2328
2329 #[doc(hidden)]
2330 impl crate::RequestBuilder for ListResourceValueConfigs {
2331 fn request_options(&mut self) -> &mut crate::RequestOptions {
2332 &mut self.0.options
2333 }
2334 }
2335
2336 /// The request builder for [SecurityCenter::list_sources][crate::client::SecurityCenter::list_sources] calls.
2337 ///
2338 /// # Example
2339 /// ```
2340 /// # use google_cloud_securitycenter_v2::builder::security_center::ListSources;
2341 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
2342 /// use google_cloud_gax::paginator::ItemPaginator;
2343 ///
2344 /// let builder = prepare_request_builder();
2345 /// let mut items = builder.by_item();
2346 /// while let Some(result) = items.next().await {
2347 /// let item = result?;
2348 /// }
2349 /// # Ok(()) }
2350 ///
2351 /// fn prepare_request_builder() -> ListSources {
2352 /// # panic!();
2353 /// // ... details omitted ...
2354 /// }
2355 /// ```
2356 #[derive(Clone, Debug)]
2357 pub struct ListSources(RequestBuilder<crate::model::ListSourcesRequest>);
2358
2359 impl ListSources {
2360 pub(crate) fn new(
2361 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
2362 ) -> Self {
2363 Self(RequestBuilder::new(stub))
2364 }
2365
2366 /// Sets the full request, replacing any prior values.
2367 pub fn with_request<V: Into<crate::model::ListSourcesRequest>>(mut self, v: V) -> Self {
2368 self.0.request = v.into();
2369 self
2370 }
2371
2372 /// Sets all the options, replacing any prior values.
2373 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2374 self.0.options = v.into();
2375 self
2376 }
2377
2378 /// Sends the request.
2379 pub async fn send(self) -> Result<crate::model::ListSourcesResponse> {
2380 (*self.0.stub)
2381 .list_sources(self.0.request, self.0.options)
2382 .await
2383 .map(crate::Response::into_body)
2384 }
2385
2386 /// Streams each page in the collection.
2387 pub fn by_page(
2388 self,
2389 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSourcesResponse, crate::Error>
2390 {
2391 use std::clone::Clone;
2392 let token = self.0.request.page_token.clone();
2393 let execute = move |token: String| {
2394 let mut builder = self.clone();
2395 builder.0.request = builder.0.request.set_page_token(token);
2396 builder.send()
2397 };
2398 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2399 }
2400
2401 /// Streams each item in the collection.
2402 pub fn by_item(
2403 self,
2404 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2405 crate::model::ListSourcesResponse,
2406 crate::Error,
2407 > {
2408 use google_cloud_gax::paginator::Paginator;
2409 self.by_page().items()
2410 }
2411
2412 /// Sets the value of [parent][crate::model::ListSourcesRequest::parent].
2413 ///
2414 /// This is a **required** field for requests.
2415 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2416 self.0.request.parent = v.into();
2417 self
2418 }
2419
2420 /// Sets the value of [page_token][crate::model::ListSourcesRequest::page_token].
2421 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2422 self.0.request.page_token = v.into();
2423 self
2424 }
2425
2426 /// Sets the value of [page_size][crate::model::ListSourcesRequest::page_size].
2427 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2428 self.0.request.page_size = v.into();
2429 self
2430 }
2431 }
2432
2433 #[doc(hidden)]
2434 impl crate::RequestBuilder for ListSources {
2435 fn request_options(&mut self) -> &mut crate::RequestOptions {
2436 &mut self.0.options
2437 }
2438 }
2439
2440 /// The request builder for [SecurityCenter::list_valued_resources][crate::client::SecurityCenter::list_valued_resources] calls.
2441 ///
2442 /// # Example
2443 /// ```
2444 /// # use google_cloud_securitycenter_v2::builder::security_center::ListValuedResources;
2445 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
2446 /// use google_cloud_gax::paginator::ItemPaginator;
2447 ///
2448 /// let builder = prepare_request_builder();
2449 /// let mut items = builder.by_item();
2450 /// while let Some(result) = items.next().await {
2451 /// let item = result?;
2452 /// }
2453 /// # Ok(()) }
2454 ///
2455 /// fn prepare_request_builder() -> ListValuedResources {
2456 /// # panic!();
2457 /// // ... details omitted ...
2458 /// }
2459 /// ```
2460 #[derive(Clone, Debug)]
2461 pub struct ListValuedResources(RequestBuilder<crate::model::ListValuedResourcesRequest>);
2462
2463 impl ListValuedResources {
2464 pub(crate) fn new(
2465 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
2466 ) -> Self {
2467 Self(RequestBuilder::new(stub))
2468 }
2469
2470 /// Sets the full request, replacing any prior values.
2471 pub fn with_request<V: Into<crate::model::ListValuedResourcesRequest>>(
2472 mut self,
2473 v: V,
2474 ) -> Self {
2475 self.0.request = v.into();
2476 self
2477 }
2478
2479 /// Sets all the options, replacing any prior values.
2480 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2481 self.0.options = v.into();
2482 self
2483 }
2484
2485 /// Sends the request.
2486 pub async fn send(self) -> Result<crate::model::ListValuedResourcesResponse> {
2487 (*self.0.stub)
2488 .list_valued_resources(self.0.request, self.0.options)
2489 .await
2490 .map(crate::Response::into_body)
2491 }
2492
2493 /// Streams each page in the collection.
2494 pub fn by_page(
2495 self,
2496 ) -> impl google_cloud_gax::paginator::Paginator<
2497 crate::model::ListValuedResourcesResponse,
2498 crate::Error,
2499 > {
2500 use std::clone::Clone;
2501 let token = self.0.request.page_token.clone();
2502 let execute = move |token: String| {
2503 let mut builder = self.clone();
2504 builder.0.request = builder.0.request.set_page_token(token);
2505 builder.send()
2506 };
2507 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2508 }
2509
2510 /// Streams each item in the collection.
2511 pub fn by_item(
2512 self,
2513 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2514 crate::model::ListValuedResourcesResponse,
2515 crate::Error,
2516 > {
2517 use google_cloud_gax::paginator::Paginator;
2518 self.by_page().items()
2519 }
2520
2521 /// Sets the value of [parent][crate::model::ListValuedResourcesRequest::parent].
2522 ///
2523 /// This is a **required** field for requests.
2524 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2525 self.0.request.parent = v.into();
2526 self
2527 }
2528
2529 /// Sets the value of [filter][crate::model::ListValuedResourcesRequest::filter].
2530 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2531 self.0.request.filter = v.into();
2532 self
2533 }
2534
2535 /// Sets the value of [page_token][crate::model::ListValuedResourcesRequest::page_token].
2536 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2537 self.0.request.page_token = v.into();
2538 self
2539 }
2540
2541 /// Sets the value of [page_size][crate::model::ListValuedResourcesRequest::page_size].
2542 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2543 self.0.request.page_size = v.into();
2544 self
2545 }
2546
2547 /// Sets the value of [order_by][crate::model::ListValuedResourcesRequest::order_by].
2548 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2549 self.0.request.order_by = v.into();
2550 self
2551 }
2552 }
2553
2554 #[doc(hidden)]
2555 impl crate::RequestBuilder for ListValuedResources {
2556 fn request_options(&mut self) -> &mut crate::RequestOptions {
2557 &mut self.0.options
2558 }
2559 }
2560
2561 /// The request builder for [SecurityCenter::set_finding_state][crate::client::SecurityCenter::set_finding_state] calls.
2562 ///
2563 /// # Example
2564 /// ```
2565 /// # use google_cloud_securitycenter_v2::builder::security_center::SetFindingState;
2566 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
2567 ///
2568 /// let builder = prepare_request_builder();
2569 /// let response = builder.send().await?;
2570 /// # Ok(()) }
2571 ///
2572 /// fn prepare_request_builder() -> SetFindingState {
2573 /// # panic!();
2574 /// // ... details omitted ...
2575 /// }
2576 /// ```
2577 #[derive(Clone, Debug)]
2578 pub struct SetFindingState(RequestBuilder<crate::model::SetFindingStateRequest>);
2579
2580 impl SetFindingState {
2581 pub(crate) fn new(
2582 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
2583 ) -> Self {
2584 Self(RequestBuilder::new(stub))
2585 }
2586
2587 /// Sets the full request, replacing any prior values.
2588 pub fn with_request<V: Into<crate::model::SetFindingStateRequest>>(mut self, v: V) -> Self {
2589 self.0.request = v.into();
2590 self
2591 }
2592
2593 /// Sets all the options, replacing any prior values.
2594 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2595 self.0.options = v.into();
2596 self
2597 }
2598
2599 /// Sends the request.
2600 pub async fn send(self) -> Result<crate::model::Finding> {
2601 (*self.0.stub)
2602 .set_finding_state(self.0.request, self.0.options)
2603 .await
2604 .map(crate::Response::into_body)
2605 }
2606
2607 /// Sets the value of [name][crate::model::SetFindingStateRequest::name].
2608 ///
2609 /// This is a **required** field for requests.
2610 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2611 self.0.request.name = v.into();
2612 self
2613 }
2614
2615 /// Sets the value of [state][crate::model::SetFindingStateRequest::state].
2616 ///
2617 /// This is a **required** field for requests.
2618 pub fn set_state<T: Into<crate::model::finding::State>>(mut self, v: T) -> Self {
2619 self.0.request.state = v.into();
2620 self
2621 }
2622 }
2623
2624 #[doc(hidden)]
2625 impl crate::RequestBuilder for SetFindingState {
2626 fn request_options(&mut self) -> &mut crate::RequestOptions {
2627 &mut self.0.options
2628 }
2629 }
2630
2631 /// The request builder for [SecurityCenter::set_iam_policy][crate::client::SecurityCenter::set_iam_policy] calls.
2632 ///
2633 /// # Example
2634 /// ```
2635 /// # use google_cloud_securitycenter_v2::builder::security_center::SetIamPolicy;
2636 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
2637 ///
2638 /// let builder = prepare_request_builder();
2639 /// let response = builder.send().await?;
2640 /// # Ok(()) }
2641 ///
2642 /// fn prepare_request_builder() -> SetIamPolicy {
2643 /// # panic!();
2644 /// // ... details omitted ...
2645 /// }
2646 /// ```
2647 #[derive(Clone, Debug)]
2648 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2649
2650 impl SetIamPolicy {
2651 pub(crate) fn new(
2652 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
2653 ) -> Self {
2654 Self(RequestBuilder::new(stub))
2655 }
2656
2657 /// Sets the full request, replacing any prior values.
2658 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2659 mut self,
2660 v: V,
2661 ) -> Self {
2662 self.0.request = v.into();
2663 self
2664 }
2665
2666 /// Sets all the options, replacing any prior values.
2667 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2668 self.0.options = v.into();
2669 self
2670 }
2671
2672 /// Sends the request.
2673 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2674 (*self.0.stub)
2675 .set_iam_policy(self.0.request, self.0.options)
2676 .await
2677 .map(crate::Response::into_body)
2678 }
2679
2680 /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
2681 ///
2682 /// This is a **required** field for requests.
2683 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2684 self.0.request.resource = v.into();
2685 self
2686 }
2687
2688 /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2689 ///
2690 /// This is a **required** field for requests.
2691 pub fn set_policy<T>(mut self, v: T) -> Self
2692 where
2693 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2694 {
2695 self.0.request.policy = std::option::Option::Some(v.into());
2696 self
2697 }
2698
2699 /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2700 ///
2701 /// This is a **required** field for requests.
2702 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2703 where
2704 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2705 {
2706 self.0.request.policy = v.map(|x| x.into());
2707 self
2708 }
2709
2710 /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2711 pub fn set_update_mask<T>(mut self, v: T) -> Self
2712 where
2713 T: std::convert::Into<wkt::FieldMask>,
2714 {
2715 self.0.request.update_mask = std::option::Option::Some(v.into());
2716 self
2717 }
2718
2719 /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2720 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2721 where
2722 T: std::convert::Into<wkt::FieldMask>,
2723 {
2724 self.0.request.update_mask = v.map(|x| x.into());
2725 self
2726 }
2727 }
2728
2729 #[doc(hidden)]
2730 impl crate::RequestBuilder for SetIamPolicy {
2731 fn request_options(&mut self) -> &mut crate::RequestOptions {
2732 &mut self.0.options
2733 }
2734 }
2735
2736 /// The request builder for [SecurityCenter::set_mute][crate::client::SecurityCenter::set_mute] calls.
2737 ///
2738 /// # Example
2739 /// ```
2740 /// # use google_cloud_securitycenter_v2::builder::security_center::SetMute;
2741 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
2742 ///
2743 /// let builder = prepare_request_builder();
2744 /// let response = builder.send().await?;
2745 /// # Ok(()) }
2746 ///
2747 /// fn prepare_request_builder() -> SetMute {
2748 /// # panic!();
2749 /// // ... details omitted ...
2750 /// }
2751 /// ```
2752 #[derive(Clone, Debug)]
2753 pub struct SetMute(RequestBuilder<crate::model::SetMuteRequest>);
2754
2755 impl SetMute {
2756 pub(crate) fn new(
2757 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
2758 ) -> Self {
2759 Self(RequestBuilder::new(stub))
2760 }
2761
2762 /// Sets the full request, replacing any prior values.
2763 pub fn with_request<V: Into<crate::model::SetMuteRequest>>(mut self, v: V) -> Self {
2764 self.0.request = v.into();
2765 self
2766 }
2767
2768 /// Sets all the options, replacing any prior values.
2769 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2770 self.0.options = v.into();
2771 self
2772 }
2773
2774 /// Sends the request.
2775 pub async fn send(self) -> Result<crate::model::Finding> {
2776 (*self.0.stub)
2777 .set_mute(self.0.request, self.0.options)
2778 .await
2779 .map(crate::Response::into_body)
2780 }
2781
2782 /// Sets the value of [name][crate::model::SetMuteRequest::name].
2783 ///
2784 /// This is a **required** field for requests.
2785 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2786 self.0.request.name = v.into();
2787 self
2788 }
2789
2790 /// Sets the value of [mute][crate::model::SetMuteRequest::mute].
2791 ///
2792 /// This is a **required** field for requests.
2793 pub fn set_mute<T: Into<crate::model::finding::Mute>>(mut self, v: T) -> Self {
2794 self.0.request.mute = v.into();
2795 self
2796 }
2797 }
2798
2799 #[doc(hidden)]
2800 impl crate::RequestBuilder for SetMute {
2801 fn request_options(&mut self) -> &mut crate::RequestOptions {
2802 &mut self.0.options
2803 }
2804 }
2805
2806 /// The request builder for [SecurityCenter::test_iam_permissions][crate::client::SecurityCenter::test_iam_permissions] calls.
2807 ///
2808 /// # Example
2809 /// ```
2810 /// # use google_cloud_securitycenter_v2::builder::security_center::TestIamPermissions;
2811 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
2812 ///
2813 /// let builder = prepare_request_builder();
2814 /// let response = builder.send().await?;
2815 /// # Ok(()) }
2816 ///
2817 /// fn prepare_request_builder() -> TestIamPermissions {
2818 /// # panic!();
2819 /// // ... details omitted ...
2820 /// }
2821 /// ```
2822 #[derive(Clone, Debug)]
2823 pub struct TestIamPermissions(
2824 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2825 );
2826
2827 impl TestIamPermissions {
2828 pub(crate) fn new(
2829 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
2830 ) -> Self {
2831 Self(RequestBuilder::new(stub))
2832 }
2833
2834 /// Sets the full request, replacing any prior values.
2835 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2836 mut self,
2837 v: V,
2838 ) -> Self {
2839 self.0.request = v.into();
2840 self
2841 }
2842
2843 /// Sets all the options, replacing any prior values.
2844 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2845 self.0.options = v.into();
2846 self
2847 }
2848
2849 /// Sends the request.
2850 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2851 (*self.0.stub)
2852 .test_iam_permissions(self.0.request, self.0.options)
2853 .await
2854 .map(crate::Response::into_body)
2855 }
2856
2857 /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
2858 ///
2859 /// This is a **required** field for requests.
2860 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2861 self.0.request.resource = v.into();
2862 self
2863 }
2864
2865 /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
2866 ///
2867 /// This is a **required** field for requests.
2868 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2869 where
2870 T: std::iter::IntoIterator<Item = V>,
2871 V: std::convert::Into<std::string::String>,
2872 {
2873 use std::iter::Iterator;
2874 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2875 self
2876 }
2877 }
2878
2879 #[doc(hidden)]
2880 impl crate::RequestBuilder for TestIamPermissions {
2881 fn request_options(&mut self) -> &mut crate::RequestOptions {
2882 &mut self.0.options
2883 }
2884 }
2885
2886 /// The request builder for [SecurityCenter::update_big_query_export][crate::client::SecurityCenter::update_big_query_export] calls.
2887 ///
2888 /// # Example
2889 /// ```
2890 /// # use google_cloud_securitycenter_v2::builder::security_center::UpdateBigQueryExport;
2891 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
2892 ///
2893 /// let builder = prepare_request_builder();
2894 /// let response = builder.send().await?;
2895 /// # Ok(()) }
2896 ///
2897 /// fn prepare_request_builder() -> UpdateBigQueryExport {
2898 /// # panic!();
2899 /// // ... details omitted ...
2900 /// }
2901 /// ```
2902 #[derive(Clone, Debug)]
2903 pub struct UpdateBigQueryExport(RequestBuilder<crate::model::UpdateBigQueryExportRequest>);
2904
2905 impl UpdateBigQueryExport {
2906 pub(crate) fn new(
2907 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
2908 ) -> Self {
2909 Self(RequestBuilder::new(stub))
2910 }
2911
2912 /// Sets the full request, replacing any prior values.
2913 pub fn with_request<V: Into<crate::model::UpdateBigQueryExportRequest>>(
2914 mut self,
2915 v: V,
2916 ) -> Self {
2917 self.0.request = v.into();
2918 self
2919 }
2920
2921 /// Sets all the options, replacing any prior values.
2922 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2923 self.0.options = v.into();
2924 self
2925 }
2926
2927 /// Sends the request.
2928 pub async fn send(self) -> Result<crate::model::BigQueryExport> {
2929 (*self.0.stub)
2930 .update_big_query_export(self.0.request, self.0.options)
2931 .await
2932 .map(crate::Response::into_body)
2933 }
2934
2935 /// Sets the value of [big_query_export][crate::model::UpdateBigQueryExportRequest::big_query_export].
2936 ///
2937 /// This is a **required** field for requests.
2938 pub fn set_big_query_export<T>(mut self, v: T) -> Self
2939 where
2940 T: std::convert::Into<crate::model::BigQueryExport>,
2941 {
2942 self.0.request.big_query_export = std::option::Option::Some(v.into());
2943 self
2944 }
2945
2946 /// Sets or clears the value of [big_query_export][crate::model::UpdateBigQueryExportRequest::big_query_export].
2947 ///
2948 /// This is a **required** field for requests.
2949 pub fn set_or_clear_big_query_export<T>(mut self, v: std::option::Option<T>) -> Self
2950 where
2951 T: std::convert::Into<crate::model::BigQueryExport>,
2952 {
2953 self.0.request.big_query_export = v.map(|x| x.into());
2954 self
2955 }
2956
2957 /// Sets the value of [update_mask][crate::model::UpdateBigQueryExportRequest::update_mask].
2958 pub fn set_update_mask<T>(mut self, v: T) -> Self
2959 where
2960 T: std::convert::Into<wkt::FieldMask>,
2961 {
2962 self.0.request.update_mask = std::option::Option::Some(v.into());
2963 self
2964 }
2965
2966 /// Sets or clears the value of [update_mask][crate::model::UpdateBigQueryExportRequest::update_mask].
2967 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2968 where
2969 T: std::convert::Into<wkt::FieldMask>,
2970 {
2971 self.0.request.update_mask = v.map(|x| x.into());
2972 self
2973 }
2974 }
2975
2976 #[doc(hidden)]
2977 impl crate::RequestBuilder for UpdateBigQueryExport {
2978 fn request_options(&mut self) -> &mut crate::RequestOptions {
2979 &mut self.0.options
2980 }
2981 }
2982
2983 /// The request builder for [SecurityCenter::update_external_system][crate::client::SecurityCenter::update_external_system] calls.
2984 ///
2985 /// # Example
2986 /// ```
2987 /// # use google_cloud_securitycenter_v2::builder::security_center::UpdateExternalSystem;
2988 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
2989 ///
2990 /// let builder = prepare_request_builder();
2991 /// let response = builder.send().await?;
2992 /// # Ok(()) }
2993 ///
2994 /// fn prepare_request_builder() -> UpdateExternalSystem {
2995 /// # panic!();
2996 /// // ... details omitted ...
2997 /// }
2998 /// ```
2999 #[derive(Clone, Debug)]
3000 pub struct UpdateExternalSystem(RequestBuilder<crate::model::UpdateExternalSystemRequest>);
3001
3002 impl UpdateExternalSystem {
3003 pub(crate) fn new(
3004 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
3005 ) -> Self {
3006 Self(RequestBuilder::new(stub))
3007 }
3008
3009 /// Sets the full request, replacing any prior values.
3010 pub fn with_request<V: Into<crate::model::UpdateExternalSystemRequest>>(
3011 mut self,
3012 v: V,
3013 ) -> Self {
3014 self.0.request = v.into();
3015 self
3016 }
3017
3018 /// Sets all the options, replacing any prior values.
3019 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3020 self.0.options = v.into();
3021 self
3022 }
3023
3024 /// Sends the request.
3025 pub async fn send(self) -> Result<crate::model::ExternalSystem> {
3026 (*self.0.stub)
3027 .update_external_system(self.0.request, self.0.options)
3028 .await
3029 .map(crate::Response::into_body)
3030 }
3031
3032 /// Sets the value of [external_system][crate::model::UpdateExternalSystemRequest::external_system].
3033 ///
3034 /// This is a **required** field for requests.
3035 pub fn set_external_system<T>(mut self, v: T) -> Self
3036 where
3037 T: std::convert::Into<crate::model::ExternalSystem>,
3038 {
3039 self.0.request.external_system = std::option::Option::Some(v.into());
3040 self
3041 }
3042
3043 /// Sets or clears the value of [external_system][crate::model::UpdateExternalSystemRequest::external_system].
3044 ///
3045 /// This is a **required** field for requests.
3046 pub fn set_or_clear_external_system<T>(mut self, v: std::option::Option<T>) -> Self
3047 where
3048 T: std::convert::Into<crate::model::ExternalSystem>,
3049 {
3050 self.0.request.external_system = v.map(|x| x.into());
3051 self
3052 }
3053
3054 /// Sets the value of [update_mask][crate::model::UpdateExternalSystemRequest::update_mask].
3055 pub fn set_update_mask<T>(mut self, v: T) -> Self
3056 where
3057 T: std::convert::Into<wkt::FieldMask>,
3058 {
3059 self.0.request.update_mask = std::option::Option::Some(v.into());
3060 self
3061 }
3062
3063 /// Sets or clears the value of [update_mask][crate::model::UpdateExternalSystemRequest::update_mask].
3064 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3065 where
3066 T: std::convert::Into<wkt::FieldMask>,
3067 {
3068 self.0.request.update_mask = v.map(|x| x.into());
3069 self
3070 }
3071 }
3072
3073 #[doc(hidden)]
3074 impl crate::RequestBuilder for UpdateExternalSystem {
3075 fn request_options(&mut self) -> &mut crate::RequestOptions {
3076 &mut self.0.options
3077 }
3078 }
3079
3080 /// The request builder for [SecurityCenter::update_finding][crate::client::SecurityCenter::update_finding] calls.
3081 ///
3082 /// # Example
3083 /// ```
3084 /// # use google_cloud_securitycenter_v2::builder::security_center::UpdateFinding;
3085 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
3086 ///
3087 /// let builder = prepare_request_builder();
3088 /// let response = builder.send().await?;
3089 /// # Ok(()) }
3090 ///
3091 /// fn prepare_request_builder() -> UpdateFinding {
3092 /// # panic!();
3093 /// // ... details omitted ...
3094 /// }
3095 /// ```
3096 #[derive(Clone, Debug)]
3097 pub struct UpdateFinding(RequestBuilder<crate::model::UpdateFindingRequest>);
3098
3099 impl UpdateFinding {
3100 pub(crate) fn new(
3101 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
3102 ) -> Self {
3103 Self(RequestBuilder::new(stub))
3104 }
3105
3106 /// Sets the full request, replacing any prior values.
3107 pub fn with_request<V: Into<crate::model::UpdateFindingRequest>>(mut self, v: V) -> Self {
3108 self.0.request = v.into();
3109 self
3110 }
3111
3112 /// Sets all the options, replacing any prior values.
3113 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3114 self.0.options = v.into();
3115 self
3116 }
3117
3118 /// Sends the request.
3119 pub async fn send(self) -> Result<crate::model::Finding> {
3120 (*self.0.stub)
3121 .update_finding(self.0.request, self.0.options)
3122 .await
3123 .map(crate::Response::into_body)
3124 }
3125
3126 /// Sets the value of [finding][crate::model::UpdateFindingRequest::finding].
3127 ///
3128 /// This is a **required** field for requests.
3129 pub fn set_finding<T>(mut self, v: T) -> Self
3130 where
3131 T: std::convert::Into<crate::model::Finding>,
3132 {
3133 self.0.request.finding = std::option::Option::Some(v.into());
3134 self
3135 }
3136
3137 /// Sets or clears the value of [finding][crate::model::UpdateFindingRequest::finding].
3138 ///
3139 /// This is a **required** field for requests.
3140 pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
3141 where
3142 T: std::convert::Into<crate::model::Finding>,
3143 {
3144 self.0.request.finding = v.map(|x| x.into());
3145 self
3146 }
3147
3148 /// Sets the value of [update_mask][crate::model::UpdateFindingRequest::update_mask].
3149 pub fn set_update_mask<T>(mut self, v: T) -> Self
3150 where
3151 T: std::convert::Into<wkt::FieldMask>,
3152 {
3153 self.0.request.update_mask = std::option::Option::Some(v.into());
3154 self
3155 }
3156
3157 /// Sets or clears the value of [update_mask][crate::model::UpdateFindingRequest::update_mask].
3158 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3159 where
3160 T: std::convert::Into<wkt::FieldMask>,
3161 {
3162 self.0.request.update_mask = v.map(|x| x.into());
3163 self
3164 }
3165 }
3166
3167 #[doc(hidden)]
3168 impl crate::RequestBuilder for UpdateFinding {
3169 fn request_options(&mut self) -> &mut crate::RequestOptions {
3170 &mut self.0.options
3171 }
3172 }
3173
3174 /// The request builder for [SecurityCenter::update_mute_config][crate::client::SecurityCenter::update_mute_config] calls.
3175 ///
3176 /// # Example
3177 /// ```
3178 /// # use google_cloud_securitycenter_v2::builder::security_center::UpdateMuteConfig;
3179 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
3180 ///
3181 /// let builder = prepare_request_builder();
3182 /// let response = builder.send().await?;
3183 /// # Ok(()) }
3184 ///
3185 /// fn prepare_request_builder() -> UpdateMuteConfig {
3186 /// # panic!();
3187 /// // ... details omitted ...
3188 /// }
3189 /// ```
3190 #[derive(Clone, Debug)]
3191 pub struct UpdateMuteConfig(RequestBuilder<crate::model::UpdateMuteConfigRequest>);
3192
3193 impl UpdateMuteConfig {
3194 pub(crate) fn new(
3195 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
3196 ) -> Self {
3197 Self(RequestBuilder::new(stub))
3198 }
3199
3200 /// Sets the full request, replacing any prior values.
3201 pub fn with_request<V: Into<crate::model::UpdateMuteConfigRequest>>(
3202 mut self,
3203 v: V,
3204 ) -> Self {
3205 self.0.request = v.into();
3206 self
3207 }
3208
3209 /// Sets all the options, replacing any prior values.
3210 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3211 self.0.options = v.into();
3212 self
3213 }
3214
3215 /// Sends the request.
3216 pub async fn send(self) -> Result<crate::model::MuteConfig> {
3217 (*self.0.stub)
3218 .update_mute_config(self.0.request, self.0.options)
3219 .await
3220 .map(crate::Response::into_body)
3221 }
3222
3223 /// Sets the value of [mute_config][crate::model::UpdateMuteConfigRequest::mute_config].
3224 ///
3225 /// This is a **required** field for requests.
3226 pub fn set_mute_config<T>(mut self, v: T) -> Self
3227 where
3228 T: std::convert::Into<crate::model::MuteConfig>,
3229 {
3230 self.0.request.mute_config = std::option::Option::Some(v.into());
3231 self
3232 }
3233
3234 /// Sets or clears the value of [mute_config][crate::model::UpdateMuteConfigRequest::mute_config].
3235 ///
3236 /// This is a **required** field for requests.
3237 pub fn set_or_clear_mute_config<T>(mut self, v: std::option::Option<T>) -> Self
3238 where
3239 T: std::convert::Into<crate::model::MuteConfig>,
3240 {
3241 self.0.request.mute_config = v.map(|x| x.into());
3242 self
3243 }
3244
3245 /// Sets the value of [update_mask][crate::model::UpdateMuteConfigRequest::update_mask].
3246 pub fn set_update_mask<T>(mut self, v: T) -> Self
3247 where
3248 T: std::convert::Into<wkt::FieldMask>,
3249 {
3250 self.0.request.update_mask = std::option::Option::Some(v.into());
3251 self
3252 }
3253
3254 /// Sets or clears the value of [update_mask][crate::model::UpdateMuteConfigRequest::update_mask].
3255 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3256 where
3257 T: std::convert::Into<wkt::FieldMask>,
3258 {
3259 self.0.request.update_mask = v.map(|x| x.into());
3260 self
3261 }
3262 }
3263
3264 #[doc(hidden)]
3265 impl crate::RequestBuilder for UpdateMuteConfig {
3266 fn request_options(&mut self) -> &mut crate::RequestOptions {
3267 &mut self.0.options
3268 }
3269 }
3270
3271 /// The request builder for [SecurityCenter::update_notification_config][crate::client::SecurityCenter::update_notification_config] calls.
3272 ///
3273 /// # Example
3274 /// ```
3275 /// # use google_cloud_securitycenter_v2::builder::security_center::UpdateNotificationConfig;
3276 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
3277 ///
3278 /// let builder = prepare_request_builder();
3279 /// let response = builder.send().await?;
3280 /// # Ok(()) }
3281 ///
3282 /// fn prepare_request_builder() -> UpdateNotificationConfig {
3283 /// # panic!();
3284 /// // ... details omitted ...
3285 /// }
3286 /// ```
3287 #[derive(Clone, Debug)]
3288 pub struct UpdateNotificationConfig(
3289 RequestBuilder<crate::model::UpdateNotificationConfigRequest>,
3290 );
3291
3292 impl UpdateNotificationConfig {
3293 pub(crate) fn new(
3294 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
3295 ) -> Self {
3296 Self(RequestBuilder::new(stub))
3297 }
3298
3299 /// Sets the full request, replacing any prior values.
3300 pub fn with_request<V: Into<crate::model::UpdateNotificationConfigRequest>>(
3301 mut self,
3302 v: V,
3303 ) -> Self {
3304 self.0.request = v.into();
3305 self
3306 }
3307
3308 /// Sets all the options, replacing any prior values.
3309 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3310 self.0.options = v.into();
3311 self
3312 }
3313
3314 /// Sends the request.
3315 pub async fn send(self) -> Result<crate::model::NotificationConfig> {
3316 (*self.0.stub)
3317 .update_notification_config(self.0.request, self.0.options)
3318 .await
3319 .map(crate::Response::into_body)
3320 }
3321
3322 /// Sets the value of [notification_config][crate::model::UpdateNotificationConfigRequest::notification_config].
3323 ///
3324 /// This is a **required** field for requests.
3325 pub fn set_notification_config<T>(mut self, v: T) -> Self
3326 where
3327 T: std::convert::Into<crate::model::NotificationConfig>,
3328 {
3329 self.0.request.notification_config = std::option::Option::Some(v.into());
3330 self
3331 }
3332
3333 /// Sets or clears the value of [notification_config][crate::model::UpdateNotificationConfigRequest::notification_config].
3334 ///
3335 /// This is a **required** field for requests.
3336 pub fn set_or_clear_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
3337 where
3338 T: std::convert::Into<crate::model::NotificationConfig>,
3339 {
3340 self.0.request.notification_config = v.map(|x| x.into());
3341 self
3342 }
3343
3344 /// Sets the value of [update_mask][crate::model::UpdateNotificationConfigRequest::update_mask].
3345 pub fn set_update_mask<T>(mut self, v: T) -> Self
3346 where
3347 T: std::convert::Into<wkt::FieldMask>,
3348 {
3349 self.0.request.update_mask = std::option::Option::Some(v.into());
3350 self
3351 }
3352
3353 /// Sets or clears the value of [update_mask][crate::model::UpdateNotificationConfigRequest::update_mask].
3354 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3355 where
3356 T: std::convert::Into<wkt::FieldMask>,
3357 {
3358 self.0.request.update_mask = v.map(|x| x.into());
3359 self
3360 }
3361 }
3362
3363 #[doc(hidden)]
3364 impl crate::RequestBuilder for UpdateNotificationConfig {
3365 fn request_options(&mut self) -> &mut crate::RequestOptions {
3366 &mut self.0.options
3367 }
3368 }
3369
3370 /// The request builder for [SecurityCenter::update_resource_value_config][crate::client::SecurityCenter::update_resource_value_config] calls.
3371 ///
3372 /// # Example
3373 /// ```
3374 /// # use google_cloud_securitycenter_v2::builder::security_center::UpdateResourceValueConfig;
3375 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
3376 ///
3377 /// let builder = prepare_request_builder();
3378 /// let response = builder.send().await?;
3379 /// # Ok(()) }
3380 ///
3381 /// fn prepare_request_builder() -> UpdateResourceValueConfig {
3382 /// # panic!();
3383 /// // ... details omitted ...
3384 /// }
3385 /// ```
3386 #[derive(Clone, Debug)]
3387 pub struct UpdateResourceValueConfig(
3388 RequestBuilder<crate::model::UpdateResourceValueConfigRequest>,
3389 );
3390
3391 impl UpdateResourceValueConfig {
3392 pub(crate) fn new(
3393 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
3394 ) -> Self {
3395 Self(RequestBuilder::new(stub))
3396 }
3397
3398 /// Sets the full request, replacing any prior values.
3399 pub fn with_request<V: Into<crate::model::UpdateResourceValueConfigRequest>>(
3400 mut self,
3401 v: V,
3402 ) -> Self {
3403 self.0.request = v.into();
3404 self
3405 }
3406
3407 /// Sets all the options, replacing any prior values.
3408 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3409 self.0.options = v.into();
3410 self
3411 }
3412
3413 /// Sends the request.
3414 pub async fn send(self) -> Result<crate::model::ResourceValueConfig> {
3415 (*self.0.stub)
3416 .update_resource_value_config(self.0.request, self.0.options)
3417 .await
3418 .map(crate::Response::into_body)
3419 }
3420
3421 /// Sets the value of [resource_value_config][crate::model::UpdateResourceValueConfigRequest::resource_value_config].
3422 ///
3423 /// This is a **required** field for requests.
3424 pub fn set_resource_value_config<T>(mut self, v: T) -> Self
3425 where
3426 T: std::convert::Into<crate::model::ResourceValueConfig>,
3427 {
3428 self.0.request.resource_value_config = std::option::Option::Some(v.into());
3429 self
3430 }
3431
3432 /// Sets or clears the value of [resource_value_config][crate::model::UpdateResourceValueConfigRequest::resource_value_config].
3433 ///
3434 /// This is a **required** field for requests.
3435 pub fn set_or_clear_resource_value_config<T>(mut self, v: std::option::Option<T>) -> Self
3436 where
3437 T: std::convert::Into<crate::model::ResourceValueConfig>,
3438 {
3439 self.0.request.resource_value_config = v.map(|x| x.into());
3440 self
3441 }
3442
3443 /// Sets the value of [update_mask][crate::model::UpdateResourceValueConfigRequest::update_mask].
3444 pub fn set_update_mask<T>(mut self, v: T) -> Self
3445 where
3446 T: std::convert::Into<wkt::FieldMask>,
3447 {
3448 self.0.request.update_mask = std::option::Option::Some(v.into());
3449 self
3450 }
3451
3452 /// Sets or clears the value of [update_mask][crate::model::UpdateResourceValueConfigRequest::update_mask].
3453 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3454 where
3455 T: std::convert::Into<wkt::FieldMask>,
3456 {
3457 self.0.request.update_mask = v.map(|x| x.into());
3458 self
3459 }
3460 }
3461
3462 #[doc(hidden)]
3463 impl crate::RequestBuilder for UpdateResourceValueConfig {
3464 fn request_options(&mut self) -> &mut crate::RequestOptions {
3465 &mut self.0.options
3466 }
3467 }
3468
3469 /// The request builder for [SecurityCenter::update_security_marks][crate::client::SecurityCenter::update_security_marks] calls.
3470 ///
3471 /// # Example
3472 /// ```
3473 /// # use google_cloud_securitycenter_v2::builder::security_center::UpdateSecurityMarks;
3474 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
3475 ///
3476 /// let builder = prepare_request_builder();
3477 /// let response = builder.send().await?;
3478 /// # Ok(()) }
3479 ///
3480 /// fn prepare_request_builder() -> UpdateSecurityMarks {
3481 /// # panic!();
3482 /// // ... details omitted ...
3483 /// }
3484 /// ```
3485 #[derive(Clone, Debug)]
3486 pub struct UpdateSecurityMarks(RequestBuilder<crate::model::UpdateSecurityMarksRequest>);
3487
3488 impl UpdateSecurityMarks {
3489 pub(crate) fn new(
3490 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
3491 ) -> Self {
3492 Self(RequestBuilder::new(stub))
3493 }
3494
3495 /// Sets the full request, replacing any prior values.
3496 pub fn with_request<V: Into<crate::model::UpdateSecurityMarksRequest>>(
3497 mut self,
3498 v: V,
3499 ) -> Self {
3500 self.0.request = v.into();
3501 self
3502 }
3503
3504 /// Sets all the options, replacing any prior values.
3505 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3506 self.0.options = v.into();
3507 self
3508 }
3509
3510 /// Sends the request.
3511 pub async fn send(self) -> Result<crate::model::SecurityMarks> {
3512 (*self.0.stub)
3513 .update_security_marks(self.0.request, self.0.options)
3514 .await
3515 .map(crate::Response::into_body)
3516 }
3517
3518 /// Sets the value of [security_marks][crate::model::UpdateSecurityMarksRequest::security_marks].
3519 ///
3520 /// This is a **required** field for requests.
3521 pub fn set_security_marks<T>(mut self, v: T) -> Self
3522 where
3523 T: std::convert::Into<crate::model::SecurityMarks>,
3524 {
3525 self.0.request.security_marks = std::option::Option::Some(v.into());
3526 self
3527 }
3528
3529 /// Sets or clears the value of [security_marks][crate::model::UpdateSecurityMarksRequest::security_marks].
3530 ///
3531 /// This is a **required** field for requests.
3532 pub fn set_or_clear_security_marks<T>(mut self, v: std::option::Option<T>) -> Self
3533 where
3534 T: std::convert::Into<crate::model::SecurityMarks>,
3535 {
3536 self.0.request.security_marks = v.map(|x| x.into());
3537 self
3538 }
3539
3540 /// Sets the value of [update_mask][crate::model::UpdateSecurityMarksRequest::update_mask].
3541 pub fn set_update_mask<T>(mut self, v: T) -> Self
3542 where
3543 T: std::convert::Into<wkt::FieldMask>,
3544 {
3545 self.0.request.update_mask = std::option::Option::Some(v.into());
3546 self
3547 }
3548
3549 /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityMarksRequest::update_mask].
3550 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3551 where
3552 T: std::convert::Into<wkt::FieldMask>,
3553 {
3554 self.0.request.update_mask = v.map(|x| x.into());
3555 self
3556 }
3557 }
3558
3559 #[doc(hidden)]
3560 impl crate::RequestBuilder for UpdateSecurityMarks {
3561 fn request_options(&mut self) -> &mut crate::RequestOptions {
3562 &mut self.0.options
3563 }
3564 }
3565
3566 /// The request builder for [SecurityCenter::update_source][crate::client::SecurityCenter::update_source] calls.
3567 ///
3568 /// # Example
3569 /// ```
3570 /// # use google_cloud_securitycenter_v2::builder::security_center::UpdateSource;
3571 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
3572 ///
3573 /// let builder = prepare_request_builder();
3574 /// let response = builder.send().await?;
3575 /// # Ok(()) }
3576 ///
3577 /// fn prepare_request_builder() -> UpdateSource {
3578 /// # panic!();
3579 /// // ... details omitted ...
3580 /// }
3581 /// ```
3582 #[derive(Clone, Debug)]
3583 pub struct UpdateSource(RequestBuilder<crate::model::UpdateSourceRequest>);
3584
3585 impl UpdateSource {
3586 pub(crate) fn new(
3587 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
3588 ) -> Self {
3589 Self(RequestBuilder::new(stub))
3590 }
3591
3592 /// Sets the full request, replacing any prior values.
3593 pub fn with_request<V: Into<crate::model::UpdateSourceRequest>>(mut self, v: V) -> Self {
3594 self.0.request = v.into();
3595 self
3596 }
3597
3598 /// Sets all the options, replacing any prior values.
3599 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3600 self.0.options = v.into();
3601 self
3602 }
3603
3604 /// Sends the request.
3605 pub async fn send(self) -> Result<crate::model::Source> {
3606 (*self.0.stub)
3607 .update_source(self.0.request, self.0.options)
3608 .await
3609 .map(crate::Response::into_body)
3610 }
3611
3612 /// Sets the value of [source][crate::model::UpdateSourceRequest::source].
3613 ///
3614 /// This is a **required** field for requests.
3615 pub fn set_source<T>(mut self, v: T) -> Self
3616 where
3617 T: std::convert::Into<crate::model::Source>,
3618 {
3619 self.0.request.source = std::option::Option::Some(v.into());
3620 self
3621 }
3622
3623 /// Sets or clears the value of [source][crate::model::UpdateSourceRequest::source].
3624 ///
3625 /// This is a **required** field for requests.
3626 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
3627 where
3628 T: std::convert::Into<crate::model::Source>,
3629 {
3630 self.0.request.source = v.map(|x| x.into());
3631 self
3632 }
3633
3634 /// Sets the value of [update_mask][crate::model::UpdateSourceRequest::update_mask].
3635 pub fn set_update_mask<T>(mut self, v: T) -> Self
3636 where
3637 T: std::convert::Into<wkt::FieldMask>,
3638 {
3639 self.0.request.update_mask = std::option::Option::Some(v.into());
3640 self
3641 }
3642
3643 /// Sets or clears the value of [update_mask][crate::model::UpdateSourceRequest::update_mask].
3644 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3645 where
3646 T: std::convert::Into<wkt::FieldMask>,
3647 {
3648 self.0.request.update_mask = v.map(|x| x.into());
3649 self
3650 }
3651 }
3652
3653 #[doc(hidden)]
3654 impl crate::RequestBuilder for UpdateSource {
3655 fn request_options(&mut self) -> &mut crate::RequestOptions {
3656 &mut self.0.options
3657 }
3658 }
3659
3660 /// The request builder for [SecurityCenter::list_operations][crate::client::SecurityCenter::list_operations] calls.
3661 ///
3662 /// # Example
3663 /// ```
3664 /// # use google_cloud_securitycenter_v2::builder::security_center::ListOperations;
3665 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
3666 /// use google_cloud_gax::paginator::ItemPaginator;
3667 ///
3668 /// let builder = prepare_request_builder();
3669 /// let mut items = builder.by_item();
3670 /// while let Some(result) = items.next().await {
3671 /// let item = result?;
3672 /// }
3673 /// # Ok(()) }
3674 ///
3675 /// fn prepare_request_builder() -> ListOperations {
3676 /// # panic!();
3677 /// // ... details omitted ...
3678 /// }
3679 /// ```
3680 #[derive(Clone, Debug)]
3681 pub struct ListOperations(
3682 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3683 );
3684
3685 impl ListOperations {
3686 pub(crate) fn new(
3687 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
3688 ) -> Self {
3689 Self(RequestBuilder::new(stub))
3690 }
3691
3692 /// Sets the full request, replacing any prior values.
3693 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3694 mut self,
3695 v: V,
3696 ) -> Self {
3697 self.0.request = v.into();
3698 self
3699 }
3700
3701 /// Sets all the options, replacing any prior values.
3702 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3703 self.0.options = v.into();
3704 self
3705 }
3706
3707 /// Sends the request.
3708 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3709 (*self.0.stub)
3710 .list_operations(self.0.request, self.0.options)
3711 .await
3712 .map(crate::Response::into_body)
3713 }
3714
3715 /// Streams each page in the collection.
3716 pub fn by_page(
3717 self,
3718 ) -> impl google_cloud_gax::paginator::Paginator<
3719 google_cloud_longrunning::model::ListOperationsResponse,
3720 crate::Error,
3721 > {
3722 use std::clone::Clone;
3723 let token = self.0.request.page_token.clone();
3724 let execute = move |token: String| {
3725 let mut builder = self.clone();
3726 builder.0.request = builder.0.request.set_page_token(token);
3727 builder.send()
3728 };
3729 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3730 }
3731
3732 /// Streams each item in the collection.
3733 pub fn by_item(
3734 self,
3735 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3736 google_cloud_longrunning::model::ListOperationsResponse,
3737 crate::Error,
3738 > {
3739 use google_cloud_gax::paginator::Paginator;
3740 self.by_page().items()
3741 }
3742
3743 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3744 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3745 self.0.request.name = v.into();
3746 self
3747 }
3748
3749 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3750 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3751 self.0.request.filter = v.into();
3752 self
3753 }
3754
3755 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3756 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3757 self.0.request.page_size = v.into();
3758 self
3759 }
3760
3761 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3762 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3763 self.0.request.page_token = v.into();
3764 self
3765 }
3766
3767 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3768 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3769 self.0.request.return_partial_success = v.into();
3770 self
3771 }
3772 }
3773
3774 #[doc(hidden)]
3775 impl crate::RequestBuilder for ListOperations {
3776 fn request_options(&mut self) -> &mut crate::RequestOptions {
3777 &mut self.0.options
3778 }
3779 }
3780
3781 /// The request builder for [SecurityCenter::get_operation][crate::client::SecurityCenter::get_operation] calls.
3782 ///
3783 /// # Example
3784 /// ```
3785 /// # use google_cloud_securitycenter_v2::builder::security_center::GetOperation;
3786 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
3787 ///
3788 /// let builder = prepare_request_builder();
3789 /// let response = builder.send().await?;
3790 /// # Ok(()) }
3791 ///
3792 /// fn prepare_request_builder() -> GetOperation {
3793 /// # panic!();
3794 /// // ... details omitted ...
3795 /// }
3796 /// ```
3797 #[derive(Clone, Debug)]
3798 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3799
3800 impl GetOperation {
3801 pub(crate) fn new(
3802 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
3803 ) -> Self {
3804 Self(RequestBuilder::new(stub))
3805 }
3806
3807 /// Sets the full request, replacing any prior values.
3808 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3809 mut self,
3810 v: V,
3811 ) -> Self {
3812 self.0.request = v.into();
3813 self
3814 }
3815
3816 /// Sets all the options, replacing any prior values.
3817 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3818 self.0.options = v.into();
3819 self
3820 }
3821
3822 /// Sends the request.
3823 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3824 (*self.0.stub)
3825 .get_operation(self.0.request, self.0.options)
3826 .await
3827 .map(crate::Response::into_body)
3828 }
3829
3830 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3831 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3832 self.0.request.name = v.into();
3833 self
3834 }
3835 }
3836
3837 #[doc(hidden)]
3838 impl crate::RequestBuilder for GetOperation {
3839 fn request_options(&mut self) -> &mut crate::RequestOptions {
3840 &mut self.0.options
3841 }
3842 }
3843
3844 /// The request builder for [SecurityCenter::delete_operation][crate::client::SecurityCenter::delete_operation] calls.
3845 ///
3846 /// # Example
3847 /// ```
3848 /// # use google_cloud_securitycenter_v2::builder::security_center::DeleteOperation;
3849 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
3850 ///
3851 /// let builder = prepare_request_builder();
3852 /// let response = builder.send().await?;
3853 /// # Ok(()) }
3854 ///
3855 /// fn prepare_request_builder() -> DeleteOperation {
3856 /// # panic!();
3857 /// // ... details omitted ...
3858 /// }
3859 /// ```
3860 #[derive(Clone, Debug)]
3861 pub struct DeleteOperation(
3862 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3863 );
3864
3865 impl DeleteOperation {
3866 pub(crate) fn new(
3867 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
3868 ) -> Self {
3869 Self(RequestBuilder::new(stub))
3870 }
3871
3872 /// Sets the full request, replacing any prior values.
3873 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3874 mut self,
3875 v: V,
3876 ) -> Self {
3877 self.0.request = v.into();
3878 self
3879 }
3880
3881 /// Sets all the options, replacing any prior values.
3882 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3883 self.0.options = v.into();
3884 self
3885 }
3886
3887 /// Sends the request.
3888 pub async fn send(self) -> Result<()> {
3889 (*self.0.stub)
3890 .delete_operation(self.0.request, self.0.options)
3891 .await
3892 .map(crate::Response::into_body)
3893 }
3894
3895 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3896 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3897 self.0.request.name = v.into();
3898 self
3899 }
3900 }
3901
3902 #[doc(hidden)]
3903 impl crate::RequestBuilder for DeleteOperation {
3904 fn request_options(&mut self) -> &mut crate::RequestOptions {
3905 &mut self.0.options
3906 }
3907 }
3908
3909 /// The request builder for [SecurityCenter::cancel_operation][crate::client::SecurityCenter::cancel_operation] calls.
3910 ///
3911 /// # Example
3912 /// ```
3913 /// # use google_cloud_securitycenter_v2::builder::security_center::CancelOperation;
3914 /// # async fn sample() -> google_cloud_securitycenter_v2::Result<()> {
3915 ///
3916 /// let builder = prepare_request_builder();
3917 /// let response = builder.send().await?;
3918 /// # Ok(()) }
3919 ///
3920 /// fn prepare_request_builder() -> CancelOperation {
3921 /// # panic!();
3922 /// // ... details omitted ...
3923 /// }
3924 /// ```
3925 #[derive(Clone, Debug)]
3926 pub struct CancelOperation(
3927 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3928 );
3929
3930 impl CancelOperation {
3931 pub(crate) fn new(
3932 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecurityCenter>,
3933 ) -> Self {
3934 Self(RequestBuilder::new(stub))
3935 }
3936
3937 /// Sets the full request, replacing any prior values.
3938 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3939 mut self,
3940 v: V,
3941 ) -> Self {
3942 self.0.request = v.into();
3943 self
3944 }
3945
3946 /// Sets all the options, replacing any prior values.
3947 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3948 self.0.options = v.into();
3949 self
3950 }
3951
3952 /// Sends the request.
3953 pub async fn send(self) -> Result<()> {
3954 (*self.0.stub)
3955 .cancel_operation(self.0.request, self.0.options)
3956 .await
3957 .map(crate::Response::into_body)
3958 }
3959
3960 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3961 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3962 self.0.request.name = v.into();
3963 self
3964 }
3965 }
3966
3967 #[doc(hidden)]
3968 impl crate::RequestBuilder for CancelOperation {
3969 fn request_options(&mut self) -> &mut crate::RequestOptions {
3970 &mut self.0.options
3971 }
3972 }
3973}