1#![allow(unused_imports)]
4
5use crate::objects::*;
6use crate::{
7 CursorPaginated, NextCursor, ResponseMetadata, SlackApiMethod, SlackClient, SlackError,
8};
9use serde::{Deserialize, Serialize};
10
11#[doc(alias = "users.conversations")]
15#[derive(Debug, Clone, PartialEq, Serialize, Default)]
16#[non_exhaustive]
17pub struct UsersConversationsRequest {
18 #[serde(skip_serializing_if = "Option::is_none")]
20 pub cursor: Option<String>,
21 #[serde(skip_serializing_if = "Option::is_none")]
23 pub exclude_archived: Option<bool>,
24 #[serde(skip_serializing_if = "Option::is_none")]
26 pub exclude_muted: Option<bool>,
27 #[serde(skip_serializing_if = "Option::is_none")]
29 pub limit: Option<i64>,
30 #[serde(skip_serializing_if = "Option::is_none")]
32 pub team_id: Option<String>,
33 #[serde(skip_serializing_if = "Option::is_none")]
35 pub types: Option<String>,
36 #[serde(skip_serializing_if = "Option::is_none")]
38 pub user: Option<String>,
39}
40
41impl UsersConversationsRequest {
42 pub fn new() -> Self {
43 Self {
44 cursor: None,
45 exclude_archived: None,
46 exclude_muted: None,
47 limit: None,
48 team_id: None,
49 types: None,
50 user: None,
51 }
52 }
53
54 pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
55 self.cursor = Some(cursor.into());
56 self
57 }
58
59 pub fn exclude_archived(mut self, exclude_archived: bool) -> Self {
60 self.exclude_archived = Some(exclude_archived);
61 self
62 }
63
64 pub fn exclude_muted(mut self, exclude_muted: bool) -> Self {
65 self.exclude_muted = Some(exclude_muted);
66 self
67 }
68
69 pub fn limit(mut self, limit: i64) -> Self {
70 self.limit = Some(limit);
71 self
72 }
73
74 pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
75 self.team_id = Some(team_id.into());
76 self
77 }
78
79 pub fn types(mut self, types: impl Into<String>) -> Self {
80 self.types = Some(types.into());
81 self
82 }
83
84 pub fn user(mut self, user: impl Into<String>) -> Self {
85 self.user = Some(user.into());
86 self
87 }
88}
89
90impl SlackApiMethod for UsersConversationsRequest {
91 const METHOD: &'static str = "users.conversations";
92 type Response = UsersConversationsResponse;
93}
94
95impl CursorPaginated for UsersConversationsRequest {
96 fn set_cursor(&mut self, cursor: String) {
97 self.cursor = Some(cursor);
98 }
99}
100
101impl NextCursor for UsersConversationsResponse {
102 fn next_cursor(&self) -> Option<&str> {
103 self.response_metadata.as_ref()?.next_cursor.as_deref()
104 }
105}
106
107#[doc(alias = "users.conversations")]
109#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
110pub struct UsersConversationsResponse {
111 #[serde(
112 default,
113 deserialize_with = "crate::de::vec",
114 skip_serializing_if = "Vec::is_empty"
115 )]
116 pub channels: Vec<Conversation>,
117 #[serde(
118 default,
119 deserialize_with = "crate::de::opt_object",
120 skip_serializing_if = "Option::is_none"
121 )]
122 pub response_metadata: Option<ResponseMetadata>,
123 #[serde(
124 default,
125 deserialize_with = "crate::de::opt_string",
126 skip_serializing_if = "Option::is_none"
127 )]
128 pub warning: Option<String>,
129}
130
131#[doc(alias = "users.deletePhoto")]
135#[derive(Debug, Clone, PartialEq, Serialize, Default)]
136#[non_exhaustive]
137pub struct UsersDeletePhotoRequest {}
138
139impl UsersDeletePhotoRequest {
140 pub fn new() -> Self {
141 Self {}
142 }
143}
144
145impl SlackApiMethod for UsersDeletePhotoRequest {
146 const METHOD: &'static str = "users.deletePhoto";
147 type Response = UsersDeletePhotoResponse;
148}
149
150#[doc(alias = "users.deletePhoto")]
152#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
153pub struct UsersDeletePhotoResponse {
154 #[serde(flatten)]
156 pub extra: serde_json::Map<String, serde_json::Value>,
157 #[serde(
158 default,
159 deserialize_with = "crate::de::opt_object",
160 skip_serializing_if = "Option::is_none"
161 )]
162 pub response_metadata: Option<ResponseMetadata>,
163 #[serde(
164 default,
165 deserialize_with = "crate::de::opt_string",
166 skip_serializing_if = "Option::is_none"
167 )]
168 pub warning: Option<String>,
169}
170
171#[doc(alias = "users.discoverableContacts.lookup")]
175#[derive(Debug, Clone, PartialEq, Serialize)]
176#[non_exhaustive]
177pub struct UsersDiscoverableContactsLookupRequest {
178 pub email: String,
179}
180
181impl UsersDiscoverableContactsLookupRequest {
182 pub fn new(email: impl Into<String>) -> Self {
183 Self {
184 email: email.into(),
185 }
186 }
187}
188
189impl SlackApiMethod for UsersDiscoverableContactsLookupRequest {
190 const METHOD: &'static str = "users.discoverableContacts.lookup";
191 type Response = UsersDiscoverableContactsLookupResponse;
192}
193
194#[doc(alias = "users.discoverableContacts.lookup")]
196#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
197pub struct UsersDiscoverableContactsLookupResponse {
198 #[serde(
199 default,
200 deserialize_with = "crate::de::opt_bool",
201 skip_serializing_if = "Option::is_none"
202 )]
203 pub is_discoverable: Option<bool>,
204 #[serde(
205 default,
206 deserialize_with = "crate::de::opt_object",
207 skip_serializing_if = "Option::is_none"
208 )]
209 pub response_metadata: Option<ResponseMetadata>,
210 #[serde(
211 default,
212 deserialize_with = "crate::de::opt_string",
213 skip_serializing_if = "Option::is_none"
214 )]
215 pub warning: Option<String>,
216}
217
218#[doc(alias = "users.getPresence")]
222#[derive(Debug, Clone, PartialEq, Serialize, Default)]
223#[non_exhaustive]
224pub struct UsersGetPresenceRequest {
225 #[serde(skip_serializing_if = "Option::is_none")]
227 pub user: Option<String>,
228}
229
230impl UsersGetPresenceRequest {
231 pub fn new() -> Self {
232 Self { user: None }
233 }
234
235 pub fn user(mut self, user: impl Into<String>) -> Self {
236 self.user = Some(user.into());
237 self
238 }
239}
240
241impl SlackApiMethod for UsersGetPresenceRequest {
242 const METHOD: &'static str = "users.getPresence";
243 type Response = UsersGetPresenceResponse;
244}
245
246#[doc(alias = "users.getPresence")]
248#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
249pub struct UsersGetPresenceResponse {
250 #[serde(
251 default,
252 deserialize_with = "crate::de::opt_string",
253 skip_serializing_if = "Option::is_none"
254 )]
255 pub presence: Option<String>,
256 #[serde(
257 default,
258 deserialize_with = "crate::de::opt_bool",
259 skip_serializing_if = "Option::is_none"
260 )]
261 pub online: Option<bool>,
262 #[serde(
263 default,
264 deserialize_with = "crate::de::opt_bool",
265 skip_serializing_if = "Option::is_none"
266 )]
267 pub auto_away: Option<bool>,
268 #[serde(
269 default,
270 deserialize_with = "crate::de::opt_bool",
271 skip_serializing_if = "Option::is_none"
272 )]
273 pub manual_away: Option<bool>,
274 #[serde(
275 default,
276 deserialize_with = "crate::de::opt_i64",
277 skip_serializing_if = "Option::is_none"
278 )]
279 pub connection_count: Option<i64>,
280 #[serde(
281 default,
282 deserialize_with = "crate::de::opt_i64",
283 skip_serializing_if = "Option::is_none"
284 )]
285 pub last_activity: Option<i64>,
286 #[serde(
287 default,
288 deserialize_with = "crate::de::opt_object",
289 skip_serializing_if = "Option::is_none"
290 )]
291 pub response_metadata: Option<ResponseMetadata>,
292 #[serde(
293 default,
294 deserialize_with = "crate::de::opt_string",
295 skip_serializing_if = "Option::is_none"
296 )]
297 pub warning: Option<String>,
298}
299
300#[doc(alias = "users.identity")]
304#[derive(Debug, Clone, PartialEq, Serialize, Default)]
305#[non_exhaustive]
306pub struct UsersIdentityRequest {}
307
308impl UsersIdentityRequest {
309 pub fn new() -> Self {
310 Self {}
311 }
312}
313
314impl SlackApiMethod for UsersIdentityRequest {
315 const METHOD: &'static str = "users.identity";
316 type Response = UsersIdentityResponse;
317}
318
319#[doc(alias = "users.identity")]
321#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
322pub struct UsersIdentityResponse {
323 #[serde(
324 default,
325 deserialize_with = "crate::de::opt_object",
326 skip_serializing_if = "Option::is_none"
327 )]
328 pub user: Option<UsersIdentityResponseUser>,
329 #[serde(
330 default,
331 deserialize_with = "crate::de::opt_object",
332 skip_serializing_if = "Option::is_none"
333 )]
334 pub team: Option<UsersIdentityResponseTeam>,
335 #[serde(
336 default,
337 deserialize_with = "crate::de::opt_object",
338 skip_serializing_if = "Option::is_none"
339 )]
340 pub response_metadata: Option<ResponseMetadata>,
341 #[serde(
342 default,
343 deserialize_with = "crate::de::opt_string",
344 skip_serializing_if = "Option::is_none"
345 )]
346 pub warning: Option<String>,
347}
348
349#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
350pub struct UsersIdentityResponseUser {
351 #[serde(
352 default,
353 deserialize_with = "crate::de::opt_string",
354 skip_serializing_if = "Option::is_none"
355 )]
356 pub name: Option<String>,
357 #[serde(
358 default,
359 deserialize_with = "crate::de::opt_string",
360 skip_serializing_if = "Option::is_none"
361 )]
362 pub id: Option<String>,
363 #[serde(
364 default,
365 deserialize_with = "crate::de::opt_string",
366 skip_serializing_if = "Option::is_none"
367 )]
368 pub email: Option<String>,
369 #[serde(
370 default,
371 deserialize_with = "crate::de::opt_string",
372 skip_serializing_if = "Option::is_none"
373 )]
374 pub image_24: Option<String>,
375 #[serde(
376 default,
377 deserialize_with = "crate::de::opt_string",
378 skip_serializing_if = "Option::is_none"
379 )]
380 pub image_32: Option<String>,
381 #[serde(
382 default,
383 deserialize_with = "crate::de::opt_string",
384 skip_serializing_if = "Option::is_none"
385 )]
386 pub image_48: Option<String>,
387 #[serde(
388 default,
389 deserialize_with = "crate::de::opt_string",
390 skip_serializing_if = "Option::is_none"
391 )]
392 pub image_72: Option<String>,
393 #[serde(
394 default,
395 deserialize_with = "crate::de::opt_string",
396 skip_serializing_if = "Option::is_none"
397 )]
398 pub image_192: Option<String>,
399}
400
401#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
402pub struct UsersIdentityResponseTeam {
403 #[serde(
404 default,
405 deserialize_with = "crate::de::opt_string",
406 skip_serializing_if = "Option::is_none"
407 )]
408 pub id: Option<String>,
409 #[serde(
410 default,
411 deserialize_with = "crate::de::opt_string",
412 skip_serializing_if = "Option::is_none"
413 )]
414 pub name: Option<String>,
415}
416
417#[doc(alias = "users.info")]
421#[derive(Debug, Clone, PartialEq, Serialize, Default)]
422#[non_exhaustive]
423pub struct UsersInfoRequest {
424 #[serde(skip_serializing_if = "Option::is_none")]
426 pub include_locale: Option<bool>,
427 #[serde(skip_serializing_if = "Option::is_none")]
429 pub user: Option<String>,
430}
431
432impl UsersInfoRequest {
433 pub fn new() -> Self {
434 Self {
435 include_locale: None,
436 user: None,
437 }
438 }
439
440 pub fn include_locale(mut self, include_locale: bool) -> Self {
441 self.include_locale = Some(include_locale);
442 self
443 }
444
445 pub fn user(mut self, user: impl Into<String>) -> Self {
446 self.user = Some(user.into());
447 self
448 }
449}
450
451impl SlackApiMethod for UsersInfoRequest {
452 const METHOD: &'static str = "users.info";
453 type Response = UsersInfoResponse;
454}
455
456#[doc(alias = "users.info")]
458#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
459pub struct UsersInfoResponse {
460 #[serde(
461 default,
462 deserialize_with = "crate::de::opt_object",
463 skip_serializing_if = "Option::is_none"
464 )]
465 pub user: Option<User>,
466 #[serde(
467 default,
468 deserialize_with = "crate::de::opt_object",
469 skip_serializing_if = "Option::is_none"
470 )]
471 pub response_metadata: Option<ResponseMetadata>,
472 #[serde(
473 default,
474 deserialize_with = "crate::de::opt_string",
475 skip_serializing_if = "Option::is_none"
476 )]
477 pub warning: Option<String>,
478}
479
480#[doc(alias = "users.list")]
484#[derive(Debug, Clone, PartialEq, Serialize, Default)]
485#[non_exhaustive]
486pub struct UsersListRequest {
487 #[serde(skip_serializing_if = "Option::is_none")]
489 pub cursor: Option<String>,
490 #[serde(skip_serializing_if = "Option::is_none")]
492 pub include_locale: Option<bool>,
493 #[serde(skip_serializing_if = "Option::is_none")]
495 pub limit: Option<i64>,
496 #[serde(skip_serializing_if = "Option::is_none")]
498 pub team_id: Option<String>,
499}
500
501impl UsersListRequest {
502 pub fn new() -> Self {
503 Self {
504 cursor: None,
505 include_locale: None,
506 limit: None,
507 team_id: None,
508 }
509 }
510
511 pub fn cursor(mut self, cursor: impl Into<String>) -> Self {
512 self.cursor = Some(cursor.into());
513 self
514 }
515
516 pub fn include_locale(mut self, include_locale: bool) -> Self {
517 self.include_locale = Some(include_locale);
518 self
519 }
520
521 pub fn limit(mut self, limit: i64) -> Self {
522 self.limit = Some(limit);
523 self
524 }
525
526 pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
527 self.team_id = Some(team_id.into());
528 self
529 }
530}
531
532impl SlackApiMethod for UsersListRequest {
533 const METHOD: &'static str = "users.list";
534 type Response = UsersListResponse;
535}
536
537impl CursorPaginated for UsersListRequest {
538 fn set_cursor(&mut self, cursor: String) {
539 self.cursor = Some(cursor);
540 }
541}
542
543impl NextCursor for UsersListResponse {
544 fn next_cursor(&self) -> Option<&str> {
545 self.response_metadata.as_ref()?.next_cursor.as_deref()
546 }
547}
548
549#[doc(alias = "users.list")]
551#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
552pub struct UsersListResponse {
553 #[serde(
554 default,
555 deserialize_with = "crate::de::vec",
556 skip_serializing_if = "Vec::is_empty"
557 )]
558 pub members: Vec<User>,
559 #[serde(
560 default,
561 deserialize_with = "crate::de::opt_i64",
562 skip_serializing_if = "Option::is_none"
563 )]
564 pub cache_ts: Option<i64>,
565 #[serde(
566 default,
567 deserialize_with = "crate::de::opt_object",
568 skip_serializing_if = "Option::is_none"
569 )]
570 pub response_metadata: Option<ResponseMetadata>,
571 #[serde(
572 default,
573 deserialize_with = "crate::de::opt_string",
574 skip_serializing_if = "Option::is_none"
575 )]
576 pub warning: Option<String>,
577}
578
579#[doc(alias = "users.lookupByEmail")]
583#[derive(Debug, Clone, PartialEq, Serialize)]
584#[non_exhaustive]
585pub struct UsersLookupByEmailRequest {
586 pub email: String,
588}
589
590impl UsersLookupByEmailRequest {
591 pub fn new(email: impl Into<String>) -> Self {
592 Self {
593 email: email.into(),
594 }
595 }
596}
597
598impl SlackApiMethod for UsersLookupByEmailRequest {
599 const METHOD: &'static str = "users.lookupByEmail";
600 type Response = UsersLookupByEmailResponse;
601}
602
603#[doc(alias = "users.lookupByEmail")]
605#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
606pub struct UsersLookupByEmailResponse {
607 #[serde(
608 default,
609 deserialize_with = "crate::de::opt_object",
610 skip_serializing_if = "Option::is_none"
611 )]
612 pub user: Option<User>,
613 #[serde(
614 default,
615 deserialize_with = "crate::de::opt_object",
616 skip_serializing_if = "Option::is_none"
617 )]
618 pub response_metadata: Option<ResponseMetadata>,
619 #[serde(
620 default,
621 deserialize_with = "crate::de::opt_string",
622 skip_serializing_if = "Option::is_none"
623 )]
624 pub warning: Option<String>,
625}
626
627#[doc(alias = "users.profile.get")]
631#[derive(Debug, Clone, PartialEq, Serialize, Default)]
632#[non_exhaustive]
633pub struct UsersProfileGetRequest {
634 #[serde(skip_serializing_if = "Option::is_none")]
636 pub include_labels: Option<bool>,
637 #[serde(skip_serializing_if = "Option::is_none")]
639 pub user: Option<String>,
640}
641
642impl UsersProfileGetRequest {
643 pub fn new() -> Self {
644 Self {
645 include_labels: None,
646 user: None,
647 }
648 }
649
650 pub fn include_labels(mut self, include_labels: bool) -> Self {
651 self.include_labels = Some(include_labels);
652 self
653 }
654
655 pub fn user(mut self, user: impl Into<String>) -> Self {
656 self.user = Some(user.into());
657 self
658 }
659}
660
661impl SlackApiMethod for UsersProfileGetRequest {
662 const METHOD: &'static str = "users.profile.get";
663 type Response = UsersProfileGetResponse;
664}
665
666#[doc(alias = "users.profile.get")]
668#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
669pub struct UsersProfileGetResponse {
670 #[serde(
671 default,
672 deserialize_with = "crate::de::opt_object",
673 skip_serializing_if = "Option::is_none"
674 )]
675 pub profile: Option<UserProfile>,
676 #[serde(
677 default,
678 deserialize_with = "crate::de::opt_object",
679 skip_serializing_if = "Option::is_none"
680 )]
681 pub response_metadata: Option<ResponseMetadata>,
682 #[serde(
683 default,
684 deserialize_with = "crate::de::opt_string",
685 skip_serializing_if = "Option::is_none"
686 )]
687 pub warning: Option<String>,
688}
689
690#[doc(alias = "users.profile.set")]
694#[derive(Debug, Clone, PartialEq, Serialize, Default)]
695#[non_exhaustive]
696pub struct UsersProfileSetRequest {
697 #[serde(skip_serializing_if = "Option::is_none")]
699 pub name: Option<String>,
700 #[serde(skip_serializing_if = "Option::is_none")]
702 pub profile: Option<String>,
703 #[serde(skip_serializing_if = "Option::is_none")]
705 pub user: Option<String>,
706 #[serde(skip_serializing_if = "Option::is_none")]
708 pub value: Option<String>,
709}
710
711impl UsersProfileSetRequest {
712 pub fn new() -> Self {
713 Self {
714 name: None,
715 profile: None,
716 user: None,
717 value: None,
718 }
719 }
720
721 pub fn name(mut self, name: impl Into<String>) -> Self {
722 self.name = Some(name.into());
723 self
724 }
725
726 pub fn profile(mut self, profile: impl Into<String>) -> Self {
727 self.profile = Some(profile.into());
728 self
729 }
730
731 pub fn user(mut self, user: impl Into<String>) -> Self {
732 self.user = Some(user.into());
733 self
734 }
735
736 pub fn value(mut self, value: impl Into<String>) -> Self {
737 self.value = Some(value.into());
738 self
739 }
740}
741
742impl SlackApiMethod for UsersProfileSetRequest {
743 const METHOD: &'static str = "users.profile.set";
744 type Response = UsersProfileSetResponse;
745}
746
747#[doc(alias = "users.profile.set")]
749#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
750pub struct UsersProfileSetResponse {
751 #[serde(
752 default,
753 deserialize_with = "crate::de::opt_object",
754 skip_serializing_if = "Option::is_none"
755 )]
756 pub profile: Option<UserProfile>,
757 #[serde(
758 default,
759 deserialize_with = "crate::de::opt_object",
760 skip_serializing_if = "Option::is_none"
761 )]
762 pub response_metadata: Option<ResponseMetadata>,
763 #[serde(
764 default,
765 deserialize_with = "crate::de::opt_string",
766 skip_serializing_if = "Option::is_none"
767 )]
768 pub warning: Option<String>,
769}
770
771#[doc(alias = "users.setActive")]
775#[derive(Debug, Clone, PartialEq, Serialize, Default)]
776#[non_exhaustive]
777pub struct UsersSetActiveRequest {}
778
779impl UsersSetActiveRequest {
780 pub fn new() -> Self {
781 Self {}
782 }
783}
784
785impl SlackApiMethod for UsersSetActiveRequest {
786 const METHOD: &'static str = "users.setActive";
787 type Response = UsersSetActiveResponse;
788}
789
790#[doc(alias = "users.setActive")]
792#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
793pub struct UsersSetActiveResponse {
794 #[serde(flatten)]
796 pub extra: serde_json::Map<String, serde_json::Value>,
797 #[serde(
798 default,
799 deserialize_with = "crate::de::opt_object",
800 skip_serializing_if = "Option::is_none"
801 )]
802 pub response_metadata: Option<ResponseMetadata>,
803 #[serde(
804 default,
805 deserialize_with = "crate::de::opt_string",
806 skip_serializing_if = "Option::is_none"
807 )]
808 pub warning: Option<String>,
809}
810
811#[doc(alias = "users.setPhoto")]
815#[derive(Debug, Clone, PartialEq, Serialize, Default)]
816#[non_exhaustive]
817pub struct UsersSetPhotoRequest {
818 #[serde(skip_serializing_if = "Option::is_none")]
820 pub crop_w: Option<String>,
821 #[serde(skip_serializing_if = "Option::is_none")]
823 pub crop_x: Option<String>,
824 #[serde(skip_serializing_if = "Option::is_none")]
826 pub crop_y: Option<String>,
827 #[serde(skip_serializing_if = "Option::is_none")]
829 pub image: Option<String>,
830}
831
832impl UsersSetPhotoRequest {
833 pub fn new() -> Self {
834 Self {
835 crop_w: None,
836 crop_x: None,
837 crop_y: None,
838 image: None,
839 }
840 }
841
842 pub fn crop_w(mut self, crop_w: impl Into<String>) -> Self {
843 self.crop_w = Some(crop_w.into());
844 self
845 }
846
847 pub fn crop_x(mut self, crop_x: impl Into<String>) -> Self {
848 self.crop_x = Some(crop_x.into());
849 self
850 }
851
852 pub fn crop_y(mut self, crop_y: impl Into<String>) -> Self {
853 self.crop_y = Some(crop_y.into());
854 self
855 }
856
857 pub fn image(mut self, image: impl Into<String>) -> Self {
858 self.image = Some(image.into());
859 self
860 }
861}
862
863impl SlackApiMethod for UsersSetPhotoRequest {
864 const METHOD: &'static str = "users.setPhoto";
865 type Response = UsersSetPhotoResponse;
866}
867
868#[doc(alias = "users.setPhoto")]
870#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
871pub struct UsersSetPhotoResponse {
872 #[serde(flatten)]
874 pub extra: serde_json::Map<String, serde_json::Value>,
875 #[serde(
876 default,
877 deserialize_with = "crate::de::opt_object",
878 skip_serializing_if = "Option::is_none"
879 )]
880 pub response_metadata: Option<ResponseMetadata>,
881 #[serde(
882 default,
883 deserialize_with = "crate::de::opt_string",
884 skip_serializing_if = "Option::is_none"
885 )]
886 pub warning: Option<String>,
887}
888
889#[doc(alias = "users.setPresence")]
893#[derive(Debug, Clone, PartialEq, Serialize)]
894#[non_exhaustive]
895pub struct UsersSetPresenceRequest {
896 pub presence: String,
898}
899
900impl UsersSetPresenceRequest {
901 pub fn new(presence: impl Into<String>) -> Self {
902 Self {
903 presence: presence.into(),
904 }
905 }
906}
907
908impl SlackApiMethod for UsersSetPresenceRequest {
909 const METHOD: &'static str = "users.setPresence";
910 type Response = UsersSetPresenceResponse;
911}
912
913#[doc(alias = "users.setPresence")]
915#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
916pub struct UsersSetPresenceResponse {
917 #[serde(flatten)]
919 pub extra: serde_json::Map<String, serde_json::Value>,
920 #[serde(
921 default,
922 deserialize_with = "crate::de::opt_object",
923 skip_serializing_if = "Option::is_none"
924 )]
925 pub response_metadata: Option<ResponseMetadata>,
926 #[serde(
927 default,
928 deserialize_with = "crate::de::opt_string",
929 skip_serializing_if = "Option::is_none"
930 )]
931 pub warning: Option<String>,
932}
933
934impl SlackClient {
935 #[doc(alias = "users.conversations")]
948 pub async fn users_conversations(
949 &self,
950 request: &UsersConversationsRequest,
951 ) -> Result<UsersConversationsResponse, SlackError> {
952 self.call(request).await
953 }
954
955 #[doc(alias = "users.deletePhoto")]
967 pub async fn users_delete_photo(
968 &self,
969 request: &UsersDeletePhotoRequest,
970 ) -> Result<UsersDeletePhotoResponse, SlackError> {
971 self.call(request).await
972 }
973
974 #[doc(alias = "users.discoverableContacts.lookup")]
986 pub async fn users_discoverable_contacts_lookup(
987 &self,
988 request: &UsersDiscoverableContactsLookupRequest,
989 ) -> Result<UsersDiscoverableContactsLookupResponse, SlackError> {
990 self.call(request).await
991 }
992
993 #[doc(alias = "users.getPresence")]
1006 pub async fn users_get_presence(
1007 &self,
1008 request: &UsersGetPresenceRequest,
1009 ) -> Result<UsersGetPresenceResponse, SlackError> {
1010 self.call(request).await
1011 }
1012
1013 #[doc(alias = "users.identity")]
1025 pub async fn users_identity(
1026 &self,
1027 request: &UsersIdentityRequest,
1028 ) -> Result<UsersIdentityResponse, SlackError> {
1029 self.call(request).await
1030 }
1031
1032 #[doc(alias = "users.info")]
1045 pub async fn users_info(
1046 &self,
1047 request: &UsersInfoRequest,
1048 ) -> Result<UsersInfoResponse, SlackError> {
1049 self.call(request).await
1050 }
1051
1052 #[doc(alias = "users.list")]
1065 pub async fn users_list(
1066 &self,
1067 request: &UsersListRequest,
1068 ) -> Result<UsersListResponse, SlackError> {
1069 self.call(request).await
1070 }
1071
1072 #[doc(alias = "users.lookupByEmail")]
1085 pub async fn users_lookup_by_email(
1086 &self,
1087 request: &UsersLookupByEmailRequest,
1088 ) -> Result<UsersLookupByEmailResponse, SlackError> {
1089 self.call(request).await
1090 }
1091
1092 #[doc(alias = "users.profile.get")]
1105 pub async fn users_profile_get(
1106 &self,
1107 request: &UsersProfileGetRequest,
1108 ) -> Result<UsersProfileGetResponse, SlackError> {
1109 self.call(request).await
1110 }
1111
1112 #[doc(alias = "users.profile.set")]
1124 pub async fn users_profile_set(
1125 &self,
1126 request: &UsersProfileSetRequest,
1127 ) -> Result<UsersProfileSetResponse, SlackError> {
1128 self.call(request).await
1129 }
1130
1131 #[doc(alias = "users.setActive")]
1144 pub async fn users_set_active(
1145 &self,
1146 request: &UsersSetActiveRequest,
1147 ) -> Result<UsersSetActiveResponse, SlackError> {
1148 self.call(request).await
1149 }
1150
1151 #[doc(alias = "users.setPhoto")]
1163 pub async fn users_set_photo(
1164 &self,
1165 request: &UsersSetPhotoRequest,
1166 ) -> Result<UsersSetPhotoResponse, SlackError> {
1167 self.call(request).await
1168 }
1169
1170 #[doc(alias = "users.setPresence")]
1183 pub async fn users_set_presence(
1184 &self,
1185 request: &UsersSetPresenceRequest,
1186 ) -> Result<UsersSetPresenceResponse, SlackError> {
1187 self.call(request).await
1188 }
1189}