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
17/// Request and client builders for [DataAccessControlService][crate::client::DataAccessControlService].
18pub mod data_access_control_service {
19 use crate::Result;
20
21 /// A builder for [DataAccessControlService][crate::client::DataAccessControlService].
22 ///
23 /// ```
24 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25 /// # use google_cloud_chronicle_v1::*;
26 /// # use builder::data_access_control_service::ClientBuilder;
27 /// # use client::DataAccessControlService;
28 /// let builder : ClientBuilder = DataAccessControlService::builder();
29 /// let client = builder
30 /// .with_endpoint("https://chronicle.googleapis.com")
31 /// .build().await?;
32 /// # Ok(()) }
33 /// ```
34 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::DataAccessControlService;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = DataAccessControlService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 /// Common implementation for [crate::client::DataAccessControlService] request builders.
52 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 /// The request builder for [DataAccessControlService::create_data_access_label][crate::client::DataAccessControlService::create_data_access_label] calls.
75 ///
76 /// # Example
77 /// ```
78 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::CreateDataAccessLabel;
79 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
80 ///
81 /// let builder = prepare_request_builder();
82 /// let response = builder.send().await?;
83 /// # Ok(()) }
84 ///
85 /// fn prepare_request_builder() -> CreateDataAccessLabel {
86 /// # panic!();
87 /// // ... details omitted ...
88 /// }
89 /// ```
90 #[derive(Clone, Debug)]
91 pub struct CreateDataAccessLabel(RequestBuilder<crate::model::CreateDataAccessLabelRequest>);
92
93 impl CreateDataAccessLabel {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 /// Sets the full request, replacing any prior values.
101 pub fn with_request<V: Into<crate::model::CreateDataAccessLabelRequest>>(
102 mut self,
103 v: V,
104 ) -> Self {
105 self.0.request = v.into();
106 self
107 }
108
109 /// Sets all the options, replacing any prior values.
110 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111 self.0.options = v.into();
112 self
113 }
114
115 /// Sends the request.
116 pub async fn send(self) -> Result<crate::model::DataAccessLabel> {
117 (*self.0.stub)
118 .create_data_access_label(self.0.request, self.0.options)
119 .await
120 .map(crate::Response::into_body)
121 }
122
123 /// Sets the value of [parent][crate::model::CreateDataAccessLabelRequest::parent].
124 ///
125 /// This is a **required** field for requests.
126 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
127 self.0.request.parent = v.into();
128 self
129 }
130
131 /// Sets the value of [data_access_label][crate::model::CreateDataAccessLabelRequest::data_access_label].
132 ///
133 /// This is a **required** field for requests.
134 pub fn set_data_access_label<T>(mut self, v: T) -> Self
135 where
136 T: std::convert::Into<crate::model::DataAccessLabel>,
137 {
138 self.0.request.data_access_label = std::option::Option::Some(v.into());
139 self
140 }
141
142 /// Sets or clears the value of [data_access_label][crate::model::CreateDataAccessLabelRequest::data_access_label].
143 ///
144 /// This is a **required** field for requests.
145 pub fn set_or_clear_data_access_label<T>(mut self, v: std::option::Option<T>) -> Self
146 where
147 T: std::convert::Into<crate::model::DataAccessLabel>,
148 {
149 self.0.request.data_access_label = v.map(|x| x.into());
150 self
151 }
152
153 /// Sets the value of [data_access_label_id][crate::model::CreateDataAccessLabelRequest::data_access_label_id].
154 ///
155 /// This is a **required** field for requests.
156 pub fn set_data_access_label_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
157 self.0.request.data_access_label_id = v.into();
158 self
159 }
160 }
161
162 #[doc(hidden)]
163 impl crate::RequestBuilder for CreateDataAccessLabel {
164 fn request_options(&mut self) -> &mut crate::RequestOptions {
165 &mut self.0.options
166 }
167 }
168
169 /// The request builder for [DataAccessControlService::get_data_access_label][crate::client::DataAccessControlService::get_data_access_label] calls.
170 ///
171 /// # Example
172 /// ```
173 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::GetDataAccessLabel;
174 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
175 ///
176 /// let builder = prepare_request_builder();
177 /// let response = builder.send().await?;
178 /// # Ok(()) }
179 ///
180 /// fn prepare_request_builder() -> GetDataAccessLabel {
181 /// # panic!();
182 /// // ... details omitted ...
183 /// }
184 /// ```
185 #[derive(Clone, Debug)]
186 pub struct GetDataAccessLabel(RequestBuilder<crate::model::GetDataAccessLabelRequest>);
187
188 impl GetDataAccessLabel {
189 pub(crate) fn new(
190 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
191 ) -> Self {
192 Self(RequestBuilder::new(stub))
193 }
194
195 /// Sets the full request, replacing any prior values.
196 pub fn with_request<V: Into<crate::model::GetDataAccessLabelRequest>>(
197 mut self,
198 v: V,
199 ) -> Self {
200 self.0.request = v.into();
201 self
202 }
203
204 /// Sets all the options, replacing any prior values.
205 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
206 self.0.options = v.into();
207 self
208 }
209
210 /// Sends the request.
211 pub async fn send(self) -> Result<crate::model::DataAccessLabel> {
212 (*self.0.stub)
213 .get_data_access_label(self.0.request, self.0.options)
214 .await
215 .map(crate::Response::into_body)
216 }
217
218 /// Sets the value of [name][crate::model::GetDataAccessLabelRequest::name].
219 ///
220 /// This is a **required** field for requests.
221 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
222 self.0.request.name = v.into();
223 self
224 }
225 }
226
227 #[doc(hidden)]
228 impl crate::RequestBuilder for GetDataAccessLabel {
229 fn request_options(&mut self) -> &mut crate::RequestOptions {
230 &mut self.0.options
231 }
232 }
233
234 /// The request builder for [DataAccessControlService::list_data_access_labels][crate::client::DataAccessControlService::list_data_access_labels] calls.
235 ///
236 /// # Example
237 /// ```
238 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::ListDataAccessLabels;
239 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
240 /// use google_cloud_gax::paginator::ItemPaginator;
241 ///
242 /// let builder = prepare_request_builder();
243 /// let mut items = builder.by_item();
244 /// while let Some(result) = items.next().await {
245 /// let item = result?;
246 /// }
247 /// # Ok(()) }
248 ///
249 /// fn prepare_request_builder() -> ListDataAccessLabels {
250 /// # panic!();
251 /// // ... details omitted ...
252 /// }
253 /// ```
254 #[derive(Clone, Debug)]
255 pub struct ListDataAccessLabels(RequestBuilder<crate::model::ListDataAccessLabelsRequest>);
256
257 impl ListDataAccessLabels {
258 pub(crate) fn new(
259 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
260 ) -> Self {
261 Self(RequestBuilder::new(stub))
262 }
263
264 /// Sets the full request, replacing any prior values.
265 pub fn with_request<V: Into<crate::model::ListDataAccessLabelsRequest>>(
266 mut self,
267 v: V,
268 ) -> Self {
269 self.0.request = v.into();
270 self
271 }
272
273 /// Sets all the options, replacing any prior values.
274 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
275 self.0.options = v.into();
276 self
277 }
278
279 /// Sends the request.
280 pub async fn send(self) -> Result<crate::model::ListDataAccessLabelsResponse> {
281 (*self.0.stub)
282 .list_data_access_labels(self.0.request, self.0.options)
283 .await
284 .map(crate::Response::into_body)
285 }
286
287 /// Streams each page in the collection.
288 pub fn by_page(
289 self,
290 ) -> impl google_cloud_gax::paginator::Paginator<
291 crate::model::ListDataAccessLabelsResponse,
292 crate::Error,
293 > {
294 use std::clone::Clone;
295 let token = self.0.request.page_token.clone();
296 let execute = move |token: String| {
297 let mut builder = self.clone();
298 builder.0.request = builder.0.request.set_page_token(token);
299 builder.send()
300 };
301 google_cloud_gax::paginator::internal::new_paginator(token, execute)
302 }
303
304 /// Streams each item in the collection.
305 pub fn by_item(
306 self,
307 ) -> impl google_cloud_gax::paginator::ItemPaginator<
308 crate::model::ListDataAccessLabelsResponse,
309 crate::Error,
310 > {
311 use google_cloud_gax::paginator::Paginator;
312 self.by_page().items()
313 }
314
315 /// Sets the value of [parent][crate::model::ListDataAccessLabelsRequest::parent].
316 ///
317 /// This is a **required** field for requests.
318 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
319 self.0.request.parent = v.into();
320 self
321 }
322
323 /// Sets the value of [page_size][crate::model::ListDataAccessLabelsRequest::page_size].
324 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
325 self.0.request.page_size = v.into();
326 self
327 }
328
329 /// Sets the value of [page_token][crate::model::ListDataAccessLabelsRequest::page_token].
330 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
331 self.0.request.page_token = v.into();
332 self
333 }
334
335 /// Sets the value of [filter][crate::model::ListDataAccessLabelsRequest::filter].
336 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
337 self.0.request.filter = v.into();
338 self
339 }
340 }
341
342 #[doc(hidden)]
343 impl crate::RequestBuilder for ListDataAccessLabels {
344 fn request_options(&mut self) -> &mut crate::RequestOptions {
345 &mut self.0.options
346 }
347 }
348
349 /// The request builder for [DataAccessControlService::update_data_access_label][crate::client::DataAccessControlService::update_data_access_label] calls.
350 ///
351 /// # Example
352 /// ```
353 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::UpdateDataAccessLabel;
354 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
355 ///
356 /// let builder = prepare_request_builder();
357 /// let response = builder.send().await?;
358 /// # Ok(()) }
359 ///
360 /// fn prepare_request_builder() -> UpdateDataAccessLabel {
361 /// # panic!();
362 /// // ... details omitted ...
363 /// }
364 /// ```
365 #[derive(Clone, Debug)]
366 pub struct UpdateDataAccessLabel(RequestBuilder<crate::model::UpdateDataAccessLabelRequest>);
367
368 impl UpdateDataAccessLabel {
369 pub(crate) fn new(
370 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
371 ) -> Self {
372 Self(RequestBuilder::new(stub))
373 }
374
375 /// Sets the full request, replacing any prior values.
376 pub fn with_request<V: Into<crate::model::UpdateDataAccessLabelRequest>>(
377 mut self,
378 v: V,
379 ) -> Self {
380 self.0.request = v.into();
381 self
382 }
383
384 /// Sets all the options, replacing any prior values.
385 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
386 self.0.options = v.into();
387 self
388 }
389
390 /// Sends the request.
391 pub async fn send(self) -> Result<crate::model::DataAccessLabel> {
392 (*self.0.stub)
393 .update_data_access_label(self.0.request, self.0.options)
394 .await
395 .map(crate::Response::into_body)
396 }
397
398 /// Sets the value of [data_access_label][crate::model::UpdateDataAccessLabelRequest::data_access_label].
399 ///
400 /// This is a **required** field for requests.
401 pub fn set_data_access_label<T>(mut self, v: T) -> Self
402 where
403 T: std::convert::Into<crate::model::DataAccessLabel>,
404 {
405 self.0.request.data_access_label = std::option::Option::Some(v.into());
406 self
407 }
408
409 /// Sets or clears the value of [data_access_label][crate::model::UpdateDataAccessLabelRequest::data_access_label].
410 ///
411 /// This is a **required** field for requests.
412 pub fn set_or_clear_data_access_label<T>(mut self, v: std::option::Option<T>) -> Self
413 where
414 T: std::convert::Into<crate::model::DataAccessLabel>,
415 {
416 self.0.request.data_access_label = v.map(|x| x.into());
417 self
418 }
419
420 /// Sets the value of [update_mask][crate::model::UpdateDataAccessLabelRequest::update_mask].
421 pub fn set_update_mask<T>(mut self, v: T) -> Self
422 where
423 T: std::convert::Into<wkt::FieldMask>,
424 {
425 self.0.request.update_mask = std::option::Option::Some(v.into());
426 self
427 }
428
429 /// Sets or clears the value of [update_mask][crate::model::UpdateDataAccessLabelRequest::update_mask].
430 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
431 where
432 T: std::convert::Into<wkt::FieldMask>,
433 {
434 self.0.request.update_mask = v.map(|x| x.into());
435 self
436 }
437 }
438
439 #[doc(hidden)]
440 impl crate::RequestBuilder for UpdateDataAccessLabel {
441 fn request_options(&mut self) -> &mut crate::RequestOptions {
442 &mut self.0.options
443 }
444 }
445
446 /// The request builder for [DataAccessControlService::delete_data_access_label][crate::client::DataAccessControlService::delete_data_access_label] calls.
447 ///
448 /// # Example
449 /// ```
450 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::DeleteDataAccessLabel;
451 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
452 ///
453 /// let builder = prepare_request_builder();
454 /// let response = builder.send().await?;
455 /// # Ok(()) }
456 ///
457 /// fn prepare_request_builder() -> DeleteDataAccessLabel {
458 /// # panic!();
459 /// // ... details omitted ...
460 /// }
461 /// ```
462 #[derive(Clone, Debug)]
463 pub struct DeleteDataAccessLabel(RequestBuilder<crate::model::DeleteDataAccessLabelRequest>);
464
465 impl DeleteDataAccessLabel {
466 pub(crate) fn new(
467 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
468 ) -> Self {
469 Self(RequestBuilder::new(stub))
470 }
471
472 /// Sets the full request, replacing any prior values.
473 pub fn with_request<V: Into<crate::model::DeleteDataAccessLabelRequest>>(
474 mut self,
475 v: V,
476 ) -> Self {
477 self.0.request = v.into();
478 self
479 }
480
481 /// Sets all the options, replacing any prior values.
482 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
483 self.0.options = v.into();
484 self
485 }
486
487 /// Sends the request.
488 pub async fn send(self) -> Result<()> {
489 (*self.0.stub)
490 .delete_data_access_label(self.0.request, self.0.options)
491 .await
492 .map(crate::Response::into_body)
493 }
494
495 /// Sets the value of [name][crate::model::DeleteDataAccessLabelRequest::name].
496 ///
497 /// This is a **required** field for requests.
498 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
499 self.0.request.name = v.into();
500 self
501 }
502 }
503
504 #[doc(hidden)]
505 impl crate::RequestBuilder for DeleteDataAccessLabel {
506 fn request_options(&mut self) -> &mut crate::RequestOptions {
507 &mut self.0.options
508 }
509 }
510
511 /// The request builder for [DataAccessControlService::create_data_access_scope][crate::client::DataAccessControlService::create_data_access_scope] calls.
512 ///
513 /// # Example
514 /// ```
515 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::CreateDataAccessScope;
516 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
517 ///
518 /// let builder = prepare_request_builder();
519 /// let response = builder.send().await?;
520 /// # Ok(()) }
521 ///
522 /// fn prepare_request_builder() -> CreateDataAccessScope {
523 /// # panic!();
524 /// // ... details omitted ...
525 /// }
526 /// ```
527 #[derive(Clone, Debug)]
528 pub struct CreateDataAccessScope(RequestBuilder<crate::model::CreateDataAccessScopeRequest>);
529
530 impl CreateDataAccessScope {
531 pub(crate) fn new(
532 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
533 ) -> Self {
534 Self(RequestBuilder::new(stub))
535 }
536
537 /// Sets the full request, replacing any prior values.
538 pub fn with_request<V: Into<crate::model::CreateDataAccessScopeRequest>>(
539 mut self,
540 v: V,
541 ) -> Self {
542 self.0.request = v.into();
543 self
544 }
545
546 /// Sets all the options, replacing any prior values.
547 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
548 self.0.options = v.into();
549 self
550 }
551
552 /// Sends the request.
553 pub async fn send(self) -> Result<crate::model::DataAccessScope> {
554 (*self.0.stub)
555 .create_data_access_scope(self.0.request, self.0.options)
556 .await
557 .map(crate::Response::into_body)
558 }
559
560 /// Sets the value of [parent][crate::model::CreateDataAccessScopeRequest::parent].
561 ///
562 /// This is a **required** field for requests.
563 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
564 self.0.request.parent = v.into();
565 self
566 }
567
568 /// Sets the value of [data_access_scope][crate::model::CreateDataAccessScopeRequest::data_access_scope].
569 ///
570 /// This is a **required** field for requests.
571 pub fn set_data_access_scope<T>(mut self, v: T) -> Self
572 where
573 T: std::convert::Into<crate::model::DataAccessScope>,
574 {
575 self.0.request.data_access_scope = std::option::Option::Some(v.into());
576 self
577 }
578
579 /// Sets or clears the value of [data_access_scope][crate::model::CreateDataAccessScopeRequest::data_access_scope].
580 ///
581 /// This is a **required** field for requests.
582 pub fn set_or_clear_data_access_scope<T>(mut self, v: std::option::Option<T>) -> Self
583 where
584 T: std::convert::Into<crate::model::DataAccessScope>,
585 {
586 self.0.request.data_access_scope = v.map(|x| x.into());
587 self
588 }
589
590 /// Sets the value of [data_access_scope_id][crate::model::CreateDataAccessScopeRequest::data_access_scope_id].
591 ///
592 /// This is a **required** field for requests.
593 pub fn set_data_access_scope_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
594 self.0.request.data_access_scope_id = v.into();
595 self
596 }
597 }
598
599 #[doc(hidden)]
600 impl crate::RequestBuilder for CreateDataAccessScope {
601 fn request_options(&mut self) -> &mut crate::RequestOptions {
602 &mut self.0.options
603 }
604 }
605
606 /// The request builder for [DataAccessControlService::get_data_access_scope][crate::client::DataAccessControlService::get_data_access_scope] calls.
607 ///
608 /// # Example
609 /// ```
610 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::GetDataAccessScope;
611 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
612 ///
613 /// let builder = prepare_request_builder();
614 /// let response = builder.send().await?;
615 /// # Ok(()) }
616 ///
617 /// fn prepare_request_builder() -> GetDataAccessScope {
618 /// # panic!();
619 /// // ... details omitted ...
620 /// }
621 /// ```
622 #[derive(Clone, Debug)]
623 pub struct GetDataAccessScope(RequestBuilder<crate::model::GetDataAccessScopeRequest>);
624
625 impl GetDataAccessScope {
626 pub(crate) fn new(
627 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
628 ) -> Self {
629 Self(RequestBuilder::new(stub))
630 }
631
632 /// Sets the full request, replacing any prior values.
633 pub fn with_request<V: Into<crate::model::GetDataAccessScopeRequest>>(
634 mut self,
635 v: V,
636 ) -> Self {
637 self.0.request = v.into();
638 self
639 }
640
641 /// Sets all the options, replacing any prior values.
642 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
643 self.0.options = v.into();
644 self
645 }
646
647 /// Sends the request.
648 pub async fn send(self) -> Result<crate::model::DataAccessScope> {
649 (*self.0.stub)
650 .get_data_access_scope(self.0.request, self.0.options)
651 .await
652 .map(crate::Response::into_body)
653 }
654
655 /// Sets the value of [name][crate::model::GetDataAccessScopeRequest::name].
656 ///
657 /// This is a **required** field for requests.
658 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
659 self.0.request.name = v.into();
660 self
661 }
662 }
663
664 #[doc(hidden)]
665 impl crate::RequestBuilder for GetDataAccessScope {
666 fn request_options(&mut self) -> &mut crate::RequestOptions {
667 &mut self.0.options
668 }
669 }
670
671 /// The request builder for [DataAccessControlService::list_data_access_scopes][crate::client::DataAccessControlService::list_data_access_scopes] calls.
672 ///
673 /// # Example
674 /// ```
675 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::ListDataAccessScopes;
676 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
677 /// use google_cloud_gax::paginator::ItemPaginator;
678 ///
679 /// let builder = prepare_request_builder();
680 /// let mut items = builder.by_item();
681 /// while let Some(result) = items.next().await {
682 /// let item = result?;
683 /// }
684 /// # Ok(()) }
685 ///
686 /// fn prepare_request_builder() -> ListDataAccessScopes {
687 /// # panic!();
688 /// // ... details omitted ...
689 /// }
690 /// ```
691 #[derive(Clone, Debug)]
692 pub struct ListDataAccessScopes(RequestBuilder<crate::model::ListDataAccessScopesRequest>);
693
694 impl ListDataAccessScopes {
695 pub(crate) fn new(
696 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
697 ) -> Self {
698 Self(RequestBuilder::new(stub))
699 }
700
701 /// Sets the full request, replacing any prior values.
702 pub fn with_request<V: Into<crate::model::ListDataAccessScopesRequest>>(
703 mut self,
704 v: V,
705 ) -> Self {
706 self.0.request = v.into();
707 self
708 }
709
710 /// Sets all the options, replacing any prior values.
711 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
712 self.0.options = v.into();
713 self
714 }
715
716 /// Sends the request.
717 pub async fn send(self) -> Result<crate::model::ListDataAccessScopesResponse> {
718 (*self.0.stub)
719 .list_data_access_scopes(self.0.request, self.0.options)
720 .await
721 .map(crate::Response::into_body)
722 }
723
724 /// Streams each page in the collection.
725 pub fn by_page(
726 self,
727 ) -> impl google_cloud_gax::paginator::Paginator<
728 crate::model::ListDataAccessScopesResponse,
729 crate::Error,
730 > {
731 use std::clone::Clone;
732 let token = self.0.request.page_token.clone();
733 let execute = move |token: String| {
734 let mut builder = self.clone();
735 builder.0.request = builder.0.request.set_page_token(token);
736 builder.send()
737 };
738 google_cloud_gax::paginator::internal::new_paginator(token, execute)
739 }
740
741 /// Streams each item in the collection.
742 pub fn by_item(
743 self,
744 ) -> impl google_cloud_gax::paginator::ItemPaginator<
745 crate::model::ListDataAccessScopesResponse,
746 crate::Error,
747 > {
748 use google_cloud_gax::paginator::Paginator;
749 self.by_page().items()
750 }
751
752 /// Sets the value of [parent][crate::model::ListDataAccessScopesRequest::parent].
753 ///
754 /// This is a **required** field for requests.
755 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
756 self.0.request.parent = v.into();
757 self
758 }
759
760 /// Sets the value of [page_size][crate::model::ListDataAccessScopesRequest::page_size].
761 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
762 self.0.request.page_size = v.into();
763 self
764 }
765
766 /// Sets the value of [page_token][crate::model::ListDataAccessScopesRequest::page_token].
767 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
768 self.0.request.page_token = v.into();
769 self
770 }
771
772 /// Sets the value of [filter][crate::model::ListDataAccessScopesRequest::filter].
773 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
774 self.0.request.filter = v.into();
775 self
776 }
777 }
778
779 #[doc(hidden)]
780 impl crate::RequestBuilder for ListDataAccessScopes {
781 fn request_options(&mut self) -> &mut crate::RequestOptions {
782 &mut self.0.options
783 }
784 }
785
786 /// The request builder for [DataAccessControlService::update_data_access_scope][crate::client::DataAccessControlService::update_data_access_scope] calls.
787 ///
788 /// # Example
789 /// ```
790 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::UpdateDataAccessScope;
791 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
792 ///
793 /// let builder = prepare_request_builder();
794 /// let response = builder.send().await?;
795 /// # Ok(()) }
796 ///
797 /// fn prepare_request_builder() -> UpdateDataAccessScope {
798 /// # panic!();
799 /// // ... details omitted ...
800 /// }
801 /// ```
802 #[derive(Clone, Debug)]
803 pub struct UpdateDataAccessScope(RequestBuilder<crate::model::UpdateDataAccessScopeRequest>);
804
805 impl UpdateDataAccessScope {
806 pub(crate) fn new(
807 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
808 ) -> Self {
809 Self(RequestBuilder::new(stub))
810 }
811
812 /// Sets the full request, replacing any prior values.
813 pub fn with_request<V: Into<crate::model::UpdateDataAccessScopeRequest>>(
814 mut self,
815 v: V,
816 ) -> Self {
817 self.0.request = v.into();
818 self
819 }
820
821 /// Sets all the options, replacing any prior values.
822 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
823 self.0.options = v.into();
824 self
825 }
826
827 /// Sends the request.
828 pub async fn send(self) -> Result<crate::model::DataAccessScope> {
829 (*self.0.stub)
830 .update_data_access_scope(self.0.request, self.0.options)
831 .await
832 .map(crate::Response::into_body)
833 }
834
835 /// Sets the value of [data_access_scope][crate::model::UpdateDataAccessScopeRequest::data_access_scope].
836 ///
837 /// This is a **required** field for requests.
838 pub fn set_data_access_scope<T>(mut self, v: T) -> Self
839 where
840 T: std::convert::Into<crate::model::DataAccessScope>,
841 {
842 self.0.request.data_access_scope = std::option::Option::Some(v.into());
843 self
844 }
845
846 /// Sets or clears the value of [data_access_scope][crate::model::UpdateDataAccessScopeRequest::data_access_scope].
847 ///
848 /// This is a **required** field for requests.
849 pub fn set_or_clear_data_access_scope<T>(mut self, v: std::option::Option<T>) -> Self
850 where
851 T: std::convert::Into<crate::model::DataAccessScope>,
852 {
853 self.0.request.data_access_scope = v.map(|x| x.into());
854 self
855 }
856
857 /// Sets the value of [update_mask][crate::model::UpdateDataAccessScopeRequest::update_mask].
858 pub fn set_update_mask<T>(mut self, v: T) -> Self
859 where
860 T: std::convert::Into<wkt::FieldMask>,
861 {
862 self.0.request.update_mask = std::option::Option::Some(v.into());
863 self
864 }
865
866 /// Sets or clears the value of [update_mask][crate::model::UpdateDataAccessScopeRequest::update_mask].
867 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
868 where
869 T: std::convert::Into<wkt::FieldMask>,
870 {
871 self.0.request.update_mask = v.map(|x| x.into());
872 self
873 }
874 }
875
876 #[doc(hidden)]
877 impl crate::RequestBuilder for UpdateDataAccessScope {
878 fn request_options(&mut self) -> &mut crate::RequestOptions {
879 &mut self.0.options
880 }
881 }
882
883 /// The request builder for [DataAccessControlService::delete_data_access_scope][crate::client::DataAccessControlService::delete_data_access_scope] calls.
884 ///
885 /// # Example
886 /// ```
887 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::DeleteDataAccessScope;
888 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
889 ///
890 /// let builder = prepare_request_builder();
891 /// let response = builder.send().await?;
892 /// # Ok(()) }
893 ///
894 /// fn prepare_request_builder() -> DeleteDataAccessScope {
895 /// # panic!();
896 /// // ... details omitted ...
897 /// }
898 /// ```
899 #[derive(Clone, Debug)]
900 pub struct DeleteDataAccessScope(RequestBuilder<crate::model::DeleteDataAccessScopeRequest>);
901
902 impl DeleteDataAccessScope {
903 pub(crate) fn new(
904 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
905 ) -> Self {
906 Self(RequestBuilder::new(stub))
907 }
908
909 /// Sets the full request, replacing any prior values.
910 pub fn with_request<V: Into<crate::model::DeleteDataAccessScopeRequest>>(
911 mut self,
912 v: V,
913 ) -> Self {
914 self.0.request = v.into();
915 self
916 }
917
918 /// Sets all the options, replacing any prior values.
919 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
920 self.0.options = v.into();
921 self
922 }
923
924 /// Sends the request.
925 pub async fn send(self) -> Result<()> {
926 (*self.0.stub)
927 .delete_data_access_scope(self.0.request, self.0.options)
928 .await
929 .map(crate::Response::into_body)
930 }
931
932 /// Sets the value of [name][crate::model::DeleteDataAccessScopeRequest::name].
933 ///
934 /// This is a **required** field for requests.
935 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
936 self.0.request.name = v.into();
937 self
938 }
939 }
940
941 #[doc(hidden)]
942 impl crate::RequestBuilder for DeleteDataAccessScope {
943 fn request_options(&mut self) -> &mut crate::RequestOptions {
944 &mut self.0.options
945 }
946 }
947
948 /// The request builder for [DataAccessControlService::list_operations][crate::client::DataAccessControlService::list_operations] calls.
949 ///
950 /// # Example
951 /// ```
952 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::ListOperations;
953 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
954 /// use google_cloud_gax::paginator::ItemPaginator;
955 ///
956 /// let builder = prepare_request_builder();
957 /// let mut items = builder.by_item();
958 /// while let Some(result) = items.next().await {
959 /// let item = result?;
960 /// }
961 /// # Ok(()) }
962 ///
963 /// fn prepare_request_builder() -> ListOperations {
964 /// # panic!();
965 /// // ... details omitted ...
966 /// }
967 /// ```
968 #[derive(Clone, Debug)]
969 pub struct ListOperations(
970 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
971 );
972
973 impl ListOperations {
974 pub(crate) fn new(
975 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
976 ) -> Self {
977 Self(RequestBuilder::new(stub))
978 }
979
980 /// Sets the full request, replacing any prior values.
981 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
982 mut self,
983 v: V,
984 ) -> Self {
985 self.0.request = v.into();
986 self
987 }
988
989 /// Sets all the options, replacing any prior values.
990 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
991 self.0.options = v.into();
992 self
993 }
994
995 /// Sends the request.
996 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
997 (*self.0.stub)
998 .list_operations(self.0.request, self.0.options)
999 .await
1000 .map(crate::Response::into_body)
1001 }
1002
1003 /// Streams each page in the collection.
1004 pub fn by_page(
1005 self,
1006 ) -> impl google_cloud_gax::paginator::Paginator<
1007 google_cloud_longrunning::model::ListOperationsResponse,
1008 crate::Error,
1009 > {
1010 use std::clone::Clone;
1011 let token = self.0.request.page_token.clone();
1012 let execute = move |token: String| {
1013 let mut builder = self.clone();
1014 builder.0.request = builder.0.request.set_page_token(token);
1015 builder.send()
1016 };
1017 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1018 }
1019
1020 /// Streams each item in the collection.
1021 pub fn by_item(
1022 self,
1023 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1024 google_cloud_longrunning::model::ListOperationsResponse,
1025 crate::Error,
1026 > {
1027 use google_cloud_gax::paginator::Paginator;
1028 self.by_page().items()
1029 }
1030
1031 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1032 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1033 self.0.request.name = v.into();
1034 self
1035 }
1036
1037 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1038 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1039 self.0.request.filter = v.into();
1040 self
1041 }
1042
1043 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1044 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1045 self.0.request.page_size = v.into();
1046 self
1047 }
1048
1049 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1050 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1051 self.0.request.page_token = v.into();
1052 self
1053 }
1054
1055 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1056 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1057 self.0.request.return_partial_success = v.into();
1058 self
1059 }
1060 }
1061
1062 #[doc(hidden)]
1063 impl crate::RequestBuilder for ListOperations {
1064 fn request_options(&mut self) -> &mut crate::RequestOptions {
1065 &mut self.0.options
1066 }
1067 }
1068
1069 /// The request builder for [DataAccessControlService::get_operation][crate::client::DataAccessControlService::get_operation] calls.
1070 ///
1071 /// # Example
1072 /// ```
1073 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::GetOperation;
1074 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1075 ///
1076 /// let builder = prepare_request_builder();
1077 /// let response = builder.send().await?;
1078 /// # Ok(()) }
1079 ///
1080 /// fn prepare_request_builder() -> GetOperation {
1081 /// # panic!();
1082 /// // ... details omitted ...
1083 /// }
1084 /// ```
1085 #[derive(Clone, Debug)]
1086 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1087
1088 impl GetOperation {
1089 pub(crate) fn new(
1090 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
1091 ) -> Self {
1092 Self(RequestBuilder::new(stub))
1093 }
1094
1095 /// Sets the full request, replacing any prior values.
1096 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1097 mut self,
1098 v: V,
1099 ) -> Self {
1100 self.0.request = v.into();
1101 self
1102 }
1103
1104 /// Sets all the options, replacing any prior values.
1105 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1106 self.0.options = v.into();
1107 self
1108 }
1109
1110 /// Sends the request.
1111 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1112 (*self.0.stub)
1113 .get_operation(self.0.request, self.0.options)
1114 .await
1115 .map(crate::Response::into_body)
1116 }
1117
1118 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1119 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1120 self.0.request.name = v.into();
1121 self
1122 }
1123 }
1124
1125 #[doc(hidden)]
1126 impl crate::RequestBuilder for GetOperation {
1127 fn request_options(&mut self) -> &mut crate::RequestOptions {
1128 &mut self.0.options
1129 }
1130 }
1131
1132 /// The request builder for [DataAccessControlService::delete_operation][crate::client::DataAccessControlService::delete_operation] calls.
1133 ///
1134 /// # Example
1135 /// ```
1136 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::DeleteOperation;
1137 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1138 ///
1139 /// let builder = prepare_request_builder();
1140 /// let response = builder.send().await?;
1141 /// # Ok(()) }
1142 ///
1143 /// fn prepare_request_builder() -> DeleteOperation {
1144 /// # panic!();
1145 /// // ... details omitted ...
1146 /// }
1147 /// ```
1148 #[derive(Clone, Debug)]
1149 pub struct DeleteOperation(
1150 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1151 );
1152
1153 impl DeleteOperation {
1154 pub(crate) fn new(
1155 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
1156 ) -> Self {
1157 Self(RequestBuilder::new(stub))
1158 }
1159
1160 /// Sets the full request, replacing any prior values.
1161 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1162 mut self,
1163 v: V,
1164 ) -> Self {
1165 self.0.request = v.into();
1166 self
1167 }
1168
1169 /// Sets all the options, replacing any prior values.
1170 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1171 self.0.options = v.into();
1172 self
1173 }
1174
1175 /// Sends the request.
1176 pub async fn send(self) -> Result<()> {
1177 (*self.0.stub)
1178 .delete_operation(self.0.request, self.0.options)
1179 .await
1180 .map(crate::Response::into_body)
1181 }
1182
1183 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
1184 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1185 self.0.request.name = v.into();
1186 self
1187 }
1188 }
1189
1190 #[doc(hidden)]
1191 impl crate::RequestBuilder for DeleteOperation {
1192 fn request_options(&mut self) -> &mut crate::RequestOptions {
1193 &mut self.0.options
1194 }
1195 }
1196
1197 /// The request builder for [DataAccessControlService::cancel_operation][crate::client::DataAccessControlService::cancel_operation] calls.
1198 ///
1199 /// # Example
1200 /// ```
1201 /// # use google_cloud_chronicle_v1::builder::data_access_control_service::CancelOperation;
1202 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1203 ///
1204 /// let builder = prepare_request_builder();
1205 /// let response = builder.send().await?;
1206 /// # Ok(()) }
1207 ///
1208 /// fn prepare_request_builder() -> CancelOperation {
1209 /// # panic!();
1210 /// // ... details omitted ...
1211 /// }
1212 /// ```
1213 #[derive(Clone, Debug)]
1214 pub struct CancelOperation(
1215 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1216 );
1217
1218 impl CancelOperation {
1219 pub(crate) fn new(
1220 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataAccessControlService>,
1221 ) -> Self {
1222 Self(RequestBuilder::new(stub))
1223 }
1224
1225 /// Sets the full request, replacing any prior values.
1226 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1227 mut self,
1228 v: V,
1229 ) -> Self {
1230 self.0.request = v.into();
1231 self
1232 }
1233
1234 /// Sets all the options, replacing any prior values.
1235 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1236 self.0.options = v.into();
1237 self
1238 }
1239
1240 /// Sends the request.
1241 pub async fn send(self) -> Result<()> {
1242 (*self.0.stub)
1243 .cancel_operation(self.0.request, self.0.options)
1244 .await
1245 .map(crate::Response::into_body)
1246 }
1247
1248 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
1249 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1250 self.0.request.name = v.into();
1251 self
1252 }
1253 }
1254
1255 #[doc(hidden)]
1256 impl crate::RequestBuilder for CancelOperation {
1257 fn request_options(&mut self) -> &mut crate::RequestOptions {
1258 &mut self.0.options
1259 }
1260 }
1261}
1262
1263/// Request and client builders for [DataTableService][crate::client::DataTableService].
1264pub mod data_table_service {
1265 use crate::Result;
1266
1267 /// A builder for [DataTableService][crate::client::DataTableService].
1268 ///
1269 /// ```
1270 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1271 /// # use google_cloud_chronicle_v1::*;
1272 /// # use builder::data_table_service::ClientBuilder;
1273 /// # use client::DataTableService;
1274 /// let builder : ClientBuilder = DataTableService::builder();
1275 /// let client = builder
1276 /// .with_endpoint("https://chronicle.googleapis.com")
1277 /// .build().await?;
1278 /// # Ok(()) }
1279 /// ```
1280 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1281
1282 pub(crate) mod client {
1283 use super::super::super::client::DataTableService;
1284 pub struct Factory;
1285 impl crate::ClientFactory for Factory {
1286 type Client = DataTableService;
1287 type Credentials = gaxi::options::Credentials;
1288 async fn build(
1289 self,
1290 config: gaxi::options::ClientConfig,
1291 ) -> crate::ClientBuilderResult<Self::Client> {
1292 Self::Client::new(config).await
1293 }
1294 }
1295 }
1296
1297 /// Common implementation for [crate::client::DataTableService] request builders.
1298 #[derive(Clone, Debug)]
1299 pub(crate) struct RequestBuilder<R: std::default::Default> {
1300 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
1301 request: R,
1302 options: crate::RequestOptions,
1303 }
1304
1305 impl<R> RequestBuilder<R>
1306 where
1307 R: std::default::Default,
1308 {
1309 pub(crate) fn new(
1310 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
1311 ) -> Self {
1312 Self {
1313 stub,
1314 request: R::default(),
1315 options: crate::RequestOptions::default(),
1316 }
1317 }
1318 }
1319
1320 /// The request builder for [DataTableService::create_data_table][crate::client::DataTableService::create_data_table] calls.
1321 ///
1322 /// # Example
1323 /// ```
1324 /// # use google_cloud_chronicle_v1::builder::data_table_service::CreateDataTable;
1325 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1326 ///
1327 /// let builder = prepare_request_builder();
1328 /// let response = builder.send().await?;
1329 /// # Ok(()) }
1330 ///
1331 /// fn prepare_request_builder() -> CreateDataTable {
1332 /// # panic!();
1333 /// // ... details omitted ...
1334 /// }
1335 /// ```
1336 #[derive(Clone, Debug)]
1337 pub struct CreateDataTable(RequestBuilder<crate::model::CreateDataTableRequest>);
1338
1339 impl CreateDataTable {
1340 pub(crate) fn new(
1341 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
1342 ) -> Self {
1343 Self(RequestBuilder::new(stub))
1344 }
1345
1346 /// Sets the full request, replacing any prior values.
1347 pub fn with_request<V: Into<crate::model::CreateDataTableRequest>>(mut self, v: V) -> Self {
1348 self.0.request = v.into();
1349 self
1350 }
1351
1352 /// Sets all the options, replacing any prior values.
1353 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1354 self.0.options = v.into();
1355 self
1356 }
1357
1358 /// Sends the request.
1359 pub async fn send(self) -> Result<crate::model::DataTable> {
1360 (*self.0.stub)
1361 .create_data_table(self.0.request, self.0.options)
1362 .await
1363 .map(crate::Response::into_body)
1364 }
1365
1366 /// Sets the value of [parent][crate::model::CreateDataTableRequest::parent].
1367 ///
1368 /// This is a **required** field for requests.
1369 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1370 self.0.request.parent = v.into();
1371 self
1372 }
1373
1374 /// Sets the value of [data_table][crate::model::CreateDataTableRequest::data_table].
1375 ///
1376 /// This is a **required** field for requests.
1377 pub fn set_data_table<T>(mut self, v: T) -> Self
1378 where
1379 T: std::convert::Into<crate::model::DataTable>,
1380 {
1381 self.0.request.data_table = std::option::Option::Some(v.into());
1382 self
1383 }
1384
1385 /// Sets or clears the value of [data_table][crate::model::CreateDataTableRequest::data_table].
1386 ///
1387 /// This is a **required** field for requests.
1388 pub fn set_or_clear_data_table<T>(mut self, v: std::option::Option<T>) -> Self
1389 where
1390 T: std::convert::Into<crate::model::DataTable>,
1391 {
1392 self.0.request.data_table = v.map(|x| x.into());
1393 self
1394 }
1395
1396 /// Sets the value of [data_table_id][crate::model::CreateDataTableRequest::data_table_id].
1397 ///
1398 /// This is a **required** field for requests.
1399 pub fn set_data_table_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1400 self.0.request.data_table_id = v.into();
1401 self
1402 }
1403 }
1404
1405 #[doc(hidden)]
1406 impl crate::RequestBuilder for CreateDataTable {
1407 fn request_options(&mut self) -> &mut crate::RequestOptions {
1408 &mut self.0.options
1409 }
1410 }
1411
1412 /// The request builder for [DataTableService::list_data_tables][crate::client::DataTableService::list_data_tables] calls.
1413 ///
1414 /// # Example
1415 /// ```
1416 /// # use google_cloud_chronicle_v1::builder::data_table_service::ListDataTables;
1417 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1418 /// use google_cloud_gax::paginator::ItemPaginator;
1419 ///
1420 /// let builder = prepare_request_builder();
1421 /// let mut items = builder.by_item();
1422 /// while let Some(result) = items.next().await {
1423 /// let item = result?;
1424 /// }
1425 /// # Ok(()) }
1426 ///
1427 /// fn prepare_request_builder() -> ListDataTables {
1428 /// # panic!();
1429 /// // ... details omitted ...
1430 /// }
1431 /// ```
1432 #[derive(Clone, Debug)]
1433 pub struct ListDataTables(RequestBuilder<crate::model::ListDataTablesRequest>);
1434
1435 impl ListDataTables {
1436 pub(crate) fn new(
1437 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
1438 ) -> Self {
1439 Self(RequestBuilder::new(stub))
1440 }
1441
1442 /// Sets the full request, replacing any prior values.
1443 pub fn with_request<V: Into<crate::model::ListDataTablesRequest>>(mut self, v: V) -> Self {
1444 self.0.request = v.into();
1445 self
1446 }
1447
1448 /// Sets all the options, replacing any prior values.
1449 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1450 self.0.options = v.into();
1451 self
1452 }
1453
1454 /// Sends the request.
1455 pub async fn send(self) -> Result<crate::model::ListDataTablesResponse> {
1456 (*self.0.stub)
1457 .list_data_tables(self.0.request, self.0.options)
1458 .await
1459 .map(crate::Response::into_body)
1460 }
1461
1462 /// Streams each page in the collection.
1463 pub fn by_page(
1464 self,
1465 ) -> impl google_cloud_gax::paginator::Paginator<
1466 crate::model::ListDataTablesResponse,
1467 crate::Error,
1468 > {
1469 use std::clone::Clone;
1470 let token = self.0.request.page_token.clone();
1471 let execute = move |token: String| {
1472 let mut builder = self.clone();
1473 builder.0.request = builder.0.request.set_page_token(token);
1474 builder.send()
1475 };
1476 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1477 }
1478
1479 /// Streams each item in the collection.
1480 pub fn by_item(
1481 self,
1482 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1483 crate::model::ListDataTablesResponse,
1484 crate::Error,
1485 > {
1486 use google_cloud_gax::paginator::Paginator;
1487 self.by_page().items()
1488 }
1489
1490 /// Sets the value of [parent][crate::model::ListDataTablesRequest::parent].
1491 ///
1492 /// This is a **required** field for requests.
1493 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1494 self.0.request.parent = v.into();
1495 self
1496 }
1497
1498 /// Sets the value of [page_size][crate::model::ListDataTablesRequest::page_size].
1499 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1500 self.0.request.page_size = v.into();
1501 self
1502 }
1503
1504 /// Sets the value of [page_token][crate::model::ListDataTablesRequest::page_token].
1505 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1506 self.0.request.page_token = v.into();
1507 self
1508 }
1509
1510 /// Sets the value of [order_by][crate::model::ListDataTablesRequest::order_by].
1511 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1512 self.0.request.order_by = v.into();
1513 self
1514 }
1515 }
1516
1517 #[doc(hidden)]
1518 impl crate::RequestBuilder for ListDataTables {
1519 fn request_options(&mut self) -> &mut crate::RequestOptions {
1520 &mut self.0.options
1521 }
1522 }
1523
1524 /// The request builder for [DataTableService::get_data_table][crate::client::DataTableService::get_data_table] calls.
1525 ///
1526 /// # Example
1527 /// ```
1528 /// # use google_cloud_chronicle_v1::builder::data_table_service::GetDataTable;
1529 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1530 ///
1531 /// let builder = prepare_request_builder();
1532 /// let response = builder.send().await?;
1533 /// # Ok(()) }
1534 ///
1535 /// fn prepare_request_builder() -> GetDataTable {
1536 /// # panic!();
1537 /// // ... details omitted ...
1538 /// }
1539 /// ```
1540 #[derive(Clone, Debug)]
1541 pub struct GetDataTable(RequestBuilder<crate::model::GetDataTableRequest>);
1542
1543 impl GetDataTable {
1544 pub(crate) fn new(
1545 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
1546 ) -> Self {
1547 Self(RequestBuilder::new(stub))
1548 }
1549
1550 /// Sets the full request, replacing any prior values.
1551 pub fn with_request<V: Into<crate::model::GetDataTableRequest>>(mut self, v: V) -> Self {
1552 self.0.request = v.into();
1553 self
1554 }
1555
1556 /// Sets all the options, replacing any prior values.
1557 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1558 self.0.options = v.into();
1559 self
1560 }
1561
1562 /// Sends the request.
1563 pub async fn send(self) -> Result<crate::model::DataTable> {
1564 (*self.0.stub)
1565 .get_data_table(self.0.request, self.0.options)
1566 .await
1567 .map(crate::Response::into_body)
1568 }
1569
1570 /// Sets the value of [name][crate::model::GetDataTableRequest::name].
1571 ///
1572 /// This is a **required** field for requests.
1573 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1574 self.0.request.name = v.into();
1575 self
1576 }
1577 }
1578
1579 #[doc(hidden)]
1580 impl crate::RequestBuilder for GetDataTable {
1581 fn request_options(&mut self) -> &mut crate::RequestOptions {
1582 &mut self.0.options
1583 }
1584 }
1585
1586 /// The request builder for [DataTableService::update_data_table][crate::client::DataTableService::update_data_table] calls.
1587 ///
1588 /// # Example
1589 /// ```
1590 /// # use google_cloud_chronicle_v1::builder::data_table_service::UpdateDataTable;
1591 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1592 ///
1593 /// let builder = prepare_request_builder();
1594 /// let response = builder.send().await?;
1595 /// # Ok(()) }
1596 ///
1597 /// fn prepare_request_builder() -> UpdateDataTable {
1598 /// # panic!();
1599 /// // ... details omitted ...
1600 /// }
1601 /// ```
1602 #[derive(Clone, Debug)]
1603 pub struct UpdateDataTable(RequestBuilder<crate::model::UpdateDataTableRequest>);
1604
1605 impl UpdateDataTable {
1606 pub(crate) fn new(
1607 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
1608 ) -> Self {
1609 Self(RequestBuilder::new(stub))
1610 }
1611
1612 /// Sets the full request, replacing any prior values.
1613 pub fn with_request<V: Into<crate::model::UpdateDataTableRequest>>(mut self, v: V) -> Self {
1614 self.0.request = v.into();
1615 self
1616 }
1617
1618 /// Sets all the options, replacing any prior values.
1619 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1620 self.0.options = v.into();
1621 self
1622 }
1623
1624 /// Sends the request.
1625 pub async fn send(self) -> Result<crate::model::DataTable> {
1626 (*self.0.stub)
1627 .update_data_table(self.0.request, self.0.options)
1628 .await
1629 .map(crate::Response::into_body)
1630 }
1631
1632 /// Sets the value of [data_table][crate::model::UpdateDataTableRequest::data_table].
1633 ///
1634 /// This is a **required** field for requests.
1635 pub fn set_data_table<T>(mut self, v: T) -> Self
1636 where
1637 T: std::convert::Into<crate::model::DataTable>,
1638 {
1639 self.0.request.data_table = std::option::Option::Some(v.into());
1640 self
1641 }
1642
1643 /// Sets or clears the value of [data_table][crate::model::UpdateDataTableRequest::data_table].
1644 ///
1645 /// This is a **required** field for requests.
1646 pub fn set_or_clear_data_table<T>(mut self, v: std::option::Option<T>) -> Self
1647 where
1648 T: std::convert::Into<crate::model::DataTable>,
1649 {
1650 self.0.request.data_table = v.map(|x| x.into());
1651 self
1652 }
1653
1654 /// Sets the value of [update_mask][crate::model::UpdateDataTableRequest::update_mask].
1655 pub fn set_update_mask<T>(mut self, v: T) -> Self
1656 where
1657 T: std::convert::Into<wkt::FieldMask>,
1658 {
1659 self.0.request.update_mask = std::option::Option::Some(v.into());
1660 self
1661 }
1662
1663 /// Sets or clears the value of [update_mask][crate::model::UpdateDataTableRequest::update_mask].
1664 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1665 where
1666 T: std::convert::Into<wkt::FieldMask>,
1667 {
1668 self.0.request.update_mask = v.map(|x| x.into());
1669 self
1670 }
1671 }
1672
1673 #[doc(hidden)]
1674 impl crate::RequestBuilder for UpdateDataTable {
1675 fn request_options(&mut self) -> &mut crate::RequestOptions {
1676 &mut self.0.options
1677 }
1678 }
1679
1680 /// The request builder for [DataTableService::delete_data_table][crate::client::DataTableService::delete_data_table] calls.
1681 ///
1682 /// # Example
1683 /// ```
1684 /// # use google_cloud_chronicle_v1::builder::data_table_service::DeleteDataTable;
1685 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1686 ///
1687 /// let builder = prepare_request_builder();
1688 /// let response = builder.send().await?;
1689 /// # Ok(()) }
1690 ///
1691 /// fn prepare_request_builder() -> DeleteDataTable {
1692 /// # panic!();
1693 /// // ... details omitted ...
1694 /// }
1695 /// ```
1696 #[derive(Clone, Debug)]
1697 pub struct DeleteDataTable(RequestBuilder<crate::model::DeleteDataTableRequest>);
1698
1699 impl DeleteDataTable {
1700 pub(crate) fn new(
1701 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
1702 ) -> Self {
1703 Self(RequestBuilder::new(stub))
1704 }
1705
1706 /// Sets the full request, replacing any prior values.
1707 pub fn with_request<V: Into<crate::model::DeleteDataTableRequest>>(mut self, v: V) -> Self {
1708 self.0.request = v.into();
1709 self
1710 }
1711
1712 /// Sets all the options, replacing any prior values.
1713 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1714 self.0.options = v.into();
1715 self
1716 }
1717
1718 /// Sends the request.
1719 pub async fn send(self) -> Result<()> {
1720 (*self.0.stub)
1721 .delete_data_table(self.0.request, self.0.options)
1722 .await
1723 .map(crate::Response::into_body)
1724 }
1725
1726 /// Sets the value of [name][crate::model::DeleteDataTableRequest::name].
1727 ///
1728 /// This is a **required** field for requests.
1729 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1730 self.0.request.name = v.into();
1731 self
1732 }
1733
1734 /// Sets the value of [force][crate::model::DeleteDataTableRequest::force].
1735 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1736 self.0.request.force = v.into();
1737 self
1738 }
1739 }
1740
1741 #[doc(hidden)]
1742 impl crate::RequestBuilder for DeleteDataTable {
1743 fn request_options(&mut self) -> &mut crate::RequestOptions {
1744 &mut self.0.options
1745 }
1746 }
1747
1748 /// The request builder for [DataTableService::create_data_table_row][crate::client::DataTableService::create_data_table_row] calls.
1749 ///
1750 /// # Example
1751 /// ```
1752 /// # use google_cloud_chronicle_v1::builder::data_table_service::CreateDataTableRow;
1753 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1754 ///
1755 /// let builder = prepare_request_builder();
1756 /// let response = builder.send().await?;
1757 /// # Ok(()) }
1758 ///
1759 /// fn prepare_request_builder() -> CreateDataTableRow {
1760 /// # panic!();
1761 /// // ... details omitted ...
1762 /// }
1763 /// ```
1764 #[derive(Clone, Debug)]
1765 pub struct CreateDataTableRow(RequestBuilder<crate::model::CreateDataTableRowRequest>);
1766
1767 impl CreateDataTableRow {
1768 pub(crate) fn new(
1769 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
1770 ) -> Self {
1771 Self(RequestBuilder::new(stub))
1772 }
1773
1774 /// Sets the full request, replacing any prior values.
1775 pub fn with_request<V: Into<crate::model::CreateDataTableRowRequest>>(
1776 mut self,
1777 v: V,
1778 ) -> Self {
1779 self.0.request = v.into();
1780 self
1781 }
1782
1783 /// Sets all the options, replacing any prior values.
1784 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1785 self.0.options = v.into();
1786 self
1787 }
1788
1789 /// Sends the request.
1790 pub async fn send(self) -> Result<crate::model::DataTableRow> {
1791 (*self.0.stub)
1792 .create_data_table_row(self.0.request, self.0.options)
1793 .await
1794 .map(crate::Response::into_body)
1795 }
1796
1797 /// Sets the value of [parent][crate::model::CreateDataTableRowRequest::parent].
1798 ///
1799 /// This is a **required** field for requests.
1800 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1801 self.0.request.parent = v.into();
1802 self
1803 }
1804
1805 /// Sets the value of [data_table_row][crate::model::CreateDataTableRowRequest::data_table_row].
1806 ///
1807 /// This is a **required** field for requests.
1808 pub fn set_data_table_row<T>(mut self, v: T) -> Self
1809 where
1810 T: std::convert::Into<crate::model::DataTableRow>,
1811 {
1812 self.0.request.data_table_row = std::option::Option::Some(v.into());
1813 self
1814 }
1815
1816 /// Sets or clears the value of [data_table_row][crate::model::CreateDataTableRowRequest::data_table_row].
1817 ///
1818 /// This is a **required** field for requests.
1819 pub fn set_or_clear_data_table_row<T>(mut self, v: std::option::Option<T>) -> Self
1820 where
1821 T: std::convert::Into<crate::model::DataTableRow>,
1822 {
1823 self.0.request.data_table_row = v.map(|x| x.into());
1824 self
1825 }
1826 }
1827
1828 #[doc(hidden)]
1829 impl crate::RequestBuilder for CreateDataTableRow {
1830 fn request_options(&mut self) -> &mut crate::RequestOptions {
1831 &mut self.0.options
1832 }
1833 }
1834
1835 /// The request builder for [DataTableService::update_data_table_row][crate::client::DataTableService::update_data_table_row] calls.
1836 ///
1837 /// # Example
1838 /// ```
1839 /// # use google_cloud_chronicle_v1::builder::data_table_service::UpdateDataTableRow;
1840 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1841 ///
1842 /// let builder = prepare_request_builder();
1843 /// let response = builder.send().await?;
1844 /// # Ok(()) }
1845 ///
1846 /// fn prepare_request_builder() -> UpdateDataTableRow {
1847 /// # panic!();
1848 /// // ... details omitted ...
1849 /// }
1850 /// ```
1851 #[derive(Clone, Debug)]
1852 pub struct UpdateDataTableRow(RequestBuilder<crate::model::UpdateDataTableRowRequest>);
1853
1854 impl UpdateDataTableRow {
1855 pub(crate) fn new(
1856 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
1857 ) -> Self {
1858 Self(RequestBuilder::new(stub))
1859 }
1860
1861 /// Sets the full request, replacing any prior values.
1862 pub fn with_request<V: Into<crate::model::UpdateDataTableRowRequest>>(
1863 mut self,
1864 v: V,
1865 ) -> Self {
1866 self.0.request = v.into();
1867 self
1868 }
1869
1870 /// Sets all the options, replacing any prior values.
1871 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1872 self.0.options = v.into();
1873 self
1874 }
1875
1876 /// Sends the request.
1877 pub async fn send(self) -> Result<crate::model::DataTableRow> {
1878 (*self.0.stub)
1879 .update_data_table_row(self.0.request, self.0.options)
1880 .await
1881 .map(crate::Response::into_body)
1882 }
1883
1884 /// Sets the value of [data_table_row][crate::model::UpdateDataTableRowRequest::data_table_row].
1885 ///
1886 /// This is a **required** field for requests.
1887 pub fn set_data_table_row<T>(mut self, v: T) -> Self
1888 where
1889 T: std::convert::Into<crate::model::DataTableRow>,
1890 {
1891 self.0.request.data_table_row = std::option::Option::Some(v.into());
1892 self
1893 }
1894
1895 /// Sets or clears the value of [data_table_row][crate::model::UpdateDataTableRowRequest::data_table_row].
1896 ///
1897 /// This is a **required** field for requests.
1898 pub fn set_or_clear_data_table_row<T>(mut self, v: std::option::Option<T>) -> Self
1899 where
1900 T: std::convert::Into<crate::model::DataTableRow>,
1901 {
1902 self.0.request.data_table_row = v.map(|x| x.into());
1903 self
1904 }
1905
1906 /// Sets the value of [update_mask][crate::model::UpdateDataTableRowRequest::update_mask].
1907 pub fn set_update_mask<T>(mut self, v: T) -> Self
1908 where
1909 T: std::convert::Into<wkt::FieldMask>,
1910 {
1911 self.0.request.update_mask = std::option::Option::Some(v.into());
1912 self
1913 }
1914
1915 /// Sets or clears the value of [update_mask][crate::model::UpdateDataTableRowRequest::update_mask].
1916 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1917 where
1918 T: std::convert::Into<wkt::FieldMask>,
1919 {
1920 self.0.request.update_mask = v.map(|x| x.into());
1921 self
1922 }
1923 }
1924
1925 #[doc(hidden)]
1926 impl crate::RequestBuilder for UpdateDataTableRow {
1927 fn request_options(&mut self) -> &mut crate::RequestOptions {
1928 &mut self.0.options
1929 }
1930 }
1931
1932 /// The request builder for [DataTableService::list_data_table_rows][crate::client::DataTableService::list_data_table_rows] calls.
1933 ///
1934 /// # Example
1935 /// ```
1936 /// # use google_cloud_chronicle_v1::builder::data_table_service::ListDataTableRows;
1937 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
1938 /// use google_cloud_gax::paginator::ItemPaginator;
1939 ///
1940 /// let builder = prepare_request_builder();
1941 /// let mut items = builder.by_item();
1942 /// while let Some(result) = items.next().await {
1943 /// let item = result?;
1944 /// }
1945 /// # Ok(()) }
1946 ///
1947 /// fn prepare_request_builder() -> ListDataTableRows {
1948 /// # panic!();
1949 /// // ... details omitted ...
1950 /// }
1951 /// ```
1952 #[derive(Clone, Debug)]
1953 pub struct ListDataTableRows(RequestBuilder<crate::model::ListDataTableRowsRequest>);
1954
1955 impl ListDataTableRows {
1956 pub(crate) fn new(
1957 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
1958 ) -> Self {
1959 Self(RequestBuilder::new(stub))
1960 }
1961
1962 /// Sets the full request, replacing any prior values.
1963 pub fn with_request<V: Into<crate::model::ListDataTableRowsRequest>>(
1964 mut self,
1965 v: V,
1966 ) -> Self {
1967 self.0.request = v.into();
1968 self
1969 }
1970
1971 /// Sets all the options, replacing any prior values.
1972 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1973 self.0.options = v.into();
1974 self
1975 }
1976
1977 /// Sends the request.
1978 pub async fn send(self) -> Result<crate::model::ListDataTableRowsResponse> {
1979 (*self.0.stub)
1980 .list_data_table_rows(self.0.request, self.0.options)
1981 .await
1982 .map(crate::Response::into_body)
1983 }
1984
1985 /// Streams each page in the collection.
1986 pub fn by_page(
1987 self,
1988 ) -> impl google_cloud_gax::paginator::Paginator<
1989 crate::model::ListDataTableRowsResponse,
1990 crate::Error,
1991 > {
1992 use std::clone::Clone;
1993 let token = self.0.request.page_token.clone();
1994 let execute = move |token: String| {
1995 let mut builder = self.clone();
1996 builder.0.request = builder.0.request.set_page_token(token);
1997 builder.send()
1998 };
1999 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2000 }
2001
2002 /// Streams each item in the collection.
2003 pub fn by_item(
2004 self,
2005 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2006 crate::model::ListDataTableRowsResponse,
2007 crate::Error,
2008 > {
2009 use google_cloud_gax::paginator::Paginator;
2010 self.by_page().items()
2011 }
2012
2013 /// Sets the value of [parent][crate::model::ListDataTableRowsRequest::parent].
2014 ///
2015 /// This is a **required** field for requests.
2016 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2017 self.0.request.parent = v.into();
2018 self
2019 }
2020
2021 /// Sets the value of [page_size][crate::model::ListDataTableRowsRequest::page_size].
2022 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2023 self.0.request.page_size = v.into();
2024 self
2025 }
2026
2027 /// Sets the value of [page_token][crate::model::ListDataTableRowsRequest::page_token].
2028 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2029 self.0.request.page_token = v.into();
2030 self
2031 }
2032
2033 /// Sets the value of [order_by][crate::model::ListDataTableRowsRequest::order_by].
2034 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2035 self.0.request.order_by = v.into();
2036 self
2037 }
2038
2039 /// Sets the value of [filter][crate::model::ListDataTableRowsRequest::filter].
2040 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2041 self.0.request.filter = v.into();
2042 self
2043 }
2044 }
2045
2046 #[doc(hidden)]
2047 impl crate::RequestBuilder for ListDataTableRows {
2048 fn request_options(&mut self) -> &mut crate::RequestOptions {
2049 &mut self.0.options
2050 }
2051 }
2052
2053 /// The request builder for [DataTableService::get_data_table_row][crate::client::DataTableService::get_data_table_row] calls.
2054 ///
2055 /// # Example
2056 /// ```
2057 /// # use google_cloud_chronicle_v1::builder::data_table_service::GetDataTableRow;
2058 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2059 ///
2060 /// let builder = prepare_request_builder();
2061 /// let response = builder.send().await?;
2062 /// # Ok(()) }
2063 ///
2064 /// fn prepare_request_builder() -> GetDataTableRow {
2065 /// # panic!();
2066 /// // ... details omitted ...
2067 /// }
2068 /// ```
2069 #[derive(Clone, Debug)]
2070 pub struct GetDataTableRow(RequestBuilder<crate::model::GetDataTableRowRequest>);
2071
2072 impl GetDataTableRow {
2073 pub(crate) fn new(
2074 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
2075 ) -> Self {
2076 Self(RequestBuilder::new(stub))
2077 }
2078
2079 /// Sets the full request, replacing any prior values.
2080 pub fn with_request<V: Into<crate::model::GetDataTableRowRequest>>(mut self, v: V) -> Self {
2081 self.0.request = v.into();
2082 self
2083 }
2084
2085 /// Sets all the options, replacing any prior values.
2086 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2087 self.0.options = v.into();
2088 self
2089 }
2090
2091 /// Sends the request.
2092 pub async fn send(self) -> Result<crate::model::DataTableRow> {
2093 (*self.0.stub)
2094 .get_data_table_row(self.0.request, self.0.options)
2095 .await
2096 .map(crate::Response::into_body)
2097 }
2098
2099 /// Sets the value of [name][crate::model::GetDataTableRowRequest::name].
2100 ///
2101 /// This is a **required** field for requests.
2102 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2103 self.0.request.name = v.into();
2104 self
2105 }
2106 }
2107
2108 #[doc(hidden)]
2109 impl crate::RequestBuilder for GetDataTableRow {
2110 fn request_options(&mut self) -> &mut crate::RequestOptions {
2111 &mut self.0.options
2112 }
2113 }
2114
2115 /// The request builder for [DataTableService::delete_data_table_row][crate::client::DataTableService::delete_data_table_row] calls.
2116 ///
2117 /// # Example
2118 /// ```
2119 /// # use google_cloud_chronicle_v1::builder::data_table_service::DeleteDataTableRow;
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() -> DeleteDataTableRow {
2127 /// # panic!();
2128 /// // ... details omitted ...
2129 /// }
2130 /// ```
2131 #[derive(Clone, Debug)]
2132 pub struct DeleteDataTableRow(RequestBuilder<crate::model::DeleteDataTableRowRequest>);
2133
2134 impl DeleteDataTableRow {
2135 pub(crate) fn new(
2136 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
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::DeleteDataTableRowRequest>>(
2143 mut self,
2144 v: V,
2145 ) -> Self {
2146 self.0.request = v.into();
2147 self
2148 }
2149
2150 /// Sets all the options, replacing any prior values.
2151 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2152 self.0.options = v.into();
2153 self
2154 }
2155
2156 /// Sends the request.
2157 pub async fn send(self) -> Result<()> {
2158 (*self.0.stub)
2159 .delete_data_table_row(self.0.request, self.0.options)
2160 .await
2161 .map(crate::Response::into_body)
2162 }
2163
2164 /// Sets the value of [name][crate::model::DeleteDataTableRowRequest::name].
2165 ///
2166 /// This is a **required** field for requests.
2167 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2168 self.0.request.name = v.into();
2169 self
2170 }
2171 }
2172
2173 #[doc(hidden)]
2174 impl crate::RequestBuilder for DeleteDataTableRow {
2175 fn request_options(&mut self) -> &mut crate::RequestOptions {
2176 &mut self.0.options
2177 }
2178 }
2179
2180 /// The request builder for [DataTableService::bulk_create_data_table_rows][crate::client::DataTableService::bulk_create_data_table_rows] calls.
2181 ///
2182 /// # Example
2183 /// ```
2184 /// # use google_cloud_chronicle_v1::builder::data_table_service::BulkCreateDataTableRows;
2185 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2186 ///
2187 /// let builder = prepare_request_builder();
2188 /// let response = builder.send().await?;
2189 /// # Ok(()) }
2190 ///
2191 /// fn prepare_request_builder() -> BulkCreateDataTableRows {
2192 /// # panic!();
2193 /// // ... details omitted ...
2194 /// }
2195 /// ```
2196 #[derive(Clone, Debug)]
2197 pub struct BulkCreateDataTableRows(
2198 RequestBuilder<crate::model::BulkCreateDataTableRowsRequest>,
2199 );
2200
2201 impl BulkCreateDataTableRows {
2202 pub(crate) fn new(
2203 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
2204 ) -> Self {
2205 Self(RequestBuilder::new(stub))
2206 }
2207
2208 /// Sets the full request, replacing any prior values.
2209 pub fn with_request<V: Into<crate::model::BulkCreateDataTableRowsRequest>>(
2210 mut self,
2211 v: V,
2212 ) -> Self {
2213 self.0.request = v.into();
2214 self
2215 }
2216
2217 /// Sets all the options, replacing any prior values.
2218 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2219 self.0.options = v.into();
2220 self
2221 }
2222
2223 /// Sends the request.
2224 pub async fn send(self) -> Result<crate::model::BulkCreateDataTableRowsResponse> {
2225 (*self.0.stub)
2226 .bulk_create_data_table_rows(self.0.request, self.0.options)
2227 .await
2228 .map(crate::Response::into_body)
2229 }
2230
2231 /// Sets the value of [parent][crate::model::BulkCreateDataTableRowsRequest::parent].
2232 ///
2233 /// This is a **required** field for requests.
2234 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2235 self.0.request.parent = v.into();
2236 self
2237 }
2238
2239 /// Sets the value of [requests][crate::model::BulkCreateDataTableRowsRequest::requests].
2240 ///
2241 /// This is a **required** field for requests.
2242 pub fn set_requests<T, V>(mut self, v: T) -> Self
2243 where
2244 T: std::iter::IntoIterator<Item = V>,
2245 V: std::convert::Into<crate::model::CreateDataTableRowRequest>,
2246 {
2247 use std::iter::Iterator;
2248 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
2249 self
2250 }
2251 }
2252
2253 #[doc(hidden)]
2254 impl crate::RequestBuilder for BulkCreateDataTableRows {
2255 fn request_options(&mut self) -> &mut crate::RequestOptions {
2256 &mut self.0.options
2257 }
2258 }
2259
2260 /// The request builder for [DataTableService::bulk_get_data_table_rows][crate::client::DataTableService::bulk_get_data_table_rows] calls.
2261 ///
2262 /// # Example
2263 /// ```
2264 /// # use google_cloud_chronicle_v1::builder::data_table_service::BulkGetDataTableRows;
2265 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2266 ///
2267 /// let builder = prepare_request_builder();
2268 /// let response = builder.send().await?;
2269 /// # Ok(()) }
2270 ///
2271 /// fn prepare_request_builder() -> BulkGetDataTableRows {
2272 /// # panic!();
2273 /// // ... details omitted ...
2274 /// }
2275 /// ```
2276 #[derive(Clone, Debug)]
2277 pub struct BulkGetDataTableRows(RequestBuilder<crate::model::BulkGetDataTableRowsRequest>);
2278
2279 impl BulkGetDataTableRows {
2280 pub(crate) fn new(
2281 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
2282 ) -> Self {
2283 Self(RequestBuilder::new(stub))
2284 }
2285
2286 /// Sets the full request, replacing any prior values.
2287 pub fn with_request<V: Into<crate::model::BulkGetDataTableRowsRequest>>(
2288 mut self,
2289 v: V,
2290 ) -> Self {
2291 self.0.request = v.into();
2292 self
2293 }
2294
2295 /// Sets all the options, replacing any prior values.
2296 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2297 self.0.options = v.into();
2298 self
2299 }
2300
2301 /// Sends the request.
2302 pub async fn send(self) -> Result<crate::model::BulkGetDataTableRowsResponse> {
2303 (*self.0.stub)
2304 .bulk_get_data_table_rows(self.0.request, self.0.options)
2305 .await
2306 .map(crate::Response::into_body)
2307 }
2308
2309 /// Sets the value of [parent][crate::model::BulkGetDataTableRowsRequest::parent].
2310 ///
2311 /// This is a **required** field for requests.
2312 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2313 self.0.request.parent = v.into();
2314 self
2315 }
2316
2317 /// Sets the value of [requests][crate::model::BulkGetDataTableRowsRequest::requests].
2318 ///
2319 /// This is a **required** field for requests.
2320 pub fn set_requests<T, V>(mut self, v: T) -> Self
2321 where
2322 T: std::iter::IntoIterator<Item = V>,
2323 V: std::convert::Into<crate::model::GetDataTableRowRequest>,
2324 {
2325 use std::iter::Iterator;
2326 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
2327 self
2328 }
2329 }
2330
2331 #[doc(hidden)]
2332 impl crate::RequestBuilder for BulkGetDataTableRows {
2333 fn request_options(&mut self) -> &mut crate::RequestOptions {
2334 &mut self.0.options
2335 }
2336 }
2337
2338 /// The request builder for [DataTableService::bulk_replace_data_table_rows][crate::client::DataTableService::bulk_replace_data_table_rows] calls.
2339 ///
2340 /// # Example
2341 /// ```
2342 /// # use google_cloud_chronicle_v1::builder::data_table_service::BulkReplaceDataTableRows;
2343 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2344 ///
2345 /// let builder = prepare_request_builder();
2346 /// let response = builder.send().await?;
2347 /// # Ok(()) }
2348 ///
2349 /// fn prepare_request_builder() -> BulkReplaceDataTableRows {
2350 /// # panic!();
2351 /// // ... details omitted ...
2352 /// }
2353 /// ```
2354 #[derive(Clone, Debug)]
2355 pub struct BulkReplaceDataTableRows(
2356 RequestBuilder<crate::model::BulkReplaceDataTableRowsRequest>,
2357 );
2358
2359 impl BulkReplaceDataTableRows {
2360 pub(crate) fn new(
2361 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
2362 ) -> Self {
2363 Self(RequestBuilder::new(stub))
2364 }
2365
2366 /// Sets the full request, replacing any prior values.
2367 pub fn with_request<V: Into<crate::model::BulkReplaceDataTableRowsRequest>>(
2368 mut self,
2369 v: V,
2370 ) -> Self {
2371 self.0.request = v.into();
2372 self
2373 }
2374
2375 /// Sets all the options, replacing any prior values.
2376 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2377 self.0.options = v.into();
2378 self
2379 }
2380
2381 /// Sends the request.
2382 pub async fn send(self) -> Result<crate::model::BulkReplaceDataTableRowsResponse> {
2383 (*self.0.stub)
2384 .bulk_replace_data_table_rows(self.0.request, self.0.options)
2385 .await
2386 .map(crate::Response::into_body)
2387 }
2388
2389 /// Sets the value of [parent][crate::model::BulkReplaceDataTableRowsRequest::parent].
2390 ///
2391 /// This is a **required** field for requests.
2392 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2393 self.0.request.parent = v.into();
2394 self
2395 }
2396
2397 /// Sets the value of [requests][crate::model::BulkReplaceDataTableRowsRequest::requests].
2398 ///
2399 /// This is a **required** field for requests.
2400 pub fn set_requests<T, V>(mut self, v: T) -> Self
2401 where
2402 T: std::iter::IntoIterator<Item = V>,
2403 V: std::convert::Into<crate::model::CreateDataTableRowRequest>,
2404 {
2405 use std::iter::Iterator;
2406 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
2407 self
2408 }
2409 }
2410
2411 #[doc(hidden)]
2412 impl crate::RequestBuilder for BulkReplaceDataTableRows {
2413 fn request_options(&mut self) -> &mut crate::RequestOptions {
2414 &mut self.0.options
2415 }
2416 }
2417
2418 /// The request builder for [DataTableService::bulk_update_data_table_rows][crate::client::DataTableService::bulk_update_data_table_rows] calls.
2419 ///
2420 /// # Example
2421 /// ```
2422 /// # use google_cloud_chronicle_v1::builder::data_table_service::BulkUpdateDataTableRows;
2423 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2424 ///
2425 /// let builder = prepare_request_builder();
2426 /// let response = builder.send().await?;
2427 /// # Ok(()) }
2428 ///
2429 /// fn prepare_request_builder() -> BulkUpdateDataTableRows {
2430 /// # panic!();
2431 /// // ... details omitted ...
2432 /// }
2433 /// ```
2434 #[derive(Clone, Debug)]
2435 pub struct BulkUpdateDataTableRows(
2436 RequestBuilder<crate::model::BulkUpdateDataTableRowsRequest>,
2437 );
2438
2439 impl BulkUpdateDataTableRows {
2440 pub(crate) fn new(
2441 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
2442 ) -> Self {
2443 Self(RequestBuilder::new(stub))
2444 }
2445
2446 /// Sets the full request, replacing any prior values.
2447 pub fn with_request<V: Into<crate::model::BulkUpdateDataTableRowsRequest>>(
2448 mut self,
2449 v: V,
2450 ) -> Self {
2451 self.0.request = v.into();
2452 self
2453 }
2454
2455 /// Sets all the options, replacing any prior values.
2456 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2457 self.0.options = v.into();
2458 self
2459 }
2460
2461 /// Sends the request.
2462 pub async fn send(self) -> Result<crate::model::BulkUpdateDataTableRowsResponse> {
2463 (*self.0.stub)
2464 .bulk_update_data_table_rows(self.0.request, self.0.options)
2465 .await
2466 .map(crate::Response::into_body)
2467 }
2468
2469 /// Sets the value of [parent][crate::model::BulkUpdateDataTableRowsRequest::parent].
2470 ///
2471 /// This is a **required** field for requests.
2472 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2473 self.0.request.parent = v.into();
2474 self
2475 }
2476
2477 /// Sets the value of [requests][crate::model::BulkUpdateDataTableRowsRequest::requests].
2478 ///
2479 /// This is a **required** field for requests.
2480 pub fn set_requests<T, V>(mut self, v: T) -> Self
2481 where
2482 T: std::iter::IntoIterator<Item = V>,
2483 V: std::convert::Into<crate::model::UpdateDataTableRowRequest>,
2484 {
2485 use std::iter::Iterator;
2486 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
2487 self
2488 }
2489 }
2490
2491 #[doc(hidden)]
2492 impl crate::RequestBuilder for BulkUpdateDataTableRows {
2493 fn request_options(&mut self) -> &mut crate::RequestOptions {
2494 &mut self.0.options
2495 }
2496 }
2497
2498 /// The request builder for [DataTableService::get_data_table_operation_errors][crate::client::DataTableService::get_data_table_operation_errors] calls.
2499 ///
2500 /// # Example
2501 /// ```
2502 /// # use google_cloud_chronicle_v1::builder::data_table_service::GetDataTableOperationErrors;
2503 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2504 ///
2505 /// let builder = prepare_request_builder();
2506 /// let response = builder.send().await?;
2507 /// # Ok(()) }
2508 ///
2509 /// fn prepare_request_builder() -> GetDataTableOperationErrors {
2510 /// # panic!();
2511 /// // ... details omitted ...
2512 /// }
2513 /// ```
2514 #[derive(Clone, Debug)]
2515 pub struct GetDataTableOperationErrors(
2516 RequestBuilder<crate::model::GetDataTableOperationErrorsRequest>,
2517 );
2518
2519 impl GetDataTableOperationErrors {
2520 pub(crate) fn new(
2521 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
2522 ) -> Self {
2523 Self(RequestBuilder::new(stub))
2524 }
2525
2526 /// Sets the full request, replacing any prior values.
2527 pub fn with_request<V: Into<crate::model::GetDataTableOperationErrorsRequest>>(
2528 mut self,
2529 v: V,
2530 ) -> Self {
2531 self.0.request = v.into();
2532 self
2533 }
2534
2535 /// Sets all the options, replacing any prior values.
2536 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2537 self.0.options = v.into();
2538 self
2539 }
2540
2541 /// Sends the request.
2542 pub async fn send(self) -> Result<crate::model::DataTableOperationErrors> {
2543 (*self.0.stub)
2544 .get_data_table_operation_errors(self.0.request, self.0.options)
2545 .await
2546 .map(crate::Response::into_body)
2547 }
2548
2549 /// Sets the value of [name][crate::model::GetDataTableOperationErrorsRequest::name].
2550 ///
2551 /// This is a **required** field for requests.
2552 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2553 self.0.request.name = v.into();
2554 self
2555 }
2556 }
2557
2558 #[doc(hidden)]
2559 impl crate::RequestBuilder for GetDataTableOperationErrors {
2560 fn request_options(&mut self) -> &mut crate::RequestOptions {
2561 &mut self.0.options
2562 }
2563 }
2564
2565 /// The request builder for [DataTableService::list_operations][crate::client::DataTableService::list_operations] calls.
2566 ///
2567 /// # Example
2568 /// ```
2569 /// # use google_cloud_chronicle_v1::builder::data_table_service::ListOperations;
2570 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2571 /// use google_cloud_gax::paginator::ItemPaginator;
2572 ///
2573 /// let builder = prepare_request_builder();
2574 /// let mut items = builder.by_item();
2575 /// while let Some(result) = items.next().await {
2576 /// let item = result?;
2577 /// }
2578 /// # Ok(()) }
2579 ///
2580 /// fn prepare_request_builder() -> ListOperations {
2581 /// # panic!();
2582 /// // ... details omitted ...
2583 /// }
2584 /// ```
2585 #[derive(Clone, Debug)]
2586 pub struct ListOperations(
2587 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2588 );
2589
2590 impl ListOperations {
2591 pub(crate) fn new(
2592 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
2593 ) -> Self {
2594 Self(RequestBuilder::new(stub))
2595 }
2596
2597 /// Sets the full request, replacing any prior values.
2598 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2599 mut self,
2600 v: V,
2601 ) -> Self {
2602 self.0.request = v.into();
2603 self
2604 }
2605
2606 /// Sets all the options, replacing any prior values.
2607 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2608 self.0.options = v.into();
2609 self
2610 }
2611
2612 /// Sends the request.
2613 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2614 (*self.0.stub)
2615 .list_operations(self.0.request, self.0.options)
2616 .await
2617 .map(crate::Response::into_body)
2618 }
2619
2620 /// Streams each page in the collection.
2621 pub fn by_page(
2622 self,
2623 ) -> impl google_cloud_gax::paginator::Paginator<
2624 google_cloud_longrunning::model::ListOperationsResponse,
2625 crate::Error,
2626 > {
2627 use std::clone::Clone;
2628 let token = self.0.request.page_token.clone();
2629 let execute = move |token: String| {
2630 let mut builder = self.clone();
2631 builder.0.request = builder.0.request.set_page_token(token);
2632 builder.send()
2633 };
2634 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2635 }
2636
2637 /// Streams each item in the collection.
2638 pub fn by_item(
2639 self,
2640 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2641 google_cloud_longrunning::model::ListOperationsResponse,
2642 crate::Error,
2643 > {
2644 use google_cloud_gax::paginator::Paginator;
2645 self.by_page().items()
2646 }
2647
2648 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
2649 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2650 self.0.request.name = v.into();
2651 self
2652 }
2653
2654 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
2655 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2656 self.0.request.filter = v.into();
2657 self
2658 }
2659
2660 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2661 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2662 self.0.request.page_size = v.into();
2663 self
2664 }
2665
2666 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2667 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2668 self.0.request.page_token = v.into();
2669 self
2670 }
2671
2672 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2673 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2674 self.0.request.return_partial_success = v.into();
2675 self
2676 }
2677 }
2678
2679 #[doc(hidden)]
2680 impl crate::RequestBuilder for ListOperations {
2681 fn request_options(&mut self) -> &mut crate::RequestOptions {
2682 &mut self.0.options
2683 }
2684 }
2685
2686 /// The request builder for [DataTableService::get_operation][crate::client::DataTableService::get_operation] calls.
2687 ///
2688 /// # Example
2689 /// ```
2690 /// # use google_cloud_chronicle_v1::builder::data_table_service::GetOperation;
2691 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2692 ///
2693 /// let builder = prepare_request_builder();
2694 /// let response = builder.send().await?;
2695 /// # Ok(()) }
2696 ///
2697 /// fn prepare_request_builder() -> GetOperation {
2698 /// # panic!();
2699 /// // ... details omitted ...
2700 /// }
2701 /// ```
2702 #[derive(Clone, Debug)]
2703 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2704
2705 impl GetOperation {
2706 pub(crate) fn new(
2707 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
2708 ) -> Self {
2709 Self(RequestBuilder::new(stub))
2710 }
2711
2712 /// Sets the full request, replacing any prior values.
2713 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2714 mut self,
2715 v: V,
2716 ) -> Self {
2717 self.0.request = v.into();
2718 self
2719 }
2720
2721 /// Sets all the options, replacing any prior values.
2722 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2723 self.0.options = v.into();
2724 self
2725 }
2726
2727 /// Sends the request.
2728 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2729 (*self.0.stub)
2730 .get_operation(self.0.request, self.0.options)
2731 .await
2732 .map(crate::Response::into_body)
2733 }
2734
2735 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2736 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2737 self.0.request.name = v.into();
2738 self
2739 }
2740 }
2741
2742 #[doc(hidden)]
2743 impl crate::RequestBuilder for GetOperation {
2744 fn request_options(&mut self) -> &mut crate::RequestOptions {
2745 &mut self.0.options
2746 }
2747 }
2748
2749 /// The request builder for [DataTableService::delete_operation][crate::client::DataTableService::delete_operation] calls.
2750 ///
2751 /// # Example
2752 /// ```
2753 /// # use google_cloud_chronicle_v1::builder::data_table_service::DeleteOperation;
2754 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2755 ///
2756 /// let builder = prepare_request_builder();
2757 /// let response = builder.send().await?;
2758 /// # Ok(()) }
2759 ///
2760 /// fn prepare_request_builder() -> DeleteOperation {
2761 /// # panic!();
2762 /// // ... details omitted ...
2763 /// }
2764 /// ```
2765 #[derive(Clone, Debug)]
2766 pub struct DeleteOperation(
2767 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2768 );
2769
2770 impl DeleteOperation {
2771 pub(crate) fn new(
2772 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
2773 ) -> Self {
2774 Self(RequestBuilder::new(stub))
2775 }
2776
2777 /// Sets the full request, replacing any prior values.
2778 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2779 mut self,
2780 v: V,
2781 ) -> Self {
2782 self.0.request = v.into();
2783 self
2784 }
2785
2786 /// Sets all the options, replacing any prior values.
2787 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2788 self.0.options = v.into();
2789 self
2790 }
2791
2792 /// Sends the request.
2793 pub async fn send(self) -> Result<()> {
2794 (*self.0.stub)
2795 .delete_operation(self.0.request, self.0.options)
2796 .await
2797 .map(crate::Response::into_body)
2798 }
2799
2800 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
2801 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2802 self.0.request.name = v.into();
2803 self
2804 }
2805 }
2806
2807 #[doc(hidden)]
2808 impl crate::RequestBuilder for DeleteOperation {
2809 fn request_options(&mut self) -> &mut crate::RequestOptions {
2810 &mut self.0.options
2811 }
2812 }
2813
2814 /// The request builder for [DataTableService::cancel_operation][crate::client::DataTableService::cancel_operation] calls.
2815 ///
2816 /// # Example
2817 /// ```
2818 /// # use google_cloud_chronicle_v1::builder::data_table_service::CancelOperation;
2819 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2820 ///
2821 /// let builder = prepare_request_builder();
2822 /// let response = builder.send().await?;
2823 /// # Ok(()) }
2824 ///
2825 /// fn prepare_request_builder() -> CancelOperation {
2826 /// # panic!();
2827 /// // ... details omitted ...
2828 /// }
2829 /// ```
2830 #[derive(Clone, Debug)]
2831 pub struct CancelOperation(
2832 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2833 );
2834
2835 impl CancelOperation {
2836 pub(crate) fn new(
2837 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataTableService>,
2838 ) -> Self {
2839 Self(RequestBuilder::new(stub))
2840 }
2841
2842 /// Sets the full request, replacing any prior values.
2843 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2844 mut self,
2845 v: V,
2846 ) -> Self {
2847 self.0.request = v.into();
2848 self
2849 }
2850
2851 /// Sets all the options, replacing any prior values.
2852 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2853 self.0.options = v.into();
2854 self
2855 }
2856
2857 /// Sends the request.
2858 pub async fn send(self) -> Result<()> {
2859 (*self.0.stub)
2860 .cancel_operation(self.0.request, self.0.options)
2861 .await
2862 .map(crate::Response::into_body)
2863 }
2864
2865 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2866 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2867 self.0.request.name = v.into();
2868 self
2869 }
2870 }
2871
2872 #[doc(hidden)]
2873 impl crate::RequestBuilder for CancelOperation {
2874 fn request_options(&mut self) -> &mut crate::RequestOptions {
2875 &mut self.0.options
2876 }
2877 }
2878}
2879
2880/// Request and client builders for [EntityService][crate::client::EntityService].
2881pub mod entity_service {
2882 use crate::Result;
2883
2884 /// A builder for [EntityService][crate::client::EntityService].
2885 ///
2886 /// ```
2887 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2888 /// # use google_cloud_chronicle_v1::*;
2889 /// # use builder::entity_service::ClientBuilder;
2890 /// # use client::EntityService;
2891 /// let builder : ClientBuilder = EntityService::builder();
2892 /// let client = builder
2893 /// .with_endpoint("https://chronicle.googleapis.com")
2894 /// .build().await?;
2895 /// # Ok(()) }
2896 /// ```
2897 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2898
2899 pub(crate) mod client {
2900 use super::super::super::client::EntityService;
2901 pub struct Factory;
2902 impl crate::ClientFactory for Factory {
2903 type Client = EntityService;
2904 type Credentials = gaxi::options::Credentials;
2905 async fn build(
2906 self,
2907 config: gaxi::options::ClientConfig,
2908 ) -> crate::ClientBuilderResult<Self::Client> {
2909 Self::Client::new(config).await
2910 }
2911 }
2912 }
2913
2914 /// Common implementation for [crate::client::EntityService] request builders.
2915 #[derive(Clone, Debug)]
2916 pub(crate) struct RequestBuilder<R: std::default::Default> {
2917 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
2918 request: R,
2919 options: crate::RequestOptions,
2920 }
2921
2922 impl<R> RequestBuilder<R>
2923 where
2924 R: std::default::Default,
2925 {
2926 pub(crate) fn new(
2927 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
2928 ) -> Self {
2929 Self {
2930 stub,
2931 request: R::default(),
2932 options: crate::RequestOptions::default(),
2933 }
2934 }
2935 }
2936
2937 /// The request builder for [EntityService::get_watchlist][crate::client::EntityService::get_watchlist] calls.
2938 ///
2939 /// # Example
2940 /// ```
2941 /// # use google_cloud_chronicle_v1::builder::entity_service::GetWatchlist;
2942 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
2943 ///
2944 /// let builder = prepare_request_builder();
2945 /// let response = builder.send().await?;
2946 /// # Ok(()) }
2947 ///
2948 /// fn prepare_request_builder() -> GetWatchlist {
2949 /// # panic!();
2950 /// // ... details omitted ...
2951 /// }
2952 /// ```
2953 #[derive(Clone, Debug)]
2954 pub struct GetWatchlist(RequestBuilder<crate::model::GetWatchlistRequest>);
2955
2956 impl GetWatchlist {
2957 pub(crate) fn new(
2958 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
2959 ) -> Self {
2960 Self(RequestBuilder::new(stub))
2961 }
2962
2963 /// Sets the full request, replacing any prior values.
2964 pub fn with_request<V: Into<crate::model::GetWatchlistRequest>>(mut self, v: V) -> Self {
2965 self.0.request = v.into();
2966 self
2967 }
2968
2969 /// Sets all the options, replacing any prior values.
2970 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2971 self.0.options = v.into();
2972 self
2973 }
2974
2975 /// Sends the request.
2976 pub async fn send(self) -> Result<crate::model::Watchlist> {
2977 (*self.0.stub)
2978 .get_watchlist(self.0.request, self.0.options)
2979 .await
2980 .map(crate::Response::into_body)
2981 }
2982
2983 /// Sets the value of [name][crate::model::GetWatchlistRequest::name].
2984 ///
2985 /// This is a **required** field for requests.
2986 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2987 self.0.request.name = v.into();
2988 self
2989 }
2990 }
2991
2992 #[doc(hidden)]
2993 impl crate::RequestBuilder for GetWatchlist {
2994 fn request_options(&mut self) -> &mut crate::RequestOptions {
2995 &mut self.0.options
2996 }
2997 }
2998
2999 /// The request builder for [EntityService::list_watchlists][crate::client::EntityService::list_watchlists] calls.
3000 ///
3001 /// # Example
3002 /// ```
3003 /// # use google_cloud_chronicle_v1::builder::entity_service::ListWatchlists;
3004 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3005 /// use google_cloud_gax::paginator::ItemPaginator;
3006 ///
3007 /// let builder = prepare_request_builder();
3008 /// let mut items = builder.by_item();
3009 /// while let Some(result) = items.next().await {
3010 /// let item = result?;
3011 /// }
3012 /// # Ok(()) }
3013 ///
3014 /// fn prepare_request_builder() -> ListWatchlists {
3015 /// # panic!();
3016 /// // ... details omitted ...
3017 /// }
3018 /// ```
3019 #[derive(Clone, Debug)]
3020 pub struct ListWatchlists(RequestBuilder<crate::model::ListWatchlistsRequest>);
3021
3022 impl ListWatchlists {
3023 pub(crate) fn new(
3024 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
3025 ) -> Self {
3026 Self(RequestBuilder::new(stub))
3027 }
3028
3029 /// Sets the full request, replacing any prior values.
3030 pub fn with_request<V: Into<crate::model::ListWatchlistsRequest>>(mut self, v: V) -> Self {
3031 self.0.request = v.into();
3032 self
3033 }
3034
3035 /// Sets all the options, replacing any prior values.
3036 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3037 self.0.options = v.into();
3038 self
3039 }
3040
3041 /// Sends the request.
3042 pub async fn send(self) -> Result<crate::model::ListWatchlistsResponse> {
3043 (*self.0.stub)
3044 .list_watchlists(self.0.request, self.0.options)
3045 .await
3046 .map(crate::Response::into_body)
3047 }
3048
3049 /// Streams each page in the collection.
3050 pub fn by_page(
3051 self,
3052 ) -> impl google_cloud_gax::paginator::Paginator<
3053 crate::model::ListWatchlistsResponse,
3054 crate::Error,
3055 > {
3056 use std::clone::Clone;
3057 let token = self.0.request.page_token.clone();
3058 let execute = move |token: String| {
3059 let mut builder = self.clone();
3060 builder.0.request = builder.0.request.set_page_token(token);
3061 builder.send()
3062 };
3063 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3064 }
3065
3066 /// Streams each item in the collection.
3067 pub fn by_item(
3068 self,
3069 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3070 crate::model::ListWatchlistsResponse,
3071 crate::Error,
3072 > {
3073 use google_cloud_gax::paginator::Paginator;
3074 self.by_page().items()
3075 }
3076
3077 /// Sets the value of [parent][crate::model::ListWatchlistsRequest::parent].
3078 ///
3079 /// This is a **required** field for requests.
3080 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3081 self.0.request.parent = v.into();
3082 self
3083 }
3084
3085 /// Sets the value of [page_size][crate::model::ListWatchlistsRequest::page_size].
3086 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3087 self.0.request.page_size = v.into();
3088 self
3089 }
3090
3091 /// Sets the value of [page_token][crate::model::ListWatchlistsRequest::page_token].
3092 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3093 self.0.request.page_token = v.into();
3094 self
3095 }
3096
3097 /// Sets the value of [filter][crate::model::ListWatchlistsRequest::filter].
3098 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3099 self.0.request.filter = v.into();
3100 self
3101 }
3102 }
3103
3104 #[doc(hidden)]
3105 impl crate::RequestBuilder for ListWatchlists {
3106 fn request_options(&mut self) -> &mut crate::RequestOptions {
3107 &mut self.0.options
3108 }
3109 }
3110
3111 /// The request builder for [EntityService::create_watchlist][crate::client::EntityService::create_watchlist] calls.
3112 ///
3113 /// # Example
3114 /// ```
3115 /// # use google_cloud_chronicle_v1::builder::entity_service::CreateWatchlist;
3116 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3117 ///
3118 /// let builder = prepare_request_builder();
3119 /// let response = builder.send().await?;
3120 /// # Ok(()) }
3121 ///
3122 /// fn prepare_request_builder() -> CreateWatchlist {
3123 /// # panic!();
3124 /// // ... details omitted ...
3125 /// }
3126 /// ```
3127 #[derive(Clone, Debug)]
3128 pub struct CreateWatchlist(RequestBuilder<crate::model::CreateWatchlistRequest>);
3129
3130 impl CreateWatchlist {
3131 pub(crate) fn new(
3132 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
3133 ) -> Self {
3134 Self(RequestBuilder::new(stub))
3135 }
3136
3137 /// Sets the full request, replacing any prior values.
3138 pub fn with_request<V: Into<crate::model::CreateWatchlistRequest>>(mut self, v: V) -> Self {
3139 self.0.request = v.into();
3140 self
3141 }
3142
3143 /// Sets all the options, replacing any prior values.
3144 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3145 self.0.options = v.into();
3146 self
3147 }
3148
3149 /// Sends the request.
3150 pub async fn send(self) -> Result<crate::model::Watchlist> {
3151 (*self.0.stub)
3152 .create_watchlist(self.0.request, self.0.options)
3153 .await
3154 .map(crate::Response::into_body)
3155 }
3156
3157 /// Sets the value of [parent][crate::model::CreateWatchlistRequest::parent].
3158 ///
3159 /// This is a **required** field for requests.
3160 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3161 self.0.request.parent = v.into();
3162 self
3163 }
3164
3165 /// Sets the value of [watchlist_id][crate::model::CreateWatchlistRequest::watchlist_id].
3166 pub fn set_watchlist_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3167 self.0.request.watchlist_id = v.into();
3168 self
3169 }
3170
3171 /// Sets the value of [watchlist][crate::model::CreateWatchlistRequest::watchlist].
3172 ///
3173 /// This is a **required** field for requests.
3174 pub fn set_watchlist<T>(mut self, v: T) -> Self
3175 where
3176 T: std::convert::Into<crate::model::Watchlist>,
3177 {
3178 self.0.request.watchlist = std::option::Option::Some(v.into());
3179 self
3180 }
3181
3182 /// Sets or clears the value of [watchlist][crate::model::CreateWatchlistRequest::watchlist].
3183 ///
3184 /// This is a **required** field for requests.
3185 pub fn set_or_clear_watchlist<T>(mut self, v: std::option::Option<T>) -> Self
3186 where
3187 T: std::convert::Into<crate::model::Watchlist>,
3188 {
3189 self.0.request.watchlist = v.map(|x| x.into());
3190 self
3191 }
3192 }
3193
3194 #[doc(hidden)]
3195 impl crate::RequestBuilder for CreateWatchlist {
3196 fn request_options(&mut self) -> &mut crate::RequestOptions {
3197 &mut self.0.options
3198 }
3199 }
3200
3201 /// The request builder for [EntityService::update_watchlist][crate::client::EntityService::update_watchlist] calls.
3202 ///
3203 /// # Example
3204 /// ```
3205 /// # use google_cloud_chronicle_v1::builder::entity_service::UpdateWatchlist;
3206 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3207 ///
3208 /// let builder = prepare_request_builder();
3209 /// let response = builder.send().await?;
3210 /// # Ok(()) }
3211 ///
3212 /// fn prepare_request_builder() -> UpdateWatchlist {
3213 /// # panic!();
3214 /// // ... details omitted ...
3215 /// }
3216 /// ```
3217 #[derive(Clone, Debug)]
3218 pub struct UpdateWatchlist(RequestBuilder<crate::model::UpdateWatchlistRequest>);
3219
3220 impl UpdateWatchlist {
3221 pub(crate) fn new(
3222 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
3223 ) -> Self {
3224 Self(RequestBuilder::new(stub))
3225 }
3226
3227 /// Sets the full request, replacing any prior values.
3228 pub fn with_request<V: Into<crate::model::UpdateWatchlistRequest>>(mut self, v: V) -> Self {
3229 self.0.request = v.into();
3230 self
3231 }
3232
3233 /// Sets all the options, replacing any prior values.
3234 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3235 self.0.options = v.into();
3236 self
3237 }
3238
3239 /// Sends the request.
3240 pub async fn send(self) -> Result<crate::model::Watchlist> {
3241 (*self.0.stub)
3242 .update_watchlist(self.0.request, self.0.options)
3243 .await
3244 .map(crate::Response::into_body)
3245 }
3246
3247 /// Sets the value of [watchlist][crate::model::UpdateWatchlistRequest::watchlist].
3248 ///
3249 /// This is a **required** field for requests.
3250 pub fn set_watchlist<T>(mut self, v: T) -> Self
3251 where
3252 T: std::convert::Into<crate::model::Watchlist>,
3253 {
3254 self.0.request.watchlist = std::option::Option::Some(v.into());
3255 self
3256 }
3257
3258 /// Sets or clears the value of [watchlist][crate::model::UpdateWatchlistRequest::watchlist].
3259 ///
3260 /// This is a **required** field for requests.
3261 pub fn set_or_clear_watchlist<T>(mut self, v: std::option::Option<T>) -> Self
3262 where
3263 T: std::convert::Into<crate::model::Watchlist>,
3264 {
3265 self.0.request.watchlist = v.map(|x| x.into());
3266 self
3267 }
3268
3269 /// Sets the value of [update_mask][crate::model::UpdateWatchlistRequest::update_mask].
3270 pub fn set_update_mask<T>(mut self, v: T) -> Self
3271 where
3272 T: std::convert::Into<wkt::FieldMask>,
3273 {
3274 self.0.request.update_mask = std::option::Option::Some(v.into());
3275 self
3276 }
3277
3278 /// Sets or clears the value of [update_mask][crate::model::UpdateWatchlistRequest::update_mask].
3279 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3280 where
3281 T: std::convert::Into<wkt::FieldMask>,
3282 {
3283 self.0.request.update_mask = v.map(|x| x.into());
3284 self
3285 }
3286 }
3287
3288 #[doc(hidden)]
3289 impl crate::RequestBuilder for UpdateWatchlist {
3290 fn request_options(&mut self) -> &mut crate::RequestOptions {
3291 &mut self.0.options
3292 }
3293 }
3294
3295 /// The request builder for [EntityService::delete_watchlist][crate::client::EntityService::delete_watchlist] calls.
3296 ///
3297 /// # Example
3298 /// ```
3299 /// # use google_cloud_chronicle_v1::builder::entity_service::DeleteWatchlist;
3300 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3301 ///
3302 /// let builder = prepare_request_builder();
3303 /// let response = builder.send().await?;
3304 /// # Ok(()) }
3305 ///
3306 /// fn prepare_request_builder() -> DeleteWatchlist {
3307 /// # panic!();
3308 /// // ... details omitted ...
3309 /// }
3310 /// ```
3311 #[derive(Clone, Debug)]
3312 pub struct DeleteWatchlist(RequestBuilder<crate::model::DeleteWatchlistRequest>);
3313
3314 impl DeleteWatchlist {
3315 pub(crate) fn new(
3316 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
3317 ) -> Self {
3318 Self(RequestBuilder::new(stub))
3319 }
3320
3321 /// Sets the full request, replacing any prior values.
3322 pub fn with_request<V: Into<crate::model::DeleteWatchlistRequest>>(mut self, v: V) -> Self {
3323 self.0.request = v.into();
3324 self
3325 }
3326
3327 /// Sets all the options, replacing any prior values.
3328 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3329 self.0.options = v.into();
3330 self
3331 }
3332
3333 /// Sends the request.
3334 pub async fn send(self) -> Result<()> {
3335 (*self.0.stub)
3336 .delete_watchlist(self.0.request, self.0.options)
3337 .await
3338 .map(crate::Response::into_body)
3339 }
3340
3341 /// Sets the value of [name][crate::model::DeleteWatchlistRequest::name].
3342 ///
3343 /// This is a **required** field for requests.
3344 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3345 self.0.request.name = v.into();
3346 self
3347 }
3348
3349 /// Sets the value of [force][crate::model::DeleteWatchlistRequest::force].
3350 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3351 self.0.request.force = v.into();
3352 self
3353 }
3354 }
3355
3356 #[doc(hidden)]
3357 impl crate::RequestBuilder for DeleteWatchlist {
3358 fn request_options(&mut self) -> &mut crate::RequestOptions {
3359 &mut self.0.options
3360 }
3361 }
3362
3363 /// The request builder for [EntityService::list_operations][crate::client::EntityService::list_operations] calls.
3364 ///
3365 /// # Example
3366 /// ```
3367 /// # use google_cloud_chronicle_v1::builder::entity_service::ListOperations;
3368 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3369 /// use google_cloud_gax::paginator::ItemPaginator;
3370 ///
3371 /// let builder = prepare_request_builder();
3372 /// let mut items = builder.by_item();
3373 /// while let Some(result) = items.next().await {
3374 /// let item = result?;
3375 /// }
3376 /// # Ok(()) }
3377 ///
3378 /// fn prepare_request_builder() -> ListOperations {
3379 /// # panic!();
3380 /// // ... details omitted ...
3381 /// }
3382 /// ```
3383 #[derive(Clone, Debug)]
3384 pub struct ListOperations(
3385 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3386 );
3387
3388 impl ListOperations {
3389 pub(crate) fn new(
3390 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
3391 ) -> Self {
3392 Self(RequestBuilder::new(stub))
3393 }
3394
3395 /// Sets the full request, replacing any prior values.
3396 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3397 mut self,
3398 v: V,
3399 ) -> Self {
3400 self.0.request = v.into();
3401 self
3402 }
3403
3404 /// Sets all the options, replacing any prior values.
3405 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3406 self.0.options = v.into();
3407 self
3408 }
3409
3410 /// Sends the request.
3411 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3412 (*self.0.stub)
3413 .list_operations(self.0.request, self.0.options)
3414 .await
3415 .map(crate::Response::into_body)
3416 }
3417
3418 /// Streams each page in the collection.
3419 pub fn by_page(
3420 self,
3421 ) -> impl google_cloud_gax::paginator::Paginator<
3422 google_cloud_longrunning::model::ListOperationsResponse,
3423 crate::Error,
3424 > {
3425 use std::clone::Clone;
3426 let token = self.0.request.page_token.clone();
3427 let execute = move |token: String| {
3428 let mut builder = self.clone();
3429 builder.0.request = builder.0.request.set_page_token(token);
3430 builder.send()
3431 };
3432 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3433 }
3434
3435 /// Streams each item in the collection.
3436 pub fn by_item(
3437 self,
3438 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3439 google_cloud_longrunning::model::ListOperationsResponse,
3440 crate::Error,
3441 > {
3442 use google_cloud_gax::paginator::Paginator;
3443 self.by_page().items()
3444 }
3445
3446 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3447 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3448 self.0.request.name = v.into();
3449 self
3450 }
3451
3452 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3453 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3454 self.0.request.filter = v.into();
3455 self
3456 }
3457
3458 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3459 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3460 self.0.request.page_size = v.into();
3461 self
3462 }
3463
3464 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3465 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3466 self.0.request.page_token = v.into();
3467 self
3468 }
3469
3470 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3471 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3472 self.0.request.return_partial_success = v.into();
3473 self
3474 }
3475 }
3476
3477 #[doc(hidden)]
3478 impl crate::RequestBuilder for ListOperations {
3479 fn request_options(&mut self) -> &mut crate::RequestOptions {
3480 &mut self.0.options
3481 }
3482 }
3483
3484 /// The request builder for [EntityService::get_operation][crate::client::EntityService::get_operation] calls.
3485 ///
3486 /// # Example
3487 /// ```
3488 /// # use google_cloud_chronicle_v1::builder::entity_service::GetOperation;
3489 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3490 ///
3491 /// let builder = prepare_request_builder();
3492 /// let response = builder.send().await?;
3493 /// # Ok(()) }
3494 ///
3495 /// fn prepare_request_builder() -> GetOperation {
3496 /// # panic!();
3497 /// // ... details omitted ...
3498 /// }
3499 /// ```
3500 #[derive(Clone, Debug)]
3501 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3502
3503 impl GetOperation {
3504 pub(crate) fn new(
3505 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
3506 ) -> Self {
3507 Self(RequestBuilder::new(stub))
3508 }
3509
3510 /// Sets the full request, replacing any prior values.
3511 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3512 mut self,
3513 v: V,
3514 ) -> Self {
3515 self.0.request = v.into();
3516 self
3517 }
3518
3519 /// Sets all the options, replacing any prior values.
3520 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3521 self.0.options = v.into();
3522 self
3523 }
3524
3525 /// Sends the request.
3526 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3527 (*self.0.stub)
3528 .get_operation(self.0.request, self.0.options)
3529 .await
3530 .map(crate::Response::into_body)
3531 }
3532
3533 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3534 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3535 self.0.request.name = v.into();
3536 self
3537 }
3538 }
3539
3540 #[doc(hidden)]
3541 impl crate::RequestBuilder for GetOperation {
3542 fn request_options(&mut self) -> &mut crate::RequestOptions {
3543 &mut self.0.options
3544 }
3545 }
3546
3547 /// The request builder for [EntityService::delete_operation][crate::client::EntityService::delete_operation] calls.
3548 ///
3549 /// # Example
3550 /// ```
3551 /// # use google_cloud_chronicle_v1::builder::entity_service::DeleteOperation;
3552 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3553 ///
3554 /// let builder = prepare_request_builder();
3555 /// let response = builder.send().await?;
3556 /// # Ok(()) }
3557 ///
3558 /// fn prepare_request_builder() -> DeleteOperation {
3559 /// # panic!();
3560 /// // ... details omitted ...
3561 /// }
3562 /// ```
3563 #[derive(Clone, Debug)]
3564 pub struct DeleteOperation(
3565 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3566 );
3567
3568 impl DeleteOperation {
3569 pub(crate) fn new(
3570 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
3571 ) -> Self {
3572 Self(RequestBuilder::new(stub))
3573 }
3574
3575 /// Sets the full request, replacing any prior values.
3576 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3577 mut self,
3578 v: V,
3579 ) -> Self {
3580 self.0.request = v.into();
3581 self
3582 }
3583
3584 /// Sets all the options, replacing any prior values.
3585 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3586 self.0.options = v.into();
3587 self
3588 }
3589
3590 /// Sends the request.
3591 pub async fn send(self) -> Result<()> {
3592 (*self.0.stub)
3593 .delete_operation(self.0.request, self.0.options)
3594 .await
3595 .map(crate::Response::into_body)
3596 }
3597
3598 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3599 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3600 self.0.request.name = v.into();
3601 self
3602 }
3603 }
3604
3605 #[doc(hidden)]
3606 impl crate::RequestBuilder for DeleteOperation {
3607 fn request_options(&mut self) -> &mut crate::RequestOptions {
3608 &mut self.0.options
3609 }
3610 }
3611
3612 /// The request builder for [EntityService::cancel_operation][crate::client::EntityService::cancel_operation] calls.
3613 ///
3614 /// # Example
3615 /// ```
3616 /// # use google_cloud_chronicle_v1::builder::entity_service::CancelOperation;
3617 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3618 ///
3619 /// let builder = prepare_request_builder();
3620 /// let response = builder.send().await?;
3621 /// # Ok(()) }
3622 ///
3623 /// fn prepare_request_builder() -> CancelOperation {
3624 /// # panic!();
3625 /// // ... details omitted ...
3626 /// }
3627 /// ```
3628 #[derive(Clone, Debug)]
3629 pub struct CancelOperation(
3630 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3631 );
3632
3633 impl CancelOperation {
3634 pub(crate) fn new(
3635 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityService>,
3636 ) -> Self {
3637 Self(RequestBuilder::new(stub))
3638 }
3639
3640 /// Sets the full request, replacing any prior values.
3641 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3642 mut self,
3643 v: V,
3644 ) -> Self {
3645 self.0.request = v.into();
3646 self
3647 }
3648
3649 /// Sets all the options, replacing any prior values.
3650 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3651 self.0.options = v.into();
3652 self
3653 }
3654
3655 /// Sends the request.
3656 pub async fn send(self) -> Result<()> {
3657 (*self.0.stub)
3658 .cancel_operation(self.0.request, self.0.options)
3659 .await
3660 .map(crate::Response::into_body)
3661 }
3662
3663 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3664 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3665 self.0.request.name = v.into();
3666 self
3667 }
3668 }
3669
3670 #[doc(hidden)]
3671 impl crate::RequestBuilder for CancelOperation {
3672 fn request_options(&mut self) -> &mut crate::RequestOptions {
3673 &mut self.0.options
3674 }
3675 }
3676}
3677
3678/// Request and client builders for [InstanceService][crate::client::InstanceService].
3679pub mod instance_service {
3680 use crate::Result;
3681
3682 /// A builder for [InstanceService][crate::client::InstanceService].
3683 ///
3684 /// ```
3685 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3686 /// # use google_cloud_chronicle_v1::*;
3687 /// # use builder::instance_service::ClientBuilder;
3688 /// # use client::InstanceService;
3689 /// let builder : ClientBuilder = InstanceService::builder();
3690 /// let client = builder
3691 /// .with_endpoint("https://chronicle.googleapis.com")
3692 /// .build().await?;
3693 /// # Ok(()) }
3694 /// ```
3695 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3696
3697 pub(crate) mod client {
3698 use super::super::super::client::InstanceService;
3699 pub struct Factory;
3700 impl crate::ClientFactory for Factory {
3701 type Client = InstanceService;
3702 type Credentials = gaxi::options::Credentials;
3703 async fn build(
3704 self,
3705 config: gaxi::options::ClientConfig,
3706 ) -> crate::ClientBuilderResult<Self::Client> {
3707 Self::Client::new(config).await
3708 }
3709 }
3710 }
3711
3712 /// Common implementation for [crate::client::InstanceService] request builders.
3713 #[derive(Clone, Debug)]
3714 pub(crate) struct RequestBuilder<R: std::default::Default> {
3715 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
3716 request: R,
3717 options: crate::RequestOptions,
3718 }
3719
3720 impl<R> RequestBuilder<R>
3721 where
3722 R: std::default::Default,
3723 {
3724 pub(crate) fn new(
3725 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
3726 ) -> Self {
3727 Self {
3728 stub,
3729 request: R::default(),
3730 options: crate::RequestOptions::default(),
3731 }
3732 }
3733 }
3734
3735 /// The request builder for [InstanceService::get_instance][crate::client::InstanceService::get_instance] calls.
3736 ///
3737 /// # Example
3738 /// ```
3739 /// # use google_cloud_chronicle_v1::builder::instance_service::GetInstance;
3740 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3741 ///
3742 /// let builder = prepare_request_builder();
3743 /// let response = builder.send().await?;
3744 /// # Ok(()) }
3745 ///
3746 /// fn prepare_request_builder() -> GetInstance {
3747 /// # panic!();
3748 /// // ... details omitted ...
3749 /// }
3750 /// ```
3751 #[derive(Clone, Debug)]
3752 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
3753
3754 impl GetInstance {
3755 pub(crate) fn new(
3756 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
3757 ) -> Self {
3758 Self(RequestBuilder::new(stub))
3759 }
3760
3761 /// Sets the full request, replacing any prior values.
3762 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
3763 self.0.request = v.into();
3764 self
3765 }
3766
3767 /// Sets all the options, replacing any prior values.
3768 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3769 self.0.options = v.into();
3770 self
3771 }
3772
3773 /// Sends the request.
3774 pub async fn send(self) -> Result<crate::model::Instance> {
3775 (*self.0.stub)
3776 .get_instance(self.0.request, self.0.options)
3777 .await
3778 .map(crate::Response::into_body)
3779 }
3780
3781 /// Sets the value of [name][crate::model::GetInstanceRequest::name].
3782 ///
3783 /// This is a **required** field for requests.
3784 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3785 self.0.request.name = v.into();
3786 self
3787 }
3788 }
3789
3790 #[doc(hidden)]
3791 impl crate::RequestBuilder for GetInstance {
3792 fn request_options(&mut self) -> &mut crate::RequestOptions {
3793 &mut self.0.options
3794 }
3795 }
3796
3797 /// The request builder for [InstanceService::list_operations][crate::client::InstanceService::list_operations] calls.
3798 ///
3799 /// # Example
3800 /// ```
3801 /// # use google_cloud_chronicle_v1::builder::instance_service::ListOperations;
3802 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3803 /// use google_cloud_gax::paginator::ItemPaginator;
3804 ///
3805 /// let builder = prepare_request_builder();
3806 /// let mut items = builder.by_item();
3807 /// while let Some(result) = items.next().await {
3808 /// let item = result?;
3809 /// }
3810 /// # Ok(()) }
3811 ///
3812 /// fn prepare_request_builder() -> ListOperations {
3813 /// # panic!();
3814 /// // ... details omitted ...
3815 /// }
3816 /// ```
3817 #[derive(Clone, Debug)]
3818 pub struct ListOperations(
3819 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3820 );
3821
3822 impl ListOperations {
3823 pub(crate) fn new(
3824 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
3825 ) -> Self {
3826 Self(RequestBuilder::new(stub))
3827 }
3828
3829 /// Sets the full request, replacing any prior values.
3830 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3831 mut self,
3832 v: V,
3833 ) -> Self {
3834 self.0.request = v.into();
3835 self
3836 }
3837
3838 /// Sets all the options, replacing any prior values.
3839 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3840 self.0.options = v.into();
3841 self
3842 }
3843
3844 /// Sends the request.
3845 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3846 (*self.0.stub)
3847 .list_operations(self.0.request, self.0.options)
3848 .await
3849 .map(crate::Response::into_body)
3850 }
3851
3852 /// Streams each page in the collection.
3853 pub fn by_page(
3854 self,
3855 ) -> impl google_cloud_gax::paginator::Paginator<
3856 google_cloud_longrunning::model::ListOperationsResponse,
3857 crate::Error,
3858 > {
3859 use std::clone::Clone;
3860 let token = self.0.request.page_token.clone();
3861 let execute = move |token: String| {
3862 let mut builder = self.clone();
3863 builder.0.request = builder.0.request.set_page_token(token);
3864 builder.send()
3865 };
3866 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3867 }
3868
3869 /// Streams each item in the collection.
3870 pub fn by_item(
3871 self,
3872 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3873 google_cloud_longrunning::model::ListOperationsResponse,
3874 crate::Error,
3875 > {
3876 use google_cloud_gax::paginator::Paginator;
3877 self.by_page().items()
3878 }
3879
3880 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3881 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3882 self.0.request.name = v.into();
3883 self
3884 }
3885
3886 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3887 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3888 self.0.request.filter = v.into();
3889 self
3890 }
3891
3892 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3893 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3894 self.0.request.page_size = v.into();
3895 self
3896 }
3897
3898 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3899 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3900 self.0.request.page_token = v.into();
3901 self
3902 }
3903
3904 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3905 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3906 self.0.request.return_partial_success = v.into();
3907 self
3908 }
3909 }
3910
3911 #[doc(hidden)]
3912 impl crate::RequestBuilder for ListOperations {
3913 fn request_options(&mut self) -> &mut crate::RequestOptions {
3914 &mut self.0.options
3915 }
3916 }
3917
3918 /// The request builder for [InstanceService::get_operation][crate::client::InstanceService::get_operation] calls.
3919 ///
3920 /// # Example
3921 /// ```
3922 /// # use google_cloud_chronicle_v1::builder::instance_service::GetOperation;
3923 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3924 ///
3925 /// let builder = prepare_request_builder();
3926 /// let response = builder.send().await?;
3927 /// # Ok(()) }
3928 ///
3929 /// fn prepare_request_builder() -> GetOperation {
3930 /// # panic!();
3931 /// // ... details omitted ...
3932 /// }
3933 /// ```
3934 #[derive(Clone, Debug)]
3935 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3936
3937 impl GetOperation {
3938 pub(crate) fn new(
3939 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
3940 ) -> Self {
3941 Self(RequestBuilder::new(stub))
3942 }
3943
3944 /// Sets the full request, replacing any prior values.
3945 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3946 mut self,
3947 v: V,
3948 ) -> Self {
3949 self.0.request = v.into();
3950 self
3951 }
3952
3953 /// Sets all the options, replacing any prior values.
3954 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3955 self.0.options = v.into();
3956 self
3957 }
3958
3959 /// Sends the request.
3960 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3961 (*self.0.stub)
3962 .get_operation(self.0.request, self.0.options)
3963 .await
3964 .map(crate::Response::into_body)
3965 }
3966
3967 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3968 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3969 self.0.request.name = v.into();
3970 self
3971 }
3972 }
3973
3974 #[doc(hidden)]
3975 impl crate::RequestBuilder for GetOperation {
3976 fn request_options(&mut self) -> &mut crate::RequestOptions {
3977 &mut self.0.options
3978 }
3979 }
3980
3981 /// The request builder for [InstanceService::delete_operation][crate::client::InstanceService::delete_operation] calls.
3982 ///
3983 /// # Example
3984 /// ```
3985 /// # use google_cloud_chronicle_v1::builder::instance_service::DeleteOperation;
3986 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
3987 ///
3988 /// let builder = prepare_request_builder();
3989 /// let response = builder.send().await?;
3990 /// # Ok(()) }
3991 ///
3992 /// fn prepare_request_builder() -> DeleteOperation {
3993 /// # panic!();
3994 /// // ... details omitted ...
3995 /// }
3996 /// ```
3997 #[derive(Clone, Debug)]
3998 pub struct DeleteOperation(
3999 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4000 );
4001
4002 impl DeleteOperation {
4003 pub(crate) fn new(
4004 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
4005 ) -> Self {
4006 Self(RequestBuilder::new(stub))
4007 }
4008
4009 /// Sets the full request, replacing any prior values.
4010 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4011 mut self,
4012 v: V,
4013 ) -> Self {
4014 self.0.request = v.into();
4015 self
4016 }
4017
4018 /// Sets all the options, replacing any prior values.
4019 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4020 self.0.options = v.into();
4021 self
4022 }
4023
4024 /// Sends the request.
4025 pub async fn send(self) -> Result<()> {
4026 (*self.0.stub)
4027 .delete_operation(self.0.request, self.0.options)
4028 .await
4029 .map(crate::Response::into_body)
4030 }
4031
4032 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
4033 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4034 self.0.request.name = v.into();
4035 self
4036 }
4037 }
4038
4039 #[doc(hidden)]
4040 impl crate::RequestBuilder for DeleteOperation {
4041 fn request_options(&mut self) -> &mut crate::RequestOptions {
4042 &mut self.0.options
4043 }
4044 }
4045
4046 /// The request builder for [InstanceService::cancel_operation][crate::client::InstanceService::cancel_operation] calls.
4047 ///
4048 /// # Example
4049 /// ```
4050 /// # use google_cloud_chronicle_v1::builder::instance_service::CancelOperation;
4051 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4052 ///
4053 /// let builder = prepare_request_builder();
4054 /// let response = builder.send().await?;
4055 /// # Ok(()) }
4056 ///
4057 /// fn prepare_request_builder() -> CancelOperation {
4058 /// # panic!();
4059 /// // ... details omitted ...
4060 /// }
4061 /// ```
4062 #[derive(Clone, Debug)]
4063 pub struct CancelOperation(
4064 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4065 );
4066
4067 impl CancelOperation {
4068 pub(crate) fn new(
4069 stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceService>,
4070 ) -> Self {
4071 Self(RequestBuilder::new(stub))
4072 }
4073
4074 /// Sets the full request, replacing any prior values.
4075 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4076 mut self,
4077 v: V,
4078 ) -> Self {
4079 self.0.request = v.into();
4080 self
4081 }
4082
4083 /// Sets all the options, replacing any prior values.
4084 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4085 self.0.options = v.into();
4086 self
4087 }
4088
4089 /// Sends the request.
4090 pub async fn send(self) -> Result<()> {
4091 (*self.0.stub)
4092 .cancel_operation(self.0.request, self.0.options)
4093 .await
4094 .map(crate::Response::into_body)
4095 }
4096
4097 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
4098 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4099 self.0.request.name = v.into();
4100 self
4101 }
4102 }
4103
4104 #[doc(hidden)]
4105 impl crate::RequestBuilder for CancelOperation {
4106 fn request_options(&mut self) -> &mut crate::RequestOptions {
4107 &mut self.0.options
4108 }
4109 }
4110}
4111
4112/// Request and client builders for [ReferenceListService][crate::client::ReferenceListService].
4113pub mod reference_list_service {
4114 use crate::Result;
4115
4116 /// A builder for [ReferenceListService][crate::client::ReferenceListService].
4117 ///
4118 /// ```
4119 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4120 /// # use google_cloud_chronicle_v1::*;
4121 /// # use builder::reference_list_service::ClientBuilder;
4122 /// # use client::ReferenceListService;
4123 /// let builder : ClientBuilder = ReferenceListService::builder();
4124 /// let client = builder
4125 /// .with_endpoint("https://chronicle.googleapis.com")
4126 /// .build().await?;
4127 /// # Ok(()) }
4128 /// ```
4129 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4130
4131 pub(crate) mod client {
4132 use super::super::super::client::ReferenceListService;
4133 pub struct Factory;
4134 impl crate::ClientFactory for Factory {
4135 type Client = ReferenceListService;
4136 type Credentials = gaxi::options::Credentials;
4137 async fn build(
4138 self,
4139 config: gaxi::options::ClientConfig,
4140 ) -> crate::ClientBuilderResult<Self::Client> {
4141 Self::Client::new(config).await
4142 }
4143 }
4144 }
4145
4146 /// Common implementation for [crate::client::ReferenceListService] request builders.
4147 #[derive(Clone, Debug)]
4148 pub(crate) struct RequestBuilder<R: std::default::Default> {
4149 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
4150 request: R,
4151 options: crate::RequestOptions,
4152 }
4153
4154 impl<R> RequestBuilder<R>
4155 where
4156 R: std::default::Default,
4157 {
4158 pub(crate) fn new(
4159 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
4160 ) -> Self {
4161 Self {
4162 stub,
4163 request: R::default(),
4164 options: crate::RequestOptions::default(),
4165 }
4166 }
4167 }
4168
4169 /// The request builder for [ReferenceListService::get_reference_list][crate::client::ReferenceListService::get_reference_list] calls.
4170 ///
4171 /// # Example
4172 /// ```
4173 /// # use google_cloud_chronicle_v1::builder::reference_list_service::GetReferenceList;
4174 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4175 ///
4176 /// let builder = prepare_request_builder();
4177 /// let response = builder.send().await?;
4178 /// # Ok(()) }
4179 ///
4180 /// fn prepare_request_builder() -> GetReferenceList {
4181 /// # panic!();
4182 /// // ... details omitted ...
4183 /// }
4184 /// ```
4185 #[derive(Clone, Debug)]
4186 pub struct GetReferenceList(RequestBuilder<crate::model::GetReferenceListRequest>);
4187
4188 impl GetReferenceList {
4189 pub(crate) fn new(
4190 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
4191 ) -> Self {
4192 Self(RequestBuilder::new(stub))
4193 }
4194
4195 /// Sets the full request, replacing any prior values.
4196 pub fn with_request<V: Into<crate::model::GetReferenceListRequest>>(
4197 mut self,
4198 v: V,
4199 ) -> Self {
4200 self.0.request = v.into();
4201 self
4202 }
4203
4204 /// Sets all the options, replacing any prior values.
4205 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4206 self.0.options = v.into();
4207 self
4208 }
4209
4210 /// Sends the request.
4211 pub async fn send(self) -> Result<crate::model::ReferenceList> {
4212 (*self.0.stub)
4213 .get_reference_list(self.0.request, self.0.options)
4214 .await
4215 .map(crate::Response::into_body)
4216 }
4217
4218 /// Sets the value of [name][crate::model::GetReferenceListRequest::name].
4219 ///
4220 /// This is a **required** field for requests.
4221 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4222 self.0.request.name = v.into();
4223 self
4224 }
4225
4226 /// Sets the value of [view][crate::model::GetReferenceListRequest::view].
4227 pub fn set_view<T: Into<crate::model::ReferenceListView>>(mut self, v: T) -> Self {
4228 self.0.request.view = v.into();
4229 self
4230 }
4231 }
4232
4233 #[doc(hidden)]
4234 impl crate::RequestBuilder for GetReferenceList {
4235 fn request_options(&mut self) -> &mut crate::RequestOptions {
4236 &mut self.0.options
4237 }
4238 }
4239
4240 /// The request builder for [ReferenceListService::list_reference_lists][crate::client::ReferenceListService::list_reference_lists] calls.
4241 ///
4242 /// # Example
4243 /// ```
4244 /// # use google_cloud_chronicle_v1::builder::reference_list_service::ListReferenceLists;
4245 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4246 /// use google_cloud_gax::paginator::ItemPaginator;
4247 ///
4248 /// let builder = prepare_request_builder();
4249 /// let mut items = builder.by_item();
4250 /// while let Some(result) = items.next().await {
4251 /// let item = result?;
4252 /// }
4253 /// # Ok(()) }
4254 ///
4255 /// fn prepare_request_builder() -> ListReferenceLists {
4256 /// # panic!();
4257 /// // ... details omitted ...
4258 /// }
4259 /// ```
4260 #[derive(Clone, Debug)]
4261 pub struct ListReferenceLists(RequestBuilder<crate::model::ListReferenceListsRequest>);
4262
4263 impl ListReferenceLists {
4264 pub(crate) fn new(
4265 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
4266 ) -> Self {
4267 Self(RequestBuilder::new(stub))
4268 }
4269
4270 /// Sets the full request, replacing any prior values.
4271 pub fn with_request<V: Into<crate::model::ListReferenceListsRequest>>(
4272 mut self,
4273 v: V,
4274 ) -> Self {
4275 self.0.request = v.into();
4276 self
4277 }
4278
4279 /// Sets all the options, replacing any prior values.
4280 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4281 self.0.options = v.into();
4282 self
4283 }
4284
4285 /// Sends the request.
4286 pub async fn send(self) -> Result<crate::model::ListReferenceListsResponse> {
4287 (*self.0.stub)
4288 .list_reference_lists(self.0.request, self.0.options)
4289 .await
4290 .map(crate::Response::into_body)
4291 }
4292
4293 /// Streams each page in the collection.
4294 pub fn by_page(
4295 self,
4296 ) -> impl google_cloud_gax::paginator::Paginator<
4297 crate::model::ListReferenceListsResponse,
4298 crate::Error,
4299 > {
4300 use std::clone::Clone;
4301 let token = self.0.request.page_token.clone();
4302 let execute = move |token: String| {
4303 let mut builder = self.clone();
4304 builder.0.request = builder.0.request.set_page_token(token);
4305 builder.send()
4306 };
4307 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4308 }
4309
4310 /// Streams each item in the collection.
4311 pub fn by_item(
4312 self,
4313 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4314 crate::model::ListReferenceListsResponse,
4315 crate::Error,
4316 > {
4317 use google_cloud_gax::paginator::Paginator;
4318 self.by_page().items()
4319 }
4320
4321 /// Sets the value of [parent][crate::model::ListReferenceListsRequest::parent].
4322 ///
4323 /// This is a **required** field for requests.
4324 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4325 self.0.request.parent = v.into();
4326 self
4327 }
4328
4329 /// Sets the value of [page_size][crate::model::ListReferenceListsRequest::page_size].
4330 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4331 self.0.request.page_size = v.into();
4332 self
4333 }
4334
4335 /// Sets the value of [page_token][crate::model::ListReferenceListsRequest::page_token].
4336 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4337 self.0.request.page_token = v.into();
4338 self
4339 }
4340
4341 /// Sets the value of [view][crate::model::ListReferenceListsRequest::view].
4342 pub fn set_view<T: Into<crate::model::ReferenceListView>>(mut self, v: T) -> Self {
4343 self.0.request.view = v.into();
4344 self
4345 }
4346 }
4347
4348 #[doc(hidden)]
4349 impl crate::RequestBuilder for ListReferenceLists {
4350 fn request_options(&mut self) -> &mut crate::RequestOptions {
4351 &mut self.0.options
4352 }
4353 }
4354
4355 /// The request builder for [ReferenceListService::create_reference_list][crate::client::ReferenceListService::create_reference_list] calls.
4356 ///
4357 /// # Example
4358 /// ```
4359 /// # use google_cloud_chronicle_v1::builder::reference_list_service::CreateReferenceList;
4360 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4361 ///
4362 /// let builder = prepare_request_builder();
4363 /// let response = builder.send().await?;
4364 /// # Ok(()) }
4365 ///
4366 /// fn prepare_request_builder() -> CreateReferenceList {
4367 /// # panic!();
4368 /// // ... details omitted ...
4369 /// }
4370 /// ```
4371 #[derive(Clone, Debug)]
4372 pub struct CreateReferenceList(RequestBuilder<crate::model::CreateReferenceListRequest>);
4373
4374 impl CreateReferenceList {
4375 pub(crate) fn new(
4376 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
4377 ) -> Self {
4378 Self(RequestBuilder::new(stub))
4379 }
4380
4381 /// Sets the full request, replacing any prior values.
4382 pub fn with_request<V: Into<crate::model::CreateReferenceListRequest>>(
4383 mut self,
4384 v: V,
4385 ) -> Self {
4386 self.0.request = v.into();
4387 self
4388 }
4389
4390 /// Sets all the options, replacing any prior values.
4391 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4392 self.0.options = v.into();
4393 self
4394 }
4395
4396 /// Sends the request.
4397 pub async fn send(self) -> Result<crate::model::ReferenceList> {
4398 (*self.0.stub)
4399 .create_reference_list(self.0.request, self.0.options)
4400 .await
4401 .map(crate::Response::into_body)
4402 }
4403
4404 /// Sets the value of [parent][crate::model::CreateReferenceListRequest::parent].
4405 ///
4406 /// This is a **required** field for requests.
4407 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4408 self.0.request.parent = v.into();
4409 self
4410 }
4411
4412 /// Sets the value of [reference_list][crate::model::CreateReferenceListRequest::reference_list].
4413 ///
4414 /// This is a **required** field for requests.
4415 pub fn set_reference_list<T>(mut self, v: T) -> Self
4416 where
4417 T: std::convert::Into<crate::model::ReferenceList>,
4418 {
4419 self.0.request.reference_list = std::option::Option::Some(v.into());
4420 self
4421 }
4422
4423 /// Sets or clears the value of [reference_list][crate::model::CreateReferenceListRequest::reference_list].
4424 ///
4425 /// This is a **required** field for requests.
4426 pub fn set_or_clear_reference_list<T>(mut self, v: std::option::Option<T>) -> Self
4427 where
4428 T: std::convert::Into<crate::model::ReferenceList>,
4429 {
4430 self.0.request.reference_list = v.map(|x| x.into());
4431 self
4432 }
4433
4434 /// Sets the value of [reference_list_id][crate::model::CreateReferenceListRequest::reference_list_id].
4435 ///
4436 /// This is a **required** field for requests.
4437 pub fn set_reference_list_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4438 self.0.request.reference_list_id = v.into();
4439 self
4440 }
4441 }
4442
4443 #[doc(hidden)]
4444 impl crate::RequestBuilder for CreateReferenceList {
4445 fn request_options(&mut self) -> &mut crate::RequestOptions {
4446 &mut self.0.options
4447 }
4448 }
4449
4450 /// The request builder for [ReferenceListService::update_reference_list][crate::client::ReferenceListService::update_reference_list] calls.
4451 ///
4452 /// # Example
4453 /// ```
4454 /// # use google_cloud_chronicle_v1::builder::reference_list_service::UpdateReferenceList;
4455 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4456 ///
4457 /// let builder = prepare_request_builder();
4458 /// let response = builder.send().await?;
4459 /// # Ok(()) }
4460 ///
4461 /// fn prepare_request_builder() -> UpdateReferenceList {
4462 /// # panic!();
4463 /// // ... details omitted ...
4464 /// }
4465 /// ```
4466 #[derive(Clone, Debug)]
4467 pub struct UpdateReferenceList(RequestBuilder<crate::model::UpdateReferenceListRequest>);
4468
4469 impl UpdateReferenceList {
4470 pub(crate) fn new(
4471 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
4472 ) -> Self {
4473 Self(RequestBuilder::new(stub))
4474 }
4475
4476 /// Sets the full request, replacing any prior values.
4477 pub fn with_request<V: Into<crate::model::UpdateReferenceListRequest>>(
4478 mut self,
4479 v: V,
4480 ) -> Self {
4481 self.0.request = v.into();
4482 self
4483 }
4484
4485 /// Sets all the options, replacing any prior values.
4486 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4487 self.0.options = v.into();
4488 self
4489 }
4490
4491 /// Sends the request.
4492 pub async fn send(self) -> Result<crate::model::ReferenceList> {
4493 (*self.0.stub)
4494 .update_reference_list(self.0.request, self.0.options)
4495 .await
4496 .map(crate::Response::into_body)
4497 }
4498
4499 /// Sets the value of [reference_list][crate::model::UpdateReferenceListRequest::reference_list].
4500 ///
4501 /// This is a **required** field for requests.
4502 pub fn set_reference_list<T>(mut self, v: T) -> Self
4503 where
4504 T: std::convert::Into<crate::model::ReferenceList>,
4505 {
4506 self.0.request.reference_list = std::option::Option::Some(v.into());
4507 self
4508 }
4509
4510 /// Sets or clears the value of [reference_list][crate::model::UpdateReferenceListRequest::reference_list].
4511 ///
4512 /// This is a **required** field for requests.
4513 pub fn set_or_clear_reference_list<T>(mut self, v: std::option::Option<T>) -> Self
4514 where
4515 T: std::convert::Into<crate::model::ReferenceList>,
4516 {
4517 self.0.request.reference_list = v.map(|x| x.into());
4518 self
4519 }
4520
4521 /// Sets the value of [update_mask][crate::model::UpdateReferenceListRequest::update_mask].
4522 pub fn set_update_mask<T>(mut self, v: T) -> Self
4523 where
4524 T: std::convert::Into<wkt::FieldMask>,
4525 {
4526 self.0.request.update_mask = std::option::Option::Some(v.into());
4527 self
4528 }
4529
4530 /// Sets or clears the value of [update_mask][crate::model::UpdateReferenceListRequest::update_mask].
4531 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4532 where
4533 T: std::convert::Into<wkt::FieldMask>,
4534 {
4535 self.0.request.update_mask = v.map(|x| x.into());
4536 self
4537 }
4538 }
4539
4540 #[doc(hidden)]
4541 impl crate::RequestBuilder for UpdateReferenceList {
4542 fn request_options(&mut self) -> &mut crate::RequestOptions {
4543 &mut self.0.options
4544 }
4545 }
4546
4547 /// The request builder for [ReferenceListService::list_operations][crate::client::ReferenceListService::list_operations] calls.
4548 ///
4549 /// # Example
4550 /// ```
4551 /// # use google_cloud_chronicle_v1::builder::reference_list_service::ListOperations;
4552 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4553 /// use google_cloud_gax::paginator::ItemPaginator;
4554 ///
4555 /// let builder = prepare_request_builder();
4556 /// let mut items = builder.by_item();
4557 /// while let Some(result) = items.next().await {
4558 /// let item = result?;
4559 /// }
4560 /// # Ok(()) }
4561 ///
4562 /// fn prepare_request_builder() -> ListOperations {
4563 /// # panic!();
4564 /// // ... details omitted ...
4565 /// }
4566 /// ```
4567 #[derive(Clone, Debug)]
4568 pub struct ListOperations(
4569 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4570 );
4571
4572 impl ListOperations {
4573 pub(crate) fn new(
4574 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
4575 ) -> Self {
4576 Self(RequestBuilder::new(stub))
4577 }
4578
4579 /// Sets the full request, replacing any prior values.
4580 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4581 mut self,
4582 v: V,
4583 ) -> Self {
4584 self.0.request = v.into();
4585 self
4586 }
4587
4588 /// Sets all the options, replacing any prior values.
4589 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4590 self.0.options = v.into();
4591 self
4592 }
4593
4594 /// Sends the request.
4595 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4596 (*self.0.stub)
4597 .list_operations(self.0.request, self.0.options)
4598 .await
4599 .map(crate::Response::into_body)
4600 }
4601
4602 /// Streams each page in the collection.
4603 pub fn by_page(
4604 self,
4605 ) -> impl google_cloud_gax::paginator::Paginator<
4606 google_cloud_longrunning::model::ListOperationsResponse,
4607 crate::Error,
4608 > {
4609 use std::clone::Clone;
4610 let token = self.0.request.page_token.clone();
4611 let execute = move |token: String| {
4612 let mut builder = self.clone();
4613 builder.0.request = builder.0.request.set_page_token(token);
4614 builder.send()
4615 };
4616 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4617 }
4618
4619 /// Streams each item in the collection.
4620 pub fn by_item(
4621 self,
4622 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4623 google_cloud_longrunning::model::ListOperationsResponse,
4624 crate::Error,
4625 > {
4626 use google_cloud_gax::paginator::Paginator;
4627 self.by_page().items()
4628 }
4629
4630 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
4631 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4632 self.0.request.name = v.into();
4633 self
4634 }
4635
4636 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
4637 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4638 self.0.request.filter = v.into();
4639 self
4640 }
4641
4642 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
4643 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4644 self.0.request.page_size = v.into();
4645 self
4646 }
4647
4648 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
4649 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4650 self.0.request.page_token = v.into();
4651 self
4652 }
4653
4654 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
4655 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4656 self.0.request.return_partial_success = v.into();
4657 self
4658 }
4659 }
4660
4661 #[doc(hidden)]
4662 impl crate::RequestBuilder for ListOperations {
4663 fn request_options(&mut self) -> &mut crate::RequestOptions {
4664 &mut self.0.options
4665 }
4666 }
4667
4668 /// The request builder for [ReferenceListService::get_operation][crate::client::ReferenceListService::get_operation] calls.
4669 ///
4670 /// # Example
4671 /// ```
4672 /// # use google_cloud_chronicle_v1::builder::reference_list_service::GetOperation;
4673 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4674 ///
4675 /// let builder = prepare_request_builder();
4676 /// let response = builder.send().await?;
4677 /// # Ok(()) }
4678 ///
4679 /// fn prepare_request_builder() -> GetOperation {
4680 /// # panic!();
4681 /// // ... details omitted ...
4682 /// }
4683 /// ```
4684 #[derive(Clone, Debug)]
4685 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4686
4687 impl GetOperation {
4688 pub(crate) fn new(
4689 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
4690 ) -> Self {
4691 Self(RequestBuilder::new(stub))
4692 }
4693
4694 /// Sets the full request, replacing any prior values.
4695 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4696 mut self,
4697 v: V,
4698 ) -> Self {
4699 self.0.request = v.into();
4700 self
4701 }
4702
4703 /// Sets all the options, replacing any prior values.
4704 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4705 self.0.options = v.into();
4706 self
4707 }
4708
4709 /// Sends the request.
4710 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4711 (*self.0.stub)
4712 .get_operation(self.0.request, self.0.options)
4713 .await
4714 .map(crate::Response::into_body)
4715 }
4716
4717 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4718 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4719 self.0.request.name = v.into();
4720 self
4721 }
4722 }
4723
4724 #[doc(hidden)]
4725 impl crate::RequestBuilder for GetOperation {
4726 fn request_options(&mut self) -> &mut crate::RequestOptions {
4727 &mut self.0.options
4728 }
4729 }
4730
4731 /// The request builder for [ReferenceListService::delete_operation][crate::client::ReferenceListService::delete_operation] calls.
4732 ///
4733 /// # Example
4734 /// ```
4735 /// # use google_cloud_chronicle_v1::builder::reference_list_service::DeleteOperation;
4736 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4737 ///
4738 /// let builder = prepare_request_builder();
4739 /// let response = builder.send().await?;
4740 /// # Ok(()) }
4741 ///
4742 /// fn prepare_request_builder() -> DeleteOperation {
4743 /// # panic!();
4744 /// // ... details omitted ...
4745 /// }
4746 /// ```
4747 #[derive(Clone, Debug)]
4748 pub struct DeleteOperation(
4749 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4750 );
4751
4752 impl DeleteOperation {
4753 pub(crate) fn new(
4754 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
4755 ) -> Self {
4756 Self(RequestBuilder::new(stub))
4757 }
4758
4759 /// Sets the full request, replacing any prior values.
4760 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4761 mut self,
4762 v: V,
4763 ) -> Self {
4764 self.0.request = v.into();
4765 self
4766 }
4767
4768 /// Sets all the options, replacing any prior values.
4769 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4770 self.0.options = v.into();
4771 self
4772 }
4773
4774 /// Sends the request.
4775 pub async fn send(self) -> Result<()> {
4776 (*self.0.stub)
4777 .delete_operation(self.0.request, self.0.options)
4778 .await
4779 .map(crate::Response::into_body)
4780 }
4781
4782 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
4783 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4784 self.0.request.name = v.into();
4785 self
4786 }
4787 }
4788
4789 #[doc(hidden)]
4790 impl crate::RequestBuilder for DeleteOperation {
4791 fn request_options(&mut self) -> &mut crate::RequestOptions {
4792 &mut self.0.options
4793 }
4794 }
4795
4796 /// The request builder for [ReferenceListService::cancel_operation][crate::client::ReferenceListService::cancel_operation] calls.
4797 ///
4798 /// # Example
4799 /// ```
4800 /// # use google_cloud_chronicle_v1::builder::reference_list_service::CancelOperation;
4801 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4802 ///
4803 /// let builder = prepare_request_builder();
4804 /// let response = builder.send().await?;
4805 /// # Ok(()) }
4806 ///
4807 /// fn prepare_request_builder() -> CancelOperation {
4808 /// # panic!();
4809 /// // ... details omitted ...
4810 /// }
4811 /// ```
4812 #[derive(Clone, Debug)]
4813 pub struct CancelOperation(
4814 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4815 );
4816
4817 impl CancelOperation {
4818 pub(crate) fn new(
4819 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReferenceListService>,
4820 ) -> Self {
4821 Self(RequestBuilder::new(stub))
4822 }
4823
4824 /// Sets the full request, replacing any prior values.
4825 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4826 mut self,
4827 v: V,
4828 ) -> Self {
4829 self.0.request = v.into();
4830 self
4831 }
4832
4833 /// Sets all the options, replacing any prior values.
4834 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4835 self.0.options = v.into();
4836 self
4837 }
4838
4839 /// Sends the request.
4840 pub async fn send(self) -> Result<()> {
4841 (*self.0.stub)
4842 .cancel_operation(self.0.request, self.0.options)
4843 .await
4844 .map(crate::Response::into_body)
4845 }
4846
4847 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
4848 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4849 self.0.request.name = v.into();
4850 self
4851 }
4852 }
4853
4854 #[doc(hidden)]
4855 impl crate::RequestBuilder for CancelOperation {
4856 fn request_options(&mut self) -> &mut crate::RequestOptions {
4857 &mut self.0.options
4858 }
4859 }
4860}
4861
4862/// Request and client builders for [RuleService][crate::client::RuleService].
4863pub mod rule_service {
4864 use crate::Result;
4865
4866 /// A builder for [RuleService][crate::client::RuleService].
4867 ///
4868 /// ```
4869 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4870 /// # use google_cloud_chronicle_v1::*;
4871 /// # use builder::rule_service::ClientBuilder;
4872 /// # use client::RuleService;
4873 /// let builder : ClientBuilder = RuleService::builder();
4874 /// let client = builder
4875 /// .with_endpoint("https://chronicle.googleapis.com")
4876 /// .build().await?;
4877 /// # Ok(()) }
4878 /// ```
4879 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4880
4881 pub(crate) mod client {
4882 use super::super::super::client::RuleService;
4883 pub struct Factory;
4884 impl crate::ClientFactory for Factory {
4885 type Client = RuleService;
4886 type Credentials = gaxi::options::Credentials;
4887 async fn build(
4888 self,
4889 config: gaxi::options::ClientConfig,
4890 ) -> crate::ClientBuilderResult<Self::Client> {
4891 Self::Client::new(config).await
4892 }
4893 }
4894 }
4895
4896 /// Common implementation for [crate::client::RuleService] request builders.
4897 #[derive(Clone, Debug)]
4898 pub(crate) struct RequestBuilder<R: std::default::Default> {
4899 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4900 request: R,
4901 options: crate::RequestOptions,
4902 }
4903
4904 impl<R> RequestBuilder<R>
4905 where
4906 R: std::default::Default,
4907 {
4908 pub(crate) fn new(
4909 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4910 ) -> Self {
4911 Self {
4912 stub,
4913 request: R::default(),
4914 options: crate::RequestOptions::default(),
4915 }
4916 }
4917 }
4918
4919 /// The request builder for [RuleService::create_rule][crate::client::RuleService::create_rule] calls.
4920 ///
4921 /// # Example
4922 /// ```
4923 /// # use google_cloud_chronicle_v1::builder::rule_service::CreateRule;
4924 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
4925 ///
4926 /// let builder = prepare_request_builder();
4927 /// let response = builder.send().await?;
4928 /// # Ok(()) }
4929 ///
4930 /// fn prepare_request_builder() -> CreateRule {
4931 /// # panic!();
4932 /// // ... details omitted ...
4933 /// }
4934 /// ```
4935 #[derive(Clone, Debug)]
4936 pub struct CreateRule(RequestBuilder<crate::model::CreateRuleRequest>);
4937
4938 impl CreateRule {
4939 pub(crate) fn new(
4940 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
4941 ) -> Self {
4942 Self(RequestBuilder::new(stub))
4943 }
4944
4945 /// Sets the full request, replacing any prior values.
4946 pub fn with_request<V: Into<crate::model::CreateRuleRequest>>(mut self, v: V) -> Self {
4947 self.0.request = v.into();
4948 self
4949 }
4950
4951 /// Sets all the options, replacing any prior values.
4952 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4953 self.0.options = v.into();
4954 self
4955 }
4956
4957 /// Sends the request.
4958 pub async fn send(self) -> Result<crate::model::Rule> {
4959 (*self.0.stub)
4960 .create_rule(self.0.request, self.0.options)
4961 .await
4962 .map(crate::Response::into_body)
4963 }
4964
4965 /// Sets the value of [parent][crate::model::CreateRuleRequest::parent].
4966 ///
4967 /// This is a **required** field for requests.
4968 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4969 self.0.request.parent = v.into();
4970 self
4971 }
4972
4973 /// Sets the value of [rule][crate::model::CreateRuleRequest::rule].
4974 ///
4975 /// This is a **required** field for requests.
4976 pub fn set_rule<T>(mut self, v: T) -> Self
4977 where
4978 T: std::convert::Into<crate::model::Rule>,
4979 {
4980 self.0.request.rule = std::option::Option::Some(v.into());
4981 self
4982 }
4983
4984 /// Sets or clears the value of [rule][crate::model::CreateRuleRequest::rule].
4985 ///
4986 /// This is a **required** field for requests.
4987 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
4988 where
4989 T: std::convert::Into<crate::model::Rule>,
4990 {
4991 self.0.request.rule = v.map(|x| x.into());
4992 self
4993 }
4994 }
4995
4996 #[doc(hidden)]
4997 impl crate::RequestBuilder for CreateRule {
4998 fn request_options(&mut self) -> &mut crate::RequestOptions {
4999 &mut self.0.options
5000 }
5001 }
5002
5003 /// The request builder for [RuleService::get_rule][crate::client::RuleService::get_rule] calls.
5004 ///
5005 /// # Example
5006 /// ```
5007 /// # use google_cloud_chronicle_v1::builder::rule_service::GetRule;
5008 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
5009 ///
5010 /// let builder = prepare_request_builder();
5011 /// let response = builder.send().await?;
5012 /// # Ok(()) }
5013 ///
5014 /// fn prepare_request_builder() -> GetRule {
5015 /// # panic!();
5016 /// // ... details omitted ...
5017 /// }
5018 /// ```
5019 #[derive(Clone, Debug)]
5020 pub struct GetRule(RequestBuilder<crate::model::GetRuleRequest>);
5021
5022 impl GetRule {
5023 pub(crate) fn new(
5024 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
5025 ) -> Self {
5026 Self(RequestBuilder::new(stub))
5027 }
5028
5029 /// Sets the full request, replacing any prior values.
5030 pub fn with_request<V: Into<crate::model::GetRuleRequest>>(mut self, v: V) -> Self {
5031 self.0.request = v.into();
5032 self
5033 }
5034
5035 /// Sets all the options, replacing any prior values.
5036 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5037 self.0.options = v.into();
5038 self
5039 }
5040
5041 /// Sends the request.
5042 pub async fn send(self) -> Result<crate::model::Rule> {
5043 (*self.0.stub)
5044 .get_rule(self.0.request, self.0.options)
5045 .await
5046 .map(crate::Response::into_body)
5047 }
5048
5049 /// Sets the value of [name][crate::model::GetRuleRequest::name].
5050 ///
5051 /// This is a **required** field for requests.
5052 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5053 self.0.request.name = v.into();
5054 self
5055 }
5056
5057 /// Sets the value of [view][crate::model::GetRuleRequest::view].
5058 pub fn set_view<T: Into<crate::model::RuleView>>(mut self, v: T) -> Self {
5059 self.0.request.view = v.into();
5060 self
5061 }
5062 }
5063
5064 #[doc(hidden)]
5065 impl crate::RequestBuilder for GetRule {
5066 fn request_options(&mut self) -> &mut crate::RequestOptions {
5067 &mut self.0.options
5068 }
5069 }
5070
5071 /// The request builder for [RuleService::list_rules][crate::client::RuleService::list_rules] calls.
5072 ///
5073 /// # Example
5074 /// ```
5075 /// # use google_cloud_chronicle_v1::builder::rule_service::ListRules;
5076 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
5077 /// use google_cloud_gax::paginator::ItemPaginator;
5078 ///
5079 /// let builder = prepare_request_builder();
5080 /// let mut items = builder.by_item();
5081 /// while let Some(result) = items.next().await {
5082 /// let item = result?;
5083 /// }
5084 /// # Ok(()) }
5085 ///
5086 /// fn prepare_request_builder() -> ListRules {
5087 /// # panic!();
5088 /// // ... details omitted ...
5089 /// }
5090 /// ```
5091 #[derive(Clone, Debug)]
5092 pub struct ListRules(RequestBuilder<crate::model::ListRulesRequest>);
5093
5094 impl ListRules {
5095 pub(crate) fn new(
5096 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
5097 ) -> Self {
5098 Self(RequestBuilder::new(stub))
5099 }
5100
5101 /// Sets the full request, replacing any prior values.
5102 pub fn with_request<V: Into<crate::model::ListRulesRequest>>(mut self, v: V) -> Self {
5103 self.0.request = v.into();
5104 self
5105 }
5106
5107 /// Sets all the options, replacing any prior values.
5108 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5109 self.0.options = v.into();
5110 self
5111 }
5112
5113 /// Sends the request.
5114 pub async fn send(self) -> Result<crate::model::ListRulesResponse> {
5115 (*self.0.stub)
5116 .list_rules(self.0.request, self.0.options)
5117 .await
5118 .map(crate::Response::into_body)
5119 }
5120
5121 /// Streams each page in the collection.
5122 pub fn by_page(
5123 self,
5124 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListRulesResponse, crate::Error>
5125 {
5126 use std::clone::Clone;
5127 let token = self.0.request.page_token.clone();
5128 let execute = move |token: String| {
5129 let mut builder = self.clone();
5130 builder.0.request = builder.0.request.set_page_token(token);
5131 builder.send()
5132 };
5133 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5134 }
5135
5136 /// Streams each item in the collection.
5137 pub fn by_item(
5138 self,
5139 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListRulesResponse, crate::Error>
5140 {
5141 use google_cloud_gax::paginator::Paginator;
5142 self.by_page().items()
5143 }
5144
5145 /// Sets the value of [parent][crate::model::ListRulesRequest::parent].
5146 ///
5147 /// This is a **required** field for requests.
5148 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5149 self.0.request.parent = v.into();
5150 self
5151 }
5152
5153 /// Sets the value of [page_size][crate::model::ListRulesRequest::page_size].
5154 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5155 self.0.request.page_size = v.into();
5156 self
5157 }
5158
5159 /// Sets the value of [page_token][crate::model::ListRulesRequest::page_token].
5160 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5161 self.0.request.page_token = v.into();
5162 self
5163 }
5164
5165 /// Sets the value of [view][crate::model::ListRulesRequest::view].
5166 pub fn set_view<T: Into<crate::model::RuleView>>(mut self, v: T) -> Self {
5167 self.0.request.view = v.into();
5168 self
5169 }
5170
5171 /// Sets the value of [filter][crate::model::ListRulesRequest::filter].
5172 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5173 self.0.request.filter = v.into();
5174 self
5175 }
5176 }
5177
5178 #[doc(hidden)]
5179 impl crate::RequestBuilder for ListRules {
5180 fn request_options(&mut self) -> &mut crate::RequestOptions {
5181 &mut self.0.options
5182 }
5183 }
5184
5185 /// The request builder for [RuleService::update_rule][crate::client::RuleService::update_rule] calls.
5186 ///
5187 /// # Example
5188 /// ```
5189 /// # use google_cloud_chronicle_v1::builder::rule_service::UpdateRule;
5190 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
5191 ///
5192 /// let builder = prepare_request_builder();
5193 /// let response = builder.send().await?;
5194 /// # Ok(()) }
5195 ///
5196 /// fn prepare_request_builder() -> UpdateRule {
5197 /// # panic!();
5198 /// // ... details omitted ...
5199 /// }
5200 /// ```
5201 #[derive(Clone, Debug)]
5202 pub struct UpdateRule(RequestBuilder<crate::model::UpdateRuleRequest>);
5203
5204 impl UpdateRule {
5205 pub(crate) fn new(
5206 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
5207 ) -> Self {
5208 Self(RequestBuilder::new(stub))
5209 }
5210
5211 /// Sets the full request, replacing any prior values.
5212 pub fn with_request<V: Into<crate::model::UpdateRuleRequest>>(mut self, v: V) -> Self {
5213 self.0.request = v.into();
5214 self
5215 }
5216
5217 /// Sets all the options, replacing any prior values.
5218 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5219 self.0.options = v.into();
5220 self
5221 }
5222
5223 /// Sends the request.
5224 pub async fn send(self) -> Result<crate::model::Rule> {
5225 (*self.0.stub)
5226 .update_rule(self.0.request, self.0.options)
5227 .await
5228 .map(crate::Response::into_body)
5229 }
5230
5231 /// Sets the value of [rule][crate::model::UpdateRuleRequest::rule].
5232 ///
5233 /// This is a **required** field for requests.
5234 pub fn set_rule<T>(mut self, v: T) -> Self
5235 where
5236 T: std::convert::Into<crate::model::Rule>,
5237 {
5238 self.0.request.rule = std::option::Option::Some(v.into());
5239 self
5240 }
5241
5242 /// Sets or clears the value of [rule][crate::model::UpdateRuleRequest::rule].
5243 ///
5244 /// This is a **required** field for requests.
5245 pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
5246 where
5247 T: std::convert::Into<crate::model::Rule>,
5248 {
5249 self.0.request.rule = v.map(|x| x.into());
5250 self
5251 }
5252
5253 /// Sets the value of [update_mask][crate::model::UpdateRuleRequest::update_mask].
5254 pub fn set_update_mask<T>(mut self, v: T) -> Self
5255 where
5256 T: std::convert::Into<wkt::FieldMask>,
5257 {
5258 self.0.request.update_mask = std::option::Option::Some(v.into());
5259 self
5260 }
5261
5262 /// Sets or clears the value of [update_mask][crate::model::UpdateRuleRequest::update_mask].
5263 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5264 where
5265 T: std::convert::Into<wkt::FieldMask>,
5266 {
5267 self.0.request.update_mask = v.map(|x| x.into());
5268 self
5269 }
5270 }
5271
5272 #[doc(hidden)]
5273 impl crate::RequestBuilder for UpdateRule {
5274 fn request_options(&mut self) -> &mut crate::RequestOptions {
5275 &mut self.0.options
5276 }
5277 }
5278
5279 /// The request builder for [RuleService::delete_rule][crate::client::RuleService::delete_rule] calls.
5280 ///
5281 /// # Example
5282 /// ```
5283 /// # use google_cloud_chronicle_v1::builder::rule_service::DeleteRule;
5284 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
5285 ///
5286 /// let builder = prepare_request_builder();
5287 /// let response = builder.send().await?;
5288 /// # Ok(()) }
5289 ///
5290 /// fn prepare_request_builder() -> DeleteRule {
5291 /// # panic!();
5292 /// // ... details omitted ...
5293 /// }
5294 /// ```
5295 #[derive(Clone, Debug)]
5296 pub struct DeleteRule(RequestBuilder<crate::model::DeleteRuleRequest>);
5297
5298 impl DeleteRule {
5299 pub(crate) fn new(
5300 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
5301 ) -> Self {
5302 Self(RequestBuilder::new(stub))
5303 }
5304
5305 /// Sets the full request, replacing any prior values.
5306 pub fn with_request<V: Into<crate::model::DeleteRuleRequest>>(mut self, v: V) -> Self {
5307 self.0.request = v.into();
5308 self
5309 }
5310
5311 /// Sets all the options, replacing any prior values.
5312 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5313 self.0.options = v.into();
5314 self
5315 }
5316
5317 /// Sends the request.
5318 pub async fn send(self) -> Result<()> {
5319 (*self.0.stub)
5320 .delete_rule(self.0.request, self.0.options)
5321 .await
5322 .map(crate::Response::into_body)
5323 }
5324
5325 /// Sets the value of [name][crate::model::DeleteRuleRequest::name].
5326 ///
5327 /// This is a **required** field for requests.
5328 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5329 self.0.request.name = v.into();
5330 self
5331 }
5332
5333 /// Sets the value of [force][crate::model::DeleteRuleRequest::force].
5334 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
5335 self.0.request.force = v.into();
5336 self
5337 }
5338 }
5339
5340 #[doc(hidden)]
5341 impl crate::RequestBuilder for DeleteRule {
5342 fn request_options(&mut self) -> &mut crate::RequestOptions {
5343 &mut self.0.options
5344 }
5345 }
5346
5347 /// The request builder for [RuleService::list_rule_revisions][crate::client::RuleService::list_rule_revisions] calls.
5348 ///
5349 /// # Example
5350 /// ```
5351 /// # use google_cloud_chronicle_v1::builder::rule_service::ListRuleRevisions;
5352 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
5353 /// use google_cloud_gax::paginator::ItemPaginator;
5354 ///
5355 /// let builder = prepare_request_builder();
5356 /// let mut items = builder.by_item();
5357 /// while let Some(result) = items.next().await {
5358 /// let item = result?;
5359 /// }
5360 /// # Ok(()) }
5361 ///
5362 /// fn prepare_request_builder() -> ListRuleRevisions {
5363 /// # panic!();
5364 /// // ... details omitted ...
5365 /// }
5366 /// ```
5367 #[derive(Clone, Debug)]
5368 pub struct ListRuleRevisions(RequestBuilder<crate::model::ListRuleRevisionsRequest>);
5369
5370 impl ListRuleRevisions {
5371 pub(crate) fn new(
5372 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
5373 ) -> Self {
5374 Self(RequestBuilder::new(stub))
5375 }
5376
5377 /// Sets the full request, replacing any prior values.
5378 pub fn with_request<V: Into<crate::model::ListRuleRevisionsRequest>>(
5379 mut self,
5380 v: V,
5381 ) -> Self {
5382 self.0.request = v.into();
5383 self
5384 }
5385
5386 /// Sets all the options, replacing any prior values.
5387 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5388 self.0.options = v.into();
5389 self
5390 }
5391
5392 /// Sends the request.
5393 pub async fn send(self) -> Result<crate::model::ListRuleRevisionsResponse> {
5394 (*self.0.stub)
5395 .list_rule_revisions(self.0.request, self.0.options)
5396 .await
5397 .map(crate::Response::into_body)
5398 }
5399
5400 /// Streams each page in the collection.
5401 pub fn by_page(
5402 self,
5403 ) -> impl google_cloud_gax::paginator::Paginator<
5404 crate::model::ListRuleRevisionsResponse,
5405 crate::Error,
5406 > {
5407 use std::clone::Clone;
5408 let token = self.0.request.page_token.clone();
5409 let execute = move |token: String| {
5410 let mut builder = self.clone();
5411 builder.0.request = builder.0.request.set_page_token(token);
5412 builder.send()
5413 };
5414 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5415 }
5416
5417 /// Streams each item in the collection.
5418 pub fn by_item(
5419 self,
5420 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5421 crate::model::ListRuleRevisionsResponse,
5422 crate::Error,
5423 > {
5424 use google_cloud_gax::paginator::Paginator;
5425 self.by_page().items()
5426 }
5427
5428 /// Sets the value of [name][crate::model::ListRuleRevisionsRequest::name].
5429 ///
5430 /// This is a **required** field for requests.
5431 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5432 self.0.request.name = v.into();
5433 self
5434 }
5435
5436 /// Sets the value of [page_size][crate::model::ListRuleRevisionsRequest::page_size].
5437 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5438 self.0.request.page_size = v.into();
5439 self
5440 }
5441
5442 /// Sets the value of [page_token][crate::model::ListRuleRevisionsRequest::page_token].
5443 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5444 self.0.request.page_token = v.into();
5445 self
5446 }
5447
5448 /// Sets the value of [view][crate::model::ListRuleRevisionsRequest::view].
5449 pub fn set_view<T: Into<crate::model::RuleView>>(mut self, v: T) -> Self {
5450 self.0.request.view = v.into();
5451 self
5452 }
5453 }
5454
5455 #[doc(hidden)]
5456 impl crate::RequestBuilder for ListRuleRevisions {
5457 fn request_options(&mut self) -> &mut crate::RequestOptions {
5458 &mut self.0.options
5459 }
5460 }
5461
5462 /// The request builder for [RuleService::create_retrohunt][crate::client::RuleService::create_retrohunt] calls.
5463 ///
5464 /// # Example
5465 /// ```
5466 /// # use google_cloud_chronicle_v1::builder::rule_service::CreateRetrohunt;
5467 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
5468 /// use google_cloud_lro::Poller;
5469 ///
5470 /// let builder = prepare_request_builder();
5471 /// let response = builder.poller().until_done().await?;
5472 /// # Ok(()) }
5473 ///
5474 /// fn prepare_request_builder() -> CreateRetrohunt {
5475 /// # panic!();
5476 /// // ... details omitted ...
5477 /// }
5478 /// ```
5479 #[derive(Clone, Debug)]
5480 pub struct CreateRetrohunt(RequestBuilder<crate::model::CreateRetrohuntRequest>);
5481
5482 impl CreateRetrohunt {
5483 pub(crate) fn new(
5484 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
5485 ) -> Self {
5486 Self(RequestBuilder::new(stub))
5487 }
5488
5489 /// Sets the full request, replacing any prior values.
5490 pub fn with_request<V: Into<crate::model::CreateRetrohuntRequest>>(mut self, v: V) -> Self {
5491 self.0.request = v.into();
5492 self
5493 }
5494
5495 /// Sets all the options, replacing any prior values.
5496 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5497 self.0.options = v.into();
5498 self
5499 }
5500
5501 /// Sends the request.
5502 ///
5503 /// # Long running operations
5504 ///
5505 /// This starts, but does not poll, a longrunning operation. More information
5506 /// on [create_retrohunt][crate::client::RuleService::create_retrohunt].
5507 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5508 (*self.0.stub)
5509 .create_retrohunt(self.0.request, self.0.options)
5510 .await
5511 .map(crate::Response::into_body)
5512 }
5513
5514 /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_retrohunt`.
5515 pub fn poller(
5516 self,
5517 ) -> impl google_cloud_lro::Poller<crate::model::Retrohunt, crate::model::RetrohuntMetadata>
5518 {
5519 type Operation = google_cloud_lro::internal::Operation<
5520 crate::model::Retrohunt,
5521 crate::model::RetrohuntMetadata,
5522 >;
5523 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5524 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5525
5526 let stub = self.0.stub.clone();
5527 let mut options = self.0.options.clone();
5528 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5529 let query = move |name| {
5530 let stub = stub.clone();
5531 let options = options.clone();
5532 async {
5533 let op = GetOperation::new(stub)
5534 .set_name(name)
5535 .with_options(options)
5536 .send()
5537 .await?;
5538 Ok(Operation::new(op))
5539 }
5540 };
5541
5542 let start = move || async {
5543 let op = self.send().await?;
5544 Ok(Operation::new(op))
5545 };
5546
5547 google_cloud_lro::internal::new_poller(
5548 polling_error_policy,
5549 polling_backoff_policy,
5550 start,
5551 query,
5552 )
5553 }
5554
5555 /// Sets the value of [parent][crate::model::CreateRetrohuntRequest::parent].
5556 ///
5557 /// This is a **required** field for requests.
5558 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5559 self.0.request.parent = v.into();
5560 self
5561 }
5562
5563 /// Sets the value of [retrohunt][crate::model::CreateRetrohuntRequest::retrohunt].
5564 ///
5565 /// This is a **required** field for requests.
5566 pub fn set_retrohunt<T>(mut self, v: T) -> Self
5567 where
5568 T: std::convert::Into<crate::model::Retrohunt>,
5569 {
5570 self.0.request.retrohunt = std::option::Option::Some(v.into());
5571 self
5572 }
5573
5574 /// Sets or clears the value of [retrohunt][crate::model::CreateRetrohuntRequest::retrohunt].
5575 ///
5576 /// This is a **required** field for requests.
5577 pub fn set_or_clear_retrohunt<T>(mut self, v: std::option::Option<T>) -> Self
5578 where
5579 T: std::convert::Into<crate::model::Retrohunt>,
5580 {
5581 self.0.request.retrohunt = v.map(|x| x.into());
5582 self
5583 }
5584 }
5585
5586 #[doc(hidden)]
5587 impl crate::RequestBuilder for CreateRetrohunt {
5588 fn request_options(&mut self) -> &mut crate::RequestOptions {
5589 &mut self.0.options
5590 }
5591 }
5592
5593 /// The request builder for [RuleService::get_retrohunt][crate::client::RuleService::get_retrohunt] calls.
5594 ///
5595 /// # Example
5596 /// ```
5597 /// # use google_cloud_chronicle_v1::builder::rule_service::GetRetrohunt;
5598 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
5599 ///
5600 /// let builder = prepare_request_builder();
5601 /// let response = builder.send().await?;
5602 /// # Ok(()) }
5603 ///
5604 /// fn prepare_request_builder() -> GetRetrohunt {
5605 /// # panic!();
5606 /// // ... details omitted ...
5607 /// }
5608 /// ```
5609 #[derive(Clone, Debug)]
5610 pub struct GetRetrohunt(RequestBuilder<crate::model::GetRetrohuntRequest>);
5611
5612 impl GetRetrohunt {
5613 pub(crate) fn new(
5614 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
5615 ) -> Self {
5616 Self(RequestBuilder::new(stub))
5617 }
5618
5619 /// Sets the full request, replacing any prior values.
5620 pub fn with_request<V: Into<crate::model::GetRetrohuntRequest>>(mut self, v: V) -> Self {
5621 self.0.request = v.into();
5622 self
5623 }
5624
5625 /// Sets all the options, replacing any prior values.
5626 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5627 self.0.options = v.into();
5628 self
5629 }
5630
5631 /// Sends the request.
5632 pub async fn send(self) -> Result<crate::model::Retrohunt> {
5633 (*self.0.stub)
5634 .get_retrohunt(self.0.request, self.0.options)
5635 .await
5636 .map(crate::Response::into_body)
5637 }
5638
5639 /// Sets the value of [name][crate::model::GetRetrohuntRequest::name].
5640 ///
5641 /// This is a **required** field for requests.
5642 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5643 self.0.request.name = v.into();
5644 self
5645 }
5646 }
5647
5648 #[doc(hidden)]
5649 impl crate::RequestBuilder for GetRetrohunt {
5650 fn request_options(&mut self) -> &mut crate::RequestOptions {
5651 &mut self.0.options
5652 }
5653 }
5654
5655 /// The request builder for [RuleService::list_retrohunts][crate::client::RuleService::list_retrohunts] calls.
5656 ///
5657 /// # Example
5658 /// ```
5659 /// # use google_cloud_chronicle_v1::builder::rule_service::ListRetrohunts;
5660 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
5661 /// use google_cloud_gax::paginator::ItemPaginator;
5662 ///
5663 /// let builder = prepare_request_builder();
5664 /// let mut items = builder.by_item();
5665 /// while let Some(result) = items.next().await {
5666 /// let item = result?;
5667 /// }
5668 /// # Ok(()) }
5669 ///
5670 /// fn prepare_request_builder() -> ListRetrohunts {
5671 /// # panic!();
5672 /// // ... details omitted ...
5673 /// }
5674 /// ```
5675 #[derive(Clone, Debug)]
5676 pub struct ListRetrohunts(RequestBuilder<crate::model::ListRetrohuntsRequest>);
5677
5678 impl ListRetrohunts {
5679 pub(crate) fn new(
5680 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
5681 ) -> Self {
5682 Self(RequestBuilder::new(stub))
5683 }
5684
5685 /// Sets the full request, replacing any prior values.
5686 pub fn with_request<V: Into<crate::model::ListRetrohuntsRequest>>(mut self, v: V) -> Self {
5687 self.0.request = v.into();
5688 self
5689 }
5690
5691 /// Sets all the options, replacing any prior values.
5692 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5693 self.0.options = v.into();
5694 self
5695 }
5696
5697 /// Sends the request.
5698 pub async fn send(self) -> Result<crate::model::ListRetrohuntsResponse> {
5699 (*self.0.stub)
5700 .list_retrohunts(self.0.request, self.0.options)
5701 .await
5702 .map(crate::Response::into_body)
5703 }
5704
5705 /// Streams each page in the collection.
5706 pub fn by_page(
5707 self,
5708 ) -> impl google_cloud_gax::paginator::Paginator<
5709 crate::model::ListRetrohuntsResponse,
5710 crate::Error,
5711 > {
5712 use std::clone::Clone;
5713 let token = self.0.request.page_token.clone();
5714 let execute = move |token: String| {
5715 let mut builder = self.clone();
5716 builder.0.request = builder.0.request.set_page_token(token);
5717 builder.send()
5718 };
5719 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5720 }
5721
5722 /// Streams each item in the collection.
5723 pub fn by_item(
5724 self,
5725 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5726 crate::model::ListRetrohuntsResponse,
5727 crate::Error,
5728 > {
5729 use google_cloud_gax::paginator::Paginator;
5730 self.by_page().items()
5731 }
5732
5733 /// Sets the value of [parent][crate::model::ListRetrohuntsRequest::parent].
5734 ///
5735 /// This is a **required** field for requests.
5736 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5737 self.0.request.parent = v.into();
5738 self
5739 }
5740
5741 /// Sets the value of [page_size][crate::model::ListRetrohuntsRequest::page_size].
5742 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5743 self.0.request.page_size = v.into();
5744 self
5745 }
5746
5747 /// Sets the value of [page_token][crate::model::ListRetrohuntsRequest::page_token].
5748 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5749 self.0.request.page_token = v.into();
5750 self
5751 }
5752
5753 /// Sets the value of [filter][crate::model::ListRetrohuntsRequest::filter].
5754 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5755 self.0.request.filter = v.into();
5756 self
5757 }
5758 }
5759
5760 #[doc(hidden)]
5761 impl crate::RequestBuilder for ListRetrohunts {
5762 fn request_options(&mut self) -> &mut crate::RequestOptions {
5763 &mut self.0.options
5764 }
5765 }
5766
5767 /// The request builder for [RuleService::get_rule_deployment][crate::client::RuleService::get_rule_deployment] calls.
5768 ///
5769 /// # Example
5770 /// ```
5771 /// # use google_cloud_chronicle_v1::builder::rule_service::GetRuleDeployment;
5772 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
5773 ///
5774 /// let builder = prepare_request_builder();
5775 /// let response = builder.send().await?;
5776 /// # Ok(()) }
5777 ///
5778 /// fn prepare_request_builder() -> GetRuleDeployment {
5779 /// # panic!();
5780 /// // ... details omitted ...
5781 /// }
5782 /// ```
5783 #[derive(Clone, Debug)]
5784 pub struct GetRuleDeployment(RequestBuilder<crate::model::GetRuleDeploymentRequest>);
5785
5786 impl GetRuleDeployment {
5787 pub(crate) fn new(
5788 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
5789 ) -> Self {
5790 Self(RequestBuilder::new(stub))
5791 }
5792
5793 /// Sets the full request, replacing any prior values.
5794 pub fn with_request<V: Into<crate::model::GetRuleDeploymentRequest>>(
5795 mut self,
5796 v: V,
5797 ) -> Self {
5798 self.0.request = v.into();
5799 self
5800 }
5801
5802 /// Sets all the options, replacing any prior values.
5803 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5804 self.0.options = v.into();
5805 self
5806 }
5807
5808 /// Sends the request.
5809 pub async fn send(self) -> Result<crate::model::RuleDeployment> {
5810 (*self.0.stub)
5811 .get_rule_deployment(self.0.request, self.0.options)
5812 .await
5813 .map(crate::Response::into_body)
5814 }
5815
5816 /// Sets the value of [name][crate::model::GetRuleDeploymentRequest::name].
5817 ///
5818 /// This is a **required** field for requests.
5819 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5820 self.0.request.name = v.into();
5821 self
5822 }
5823 }
5824
5825 #[doc(hidden)]
5826 impl crate::RequestBuilder for GetRuleDeployment {
5827 fn request_options(&mut self) -> &mut crate::RequestOptions {
5828 &mut self.0.options
5829 }
5830 }
5831
5832 /// The request builder for [RuleService::list_rule_deployments][crate::client::RuleService::list_rule_deployments] calls.
5833 ///
5834 /// # Example
5835 /// ```
5836 /// # use google_cloud_chronicle_v1::builder::rule_service::ListRuleDeployments;
5837 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
5838 /// use google_cloud_gax::paginator::ItemPaginator;
5839 ///
5840 /// let builder = prepare_request_builder();
5841 /// let mut items = builder.by_item();
5842 /// while let Some(result) = items.next().await {
5843 /// let item = result?;
5844 /// }
5845 /// # Ok(()) }
5846 ///
5847 /// fn prepare_request_builder() -> ListRuleDeployments {
5848 /// # panic!();
5849 /// // ... details omitted ...
5850 /// }
5851 /// ```
5852 #[derive(Clone, Debug)]
5853 pub struct ListRuleDeployments(RequestBuilder<crate::model::ListRuleDeploymentsRequest>);
5854
5855 impl ListRuleDeployments {
5856 pub(crate) fn new(
5857 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
5858 ) -> Self {
5859 Self(RequestBuilder::new(stub))
5860 }
5861
5862 /// Sets the full request, replacing any prior values.
5863 pub fn with_request<V: Into<crate::model::ListRuleDeploymentsRequest>>(
5864 mut self,
5865 v: V,
5866 ) -> Self {
5867 self.0.request = v.into();
5868 self
5869 }
5870
5871 /// Sets all the options, replacing any prior values.
5872 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5873 self.0.options = v.into();
5874 self
5875 }
5876
5877 /// Sends the request.
5878 pub async fn send(self) -> Result<crate::model::ListRuleDeploymentsResponse> {
5879 (*self.0.stub)
5880 .list_rule_deployments(self.0.request, self.0.options)
5881 .await
5882 .map(crate::Response::into_body)
5883 }
5884
5885 /// Streams each page in the collection.
5886 pub fn by_page(
5887 self,
5888 ) -> impl google_cloud_gax::paginator::Paginator<
5889 crate::model::ListRuleDeploymentsResponse,
5890 crate::Error,
5891 > {
5892 use std::clone::Clone;
5893 let token = self.0.request.page_token.clone();
5894 let execute = move |token: String| {
5895 let mut builder = self.clone();
5896 builder.0.request = builder.0.request.set_page_token(token);
5897 builder.send()
5898 };
5899 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5900 }
5901
5902 /// Streams each item in the collection.
5903 pub fn by_item(
5904 self,
5905 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5906 crate::model::ListRuleDeploymentsResponse,
5907 crate::Error,
5908 > {
5909 use google_cloud_gax::paginator::Paginator;
5910 self.by_page().items()
5911 }
5912
5913 /// Sets the value of [parent][crate::model::ListRuleDeploymentsRequest::parent].
5914 ///
5915 /// This is a **required** field for requests.
5916 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5917 self.0.request.parent = v.into();
5918 self
5919 }
5920
5921 /// Sets the value of [page_size][crate::model::ListRuleDeploymentsRequest::page_size].
5922 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5923 self.0.request.page_size = v.into();
5924 self
5925 }
5926
5927 /// Sets the value of [page_token][crate::model::ListRuleDeploymentsRequest::page_token].
5928 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5929 self.0.request.page_token = v.into();
5930 self
5931 }
5932
5933 /// Sets the value of [filter][crate::model::ListRuleDeploymentsRequest::filter].
5934 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5935 self.0.request.filter = v.into();
5936 self
5937 }
5938 }
5939
5940 #[doc(hidden)]
5941 impl crate::RequestBuilder for ListRuleDeployments {
5942 fn request_options(&mut self) -> &mut crate::RequestOptions {
5943 &mut self.0.options
5944 }
5945 }
5946
5947 /// The request builder for [RuleService::update_rule_deployment][crate::client::RuleService::update_rule_deployment] calls.
5948 ///
5949 /// # Example
5950 /// ```
5951 /// # use google_cloud_chronicle_v1::builder::rule_service::UpdateRuleDeployment;
5952 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
5953 ///
5954 /// let builder = prepare_request_builder();
5955 /// let response = builder.send().await?;
5956 /// # Ok(()) }
5957 ///
5958 /// fn prepare_request_builder() -> UpdateRuleDeployment {
5959 /// # panic!();
5960 /// // ... details omitted ...
5961 /// }
5962 /// ```
5963 #[derive(Clone, Debug)]
5964 pub struct UpdateRuleDeployment(RequestBuilder<crate::model::UpdateRuleDeploymentRequest>);
5965
5966 impl UpdateRuleDeployment {
5967 pub(crate) fn new(
5968 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
5969 ) -> Self {
5970 Self(RequestBuilder::new(stub))
5971 }
5972
5973 /// Sets the full request, replacing any prior values.
5974 pub fn with_request<V: Into<crate::model::UpdateRuleDeploymentRequest>>(
5975 mut self,
5976 v: V,
5977 ) -> Self {
5978 self.0.request = v.into();
5979 self
5980 }
5981
5982 /// Sets all the options, replacing any prior values.
5983 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5984 self.0.options = v.into();
5985 self
5986 }
5987
5988 /// Sends the request.
5989 pub async fn send(self) -> Result<crate::model::RuleDeployment> {
5990 (*self.0.stub)
5991 .update_rule_deployment(self.0.request, self.0.options)
5992 .await
5993 .map(crate::Response::into_body)
5994 }
5995
5996 /// Sets the value of [rule_deployment][crate::model::UpdateRuleDeploymentRequest::rule_deployment].
5997 ///
5998 /// This is a **required** field for requests.
5999 pub fn set_rule_deployment<T>(mut self, v: T) -> Self
6000 where
6001 T: std::convert::Into<crate::model::RuleDeployment>,
6002 {
6003 self.0.request.rule_deployment = std::option::Option::Some(v.into());
6004 self
6005 }
6006
6007 /// Sets or clears the value of [rule_deployment][crate::model::UpdateRuleDeploymentRequest::rule_deployment].
6008 ///
6009 /// This is a **required** field for requests.
6010 pub fn set_or_clear_rule_deployment<T>(mut self, v: std::option::Option<T>) -> Self
6011 where
6012 T: std::convert::Into<crate::model::RuleDeployment>,
6013 {
6014 self.0.request.rule_deployment = v.map(|x| x.into());
6015 self
6016 }
6017
6018 /// Sets the value of [update_mask][crate::model::UpdateRuleDeploymentRequest::update_mask].
6019 ///
6020 /// This is a **required** field for requests.
6021 pub fn set_update_mask<T>(mut self, v: T) -> Self
6022 where
6023 T: std::convert::Into<wkt::FieldMask>,
6024 {
6025 self.0.request.update_mask = std::option::Option::Some(v.into());
6026 self
6027 }
6028
6029 /// Sets or clears the value of [update_mask][crate::model::UpdateRuleDeploymentRequest::update_mask].
6030 ///
6031 /// This is a **required** field for requests.
6032 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6033 where
6034 T: std::convert::Into<wkt::FieldMask>,
6035 {
6036 self.0.request.update_mask = v.map(|x| x.into());
6037 self
6038 }
6039 }
6040
6041 #[doc(hidden)]
6042 impl crate::RequestBuilder for UpdateRuleDeployment {
6043 fn request_options(&mut self) -> &mut crate::RequestOptions {
6044 &mut self.0.options
6045 }
6046 }
6047
6048 /// The request builder for [RuleService::list_operations][crate::client::RuleService::list_operations] calls.
6049 ///
6050 /// # Example
6051 /// ```
6052 /// # use google_cloud_chronicle_v1::builder::rule_service::ListOperations;
6053 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
6054 /// use google_cloud_gax::paginator::ItemPaginator;
6055 ///
6056 /// let builder = prepare_request_builder();
6057 /// let mut items = builder.by_item();
6058 /// while let Some(result) = items.next().await {
6059 /// let item = result?;
6060 /// }
6061 /// # Ok(()) }
6062 ///
6063 /// fn prepare_request_builder() -> ListOperations {
6064 /// # panic!();
6065 /// // ... details omitted ...
6066 /// }
6067 /// ```
6068 #[derive(Clone, Debug)]
6069 pub struct ListOperations(
6070 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6071 );
6072
6073 impl ListOperations {
6074 pub(crate) fn new(
6075 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
6076 ) -> Self {
6077 Self(RequestBuilder::new(stub))
6078 }
6079
6080 /// Sets the full request, replacing any prior values.
6081 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6082 mut self,
6083 v: V,
6084 ) -> Self {
6085 self.0.request = v.into();
6086 self
6087 }
6088
6089 /// Sets all the options, replacing any prior values.
6090 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6091 self.0.options = v.into();
6092 self
6093 }
6094
6095 /// Sends the request.
6096 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6097 (*self.0.stub)
6098 .list_operations(self.0.request, self.0.options)
6099 .await
6100 .map(crate::Response::into_body)
6101 }
6102
6103 /// Streams each page in the collection.
6104 pub fn by_page(
6105 self,
6106 ) -> impl google_cloud_gax::paginator::Paginator<
6107 google_cloud_longrunning::model::ListOperationsResponse,
6108 crate::Error,
6109 > {
6110 use std::clone::Clone;
6111 let token = self.0.request.page_token.clone();
6112 let execute = move |token: String| {
6113 let mut builder = self.clone();
6114 builder.0.request = builder.0.request.set_page_token(token);
6115 builder.send()
6116 };
6117 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6118 }
6119
6120 /// Streams each item in the collection.
6121 pub fn by_item(
6122 self,
6123 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6124 google_cloud_longrunning::model::ListOperationsResponse,
6125 crate::Error,
6126 > {
6127 use google_cloud_gax::paginator::Paginator;
6128 self.by_page().items()
6129 }
6130
6131 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
6132 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6133 self.0.request.name = v.into();
6134 self
6135 }
6136
6137 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
6138 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6139 self.0.request.filter = v.into();
6140 self
6141 }
6142
6143 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
6144 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6145 self.0.request.page_size = v.into();
6146 self
6147 }
6148
6149 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
6150 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6151 self.0.request.page_token = v.into();
6152 self
6153 }
6154
6155 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
6156 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6157 self.0.request.return_partial_success = v.into();
6158 self
6159 }
6160 }
6161
6162 #[doc(hidden)]
6163 impl crate::RequestBuilder for ListOperations {
6164 fn request_options(&mut self) -> &mut crate::RequestOptions {
6165 &mut self.0.options
6166 }
6167 }
6168
6169 /// The request builder for [RuleService::get_operation][crate::client::RuleService::get_operation] calls.
6170 ///
6171 /// # Example
6172 /// ```
6173 /// # use google_cloud_chronicle_v1::builder::rule_service::GetOperation;
6174 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
6175 ///
6176 /// let builder = prepare_request_builder();
6177 /// let response = builder.send().await?;
6178 /// # Ok(()) }
6179 ///
6180 /// fn prepare_request_builder() -> GetOperation {
6181 /// # panic!();
6182 /// // ... details omitted ...
6183 /// }
6184 /// ```
6185 #[derive(Clone, Debug)]
6186 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6187
6188 impl GetOperation {
6189 pub(crate) fn new(
6190 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
6191 ) -> Self {
6192 Self(RequestBuilder::new(stub))
6193 }
6194
6195 /// Sets the full request, replacing any prior values.
6196 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6197 mut self,
6198 v: V,
6199 ) -> Self {
6200 self.0.request = v.into();
6201 self
6202 }
6203
6204 /// Sets all the options, replacing any prior values.
6205 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6206 self.0.options = v.into();
6207 self
6208 }
6209
6210 /// Sends the request.
6211 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6212 (*self.0.stub)
6213 .get_operation(self.0.request, self.0.options)
6214 .await
6215 .map(crate::Response::into_body)
6216 }
6217
6218 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
6219 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6220 self.0.request.name = v.into();
6221 self
6222 }
6223 }
6224
6225 #[doc(hidden)]
6226 impl crate::RequestBuilder for GetOperation {
6227 fn request_options(&mut self) -> &mut crate::RequestOptions {
6228 &mut self.0.options
6229 }
6230 }
6231
6232 /// The request builder for [RuleService::delete_operation][crate::client::RuleService::delete_operation] calls.
6233 ///
6234 /// # Example
6235 /// ```
6236 /// # use google_cloud_chronicle_v1::builder::rule_service::DeleteOperation;
6237 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
6238 ///
6239 /// let builder = prepare_request_builder();
6240 /// let response = builder.send().await?;
6241 /// # Ok(()) }
6242 ///
6243 /// fn prepare_request_builder() -> DeleteOperation {
6244 /// # panic!();
6245 /// // ... details omitted ...
6246 /// }
6247 /// ```
6248 #[derive(Clone, Debug)]
6249 pub struct DeleteOperation(
6250 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
6251 );
6252
6253 impl DeleteOperation {
6254 pub(crate) fn new(
6255 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
6256 ) -> Self {
6257 Self(RequestBuilder::new(stub))
6258 }
6259
6260 /// Sets the full request, replacing any prior values.
6261 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
6262 mut self,
6263 v: V,
6264 ) -> Self {
6265 self.0.request = v.into();
6266 self
6267 }
6268
6269 /// Sets all the options, replacing any prior values.
6270 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6271 self.0.options = v.into();
6272 self
6273 }
6274
6275 /// Sends the request.
6276 pub async fn send(self) -> Result<()> {
6277 (*self.0.stub)
6278 .delete_operation(self.0.request, self.0.options)
6279 .await
6280 .map(crate::Response::into_body)
6281 }
6282
6283 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
6284 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6285 self.0.request.name = v.into();
6286 self
6287 }
6288 }
6289
6290 #[doc(hidden)]
6291 impl crate::RequestBuilder for DeleteOperation {
6292 fn request_options(&mut self) -> &mut crate::RequestOptions {
6293 &mut self.0.options
6294 }
6295 }
6296
6297 /// The request builder for [RuleService::cancel_operation][crate::client::RuleService::cancel_operation] calls.
6298 ///
6299 /// # Example
6300 /// ```
6301 /// # use google_cloud_chronicle_v1::builder::rule_service::CancelOperation;
6302 /// # async fn sample() -> google_cloud_chronicle_v1::Result<()> {
6303 ///
6304 /// let builder = prepare_request_builder();
6305 /// let response = builder.send().await?;
6306 /// # Ok(()) }
6307 ///
6308 /// fn prepare_request_builder() -> CancelOperation {
6309 /// # panic!();
6310 /// // ... details omitted ...
6311 /// }
6312 /// ```
6313 #[derive(Clone, Debug)]
6314 pub struct CancelOperation(
6315 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
6316 );
6317
6318 impl CancelOperation {
6319 pub(crate) fn new(
6320 stub: std::sync::Arc<dyn super::super::stub::dynamic::RuleService>,
6321 ) -> Self {
6322 Self(RequestBuilder::new(stub))
6323 }
6324
6325 /// Sets the full request, replacing any prior values.
6326 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
6327 mut self,
6328 v: V,
6329 ) -> Self {
6330 self.0.request = v.into();
6331 self
6332 }
6333
6334 /// Sets all the options, replacing any prior values.
6335 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6336 self.0.options = v.into();
6337 self
6338 }
6339
6340 /// Sends the request.
6341 pub async fn send(self) -> Result<()> {
6342 (*self.0.stub)
6343 .cancel_operation(self.0.request, self.0.options)
6344 .await
6345 .map(crate::Response::into_body)
6346 }
6347
6348 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
6349 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6350 self.0.request.name = v.into();
6351 self
6352 }
6353 }
6354
6355 #[doc(hidden)]
6356 impl crate::RequestBuilder for CancelOperation {
6357 fn request_options(&mut self) -> &mut crate::RequestOptions {
6358 &mut self.0.options
6359 }
6360 }
6361}