1#[non_exhaustive]
4#[derive(std::clone::Clone, std::cmp::PartialEq)]
5pub struct IdentityHandle {
6 pub identity_id: std::option::Option<std::string::String>,
8 pub display_name: std::option::Option<std::string::String>,
10 pub account_number: std::option::Option<i32>,
12 pub avatar_url: std::option::Option<std::string::String>,
14 pub presence: std::option::Option<crate::model::IdentityPresence>,
16 pub is_registered: std::option::Option<bool>,
18 pub external: std::option::Option<crate::model::IdentityExternalLinks>,
20}
21impl IdentityHandle {
22 pub fn identity_id(&self) -> std::option::Option<&str> {
24 self.identity_id.as_deref()
25 }
26 pub fn display_name(&self) -> std::option::Option<&str> {
28 self.display_name.as_deref()
29 }
30 pub fn account_number(&self) -> std::option::Option<i32> {
32 self.account_number
33 }
34 pub fn avatar_url(&self) -> std::option::Option<&str> {
36 self.avatar_url.as_deref()
37 }
38 pub fn presence(&self) -> std::option::Option<&crate::model::IdentityPresence> {
40 self.presence.as_ref()
41 }
42 pub fn is_registered(&self) -> std::option::Option<bool> {
44 self.is_registered
45 }
46 pub fn external(&self) -> std::option::Option<&crate::model::IdentityExternalLinks> {
48 self.external.as_ref()
49 }
50}
51impl std::fmt::Debug for IdentityHandle {
52 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
53 let mut formatter = f.debug_struct("IdentityHandle");
54 formatter.field("identity_id", &self.identity_id);
55 formatter.field("display_name", &self.display_name);
56 formatter.field("account_number", &self.account_number);
57 formatter.field("avatar_url", &self.avatar_url);
58 formatter.field("presence", &self.presence);
59 formatter.field("is_registered", &self.is_registered);
60 formatter.field("external", &self.external);
61 formatter.finish()
62 }
63}
64pub mod identity_handle {
66 #[non_exhaustive]
68 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
69 pub struct Builder {
70 pub(crate) identity_id: std::option::Option<std::string::String>,
71 pub(crate) display_name: std::option::Option<std::string::String>,
72 pub(crate) account_number: std::option::Option<i32>,
73 pub(crate) avatar_url: std::option::Option<std::string::String>,
74 pub(crate) presence: std::option::Option<crate::model::IdentityPresence>,
75 pub(crate) is_registered: std::option::Option<bool>,
76 pub(crate) external: std::option::Option<crate::model::IdentityExternalLinks>,
77 }
78 impl Builder {
79 pub fn identity_id(mut self, input: impl Into<std::string::String>) -> Self {
81 self.identity_id = Some(input.into());
82 self
83 }
84 pub fn set_identity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
86 self.identity_id = input;
87 self
88 }
89 pub fn display_name(mut self, input: impl Into<std::string::String>) -> Self {
91 self.display_name = Some(input.into());
92 self
93 }
94 pub fn set_display_name(mut self, input: std::option::Option<std::string::String>) -> Self {
96 self.display_name = input;
97 self
98 }
99 pub fn account_number(mut self, input: i32) -> Self {
101 self.account_number = Some(input);
102 self
103 }
104 pub fn set_account_number(mut self, input: std::option::Option<i32>) -> Self {
106 self.account_number = input;
107 self
108 }
109 pub fn avatar_url(mut self, input: impl Into<std::string::String>) -> Self {
111 self.avatar_url = Some(input.into());
112 self
113 }
114 pub fn set_avatar_url(mut self, input: std::option::Option<std::string::String>) -> Self {
116 self.avatar_url = input;
117 self
118 }
119 pub fn presence(mut self, input: crate::model::IdentityPresence) -> Self {
121 self.presence = Some(input);
122 self
123 }
124 pub fn set_presence(
126 mut self,
127 input: std::option::Option<crate::model::IdentityPresence>,
128 ) -> Self {
129 self.presence = input;
130 self
131 }
132 pub fn is_registered(mut self, input: bool) -> Self {
134 self.is_registered = Some(input);
135 self
136 }
137 pub fn set_is_registered(mut self, input: std::option::Option<bool>) -> Self {
139 self.is_registered = input;
140 self
141 }
142 pub fn external(mut self, input: crate::model::IdentityExternalLinks) -> Self {
144 self.external = Some(input);
145 self
146 }
147 pub fn set_external(
149 mut self,
150 input: std::option::Option<crate::model::IdentityExternalLinks>,
151 ) -> Self {
152 self.external = input;
153 self
154 }
155 pub fn build(self) -> crate::model::IdentityHandle {
157 crate::model::IdentityHandle {
158 identity_id: self.identity_id,
159 display_name: self.display_name,
160 account_number: self.account_number,
161 avatar_url: self.avatar_url,
162 presence: self.presence,
163 is_registered: self.is_registered,
164 external: self.external,
165 }
166 }
167 }
168}
169impl IdentityHandle {
170 pub fn builder() -> crate::model::identity_handle::Builder {
172 crate::model::identity_handle::Builder::default()
173 }
174}
175
176#[non_exhaustive]
178#[derive(std::clone::Clone, std::cmp::PartialEq)]
179pub struct IdentityExternalLinks {
180 pub profile: std::option::Option<std::string::String>,
182 pub settings: std::option::Option<std::string::String>,
184 pub chat: std::option::Option<std::string::String>,
186}
187impl IdentityExternalLinks {
188 pub fn profile(&self) -> std::option::Option<&str> {
190 self.profile.as_deref()
191 }
192 pub fn settings(&self) -> std::option::Option<&str> {
194 self.settings.as_deref()
195 }
196 pub fn chat(&self) -> std::option::Option<&str> {
198 self.chat.as_deref()
199 }
200}
201impl std::fmt::Debug for IdentityExternalLinks {
202 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
203 let mut formatter = f.debug_struct("IdentityExternalLinks");
204 formatter.field("profile", &self.profile);
205 formatter.field("settings", &self.settings);
206 formatter.field("chat", &self.chat);
207 formatter.finish()
208 }
209}
210pub mod identity_external_links {
212 #[non_exhaustive]
214 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
215 pub struct Builder {
216 pub(crate) profile: std::option::Option<std::string::String>,
217 pub(crate) settings: std::option::Option<std::string::String>,
218 pub(crate) chat: std::option::Option<std::string::String>,
219 }
220 impl Builder {
221 pub fn profile(mut self, input: impl Into<std::string::String>) -> Self {
223 self.profile = Some(input.into());
224 self
225 }
226 pub fn set_profile(mut self, input: std::option::Option<std::string::String>) -> Self {
228 self.profile = input;
229 self
230 }
231 pub fn settings(mut self, input: impl Into<std::string::String>) -> Self {
233 self.settings = Some(input.into());
234 self
235 }
236 pub fn set_settings(mut self, input: std::option::Option<std::string::String>) -> Self {
238 self.settings = input;
239 self
240 }
241 pub fn chat(mut self, input: impl Into<std::string::String>) -> Self {
243 self.chat = Some(input.into());
244 self
245 }
246 pub fn set_chat(mut self, input: std::option::Option<std::string::String>) -> Self {
248 self.chat = input;
249 self
250 }
251 pub fn build(self) -> crate::model::IdentityExternalLinks {
253 crate::model::IdentityExternalLinks {
254 profile: self.profile,
255 settings: self.settings,
256 chat: self.chat,
257 }
258 }
259 }
260}
261impl IdentityExternalLinks {
262 pub fn builder() -> crate::model::identity_external_links::Builder {
264 crate::model::identity_external_links::Builder::default()
265 }
266}
267
268#[non_exhaustive]
270#[derive(std::clone::Clone, std::cmp::PartialEq)]
271pub struct IdentityPresence {
272 pub update_ts: std::option::Option<i64>,
274 pub status: std::option::Option<crate::model::IdentityStatus>,
276 pub party: std::option::Option<crate::model::PartyHandle>,
278 pub game_activity: std::option::Option<crate::model::IdentityGameActivity>,
280}
281impl IdentityPresence {
282 pub fn update_ts(&self) -> std::option::Option<i64> {
284 self.update_ts
285 }
286 pub fn status(&self) -> std::option::Option<&crate::model::IdentityStatus> {
288 self.status.as_ref()
289 }
290 pub fn party(&self) -> std::option::Option<&crate::model::PartyHandle> {
292 self.party.as_ref()
293 }
294 pub fn game_activity(&self) -> std::option::Option<&crate::model::IdentityGameActivity> {
296 self.game_activity.as_ref()
297 }
298}
299impl std::fmt::Debug for IdentityPresence {
300 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
301 let mut formatter = f.debug_struct("IdentityPresence");
302 formatter.field("update_ts", &self.update_ts);
303 formatter.field("status", &self.status);
304 formatter.field("party", &self.party);
305 formatter.field("game_activity", &self.game_activity);
306 formatter.finish()
307 }
308}
309pub mod identity_presence {
311 #[non_exhaustive]
313 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
314 pub struct Builder {
315 pub(crate) update_ts: std::option::Option<i64>,
316 pub(crate) status: std::option::Option<crate::model::IdentityStatus>,
317 pub(crate) party: std::option::Option<crate::model::PartyHandle>,
318 pub(crate) game_activity: std::option::Option<crate::model::IdentityGameActivity>,
319 }
320 impl Builder {
321 pub fn update_ts(mut self, input: i64) -> Self {
323 self.update_ts = Some(input);
324 self
325 }
326 pub fn set_update_ts(mut self, input: std::option::Option<i64>) -> Self {
328 self.update_ts = input;
329 self
330 }
331 pub fn status(mut self, input: crate::model::IdentityStatus) -> Self {
333 self.status = Some(input);
334 self
335 }
336 pub fn set_status(
338 mut self,
339 input: std::option::Option<crate::model::IdentityStatus>,
340 ) -> Self {
341 self.status = input;
342 self
343 }
344 pub fn party(mut self, input: crate::model::PartyHandle) -> Self {
346 self.party = Some(input);
347 self
348 }
349 pub fn set_party(mut self, input: std::option::Option<crate::model::PartyHandle>) -> Self {
351 self.party = input;
352 self
353 }
354 pub fn game_activity(mut self, input: crate::model::IdentityGameActivity) -> Self {
356 self.game_activity = Some(input);
357 self
358 }
359 pub fn set_game_activity(
361 mut self,
362 input: std::option::Option<crate::model::IdentityGameActivity>,
363 ) -> Self {
364 self.game_activity = input;
365 self
366 }
367 pub fn build(self) -> crate::model::IdentityPresence {
369 crate::model::IdentityPresence {
370 update_ts: self.update_ts,
371 status: self.status,
372 party: self.party,
373 game_activity: self.game_activity,
374 }
375 }
376 }
377}
378impl IdentityPresence {
379 pub fn builder() -> crate::model::identity_presence::Builder {
381 crate::model::identity_presence::Builder::default()
382 }
383}
384
385#[non_exhaustive]
387#[derive(std::clone::Clone, std::cmp::PartialEq)]
388pub struct IdentityGameActivity {
389 pub game: std::option::Option<crate::model::GameHandle>,
391 pub message: std::option::Option<std::string::String>,
393 pub public_metadata: std::option::Option<aws_smithy_types::Document>,
395 pub friend_metadata: std::option::Option<aws_smithy_types::Document>,
397}
398impl IdentityGameActivity {
399 pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> {
401 self.game.as_ref()
402 }
403 pub fn message(&self) -> std::option::Option<&str> {
405 self.message.as_deref()
406 }
407 pub fn public_metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
409 self.public_metadata.as_ref()
410 }
411 pub fn friend_metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
413 self.friend_metadata.as_ref()
414 }
415}
416impl std::fmt::Debug for IdentityGameActivity {
417 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
418 let mut formatter = f.debug_struct("IdentityGameActivity");
419 formatter.field("game", &self.game);
420 formatter.field("message", &self.message);
421 formatter.field("public_metadata", &self.public_metadata);
422 formatter.field("friend_metadata", &self.friend_metadata);
423 formatter.finish()
424 }
425}
426pub mod identity_game_activity {
428 #[non_exhaustive]
430 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
431 pub struct Builder {
432 pub(crate) game: std::option::Option<crate::model::GameHandle>,
433 pub(crate) message: std::option::Option<std::string::String>,
434 pub(crate) public_metadata: std::option::Option<aws_smithy_types::Document>,
435 pub(crate) friend_metadata: std::option::Option<aws_smithy_types::Document>,
436 }
437 impl Builder {
438 pub fn game(mut self, input: crate::model::GameHandle) -> Self {
440 self.game = Some(input);
441 self
442 }
443 pub fn set_game(mut self, input: std::option::Option<crate::model::GameHandle>) -> Self {
445 self.game = input;
446 self
447 }
448 pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
450 self.message = Some(input.into());
451 self
452 }
453 pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
455 self.message = input;
456 self
457 }
458 pub fn public_metadata(mut self, input: aws_smithy_types::Document) -> Self {
460 self.public_metadata = Some(input);
461 self
462 }
463 pub fn set_public_metadata(
465 mut self,
466 input: std::option::Option<aws_smithy_types::Document>,
467 ) -> Self {
468 self.public_metadata = input;
469 self
470 }
471 pub fn friend_metadata(mut self, input: aws_smithy_types::Document) -> Self {
473 self.friend_metadata = Some(input);
474 self
475 }
476 pub fn set_friend_metadata(
478 mut self,
479 input: std::option::Option<aws_smithy_types::Document>,
480 ) -> Self {
481 self.friend_metadata = input;
482 self
483 }
484 pub fn build(self) -> crate::model::IdentityGameActivity {
486 crate::model::IdentityGameActivity {
487 game: self.game,
488 message: self.message,
489 public_metadata: self.public_metadata,
490 friend_metadata: self.friend_metadata,
491 }
492 }
493 }
494}
495impl IdentityGameActivity {
496 pub fn builder() -> crate::model::identity_game_activity::Builder {
498 crate::model::identity_game_activity::Builder::default()
499 }
500}
501
502#[non_exhaustive]
504#[derive(std::clone::Clone, std::cmp::PartialEq)]
505pub struct GameHandle {
506 pub game_id: std::option::Option<std::string::String>,
508 pub name_id: std::option::Option<std::string::String>,
510 pub display_name: std::option::Option<std::string::String>,
512 pub logo_url: std::option::Option<std::string::String>,
514 pub banner_url: std::option::Option<std::string::String>,
516}
517impl GameHandle {
518 pub fn game_id(&self) -> std::option::Option<&str> {
520 self.game_id.as_deref()
521 }
522 pub fn name_id(&self) -> std::option::Option<&str> {
524 self.name_id.as_deref()
525 }
526 pub fn display_name(&self) -> std::option::Option<&str> {
528 self.display_name.as_deref()
529 }
530 pub fn logo_url(&self) -> std::option::Option<&str> {
532 self.logo_url.as_deref()
533 }
534 pub fn banner_url(&self) -> std::option::Option<&str> {
536 self.banner_url.as_deref()
537 }
538}
539impl std::fmt::Debug for GameHandle {
540 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
541 let mut formatter = f.debug_struct("GameHandle");
542 formatter.field("game_id", &self.game_id);
543 formatter.field("name_id", &self.name_id);
544 formatter.field("display_name", &self.display_name);
545 formatter.field("logo_url", &self.logo_url);
546 formatter.field("banner_url", &self.banner_url);
547 formatter.finish()
548 }
549}
550pub mod game_handle {
552 #[non_exhaustive]
554 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
555 pub struct Builder {
556 pub(crate) game_id: std::option::Option<std::string::String>,
557 pub(crate) name_id: std::option::Option<std::string::String>,
558 pub(crate) display_name: std::option::Option<std::string::String>,
559 pub(crate) logo_url: std::option::Option<std::string::String>,
560 pub(crate) banner_url: std::option::Option<std::string::String>,
561 }
562 impl Builder {
563 pub fn game_id(mut self, input: impl Into<std::string::String>) -> Self {
565 self.game_id = Some(input.into());
566 self
567 }
568 pub fn set_game_id(mut self, input: std::option::Option<std::string::String>) -> Self {
570 self.game_id = input;
571 self
572 }
573 pub fn name_id(mut self, input: impl Into<std::string::String>) -> Self {
575 self.name_id = Some(input.into());
576 self
577 }
578 pub fn set_name_id(mut self, input: std::option::Option<std::string::String>) -> Self {
580 self.name_id = input;
581 self
582 }
583 pub fn display_name(mut self, input: impl Into<std::string::String>) -> Self {
585 self.display_name = Some(input.into());
586 self
587 }
588 pub fn set_display_name(mut self, input: std::option::Option<std::string::String>) -> Self {
590 self.display_name = input;
591 self
592 }
593 pub fn logo_url(mut self, input: impl Into<std::string::String>) -> Self {
595 self.logo_url = Some(input.into());
596 self
597 }
598 pub fn set_logo_url(mut self, input: std::option::Option<std::string::String>) -> Self {
600 self.logo_url = input;
601 self
602 }
603 pub fn banner_url(mut self, input: impl Into<std::string::String>) -> Self {
605 self.banner_url = Some(input.into());
606 self
607 }
608 pub fn set_banner_url(mut self, input: std::option::Option<std::string::String>) -> Self {
610 self.banner_url = input;
611 self
612 }
613 pub fn build(self) -> crate::model::GameHandle {
615 crate::model::GameHandle {
616 game_id: self.game_id,
617 name_id: self.name_id,
618 display_name: self.display_name,
619 logo_url: self.logo_url,
620 banner_url: self.banner_url,
621 }
622 }
623 }
624}
625impl GameHandle {
626 pub fn builder() -> crate::model::game_handle::Builder {
628 crate::model::game_handle::Builder::default()
629 }
630}
631
632#[non_exhaustive]
634#[derive(std::clone::Clone, std::cmp::PartialEq)]
635pub struct PartyHandle {
636 pub party_id: std::option::Option<std::string::String>,
638 pub create_ts: std::option::Option<i64>,
640 pub activity: std::option::Option<crate::model::PartyActivity>,
642 pub external: std::option::Option<crate::model::PartyExternalLinks>,
644}
645impl PartyHandle {
646 pub fn party_id(&self) -> std::option::Option<&str> {
648 self.party_id.as_deref()
649 }
650 pub fn create_ts(&self) -> std::option::Option<i64> {
652 self.create_ts
653 }
654 pub fn activity(&self) -> std::option::Option<&crate::model::PartyActivity> {
656 self.activity.as_ref()
657 }
658 pub fn external(&self) -> std::option::Option<&crate::model::PartyExternalLinks> {
660 self.external.as_ref()
661 }
662}
663impl std::fmt::Debug for PartyHandle {
664 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
665 let mut formatter = f.debug_struct("PartyHandle");
666 formatter.field("party_id", &self.party_id);
667 formatter.field("create_ts", &self.create_ts);
668 formatter.field("activity", &self.activity);
669 formatter.field("external", &self.external);
670 formatter.finish()
671 }
672}
673pub mod party_handle {
675 #[non_exhaustive]
677 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
678 pub struct Builder {
679 pub(crate) party_id: std::option::Option<std::string::String>,
680 pub(crate) create_ts: std::option::Option<i64>,
681 pub(crate) activity: std::option::Option<crate::model::PartyActivity>,
682 pub(crate) external: std::option::Option<crate::model::PartyExternalLinks>,
683 }
684 impl Builder {
685 pub fn party_id(mut self, input: impl Into<std::string::String>) -> Self {
687 self.party_id = Some(input.into());
688 self
689 }
690 pub fn set_party_id(mut self, input: std::option::Option<std::string::String>) -> Self {
692 self.party_id = input;
693 self
694 }
695 pub fn create_ts(mut self, input: i64) -> Self {
697 self.create_ts = Some(input);
698 self
699 }
700 pub fn set_create_ts(mut self, input: std::option::Option<i64>) -> Self {
702 self.create_ts = input;
703 self
704 }
705 pub fn activity(mut self, input: crate::model::PartyActivity) -> Self {
707 self.activity = Some(input);
708 self
709 }
710 pub fn set_activity(
712 mut self,
713 input: std::option::Option<crate::model::PartyActivity>,
714 ) -> Self {
715 self.activity = input;
716 self
717 }
718 pub fn external(mut self, input: crate::model::PartyExternalLinks) -> Self {
720 self.external = Some(input);
721 self
722 }
723 pub fn set_external(
725 mut self,
726 input: std::option::Option<crate::model::PartyExternalLinks>,
727 ) -> Self {
728 self.external = input;
729 self
730 }
731 pub fn build(self) -> crate::model::PartyHandle {
733 crate::model::PartyHandle {
734 party_id: self.party_id,
735 create_ts: self.create_ts,
736 activity: self.activity,
737 external: self.external,
738 }
739 }
740 }
741}
742impl PartyHandle {
743 pub fn builder() -> crate::model::party_handle::Builder {
745 crate::model::party_handle::Builder::default()
746 }
747}
748
749#[non_exhaustive]
751#[derive(std::clone::Clone, std::cmp::PartialEq)]
752pub struct PartyExternalLinks {
753 pub chat: std::option::Option<std::string::String>,
755}
756impl PartyExternalLinks {
757 pub fn chat(&self) -> std::option::Option<&str> {
759 self.chat.as_deref()
760 }
761}
762impl std::fmt::Debug for PartyExternalLinks {
763 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
764 let mut formatter = f.debug_struct("PartyExternalLinks");
765 formatter.field("chat", &self.chat);
766 formatter.finish()
767 }
768}
769pub mod party_external_links {
771 #[non_exhaustive]
773 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
774 pub struct Builder {
775 pub(crate) chat: std::option::Option<std::string::String>,
776 }
777 impl Builder {
778 pub fn chat(mut self, input: impl Into<std::string::String>) -> Self {
780 self.chat = Some(input.into());
781 self
782 }
783 pub fn set_chat(mut self, input: std::option::Option<std::string::String>) -> Self {
785 self.chat = input;
786 self
787 }
788 pub fn build(self) -> crate::model::PartyExternalLinks {
790 crate::model::PartyExternalLinks { chat: self.chat }
791 }
792 }
793}
794impl PartyExternalLinks {
795 pub fn builder() -> crate::model::party_external_links::Builder {
797 crate::model::party_external_links::Builder::default()
798 }
799}
800
801#[non_exhaustive]
803#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
804pub enum PartyActivity {
805 Idle(crate::model::PartyActivityIdle),
807 MatchmakerFindingLobby(crate::model::PartyActivityMatchmakerFindingLobby),
809 MatchmakerLobby(crate::model::PartyActivityMatchmakerLobby),
811 #[non_exhaustive]
819 Unknown,
820}
821impl PartyActivity {
822 pub fn as_idle(&self) -> std::result::Result<&crate::model::PartyActivityIdle, &Self> {
825 if let PartyActivity::Idle(val) = &self {
826 Ok(val)
827 } else {
828 Err(self)
829 }
830 }
831 pub fn is_idle(&self) -> bool {
833 self.as_idle().is_ok()
834 }
835 pub fn as_matchmaker_finding_lobby(
838 &self,
839 ) -> std::result::Result<&crate::model::PartyActivityMatchmakerFindingLobby, &Self> {
840 if let PartyActivity::MatchmakerFindingLobby(val) = &self {
841 Ok(val)
842 } else {
843 Err(self)
844 }
845 }
846 pub fn is_matchmaker_finding_lobby(&self) -> bool {
848 self.as_matchmaker_finding_lobby().is_ok()
849 }
850 pub fn as_matchmaker_lobby(
853 &self,
854 ) -> std::result::Result<&crate::model::PartyActivityMatchmakerLobby, &Self> {
855 if let PartyActivity::MatchmakerLobby(val) = &self {
856 Ok(val)
857 } else {
858 Err(self)
859 }
860 }
861 pub fn is_matchmaker_lobby(&self) -> bool {
863 self.as_matchmaker_lobby().is_ok()
864 }
865 pub fn is_unknown(&self) -> bool {
867 matches!(self, Self::Unknown)
868 }
869}
870
871#[non_exhaustive]
873#[derive(std::clone::Clone, std::cmp::PartialEq)]
874pub struct PartyActivityMatchmakerLobby {
875 pub lobby: std::option::Option<crate::model::PartyMatchmakerLobby>,
877 pub game: std::option::Option<crate::model::GameHandle>,
879}
880impl PartyActivityMatchmakerLobby {
881 pub fn lobby(&self) -> std::option::Option<&crate::model::PartyMatchmakerLobby> {
883 self.lobby.as_ref()
884 }
885 pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> {
887 self.game.as_ref()
888 }
889}
890impl std::fmt::Debug for PartyActivityMatchmakerLobby {
891 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
892 let mut formatter = f.debug_struct("PartyActivityMatchmakerLobby");
893 formatter.field("lobby", &self.lobby);
894 formatter.field("game", &self.game);
895 formatter.finish()
896 }
897}
898pub mod party_activity_matchmaker_lobby {
900 #[non_exhaustive]
902 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
903 pub struct Builder {
904 pub(crate) lobby: std::option::Option<crate::model::PartyMatchmakerLobby>,
905 pub(crate) game: std::option::Option<crate::model::GameHandle>,
906 }
907 impl Builder {
908 pub fn lobby(mut self, input: crate::model::PartyMatchmakerLobby) -> Self {
910 self.lobby = Some(input);
911 self
912 }
913 pub fn set_lobby(
915 mut self,
916 input: std::option::Option<crate::model::PartyMatchmakerLobby>,
917 ) -> Self {
918 self.lobby = input;
919 self
920 }
921 pub fn game(mut self, input: crate::model::GameHandle) -> Self {
923 self.game = Some(input);
924 self
925 }
926 pub fn set_game(mut self, input: std::option::Option<crate::model::GameHandle>) -> Self {
928 self.game = input;
929 self
930 }
931 pub fn build(self) -> crate::model::PartyActivityMatchmakerLobby {
933 crate::model::PartyActivityMatchmakerLobby {
934 lobby: self.lobby,
935 game: self.game,
936 }
937 }
938 }
939}
940impl PartyActivityMatchmakerLobby {
941 pub fn builder() -> crate::model::party_activity_matchmaker_lobby::Builder {
943 crate::model::party_activity_matchmaker_lobby::Builder::default()
944 }
945}
946
947#[non_exhaustive]
949#[derive(std::clone::Clone, std::cmp::PartialEq)]
950pub struct PartyMatchmakerLobby {
951 pub lobby_id: std::option::Option<std::string::String>,
953}
954impl PartyMatchmakerLobby {
955 pub fn lobby_id(&self) -> std::option::Option<&str> {
957 self.lobby_id.as_deref()
958 }
959}
960impl std::fmt::Debug for PartyMatchmakerLobby {
961 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
962 let mut formatter = f.debug_struct("PartyMatchmakerLobby");
963 formatter.field("lobby_id", &self.lobby_id);
964 formatter.finish()
965 }
966}
967pub mod party_matchmaker_lobby {
969 #[non_exhaustive]
971 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
972 pub struct Builder {
973 pub(crate) lobby_id: std::option::Option<std::string::String>,
974 }
975 impl Builder {
976 pub fn lobby_id(mut self, input: impl Into<std::string::String>) -> Self {
978 self.lobby_id = Some(input.into());
979 self
980 }
981 pub fn set_lobby_id(mut self, input: std::option::Option<std::string::String>) -> Self {
983 self.lobby_id = input;
984 self
985 }
986 pub fn build(self) -> crate::model::PartyMatchmakerLobby {
988 crate::model::PartyMatchmakerLobby {
989 lobby_id: self.lobby_id,
990 }
991 }
992 }
993}
994impl PartyMatchmakerLobby {
995 pub fn builder() -> crate::model::party_matchmaker_lobby::Builder {
997 crate::model::party_matchmaker_lobby::Builder::default()
998 }
999}
1000
1001#[non_exhaustive]
1003#[derive(std::clone::Clone, std::cmp::PartialEq)]
1004pub struct PartyActivityMatchmakerFindingLobby {
1005 pub game: std::option::Option<crate::model::GameHandle>,
1007}
1008impl PartyActivityMatchmakerFindingLobby {
1009 pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> {
1011 self.game.as_ref()
1012 }
1013}
1014impl std::fmt::Debug for PartyActivityMatchmakerFindingLobby {
1015 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1016 let mut formatter = f.debug_struct("PartyActivityMatchmakerFindingLobby");
1017 formatter.field("game", &self.game);
1018 formatter.finish()
1019 }
1020}
1021pub mod party_activity_matchmaker_finding_lobby {
1023 #[non_exhaustive]
1025 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1026 pub struct Builder {
1027 pub(crate) game: std::option::Option<crate::model::GameHandle>,
1028 }
1029 impl Builder {
1030 pub fn game(mut self, input: crate::model::GameHandle) -> Self {
1032 self.game = Some(input);
1033 self
1034 }
1035 pub fn set_game(mut self, input: std::option::Option<crate::model::GameHandle>) -> Self {
1037 self.game = input;
1038 self
1039 }
1040 pub fn build(self) -> crate::model::PartyActivityMatchmakerFindingLobby {
1042 crate::model::PartyActivityMatchmakerFindingLobby { game: self.game }
1043 }
1044 }
1045}
1046impl PartyActivityMatchmakerFindingLobby {
1047 pub fn builder() -> crate::model::party_activity_matchmaker_finding_lobby::Builder {
1049 crate::model::party_activity_matchmaker_finding_lobby::Builder::default()
1050 }
1051}
1052
1053#[non_exhaustive]
1055#[derive(std::clone::Clone, std::cmp::PartialEq)]
1056pub struct PartyActivityIdle {}
1057impl std::fmt::Debug for PartyActivityIdle {
1058 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1059 let mut formatter = f.debug_struct("PartyActivityIdle");
1060 formatter.finish()
1061 }
1062}
1063pub mod party_activity_idle {
1065 #[non_exhaustive]
1067 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1068 pub struct Builder {}
1069 impl Builder {
1070 pub fn build(self) -> crate::model::PartyActivityIdle {
1072 crate::model::PartyActivityIdle {}
1073 }
1074 }
1075}
1076impl PartyActivityIdle {
1077 pub fn builder() -> crate::model::party_activity_idle::Builder {
1079 crate::model::party_activity_idle::Builder::default()
1080 }
1081}
1082
1083#[non_exhaustive]
1086#[derive(
1087 std::clone::Clone,
1088 std::cmp::Eq,
1089 std::cmp::Ord,
1090 std::cmp::PartialEq,
1091 std::cmp::PartialOrd,
1092 std::fmt::Debug,
1093 std::hash::Hash,
1094)]
1095pub enum IdentityStatus {
1096 #[allow(missing_docs)] Away,
1098 #[allow(missing_docs)] Offline,
1100 #[allow(missing_docs)] Online,
1102 Unknown(String),
1104}
1105impl std::convert::From<&str> for IdentityStatus {
1106 fn from(s: &str) -> Self {
1107 match s {
1108 "away" => IdentityStatus::Away,
1109 "offline" => IdentityStatus::Offline,
1110 "online" => IdentityStatus::Online,
1111 other => IdentityStatus::Unknown(other.to_owned()),
1112 }
1113 }
1114}
1115impl std::str::FromStr for IdentityStatus {
1116 type Err = std::convert::Infallible;
1117
1118 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1119 Ok(IdentityStatus::from(s))
1120 }
1121}
1122impl IdentityStatus {
1123 pub fn as_str(&self) -> &str {
1125 match self {
1126 IdentityStatus::Away => "away",
1127 IdentityStatus::Offline => "offline",
1128 IdentityStatus::Online => "online",
1129 IdentityStatus::Unknown(s) => s.as_ref(),
1130 }
1131 }
1132 pub fn values() -> &'static [&'static str] {
1134 &["away", "offline", "online"]
1135 }
1136}
1137impl AsRef<str> for IdentityStatus {
1138 fn as_ref(&self) -> &str {
1139 self.as_str()
1140 }
1141}
1142
1143#[non_exhaustive]
1145#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1146pub enum SendMessageBody {
1147 Text(crate::model::SendMessageBodyText),
1149 #[non_exhaustive]
1157 Unknown,
1158}
1159impl SendMessageBody {
1160 #[allow(irrefutable_let_patterns)]
1161 pub fn as_text(&self) -> std::result::Result<&crate::model::SendMessageBodyText, &Self> {
1164 if let SendMessageBody::Text(val) = &self {
1165 Ok(val)
1166 } else {
1167 Err(self)
1168 }
1169 }
1170 pub fn is_text(&self) -> bool {
1172 self.as_text().is_ok()
1173 }
1174 pub fn is_unknown(&self) -> bool {
1176 matches!(self, Self::Unknown)
1177 }
1178}
1179
1180#[non_exhaustive]
1182#[derive(std::clone::Clone, std::cmp::PartialEq)]
1183pub struct SendMessageBodyText {
1184 #[allow(missing_docs)] pub body: std::option::Option<std::string::String>,
1186}
1187impl SendMessageBodyText {
1188 #[allow(missing_docs)] pub fn body(&self) -> std::option::Option<&str> {
1190 self.body.as_deref()
1191 }
1192}
1193impl std::fmt::Debug for SendMessageBodyText {
1194 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1195 let mut formatter = f.debug_struct("SendMessageBodyText");
1196 formatter.field("body", &self.body);
1197 formatter.finish()
1198 }
1199}
1200pub mod send_message_body_text {
1202 #[non_exhaustive]
1204 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1205 pub struct Builder {
1206 pub(crate) body: std::option::Option<std::string::String>,
1207 }
1208 impl Builder {
1209 #[allow(missing_docs)] pub fn body(mut self, input: impl Into<std::string::String>) -> Self {
1211 self.body = Some(input.into());
1212 self
1213 }
1214 #[allow(missing_docs)] pub fn set_body(mut self, input: std::option::Option<std::string::String>) -> Self {
1216 self.body = input;
1217 self
1218 }
1219 pub fn build(self) -> crate::model::SendMessageBodyText {
1221 crate::model::SendMessageBodyText { body: self.body }
1222 }
1223 }
1224}
1225impl SendMessageBodyText {
1226 pub fn builder() -> crate::model::send_message_body_text::Builder {
1228 crate::model::send_message_body_text::Builder::default()
1229 }
1230}
1231
1232#[non_exhaustive]
1234#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1235pub enum SendChatTopic {
1236 Direct(crate::model::SendChatTopicDirect),
1238 Group(crate::model::SendChatTopicGroup),
1240 Party(crate::model::SendChatTopicParty),
1242 ThreadId(std::string::String),
1244 #[non_exhaustive]
1252 Unknown,
1253}
1254impl SendChatTopic {
1255 pub fn as_direct(&self) -> std::result::Result<&crate::model::SendChatTopicDirect, &Self> {
1258 if let SendChatTopic::Direct(val) = &self {
1259 Ok(val)
1260 } else {
1261 Err(self)
1262 }
1263 }
1264 pub fn is_direct(&self) -> bool {
1266 self.as_direct().is_ok()
1267 }
1268 pub fn as_group(&self) -> std::result::Result<&crate::model::SendChatTopicGroup, &Self> {
1271 if let SendChatTopic::Group(val) = &self {
1272 Ok(val)
1273 } else {
1274 Err(self)
1275 }
1276 }
1277 pub fn is_group(&self) -> bool {
1279 self.as_group().is_ok()
1280 }
1281 pub fn as_party(&self) -> std::result::Result<&crate::model::SendChatTopicParty, &Self> {
1284 if let SendChatTopic::Party(val) = &self {
1285 Ok(val)
1286 } else {
1287 Err(self)
1288 }
1289 }
1290 pub fn is_party(&self) -> bool {
1292 self.as_party().is_ok()
1293 }
1294 pub fn as_thread_id(&self) -> std::result::Result<&std::string::String, &Self> {
1297 if let SendChatTopic::ThreadId(val) = &self {
1298 Ok(val)
1299 } else {
1300 Err(self)
1301 }
1302 }
1303 pub fn is_thread_id(&self) -> bool {
1305 self.as_thread_id().is_ok()
1306 }
1307 pub fn is_unknown(&self) -> bool {
1309 matches!(self, Self::Unknown)
1310 }
1311}
1312
1313#[non_exhaustive]
1315#[derive(std::clone::Clone, std::cmp::PartialEq)]
1316pub struct SendChatTopicDirect {
1317 pub identity_id: std::option::Option<std::string::String>,
1319}
1320impl SendChatTopicDirect {
1321 pub fn identity_id(&self) -> std::option::Option<&str> {
1323 self.identity_id.as_deref()
1324 }
1325}
1326impl std::fmt::Debug for SendChatTopicDirect {
1327 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1328 let mut formatter = f.debug_struct("SendChatTopicDirect");
1329 formatter.field("identity_id", &self.identity_id);
1330 formatter.finish()
1331 }
1332}
1333pub mod send_chat_topic_direct {
1335 #[non_exhaustive]
1337 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1338 pub struct Builder {
1339 pub(crate) identity_id: std::option::Option<std::string::String>,
1340 }
1341 impl Builder {
1342 pub fn identity_id(mut self, input: impl Into<std::string::String>) -> Self {
1344 self.identity_id = Some(input.into());
1345 self
1346 }
1347 pub fn set_identity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
1349 self.identity_id = input;
1350 self
1351 }
1352 pub fn build(self) -> crate::model::SendChatTopicDirect {
1354 crate::model::SendChatTopicDirect {
1355 identity_id: self.identity_id,
1356 }
1357 }
1358 }
1359}
1360impl SendChatTopicDirect {
1361 pub fn builder() -> crate::model::send_chat_topic_direct::Builder {
1363 crate::model::send_chat_topic_direct::Builder::default()
1364 }
1365}
1366
1367#[non_exhaustive]
1369#[derive(std::clone::Clone, std::cmp::PartialEq)]
1370pub struct SendChatTopicParty {
1371 pub party_id: std::option::Option<std::string::String>,
1373}
1374impl SendChatTopicParty {
1375 pub fn party_id(&self) -> std::option::Option<&str> {
1377 self.party_id.as_deref()
1378 }
1379}
1380impl std::fmt::Debug for SendChatTopicParty {
1381 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1382 let mut formatter = f.debug_struct("SendChatTopicParty");
1383 formatter.field("party_id", &self.party_id);
1384 formatter.finish()
1385 }
1386}
1387pub mod send_chat_topic_party {
1389 #[non_exhaustive]
1391 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1392 pub struct Builder {
1393 pub(crate) party_id: std::option::Option<std::string::String>,
1394 }
1395 impl Builder {
1396 pub fn party_id(mut self, input: impl Into<std::string::String>) -> Self {
1398 self.party_id = Some(input.into());
1399 self
1400 }
1401 pub fn set_party_id(mut self, input: std::option::Option<std::string::String>) -> Self {
1403 self.party_id = input;
1404 self
1405 }
1406 pub fn build(self) -> crate::model::SendChatTopicParty {
1408 crate::model::SendChatTopicParty {
1409 party_id: self.party_id,
1410 }
1411 }
1412 }
1413}
1414impl SendChatTopicParty {
1415 pub fn builder() -> crate::model::send_chat_topic_party::Builder {
1417 crate::model::send_chat_topic_party::Builder::default()
1418 }
1419}
1420
1421#[non_exhaustive]
1423#[derive(std::clone::Clone, std::cmp::PartialEq)]
1424pub struct SendChatTopicGroup {
1425 pub group_id: std::option::Option<std::string::String>,
1427}
1428impl SendChatTopicGroup {
1429 pub fn group_id(&self) -> std::option::Option<&str> {
1431 self.group_id.as_deref()
1432 }
1433}
1434impl std::fmt::Debug for SendChatTopicGroup {
1435 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1436 let mut formatter = f.debug_struct("SendChatTopicGroup");
1437 formatter.field("group_id", &self.group_id);
1438 formatter.finish()
1439 }
1440}
1441pub mod send_chat_topic_group {
1443 #[non_exhaustive]
1445 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1446 pub struct Builder {
1447 pub(crate) group_id: std::option::Option<std::string::String>,
1448 }
1449 impl Builder {
1450 pub fn group_id(mut self, input: impl Into<std::string::String>) -> Self {
1452 self.group_id = Some(input.into());
1453 self
1454 }
1455 pub fn set_group_id(mut self, input: std::option::Option<std::string::String>) -> Self {
1457 self.group_id = input;
1458 self
1459 }
1460 pub fn build(self) -> crate::model::SendChatTopicGroup {
1462 crate::model::SendChatTopicGroup {
1463 group_id: self.group_id,
1464 }
1465 }
1466 }
1467}
1468impl SendChatTopicGroup {
1469 pub fn builder() -> crate::model::send_chat_topic_group::Builder {
1471 crate::model::send_chat_topic_group::Builder::default()
1472 }
1473}
1474
1475#[non_exhaustive]
1477#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1478pub enum ChatTypingStatus {
1479 Idle(crate::model::Unit),
1481 Typing(crate::model::Unit),
1483 #[non_exhaustive]
1491 Unknown,
1492}
1493impl ChatTypingStatus {
1494 pub fn as_idle(&self) -> std::result::Result<&crate::model::Unit, &Self> {
1497 if let ChatTypingStatus::Idle(val) = &self {
1498 Ok(val)
1499 } else {
1500 Err(self)
1501 }
1502 }
1503 pub fn is_idle(&self) -> bool {
1505 self.as_idle().is_ok()
1506 }
1507 pub fn as_typing(&self) -> std::result::Result<&crate::model::Unit, &Self> {
1510 if let ChatTypingStatus::Typing(val) = &self {
1511 Ok(val)
1512 } else {
1513 Err(self)
1514 }
1515 }
1516 pub fn is_typing(&self) -> bool {
1518 self.as_typing().is_ok()
1519 }
1520 pub fn is_unknown(&self) -> bool {
1522 matches!(self, Self::Unknown)
1523 }
1524}
1525
1526#[allow(missing_docs)] #[non_exhaustive]
1528#[derive(std::clone::Clone, std::cmp::PartialEq)]
1529pub struct Unit {}
1530impl std::fmt::Debug for Unit {
1531 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1532 let mut formatter = f.debug_struct("Unit");
1533 formatter.finish()
1534 }
1535}
1536pub mod unit {
1538 #[non_exhaustive]
1540 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1541 pub struct Builder {}
1542 impl Builder {
1543 pub fn build(self) -> crate::model::Unit {
1545 crate::model::Unit {}
1546 }
1547 }
1548}
1549impl Unit {
1550 pub fn builder() -> crate::model::unit::Builder {
1552 crate::model::unit::Builder::default()
1553 }
1554}
1555
1556#[non_exhaustive]
1558#[derive(std::clone::Clone, std::cmp::PartialEq)]
1559pub struct ChatMessage {
1560 pub chat_message_id: std::option::Option<std::string::String>,
1562 pub thread_id: std::option::Option<std::string::String>,
1564 pub send_ts: std::option::Option<i64>,
1566 pub body: std::option::Option<crate::model::ChatMessageBody>,
1568}
1569impl ChatMessage {
1570 pub fn chat_message_id(&self) -> std::option::Option<&str> {
1572 self.chat_message_id.as_deref()
1573 }
1574 pub fn thread_id(&self) -> std::option::Option<&str> {
1576 self.thread_id.as_deref()
1577 }
1578 pub fn send_ts(&self) -> std::option::Option<i64> {
1580 self.send_ts
1581 }
1582 pub fn body(&self) -> std::option::Option<&crate::model::ChatMessageBody> {
1584 self.body.as_ref()
1585 }
1586}
1587impl std::fmt::Debug for ChatMessage {
1588 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1589 let mut formatter = f.debug_struct("ChatMessage");
1590 formatter.field("chat_message_id", &self.chat_message_id);
1591 formatter.field("thread_id", &self.thread_id);
1592 formatter.field("send_ts", &self.send_ts);
1593 formatter.field("body", &self.body);
1594 formatter.finish()
1595 }
1596}
1597pub mod chat_message {
1599 #[non_exhaustive]
1601 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1602 pub struct Builder {
1603 pub(crate) chat_message_id: std::option::Option<std::string::String>,
1604 pub(crate) thread_id: std::option::Option<std::string::String>,
1605 pub(crate) send_ts: std::option::Option<i64>,
1606 pub(crate) body: std::option::Option<crate::model::ChatMessageBody>,
1607 }
1608 impl Builder {
1609 pub fn chat_message_id(mut self, input: impl Into<std::string::String>) -> Self {
1611 self.chat_message_id = Some(input.into());
1612 self
1613 }
1614 pub fn set_chat_message_id(
1616 mut self,
1617 input: std::option::Option<std::string::String>,
1618 ) -> Self {
1619 self.chat_message_id = input;
1620 self
1621 }
1622 pub fn thread_id(mut self, input: impl Into<std::string::String>) -> Self {
1624 self.thread_id = Some(input.into());
1625 self
1626 }
1627 pub fn set_thread_id(mut self, input: std::option::Option<std::string::String>) -> Self {
1629 self.thread_id = input;
1630 self
1631 }
1632 pub fn send_ts(mut self, input: i64) -> Self {
1634 self.send_ts = Some(input);
1635 self
1636 }
1637 pub fn set_send_ts(mut self, input: std::option::Option<i64>) -> Self {
1639 self.send_ts = input;
1640 self
1641 }
1642 pub fn body(mut self, input: crate::model::ChatMessageBody) -> Self {
1644 self.body = Some(input);
1645 self
1646 }
1647 pub fn set_body(
1649 mut self,
1650 input: std::option::Option<crate::model::ChatMessageBody>,
1651 ) -> Self {
1652 self.body = input;
1653 self
1654 }
1655 pub fn build(self) -> crate::model::ChatMessage {
1657 crate::model::ChatMessage {
1658 chat_message_id: self.chat_message_id,
1659 thread_id: self.thread_id,
1660 send_ts: self.send_ts,
1661 body: self.body,
1662 }
1663 }
1664 }
1665}
1666impl ChatMessage {
1667 pub fn builder() -> crate::model::chat_message::Builder {
1669 crate::model::chat_message::Builder::default()
1670 }
1671}
1672
1673#[non_exhaustive]
1675#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1676pub enum ChatMessageBody {
1677 ChatCreate(crate::model::ChatMessageBodyChatCreate),
1679 GroupJoin(crate::model::ChatMessageBodyGroupJoin),
1681 GroupLeave(crate::model::ChatMessageBodyGroupLeave),
1683 IdentityFollow(crate::model::ChatMessageBodyIdentityFollow),
1685 PartyActivityChange(crate::model::ChatMessageBodyPartyActivityChange),
1687 PartyInvite(crate::model::ChatMessageBodyPartyInvite),
1689 PartyJoin(crate::model::ChatMessageBodyPartyJoin),
1691 PartyLeave(crate::model::ChatMessageBodyPartyLeave),
1693 Text(crate::model::ChatMessageBodyText),
1695 #[non_exhaustive]
1703 Unknown,
1704}
1705impl ChatMessageBody {
1706 pub fn as_chat_create(
1709 &self,
1710 ) -> std::result::Result<&crate::model::ChatMessageBodyChatCreate, &Self> {
1711 if let ChatMessageBody::ChatCreate(val) = &self {
1712 Ok(val)
1713 } else {
1714 Err(self)
1715 }
1716 }
1717 pub fn is_chat_create(&self) -> bool {
1719 self.as_chat_create().is_ok()
1720 }
1721 pub fn as_group_join(
1724 &self,
1725 ) -> std::result::Result<&crate::model::ChatMessageBodyGroupJoin, &Self> {
1726 if let ChatMessageBody::GroupJoin(val) = &self {
1727 Ok(val)
1728 } else {
1729 Err(self)
1730 }
1731 }
1732 pub fn is_group_join(&self) -> bool {
1734 self.as_group_join().is_ok()
1735 }
1736 pub fn as_group_leave(
1739 &self,
1740 ) -> std::result::Result<&crate::model::ChatMessageBodyGroupLeave, &Self> {
1741 if let ChatMessageBody::GroupLeave(val) = &self {
1742 Ok(val)
1743 } else {
1744 Err(self)
1745 }
1746 }
1747 pub fn is_group_leave(&self) -> bool {
1749 self.as_group_leave().is_ok()
1750 }
1751 pub fn as_identity_follow(
1754 &self,
1755 ) -> std::result::Result<&crate::model::ChatMessageBodyIdentityFollow, &Self> {
1756 if let ChatMessageBody::IdentityFollow(val) = &self {
1757 Ok(val)
1758 } else {
1759 Err(self)
1760 }
1761 }
1762 pub fn is_identity_follow(&self) -> bool {
1764 self.as_identity_follow().is_ok()
1765 }
1766 pub fn as_party_activity_change(
1769 &self,
1770 ) -> std::result::Result<&crate::model::ChatMessageBodyPartyActivityChange, &Self> {
1771 if let ChatMessageBody::PartyActivityChange(val) = &self {
1772 Ok(val)
1773 } else {
1774 Err(self)
1775 }
1776 }
1777 pub fn is_party_activity_change(&self) -> bool {
1779 self.as_party_activity_change().is_ok()
1780 }
1781 pub fn as_party_invite(
1784 &self,
1785 ) -> std::result::Result<&crate::model::ChatMessageBodyPartyInvite, &Self> {
1786 if let ChatMessageBody::PartyInvite(val) = &self {
1787 Ok(val)
1788 } else {
1789 Err(self)
1790 }
1791 }
1792 pub fn is_party_invite(&self) -> bool {
1794 self.as_party_invite().is_ok()
1795 }
1796 pub fn as_party_join(
1799 &self,
1800 ) -> std::result::Result<&crate::model::ChatMessageBodyPartyJoin, &Self> {
1801 if let ChatMessageBody::PartyJoin(val) = &self {
1802 Ok(val)
1803 } else {
1804 Err(self)
1805 }
1806 }
1807 pub fn is_party_join(&self) -> bool {
1809 self.as_party_join().is_ok()
1810 }
1811 pub fn as_party_leave(
1814 &self,
1815 ) -> std::result::Result<&crate::model::ChatMessageBodyPartyLeave, &Self> {
1816 if let ChatMessageBody::PartyLeave(val) = &self {
1817 Ok(val)
1818 } else {
1819 Err(self)
1820 }
1821 }
1822 pub fn is_party_leave(&self) -> bool {
1824 self.as_party_leave().is_ok()
1825 }
1826 pub fn as_text(&self) -> std::result::Result<&crate::model::ChatMessageBodyText, &Self> {
1829 if let ChatMessageBody::Text(val) = &self {
1830 Ok(val)
1831 } else {
1832 Err(self)
1833 }
1834 }
1835 pub fn is_text(&self) -> bool {
1837 self.as_text().is_ok()
1838 }
1839 pub fn is_unknown(&self) -> bool {
1841 matches!(self, Self::Unknown)
1842 }
1843}
1844
1845#[non_exhaustive]
1847#[derive(std::clone::Clone, std::cmp::PartialEq)]
1848pub struct ChatMessageBodyPartyActivityChange {}
1849impl std::fmt::Debug for ChatMessageBodyPartyActivityChange {
1850 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1851 let mut formatter = f.debug_struct("ChatMessageBodyPartyActivityChange");
1852 formatter.finish()
1853 }
1854}
1855pub mod chat_message_body_party_activity_change {
1857 #[non_exhaustive]
1859 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1860 pub struct Builder {}
1861 impl Builder {
1862 pub fn build(self) -> crate::model::ChatMessageBodyPartyActivityChange {
1864 crate::model::ChatMessageBodyPartyActivityChange {}
1865 }
1866 }
1867}
1868impl ChatMessageBodyPartyActivityChange {
1869 pub fn builder() -> crate::model::chat_message_body_party_activity_change::Builder {
1871 crate::model::chat_message_body_party_activity_change::Builder::default()
1872 }
1873}
1874
1875#[non_exhaustive]
1877#[derive(std::clone::Clone, std::cmp::PartialEq)]
1878pub struct ChatMessageBodyPartyLeave {
1879 pub identity: std::option::Option<crate::model::IdentityHandle>,
1881}
1882impl ChatMessageBodyPartyLeave {
1883 pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
1885 self.identity.as_ref()
1886 }
1887}
1888impl std::fmt::Debug for ChatMessageBodyPartyLeave {
1889 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1890 let mut formatter = f.debug_struct("ChatMessageBodyPartyLeave");
1891 formatter.field("identity", &self.identity);
1892 formatter.finish()
1893 }
1894}
1895pub mod chat_message_body_party_leave {
1897 #[non_exhaustive]
1899 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1900 pub struct Builder {
1901 pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
1902 }
1903 impl Builder {
1904 pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
1906 self.identity = Some(input);
1907 self
1908 }
1909 pub fn set_identity(
1911 mut self,
1912 input: std::option::Option<crate::model::IdentityHandle>,
1913 ) -> Self {
1914 self.identity = input;
1915 self
1916 }
1917 pub fn build(self) -> crate::model::ChatMessageBodyPartyLeave {
1919 crate::model::ChatMessageBodyPartyLeave {
1920 identity: self.identity,
1921 }
1922 }
1923 }
1924}
1925impl ChatMessageBodyPartyLeave {
1926 pub fn builder() -> crate::model::chat_message_body_party_leave::Builder {
1928 crate::model::chat_message_body_party_leave::Builder::default()
1929 }
1930}
1931
1932#[non_exhaustive]
1934#[derive(std::clone::Clone, std::cmp::PartialEq)]
1935pub struct ChatMessageBodyPartyJoin {
1936 pub identity: std::option::Option<crate::model::IdentityHandle>,
1938}
1939impl ChatMessageBodyPartyJoin {
1940 pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
1942 self.identity.as_ref()
1943 }
1944}
1945impl std::fmt::Debug for ChatMessageBodyPartyJoin {
1946 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1947 let mut formatter = f.debug_struct("ChatMessageBodyPartyJoin");
1948 formatter.field("identity", &self.identity);
1949 formatter.finish()
1950 }
1951}
1952pub mod chat_message_body_party_join {
1954 #[non_exhaustive]
1956 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1957 pub struct Builder {
1958 pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
1959 }
1960 impl Builder {
1961 pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
1963 self.identity = Some(input);
1964 self
1965 }
1966 pub fn set_identity(
1968 mut self,
1969 input: std::option::Option<crate::model::IdentityHandle>,
1970 ) -> Self {
1971 self.identity = input;
1972 self
1973 }
1974 pub fn build(self) -> crate::model::ChatMessageBodyPartyJoin {
1976 crate::model::ChatMessageBodyPartyJoin {
1977 identity: self.identity,
1978 }
1979 }
1980 }
1981}
1982impl ChatMessageBodyPartyJoin {
1983 pub fn builder() -> crate::model::chat_message_body_party_join::Builder {
1985 crate::model::chat_message_body_party_join::Builder::default()
1986 }
1987}
1988
1989#[non_exhaustive]
1991#[derive(std::clone::Clone, std::cmp::PartialEq)]
1992pub struct ChatMessageBodyPartyInvite {
1993 pub sender: std::option::Option<crate::model::IdentityHandle>,
1995 pub party: std::option::Option<crate::model::PartyHandle>,
1997 pub invite_token: std::option::Option<std::string::String>,
1999}
2000impl ChatMessageBodyPartyInvite {
2001 pub fn sender(&self) -> std::option::Option<&crate::model::IdentityHandle> {
2003 self.sender.as_ref()
2004 }
2005 pub fn party(&self) -> std::option::Option<&crate::model::PartyHandle> {
2007 self.party.as_ref()
2008 }
2009 pub fn invite_token(&self) -> std::option::Option<&str> {
2011 self.invite_token.as_deref()
2012 }
2013}
2014impl std::fmt::Debug for ChatMessageBodyPartyInvite {
2015 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2016 let mut formatter = f.debug_struct("ChatMessageBodyPartyInvite");
2017 formatter.field("sender", &self.sender);
2018 formatter.field("party", &self.party);
2019 formatter.field("invite_token", &"*** Sensitive Data Redacted ***");
2020 formatter.finish()
2021 }
2022}
2023pub mod chat_message_body_party_invite {
2025 #[non_exhaustive]
2027 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2028 pub struct Builder {
2029 pub(crate) sender: std::option::Option<crate::model::IdentityHandle>,
2030 pub(crate) party: std::option::Option<crate::model::PartyHandle>,
2031 pub(crate) invite_token: std::option::Option<std::string::String>,
2032 }
2033 impl Builder {
2034 pub fn sender(mut self, input: crate::model::IdentityHandle) -> Self {
2036 self.sender = Some(input);
2037 self
2038 }
2039 pub fn set_sender(
2041 mut self,
2042 input: std::option::Option<crate::model::IdentityHandle>,
2043 ) -> Self {
2044 self.sender = input;
2045 self
2046 }
2047 pub fn party(mut self, input: crate::model::PartyHandle) -> Self {
2049 self.party = Some(input);
2050 self
2051 }
2052 pub fn set_party(mut self, input: std::option::Option<crate::model::PartyHandle>) -> Self {
2054 self.party = input;
2055 self
2056 }
2057 pub fn invite_token(mut self, input: impl Into<std::string::String>) -> Self {
2059 self.invite_token = Some(input.into());
2060 self
2061 }
2062 pub fn set_invite_token(mut self, input: std::option::Option<std::string::String>) -> Self {
2064 self.invite_token = input;
2065 self
2066 }
2067 pub fn build(self) -> crate::model::ChatMessageBodyPartyInvite {
2069 crate::model::ChatMessageBodyPartyInvite {
2070 sender: self.sender,
2071 party: self.party,
2072 invite_token: self.invite_token,
2073 }
2074 }
2075 }
2076}
2077impl ChatMessageBodyPartyInvite {
2078 pub fn builder() -> crate::model::chat_message_body_party_invite::Builder {
2080 crate::model::chat_message_body_party_invite::Builder::default()
2081 }
2082}
2083
2084#[non_exhaustive]
2086#[derive(std::clone::Clone, std::cmp::PartialEq)]
2087pub struct ChatMessageBodyGroupLeave {
2088 pub identity: std::option::Option<crate::model::IdentityHandle>,
2090}
2091impl ChatMessageBodyGroupLeave {
2092 pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
2094 self.identity.as_ref()
2095 }
2096}
2097impl std::fmt::Debug for ChatMessageBodyGroupLeave {
2098 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2099 let mut formatter = f.debug_struct("ChatMessageBodyGroupLeave");
2100 formatter.field("identity", &self.identity);
2101 formatter.finish()
2102 }
2103}
2104pub mod chat_message_body_group_leave {
2106 #[non_exhaustive]
2108 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2109 pub struct Builder {
2110 pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
2111 }
2112 impl Builder {
2113 pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
2115 self.identity = Some(input);
2116 self
2117 }
2118 pub fn set_identity(
2120 mut self,
2121 input: std::option::Option<crate::model::IdentityHandle>,
2122 ) -> Self {
2123 self.identity = input;
2124 self
2125 }
2126 pub fn build(self) -> crate::model::ChatMessageBodyGroupLeave {
2128 crate::model::ChatMessageBodyGroupLeave {
2129 identity: self.identity,
2130 }
2131 }
2132 }
2133}
2134impl ChatMessageBodyGroupLeave {
2135 pub fn builder() -> crate::model::chat_message_body_group_leave::Builder {
2137 crate::model::chat_message_body_group_leave::Builder::default()
2138 }
2139}
2140
2141#[non_exhaustive]
2143#[derive(std::clone::Clone, std::cmp::PartialEq)]
2144pub struct ChatMessageBodyGroupJoin {
2145 pub identity: std::option::Option<crate::model::IdentityHandle>,
2147}
2148impl ChatMessageBodyGroupJoin {
2149 pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
2151 self.identity.as_ref()
2152 }
2153}
2154impl std::fmt::Debug for ChatMessageBodyGroupJoin {
2155 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2156 let mut formatter = f.debug_struct("ChatMessageBodyGroupJoin");
2157 formatter.field("identity", &self.identity);
2158 formatter.finish()
2159 }
2160}
2161pub mod chat_message_body_group_join {
2163 #[non_exhaustive]
2165 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2166 pub struct Builder {
2167 pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
2168 }
2169 impl Builder {
2170 pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
2172 self.identity = Some(input);
2173 self
2174 }
2175 pub fn set_identity(
2177 mut self,
2178 input: std::option::Option<crate::model::IdentityHandle>,
2179 ) -> Self {
2180 self.identity = input;
2181 self
2182 }
2183 pub fn build(self) -> crate::model::ChatMessageBodyGroupJoin {
2185 crate::model::ChatMessageBodyGroupJoin {
2186 identity: self.identity,
2187 }
2188 }
2189 }
2190}
2191impl ChatMessageBodyGroupJoin {
2192 pub fn builder() -> crate::model::chat_message_body_group_join::Builder {
2194 crate::model::chat_message_body_group_join::Builder::default()
2195 }
2196}
2197
2198#[non_exhaustive]
2200#[derive(std::clone::Clone, std::cmp::PartialEq)]
2201pub struct ChatMessageBodyIdentityFollow {}
2202impl std::fmt::Debug for ChatMessageBodyIdentityFollow {
2203 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2204 let mut formatter = f.debug_struct("ChatMessageBodyIdentityFollow");
2205 formatter.finish()
2206 }
2207}
2208pub mod chat_message_body_identity_follow {
2210 #[non_exhaustive]
2212 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2213 pub struct Builder {}
2214 impl Builder {
2215 pub fn build(self) -> crate::model::ChatMessageBodyIdentityFollow {
2217 crate::model::ChatMessageBodyIdentityFollow {}
2218 }
2219 }
2220}
2221impl ChatMessageBodyIdentityFollow {
2222 pub fn builder() -> crate::model::chat_message_body_identity_follow::Builder {
2224 crate::model::chat_message_body_identity_follow::Builder::default()
2225 }
2226}
2227
2228#[non_exhaustive]
2230#[derive(std::clone::Clone, std::cmp::PartialEq)]
2231pub struct ChatMessageBodyChatCreate {}
2232impl std::fmt::Debug for ChatMessageBodyChatCreate {
2233 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2234 let mut formatter = f.debug_struct("ChatMessageBodyChatCreate");
2235 formatter.finish()
2236 }
2237}
2238pub mod chat_message_body_chat_create {
2240 #[non_exhaustive]
2242 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2243 pub struct Builder {}
2244 impl Builder {
2245 pub fn build(self) -> crate::model::ChatMessageBodyChatCreate {
2247 crate::model::ChatMessageBodyChatCreate {}
2248 }
2249 }
2250}
2251impl ChatMessageBodyChatCreate {
2252 pub fn builder() -> crate::model::chat_message_body_chat_create::Builder {
2254 crate::model::chat_message_body_chat_create::Builder::default()
2255 }
2256}
2257
2258#[non_exhaustive]
2260#[derive(std::clone::Clone, std::cmp::PartialEq)]
2261pub struct ChatMessageBodyText {
2262 pub sender: std::option::Option<crate::model::IdentityHandle>,
2264 pub body: std::option::Option<std::string::String>,
2266}
2267impl ChatMessageBodyText {
2268 pub fn sender(&self) -> std::option::Option<&crate::model::IdentityHandle> {
2270 self.sender.as_ref()
2271 }
2272 pub fn body(&self) -> std::option::Option<&str> {
2274 self.body.as_deref()
2275 }
2276}
2277impl std::fmt::Debug for ChatMessageBodyText {
2278 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2279 let mut formatter = f.debug_struct("ChatMessageBodyText");
2280 formatter.field("sender", &self.sender);
2281 formatter.field("body", &self.body);
2282 formatter.finish()
2283 }
2284}
2285pub mod chat_message_body_text {
2287 #[non_exhaustive]
2289 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2290 pub struct Builder {
2291 pub(crate) sender: std::option::Option<crate::model::IdentityHandle>,
2292 pub(crate) body: std::option::Option<std::string::String>,
2293 }
2294 impl Builder {
2295 pub fn sender(mut self, input: crate::model::IdentityHandle) -> Self {
2297 self.sender = Some(input);
2298 self
2299 }
2300 pub fn set_sender(
2302 mut self,
2303 input: std::option::Option<crate::model::IdentityHandle>,
2304 ) -> Self {
2305 self.sender = input;
2306 self
2307 }
2308 pub fn body(mut self, input: impl Into<std::string::String>) -> Self {
2310 self.body = Some(input.into());
2311 self
2312 }
2313 pub fn set_body(mut self, input: std::option::Option<std::string::String>) -> Self {
2315 self.body = input;
2316 self
2317 }
2318 pub fn build(self) -> crate::model::ChatMessageBodyText {
2320 crate::model::ChatMessageBodyText {
2321 sender: self.sender,
2322 body: self.body,
2323 }
2324 }
2325 }
2326}
2327impl ChatMessageBodyText {
2328 pub fn builder() -> crate::model::chat_message_body_text::Builder {
2330 crate::model::chat_message_body_text::Builder::default()
2331 }
2332}
2333
2334#[non_exhaustive]
2337#[derive(
2338 std::clone::Clone,
2339 std::cmp::Eq,
2340 std::cmp::Ord,
2341 std::cmp::PartialEq,
2342 std::cmp::PartialOrd,
2343 std::fmt::Debug,
2344 std::hash::Hash,
2345)]
2346pub enum QueryDirection {
2347 After,
2349 Before,
2351 BeforeAndAfter,
2353 Unknown(String),
2355}
2356impl std::convert::From<&str> for QueryDirection {
2357 fn from(s: &str) -> Self {
2358 match s {
2359 "after" => QueryDirection::After,
2360 "before" => QueryDirection::Before,
2361 "before_and_after" => QueryDirection::BeforeAndAfter,
2362 other => QueryDirection::Unknown(other.to_owned()),
2363 }
2364 }
2365}
2366impl std::str::FromStr for QueryDirection {
2367 type Err = std::convert::Infallible;
2368
2369 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
2370 Ok(QueryDirection::from(s))
2371 }
2372}
2373impl QueryDirection {
2374 pub fn as_str(&self) -> &str {
2376 match self {
2377 QueryDirection::After => "after",
2378 QueryDirection::Before => "before",
2379 QueryDirection::BeforeAndAfter => "before_and_after",
2380 QueryDirection::Unknown(s) => s.as_ref(),
2381 }
2382 }
2383 pub fn values() -> &'static [&'static str] {
2385 &["after", "before", "before_and_after"]
2386 }
2387}
2388impl AsRef<str> for QueryDirection {
2389 fn as_ref(&self) -> &str {
2390 self.as_str()
2391 }
2392}
2393
2394#[non_exhaustive]
2396#[derive(std::clone::Clone, std::cmp::PartialEq)]
2397pub struct WatchResponse {
2398 pub index: std::option::Option<std::string::String>,
2400}
2401impl WatchResponse {
2402 pub fn index(&self) -> std::option::Option<&str> {
2404 self.index.as_deref()
2405 }
2406}
2407impl std::fmt::Debug for WatchResponse {
2408 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2409 let mut formatter = f.debug_struct("WatchResponse");
2410 formatter.field("index", &self.index);
2411 formatter.finish()
2412 }
2413}
2414pub mod watch_response {
2416 #[non_exhaustive]
2418 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2419 pub struct Builder {
2420 pub(crate) index: std::option::Option<std::string::String>,
2421 }
2422 impl Builder {
2423 pub fn index(mut self, input: impl Into<std::string::String>) -> Self {
2425 self.index = Some(input.into());
2426 self
2427 }
2428 pub fn set_index(mut self, input: std::option::Option<std::string::String>) -> Self {
2430 self.index = input;
2431 self
2432 }
2433 pub fn build(self) -> crate::model::WatchResponse {
2435 crate::model::WatchResponse { index: self.index }
2436 }
2437 }
2438}
2439impl WatchResponse {
2440 pub fn builder() -> crate::model::watch_response::Builder {
2442 crate::model::watch_response::Builder::default()
2443 }
2444}
2445
2446#[non_exhaustive]
2448#[derive(std::clone::Clone, std::cmp::PartialEq)]
2449pub struct ChatIdentityTypingStatus {
2450 pub identity: std::option::Option<crate::model::IdentityHandle>,
2452 pub status: std::option::Option<crate::model::ChatTypingStatus>,
2454}
2455impl ChatIdentityTypingStatus {
2456 pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
2458 self.identity.as_ref()
2459 }
2460 pub fn status(&self) -> std::option::Option<&crate::model::ChatTypingStatus> {
2462 self.status.as_ref()
2463 }
2464}
2465impl std::fmt::Debug for ChatIdentityTypingStatus {
2466 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2467 let mut formatter = f.debug_struct("ChatIdentityTypingStatus");
2468 formatter.field("identity", &self.identity);
2469 formatter.field("status", &self.status);
2470 formatter.finish()
2471 }
2472}
2473pub mod chat_identity_typing_status {
2475 #[non_exhaustive]
2477 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2478 pub struct Builder {
2479 pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
2480 pub(crate) status: std::option::Option<crate::model::ChatTypingStatus>,
2481 }
2482 impl Builder {
2483 pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
2485 self.identity = Some(input);
2486 self
2487 }
2488 pub fn set_identity(
2490 mut self,
2491 input: std::option::Option<crate::model::IdentityHandle>,
2492 ) -> Self {
2493 self.identity = input;
2494 self
2495 }
2496 pub fn status(mut self, input: crate::model::ChatTypingStatus) -> Self {
2498 self.status = Some(input);
2499 self
2500 }
2501 pub fn set_status(
2503 mut self,
2504 input: std::option::Option<crate::model::ChatTypingStatus>,
2505 ) -> Self {
2506 self.status = input;
2507 self
2508 }
2509 pub fn build(self) -> crate::model::ChatIdentityTypingStatus {
2511 crate::model::ChatIdentityTypingStatus {
2512 identity: self.identity,
2513 status: self.status,
2514 }
2515 }
2516 }
2517}
2518impl ChatIdentityTypingStatus {
2519 pub fn builder() -> crate::model::chat_identity_typing_status::Builder {
2521 crate::model::chat_identity_typing_status::Builder::default()
2522 }
2523}
2524
2525#[non_exhaustive]
2527#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2528pub enum ChatSimpleTopic {
2529 Direct(crate::model::ChatSimpleTopicDirect),
2531 Group(crate::model::ChatSimpleTopicGroup),
2533 Party(crate::model::ChatSimpleTopicParty),
2535 #[non_exhaustive]
2543 Unknown,
2544}
2545impl ChatSimpleTopic {
2546 pub fn as_direct(&self) -> std::result::Result<&crate::model::ChatSimpleTopicDirect, &Self> {
2549 if let ChatSimpleTopic::Direct(val) = &self {
2550 Ok(val)
2551 } else {
2552 Err(self)
2553 }
2554 }
2555 pub fn is_direct(&self) -> bool {
2557 self.as_direct().is_ok()
2558 }
2559 pub fn as_group(&self) -> std::result::Result<&crate::model::ChatSimpleTopicGroup, &Self> {
2562 if let ChatSimpleTopic::Group(val) = &self {
2563 Ok(val)
2564 } else {
2565 Err(self)
2566 }
2567 }
2568 pub fn is_group(&self) -> bool {
2570 self.as_group().is_ok()
2571 }
2572 pub fn as_party(&self) -> std::result::Result<&crate::model::ChatSimpleTopicParty, &Self> {
2575 if let ChatSimpleTopic::Party(val) = &self {
2576 Ok(val)
2577 } else {
2578 Err(self)
2579 }
2580 }
2581 pub fn is_party(&self) -> bool {
2583 self.as_party().is_ok()
2584 }
2585 pub fn is_unknown(&self) -> bool {
2587 matches!(self, Self::Unknown)
2588 }
2589}
2590
2591#[non_exhaustive]
2593#[derive(std::clone::Clone, std::cmp::PartialEq)]
2594pub struct ChatSimpleTopicDirect {
2595 pub identity_a_id: std::option::Option<std::string::String>,
2597 pub identity_b_id: std::option::Option<std::string::String>,
2599}
2600impl ChatSimpleTopicDirect {
2601 pub fn identity_a_id(&self) -> std::option::Option<&str> {
2603 self.identity_a_id.as_deref()
2604 }
2605 pub fn identity_b_id(&self) -> std::option::Option<&str> {
2607 self.identity_b_id.as_deref()
2608 }
2609}
2610impl std::fmt::Debug for ChatSimpleTopicDirect {
2611 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2612 let mut formatter = f.debug_struct("ChatSimpleTopicDirect");
2613 formatter.field("identity_a_id", &self.identity_a_id);
2614 formatter.field("identity_b_id", &self.identity_b_id);
2615 formatter.finish()
2616 }
2617}
2618pub mod chat_simple_topic_direct {
2620 #[non_exhaustive]
2622 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2623 pub struct Builder {
2624 pub(crate) identity_a_id: std::option::Option<std::string::String>,
2625 pub(crate) identity_b_id: std::option::Option<std::string::String>,
2626 }
2627 impl Builder {
2628 pub fn identity_a_id(mut self, input: impl Into<std::string::String>) -> Self {
2630 self.identity_a_id = Some(input.into());
2631 self
2632 }
2633 pub fn set_identity_a_id(
2635 mut self,
2636 input: std::option::Option<std::string::String>,
2637 ) -> Self {
2638 self.identity_a_id = input;
2639 self
2640 }
2641 pub fn identity_b_id(mut self, input: impl Into<std::string::String>) -> Self {
2643 self.identity_b_id = Some(input.into());
2644 self
2645 }
2646 pub fn set_identity_b_id(
2648 mut self,
2649 input: std::option::Option<std::string::String>,
2650 ) -> Self {
2651 self.identity_b_id = input;
2652 self
2653 }
2654 pub fn build(self) -> crate::model::ChatSimpleTopicDirect {
2656 crate::model::ChatSimpleTopicDirect {
2657 identity_a_id: self.identity_a_id,
2658 identity_b_id: self.identity_b_id,
2659 }
2660 }
2661 }
2662}
2663impl ChatSimpleTopicDirect {
2664 pub fn builder() -> crate::model::chat_simple_topic_direct::Builder {
2666 crate::model::chat_simple_topic_direct::Builder::default()
2667 }
2668}
2669
2670#[non_exhaustive]
2672#[derive(std::clone::Clone, std::cmp::PartialEq)]
2673pub struct ChatSimpleTopicParty {
2674 pub party_id: std::option::Option<std::string::String>,
2676}
2677impl ChatSimpleTopicParty {
2678 pub fn party_id(&self) -> std::option::Option<&str> {
2680 self.party_id.as_deref()
2681 }
2682}
2683impl std::fmt::Debug for ChatSimpleTopicParty {
2684 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2685 let mut formatter = f.debug_struct("ChatSimpleTopicParty");
2686 formatter.field("party_id", &self.party_id);
2687 formatter.finish()
2688 }
2689}
2690pub mod chat_simple_topic_party {
2692 #[non_exhaustive]
2694 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2695 pub struct Builder {
2696 pub(crate) party_id: std::option::Option<std::string::String>,
2697 }
2698 impl Builder {
2699 pub fn party_id(mut self, input: impl Into<std::string::String>) -> Self {
2701 self.party_id = Some(input.into());
2702 self
2703 }
2704 pub fn set_party_id(mut self, input: std::option::Option<std::string::String>) -> Self {
2706 self.party_id = input;
2707 self
2708 }
2709 pub fn build(self) -> crate::model::ChatSimpleTopicParty {
2711 crate::model::ChatSimpleTopicParty {
2712 party_id: self.party_id,
2713 }
2714 }
2715 }
2716}
2717impl ChatSimpleTopicParty {
2718 pub fn builder() -> crate::model::chat_simple_topic_party::Builder {
2720 crate::model::chat_simple_topic_party::Builder::default()
2721 }
2722}
2723
2724#[non_exhaustive]
2726#[derive(std::clone::Clone, std::cmp::PartialEq)]
2727pub struct ChatSimpleTopicGroup {
2728 pub group_id: std::option::Option<std::string::String>,
2730}
2731impl ChatSimpleTopicGroup {
2732 pub fn group_id(&self) -> std::option::Option<&str> {
2734 self.group_id.as_deref()
2735 }
2736}
2737impl std::fmt::Debug for ChatSimpleTopicGroup {
2738 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2739 let mut formatter = f.debug_struct("ChatSimpleTopicGroup");
2740 formatter.field("group_id", &self.group_id);
2741 formatter.finish()
2742 }
2743}
2744pub mod chat_simple_topic_group {
2746 #[non_exhaustive]
2748 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2749 pub struct Builder {
2750 pub(crate) group_id: std::option::Option<std::string::String>,
2751 }
2752 impl Builder {
2753 pub fn group_id(mut self, input: impl Into<std::string::String>) -> Self {
2755 self.group_id = Some(input.into());
2756 self
2757 }
2758 pub fn set_group_id(mut self, input: std::option::Option<std::string::String>) -> Self {
2760 self.group_id = input;
2761 self
2762 }
2763 pub fn build(self) -> crate::model::ChatSimpleTopicGroup {
2765 crate::model::ChatSimpleTopicGroup {
2766 group_id: self.group_id,
2767 }
2768 }
2769 }
2770}
2771impl ChatSimpleTopicGroup {
2772 pub fn builder() -> crate::model::chat_simple_topic_group::Builder {
2774 crate::model::chat_simple_topic_group::Builder::default()
2775 }
2776}