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