google_cloud_chronicle_v1/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 data_access_control_service {
18 use crate::Result;
19
20 /// A builder for [DataAccessControlService][crate::client::DataAccessControlService].
21 ///
22 /// ```
23 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
24 /// # use google_cloud_chronicle_v1::*;
25 /// # use builder::data_access_control_service::ClientBuilder;
26 /// # use client::DataAccessControlService;
27 /// let builder : ClientBuilder = DataAccessControlService::builder();
28 /// let client = builder
29 /// .with_endpoint("https://chronicle.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::DataAccessControlService;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = DataAccessControlService;
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::DataAccessControlService] 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::DataAccessControlService>,
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::DataAccessControlService>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 /// The request builder for [DataAccessControlService::create_data_access_label][crate::client::DataAccessControlService::create_data_access_label] calls.
74 ///
75 /// # Example
76 /// ```
77 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::CreateDataAccessLabel;
78 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
79 ///
80 /// let builder = prepare_request_builder();
81 /// let response = builder.send().await?;
82 /// # Ok(()) }
83 ///
84 /// fn prepare_request_builder() -> CreateDataAccessLabel {
85 /// # panic!();
86 /// // ... details omitted ...
87 /// }
88 /// ```
89 #[derive(Clone, Debug)]
90 pub struct CreateDataAccessLabel(RequestBuilder<crate::model::CreateDataAccessLabelRequest>);
91
92 impl CreateDataAccessLabel {
93 pub(crate) fn new(
94 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
95 ) -> Self {
96 Self(RequestBuilder::new(stub))
97 }
98
99 /// Sets the full request, replacing any prior values.
100 pub fn with_request<V: Into<crate::model::CreateDataAccessLabelRequest>>(
101 mut self,
102 v: V,
103 ) -> Self {
104 self.0.request = v.into();
105 self
106 }
107
108 /// Sets all the options, replacing any prior values.
109 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
110 self.0.options = v.into();
111 self
112 }
113
114 /// Sends the request.
115 pub async fn send(self) -> Result<crate::model::DataAccessLabel> {
116 (*self.0.stub)
117 .create_data_access_label(self.0.request, self.0.options)
118 .await
119 .map(crate::Response::into_body)
120 }
121
122 /// Sets the value of [parent][crate::model::CreateDataAccessLabelRequest::parent].
123 ///
124 /// This is a **required** field for requests.
125 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
126 self.0.request.parent = v.into();
127 self
128 }
129
130 /// Sets the value of [data_access_label][crate::model::CreateDataAccessLabelRequest::data_access_label].
131 ///
132 /// This is a **required** field for requests.
133 pub fn set_data_access_label<T>(mut self, v: T) -> Self
134 where
135 T: std::convert::Into<crate::model::DataAccessLabel>,
136 {
137 self.0.request.data_access_label = std::option::Option::Some(v.into());
138 self
139 }
140
141 /// Sets or clears the value of [data_access_label][crate::model::CreateDataAccessLabelRequest::data_access_label].
142 ///
143 /// This is a **required** field for requests.
144 pub fn set_or_clear_data_access_label<T>(mut self, v: std::option::Option<T>) -> Self
145 where
146 T: std::convert::Into<crate::model::DataAccessLabel>,
147 {
148 self.0.request.data_access_label = v.map(|x| x.into());
149 self
150 }
151
152 /// Sets the value of [data_access_label_id][crate::model::CreateDataAccessLabelRequest::data_access_label_id].
153 ///
154 /// This is a **required** field for requests.
155 pub fn set_data_access_label_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
156 self.0.request.data_access_label_id = v.into();
157 self
158 }
159 }
160
161 #[doc(hidden)]
162 impl crate::RequestBuilder for CreateDataAccessLabel {
163 fn request_options(&mut self) -> &mut crate::RequestOptions {
164 &mut self.0.options
165 }
166 }
167
168 /// The request builder for [DataAccessControlService::get_data_access_label][crate::client::DataAccessControlService::get_data_access_label] calls.
169 ///
170 /// # Example
171 /// ```
172 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::GetDataAccessLabel;
173 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
174 ///
175 /// let builder = prepare_request_builder();
176 /// let response = builder.send().await?;
177 /// # Ok(()) }
178 ///
179 /// fn prepare_request_builder() -> GetDataAccessLabel {
180 /// # panic!();
181 /// // ... details omitted ...
182 /// }
183 /// ```
184 #[derive(Clone, Debug)]
185 pub struct GetDataAccessLabel(RequestBuilder<crate::model::GetDataAccessLabelRequest>);
186
187 impl GetDataAccessLabel {
188 pub(crate) fn new(
189 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
190 ) -> Self {
191 Self(RequestBuilder::new(stub))
192 }
193
194 /// Sets the full request, replacing any prior values.
195 pub fn with_request<V: Into<crate::model::GetDataAccessLabelRequest>>(
196 mut self,
197 v: V,
198 ) -> Self {
199 self.0.request = v.into();
200 self
201 }
202
203 /// Sets all the options, replacing any prior values.
204 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
205 self.0.options = v.into();
206 self
207 }
208
209 /// Sends the request.
210 pub async fn send(self) -> Result<crate::model::DataAccessLabel> {
211 (*self.0.stub)
212 .get_data_access_label(self.0.request, self.0.options)
213 .await
214 .map(crate::Response::into_body)
215 }
216
217 /// Sets the value of [name][crate::model::GetDataAccessLabelRequest::name].
218 ///
219 /// This is a **required** field for requests.
220 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
221 self.0.request.name = v.into();
222 self
223 }
224 }
225
226 #[doc(hidden)]
227 impl crate::RequestBuilder for GetDataAccessLabel {
228 fn request_options(&mut self) -> &mut crate::RequestOptions {
229 &mut self.0.options
230 }
231 }
232
233 /// The request builder for [DataAccessControlService::list_data_access_labels][crate::client::DataAccessControlService::list_data_access_labels] calls.
234 ///
235 /// # Example
236 /// ```
237 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::ListDataAccessLabels;
238 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
239 /// use google_cloud_gax::paginator::ItemPaginator;
240 ///
241 /// let builder = prepare_request_builder();
242 /// let mut items = builder.by_item();
243 /// while let Some(result) = items.next().await {
244 /// let item = result?;
245 /// }
246 /// # Ok(()) }
247 ///
248 /// fn prepare_request_builder() -> ListDataAccessLabels {
249 /// # panic!();
250 /// // ... details omitted ...
251 /// }
252 /// ```
253 #[derive(Clone, Debug)]
254 pub struct ListDataAccessLabels(RequestBuilder<crate::model::ListDataAccessLabelsRequest>);
255
256 impl ListDataAccessLabels {
257 pub(crate) fn new(
258 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
259 ) -> Self {
260 Self(RequestBuilder::new(stub))
261 }
262
263 /// Sets the full request, replacing any prior values.
264 pub fn with_request<V: Into<crate::model::ListDataAccessLabelsRequest>>(
265 mut self,
266 v: V,
267 ) -> Self {
268 self.0.request = v.into();
269 self
270 }
271
272 /// Sets all the options, replacing any prior values.
273 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
274 self.0.options = v.into();
275 self
276 }
277
278 /// Sends the request.
279 pub async fn send(self) -> Result<crate::model::ListDataAccessLabelsResponse> {
280 (*self.0.stub)
281 .list_data_access_labels(self.0.request, self.0.options)
282 .await
283 .map(crate::Response::into_body)
284 }
285
286 /// Streams each page in the collection.
287 pub fn by_page(
288 self,
289 ) -> impl google_cloud_gax::paginator::Paginator<
290 crate::model::ListDataAccessLabelsResponse,
291 crate::Error,
292 > {
293 use std::clone::Clone;
294 let token = self.0.request.page_token.clone();
295 let execute = move |token: String| {
296 let mut builder = self.clone();
297 builder.0.request = builder.0.request.set_page_token(token);
298 builder.send()
299 };
300 google_cloud_gax::paginator::internal::new_paginator(token, execute)
301 }
302
303 /// Streams each item in the collection.
304 pub fn by_item(
305 self,
306 ) -> impl google_cloud_gax::paginator::ItemPaginator<
307 crate::model::ListDataAccessLabelsResponse,
308 crate::Error,
309 > {
310 use google_cloud_gax::paginator::Paginator;
311 self.by_page().items()
312 }
313
314 /// Sets the value of [parent][crate::model::ListDataAccessLabelsRequest::parent].
315 ///
316 /// This is a **required** field for requests.
317 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
318 self.0.request.parent = v.into();
319 self
320 }
321
322 /// Sets the value of [page_size][crate::model::ListDataAccessLabelsRequest::page_size].
323 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
324 self.0.request.page_size = v.into();
325 self
326 }
327
328 /// Sets the value of [page_token][crate::model::ListDataAccessLabelsRequest::page_token].
329 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
330 self.0.request.page_token = v.into();
331 self
332 }
333
334 /// Sets the value of [filter][crate::model::ListDataAccessLabelsRequest::filter].
335 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
336 self.0.request.filter = v.into();
337 self
338 }
339 }
340
341 #[doc(hidden)]
342 impl crate::RequestBuilder for ListDataAccessLabels {
343 fn request_options(&mut self) -> &mut crate::RequestOptions {
344 &mut self.0.options
345 }
346 }
347
348 /// The request builder for [DataAccessControlService::update_data_access_label][crate::client::DataAccessControlService::update_data_access_label] calls.
349 ///
350 /// # Example
351 /// ```
352 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::UpdateDataAccessLabel;
353 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
354 ///
355 /// let builder = prepare_request_builder();
356 /// let response = builder.send().await?;
357 /// # Ok(()) }
358 ///
359 /// fn prepare_request_builder() -> UpdateDataAccessLabel {
360 /// # panic!();
361 /// // ... details omitted ...
362 /// }
363 /// ```
364 #[derive(Clone, Debug)]
365 pub struct UpdateDataAccessLabel(RequestBuilder<crate::model::UpdateDataAccessLabelRequest>);
366
367 impl UpdateDataAccessLabel {
368 pub(crate) fn new(
369 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
370 ) -> Self {
371 Self(RequestBuilder::new(stub))
372 }
373
374 /// Sets the full request, replacing any prior values.
375 pub fn with_request<V: Into<crate::model::UpdateDataAccessLabelRequest>>(
376 mut self,
377 v: V,
378 ) -> Self {
379 self.0.request = v.into();
380 self
381 }
382
383 /// Sets all the options, replacing any prior values.
384 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
385 self.0.options = v.into();
386 self
387 }
388
389 /// Sends the request.
390 pub async fn send(self) -> Result<crate::model::DataAccessLabel> {
391 (*self.0.stub)
392 .update_data_access_label(self.0.request, self.0.options)
393 .await
394 .map(crate::Response::into_body)
395 }
396
397 /// Sets the value of [data_access_label][crate::model::UpdateDataAccessLabelRequest::data_access_label].
398 ///
399 /// This is a **required** field for requests.
400 pub fn set_data_access_label<T>(mut self, v: T) -> Self
401 where
402 T: std::convert::Into<crate::model::DataAccessLabel>,
403 {
404 self.0.request.data_access_label = std::option::Option::Some(v.into());
405 self
406 }
407
408 /// Sets or clears the value of [data_access_label][crate::model::UpdateDataAccessLabelRequest::data_access_label].
409 ///
410 /// This is a **required** field for requests.
411 pub fn set_or_clear_data_access_label<T>(mut self, v: std::option::Option<T>) -> Self
412 where
413 T: std::convert::Into<crate::model::DataAccessLabel>,
414 {
415 self.0.request.data_access_label = v.map(|x| x.into());
416 self
417 }
418
419 /// Sets the value of [update_mask][crate::model::UpdateDataAccessLabelRequest::update_mask].
420 pub fn set_update_mask<T>(mut self, v: T) -> Self
421 where
422 T: std::convert::Into<wkt::FieldMask>,
423 {
424 self.0.request.update_mask = std::option::Option::Some(v.into());
425 self
426 }
427
428 /// Sets or clears the value of [update_mask][crate::model::UpdateDataAccessLabelRequest::update_mask].
429 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
430 where
431 T: std::convert::Into<wkt::FieldMask>,
432 {
433 self.0.request.update_mask = v.map(|x| x.into());
434 self
435 }
436 }
437
438 #[doc(hidden)]
439 impl crate::RequestBuilder for UpdateDataAccessLabel {
440 fn request_options(&mut self) -> &mut crate::RequestOptions {
441 &mut self.0.options
442 }
443 }
444
445 /// The request builder for [DataAccessControlService::delete_data_access_label][crate::client::DataAccessControlService::delete_data_access_label] calls.
446 ///
447 /// # Example
448 /// ```
449 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::DeleteDataAccessLabel;
450 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
451 ///
452 /// let builder = prepare_request_builder();
453 /// let response = builder.send().await?;
454 /// # Ok(()) }
455 ///
456 /// fn prepare_request_builder() -> DeleteDataAccessLabel {
457 /// # panic!();
458 /// // ... details omitted ...
459 /// }
460 /// ```
461 #[derive(Clone, Debug)]
462 pub struct DeleteDataAccessLabel(RequestBuilder<crate::model::DeleteDataAccessLabelRequest>);
463
464 impl DeleteDataAccessLabel {
465 pub(crate) fn new(
466 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
467 ) -> Self {
468 Self(RequestBuilder::new(stub))
469 }
470
471 /// Sets the full request, replacing any prior values.
472 pub fn with_request<V: Into<crate::model::DeleteDataAccessLabelRequest>>(
473 mut self,
474 v: V,
475 ) -> Self {
476 self.0.request = v.into();
477 self
478 }
479
480 /// Sets all the options, replacing any prior values.
481 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
482 self.0.options = v.into();
483 self
484 }
485
486 /// Sends the request.
487 pub async fn send(self) -> Result<()> {
488 (*self.0.stub)
489 .delete_data_access_label(self.0.request, self.0.options)
490 .await
491 .map(crate::Response::into_body)
492 }
493
494 /// Sets the value of [name][crate::model::DeleteDataAccessLabelRequest::name].
495 ///
496 /// This is a **required** field for requests.
497 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
498 self.0.request.name = v.into();
499 self
500 }
501 }
502
503 #[doc(hidden)]
504 impl crate::RequestBuilder for DeleteDataAccessLabel {
505 fn request_options(&mut self) -> &mut crate::RequestOptions {
506 &mut self.0.options
507 }
508 }
509
510 /// The request builder for [DataAccessControlService::create_data_access_scope][crate::client::DataAccessControlService::create_data_access_scope] calls.
511 ///
512 /// # Example
513 /// ```
514 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::CreateDataAccessScope;
515 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
516 ///
517 /// let builder = prepare_request_builder();
518 /// let response = builder.send().await?;
519 /// # Ok(()) }
520 ///
521 /// fn prepare_request_builder() -> CreateDataAccessScope {
522 /// # panic!();
523 /// // ... details omitted ...
524 /// }
525 /// ```
526 #[derive(Clone, Debug)]
527 pub struct CreateDataAccessScope(RequestBuilder<crate::model::CreateDataAccessScopeRequest>);
528
529 impl CreateDataAccessScope {
530 pub(crate) fn new(
531 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
532 ) -> Self {
533 Self(RequestBuilder::new(stub))
534 }
535
536 /// Sets the full request, replacing any prior values.
537 pub fn with_request<V: Into<crate::model::CreateDataAccessScopeRequest>>(
538 mut self,
539 v: V,
540 ) -> Self {
541 self.0.request = v.into();
542 self
543 }
544
545 /// Sets all the options, replacing any prior values.
546 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
547 self.0.options = v.into();
548 self
549 }
550
551 /// Sends the request.
552 pub async fn send(self) -> Result<crate::model::DataAccessScope> {
553 (*self.0.stub)
554 .create_data_access_scope(self.0.request, self.0.options)
555 .await
556 .map(crate::Response::into_body)
557 }
558
559 /// Sets the value of [parent][crate::model::CreateDataAccessScopeRequest::parent].
560 ///
561 /// This is a **required** field for requests.
562 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
563 self.0.request.parent = v.into();
564 self
565 }
566
567 /// Sets the value of [data_access_scope][crate::model::CreateDataAccessScopeRequest::data_access_scope].
568 ///
569 /// This is a **required** field for requests.
570 pub fn set_data_access_scope<T>(mut self, v: T) -> Self
571 where
572 T: std::convert::Into<crate::model::DataAccessScope>,
573 {
574 self.0.request.data_access_scope = std::option::Option::Some(v.into());
575 self
576 }
577
578 /// Sets or clears the value of [data_access_scope][crate::model::CreateDataAccessScopeRequest::data_access_scope].
579 ///
580 /// This is a **required** field for requests.
581 pub fn set_or_clear_data_access_scope<T>(mut self, v: std::option::Option<T>) -> Self
582 where
583 T: std::convert::Into<crate::model::DataAccessScope>,
584 {
585 self.0.request.data_access_scope = v.map(|x| x.into());
586 self
587 }
588
589 /// Sets the value of [data_access_scope_id][crate::model::CreateDataAccessScopeRequest::data_access_scope_id].
590 ///
591 /// This is a **required** field for requests.
592 pub fn set_data_access_scope_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
593 self.0.request.data_access_scope_id = v.into();
594 self
595 }
596 }
597
598 #[doc(hidden)]
599 impl crate::RequestBuilder for CreateDataAccessScope {
600 fn request_options(&mut self) -> &mut crate::RequestOptions {
601 &mut self.0.options
602 }
603 }
604
605 /// The request builder for [DataAccessControlService::get_data_access_scope][crate::client::DataAccessControlService::get_data_access_scope] calls.
606 ///
607 /// # Example
608 /// ```
609 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::GetDataAccessScope;
610 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
611 ///
612 /// let builder = prepare_request_builder();
613 /// let response = builder.send().await?;
614 /// # Ok(()) }
615 ///
616 /// fn prepare_request_builder() -> GetDataAccessScope {
617 /// # panic!();
618 /// // ... details omitted ...
619 /// }
620 /// ```
621 #[derive(Clone, Debug)]
622 pub struct GetDataAccessScope(RequestBuilder<crate::model::GetDataAccessScopeRequest>);
623
624 impl GetDataAccessScope {
625 pub(crate) fn new(
626 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
627 ) -> Self {
628 Self(RequestBuilder::new(stub))
629 }
630
631 /// Sets the full request, replacing any prior values.
632 pub fn with_request<V: Into<crate::model::GetDataAccessScopeRequest>>(
633 mut self,
634 v: V,
635 ) -> Self {
636 self.0.request = v.into();
637 self
638 }
639
640 /// Sets all the options, replacing any prior values.
641 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
642 self.0.options = v.into();
643 self
644 }
645
646 /// Sends the request.
647 pub async fn send(self) -> Result<crate::model::DataAccessScope> {
648 (*self.0.stub)
649 .get_data_access_scope(self.0.request, self.0.options)
650 .await
651 .map(crate::Response::into_body)
652 }
653
654 /// Sets the value of [name][crate::model::GetDataAccessScopeRequest::name].
655 ///
656 /// This is a **required** field for requests.
657 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
658 self.0.request.name = v.into();
659 self
660 }
661 }
662
663 #[doc(hidden)]
664 impl crate::RequestBuilder for GetDataAccessScope {
665 fn request_options(&mut self) -> &mut crate::RequestOptions {
666 &mut self.0.options
667 }
668 }
669
670 /// The request builder for [DataAccessControlService::list_data_access_scopes][crate::client::DataAccessControlService::list_data_access_scopes] calls.
671 ///
672 /// # Example
673 /// ```
674 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::ListDataAccessScopes;
675 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
676 /// use google_cloud_gax::paginator::ItemPaginator;
677 ///
678 /// let builder = prepare_request_builder();
679 /// let mut items = builder.by_item();
680 /// while let Some(result) = items.next().await {
681 /// let item = result?;
682 /// }
683 /// # Ok(()) }
684 ///
685 /// fn prepare_request_builder() -> ListDataAccessScopes {
686 /// # panic!();
687 /// // ... details omitted ...
688 /// }
689 /// ```
690 #[derive(Clone, Debug)]
691 pub struct ListDataAccessScopes(RequestBuilder<crate::model::ListDataAccessScopesRequest>);
692
693 impl ListDataAccessScopes {
694 pub(crate) fn new(
695 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
696 ) -> Self {
697 Self(RequestBuilder::new(stub))
698 }
699
700 /// Sets the full request, replacing any prior values.
701 pub fn with_request<V: Into<crate::model::ListDataAccessScopesRequest>>(
702 mut self,
703 v: V,
704 ) -> Self {
705 self.0.request = v.into();
706 self
707 }
708
709 /// Sets all the options, replacing any prior values.
710 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
711 self.0.options = v.into();
712 self
713 }
714
715 /// Sends the request.
716 pub async fn send(self) -> Result<crate::model::ListDataAccessScopesResponse> {
717 (*self.0.stub)
718 .list_data_access_scopes(self.0.request, self.0.options)
719 .await
720 .map(crate::Response::into_body)
721 }
722
723 /// Streams each page in the collection.
724 pub fn by_page(
725 self,
726 ) -> impl google_cloud_gax::paginator::Paginator<
727 crate::model::ListDataAccessScopesResponse,
728 crate::Error,
729 > {
730 use std::clone::Clone;
731 let token = self.0.request.page_token.clone();
732 let execute = move |token: String| {
733 let mut builder = self.clone();
734 builder.0.request = builder.0.request.set_page_token(token);
735 builder.send()
736 };
737 google_cloud_gax::paginator::internal::new_paginator(token, execute)
738 }
739
740 /// Streams each item in the collection.
741 pub fn by_item(
742 self,
743 ) -> impl google_cloud_gax::paginator::ItemPaginator<
744 crate::model::ListDataAccessScopesResponse,
745 crate::Error,
746 > {
747 use google_cloud_gax::paginator::Paginator;
748 self.by_page().items()
749 }
750
751 /// Sets the value of [parent][crate::model::ListDataAccessScopesRequest::parent].
752 ///
753 /// This is a **required** field for requests.
754 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
755 self.0.request.parent = v.into();
756 self
757 }
758
759 /// Sets the value of [page_size][crate::model::ListDataAccessScopesRequest::page_size].
760 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
761 self.0.request.page_size = v.into();
762 self
763 }
764
765 /// Sets the value of [page_token][crate::model::ListDataAccessScopesRequest::page_token].
766 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
767 self.0.request.page_token = v.into();
768 self
769 }
770
771 /// Sets the value of [filter][crate::model::ListDataAccessScopesRequest::filter].
772 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
773 self.0.request.filter = v.into();
774 self
775 }
776 }
777
778 #[doc(hidden)]
779 impl crate::RequestBuilder for ListDataAccessScopes {
780 fn request_options(&mut self) -> &mut crate::RequestOptions {
781 &mut self.0.options
782 }
783 }
784
785 /// The request builder for [DataAccessControlService::update_data_access_scope][crate::client::DataAccessControlService::update_data_access_scope] calls.
786 ///
787 /// # Example
788 /// ```
789 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::UpdateDataAccessScope;
790 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
791 ///
792 /// let builder = prepare_request_builder();
793 /// let response = builder.send().await?;
794 /// # Ok(()) }
795 ///
796 /// fn prepare_request_builder() -> UpdateDataAccessScope {
797 /// # panic!();
798 /// // ... details omitted ...
799 /// }
800 /// ```
801 #[derive(Clone, Debug)]
802 pub struct UpdateDataAccessScope(RequestBuilder<crate::model::UpdateDataAccessScopeRequest>);
803
804 impl UpdateDataAccessScope {
805 pub(crate) fn new(
806 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
807 ) -> Self {
808 Self(RequestBuilder::new(stub))
809 }
810
811 /// Sets the full request, replacing any prior values.
812 pub fn with_request<V: Into<crate::model::UpdateDataAccessScopeRequest>>(
813 mut self,
814 v: V,
815 ) -> Self {
816 self.0.request = v.into();
817 self
818 }
819
820 /// Sets all the options, replacing any prior values.
821 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
822 self.0.options = v.into();
823 self
824 }
825
826 /// Sends the request.
827 pub async fn send(self) -> Result<crate::model::DataAccessScope> {
828 (*self.0.stub)
829 .update_data_access_scope(self.0.request, self.0.options)
830 .await
831 .map(crate::Response::into_body)
832 }
833
834 /// Sets the value of [data_access_scope][crate::model::UpdateDataAccessScopeRequest::data_access_scope].
835 ///
836 /// This is a **required** field for requests.
837 pub fn set_data_access_scope<T>(mut self, v: T) -> Self
838 where
839 T: std::convert::Into<crate::model::DataAccessScope>,
840 {
841 self.0.request.data_access_scope = std::option::Option::Some(v.into());
842 self
843 }
844
845 /// Sets or clears the value of [data_access_scope][crate::model::UpdateDataAccessScopeRequest::data_access_scope].
846 ///
847 /// This is a **required** field for requests.
848 pub fn set_or_clear_data_access_scope<T>(mut self, v: std::option::Option<T>) -> Self
849 where
850 T: std::convert::Into<crate::model::DataAccessScope>,
851 {
852 self.0.request.data_access_scope = v.map(|x| x.into());
853 self
854 }
855
856 /// Sets the value of [update_mask][crate::model::UpdateDataAccessScopeRequest::update_mask].
857 pub fn set_update_mask<T>(mut self, v: T) -> Self
858 where
859 T: std::convert::Into<wkt::FieldMask>,
860 {
861 self.0.request.update_mask = std::option::Option::Some(v.into());
862 self
863 }
864
865 /// Sets or clears the value of [update_mask][crate::model::UpdateDataAccessScopeRequest::update_mask].
866 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
867 where
868 T: std::convert::Into<wkt::FieldMask>,
869 {
870 self.0.request.update_mask = v.map(|x| x.into());
871 self
872 }
873 }
874
875 #[doc(hidden)]
876 impl crate::RequestBuilder for UpdateDataAccessScope {
877 fn request_options(&mut self) -> &mut crate::RequestOptions {
878 &mut self.0.options
879 }
880 }
881
882 /// The request builder for [DataAccessControlService::delete_data_access_scope][crate::client::DataAccessControlService::delete_data_access_scope] calls.
883 ///
884 /// # Example
885 /// ```
886 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::DeleteDataAccessScope;
887 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
888 ///
889 /// let builder = prepare_request_builder();
890 /// let response = builder.send().await?;
891 /// # Ok(()) }
892 ///
893 /// fn prepare_request_builder() -> DeleteDataAccessScope {
894 /// # panic!();
895 /// // ... details omitted ...
896 /// }
897 /// ```
898 #[derive(Clone, Debug)]
899 pub struct DeleteDataAccessScope(RequestBuilder<crate::model::DeleteDataAccessScopeRequest>);
900
901 impl DeleteDataAccessScope {
902 pub(crate) fn new(
903 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
904 ) -> Self {
905 Self(RequestBuilder::new(stub))
906 }
907
908 /// Sets the full request, replacing any prior values.
909 pub fn with_request<V: Into<crate::model::DeleteDataAccessScopeRequest>>(
910 mut self,
911 v: V,
912 ) -> Self {
913 self.0.request = v.into();
914 self
915 }
916
917 /// Sets all the options, replacing any prior values.
918 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
919 self.0.options = v.into();
920 self
921 }
922
923 /// Sends the request.
924 pub async fn send(self) -> Result<()> {
925 (*self.0.stub)
926 .delete_data_access_scope(self.0.request, self.0.options)
927 .await
928 .map(crate::Response::into_body)
929 }
930
931 /// Sets the value of [name][crate::model::DeleteDataAccessScopeRequest::name].
932 ///
933 /// This is a **required** field for requests.
934 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
935 self.0.request.name = v.into();
936 self
937 }
938 }
939
940 #[doc(hidden)]
941 impl crate::RequestBuilder for DeleteDataAccessScope {
942 fn request_options(&mut self) -> &mut crate::RequestOptions {
943 &mut self.0.options
944 }
945 }
946
947 /// The request builder for [DataAccessControlService::list_operations][crate::client::DataAccessControlService::list_operations] calls.
948 ///
949 /// # Example
950 /// ```
951 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::ListOperations;
952 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
953 /// use google_cloud_gax::paginator::ItemPaginator;
954 ///
955 /// let builder = prepare_request_builder();
956 /// let mut items = builder.by_item();
957 /// while let Some(result) = items.next().await {
958 /// let item = result?;
959 /// }
960 /// # Ok(()) }
961 ///
962 /// fn prepare_request_builder() -> ListOperations {
963 /// # panic!();
964 /// // ... details omitted ...
965 /// }
966 /// ```
967 #[derive(Clone, Debug)]
968 pub struct ListOperations(
969 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
970 );
971
972 impl ListOperations {
973 pub(crate) fn new(
974 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
975 ) -> Self {
976 Self(RequestBuilder::new(stub))
977 }
978
979 /// Sets the full request, replacing any prior values.
980 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
981 mut self,
982 v: V,
983 ) -> Self {
984 self.0.request = v.into();
985 self
986 }
987
988 /// Sets all the options, replacing any prior values.
989 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
990 self.0.options = v.into();
991 self
992 }
993
994 /// Sends the request.
995 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
996 (*self.0.stub)
997 .list_operations(self.0.request, self.0.options)
998 .await
999 .map(crate::Response::into_body)
1000 }
1001
1002 /// Streams each page in the collection.
1003 pub fn by_page(
1004 self,
1005 ) -> impl google_cloud_gax::paginator::Paginator<
1006 google_cloud_longrunning::model::ListOperationsResponse,
1007 crate::Error,
1008 > {
1009 use std::clone::Clone;
1010 let token = self.0.request.page_token.clone();
1011 let execute = move |token: String| {
1012 let mut builder = self.clone();
1013 builder.0.request = builder.0.request.set_page_token(token);
1014 builder.send()
1015 };
1016 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1017 }
1018
1019 /// Streams each item in the collection.
1020 pub fn by_item(
1021 self,
1022 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1023 google_cloud_longrunning::model::ListOperationsResponse,
1024 crate::Error,
1025 > {
1026 use google_cloud_gax::paginator::Paginator;
1027 self.by_page().items()
1028 }
1029
1030 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1031 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1032 self.0.request.name = v.into();
1033 self
1034 }
1035
1036 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1037 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1038 self.0.request.filter = v.into();
1039 self
1040 }
1041
1042 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1043 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1044 self.0.request.page_size = v.into();
1045 self
1046 }
1047
1048 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1049 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1050 self.0.request.page_token = v.into();
1051 self
1052 }
1053
1054 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1055 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1056 self.0.request.return_partial_success = v.into();
1057 self
1058 }
1059 }
1060
1061 #[doc(hidden)]
1062 impl crate::RequestBuilder for ListOperations {
1063 fn request_options(&mut self) -> &mut crate::RequestOptions {
1064 &mut self.0.options
1065 }
1066 }
1067
1068 /// The request builder for [DataAccessControlService::get_operation][crate::client::DataAccessControlService::get_operation] calls.
1069 ///
1070 /// # Example
1071 /// ```
1072 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::GetOperation;
1073 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1074 ///
1075 /// let builder = prepare_request_builder();
1076 /// let response = builder.send().await?;
1077 /// # Ok(()) }
1078 ///
1079 /// fn prepare_request_builder() -> GetOperation {
1080 /// # panic!();
1081 /// // ... details omitted ...
1082 /// }
1083 /// ```
1084 #[derive(Clone, Debug)]
1085 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1086
1087 impl GetOperation {
1088 pub(crate) fn new(
1089 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
1090 ) -> Self {
1091 Self(RequestBuilder::new(stub))
1092 }
1093
1094 /// Sets the full request, replacing any prior values.
1095 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1096 mut self,
1097 v: V,
1098 ) -> 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<google_cloud_longrunning::model::Operation> {
1111 (*self.0.stub)
1112 .get_operation(self.0.request, self.0.options)
1113 .await
1114 .map(crate::Response::into_body)
1115 }
1116
1117 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1118 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1119 self.0.request.name = v.into();
1120 self
1121 }
1122 }
1123
1124 #[doc(hidden)]
1125 impl crate::RequestBuilder for GetOperation {
1126 fn request_options(&mut self) -> &mut crate::RequestOptions {
1127 &mut self.0.options
1128 }
1129 }
1130
1131 /// The request builder for [DataAccessControlService::delete_operation][crate::client::DataAccessControlService::delete_operation] calls.
1132 ///
1133 /// # Example
1134 /// ```
1135 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::DeleteOperation;
1136 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1137 ///
1138 /// let builder = prepare_request_builder();
1139 /// let response = builder.send().await?;
1140 /// # Ok(()) }
1141 ///
1142 /// fn prepare_request_builder() -> DeleteOperation {
1143 /// # panic!();
1144 /// // ... details omitted ...
1145 /// }
1146 /// ```
1147 #[derive(Clone, Debug)]
1148 pub struct DeleteOperation(
1149 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1150 );
1151
1152 impl DeleteOperation {
1153 pub(crate) fn new(
1154 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
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<google_cloud_longrunning::model::DeleteOperationRequest>>(
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<()> {
1176 (*self.0.stub)
1177 .delete_operation(self.0.request, self.0.options)
1178 .await
1179 .map(crate::Response::into_body)
1180 }
1181
1182 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
1183 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1184 self.0.request.name = v.into();
1185 self
1186 }
1187 }
1188
1189 #[doc(hidden)]
1190 impl crate::RequestBuilder for DeleteOperation {
1191 fn request_options(&mut self) -> &mut crate::RequestOptions {
1192 &mut self.0.options
1193 }
1194 }
1195
1196 /// The request builder for [DataAccessControlService::cancel_operation][crate::client::DataAccessControlService::cancel_operation] calls.
1197 ///
1198 /// # Example
1199 /// ```
1200 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::CancelOperation;
1201 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1202 ///
1203 /// let builder = prepare_request_builder();
1204 /// let response = builder.send().await?;
1205 /// # Ok(()) }
1206 ///
1207 /// fn prepare_request_builder() -> CancelOperation {
1208 /// # panic!();
1209 /// // ... details omitted ...
1210 /// }
1211 /// ```
1212 #[derive(Clone, Debug)]
1213 pub struct CancelOperation(
1214 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1215 );
1216
1217 impl CancelOperation {
1218 pub(crate) fn new(
1219 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
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_longrunning::model::CancelOperationRequest>>(
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<()> {
1241 (*self.0.stub)
1242 .cancel_operation(self.0.request, self.0.options)
1243 .await
1244 .map(crate::Response::into_body)
1245 }
1246
1247 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
1248 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1249 self.0.request.name = v.into();
1250 self
1251 }
1252 }
1253
1254 #[doc(hidden)]
1255 impl crate::RequestBuilder for CancelOperation {
1256 fn request_options(&mut self) -> &mut crate::RequestOptions {
1257 &mut self.0.options
1258 }
1259 }
1260}
1261
1262pub mod entity_service {
1263 use crate::Result;
1264
1265 /// A builder for [EntityService][crate::client::EntityService].
1266 ///
1267 /// ```
1268 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1269 /// # use google_cloud_chronicle_v1::*;
1270 /// # use builder::entity_service::ClientBuilder;
1271 /// # use client::EntityService;
1272 /// let builder : ClientBuilder = EntityService::builder();
1273 /// let client = builder
1274 /// .with_endpoint("https://chronicle.googleapis.com")
1275 /// .build().await?;
1276 /// # Ok(()) }
1277 /// ```
1278 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1279
1280 pub(crate) mod client {
1281 use super::super::super::client::EntityService;
1282 pub struct Factory;
1283 impl crate::ClientFactory for Factory {
1284 type Client = EntityService;
1285 type Credentials = gaxi::options::Credentials;
1286 async fn build(
1287 self,
1288 config: gaxi::options::ClientConfig,
1289 ) -> crate::ClientBuilderResult<Self::Client> {
1290 Self::Client::new(config).await
1291 }
1292 }
1293 }
1294
1295 /// Common implementation for [crate::client::EntityService] request builders.
1296 #[derive(Clone, Debug)]
1297 pub(crate) struct RequestBuilder<R: std::default::Default> {
1298 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1299 request: R,
1300 options: crate::RequestOptions,
1301 }
1302
1303 impl<R> RequestBuilder<R>
1304 where
1305 R: std::default::Default,
1306 {
1307 pub(crate) fn new(
1308 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1309 ) -> Self {
1310 Self {
1311 stub,
1312 request: R::default(),
1313 options: crate::RequestOptions::default(),
1314 }
1315 }
1316 }
1317
1318 /// The request builder for [EntityService::get_watchlist][crate::client::EntityService::get_watchlist] calls.
1319 ///
1320 /// # Example
1321 /// ```
1322 /// # use google_cloud_chronicle_v1::builder::entity_service::GetWatchlist;
1323 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1324 ///
1325 /// let builder = prepare_request_builder();
1326 /// let response = builder.send().await?;
1327 /// # Ok(()) }
1328 ///
1329 /// fn prepare_request_builder() -> GetWatchlist {
1330 /// # panic!();
1331 /// // ... details omitted ...
1332 /// }
1333 /// ```
1334 #[derive(Clone, Debug)]
1335 pub struct GetWatchlist(RequestBuilder<crate::model::GetWatchlistRequest>);
1336
1337 impl GetWatchlist {
1338 pub(crate) fn new(
1339 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1340 ) -> Self {
1341 Self(RequestBuilder::new(stub))
1342 }
1343
1344 /// Sets the full request, replacing any prior values.
1345 pub fn with_request<V: Into<crate::model::GetWatchlistRequest>>(mut self, v: V) -> Self {
1346 self.0.request = v.into();
1347 self
1348 }
1349
1350 /// Sets all the options, replacing any prior values.
1351 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1352 self.0.options = v.into();
1353 self
1354 }
1355
1356 /// Sends the request.
1357 pub async fn send(self) -> Result<crate::model::Watchlist> {
1358 (*self.0.stub)
1359 .get_watchlist(self.0.request, self.0.options)
1360 .await
1361 .map(crate::Response::into_body)
1362 }
1363
1364 /// Sets the value of [name][crate::model::GetWatchlistRequest::name].
1365 ///
1366 /// This is a **required** field for requests.
1367 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1368 self.0.request.name = v.into();
1369 self
1370 }
1371 }
1372
1373 #[doc(hidden)]
1374 impl crate::RequestBuilder for GetWatchlist {
1375 fn request_options(&mut self) -> &mut crate::RequestOptions {
1376 &mut self.0.options
1377 }
1378 }
1379
1380 /// The request builder for [EntityService::list_watchlists][crate::client::EntityService::list_watchlists] calls.
1381 ///
1382 /// # Example
1383 /// ```
1384 /// # use google_cloud_chronicle_v1::builder::entity_service::ListWatchlists;
1385 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1386 /// use google_cloud_gax::paginator::ItemPaginator;
1387 ///
1388 /// let builder = prepare_request_builder();
1389 /// let mut items = builder.by_item();
1390 /// while let Some(result) = items.next().await {
1391 /// let item = result?;
1392 /// }
1393 /// # Ok(()) }
1394 ///
1395 /// fn prepare_request_builder() -> ListWatchlists {
1396 /// # panic!();
1397 /// // ... details omitted ...
1398 /// }
1399 /// ```
1400 #[derive(Clone, Debug)]
1401 pub struct ListWatchlists(RequestBuilder<crate::model::ListWatchlistsRequest>);
1402
1403 impl ListWatchlists {
1404 pub(crate) fn new(
1405 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1406 ) -> Self {
1407 Self(RequestBuilder::new(stub))
1408 }
1409
1410 /// Sets the full request, replacing any prior values.
1411 pub fn with_request<V: Into<crate::model::ListWatchlistsRequest>>(mut self, v: V) -> Self {
1412 self.0.request = v.into();
1413 self
1414 }
1415
1416 /// Sets all the options, replacing any prior values.
1417 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1418 self.0.options = v.into();
1419 self
1420 }
1421
1422 /// Sends the request.
1423 pub async fn send(self) -> Result<crate::model::ListWatchlistsResponse> {
1424 (*self.0.stub)
1425 .list_watchlists(self.0.request, self.0.options)
1426 .await
1427 .map(crate::Response::into_body)
1428 }
1429
1430 /// Streams each page in the collection.
1431 pub fn by_page(
1432 self,
1433 ) -> impl google_cloud_gax::paginator::Paginator<
1434 crate::model::ListWatchlistsResponse,
1435 crate::Error,
1436 > {
1437 use std::clone::Clone;
1438 let token = self.0.request.page_token.clone();
1439 let execute = move |token: String| {
1440 let mut builder = self.clone();
1441 builder.0.request = builder.0.request.set_page_token(token);
1442 builder.send()
1443 };
1444 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1445 }
1446
1447 /// Streams each item in the collection.
1448 pub fn by_item(
1449 self,
1450 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1451 crate::model::ListWatchlistsResponse,
1452 crate::Error,
1453 > {
1454 use google_cloud_gax::paginator::Paginator;
1455 self.by_page().items()
1456 }
1457
1458 /// Sets the value of [parent][crate::model::ListWatchlistsRequest::parent].
1459 ///
1460 /// This is a **required** field for requests.
1461 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1462 self.0.request.parent = v.into();
1463 self
1464 }
1465
1466 /// Sets the value of [page_size][crate::model::ListWatchlistsRequest::page_size].
1467 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1468 self.0.request.page_size = v.into();
1469 self
1470 }
1471
1472 /// Sets the value of [page_token][crate::model::ListWatchlistsRequest::page_token].
1473 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1474 self.0.request.page_token = v.into();
1475 self
1476 }
1477
1478 /// Sets the value of [filter][crate::model::ListWatchlistsRequest::filter].
1479 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1480 self.0.request.filter = v.into();
1481 self
1482 }
1483 }
1484
1485 #[doc(hidden)]
1486 impl crate::RequestBuilder for ListWatchlists {
1487 fn request_options(&mut self) -> &mut crate::RequestOptions {
1488 &mut self.0.options
1489 }
1490 }
1491
1492 /// The request builder for [EntityService::create_watchlist][crate::client::EntityService::create_watchlist] calls.
1493 ///
1494 /// # Example
1495 /// ```
1496 /// # use google_cloud_chronicle_v1::builder::entity_service::CreateWatchlist;
1497 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1498 ///
1499 /// let builder = prepare_request_builder();
1500 /// let response = builder.send().await?;
1501 /// # Ok(()) }
1502 ///
1503 /// fn prepare_request_builder() -> CreateWatchlist {
1504 /// # panic!();
1505 /// // ... details omitted ...
1506 /// }
1507 /// ```
1508 #[derive(Clone, Debug)]
1509 pub struct CreateWatchlist(RequestBuilder<crate::model::CreateWatchlistRequest>);
1510
1511 impl CreateWatchlist {
1512 pub(crate) fn new(
1513 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1514 ) -> Self {
1515 Self(RequestBuilder::new(stub))
1516 }
1517
1518 /// Sets the full request, replacing any prior values.
1519 pub fn with_request<V: Into<crate::model::CreateWatchlistRequest>>(mut self, v: V) -> Self {
1520 self.0.request = v.into();
1521 self
1522 }
1523
1524 /// Sets all the options, replacing any prior values.
1525 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1526 self.0.options = v.into();
1527 self
1528 }
1529
1530 /// Sends the request.
1531 pub async fn send(self) -> Result<crate::model::Watchlist> {
1532 (*self.0.stub)
1533 .create_watchlist(self.0.request, self.0.options)
1534 .await
1535 .map(crate::Response::into_body)
1536 }
1537
1538 /// Sets the value of [parent][crate::model::CreateWatchlistRequest::parent].
1539 ///
1540 /// This is a **required** field for requests.
1541 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1542 self.0.request.parent = v.into();
1543 self
1544 }
1545
1546 /// Sets the value of [watchlist_id][crate::model::CreateWatchlistRequest::watchlist_id].
1547 pub fn set_watchlist_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1548 self.0.request.watchlist_id = v.into();
1549 self
1550 }
1551
1552 /// Sets the value of [watchlist][crate::model::CreateWatchlistRequest::watchlist].
1553 ///
1554 /// This is a **required** field for requests.
1555 pub fn set_watchlist<T>(mut self, v: T) -> Self
1556 where
1557 T: std::convert::Into<crate::model::Watchlist>,
1558 {
1559 self.0.request.watchlist = std::option::Option::Some(v.into());
1560 self
1561 }
1562
1563 /// Sets or clears the value of [watchlist][crate::model::CreateWatchlistRequest::watchlist].
1564 ///
1565 /// This is a **required** field for requests.
1566 pub fn set_or_clear_watchlist<T>(mut self, v: std::option::Option<T>) -> Self
1567 where
1568 T: std::convert::Into<crate::model::Watchlist>,
1569 {
1570 self.0.request.watchlist = v.map(|x| x.into());
1571 self
1572 }
1573 }
1574
1575 #[doc(hidden)]
1576 impl crate::RequestBuilder for CreateWatchlist {
1577 fn request_options(&mut self) -> &mut crate::RequestOptions {
1578 &mut self.0.options
1579 }
1580 }
1581
1582 /// The request builder for [EntityService::update_watchlist][crate::client::EntityService::update_watchlist] calls.
1583 ///
1584 /// # Example
1585 /// ```
1586 /// # use google_cloud_chronicle_v1::builder::entity_service::UpdateWatchlist;
1587 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1588 ///
1589 /// let builder = prepare_request_builder();
1590 /// let response = builder.send().await?;
1591 /// # Ok(()) }
1592 ///
1593 /// fn prepare_request_builder() -> UpdateWatchlist {
1594 /// # panic!();
1595 /// // ... details omitted ...
1596 /// }
1597 /// ```
1598 #[derive(Clone, Debug)]
1599 pub struct UpdateWatchlist(RequestBuilder<crate::model::UpdateWatchlistRequest>);
1600
1601 impl UpdateWatchlist {
1602 pub(crate) fn new(
1603 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1604 ) -> Self {
1605 Self(RequestBuilder::new(stub))
1606 }
1607
1608 /// Sets the full request, replacing any prior values.
1609 pub fn with_request<V: Into<crate::model::UpdateWatchlistRequest>>(mut self, v: V) -> Self {
1610 self.0.request = v.into();
1611 self
1612 }
1613
1614 /// Sets all the options, replacing any prior values.
1615 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1616 self.0.options = v.into();
1617 self
1618 }
1619
1620 /// Sends the request.
1621 pub async fn send(self) -> Result<crate::model::Watchlist> {
1622 (*self.0.stub)
1623 .update_watchlist(self.0.request, self.0.options)
1624 .await
1625 .map(crate::Response::into_body)
1626 }
1627
1628 /// Sets the value of [watchlist][crate::model::UpdateWatchlistRequest::watchlist].
1629 ///
1630 /// This is a **required** field for requests.
1631 pub fn set_watchlist<T>(mut self, v: T) -> Self
1632 where
1633 T: std::convert::Into<crate::model::Watchlist>,
1634 {
1635 self.0.request.watchlist = std::option::Option::Some(v.into());
1636 self
1637 }
1638
1639 /// Sets or clears the value of [watchlist][crate::model::UpdateWatchlistRequest::watchlist].
1640 ///
1641 /// This is a **required** field for requests.
1642 pub fn set_or_clear_watchlist<T>(mut self, v: std::option::Option<T>) -> Self
1643 where
1644 T: std::convert::Into<crate::model::Watchlist>,
1645 {
1646 self.0.request.watchlist = v.map(|x| x.into());
1647 self
1648 }
1649
1650 /// Sets the value of [update_mask][crate::model::UpdateWatchlistRequest::update_mask].
1651 pub fn set_update_mask<T>(mut self, v: T) -> Self
1652 where
1653 T: std::convert::Into<wkt::FieldMask>,
1654 {
1655 self.0.request.update_mask = std::option::Option::Some(v.into());
1656 self
1657 }
1658
1659 /// Sets or clears the value of [update_mask][crate::model::UpdateWatchlistRequest::update_mask].
1660 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1661 where
1662 T: std::convert::Into<wkt::FieldMask>,
1663 {
1664 self.0.request.update_mask = v.map(|x| x.into());
1665 self
1666 }
1667 }
1668
1669 #[doc(hidden)]
1670 impl crate::RequestBuilder for UpdateWatchlist {
1671 fn request_options(&mut self) -> &mut crate::RequestOptions {
1672 &mut self.0.options
1673 }
1674 }
1675
1676 /// The request builder for [EntityService::delete_watchlist][crate::client::EntityService::delete_watchlist] calls.
1677 ///
1678 /// # Example
1679 /// ```
1680 /// # use google_cloud_chronicle_v1::builder::entity_service::DeleteWatchlist;
1681 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1682 ///
1683 /// let builder = prepare_request_builder();
1684 /// let response = builder.send().await?;
1685 /// # Ok(()) }
1686 ///
1687 /// fn prepare_request_builder() -> DeleteWatchlist {
1688 /// # panic!();
1689 /// // ... details omitted ...
1690 /// }
1691 /// ```
1692 #[derive(Clone, Debug)]
1693 pub struct DeleteWatchlist(RequestBuilder<crate::model::DeleteWatchlistRequest>);
1694
1695 impl DeleteWatchlist {
1696 pub(crate) fn new(
1697 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1698 ) -> Self {
1699 Self(RequestBuilder::new(stub))
1700 }
1701
1702 /// Sets the full request, replacing any prior values.
1703 pub fn with_request<V: Into<crate::model::DeleteWatchlistRequest>>(mut self, v: V) -> Self {
1704 self.0.request = v.into();
1705 self
1706 }
1707
1708 /// Sets all the options, replacing any prior values.
1709 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1710 self.0.options = v.into();
1711 self
1712 }
1713
1714 /// Sends the request.
1715 pub async fn send(self) -> Result<()> {
1716 (*self.0.stub)
1717 .delete_watchlist(self.0.request, self.0.options)
1718 .await
1719 .map(crate::Response::into_body)
1720 }
1721
1722 /// Sets the value of [name][crate::model::DeleteWatchlistRequest::name].
1723 ///
1724 /// This is a **required** field for requests.
1725 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1726 self.0.request.name = v.into();
1727 self
1728 }
1729
1730 /// Sets the value of [force][crate::model::DeleteWatchlistRequest::force].
1731 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1732 self.0.request.force = v.into();
1733 self
1734 }
1735 }
1736
1737 #[doc(hidden)]
1738 impl crate::RequestBuilder for DeleteWatchlist {
1739 fn request_options(&mut self) -> &mut crate::RequestOptions {
1740 &mut self.0.options
1741 }
1742 }
1743
1744 /// The request builder for [EntityService::list_operations][crate::client::EntityService::list_operations] calls.
1745 ///
1746 /// # Example
1747 /// ```
1748 /// # use google_cloud_chronicle_v1::builder::entity_service::ListOperations;
1749 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1750 /// use google_cloud_gax::paginator::ItemPaginator;
1751 ///
1752 /// let builder = prepare_request_builder();
1753 /// let mut items = builder.by_item();
1754 /// while let Some(result) = items.next().await {
1755 /// let item = result?;
1756 /// }
1757 /// # Ok(()) }
1758 ///
1759 /// fn prepare_request_builder() -> ListOperations {
1760 /// # panic!();
1761 /// // ... details omitted ...
1762 /// }
1763 /// ```
1764 #[derive(Clone, Debug)]
1765 pub struct ListOperations(
1766 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1767 );
1768
1769 impl ListOperations {
1770 pub(crate) fn new(
1771 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1772 ) -> Self {
1773 Self(RequestBuilder::new(stub))
1774 }
1775
1776 /// Sets the full request, replacing any prior values.
1777 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1778 mut self,
1779 v: V,
1780 ) -> Self {
1781 self.0.request = v.into();
1782 self
1783 }
1784
1785 /// Sets all the options, replacing any prior values.
1786 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1787 self.0.options = v.into();
1788 self
1789 }
1790
1791 /// Sends the request.
1792 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1793 (*self.0.stub)
1794 .list_operations(self.0.request, self.0.options)
1795 .await
1796 .map(crate::Response::into_body)
1797 }
1798
1799 /// Streams each page in the collection.
1800 pub fn by_page(
1801 self,
1802 ) -> impl google_cloud_gax::paginator::Paginator<
1803 google_cloud_longrunning::model::ListOperationsResponse,
1804 crate::Error,
1805 > {
1806 use std::clone::Clone;
1807 let token = self.0.request.page_token.clone();
1808 let execute = move |token: String| {
1809 let mut builder = self.clone();
1810 builder.0.request = builder.0.request.set_page_token(token);
1811 builder.send()
1812 };
1813 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1814 }
1815
1816 /// Streams each item in the collection.
1817 pub fn by_item(
1818 self,
1819 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1820 google_cloud_longrunning::model::ListOperationsResponse,
1821 crate::Error,
1822 > {
1823 use google_cloud_gax::paginator::Paginator;
1824 self.by_page().items()
1825 }
1826
1827 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1828 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1829 self.0.request.name = v.into();
1830 self
1831 }
1832
1833 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1834 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1835 self.0.request.filter = v.into();
1836 self
1837 }
1838
1839 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1840 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1841 self.0.request.page_size = v.into();
1842 self
1843 }
1844
1845 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1846 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1847 self.0.request.page_token = v.into();
1848 self
1849 }
1850
1851 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1852 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1853 self.0.request.return_partial_success = v.into();
1854 self
1855 }
1856 }
1857
1858 #[doc(hidden)]
1859 impl crate::RequestBuilder for ListOperations {
1860 fn request_options(&mut self) -> &mut crate::RequestOptions {
1861 &mut self.0.options
1862 }
1863 }
1864
1865 /// The request builder for [EntityService::get_operation][crate::client::EntityService::get_operation] calls.
1866 ///
1867 /// # Example
1868 /// ```
1869 /// # use google_cloud_chronicle_v1::builder::entity_service::GetOperation;
1870 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1871 ///
1872 /// let builder = prepare_request_builder();
1873 /// let response = builder.send().await?;
1874 /// # Ok(()) }
1875 ///
1876 /// fn prepare_request_builder() -> GetOperation {
1877 /// # panic!();
1878 /// // ... details omitted ...
1879 /// }
1880 /// ```
1881 #[derive(Clone, Debug)]
1882 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1883
1884 impl GetOperation {
1885 pub(crate) fn new(
1886 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1887 ) -> Self {
1888 Self(RequestBuilder::new(stub))
1889 }
1890
1891 /// Sets the full request, replacing any prior values.
1892 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1893 mut self,
1894 v: V,
1895 ) -> Self {
1896 self.0.request = v.into();
1897 self
1898 }
1899
1900 /// Sets all the options, replacing any prior values.
1901 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1902 self.0.options = v.into();
1903 self
1904 }
1905
1906 /// Sends the request.
1907 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1908 (*self.0.stub)
1909 .get_operation(self.0.request, self.0.options)
1910 .await
1911 .map(crate::Response::into_body)
1912 }
1913
1914 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1915 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1916 self.0.request.name = v.into();
1917 self
1918 }
1919 }
1920
1921 #[doc(hidden)]
1922 impl crate::RequestBuilder for GetOperation {
1923 fn request_options(&mut self) -> &mut crate::RequestOptions {
1924 &mut self.0.options
1925 }
1926 }
1927
1928 /// The request builder for [EntityService::delete_operation][crate::client::EntityService::delete_operation] calls.
1929 ///
1930 /// # Example
1931 /// ```
1932 /// # use google_cloud_chronicle_v1::builder::entity_service::DeleteOperation;
1933 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1934 ///
1935 /// let builder = prepare_request_builder();
1936 /// let response = builder.send().await?;
1937 /// # Ok(()) }
1938 ///
1939 /// fn prepare_request_builder() -> DeleteOperation {
1940 /// # panic!();
1941 /// // ... details omitted ...
1942 /// }
1943 /// ```
1944 #[derive(Clone, Debug)]
1945 pub struct DeleteOperation(
1946 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1947 );
1948
1949 impl DeleteOperation {
1950 pub(crate) fn new(
1951 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
1952 ) -> Self {
1953 Self(RequestBuilder::new(stub))
1954 }
1955
1956 /// Sets the full request, replacing any prior values.
1957 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1958 mut self,
1959 v: V,
1960 ) -> Self {
1961 self.0.request = v.into();
1962 self
1963 }
1964
1965 /// Sets all the options, replacing any prior values.
1966 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1967 self.0.options = v.into();
1968 self
1969 }
1970
1971 /// Sends the request.
1972 pub async fn send(self) -> Result<()> {
1973 (*self.0.stub)
1974 .delete_operation(self.0.request, self.0.options)
1975 .await
1976 .map(crate::Response::into_body)
1977 }
1978
1979 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
1980 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1981 self.0.request.name = v.into();
1982 self
1983 }
1984 }
1985
1986 #[doc(hidden)]
1987 impl crate::RequestBuilder for DeleteOperation {
1988 fn request_options(&mut self) -> &mut crate::RequestOptions {
1989 &mut self.0.options
1990 }
1991 }
1992
1993 /// The request builder for [EntityService::cancel_operation][crate::client::EntityService::cancel_operation] calls.
1994 ///
1995 /// # Example
1996 /// ```
1997 /// # use google_cloud_chronicle_v1::builder::entity_service::CancelOperation;
1998 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1999 ///
2000 /// let builder = prepare_request_builder();
2001 /// let response = builder.send().await?;
2002 /// # Ok(()) }
2003 ///
2004 /// fn prepare_request_builder() -> CancelOperation {
2005 /// # panic!();
2006 /// // ... details omitted ...
2007 /// }
2008 /// ```
2009 #[derive(Clone, Debug)]
2010 pub struct CancelOperation(
2011 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2012 );
2013
2014 impl CancelOperation {
2015 pub(crate) fn new(
2016 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
2017 ) -> Self {
2018 Self(RequestBuilder::new(stub))
2019 }
2020
2021 /// Sets the full request, replacing any prior values.
2022 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2023 mut self,
2024 v: V,
2025 ) -> Self {
2026 self.0.request = v.into();
2027 self
2028 }
2029
2030 /// Sets all the options, replacing any prior values.
2031 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2032 self.0.options = v.into();
2033 self
2034 }
2035
2036 /// Sends the request.
2037 pub async fn send(self) -> Result<()> {
2038 (*self.0.stub)
2039 .cancel_operation(self.0.request, self.0.options)
2040 .await
2041 .map(crate::Response::into_body)
2042 }
2043
2044 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2045 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2046 self.0.request.name = v.into();
2047 self
2048 }
2049 }
2050
2051 #[doc(hidden)]
2052 impl crate::RequestBuilder for CancelOperation {
2053 fn request_options(&mut self) -> &mut crate::RequestOptions {
2054 &mut self.0.options
2055 }
2056 }
2057}
2058
2059pub mod instance_service {
2060 use crate::Result;
2061
2062 /// A builder for [InstanceService][crate::client::InstanceService].
2063 ///
2064 /// ```
2065 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2066 /// # use google_cloud_chronicle_v1::*;
2067 /// # use builder::instance_service::ClientBuilder;
2068 /// # use client::InstanceService;
2069 /// let builder : ClientBuilder = InstanceService::builder();
2070 /// let client = builder
2071 /// .with_endpoint("https://chronicle.googleapis.com")
2072 /// .build().await?;
2073 /// # Ok(()) }
2074 /// ```
2075 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2076
2077 pub(crate) mod client {
2078 use super::super::super::client::InstanceService;
2079 pub struct Factory;
2080 impl crate::ClientFactory for Factory {
2081 type Client = InstanceService;
2082 type Credentials = gaxi::options::Credentials;
2083 async fn build(
2084 self,
2085 config: gaxi::options::ClientConfig,
2086 ) -> crate::ClientBuilderResult<Self::Client> {
2087 Self::Client::new(config).await
2088 }
2089 }
2090 }
2091
2092 /// Common implementation for [crate::client::InstanceService] request builders.
2093 #[derive(Clone, Debug)]
2094 pub(crate) struct RequestBuilder<R: std::default::Default> {
2095 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
2096 request: R,
2097 options: crate::RequestOptions,
2098 }
2099
2100 impl<R> RequestBuilder<R>
2101 where
2102 R: std::default::Default,
2103 {
2104 pub(crate) fn new(
2105 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
2106 ) -> Self {
2107 Self {
2108 stub,
2109 request: R::default(),
2110 options: crate::RequestOptions::default(),
2111 }
2112 }
2113 }
2114
2115 /// The request builder for [InstanceService::get_instance][crate::client::InstanceService::get_instance] calls.
2116 ///
2117 /// # Example
2118 /// ```
2119 /// # use google_cloud_chronicle_v1::builder::instance_service::GetInstance;
2120 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2121 ///
2122 /// let builder = prepare_request_builder();
2123 /// let response = builder.send().await?;
2124 /// # Ok(()) }
2125 ///
2126 /// fn prepare_request_builder() -> GetInstance {
2127 /// # panic!();
2128 /// // ... details omitted ...
2129 /// }
2130 /// ```
2131 #[derive(Clone, Debug)]
2132 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
2133
2134 impl GetInstance {
2135 pub(crate) fn new(
2136 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
2137 ) -> Self {
2138 Self(RequestBuilder::new(stub))
2139 }
2140
2141 /// Sets the full request, replacing any prior values.
2142 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
2143 self.0.request = v.into();
2144 self
2145 }
2146
2147 /// Sets all the options, replacing any prior values.
2148 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2149 self.0.options = v.into();
2150 self
2151 }
2152
2153 /// Sends the request.
2154 pub async fn send(self) -> Result<crate::model::Instance> {
2155 (*self.0.stub)
2156 .get_instance(self.0.request, self.0.options)
2157 .await
2158 .map(crate::Response::into_body)
2159 }
2160
2161 /// Sets the value of [name][crate::model::GetInstanceRequest::name].
2162 ///
2163 /// This is a **required** field for requests.
2164 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2165 self.0.request.name = v.into();
2166 self
2167 }
2168 }
2169
2170 #[doc(hidden)]
2171 impl crate::RequestBuilder for GetInstance {
2172 fn request_options(&mut self) -> &mut crate::RequestOptions {
2173 &mut self.0.options
2174 }
2175 }
2176
2177 /// The request builder for [InstanceService::list_operations][crate::client::InstanceService::list_operations] calls.
2178 ///
2179 /// # Example
2180 /// ```
2181 /// # use google_cloud_chronicle_v1::builder::instance_service::ListOperations;
2182 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2183 /// use google_cloud_gax::paginator::ItemPaginator;
2184 ///
2185 /// let builder = prepare_request_builder();
2186 /// let mut items = builder.by_item();
2187 /// while let Some(result) = items.next().await {
2188 /// let item = result?;
2189 /// }
2190 /// # Ok(()) }
2191 ///
2192 /// fn prepare_request_builder() -> ListOperations {
2193 /// # panic!();
2194 /// // ... details omitted ...
2195 /// }
2196 /// ```
2197 #[derive(Clone, Debug)]
2198 pub struct ListOperations(
2199 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2200 );
2201
2202 impl ListOperations {
2203 pub(crate) fn new(
2204 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
2205 ) -> Self {
2206 Self(RequestBuilder::new(stub))
2207 }
2208
2209 /// Sets the full request, replacing any prior values.
2210 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2211 mut self,
2212 v: V,
2213 ) -> Self {
2214 self.0.request = v.into();
2215 self
2216 }
2217
2218 /// Sets all the options, replacing any prior values.
2219 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2220 self.0.options = v.into();
2221 self
2222 }
2223
2224 /// Sends the request.
2225 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2226 (*self.0.stub)
2227 .list_operations(self.0.request, self.0.options)
2228 .await
2229 .map(crate::Response::into_body)
2230 }
2231
2232 /// Streams each page in the collection.
2233 pub fn by_page(
2234 self,
2235 ) -> impl google_cloud_gax::paginator::Paginator<
2236 google_cloud_longrunning::model::ListOperationsResponse,
2237 crate::Error,
2238 > {
2239 use std::clone::Clone;
2240 let token = self.0.request.page_token.clone();
2241 let execute = move |token: String| {
2242 let mut builder = self.clone();
2243 builder.0.request = builder.0.request.set_page_token(token);
2244 builder.send()
2245 };
2246 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2247 }
2248
2249 /// Streams each item in the collection.
2250 pub fn by_item(
2251 self,
2252 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2253 google_cloud_longrunning::model::ListOperationsResponse,
2254 crate::Error,
2255 > {
2256 use google_cloud_gax::paginator::Paginator;
2257 self.by_page().items()
2258 }
2259
2260 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
2261 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2262 self.0.request.name = v.into();
2263 self
2264 }
2265
2266 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
2267 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2268 self.0.request.filter = v.into();
2269 self
2270 }
2271
2272 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2273 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2274 self.0.request.page_size = v.into();
2275 self
2276 }
2277
2278 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2279 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2280 self.0.request.page_token = v.into();
2281 self
2282 }
2283
2284 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2285 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2286 self.0.request.return_partial_success = v.into();
2287 self
2288 }
2289 }
2290
2291 #[doc(hidden)]
2292 impl crate::RequestBuilder for ListOperations {
2293 fn request_options(&mut self) -> &mut crate::RequestOptions {
2294 &mut self.0.options
2295 }
2296 }
2297
2298 /// The request builder for [InstanceService::get_operation][crate::client::InstanceService::get_operation] calls.
2299 ///
2300 /// # Example
2301 /// ```
2302 /// # use google_cloud_chronicle_v1::builder::instance_service::GetOperation;
2303 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2304 ///
2305 /// let builder = prepare_request_builder();
2306 /// let response = builder.send().await?;
2307 /// # Ok(()) }
2308 ///
2309 /// fn prepare_request_builder() -> GetOperation {
2310 /// # panic!();
2311 /// // ... details omitted ...
2312 /// }
2313 /// ```
2314 #[derive(Clone, Debug)]
2315 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2316
2317 impl GetOperation {
2318 pub(crate) fn new(
2319 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
2320 ) -> Self {
2321 Self(RequestBuilder::new(stub))
2322 }
2323
2324 /// Sets the full request, replacing any prior values.
2325 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2326 mut self,
2327 v: V,
2328 ) -> Self {
2329 self.0.request = v.into();
2330 self
2331 }
2332
2333 /// Sets all the options, replacing any prior values.
2334 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2335 self.0.options = v.into();
2336 self
2337 }
2338
2339 /// Sends the request.
2340 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2341 (*self.0.stub)
2342 .get_operation(self.0.request, self.0.options)
2343 .await
2344 .map(crate::Response::into_body)
2345 }
2346
2347 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2348 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2349 self.0.request.name = v.into();
2350 self
2351 }
2352 }
2353
2354 #[doc(hidden)]
2355 impl crate::RequestBuilder for GetOperation {
2356 fn request_options(&mut self) -> &mut crate::RequestOptions {
2357 &mut self.0.options
2358 }
2359 }
2360
2361 /// The request builder for [InstanceService::delete_operation][crate::client::InstanceService::delete_operation] calls.
2362 ///
2363 /// # Example
2364 /// ```
2365 /// # use google_cloud_chronicle_v1::builder::instance_service::DeleteOperation;
2366 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2367 ///
2368 /// let builder = prepare_request_builder();
2369 /// let response = builder.send().await?;
2370 /// # Ok(()) }
2371 ///
2372 /// fn prepare_request_builder() -> DeleteOperation {
2373 /// # panic!();
2374 /// // ... details omitted ...
2375 /// }
2376 /// ```
2377 #[derive(Clone, Debug)]
2378 pub struct DeleteOperation(
2379 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2380 );
2381
2382 impl DeleteOperation {
2383 pub(crate) fn new(
2384 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
2385 ) -> Self {
2386 Self(RequestBuilder::new(stub))
2387 }
2388
2389 /// Sets the full request, replacing any prior values.
2390 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2391 mut self,
2392 v: V,
2393 ) -> Self {
2394 self.0.request = v.into();
2395 self
2396 }
2397
2398 /// Sets all the options, replacing any prior values.
2399 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2400 self.0.options = v.into();
2401 self
2402 }
2403
2404 /// Sends the request.
2405 pub async fn send(self) -> Result<()> {
2406 (*self.0.stub)
2407 .delete_operation(self.0.request, self.0.options)
2408 .await
2409 .map(crate::Response::into_body)
2410 }
2411
2412 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
2413 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2414 self.0.request.name = v.into();
2415 self
2416 }
2417 }
2418
2419 #[doc(hidden)]
2420 impl crate::RequestBuilder for DeleteOperation {
2421 fn request_options(&mut self) -> &mut crate::RequestOptions {
2422 &mut self.0.options
2423 }
2424 }
2425
2426 /// The request builder for [InstanceService::cancel_operation][crate::client::InstanceService::cancel_operation] calls.
2427 ///
2428 /// # Example
2429 /// ```
2430 /// # use google_cloud_chronicle_v1::builder::instance_service::CancelOperation;
2431 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2432 ///
2433 /// let builder = prepare_request_builder();
2434 /// let response = builder.send().await?;
2435 /// # Ok(()) }
2436 ///
2437 /// fn prepare_request_builder() -> CancelOperation {
2438 /// # panic!();
2439 /// // ... details omitted ...
2440 /// }
2441 /// ```
2442 #[derive(Clone, Debug)]
2443 pub struct CancelOperation(
2444 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2445 );
2446
2447 impl CancelOperation {
2448 pub(crate) fn new(
2449 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
2450 ) -> Self {
2451 Self(RequestBuilder::new(stub))
2452 }
2453
2454 /// Sets the full request, replacing any prior values.
2455 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2456 mut self,
2457 v: V,
2458 ) -> Self {
2459 self.0.request = v.into();
2460 self
2461 }
2462
2463 /// Sets all the options, replacing any prior values.
2464 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2465 self.0.options = v.into();
2466 self
2467 }
2468
2469 /// Sends the request.
2470 pub async fn send(self) -> Result<()> {
2471 (*self.0.stub)
2472 .cancel_operation(self.0.request, self.0.options)
2473 .await
2474 .map(crate::Response::into_body)
2475 }
2476
2477 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2478 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2479 self.0.request.name = v.into();
2480 self
2481 }
2482 }
2483
2484 #[doc(hidden)]
2485 impl crate::RequestBuilder for CancelOperation {
2486 fn request_options(&mut self) -> &mut crate::RequestOptions {
2487 &mut self.0.options
2488 }
2489 }
2490}
2491
2492pub mod reference_list_service {
2493 use crate::Result;
2494
2495 /// A builder for [ReferenceListService][crate::client::ReferenceListService].
2496 ///
2497 /// ```
2498 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2499 /// # use google_cloud_chronicle_v1::*;
2500 /// # use builder::reference_list_service::ClientBuilder;
2501 /// # use client::ReferenceListService;
2502 /// let builder : ClientBuilder = ReferenceListService::builder();
2503 /// let client = builder
2504 /// .with_endpoint("https://chronicle.googleapis.com")
2505 /// .build().await?;
2506 /// # Ok(()) }
2507 /// ```
2508 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2509
2510 pub(crate) mod client {
2511 use super::super::super::client::ReferenceListService;
2512 pub struct Factory;
2513 impl crate::ClientFactory for Factory {
2514 type Client = ReferenceListService;
2515 type Credentials = gaxi::options::Credentials;
2516 async fn build(
2517 self,
2518 config: gaxi::options::ClientConfig,
2519 ) -> crate::ClientBuilderResult<Self::Client> {
2520 Self::Client::new(config).await
2521 }
2522 }
2523 }
2524
2525 /// Common implementation for [crate::client::ReferenceListService] request builders.
2526 #[derive(Clone, Debug)]
2527 pub(crate) struct RequestBuilder<R: std::default::Default> {
2528 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
2529 request: R,
2530 options: crate::RequestOptions,
2531 }
2532
2533 impl<R> RequestBuilder<R>
2534 where
2535 R: std::default::Default,
2536 {
2537 pub(crate) fn new(
2538 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
2539 ) -> Self {
2540 Self {
2541 stub,
2542 request: R::default(),
2543 options: crate::RequestOptions::default(),
2544 }
2545 }
2546 }
2547
2548 /// The request builder for [ReferenceListService::get_reference_list][crate::client::ReferenceListService::get_reference_list] calls.
2549 ///
2550 /// # Example
2551 /// ```
2552 /// # use google_cloud_chronicle_v1::builder::reference_list_service::GetReferenceList;
2553 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2554 ///
2555 /// let builder = prepare_request_builder();
2556 /// let response = builder.send().await?;
2557 /// # Ok(()) }
2558 ///
2559 /// fn prepare_request_builder() -> GetReferenceList {
2560 /// # panic!();
2561 /// // ... details omitted ...
2562 /// }
2563 /// ```
2564 #[derive(Clone, Debug)]
2565 pub struct GetReferenceList(RequestBuilder<crate::model::GetReferenceListRequest>);
2566
2567 impl GetReferenceList {
2568 pub(crate) fn new(
2569 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
2570 ) -> Self {
2571 Self(RequestBuilder::new(stub))
2572 }
2573
2574 /// Sets the full request, replacing any prior values.
2575 pub fn with_request<V: Into<crate::model::GetReferenceListRequest>>(
2576 mut self,
2577 v: V,
2578 ) -> Self {
2579 self.0.request = v.into();
2580 self
2581 }
2582
2583 /// Sets all the options, replacing any prior values.
2584 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2585 self.0.options = v.into();
2586 self
2587 }
2588
2589 /// Sends the request.
2590 pub async fn send(self) -> Result<crate::model::ReferenceList> {
2591 (*self.0.stub)
2592 .get_reference_list(self.0.request, self.0.options)
2593 .await
2594 .map(crate::Response::into_body)
2595 }
2596
2597 /// Sets the value of [name][crate::model::GetReferenceListRequest::name].
2598 ///
2599 /// This is a **required** field for requests.
2600 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2601 self.0.request.name = v.into();
2602 self
2603 }
2604
2605 /// Sets the value of [view][crate::model::GetReferenceListRequest::view].
2606 pub fn set_view<T: Into<crate::model::ReferenceListView>>(mut self, v: T) -> Self {
2607 self.0.request.view = v.into();
2608 self
2609 }
2610 }
2611
2612 #[doc(hidden)]
2613 impl crate::RequestBuilder for GetReferenceList {
2614 fn request_options(&mut self) -> &mut crate::RequestOptions {
2615 &mut self.0.options
2616 }
2617 }
2618
2619 /// The request builder for [ReferenceListService::list_reference_lists][crate::client::ReferenceListService::list_reference_lists] calls.
2620 ///
2621 /// # Example
2622 /// ```
2623 /// # use google_cloud_chronicle_v1::builder::reference_list_service::ListReferenceLists;
2624 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2625 /// use google_cloud_gax::paginator::ItemPaginator;
2626 ///
2627 /// let builder = prepare_request_builder();
2628 /// let mut items = builder.by_item();
2629 /// while let Some(result) = items.next().await {
2630 /// let item = result?;
2631 /// }
2632 /// # Ok(()) }
2633 ///
2634 /// fn prepare_request_builder() -> ListReferenceLists {
2635 /// # panic!();
2636 /// // ... details omitted ...
2637 /// }
2638 /// ```
2639 #[derive(Clone, Debug)]
2640 pub struct ListReferenceLists(RequestBuilder<crate::model::ListReferenceListsRequest>);
2641
2642 impl ListReferenceLists {
2643 pub(crate) fn new(
2644 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
2645 ) -> Self {
2646 Self(RequestBuilder::new(stub))
2647 }
2648
2649 /// Sets the full request, replacing any prior values.
2650 pub fn with_request<V: Into<crate::model::ListReferenceListsRequest>>(
2651 mut self,
2652 v: V,
2653 ) -> Self {
2654 self.0.request = v.into();
2655 self
2656 }
2657
2658 /// Sets all the options, replacing any prior values.
2659 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2660 self.0.options = v.into();
2661 self
2662 }
2663
2664 /// Sends the request.
2665 pub async fn send(self) -> Result<crate::model::ListReferenceListsResponse> {
2666 (*self.0.stub)
2667 .list_reference_lists(self.0.request, self.0.options)
2668 .await
2669 .map(crate::Response::into_body)
2670 }
2671
2672 /// Streams each page in the collection.
2673 pub fn by_page(
2674 self,
2675 ) -> impl google_cloud_gax::paginator::Paginator<
2676 crate::model::ListReferenceListsResponse,
2677 crate::Error,
2678 > {
2679 use std::clone::Clone;
2680 let token = self.0.request.page_token.clone();
2681 let execute = move |token: String| {
2682 let mut builder = self.clone();
2683 builder.0.request = builder.0.request.set_page_token(token);
2684 builder.send()
2685 };
2686 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2687 }
2688
2689 /// Streams each item in the collection.
2690 pub fn by_item(
2691 self,
2692 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2693 crate::model::ListReferenceListsResponse,
2694 crate::Error,
2695 > {
2696 use google_cloud_gax::paginator::Paginator;
2697 self.by_page().items()
2698 }
2699
2700 /// Sets the value of [parent][crate::model::ListReferenceListsRequest::parent].
2701 ///
2702 /// This is a **required** field for requests.
2703 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2704 self.0.request.parent = v.into();
2705 self
2706 }
2707
2708 /// Sets the value of [page_size][crate::model::ListReferenceListsRequest::page_size].
2709 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2710 self.0.request.page_size = v.into();
2711 self
2712 }
2713
2714 /// Sets the value of [page_token][crate::model::ListReferenceListsRequest::page_token].
2715 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2716 self.0.request.page_token = v.into();
2717 self
2718 }
2719
2720 /// Sets the value of [view][crate::model::ListReferenceListsRequest::view].
2721 pub fn set_view<T: Into<crate::model::ReferenceListView>>(mut self, v: T) -> Self {
2722 self.0.request.view = v.into();
2723 self
2724 }
2725 }
2726
2727 #[doc(hidden)]
2728 impl crate::RequestBuilder for ListReferenceLists {
2729 fn request_options(&mut self) -> &mut crate::RequestOptions {
2730 &mut self.0.options
2731 }
2732 }
2733
2734 /// The request builder for [ReferenceListService::create_reference_list][crate::client::ReferenceListService::create_reference_list] calls.
2735 ///
2736 /// # Example
2737 /// ```
2738 /// # use google_cloud_chronicle_v1::builder::reference_list_service::CreateReferenceList;
2739 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2740 ///
2741 /// let builder = prepare_request_builder();
2742 /// let response = builder.send().await?;
2743 /// # Ok(()) }
2744 ///
2745 /// fn prepare_request_builder() -> CreateReferenceList {
2746 /// # panic!();
2747 /// // ... details omitted ...
2748 /// }
2749 /// ```
2750 #[derive(Clone, Debug)]
2751 pub struct CreateReferenceList(RequestBuilder<crate::model::CreateReferenceListRequest>);
2752
2753 impl CreateReferenceList {
2754 pub(crate) fn new(
2755 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
2756 ) -> Self {
2757 Self(RequestBuilder::new(stub))
2758 }
2759
2760 /// Sets the full request, replacing any prior values.
2761 pub fn with_request<V: Into<crate::model::CreateReferenceListRequest>>(
2762 mut self,
2763 v: V,
2764 ) -> Self {
2765 self.0.request = v.into();
2766 self
2767 }
2768
2769 /// Sets all the options, replacing any prior values.
2770 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2771 self.0.options = v.into();
2772 self
2773 }
2774
2775 /// Sends the request.
2776 pub async fn send(self) -> Result<crate::model::ReferenceList> {
2777 (*self.0.stub)
2778 .create_reference_list(self.0.request, self.0.options)
2779 .await
2780 .map(crate::Response::into_body)
2781 }
2782
2783 /// Sets the value of [parent][crate::model::CreateReferenceListRequest::parent].
2784 ///
2785 /// This is a **required** field for requests.
2786 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2787 self.0.request.parent = v.into();
2788 self
2789 }
2790
2791 /// Sets the value of [reference_list][crate::model::CreateReferenceListRequest::reference_list].
2792 ///
2793 /// This is a **required** field for requests.
2794 pub fn set_reference_list<T>(mut self, v: T) -> Self
2795 where
2796 T: std::convert::Into<crate::model::ReferenceList>,
2797 {
2798 self.0.request.reference_list = std::option::Option::Some(v.into());
2799 self
2800 }
2801
2802 /// Sets or clears the value of [reference_list][crate::model::CreateReferenceListRequest::reference_list].
2803 ///
2804 /// This is a **required** field for requests.
2805 pub fn set_or_clear_reference_list<T>(mut self, v: std::option::Option<T>) -> Self
2806 where
2807 T: std::convert::Into<crate::model::ReferenceList>,
2808 {
2809 self.0.request.reference_list = v.map(|x| x.into());
2810 self
2811 }
2812
2813 /// Sets the value of [reference_list_id][crate::model::CreateReferenceListRequest::reference_list_id].
2814 ///
2815 /// This is a **required** field for requests.
2816 pub fn set_reference_list_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2817 self.0.request.reference_list_id = v.into();
2818 self
2819 }
2820 }
2821
2822 #[doc(hidden)]
2823 impl crate::RequestBuilder for CreateReferenceList {
2824 fn request_options(&mut self) -> &mut crate::RequestOptions {
2825 &mut self.0.options
2826 }
2827 }
2828
2829 /// The request builder for [ReferenceListService::update_reference_list][crate::client::ReferenceListService::update_reference_list] calls.
2830 ///
2831 /// # Example
2832 /// ```
2833 /// # use google_cloud_chronicle_v1::builder::reference_list_service::UpdateReferenceList;
2834 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2835 ///
2836 /// let builder = prepare_request_builder();
2837 /// let response = builder.send().await?;
2838 /// # Ok(()) }
2839 ///
2840 /// fn prepare_request_builder() -> UpdateReferenceList {
2841 /// # panic!();
2842 /// // ... details omitted ...
2843 /// }
2844 /// ```
2845 #[derive(Clone, Debug)]
2846 pub struct UpdateReferenceList(RequestBuilder<crate::model::UpdateReferenceListRequest>);
2847
2848 impl UpdateReferenceList {
2849 pub(crate) fn new(
2850 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
2851 ) -> Self {
2852 Self(RequestBuilder::new(stub))
2853 }
2854
2855 /// Sets the full request, replacing any prior values.
2856 pub fn with_request<V: Into<crate::model::UpdateReferenceListRequest>>(
2857 mut self,
2858 v: V,
2859 ) -> Self {
2860 self.0.request = v.into();
2861 self
2862 }
2863
2864 /// Sets all the options, replacing any prior values.
2865 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2866 self.0.options = v.into();
2867 self
2868 }
2869
2870 /// Sends the request.
2871 pub async fn send(self) -> Result<crate::model::ReferenceList> {
2872 (*self.0.stub)
2873 .update_reference_list(self.0.request, self.0.options)
2874 .await
2875 .map(crate::Response::into_body)
2876 }
2877
2878 /// Sets the value of [reference_list][crate::model::UpdateReferenceListRequest::reference_list].
2879 ///
2880 /// This is a **required** field for requests.
2881 pub fn set_reference_list<T>(mut self, v: T) -> Self
2882 where
2883 T: std::convert::Into<crate::model::ReferenceList>,
2884 {
2885 self.0.request.reference_list = std::option::Option::Some(v.into());
2886 self
2887 }
2888
2889 /// Sets or clears the value of [reference_list][crate::model::UpdateReferenceListRequest::reference_list].
2890 ///
2891 /// This is a **required** field for requests.
2892 pub fn set_or_clear_reference_list<T>(mut self, v: std::option::Option<T>) -> Self
2893 where
2894 T: std::convert::Into<crate::model::ReferenceList>,
2895 {
2896 self.0.request.reference_list = v.map(|x| x.into());
2897 self
2898 }
2899
2900 /// Sets the value of [update_mask][crate::model::UpdateReferenceListRequest::update_mask].
2901 pub fn set_update_mask<T>(mut self, v: T) -> Self
2902 where
2903 T: std::convert::Into<wkt::FieldMask>,
2904 {
2905 self.0.request.update_mask = std::option::Option::Some(v.into());
2906 self
2907 }
2908
2909 /// Sets or clears the value of [update_mask][crate::model::UpdateReferenceListRequest::update_mask].
2910 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2911 where
2912 T: std::convert::Into<wkt::FieldMask>,
2913 {
2914 self.0.request.update_mask = v.map(|x| x.into());
2915 self
2916 }
2917 }
2918
2919 #[doc(hidden)]
2920 impl crate::RequestBuilder for UpdateReferenceList {
2921 fn request_options(&mut self) -> &mut crate::RequestOptions {
2922 &mut self.0.options
2923 }
2924 }
2925
2926 /// The request builder for [ReferenceListService::list_operations][crate::client::ReferenceListService::list_operations] calls.
2927 ///
2928 /// # Example
2929 /// ```
2930 /// # use google_cloud_chronicle_v1::builder::reference_list_service::ListOperations;
2931 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2932 /// use google_cloud_gax::paginator::ItemPaginator;
2933 ///
2934 /// let builder = prepare_request_builder();
2935 /// let mut items = builder.by_item();
2936 /// while let Some(result) = items.next().await {
2937 /// let item = result?;
2938 /// }
2939 /// # Ok(()) }
2940 ///
2941 /// fn prepare_request_builder() -> ListOperations {
2942 /// # panic!();
2943 /// // ... details omitted ...
2944 /// }
2945 /// ```
2946 #[derive(Clone, Debug)]
2947 pub struct ListOperations(
2948 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2949 );
2950
2951 impl ListOperations {
2952 pub(crate) fn new(
2953 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
2954 ) -> Self {
2955 Self(RequestBuilder::new(stub))
2956 }
2957
2958 /// Sets the full request, replacing any prior values.
2959 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2960 mut self,
2961 v: V,
2962 ) -> Self {
2963 self.0.request = v.into();
2964 self
2965 }
2966
2967 /// Sets all the options, replacing any prior values.
2968 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2969 self.0.options = v.into();
2970 self
2971 }
2972
2973 /// Sends the request.
2974 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2975 (*self.0.stub)
2976 .list_operations(self.0.request, self.0.options)
2977 .await
2978 .map(crate::Response::into_body)
2979 }
2980
2981 /// Streams each page in the collection.
2982 pub fn by_page(
2983 self,
2984 ) -> impl google_cloud_gax::paginator::Paginator<
2985 google_cloud_longrunning::model::ListOperationsResponse,
2986 crate::Error,
2987 > {
2988 use std::clone::Clone;
2989 let token = self.0.request.page_token.clone();
2990 let execute = move |token: String| {
2991 let mut builder = self.clone();
2992 builder.0.request = builder.0.request.set_page_token(token);
2993 builder.send()
2994 };
2995 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2996 }
2997
2998 /// Streams each item in the collection.
2999 pub fn by_item(
3000 self,
3001 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3002 google_cloud_longrunning::model::ListOperationsResponse,
3003 crate::Error,
3004 > {
3005 use google_cloud_gax::paginator::Paginator;
3006 self.by_page().items()
3007 }
3008
3009 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3010 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3011 self.0.request.name = v.into();
3012 self
3013 }
3014
3015 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3016 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3017 self.0.request.filter = v.into();
3018 self
3019 }
3020
3021 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3022 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3023 self.0.request.page_size = v.into();
3024 self
3025 }
3026
3027 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3028 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3029 self.0.request.page_token = v.into();
3030 self
3031 }
3032
3033 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3034 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3035 self.0.request.return_partial_success = v.into();
3036 self
3037 }
3038 }
3039
3040 #[doc(hidden)]
3041 impl crate::RequestBuilder for ListOperations {
3042 fn request_options(&mut self) -> &mut crate::RequestOptions {
3043 &mut self.0.options
3044 }
3045 }
3046
3047 /// The request builder for [ReferenceListService::get_operation][crate::client::ReferenceListService::get_operation] calls.
3048 ///
3049 /// # Example
3050 /// ```
3051 /// # use google_cloud_chronicle_v1::builder::reference_list_service::GetOperation;
3052 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3053 ///
3054 /// let builder = prepare_request_builder();
3055 /// let response = builder.send().await?;
3056 /// # Ok(()) }
3057 ///
3058 /// fn prepare_request_builder() -> GetOperation {
3059 /// # panic!();
3060 /// // ... details omitted ...
3061 /// }
3062 /// ```
3063 #[derive(Clone, Debug)]
3064 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3065
3066 impl GetOperation {
3067 pub(crate) fn new(
3068 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
3069 ) -> Self {
3070 Self(RequestBuilder::new(stub))
3071 }
3072
3073 /// Sets the full request, replacing any prior values.
3074 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3075 mut self,
3076 v: V,
3077 ) -> Self {
3078 self.0.request = v.into();
3079 self
3080 }
3081
3082 /// Sets all the options, replacing any prior values.
3083 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3084 self.0.options = v.into();
3085 self
3086 }
3087
3088 /// Sends the request.
3089 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3090 (*self.0.stub)
3091 .get_operation(self.0.request, self.0.options)
3092 .await
3093 .map(crate::Response::into_body)
3094 }
3095
3096 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3097 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3098 self.0.request.name = v.into();
3099 self
3100 }
3101 }
3102
3103 #[doc(hidden)]
3104 impl crate::RequestBuilder for GetOperation {
3105 fn request_options(&mut self) -> &mut crate::RequestOptions {
3106 &mut self.0.options
3107 }
3108 }
3109
3110 /// The request builder for [ReferenceListService::delete_operation][crate::client::ReferenceListService::delete_operation] calls.
3111 ///
3112 /// # Example
3113 /// ```
3114 /// # use google_cloud_chronicle_v1::builder::reference_list_service::DeleteOperation;
3115 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3116 ///
3117 /// let builder = prepare_request_builder();
3118 /// let response = builder.send().await?;
3119 /// # Ok(()) }
3120 ///
3121 /// fn prepare_request_builder() -> DeleteOperation {
3122 /// # panic!();
3123 /// // ... details omitted ...
3124 /// }
3125 /// ```
3126 #[derive(Clone, Debug)]
3127 pub struct DeleteOperation(
3128 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3129 );
3130
3131 impl DeleteOperation {
3132 pub(crate) fn new(
3133 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
3134 ) -> Self {
3135 Self(RequestBuilder::new(stub))
3136 }
3137
3138 /// Sets the full request, replacing any prior values.
3139 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3140 mut self,
3141 v: V,
3142 ) -> Self {
3143 self.0.request = v.into();
3144 self
3145 }
3146
3147 /// Sets all the options, replacing any prior values.
3148 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3149 self.0.options = v.into();
3150 self
3151 }
3152
3153 /// Sends the request.
3154 pub async fn send(self) -> Result<()> {
3155 (*self.0.stub)
3156 .delete_operation(self.0.request, self.0.options)
3157 .await
3158 .map(crate::Response::into_body)
3159 }
3160
3161 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3162 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3163 self.0.request.name = v.into();
3164 self
3165 }
3166 }
3167
3168 #[doc(hidden)]
3169 impl crate::RequestBuilder for DeleteOperation {
3170 fn request_options(&mut self) -> &mut crate::RequestOptions {
3171 &mut self.0.options
3172 }
3173 }
3174
3175 /// The request builder for [ReferenceListService::cancel_operation][crate::client::ReferenceListService::cancel_operation] calls.
3176 ///
3177 /// # Example
3178 /// ```
3179 /// # use google_cloud_chronicle_v1::builder::reference_list_service::CancelOperation;
3180 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3181 ///
3182 /// let builder = prepare_request_builder();
3183 /// let response = builder.send().await?;
3184 /// # Ok(()) }
3185 ///
3186 /// fn prepare_request_builder() -> CancelOperation {
3187 /// # panic!();
3188 /// // ... details omitted ...
3189 /// }
3190 /// ```
3191 #[derive(Clone, Debug)]
3192 pub struct CancelOperation(
3193 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3194 );
3195
3196 impl CancelOperation {
3197 pub(crate) fn new(
3198 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
3199 ) -> Self {
3200 Self(RequestBuilder::new(stub))
3201 }
3202
3203 /// Sets the full request, replacing any prior values.
3204 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3205 mut self,
3206 v: V,
3207 ) -> Self {
3208 self.0.request = v.into();
3209 self
3210 }
3211
3212 /// Sets all the options, replacing any prior values.
3213 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3214 self.0.options = v.into();
3215 self
3216 }
3217
3218 /// Sends the request.
3219 pub async fn send(self) -> Result<()> {
3220 (*self.0.stub)
3221 .cancel_operation(self.0.request, self.0.options)
3222 .await
3223 .map(crate::Response::into_body)
3224 }
3225
3226 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3227 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3228 self.0.request.name = v.into();
3229 self
3230 }
3231 }
3232
3233 #[doc(hidden)]
3234 impl crate::RequestBuilder for CancelOperation {
3235 fn request_options(&mut self) -> &mut crate::RequestOptions {
3236 &mut self.0.options
3237 }
3238 }
3239}
3240
3241pub mod rule_service {
3242 use crate::Result;
3243
3244 /// A builder for [RuleService][crate::client::RuleService].
3245 ///
3246 /// ```
3247 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3248 /// # use google_cloud_chronicle_v1::*;
3249 /// # use builder::rule_service::ClientBuilder;
3250 /// # use client::RuleService;
3251 /// let builder : ClientBuilder = RuleService::builder();
3252 /// let client = builder
3253 /// .with_endpoint("https://chronicle.googleapis.com")
3254 /// .build().await?;
3255 /// # Ok(()) }
3256 /// ```
3257 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3258
3259 pub(crate) mod client {
3260 use super::super::super::client::RuleService;
3261 pub struct Factory;
3262 impl crate::ClientFactory for Factory {
3263 type Client = RuleService;
3264 type Credentials = gaxi::options::Credentials;
3265 async fn build(
3266 self,
3267 config: gaxi::options::ClientConfig,
3268 ) -> crate::ClientBuilderResult<Self::Client> {
3269 Self::Client::new(config).await
3270 }
3271 }
3272 }
3273
3274 /// Common implementation for [crate::client::RuleService] request builders.
3275 #[derive(Clone, Debug)]
3276 pub(crate) struct RequestBuilder<R: std::default::Default> {
3277 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3278 request: R,
3279 options: crate::RequestOptions,
3280 }
3281
3282 impl<R> RequestBuilder<R>
3283 where
3284 R: std::default::Default,
3285 {
3286 pub(crate) fn new(
3287 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3288 ) -> Self {
3289 Self {
3290 stub,
3291 request: R::default(),
3292 options: crate::RequestOptions::default(),
3293 }
3294 }
3295 }
3296
3297 /// The request builder for [RuleService::create_rule][crate::client::RuleService::create_rule] calls.
3298 ///
3299 /// # Example
3300 /// ```
3301 /// # use google_cloud_chronicle_v1::builder::rule_service::CreateRule;
3302 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3303 ///
3304 /// let builder = prepare_request_builder();
3305 /// let response = builder.send().await?;
3306 /// # Ok(()) }
3307 ///
3308 /// fn prepare_request_builder() -> CreateRule {
3309 /// # panic!();
3310 /// // ... details omitted ...
3311 /// }
3312 /// ```
3313 #[derive(Clone, Debug)]
3314 pub struct CreateRule(RequestBuilder<crate::model::CreateRuleRequest>);
3315
3316 impl CreateRule {
3317 pub(crate) fn new(
3318 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3319 ) -> Self {
3320 Self(RequestBuilder::new(stub))
3321 }
3322
3323 /// Sets the full request, replacing any prior values.
3324 pub fn with_request<V: Into<crate::model::CreateRuleRequest>>(mut self, v: V) -> Self {
3325 self.0.request = v.into();
3326 self
3327 }
3328
3329 /// Sets all the options, replacing any prior values.
3330 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3331 self.0.options = v.into();
3332 self
3333 }
3334
3335 /// Sends the request.
3336 pub async fn send(self) -> Result<crate::model::Rule> {
3337 (*self.0.stub)
3338 .create_rule(self.0.request, self.0.options)
3339 .await
3340 .map(crate::Response::into_body)
3341 }
3342
3343 /// Sets the value of [parent][crate::model::CreateRuleRequest::parent].
3344 ///
3345 /// This is a **required** field for requests.
3346 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3347 self.0.request.parent = v.into();
3348 self
3349 }
3350
3351 /// Sets the value of [rule][crate::model::CreateRuleRequest::rule].
3352 ///
3353 /// This is a **required** field for requests.
3354 pub fn set_rule<T>(mut self, v: T) -> Self
3355 where
3356 T: std::convert::Into<crate::model::Rule>,
3357 {
3358 self.0.request.rule = std::option::Option::Some(v.into());
3359 self
3360 }
3361
3362 /// Sets or clears the value of [rule][crate::model::CreateRuleRequest::rule].
3363 ///
3364 /// This is a **required** field for requests.
3365 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3366 where
3367 T: std::convert::Into<crate::model::Rule>,
3368 {
3369 self.0.request.rule = v.map(|x| x.into());
3370 self
3371 }
3372 }
3373
3374 #[doc(hidden)]
3375 impl crate::RequestBuilder for CreateRule {
3376 fn request_options(&mut self) -> &mut crate::RequestOptions {
3377 &mut self.0.options
3378 }
3379 }
3380
3381 /// The request builder for [RuleService::get_rule][crate::client::RuleService::get_rule] calls.
3382 ///
3383 /// # Example
3384 /// ```
3385 /// # use google_cloud_chronicle_v1::builder::rule_service::GetRule;
3386 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3387 ///
3388 /// let builder = prepare_request_builder();
3389 /// let response = builder.send().await?;
3390 /// # Ok(()) }
3391 ///
3392 /// fn prepare_request_builder() -> GetRule {
3393 /// # panic!();
3394 /// // ... details omitted ...
3395 /// }
3396 /// ```
3397 #[derive(Clone, Debug)]
3398 pub struct GetRule(RequestBuilder<crate::model::GetRuleRequest>);
3399
3400 impl GetRule {
3401 pub(crate) fn new(
3402 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3403 ) -> Self {
3404 Self(RequestBuilder::new(stub))
3405 }
3406
3407 /// Sets the full request, replacing any prior values.
3408 pub fn with_request<V: Into<crate::model::GetRuleRequest>>(mut self, v: V) -> Self {
3409 self.0.request = v.into();
3410 self
3411 }
3412
3413 /// Sets all the options, replacing any prior values.
3414 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3415 self.0.options = v.into();
3416 self
3417 }
3418
3419 /// Sends the request.
3420 pub async fn send(self) -> Result<crate::model::Rule> {
3421 (*self.0.stub)
3422 .get_rule(self.0.request, self.0.options)
3423 .await
3424 .map(crate::Response::into_body)
3425 }
3426
3427 /// Sets the value of [name][crate::model::GetRuleRequest::name].
3428 ///
3429 /// This is a **required** field for requests.
3430 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3431 self.0.request.name = v.into();
3432 self
3433 }
3434
3435 /// Sets the value of [view][crate::model::GetRuleRequest::view].
3436 pub fn set_view<T: Into<crate::model::RuleView>>(mut self, v: T) -> Self {
3437 self.0.request.view = v.into();
3438 self
3439 }
3440 }
3441
3442 #[doc(hidden)]
3443 impl crate::RequestBuilder for GetRule {
3444 fn request_options(&mut self) -> &mut crate::RequestOptions {
3445 &mut self.0.options
3446 }
3447 }
3448
3449 /// The request builder for [RuleService::list_rules][crate::client::RuleService::list_rules] calls.
3450 ///
3451 /// # Example
3452 /// ```
3453 /// # use google_cloud_chronicle_v1::builder::rule_service::ListRules;
3454 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3455 /// use google_cloud_gax::paginator::ItemPaginator;
3456 ///
3457 /// let builder = prepare_request_builder();
3458 /// let mut items = builder.by_item();
3459 /// while let Some(result) = items.next().await {
3460 /// let item = result?;
3461 /// }
3462 /// # Ok(()) }
3463 ///
3464 /// fn prepare_request_builder() -> ListRules {
3465 /// # panic!();
3466 /// // ... details omitted ...
3467 /// }
3468 /// ```
3469 #[derive(Clone, Debug)]
3470 pub struct ListRules(RequestBuilder<crate::model::ListRulesRequest>);
3471
3472 impl ListRules {
3473 pub(crate) fn new(
3474 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3475 ) -> Self {
3476 Self(RequestBuilder::new(stub))
3477 }
3478
3479 /// Sets the full request, replacing any prior values.
3480 pub fn with_request<V: Into<crate::model::ListRulesRequest>>(mut self, v: V) -> Self {
3481 self.0.request = v.into();
3482 self
3483 }
3484
3485 /// Sets all the options, replacing any prior values.
3486 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3487 self.0.options = v.into();
3488 self
3489 }
3490
3491 /// Sends the request.
3492 pub async fn send(self) -> Result<crate::model::ListRulesResponse> {
3493 (*self.0.stub)
3494 .list_rules(self.0.request, self.0.options)
3495 .await
3496 .map(crate::Response::into_body)
3497 }
3498
3499 /// Streams each page in the collection.
3500 pub fn by_page(
3501 self,
3502 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListRulesResponse, crate::Error>
3503 {
3504 use std::clone::Clone;
3505 let token = self.0.request.page_token.clone();
3506 let execute = move |token: String| {
3507 let mut builder = self.clone();
3508 builder.0.request = builder.0.request.set_page_token(token);
3509 builder.send()
3510 };
3511 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3512 }
3513
3514 /// Streams each item in the collection.
3515 pub fn by_item(
3516 self,
3517 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListRulesResponse, crate::Error>
3518 {
3519 use google_cloud_gax::paginator::Paginator;
3520 self.by_page().items()
3521 }
3522
3523 /// Sets the value of [parent][crate::model::ListRulesRequest::parent].
3524 ///
3525 /// This is a **required** field for requests.
3526 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3527 self.0.request.parent = v.into();
3528 self
3529 }
3530
3531 /// Sets the value of [page_size][crate::model::ListRulesRequest::page_size].
3532 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3533 self.0.request.page_size = v.into();
3534 self
3535 }
3536
3537 /// Sets the value of [page_token][crate::model::ListRulesRequest::page_token].
3538 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3539 self.0.request.page_token = v.into();
3540 self
3541 }
3542
3543 /// Sets the value of [view][crate::model::ListRulesRequest::view].
3544 pub fn set_view<T: Into<crate::model::RuleView>>(mut self, v: T) -> Self {
3545 self.0.request.view = v.into();
3546 self
3547 }
3548
3549 /// Sets the value of [filter][crate::model::ListRulesRequest::filter].
3550 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3551 self.0.request.filter = v.into();
3552 self
3553 }
3554 }
3555
3556 #[doc(hidden)]
3557 impl crate::RequestBuilder for ListRules {
3558 fn request_options(&mut self) -> &mut crate::RequestOptions {
3559 &mut self.0.options
3560 }
3561 }
3562
3563 /// The request builder for [RuleService::update_rule][crate::client::RuleService::update_rule] calls.
3564 ///
3565 /// # Example
3566 /// ```
3567 /// # use google_cloud_chronicle_v1::builder::rule_service::UpdateRule;
3568 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3569 ///
3570 /// let builder = prepare_request_builder();
3571 /// let response = builder.send().await?;
3572 /// # Ok(()) }
3573 ///
3574 /// fn prepare_request_builder() -> UpdateRule {
3575 /// # panic!();
3576 /// // ... details omitted ...
3577 /// }
3578 /// ```
3579 #[derive(Clone, Debug)]
3580 pub struct UpdateRule(RequestBuilder<crate::model::UpdateRuleRequest>);
3581
3582 impl UpdateRule {
3583 pub(crate) fn new(
3584 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3585 ) -> Self {
3586 Self(RequestBuilder::new(stub))
3587 }
3588
3589 /// Sets the full request, replacing any prior values.
3590 pub fn with_request<V: Into<crate::model::UpdateRuleRequest>>(mut self, v: V) -> Self {
3591 self.0.request = v.into();
3592 self
3593 }
3594
3595 /// Sets all the options, replacing any prior values.
3596 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3597 self.0.options = v.into();
3598 self
3599 }
3600
3601 /// Sends the request.
3602 pub async fn send(self) -> Result<crate::model::Rule> {
3603 (*self.0.stub)
3604 .update_rule(self.0.request, self.0.options)
3605 .await
3606 .map(crate::Response::into_body)
3607 }
3608
3609 /// Sets the value of [rule][crate::model::UpdateRuleRequest::rule].
3610 ///
3611 /// This is a **required** field for requests.
3612 pub fn set_rule<T>(mut self, v: T) -> Self
3613 where
3614 T: std::convert::Into<crate::model::Rule>,
3615 {
3616 self.0.request.rule = std::option::Option::Some(v.into());
3617 self
3618 }
3619
3620 /// Sets or clears the value of [rule][crate::model::UpdateRuleRequest::rule].
3621 ///
3622 /// This is a **required** field for requests.
3623 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
3624 where
3625 T: std::convert::Into<crate::model::Rule>,
3626 {
3627 self.0.request.rule = v.map(|x| x.into());
3628 self
3629 }
3630
3631 /// Sets the value of [update_mask][crate::model::UpdateRuleRequest::update_mask].
3632 pub fn set_update_mask<T>(mut self, v: T) -> Self
3633 where
3634 T: std::convert::Into<wkt::FieldMask>,
3635 {
3636 self.0.request.update_mask = std::option::Option::Some(v.into());
3637 self
3638 }
3639
3640 /// Sets or clears the value of [update_mask][crate::model::UpdateRuleRequest::update_mask].
3641 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3642 where
3643 T: std::convert::Into<wkt::FieldMask>,
3644 {
3645 self.0.request.update_mask = v.map(|x| x.into());
3646 self
3647 }
3648 }
3649
3650 #[doc(hidden)]
3651 impl crate::RequestBuilder for UpdateRule {
3652 fn request_options(&mut self) -> &mut crate::RequestOptions {
3653 &mut self.0.options
3654 }
3655 }
3656
3657 /// The request builder for [RuleService::delete_rule][crate::client::RuleService::delete_rule] calls.
3658 ///
3659 /// # Example
3660 /// ```
3661 /// # use google_cloud_chronicle_v1::builder::rule_service::DeleteRule;
3662 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3663 ///
3664 /// let builder = prepare_request_builder();
3665 /// let response = builder.send().await?;
3666 /// # Ok(()) }
3667 ///
3668 /// fn prepare_request_builder() -> DeleteRule {
3669 /// # panic!();
3670 /// // ... details omitted ...
3671 /// }
3672 /// ```
3673 #[derive(Clone, Debug)]
3674 pub struct DeleteRule(RequestBuilder<crate::model::DeleteRuleRequest>);
3675
3676 impl DeleteRule {
3677 pub(crate) fn new(
3678 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3679 ) -> Self {
3680 Self(RequestBuilder::new(stub))
3681 }
3682
3683 /// Sets the full request, replacing any prior values.
3684 pub fn with_request<V: Into<crate::model::DeleteRuleRequest>>(mut self, v: V) -> Self {
3685 self.0.request = v.into();
3686 self
3687 }
3688
3689 /// Sets all the options, replacing any prior values.
3690 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3691 self.0.options = v.into();
3692 self
3693 }
3694
3695 /// Sends the request.
3696 pub async fn send(self) -> Result<()> {
3697 (*self.0.stub)
3698 .delete_rule(self.0.request, self.0.options)
3699 .await
3700 .map(crate::Response::into_body)
3701 }
3702
3703 /// Sets the value of [name][crate::model::DeleteRuleRequest::name].
3704 ///
3705 /// This is a **required** field for requests.
3706 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3707 self.0.request.name = v.into();
3708 self
3709 }
3710
3711 /// Sets the value of [force][crate::model::DeleteRuleRequest::force].
3712 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3713 self.0.request.force = v.into();
3714 self
3715 }
3716 }
3717
3718 #[doc(hidden)]
3719 impl crate::RequestBuilder for DeleteRule {
3720 fn request_options(&mut self) -> &mut crate::RequestOptions {
3721 &mut self.0.options
3722 }
3723 }
3724
3725 /// The request builder for [RuleService::list_rule_revisions][crate::client::RuleService::list_rule_revisions] calls.
3726 ///
3727 /// # Example
3728 /// ```
3729 /// # use google_cloud_chronicle_v1::builder::rule_service::ListRuleRevisions;
3730 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3731 /// use google_cloud_gax::paginator::ItemPaginator;
3732 ///
3733 /// let builder = prepare_request_builder();
3734 /// let mut items = builder.by_item();
3735 /// while let Some(result) = items.next().await {
3736 /// let item = result?;
3737 /// }
3738 /// # Ok(()) }
3739 ///
3740 /// fn prepare_request_builder() -> ListRuleRevisions {
3741 /// # panic!();
3742 /// // ... details omitted ...
3743 /// }
3744 /// ```
3745 #[derive(Clone, Debug)]
3746 pub struct ListRuleRevisions(RequestBuilder<crate::model::ListRuleRevisionsRequest>);
3747
3748 impl ListRuleRevisions {
3749 pub(crate) fn new(
3750 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3751 ) -> Self {
3752 Self(RequestBuilder::new(stub))
3753 }
3754
3755 /// Sets the full request, replacing any prior values.
3756 pub fn with_request<V: Into<crate::model::ListRuleRevisionsRequest>>(
3757 mut self,
3758 v: V,
3759 ) -> Self {
3760 self.0.request = v.into();
3761 self
3762 }
3763
3764 /// Sets all the options, replacing any prior values.
3765 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3766 self.0.options = v.into();
3767 self
3768 }
3769
3770 /// Sends the request.
3771 pub async fn send(self) -> Result<crate::model::ListRuleRevisionsResponse> {
3772 (*self.0.stub)
3773 .list_rule_revisions(self.0.request, self.0.options)
3774 .await
3775 .map(crate::Response::into_body)
3776 }
3777
3778 /// Streams each page in the collection.
3779 pub fn by_page(
3780 self,
3781 ) -> impl google_cloud_gax::paginator::Paginator<
3782 crate::model::ListRuleRevisionsResponse,
3783 crate::Error,
3784 > {
3785 use std::clone::Clone;
3786 let token = self.0.request.page_token.clone();
3787 let execute = move |token: String| {
3788 let mut builder = self.clone();
3789 builder.0.request = builder.0.request.set_page_token(token);
3790 builder.send()
3791 };
3792 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3793 }
3794
3795 /// Streams each item in the collection.
3796 pub fn by_item(
3797 self,
3798 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3799 crate::model::ListRuleRevisionsResponse,
3800 crate::Error,
3801 > {
3802 use google_cloud_gax::paginator::Paginator;
3803 self.by_page().items()
3804 }
3805
3806 /// Sets the value of [name][crate::model::ListRuleRevisionsRequest::name].
3807 ///
3808 /// This is a **required** field for requests.
3809 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3810 self.0.request.name = v.into();
3811 self
3812 }
3813
3814 /// Sets the value of [page_size][crate::model::ListRuleRevisionsRequest::page_size].
3815 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3816 self.0.request.page_size = v.into();
3817 self
3818 }
3819
3820 /// Sets the value of [page_token][crate::model::ListRuleRevisionsRequest::page_token].
3821 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3822 self.0.request.page_token = v.into();
3823 self
3824 }
3825
3826 /// Sets the value of [view][crate::model::ListRuleRevisionsRequest::view].
3827 pub fn set_view<T: Into<crate::model::RuleView>>(mut self, v: T) -> Self {
3828 self.0.request.view = v.into();
3829 self
3830 }
3831 }
3832
3833 #[doc(hidden)]
3834 impl crate::RequestBuilder for ListRuleRevisions {
3835 fn request_options(&mut self) -> &mut crate::RequestOptions {
3836 &mut self.0.options
3837 }
3838 }
3839
3840 /// The request builder for [RuleService::create_retrohunt][crate::client::RuleService::create_retrohunt] calls.
3841 ///
3842 /// # Example
3843 /// ```
3844 /// # use google_cloud_chronicle_v1::builder::rule_service::CreateRetrohunt;
3845 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3846 /// use google_cloud_lro::Poller;
3847 ///
3848 /// let builder = prepare_request_builder();
3849 /// let response = builder.poller().until_done().await?;
3850 /// # Ok(()) }
3851 ///
3852 /// fn prepare_request_builder() -> CreateRetrohunt {
3853 /// # panic!();
3854 /// // ... details omitted ...
3855 /// }
3856 /// ```
3857 #[derive(Clone, Debug)]
3858 pub struct CreateRetrohunt(RequestBuilder<crate::model::CreateRetrohuntRequest>);
3859
3860 impl CreateRetrohunt {
3861 pub(crate) fn new(
3862 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3863 ) -> Self {
3864 Self(RequestBuilder::new(stub))
3865 }
3866
3867 /// Sets the full request, replacing any prior values.
3868 pub fn with_request<V: Into<crate::model::CreateRetrohuntRequest>>(mut self, v: V) -> Self {
3869 self.0.request = v.into();
3870 self
3871 }
3872
3873 /// Sets all the options, replacing any prior values.
3874 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3875 self.0.options = v.into();
3876 self
3877 }
3878
3879 /// Sends the request.
3880 ///
3881 /// # Long running operations
3882 ///
3883 /// This starts, but does not poll, a longrunning operation. More information
3884 /// on [create_retrohunt][crate::client::RuleService::create_retrohunt].
3885 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3886 (*self.0.stub)
3887 .create_retrohunt(self.0.request, self.0.options)
3888 .await
3889 .map(crate::Response::into_body)
3890 }
3891
3892 /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_retrohunt`.
3893 pub fn poller(
3894 self,
3895 ) -> impl google_cloud_lro::Poller<crate::model::Retrohunt, crate::model::RetrohuntMetadata>
3896 {
3897 type Operation = google_cloud_lro::internal::Operation<
3898 crate::model::Retrohunt,
3899 crate::model::RetrohuntMetadata,
3900 >;
3901 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3902 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3903
3904 let stub = self.0.stub.clone();
3905 let mut options = self.0.options.clone();
3906 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3907 let query = move |name| {
3908 let stub = stub.clone();
3909 let options = options.clone();
3910 async {
3911 let op = GetOperation::new(stub)
3912 .set_name(name)
3913 .with_options(options)
3914 .send()
3915 .await?;
3916 Ok(Operation::new(op))
3917 }
3918 };
3919
3920 let start = move || async {
3921 let op = self.send().await?;
3922 Ok(Operation::new(op))
3923 };
3924
3925 google_cloud_lro::internal::new_poller(
3926 polling_error_policy,
3927 polling_backoff_policy,
3928 start,
3929 query,
3930 )
3931 }
3932
3933 /// Sets the value of [parent][crate::model::CreateRetrohuntRequest::parent].
3934 ///
3935 /// This is a **required** field for requests.
3936 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3937 self.0.request.parent = v.into();
3938 self
3939 }
3940
3941 /// Sets the value of [retrohunt][crate::model::CreateRetrohuntRequest::retrohunt].
3942 ///
3943 /// This is a **required** field for requests.
3944 pub fn set_retrohunt<T>(mut self, v: T) -> Self
3945 where
3946 T: std::convert::Into<crate::model::Retrohunt>,
3947 {
3948 self.0.request.retrohunt = std::option::Option::Some(v.into());
3949 self
3950 }
3951
3952 /// Sets or clears the value of [retrohunt][crate::model::CreateRetrohuntRequest::retrohunt].
3953 ///
3954 /// This is a **required** field for requests.
3955 pub fn set_or_clear_retrohunt<T>(mut self, v: std::option::Option<T>) -> Self
3956 where
3957 T: std::convert::Into<crate::model::Retrohunt>,
3958 {
3959 self.0.request.retrohunt = v.map(|x| x.into());
3960 self
3961 }
3962 }
3963
3964 #[doc(hidden)]
3965 impl crate::RequestBuilder for CreateRetrohunt {
3966 fn request_options(&mut self) -> &mut crate::RequestOptions {
3967 &mut self.0.options
3968 }
3969 }
3970
3971 /// The request builder for [RuleService::get_retrohunt][crate::client::RuleService::get_retrohunt] calls.
3972 ///
3973 /// # Example
3974 /// ```
3975 /// # use google_cloud_chronicle_v1::builder::rule_service::GetRetrohunt;
3976 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3977 ///
3978 /// let builder = prepare_request_builder();
3979 /// let response = builder.send().await?;
3980 /// # Ok(()) }
3981 ///
3982 /// fn prepare_request_builder() -> GetRetrohunt {
3983 /// # panic!();
3984 /// // ... details omitted ...
3985 /// }
3986 /// ```
3987 #[derive(Clone, Debug)]
3988 pub struct GetRetrohunt(RequestBuilder<crate::model::GetRetrohuntRequest>);
3989
3990 impl GetRetrohunt {
3991 pub(crate) fn new(
3992 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
3993 ) -> Self {
3994 Self(RequestBuilder::new(stub))
3995 }
3996
3997 /// Sets the full request, replacing any prior values.
3998 pub fn with_request<V: Into<crate::model::GetRetrohuntRequest>>(mut self, v: V) -> Self {
3999 self.0.request = v.into();
4000 self
4001 }
4002
4003 /// Sets all the options, replacing any prior values.
4004 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4005 self.0.options = v.into();
4006 self
4007 }
4008
4009 /// Sends the request.
4010 pub async fn send(self) -> Result<crate::model::Retrohunt> {
4011 (*self.0.stub)
4012 .get_retrohunt(self.0.request, self.0.options)
4013 .await
4014 .map(crate::Response::into_body)
4015 }
4016
4017 /// Sets the value of [name][crate::model::GetRetrohuntRequest::name].
4018 ///
4019 /// This is a **required** field for requests.
4020 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4021 self.0.request.name = v.into();
4022 self
4023 }
4024 }
4025
4026 #[doc(hidden)]
4027 impl crate::RequestBuilder for GetRetrohunt {
4028 fn request_options(&mut self) -> &mut crate::RequestOptions {
4029 &mut self.0.options
4030 }
4031 }
4032
4033 /// The request builder for [RuleService::list_retrohunts][crate::client::RuleService::list_retrohunts] calls.
4034 ///
4035 /// # Example
4036 /// ```
4037 /// # use google_cloud_chronicle_v1::builder::rule_service::ListRetrohunts;
4038 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4039 /// use google_cloud_gax::paginator::ItemPaginator;
4040 ///
4041 /// let builder = prepare_request_builder();
4042 /// let mut items = builder.by_item();
4043 /// while let Some(result) = items.next().await {
4044 /// let item = result?;
4045 /// }
4046 /// # Ok(()) }
4047 ///
4048 /// fn prepare_request_builder() -> ListRetrohunts {
4049 /// # panic!();
4050 /// // ... details omitted ...
4051 /// }
4052 /// ```
4053 #[derive(Clone, Debug)]
4054 pub struct ListRetrohunts(RequestBuilder<crate::model::ListRetrohuntsRequest>);
4055
4056 impl ListRetrohunts {
4057 pub(crate) fn new(
4058 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4059 ) -> Self {
4060 Self(RequestBuilder::new(stub))
4061 }
4062
4063 /// Sets the full request, replacing any prior values.
4064 pub fn with_request<V: Into<crate::model::ListRetrohuntsRequest>>(mut self, v: V) -> Self {
4065 self.0.request = v.into();
4066 self
4067 }
4068
4069 /// Sets all the options, replacing any prior values.
4070 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4071 self.0.options = v.into();
4072 self
4073 }
4074
4075 /// Sends the request.
4076 pub async fn send(self) -> Result<crate::model::ListRetrohuntsResponse> {
4077 (*self.0.stub)
4078 .list_retrohunts(self.0.request, self.0.options)
4079 .await
4080 .map(crate::Response::into_body)
4081 }
4082
4083 /// Streams each page in the collection.
4084 pub fn by_page(
4085 self,
4086 ) -> impl google_cloud_gax::paginator::Paginator<
4087 crate::model::ListRetrohuntsResponse,
4088 crate::Error,
4089 > {
4090 use std::clone::Clone;
4091 let token = self.0.request.page_token.clone();
4092 let execute = move |token: String| {
4093 let mut builder = self.clone();
4094 builder.0.request = builder.0.request.set_page_token(token);
4095 builder.send()
4096 };
4097 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4098 }
4099
4100 /// Streams each item in the collection.
4101 pub fn by_item(
4102 self,
4103 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4104 crate::model::ListRetrohuntsResponse,
4105 crate::Error,
4106 > {
4107 use google_cloud_gax::paginator::Paginator;
4108 self.by_page().items()
4109 }
4110
4111 /// Sets the value of [parent][crate::model::ListRetrohuntsRequest::parent].
4112 ///
4113 /// This is a **required** field for requests.
4114 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4115 self.0.request.parent = v.into();
4116 self
4117 }
4118
4119 /// Sets the value of [page_size][crate::model::ListRetrohuntsRequest::page_size].
4120 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4121 self.0.request.page_size = v.into();
4122 self
4123 }
4124
4125 /// Sets the value of [page_token][crate::model::ListRetrohuntsRequest::page_token].
4126 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4127 self.0.request.page_token = v.into();
4128 self
4129 }
4130
4131 /// Sets the value of [filter][crate::model::ListRetrohuntsRequest::filter].
4132 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4133 self.0.request.filter = v.into();
4134 self
4135 }
4136 }
4137
4138 #[doc(hidden)]
4139 impl crate::RequestBuilder for ListRetrohunts {
4140 fn request_options(&mut self) -> &mut crate::RequestOptions {
4141 &mut self.0.options
4142 }
4143 }
4144
4145 /// The request builder for [RuleService::get_rule_deployment][crate::client::RuleService::get_rule_deployment] calls.
4146 ///
4147 /// # Example
4148 /// ```
4149 /// # use google_cloud_chronicle_v1::builder::rule_service::GetRuleDeployment;
4150 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4151 ///
4152 /// let builder = prepare_request_builder();
4153 /// let response = builder.send().await?;
4154 /// # Ok(()) }
4155 ///
4156 /// fn prepare_request_builder() -> GetRuleDeployment {
4157 /// # panic!();
4158 /// // ... details omitted ...
4159 /// }
4160 /// ```
4161 #[derive(Clone, Debug)]
4162 pub struct GetRuleDeployment(RequestBuilder<crate::model::GetRuleDeploymentRequest>);
4163
4164 impl GetRuleDeployment {
4165 pub(crate) fn new(
4166 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4167 ) -> Self {
4168 Self(RequestBuilder::new(stub))
4169 }
4170
4171 /// Sets the full request, replacing any prior values.
4172 pub fn with_request<V: Into<crate::model::GetRuleDeploymentRequest>>(
4173 mut self,
4174 v: V,
4175 ) -> Self {
4176 self.0.request = v.into();
4177 self
4178 }
4179
4180 /// Sets all the options, replacing any prior values.
4181 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4182 self.0.options = v.into();
4183 self
4184 }
4185
4186 /// Sends the request.
4187 pub async fn send(self) -> Result<crate::model::RuleDeployment> {
4188 (*self.0.stub)
4189 .get_rule_deployment(self.0.request, self.0.options)
4190 .await
4191 .map(crate::Response::into_body)
4192 }
4193
4194 /// Sets the value of [name][crate::model::GetRuleDeploymentRequest::name].
4195 ///
4196 /// This is a **required** field for requests.
4197 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4198 self.0.request.name = v.into();
4199 self
4200 }
4201 }
4202
4203 #[doc(hidden)]
4204 impl crate::RequestBuilder for GetRuleDeployment {
4205 fn request_options(&mut self) -> &mut crate::RequestOptions {
4206 &mut self.0.options
4207 }
4208 }
4209
4210 /// The request builder for [RuleService::list_rule_deployments][crate::client::RuleService::list_rule_deployments] calls.
4211 ///
4212 /// # Example
4213 /// ```
4214 /// # use google_cloud_chronicle_v1::builder::rule_service::ListRuleDeployments;
4215 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4216 /// use google_cloud_gax::paginator::ItemPaginator;
4217 ///
4218 /// let builder = prepare_request_builder();
4219 /// let mut items = builder.by_item();
4220 /// while let Some(result) = items.next().await {
4221 /// let item = result?;
4222 /// }
4223 /// # Ok(()) }
4224 ///
4225 /// fn prepare_request_builder() -> ListRuleDeployments {
4226 /// # panic!();
4227 /// // ... details omitted ...
4228 /// }
4229 /// ```
4230 #[derive(Clone, Debug)]
4231 pub struct ListRuleDeployments(RequestBuilder<crate::model::ListRuleDeploymentsRequest>);
4232
4233 impl ListRuleDeployments {
4234 pub(crate) fn new(
4235 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4236 ) -> Self {
4237 Self(RequestBuilder::new(stub))
4238 }
4239
4240 /// Sets the full request, replacing any prior values.
4241 pub fn with_request<V: Into<crate::model::ListRuleDeploymentsRequest>>(
4242 mut self,
4243 v: V,
4244 ) -> Self {
4245 self.0.request = v.into();
4246 self
4247 }
4248
4249 /// Sets all the options, replacing any prior values.
4250 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4251 self.0.options = v.into();
4252 self
4253 }
4254
4255 /// Sends the request.
4256 pub async fn send(self) -> Result<crate::model::ListRuleDeploymentsResponse> {
4257 (*self.0.stub)
4258 .list_rule_deployments(self.0.request, self.0.options)
4259 .await
4260 .map(crate::Response::into_body)
4261 }
4262
4263 /// Streams each page in the collection.
4264 pub fn by_page(
4265 self,
4266 ) -> impl google_cloud_gax::paginator::Paginator<
4267 crate::model::ListRuleDeploymentsResponse,
4268 crate::Error,
4269 > {
4270 use std::clone::Clone;
4271 let token = self.0.request.page_token.clone();
4272 let execute = move |token: String| {
4273 let mut builder = self.clone();
4274 builder.0.request = builder.0.request.set_page_token(token);
4275 builder.send()
4276 };
4277 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4278 }
4279
4280 /// Streams each item in the collection.
4281 pub fn by_item(
4282 self,
4283 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4284 crate::model::ListRuleDeploymentsResponse,
4285 crate::Error,
4286 > {
4287 use google_cloud_gax::paginator::Paginator;
4288 self.by_page().items()
4289 }
4290
4291 /// Sets the value of [parent][crate::model::ListRuleDeploymentsRequest::parent].
4292 ///
4293 /// This is a **required** field for requests.
4294 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4295 self.0.request.parent = v.into();
4296 self
4297 }
4298
4299 /// Sets the value of [page_size][crate::model::ListRuleDeploymentsRequest::page_size].
4300 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4301 self.0.request.page_size = v.into();
4302 self
4303 }
4304
4305 /// Sets the value of [page_token][crate::model::ListRuleDeploymentsRequest::page_token].
4306 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4307 self.0.request.page_token = v.into();
4308 self
4309 }
4310
4311 /// Sets the value of [filter][crate::model::ListRuleDeploymentsRequest::filter].
4312 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4313 self.0.request.filter = v.into();
4314 self
4315 }
4316 }
4317
4318 #[doc(hidden)]
4319 impl crate::RequestBuilder for ListRuleDeployments {
4320 fn request_options(&mut self) -> &mut crate::RequestOptions {
4321 &mut self.0.options
4322 }
4323 }
4324
4325 /// The request builder for [RuleService::update_rule_deployment][crate::client::RuleService::update_rule_deployment] calls.
4326 ///
4327 /// # Example
4328 /// ```
4329 /// # use google_cloud_chronicle_v1::builder::rule_service::UpdateRuleDeployment;
4330 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4331 ///
4332 /// let builder = prepare_request_builder();
4333 /// let response = builder.send().await?;
4334 /// # Ok(()) }
4335 ///
4336 /// fn prepare_request_builder() -> UpdateRuleDeployment {
4337 /// # panic!();
4338 /// // ... details omitted ...
4339 /// }
4340 /// ```
4341 #[derive(Clone, Debug)]
4342 pub struct UpdateRuleDeployment(RequestBuilder<crate::model::UpdateRuleDeploymentRequest>);
4343
4344 impl UpdateRuleDeployment {
4345 pub(crate) fn new(
4346 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4347 ) -> Self {
4348 Self(RequestBuilder::new(stub))
4349 }
4350
4351 /// Sets the full request, replacing any prior values.
4352 pub fn with_request<V: Into<crate::model::UpdateRuleDeploymentRequest>>(
4353 mut self,
4354 v: V,
4355 ) -> Self {
4356 self.0.request = v.into();
4357 self
4358 }
4359
4360 /// Sets all the options, replacing any prior values.
4361 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4362 self.0.options = v.into();
4363 self
4364 }
4365
4366 /// Sends the request.
4367 pub async fn send(self) -> Result<crate::model::RuleDeployment> {
4368 (*self.0.stub)
4369 .update_rule_deployment(self.0.request, self.0.options)
4370 .await
4371 .map(crate::Response::into_body)
4372 }
4373
4374 /// Sets the value of [rule_deployment][crate::model::UpdateRuleDeploymentRequest::rule_deployment].
4375 ///
4376 /// This is a **required** field for requests.
4377 pub fn set_rule_deployment<T>(mut self, v: T) -> Self
4378 where
4379 T: std::convert::Into<crate::model::RuleDeployment>,
4380 {
4381 self.0.request.rule_deployment = std::option::Option::Some(v.into());
4382 self
4383 }
4384
4385 /// Sets or clears the value of [rule_deployment][crate::model::UpdateRuleDeploymentRequest::rule_deployment].
4386 ///
4387 /// This is a **required** field for requests.
4388 pub fn set_or_clear_rule_deployment<T>(mut self, v: std::option::Option<T>) -> Self
4389 where
4390 T: std::convert::Into<crate::model::RuleDeployment>,
4391 {
4392 self.0.request.rule_deployment = v.map(|x| x.into());
4393 self
4394 }
4395
4396 /// Sets the value of [update_mask][crate::model::UpdateRuleDeploymentRequest::update_mask].
4397 ///
4398 /// This is a **required** field for requests.
4399 pub fn set_update_mask<T>(mut self, v: T) -> Self
4400 where
4401 T: std::convert::Into<wkt::FieldMask>,
4402 {
4403 self.0.request.update_mask = std::option::Option::Some(v.into());
4404 self
4405 }
4406
4407 /// Sets or clears the value of [update_mask][crate::model::UpdateRuleDeploymentRequest::update_mask].
4408 ///
4409 /// This is a **required** field for requests.
4410 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4411 where
4412 T: std::convert::Into<wkt::FieldMask>,
4413 {
4414 self.0.request.update_mask = v.map(|x| x.into());
4415 self
4416 }
4417 }
4418
4419 #[doc(hidden)]
4420 impl crate::RequestBuilder for UpdateRuleDeployment {
4421 fn request_options(&mut self) -> &mut crate::RequestOptions {
4422 &mut self.0.options
4423 }
4424 }
4425
4426 /// The request builder for [RuleService::list_operations][crate::client::RuleService::list_operations] calls.
4427 ///
4428 /// # Example
4429 /// ```
4430 /// # use google_cloud_chronicle_v1::builder::rule_service::ListOperations;
4431 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4432 /// use google_cloud_gax::paginator::ItemPaginator;
4433 ///
4434 /// let builder = prepare_request_builder();
4435 /// let mut items = builder.by_item();
4436 /// while let Some(result) = items.next().await {
4437 /// let item = result?;
4438 /// }
4439 /// # Ok(()) }
4440 ///
4441 /// fn prepare_request_builder() -> ListOperations {
4442 /// # panic!();
4443 /// // ... details omitted ...
4444 /// }
4445 /// ```
4446 #[derive(Clone, Debug)]
4447 pub struct ListOperations(
4448 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4449 );
4450
4451 impl ListOperations {
4452 pub(crate) fn new(
4453 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4454 ) -> Self {
4455 Self(RequestBuilder::new(stub))
4456 }
4457
4458 /// Sets the full request, replacing any prior values.
4459 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4460 mut self,
4461 v: V,
4462 ) -> Self {
4463 self.0.request = v.into();
4464 self
4465 }
4466
4467 /// Sets all the options, replacing any prior values.
4468 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4469 self.0.options = v.into();
4470 self
4471 }
4472
4473 /// Sends the request.
4474 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4475 (*self.0.stub)
4476 .list_operations(self.0.request, self.0.options)
4477 .await
4478 .map(crate::Response::into_body)
4479 }
4480
4481 /// Streams each page in the collection.
4482 pub fn by_page(
4483 self,
4484 ) -> impl google_cloud_gax::paginator::Paginator<
4485 google_cloud_longrunning::model::ListOperationsResponse,
4486 crate::Error,
4487 > {
4488 use std::clone::Clone;
4489 let token = self.0.request.page_token.clone();
4490 let execute = move |token: String| {
4491 let mut builder = self.clone();
4492 builder.0.request = builder.0.request.set_page_token(token);
4493 builder.send()
4494 };
4495 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4496 }
4497
4498 /// Streams each item in the collection.
4499 pub fn by_item(
4500 self,
4501 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4502 google_cloud_longrunning::model::ListOperationsResponse,
4503 crate::Error,
4504 > {
4505 use google_cloud_gax::paginator::Paginator;
4506 self.by_page().items()
4507 }
4508
4509 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
4510 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4511 self.0.request.name = v.into();
4512 self
4513 }
4514
4515 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
4516 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4517 self.0.request.filter = v.into();
4518 self
4519 }
4520
4521 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
4522 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4523 self.0.request.page_size = v.into();
4524 self
4525 }
4526
4527 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
4528 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4529 self.0.request.page_token = v.into();
4530 self
4531 }
4532
4533 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
4534 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4535 self.0.request.return_partial_success = v.into();
4536 self
4537 }
4538 }
4539
4540 #[doc(hidden)]
4541 impl crate::RequestBuilder for ListOperations {
4542 fn request_options(&mut self) -> &mut crate::RequestOptions {
4543 &mut self.0.options
4544 }
4545 }
4546
4547 /// The request builder for [RuleService::get_operation][crate::client::RuleService::get_operation] calls.
4548 ///
4549 /// # Example
4550 /// ```
4551 /// # use google_cloud_chronicle_v1::builder::rule_service::GetOperation;
4552 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4553 ///
4554 /// let builder = prepare_request_builder();
4555 /// let response = builder.send().await?;
4556 /// # Ok(()) }
4557 ///
4558 /// fn prepare_request_builder() -> GetOperation {
4559 /// # panic!();
4560 /// // ... details omitted ...
4561 /// }
4562 /// ```
4563 #[derive(Clone, Debug)]
4564 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4565
4566 impl GetOperation {
4567 pub(crate) fn new(
4568 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4569 ) -> Self {
4570 Self(RequestBuilder::new(stub))
4571 }
4572
4573 /// Sets the full request, replacing any prior values.
4574 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4575 mut self,
4576 v: V,
4577 ) -> Self {
4578 self.0.request = v.into();
4579 self
4580 }
4581
4582 /// Sets all the options, replacing any prior values.
4583 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4584 self.0.options = v.into();
4585 self
4586 }
4587
4588 /// Sends the request.
4589 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4590 (*self.0.stub)
4591 .get_operation(self.0.request, self.0.options)
4592 .await
4593 .map(crate::Response::into_body)
4594 }
4595
4596 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4597 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4598 self.0.request.name = v.into();
4599 self
4600 }
4601 }
4602
4603 #[doc(hidden)]
4604 impl crate::RequestBuilder for GetOperation {
4605 fn request_options(&mut self) -> &mut crate::RequestOptions {
4606 &mut self.0.options
4607 }
4608 }
4609
4610 /// The request builder for [RuleService::delete_operation][crate::client::RuleService::delete_operation] calls.
4611 ///
4612 /// # Example
4613 /// ```
4614 /// # use google_cloud_chronicle_v1::builder::rule_service::DeleteOperation;
4615 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4616 ///
4617 /// let builder = prepare_request_builder();
4618 /// let response = builder.send().await?;
4619 /// # Ok(()) }
4620 ///
4621 /// fn prepare_request_builder() -> DeleteOperation {
4622 /// # panic!();
4623 /// // ... details omitted ...
4624 /// }
4625 /// ```
4626 #[derive(Clone, Debug)]
4627 pub struct DeleteOperation(
4628 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4629 );
4630
4631 impl DeleteOperation {
4632 pub(crate) fn new(
4633 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4634 ) -> Self {
4635 Self(RequestBuilder::new(stub))
4636 }
4637
4638 /// Sets the full request, replacing any prior values.
4639 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4640 mut self,
4641 v: V,
4642 ) -> Self {
4643 self.0.request = v.into();
4644 self
4645 }
4646
4647 /// Sets all the options, replacing any prior values.
4648 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4649 self.0.options = v.into();
4650 self
4651 }
4652
4653 /// Sends the request.
4654 pub async fn send(self) -> Result<()> {
4655 (*self.0.stub)
4656 .delete_operation(self.0.request, self.0.options)
4657 .await
4658 .map(crate::Response::into_body)
4659 }
4660
4661 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
4662 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4663 self.0.request.name = v.into();
4664 self
4665 }
4666 }
4667
4668 #[doc(hidden)]
4669 impl crate::RequestBuilder for DeleteOperation {
4670 fn request_options(&mut self) -> &mut crate::RequestOptions {
4671 &mut self.0.options
4672 }
4673 }
4674
4675 /// The request builder for [RuleService::cancel_operation][crate::client::RuleService::cancel_operation] calls.
4676 ///
4677 /// # Example
4678 /// ```
4679 /// # use google_cloud_chronicle_v1::builder::rule_service::CancelOperation;
4680 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4681 ///
4682 /// let builder = prepare_request_builder();
4683 /// let response = builder.send().await?;
4684 /// # Ok(()) }
4685 ///
4686 /// fn prepare_request_builder() -> CancelOperation {
4687 /// # panic!();
4688 /// // ... details omitted ...
4689 /// }
4690 /// ```
4691 #[derive(Clone, Debug)]
4692 pub struct CancelOperation(
4693 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4694 );
4695
4696 impl CancelOperation {
4697 pub(crate) fn new(
4698 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4699 ) -> Self {
4700 Self(RequestBuilder::new(stub))
4701 }
4702
4703 /// Sets the full request, replacing any prior values.
4704 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4705 mut self,
4706 v: V,
4707 ) -> Self {
4708 self.0.request = v.into();
4709 self
4710 }
4711
4712 /// Sets all the options, replacing any prior values.
4713 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4714 self.0.options = v.into();
4715 self
4716 }
4717
4718 /// Sends the request.
4719 pub async fn send(self) -> Result<()> {
4720 (*self.0.stub)
4721 .cancel_operation(self.0.request, self.0.options)
4722 .await
4723 .map(crate::Response::into_body)
4724 }
4725
4726 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
4727 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4728 self.0.request.name = v.into();
4729 self
4730 }
4731 }
4732
4733 #[doc(hidden)]
4734 impl crate::RequestBuilder for CancelOperation {
4735 fn request_options(&mut self) -> &mut crate::RequestOptions {
4736 &mut self.0.options
4737 }
4738 }
4739}