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 party: std::option::Option<crate::model::PartyHandle>,
18 pub is_registered: std::option::Option<bool>,
20 pub external: std::option::Option<crate::model::IdentityExternalLinks>,
22}
23impl IdentityHandle {
24 pub fn identity_id(&self) -> std::option::Option<&str> {
26 self.identity_id.as_deref()
27 }
28 pub fn display_name(&self) -> std::option::Option<&str> {
30 self.display_name.as_deref()
31 }
32 pub fn account_number(&self) -> std::option::Option<i32> {
34 self.account_number
35 }
36 pub fn avatar_url(&self) -> std::option::Option<&str> {
38 self.avatar_url.as_deref()
39 }
40 pub fn presence(&self) -> std::option::Option<&crate::model::IdentityPresence> {
42 self.presence.as_ref()
43 }
44 pub fn party(&self) -> std::option::Option<&crate::model::PartyHandle> {
46 self.party.as_ref()
47 }
48 pub fn is_registered(&self) -> std::option::Option<bool> {
50 self.is_registered
51 }
52 pub fn external(&self) -> std::option::Option<&crate::model::IdentityExternalLinks> {
54 self.external.as_ref()
55 }
56}
57impl std::fmt::Debug for IdentityHandle {
58 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
59 let mut formatter = f.debug_struct("IdentityHandle");
60 formatter.field("identity_id", &self.identity_id);
61 formatter.field("display_name", &self.display_name);
62 formatter.field("account_number", &self.account_number);
63 formatter.field("avatar_url", &self.avatar_url);
64 formatter.field("presence", &self.presence);
65 formatter.field("party", &self.party);
66 formatter.field("is_registered", &self.is_registered);
67 formatter.field("external", &self.external);
68 formatter.finish()
69 }
70}
71pub mod identity_handle {
73 #[non_exhaustive]
75 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
76 pub struct Builder {
77 pub(crate) identity_id: std::option::Option<std::string::String>,
78 pub(crate) display_name: std::option::Option<std::string::String>,
79 pub(crate) account_number: std::option::Option<i32>,
80 pub(crate) avatar_url: std::option::Option<std::string::String>,
81 pub(crate) presence: std::option::Option<crate::model::IdentityPresence>,
82 pub(crate) party: std::option::Option<crate::model::PartyHandle>,
83 pub(crate) is_registered: std::option::Option<bool>,
84 pub(crate) external: std::option::Option<crate::model::IdentityExternalLinks>,
85 }
86 impl Builder {
87 pub fn identity_id(mut self, input: impl Into<std::string::String>) -> Self {
89 self.identity_id = Some(input.into());
90 self
91 }
92 pub fn set_identity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
94 self.identity_id = input;
95 self
96 }
97 pub fn display_name(mut self, input: impl Into<std::string::String>) -> Self {
99 self.display_name = Some(input.into());
100 self
101 }
102 pub fn set_display_name(mut self, input: std::option::Option<std::string::String>) -> Self {
104 self.display_name = input;
105 self
106 }
107 pub fn account_number(mut self, input: i32) -> Self {
109 self.account_number = Some(input);
110 self
111 }
112 pub fn set_account_number(mut self, input: std::option::Option<i32>) -> Self {
114 self.account_number = input;
115 self
116 }
117 pub fn avatar_url(mut self, input: impl Into<std::string::String>) -> Self {
119 self.avatar_url = Some(input.into());
120 self
121 }
122 pub fn set_avatar_url(mut self, input: std::option::Option<std::string::String>) -> Self {
124 self.avatar_url = input;
125 self
126 }
127 pub fn presence(mut self, input: crate::model::IdentityPresence) -> Self {
129 self.presence = Some(input);
130 self
131 }
132 pub fn set_presence(
134 mut self,
135 input: std::option::Option<crate::model::IdentityPresence>,
136 ) -> Self {
137 self.presence = input;
138 self
139 }
140 pub fn party(mut self, input: crate::model::PartyHandle) -> Self {
142 self.party = Some(input);
143 self
144 }
145 pub fn set_party(mut self, input: std::option::Option<crate::model::PartyHandle>) -> Self {
147 self.party = input;
148 self
149 }
150 pub fn is_registered(mut self, input: bool) -> Self {
152 self.is_registered = Some(input);
153 self
154 }
155 pub fn set_is_registered(mut self, input: std::option::Option<bool>) -> Self {
157 self.is_registered = input;
158 self
159 }
160 pub fn external(mut self, input: crate::model::IdentityExternalLinks) -> Self {
162 self.external = Some(input);
163 self
164 }
165 pub fn set_external(
167 mut self,
168 input: std::option::Option<crate::model::IdentityExternalLinks>,
169 ) -> Self {
170 self.external = input;
171 self
172 }
173 pub fn build(self) -> crate::model::IdentityHandle {
175 crate::model::IdentityHandle {
176 identity_id: self.identity_id,
177 display_name: self.display_name,
178 account_number: self.account_number,
179 avatar_url: self.avatar_url,
180 presence: self.presence,
181 party: self.party,
182 is_registered: self.is_registered,
183 external: self.external,
184 }
185 }
186 }
187}
188impl IdentityHandle {
189 pub fn builder() -> crate::model::identity_handle::Builder {
191 crate::model::identity_handle::Builder::default()
192 }
193}
194
195#[non_exhaustive]
197#[derive(std::clone::Clone, std::cmp::PartialEq)]
198pub struct IdentityExternalLinks {
199 pub profile: std::option::Option<std::string::String>,
201 pub settings: std::option::Option<std::string::String>,
203 pub chat: std::option::Option<std::string::String>,
205}
206impl IdentityExternalLinks {
207 pub fn profile(&self) -> std::option::Option<&str> {
209 self.profile.as_deref()
210 }
211 pub fn settings(&self) -> std::option::Option<&str> {
213 self.settings.as_deref()
214 }
215 pub fn chat(&self) -> std::option::Option<&str> {
217 self.chat.as_deref()
218 }
219}
220impl std::fmt::Debug for IdentityExternalLinks {
221 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
222 let mut formatter = f.debug_struct("IdentityExternalLinks");
223 formatter.field("profile", &self.profile);
224 formatter.field("settings", &self.settings);
225 formatter.field("chat", &self.chat);
226 formatter.finish()
227 }
228}
229pub mod identity_external_links {
231 #[non_exhaustive]
233 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
234 pub struct Builder {
235 pub(crate) profile: std::option::Option<std::string::String>,
236 pub(crate) settings: std::option::Option<std::string::String>,
237 pub(crate) chat: std::option::Option<std::string::String>,
238 }
239 impl Builder {
240 pub fn profile(mut self, input: impl Into<std::string::String>) -> Self {
242 self.profile = Some(input.into());
243 self
244 }
245 pub fn set_profile(mut self, input: std::option::Option<std::string::String>) -> Self {
247 self.profile = input;
248 self
249 }
250 pub fn settings(mut self, input: impl Into<std::string::String>) -> Self {
252 self.settings = Some(input.into());
253 self
254 }
255 pub fn set_settings(mut self, input: std::option::Option<std::string::String>) -> Self {
257 self.settings = input;
258 self
259 }
260 pub fn chat(mut self, input: impl Into<std::string::String>) -> Self {
262 self.chat = Some(input.into());
263 self
264 }
265 pub fn set_chat(mut self, input: std::option::Option<std::string::String>) -> Self {
267 self.chat = input;
268 self
269 }
270 pub fn build(self) -> crate::model::IdentityExternalLinks {
272 crate::model::IdentityExternalLinks {
273 profile: self.profile,
274 settings: self.settings,
275 chat: self.chat,
276 }
277 }
278 }
279}
280impl IdentityExternalLinks {
281 pub fn builder() -> crate::model::identity_external_links::Builder {
283 crate::model::identity_external_links::Builder::default()
284 }
285}
286
287#[non_exhaustive]
289#[derive(std::clone::Clone, std::cmp::PartialEq)]
290pub struct PartyHandle {
291 pub party_id: std::option::Option<std::string::String>,
293 pub create_ts: std::option::Option<aws_smithy_types::DateTime>,
295 pub activity: std::option::Option<crate::model::PartyActivity>,
297 pub external: std::option::Option<crate::model::PartyExternalLinks>,
299}
300impl PartyHandle {
301 pub fn party_id(&self) -> std::option::Option<&str> {
303 self.party_id.as_deref()
304 }
305 pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
307 self.create_ts.as_ref()
308 }
309 pub fn activity(&self) -> std::option::Option<&crate::model::PartyActivity> {
311 self.activity.as_ref()
312 }
313 pub fn external(&self) -> std::option::Option<&crate::model::PartyExternalLinks> {
315 self.external.as_ref()
316 }
317}
318impl std::fmt::Debug for PartyHandle {
319 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
320 let mut formatter = f.debug_struct("PartyHandle");
321 formatter.field("party_id", &self.party_id);
322 formatter.field("create_ts", &self.create_ts);
323 formatter.field("activity", &self.activity);
324 formatter.field("external", &self.external);
325 formatter.finish()
326 }
327}
328pub mod party_handle {
330 #[non_exhaustive]
332 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
333 pub struct Builder {
334 pub(crate) party_id: std::option::Option<std::string::String>,
335 pub(crate) create_ts: std::option::Option<aws_smithy_types::DateTime>,
336 pub(crate) activity: std::option::Option<crate::model::PartyActivity>,
337 pub(crate) external: std::option::Option<crate::model::PartyExternalLinks>,
338 }
339 impl Builder {
340 pub fn party_id(mut self, input: impl Into<std::string::String>) -> Self {
342 self.party_id = Some(input.into());
343 self
344 }
345 pub fn set_party_id(mut self, input: std::option::Option<std::string::String>) -> Self {
347 self.party_id = input;
348 self
349 }
350 pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self {
352 self.create_ts = Some(input);
353 self
354 }
355 pub fn set_create_ts(
357 mut self,
358 input: std::option::Option<aws_smithy_types::DateTime>,
359 ) -> Self {
360 self.create_ts = input;
361 self
362 }
363 pub fn activity(mut self, input: crate::model::PartyActivity) -> Self {
365 self.activity = Some(input);
366 self
367 }
368 pub fn set_activity(
370 mut self,
371 input: std::option::Option<crate::model::PartyActivity>,
372 ) -> Self {
373 self.activity = input;
374 self
375 }
376 pub fn external(mut self, input: crate::model::PartyExternalLinks) -> Self {
378 self.external = Some(input);
379 self
380 }
381 pub fn set_external(
383 mut self,
384 input: std::option::Option<crate::model::PartyExternalLinks>,
385 ) -> Self {
386 self.external = input;
387 self
388 }
389 pub fn build(self) -> crate::model::PartyHandle {
391 crate::model::PartyHandle {
392 party_id: self.party_id,
393 create_ts: self.create_ts,
394 activity: self.activity,
395 external: self.external,
396 }
397 }
398 }
399}
400impl PartyHandle {
401 pub fn builder() -> crate::model::party_handle::Builder {
403 crate::model::party_handle::Builder::default()
404 }
405}
406
407#[non_exhaustive]
409#[derive(std::clone::Clone, std::cmp::PartialEq)]
410pub struct PartyExternalLinks {
411 pub chat: std::option::Option<std::string::String>,
413}
414impl PartyExternalLinks {
415 pub fn chat(&self) -> std::option::Option<&str> {
417 self.chat.as_deref()
418 }
419}
420impl std::fmt::Debug for PartyExternalLinks {
421 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
422 let mut formatter = f.debug_struct("PartyExternalLinks");
423 formatter.field("chat", &self.chat);
424 formatter.finish()
425 }
426}
427pub mod party_external_links {
429 #[non_exhaustive]
431 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
432 pub struct Builder {
433 pub(crate) chat: std::option::Option<std::string::String>,
434 }
435 impl Builder {
436 pub fn chat(mut self, input: impl Into<std::string::String>) -> Self {
438 self.chat = Some(input.into());
439 self
440 }
441 pub fn set_chat(mut self, input: std::option::Option<std::string::String>) -> Self {
443 self.chat = input;
444 self
445 }
446 pub fn build(self) -> crate::model::PartyExternalLinks {
448 crate::model::PartyExternalLinks { chat: self.chat }
449 }
450 }
451}
452impl PartyExternalLinks {
453 pub fn builder() -> crate::model::party_external_links::Builder {
455 crate::model::party_external_links::Builder::default()
456 }
457}
458
459#[non_exhaustive]
461#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
462pub enum PartyActivity {
463 Idle(crate::model::PartyActivityIdle),
465 MatchmakerFindingLobby(crate::model::PartyActivityMatchmakerFindingLobby),
467 MatchmakerLobby(crate::model::PartyActivityMatchmakerLobby),
469 #[non_exhaustive]
477 Unknown,
478}
479impl PartyActivity {
480 pub fn as_idle(&self) -> std::result::Result<&crate::model::PartyActivityIdle, &Self> {
483 if let PartyActivity::Idle(val) = &self {
484 Ok(val)
485 } else {
486 Err(self)
487 }
488 }
489 pub fn is_idle(&self) -> bool {
491 self.as_idle().is_ok()
492 }
493 pub fn as_matchmaker_finding_lobby(
496 &self,
497 ) -> std::result::Result<&crate::model::PartyActivityMatchmakerFindingLobby, &Self> {
498 if let PartyActivity::MatchmakerFindingLobby(val) = &self {
499 Ok(val)
500 } else {
501 Err(self)
502 }
503 }
504 pub fn is_matchmaker_finding_lobby(&self) -> bool {
506 self.as_matchmaker_finding_lobby().is_ok()
507 }
508 pub fn as_matchmaker_lobby(
511 &self,
512 ) -> std::result::Result<&crate::model::PartyActivityMatchmakerLobby, &Self> {
513 if let PartyActivity::MatchmakerLobby(val) = &self {
514 Ok(val)
515 } else {
516 Err(self)
517 }
518 }
519 pub fn is_matchmaker_lobby(&self) -> bool {
521 self.as_matchmaker_lobby().is_ok()
522 }
523 pub fn is_unknown(&self) -> bool {
525 matches!(self, Self::Unknown)
526 }
527}
528
529#[non_exhaustive]
531#[derive(std::clone::Clone, std::cmp::PartialEq)]
532pub struct PartyActivityMatchmakerLobby {
533 pub lobby: std::option::Option<crate::model::PartyMatchmakerLobby>,
535 pub game: std::option::Option<crate::model::GameHandle>,
537}
538impl PartyActivityMatchmakerLobby {
539 pub fn lobby(&self) -> std::option::Option<&crate::model::PartyMatchmakerLobby> {
541 self.lobby.as_ref()
542 }
543 pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> {
545 self.game.as_ref()
546 }
547}
548impl std::fmt::Debug for PartyActivityMatchmakerLobby {
549 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
550 let mut formatter = f.debug_struct("PartyActivityMatchmakerLobby");
551 formatter.field("lobby", &self.lobby);
552 formatter.field("game", &self.game);
553 formatter.finish()
554 }
555}
556pub mod party_activity_matchmaker_lobby {
558 #[non_exhaustive]
560 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
561 pub struct Builder {
562 pub(crate) lobby: std::option::Option<crate::model::PartyMatchmakerLobby>,
563 pub(crate) game: std::option::Option<crate::model::GameHandle>,
564 }
565 impl Builder {
566 pub fn lobby(mut self, input: crate::model::PartyMatchmakerLobby) -> Self {
568 self.lobby = Some(input);
569 self
570 }
571 pub fn set_lobby(
573 mut self,
574 input: std::option::Option<crate::model::PartyMatchmakerLobby>,
575 ) -> Self {
576 self.lobby = input;
577 self
578 }
579 pub fn game(mut self, input: crate::model::GameHandle) -> Self {
581 self.game = Some(input);
582 self
583 }
584 pub fn set_game(mut self, input: std::option::Option<crate::model::GameHandle>) -> Self {
586 self.game = input;
587 self
588 }
589 pub fn build(self) -> crate::model::PartyActivityMatchmakerLobby {
591 crate::model::PartyActivityMatchmakerLobby {
592 lobby: self.lobby,
593 game: self.game,
594 }
595 }
596 }
597}
598impl PartyActivityMatchmakerLobby {
599 pub fn builder() -> crate::model::party_activity_matchmaker_lobby::Builder {
601 crate::model::party_activity_matchmaker_lobby::Builder::default()
602 }
603}
604
605#[non_exhaustive]
607#[derive(std::clone::Clone, std::cmp::PartialEq)]
608pub struct GameHandle {
609 pub game_id: std::option::Option<std::string::String>,
611 pub name_id: std::option::Option<std::string::String>,
613 pub display_name: std::option::Option<std::string::String>,
615 pub logo_url: std::option::Option<std::string::String>,
617 pub banner_url: std::option::Option<std::string::String>,
619}
620impl GameHandle {
621 pub fn game_id(&self) -> std::option::Option<&str> {
623 self.game_id.as_deref()
624 }
625 pub fn name_id(&self) -> std::option::Option<&str> {
627 self.name_id.as_deref()
628 }
629 pub fn display_name(&self) -> std::option::Option<&str> {
631 self.display_name.as_deref()
632 }
633 pub fn logo_url(&self) -> std::option::Option<&str> {
635 self.logo_url.as_deref()
636 }
637 pub fn banner_url(&self) -> std::option::Option<&str> {
639 self.banner_url.as_deref()
640 }
641}
642impl std::fmt::Debug for GameHandle {
643 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
644 let mut formatter = f.debug_struct("GameHandle");
645 formatter.field("game_id", &self.game_id);
646 formatter.field("name_id", &self.name_id);
647 formatter.field("display_name", &self.display_name);
648 formatter.field("logo_url", &self.logo_url);
649 formatter.field("banner_url", &self.banner_url);
650 formatter.finish()
651 }
652}
653pub mod game_handle {
655 #[non_exhaustive]
657 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
658 pub struct Builder {
659 pub(crate) game_id: std::option::Option<std::string::String>,
660 pub(crate) name_id: std::option::Option<std::string::String>,
661 pub(crate) display_name: std::option::Option<std::string::String>,
662 pub(crate) logo_url: std::option::Option<std::string::String>,
663 pub(crate) banner_url: std::option::Option<std::string::String>,
664 }
665 impl Builder {
666 pub fn game_id(mut self, input: impl Into<std::string::String>) -> Self {
668 self.game_id = Some(input.into());
669 self
670 }
671 pub fn set_game_id(mut self, input: std::option::Option<std::string::String>) -> Self {
673 self.game_id = input;
674 self
675 }
676 pub fn name_id(mut self, input: impl Into<std::string::String>) -> Self {
678 self.name_id = Some(input.into());
679 self
680 }
681 pub fn set_name_id(mut self, input: std::option::Option<std::string::String>) -> Self {
683 self.name_id = input;
684 self
685 }
686 pub fn display_name(mut self, input: impl Into<std::string::String>) -> Self {
688 self.display_name = Some(input.into());
689 self
690 }
691 pub fn set_display_name(mut self, input: std::option::Option<std::string::String>) -> Self {
693 self.display_name = input;
694 self
695 }
696 pub fn logo_url(mut self, input: impl Into<std::string::String>) -> Self {
698 self.logo_url = Some(input.into());
699 self
700 }
701 pub fn set_logo_url(mut self, input: std::option::Option<std::string::String>) -> Self {
703 self.logo_url = input;
704 self
705 }
706 pub fn banner_url(mut self, input: impl Into<std::string::String>) -> Self {
708 self.banner_url = Some(input.into());
709 self
710 }
711 pub fn set_banner_url(mut self, input: std::option::Option<std::string::String>) -> Self {
713 self.banner_url = input;
714 self
715 }
716 pub fn build(self) -> crate::model::GameHandle {
718 crate::model::GameHandle {
719 game_id: self.game_id,
720 name_id: self.name_id,
721 display_name: self.display_name,
722 logo_url: self.logo_url,
723 banner_url: self.banner_url,
724 }
725 }
726 }
727}
728impl GameHandle {
729 pub fn builder() -> crate::model::game_handle::Builder {
731 crate::model::game_handle::Builder::default()
732 }
733}
734
735#[non_exhaustive]
737#[derive(std::clone::Clone, std::cmp::PartialEq)]
738pub struct PartyMatchmakerLobby {
739 pub lobby_id: std::option::Option<std::string::String>,
741}
742impl PartyMatchmakerLobby {
743 pub fn lobby_id(&self) -> std::option::Option<&str> {
745 self.lobby_id.as_deref()
746 }
747}
748impl std::fmt::Debug for PartyMatchmakerLobby {
749 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
750 let mut formatter = f.debug_struct("PartyMatchmakerLobby");
751 formatter.field("lobby_id", &self.lobby_id);
752 formatter.finish()
753 }
754}
755pub mod party_matchmaker_lobby {
757 #[non_exhaustive]
759 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
760 pub struct Builder {
761 pub(crate) lobby_id: std::option::Option<std::string::String>,
762 }
763 impl Builder {
764 pub fn lobby_id(mut self, input: impl Into<std::string::String>) -> Self {
766 self.lobby_id = Some(input.into());
767 self
768 }
769 pub fn set_lobby_id(mut self, input: std::option::Option<std::string::String>) -> Self {
771 self.lobby_id = input;
772 self
773 }
774 pub fn build(self) -> crate::model::PartyMatchmakerLobby {
776 crate::model::PartyMatchmakerLobby {
777 lobby_id: self.lobby_id,
778 }
779 }
780 }
781}
782impl PartyMatchmakerLobby {
783 pub fn builder() -> crate::model::party_matchmaker_lobby::Builder {
785 crate::model::party_matchmaker_lobby::Builder::default()
786 }
787}
788
789#[non_exhaustive]
791#[derive(std::clone::Clone, std::cmp::PartialEq)]
792pub struct PartyActivityMatchmakerFindingLobby {
793 pub game: std::option::Option<crate::model::GameHandle>,
795}
796impl PartyActivityMatchmakerFindingLobby {
797 pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> {
799 self.game.as_ref()
800 }
801}
802impl std::fmt::Debug for PartyActivityMatchmakerFindingLobby {
803 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
804 let mut formatter = f.debug_struct("PartyActivityMatchmakerFindingLobby");
805 formatter.field("game", &self.game);
806 formatter.finish()
807 }
808}
809pub mod party_activity_matchmaker_finding_lobby {
811 #[non_exhaustive]
813 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
814 pub struct Builder {
815 pub(crate) game: std::option::Option<crate::model::GameHandle>,
816 }
817 impl Builder {
818 pub fn game(mut self, input: crate::model::GameHandle) -> Self {
820 self.game = Some(input);
821 self
822 }
823 pub fn set_game(mut self, input: std::option::Option<crate::model::GameHandle>) -> Self {
825 self.game = input;
826 self
827 }
828 pub fn build(self) -> crate::model::PartyActivityMatchmakerFindingLobby {
830 crate::model::PartyActivityMatchmakerFindingLobby { game: self.game }
831 }
832 }
833}
834impl PartyActivityMatchmakerFindingLobby {
835 pub fn builder() -> crate::model::party_activity_matchmaker_finding_lobby::Builder {
837 crate::model::party_activity_matchmaker_finding_lobby::Builder::default()
838 }
839}
840
841#[non_exhaustive]
843#[derive(std::clone::Clone, std::cmp::PartialEq)]
844pub struct PartyActivityIdle {}
845impl std::fmt::Debug for PartyActivityIdle {
846 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
847 let mut formatter = f.debug_struct("PartyActivityIdle");
848 formatter.finish()
849 }
850}
851pub mod party_activity_idle {
853 #[non_exhaustive]
855 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
856 pub struct Builder {}
857 impl Builder {
858 pub fn build(self) -> crate::model::PartyActivityIdle {
860 crate::model::PartyActivityIdle {}
861 }
862 }
863}
864impl PartyActivityIdle {
865 pub fn builder() -> crate::model::party_activity_idle::Builder {
867 crate::model::party_activity_idle::Builder::default()
868 }
869}
870
871#[non_exhaustive]
873#[derive(std::clone::Clone, std::cmp::PartialEq)]
874pub struct IdentityPresence {
875 pub update_ts: std::option::Option<aws_smithy_types::DateTime>,
877 pub status: std::option::Option<crate::model::IdentityStatus>,
879 pub game_activity: std::option::Option<crate::model::IdentityGameActivity>,
881}
882impl IdentityPresence {
883 pub fn update_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
885 self.update_ts.as_ref()
886 }
887 pub fn status(&self) -> std::option::Option<&crate::model::IdentityStatus> {
889 self.status.as_ref()
890 }
891 pub fn game_activity(&self) -> std::option::Option<&crate::model::IdentityGameActivity> {
893 self.game_activity.as_ref()
894 }
895}
896impl std::fmt::Debug for IdentityPresence {
897 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
898 let mut formatter = f.debug_struct("IdentityPresence");
899 formatter.field("update_ts", &self.update_ts);
900 formatter.field("status", &self.status);
901 formatter.field("game_activity", &self.game_activity);
902 formatter.finish()
903 }
904}
905pub mod identity_presence {
907 #[non_exhaustive]
909 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
910 pub struct Builder {
911 pub(crate) update_ts: std::option::Option<aws_smithy_types::DateTime>,
912 pub(crate) status: std::option::Option<crate::model::IdentityStatus>,
913 pub(crate) game_activity: std::option::Option<crate::model::IdentityGameActivity>,
914 }
915 impl Builder {
916 pub fn update_ts(mut self, input: aws_smithy_types::DateTime) -> Self {
918 self.update_ts = Some(input);
919 self
920 }
921 pub fn set_update_ts(
923 mut self,
924 input: std::option::Option<aws_smithy_types::DateTime>,
925 ) -> Self {
926 self.update_ts = input;
927 self
928 }
929 pub fn status(mut self, input: crate::model::IdentityStatus) -> Self {
931 self.status = Some(input);
932 self
933 }
934 pub fn set_status(
936 mut self,
937 input: std::option::Option<crate::model::IdentityStatus>,
938 ) -> Self {
939 self.status = input;
940 self
941 }
942 pub fn game_activity(mut self, input: crate::model::IdentityGameActivity) -> Self {
944 self.game_activity = Some(input);
945 self
946 }
947 pub fn set_game_activity(
949 mut self,
950 input: std::option::Option<crate::model::IdentityGameActivity>,
951 ) -> Self {
952 self.game_activity = input;
953 self
954 }
955 pub fn build(self) -> crate::model::IdentityPresence {
957 crate::model::IdentityPresence {
958 update_ts: self.update_ts,
959 status: self.status,
960 game_activity: self.game_activity,
961 }
962 }
963 }
964}
965impl IdentityPresence {
966 pub fn builder() -> crate::model::identity_presence::Builder {
968 crate::model::identity_presence::Builder::default()
969 }
970}
971
972#[non_exhaustive]
974#[derive(std::clone::Clone, std::cmp::PartialEq)]
975pub struct IdentityGameActivity {
976 pub game: std::option::Option<crate::model::GameHandle>,
978 pub message: std::option::Option<std::string::String>,
980 pub public_metadata: std::option::Option<aws_smithy_types::Document>,
982 pub mutual_metadata: std::option::Option<aws_smithy_types::Document>,
984}
985impl IdentityGameActivity {
986 pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> {
988 self.game.as_ref()
989 }
990 pub fn message(&self) -> std::option::Option<&str> {
992 self.message.as_deref()
993 }
994 pub fn public_metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
996 self.public_metadata.as_ref()
997 }
998 pub fn mutual_metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
1000 self.mutual_metadata.as_ref()
1001 }
1002}
1003impl std::fmt::Debug for IdentityGameActivity {
1004 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1005 let mut formatter = f.debug_struct("IdentityGameActivity");
1006 formatter.field("game", &self.game);
1007 formatter.field("message", &self.message);
1008 formatter.field("public_metadata", &self.public_metadata);
1009 formatter.field("mutual_metadata", &self.mutual_metadata);
1010 formatter.finish()
1011 }
1012}
1013pub mod identity_game_activity {
1015 #[non_exhaustive]
1017 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1018 pub struct Builder {
1019 pub(crate) game: std::option::Option<crate::model::GameHandle>,
1020 pub(crate) message: std::option::Option<std::string::String>,
1021 pub(crate) public_metadata: std::option::Option<aws_smithy_types::Document>,
1022 pub(crate) mutual_metadata: std::option::Option<aws_smithy_types::Document>,
1023 }
1024 impl Builder {
1025 pub fn game(mut self, input: crate::model::GameHandle) -> Self {
1027 self.game = Some(input);
1028 self
1029 }
1030 pub fn set_game(mut self, input: std::option::Option<crate::model::GameHandle>) -> Self {
1032 self.game = input;
1033 self
1034 }
1035 pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
1037 self.message = Some(input.into());
1038 self
1039 }
1040 pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
1042 self.message = input;
1043 self
1044 }
1045 pub fn public_metadata(mut self, input: aws_smithy_types::Document) -> Self {
1047 self.public_metadata = Some(input);
1048 self
1049 }
1050 pub fn set_public_metadata(
1052 mut self,
1053 input: std::option::Option<aws_smithy_types::Document>,
1054 ) -> Self {
1055 self.public_metadata = input;
1056 self
1057 }
1058 pub fn mutual_metadata(mut self, input: aws_smithy_types::Document) -> Self {
1060 self.mutual_metadata = Some(input);
1061 self
1062 }
1063 pub fn set_mutual_metadata(
1065 mut self,
1066 input: std::option::Option<aws_smithy_types::Document>,
1067 ) -> Self {
1068 self.mutual_metadata = input;
1069 self
1070 }
1071 pub fn build(self) -> crate::model::IdentityGameActivity {
1073 crate::model::IdentityGameActivity {
1074 game: self.game,
1075 message: self.message,
1076 public_metadata: self.public_metadata,
1077 mutual_metadata: self.mutual_metadata,
1078 }
1079 }
1080 }
1081}
1082impl IdentityGameActivity {
1083 pub fn builder() -> crate::model::identity_game_activity::Builder {
1085 crate::model::identity_game_activity::Builder::default()
1086 }
1087}
1088
1089#[non_exhaustive]
1092#[derive(
1093 std::clone::Clone,
1094 std::cmp::Eq,
1095 std::cmp::Ord,
1096 std::cmp::PartialEq,
1097 std::cmp::PartialOrd,
1098 std::fmt::Debug,
1099 std::hash::Hash,
1100)]
1101pub enum IdentityStatus {
1102 #[allow(missing_docs)] Away,
1104 #[allow(missing_docs)] Offline,
1106 #[allow(missing_docs)] Online,
1108 Unknown(String),
1110}
1111impl std::convert::From<&str> for IdentityStatus {
1112 fn from(s: &str) -> Self {
1113 match s {
1114 "away" => IdentityStatus::Away,
1115 "offline" => IdentityStatus::Offline,
1116 "online" => IdentityStatus::Online,
1117 other => IdentityStatus::Unknown(other.to_owned()),
1118 }
1119 }
1120}
1121impl std::str::FromStr for IdentityStatus {
1122 type Err = std::convert::Infallible;
1123
1124 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1125 Ok(IdentityStatus::from(s))
1126 }
1127}
1128impl IdentityStatus {
1129 pub fn as_str(&self) -> &str {
1131 match self {
1132 IdentityStatus::Away => "away",
1133 IdentityStatus::Offline => "offline",
1134 IdentityStatus::Online => "online",
1135 IdentityStatus::Unknown(s) => s.as_ref(),
1136 }
1137 }
1138 pub fn values() -> &'static [&'static str] {
1140 &["away", "offline", "online"]
1141 }
1142}
1143impl AsRef<str> for IdentityStatus {
1144 fn as_ref(&self) -> &str {
1145 self.as_str()
1146 }
1147}
1148
1149#[non_exhaustive]
1151#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1152pub enum SendMessageBody {
1153 PartyInvite(crate::model::SendMessageBodyPartyInvite),
1155 Text(crate::model::SendMessageBodyText),
1157 #[non_exhaustive]
1165 Unknown,
1166}
1167impl SendMessageBody {
1168 pub fn as_party_invite(
1171 &self,
1172 ) -> std::result::Result<&crate::model::SendMessageBodyPartyInvite, &Self> {
1173 if let SendMessageBody::PartyInvite(val) = &self {
1174 Ok(val)
1175 } else {
1176 Err(self)
1177 }
1178 }
1179 pub fn is_party_invite(&self) -> bool {
1181 self.as_party_invite().is_ok()
1182 }
1183 pub fn as_text(&self) -> std::result::Result<&crate::model::SendMessageBodyText, &Self> {
1186 if let SendMessageBody::Text(val) = &self {
1187 Ok(val)
1188 } else {
1189 Err(self)
1190 }
1191 }
1192 pub fn is_text(&self) -> bool {
1194 self.as_text().is_ok()
1195 }
1196 pub fn is_unknown(&self) -> bool {
1198 matches!(self, Self::Unknown)
1199 }
1200}
1201
1202#[non_exhaustive]
1204#[derive(std::clone::Clone, std::cmp::PartialEq)]
1205pub struct SendMessageBodyPartyInvite {
1206 pub token: std::option::Option<std::string::String>,
1208}
1209impl SendMessageBodyPartyInvite {
1210 pub fn token(&self) -> std::option::Option<&str> {
1212 self.token.as_deref()
1213 }
1214}
1215impl std::fmt::Debug for SendMessageBodyPartyInvite {
1216 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1217 let mut formatter = f.debug_struct("SendMessageBodyPartyInvite");
1218 formatter.field("token", &"*** Sensitive Data Redacted ***");
1219 formatter.finish()
1220 }
1221}
1222pub mod send_message_body_party_invite {
1224 #[non_exhaustive]
1226 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1227 pub struct Builder {
1228 pub(crate) token: std::option::Option<std::string::String>,
1229 }
1230 impl Builder {
1231 pub fn token(mut self, input: impl Into<std::string::String>) -> Self {
1233 self.token = Some(input.into());
1234 self
1235 }
1236 pub fn set_token(mut self, input: std::option::Option<std::string::String>) -> Self {
1238 self.token = input;
1239 self
1240 }
1241 pub fn build(self) -> crate::model::SendMessageBodyPartyInvite {
1243 crate::model::SendMessageBodyPartyInvite { token: self.token }
1244 }
1245 }
1246}
1247impl SendMessageBodyPartyInvite {
1248 pub fn builder() -> crate::model::send_message_body_party_invite::Builder {
1250 crate::model::send_message_body_party_invite::Builder::default()
1251 }
1252}
1253
1254#[non_exhaustive]
1256#[derive(std::clone::Clone, std::cmp::PartialEq)]
1257pub struct SendMessageBodyText {
1258 #[allow(missing_docs)] pub body: std::option::Option<std::string::String>,
1260}
1261impl SendMessageBodyText {
1262 #[allow(missing_docs)] pub fn body(&self) -> std::option::Option<&str> {
1264 self.body.as_deref()
1265 }
1266}
1267impl std::fmt::Debug for SendMessageBodyText {
1268 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1269 let mut formatter = f.debug_struct("SendMessageBodyText");
1270 formatter.field("body", &self.body);
1271 formatter.finish()
1272 }
1273}
1274pub mod send_message_body_text {
1276 #[non_exhaustive]
1278 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1279 pub struct Builder {
1280 pub(crate) body: std::option::Option<std::string::String>,
1281 }
1282 impl Builder {
1283 #[allow(missing_docs)] pub fn body(mut self, input: impl Into<std::string::String>) -> Self {
1285 self.body = Some(input.into());
1286 self
1287 }
1288 #[allow(missing_docs)] pub fn set_body(mut self, input: std::option::Option<std::string::String>) -> Self {
1290 self.body = input;
1291 self
1292 }
1293 pub fn build(self) -> crate::model::SendMessageBodyText {
1295 crate::model::SendMessageBodyText { body: self.body }
1296 }
1297 }
1298}
1299impl SendMessageBodyText {
1300 pub fn builder() -> crate::model::send_message_body_text::Builder {
1302 crate::model::send_message_body_text::Builder::default()
1303 }
1304}
1305
1306#[non_exhaustive]
1308#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1309pub enum SendChatTopic {
1310 GroupId(std::string::String),
1312 IdentityId(std::string::String),
1314 PartyId(std::string::String),
1316 ThreadId(std::string::String),
1318 #[non_exhaustive]
1326 Unknown,
1327}
1328impl SendChatTopic {
1329 pub fn as_group_id(&self) -> std::result::Result<&std::string::String, &Self> {
1332 if let SendChatTopic::GroupId(val) = &self {
1333 Ok(val)
1334 } else {
1335 Err(self)
1336 }
1337 }
1338 pub fn is_group_id(&self) -> bool {
1340 self.as_group_id().is_ok()
1341 }
1342 pub fn as_identity_id(&self) -> std::result::Result<&std::string::String, &Self> {
1345 if let SendChatTopic::IdentityId(val) = &self {
1346 Ok(val)
1347 } else {
1348 Err(self)
1349 }
1350 }
1351 pub fn is_identity_id(&self) -> bool {
1353 self.as_identity_id().is_ok()
1354 }
1355 pub fn as_party_id(&self) -> std::result::Result<&std::string::String, &Self> {
1358 if let SendChatTopic::PartyId(val) = &self {
1359 Ok(val)
1360 } else {
1361 Err(self)
1362 }
1363 }
1364 pub fn is_party_id(&self) -> bool {
1366 self.as_party_id().is_ok()
1367 }
1368 pub fn as_thread_id(&self) -> std::result::Result<&std::string::String, &Self> {
1371 if let SendChatTopic::ThreadId(val) = &self {
1372 Ok(val)
1373 } else {
1374 Err(self)
1375 }
1376 }
1377 pub fn is_thread_id(&self) -> bool {
1379 self.as_thread_id().is_ok()
1380 }
1381 pub fn is_unknown(&self) -> bool {
1383 matches!(self, Self::Unknown)
1384 }
1385}
1386
1387#[non_exhaustive]
1389#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1390pub enum ChatTypingStatus {
1391 Idle(crate::model::Unit),
1393 Typing(crate::model::Unit),
1395 #[non_exhaustive]
1403 Unknown,
1404}
1405impl ChatTypingStatus {
1406 pub fn as_idle(&self) -> std::result::Result<&crate::model::Unit, &Self> {
1409 if let ChatTypingStatus::Idle(val) = &self {
1410 Ok(val)
1411 } else {
1412 Err(self)
1413 }
1414 }
1415 pub fn is_idle(&self) -> bool {
1417 self.as_idle().is_ok()
1418 }
1419 pub fn as_typing(&self) -> std::result::Result<&crate::model::Unit, &Self> {
1422 if let ChatTypingStatus::Typing(val) = &self {
1423 Ok(val)
1424 } else {
1425 Err(self)
1426 }
1427 }
1428 pub fn is_typing(&self) -> bool {
1430 self.as_typing().is_ok()
1431 }
1432 pub fn is_unknown(&self) -> bool {
1434 matches!(self, Self::Unknown)
1435 }
1436}
1437
1438#[allow(missing_docs)] #[non_exhaustive]
1440#[derive(std::clone::Clone, std::cmp::PartialEq)]
1441pub struct Unit {}
1442impl std::fmt::Debug for Unit {
1443 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1444 let mut formatter = f.debug_struct("Unit");
1445 formatter.finish()
1446 }
1447}
1448pub mod unit {
1450 #[non_exhaustive]
1452 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1453 pub struct Builder {}
1454 impl Builder {
1455 pub fn build(self) -> crate::model::Unit {
1457 crate::model::Unit {}
1458 }
1459 }
1460}
1461impl Unit {
1462 pub fn builder() -> crate::model::unit::Builder {
1464 crate::model::unit::Builder::default()
1465 }
1466}
1467
1468#[non_exhaustive]
1470#[derive(std::clone::Clone, std::cmp::PartialEq)]
1471pub struct ChatMessage {
1472 pub chat_message_id: std::option::Option<std::string::String>,
1474 pub thread_id: std::option::Option<std::string::String>,
1476 pub send_ts: std::option::Option<aws_smithy_types::DateTime>,
1478 pub body: std::option::Option<crate::model::ChatMessageBody>,
1480}
1481impl ChatMessage {
1482 pub fn chat_message_id(&self) -> std::option::Option<&str> {
1484 self.chat_message_id.as_deref()
1485 }
1486 pub fn thread_id(&self) -> std::option::Option<&str> {
1488 self.thread_id.as_deref()
1489 }
1490 pub fn send_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
1492 self.send_ts.as_ref()
1493 }
1494 pub fn body(&self) -> std::option::Option<&crate::model::ChatMessageBody> {
1496 self.body.as_ref()
1497 }
1498}
1499impl std::fmt::Debug for ChatMessage {
1500 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1501 let mut formatter = f.debug_struct("ChatMessage");
1502 formatter.field("chat_message_id", &self.chat_message_id);
1503 formatter.field("thread_id", &self.thread_id);
1504 formatter.field("send_ts", &self.send_ts);
1505 formatter.field("body", &self.body);
1506 formatter.finish()
1507 }
1508}
1509pub mod chat_message {
1511 #[non_exhaustive]
1513 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1514 pub struct Builder {
1515 pub(crate) chat_message_id: std::option::Option<std::string::String>,
1516 pub(crate) thread_id: std::option::Option<std::string::String>,
1517 pub(crate) send_ts: std::option::Option<aws_smithy_types::DateTime>,
1518 pub(crate) body: std::option::Option<crate::model::ChatMessageBody>,
1519 }
1520 impl Builder {
1521 pub fn chat_message_id(mut self, input: impl Into<std::string::String>) -> Self {
1523 self.chat_message_id = Some(input.into());
1524 self
1525 }
1526 pub fn set_chat_message_id(
1528 mut self,
1529 input: std::option::Option<std::string::String>,
1530 ) -> Self {
1531 self.chat_message_id = input;
1532 self
1533 }
1534 pub fn thread_id(mut self, input: impl Into<std::string::String>) -> Self {
1536 self.thread_id = Some(input.into());
1537 self
1538 }
1539 pub fn set_thread_id(mut self, input: std::option::Option<std::string::String>) -> Self {
1541 self.thread_id = input;
1542 self
1543 }
1544 pub fn send_ts(mut self, input: aws_smithy_types::DateTime) -> Self {
1546 self.send_ts = Some(input);
1547 self
1548 }
1549 pub fn set_send_ts(
1551 mut self,
1552 input: std::option::Option<aws_smithy_types::DateTime>,
1553 ) -> Self {
1554 self.send_ts = input;
1555 self
1556 }
1557 pub fn body(mut self, input: crate::model::ChatMessageBody) -> Self {
1559 self.body = Some(input);
1560 self
1561 }
1562 pub fn set_body(
1564 mut self,
1565 input: std::option::Option<crate::model::ChatMessageBody>,
1566 ) -> Self {
1567 self.body = input;
1568 self
1569 }
1570 pub fn build(self) -> crate::model::ChatMessage {
1572 crate::model::ChatMessage {
1573 chat_message_id: self.chat_message_id,
1574 thread_id: self.thread_id,
1575 send_ts: self.send_ts,
1576 body: self.body,
1577 }
1578 }
1579 }
1580}
1581impl ChatMessage {
1582 pub fn builder() -> crate::model::chat_message::Builder {
1584 crate::model::chat_message::Builder::default()
1585 }
1586}
1587
1588#[non_exhaustive]
1590#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1591pub enum ChatMessageBody {
1592 ChatCreate(crate::model::ChatMessageBodyChatCreate),
1594 GroupJoin(crate::model::ChatMessageBodyGroupJoin),
1596 GroupLeave(crate::model::ChatMessageBodyGroupLeave),
1598 IdentityFollow(crate::model::ChatMessageBodyIdentityFollow),
1600 PartyActivityChange(crate::model::ChatMessageBodyPartyActivityChange),
1602 PartyInvite(crate::model::ChatMessageBodyPartyInvite),
1604 PartyJoin(crate::model::ChatMessageBodyPartyJoin),
1606 PartyJoinRequest(crate::model::ChatMessageBodyPartyJoinRequest),
1608 PartyLeave(crate::model::ChatMessageBodyPartyLeave),
1610 Text(crate::model::ChatMessageBodyText),
1612 #[non_exhaustive]
1620 Unknown,
1621}
1622impl ChatMessageBody {
1623 pub fn as_chat_create(
1626 &self,
1627 ) -> std::result::Result<&crate::model::ChatMessageBodyChatCreate, &Self> {
1628 if let ChatMessageBody::ChatCreate(val) = &self {
1629 Ok(val)
1630 } else {
1631 Err(self)
1632 }
1633 }
1634 pub fn is_chat_create(&self) -> bool {
1636 self.as_chat_create().is_ok()
1637 }
1638 pub fn as_group_join(
1641 &self,
1642 ) -> std::result::Result<&crate::model::ChatMessageBodyGroupJoin, &Self> {
1643 if let ChatMessageBody::GroupJoin(val) = &self {
1644 Ok(val)
1645 } else {
1646 Err(self)
1647 }
1648 }
1649 pub fn is_group_join(&self) -> bool {
1651 self.as_group_join().is_ok()
1652 }
1653 pub fn as_group_leave(
1656 &self,
1657 ) -> std::result::Result<&crate::model::ChatMessageBodyGroupLeave, &Self> {
1658 if let ChatMessageBody::GroupLeave(val) = &self {
1659 Ok(val)
1660 } else {
1661 Err(self)
1662 }
1663 }
1664 pub fn is_group_leave(&self) -> bool {
1666 self.as_group_leave().is_ok()
1667 }
1668 pub fn as_identity_follow(
1671 &self,
1672 ) -> std::result::Result<&crate::model::ChatMessageBodyIdentityFollow, &Self> {
1673 if let ChatMessageBody::IdentityFollow(val) = &self {
1674 Ok(val)
1675 } else {
1676 Err(self)
1677 }
1678 }
1679 pub fn is_identity_follow(&self) -> bool {
1681 self.as_identity_follow().is_ok()
1682 }
1683 pub fn as_party_activity_change(
1686 &self,
1687 ) -> std::result::Result<&crate::model::ChatMessageBodyPartyActivityChange, &Self> {
1688 if let ChatMessageBody::PartyActivityChange(val) = &self {
1689 Ok(val)
1690 } else {
1691 Err(self)
1692 }
1693 }
1694 pub fn is_party_activity_change(&self) -> bool {
1696 self.as_party_activity_change().is_ok()
1697 }
1698 pub fn as_party_invite(
1701 &self,
1702 ) -> std::result::Result<&crate::model::ChatMessageBodyPartyInvite, &Self> {
1703 if let ChatMessageBody::PartyInvite(val) = &self {
1704 Ok(val)
1705 } else {
1706 Err(self)
1707 }
1708 }
1709 pub fn is_party_invite(&self) -> bool {
1711 self.as_party_invite().is_ok()
1712 }
1713 pub fn as_party_join(
1716 &self,
1717 ) -> std::result::Result<&crate::model::ChatMessageBodyPartyJoin, &Self> {
1718 if let ChatMessageBody::PartyJoin(val) = &self {
1719 Ok(val)
1720 } else {
1721 Err(self)
1722 }
1723 }
1724 pub fn is_party_join(&self) -> bool {
1726 self.as_party_join().is_ok()
1727 }
1728 pub fn as_party_join_request(
1731 &self,
1732 ) -> std::result::Result<&crate::model::ChatMessageBodyPartyJoinRequest, &Self> {
1733 if let ChatMessageBody::PartyJoinRequest(val) = &self {
1734 Ok(val)
1735 } else {
1736 Err(self)
1737 }
1738 }
1739 pub fn is_party_join_request(&self) -> bool {
1741 self.as_party_join_request().is_ok()
1742 }
1743 pub fn as_party_leave(
1746 &self,
1747 ) -> std::result::Result<&crate::model::ChatMessageBodyPartyLeave, &Self> {
1748 if let ChatMessageBody::PartyLeave(val) = &self {
1749 Ok(val)
1750 } else {
1751 Err(self)
1752 }
1753 }
1754 pub fn is_party_leave(&self) -> bool {
1756 self.as_party_leave().is_ok()
1757 }
1758 pub fn as_text(&self) -> std::result::Result<&crate::model::ChatMessageBodyText, &Self> {
1761 if let ChatMessageBody::Text(val) = &self {
1762 Ok(val)
1763 } else {
1764 Err(self)
1765 }
1766 }
1767 pub fn is_text(&self) -> bool {
1769 self.as_text().is_ok()
1770 }
1771 pub fn is_unknown(&self) -> bool {
1773 matches!(self, Self::Unknown)
1774 }
1775}
1776
1777#[non_exhaustive]
1779#[derive(std::clone::Clone, std::cmp::PartialEq)]
1780pub struct ChatMessageBodyPartyActivityChange {}
1781impl std::fmt::Debug for ChatMessageBodyPartyActivityChange {
1782 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1783 let mut formatter = f.debug_struct("ChatMessageBodyPartyActivityChange");
1784 formatter.finish()
1785 }
1786}
1787pub mod chat_message_body_party_activity_change {
1789 #[non_exhaustive]
1791 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1792 pub struct Builder {}
1793 impl Builder {
1794 pub fn build(self) -> crate::model::ChatMessageBodyPartyActivityChange {
1796 crate::model::ChatMessageBodyPartyActivityChange {}
1797 }
1798 }
1799}
1800impl ChatMessageBodyPartyActivityChange {
1801 pub fn builder() -> crate::model::chat_message_body_party_activity_change::Builder {
1803 crate::model::chat_message_body_party_activity_change::Builder::default()
1804 }
1805}
1806
1807#[non_exhaustive]
1809#[derive(std::clone::Clone, std::cmp::PartialEq)]
1810pub struct ChatMessageBodyPartyLeave {
1811 pub identity: std::option::Option<crate::model::IdentityHandle>,
1813}
1814impl ChatMessageBodyPartyLeave {
1815 pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
1817 self.identity.as_ref()
1818 }
1819}
1820impl std::fmt::Debug for ChatMessageBodyPartyLeave {
1821 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1822 let mut formatter = f.debug_struct("ChatMessageBodyPartyLeave");
1823 formatter.field("identity", &self.identity);
1824 formatter.finish()
1825 }
1826}
1827pub mod chat_message_body_party_leave {
1829 #[non_exhaustive]
1831 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1832 pub struct Builder {
1833 pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
1834 }
1835 impl Builder {
1836 pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
1838 self.identity = Some(input);
1839 self
1840 }
1841 pub fn set_identity(
1843 mut self,
1844 input: std::option::Option<crate::model::IdentityHandle>,
1845 ) -> Self {
1846 self.identity = input;
1847 self
1848 }
1849 pub fn build(self) -> crate::model::ChatMessageBodyPartyLeave {
1851 crate::model::ChatMessageBodyPartyLeave {
1852 identity: self.identity,
1853 }
1854 }
1855 }
1856}
1857impl ChatMessageBodyPartyLeave {
1858 pub fn builder() -> crate::model::chat_message_body_party_leave::Builder {
1860 crate::model::chat_message_body_party_leave::Builder::default()
1861 }
1862}
1863
1864#[non_exhaustive]
1866#[derive(std::clone::Clone, std::cmp::PartialEq)]
1867pub struct ChatMessageBodyPartyJoin {
1868 pub identity: std::option::Option<crate::model::IdentityHandle>,
1870}
1871impl ChatMessageBodyPartyJoin {
1872 pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
1874 self.identity.as_ref()
1875 }
1876}
1877impl std::fmt::Debug for ChatMessageBodyPartyJoin {
1878 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1879 let mut formatter = f.debug_struct("ChatMessageBodyPartyJoin");
1880 formatter.field("identity", &self.identity);
1881 formatter.finish()
1882 }
1883}
1884pub mod chat_message_body_party_join {
1886 #[non_exhaustive]
1888 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1889 pub struct Builder {
1890 pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
1891 }
1892 impl Builder {
1893 pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
1895 self.identity = Some(input);
1896 self
1897 }
1898 pub fn set_identity(
1900 mut self,
1901 input: std::option::Option<crate::model::IdentityHandle>,
1902 ) -> Self {
1903 self.identity = input;
1904 self
1905 }
1906 pub fn build(self) -> crate::model::ChatMessageBodyPartyJoin {
1908 crate::model::ChatMessageBodyPartyJoin {
1909 identity: self.identity,
1910 }
1911 }
1912 }
1913}
1914impl ChatMessageBodyPartyJoin {
1915 pub fn builder() -> crate::model::chat_message_body_party_join::Builder {
1917 crate::model::chat_message_body_party_join::Builder::default()
1918 }
1919}
1920
1921#[non_exhaustive]
1923#[derive(std::clone::Clone, std::cmp::PartialEq)]
1924pub struct ChatMessageBodyPartyJoinRequest {
1925 pub sender: std::option::Option<crate::model::IdentityHandle>,
1927}
1928impl ChatMessageBodyPartyJoinRequest {
1929 pub fn sender(&self) -> std::option::Option<&crate::model::IdentityHandle> {
1931 self.sender.as_ref()
1932 }
1933}
1934impl std::fmt::Debug for ChatMessageBodyPartyJoinRequest {
1935 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1936 let mut formatter = f.debug_struct("ChatMessageBodyPartyJoinRequest");
1937 formatter.field("sender", &self.sender);
1938 formatter.finish()
1939 }
1940}
1941pub mod chat_message_body_party_join_request {
1943 #[non_exhaustive]
1945 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
1946 pub struct Builder {
1947 pub(crate) sender: std::option::Option<crate::model::IdentityHandle>,
1948 }
1949 impl Builder {
1950 pub fn sender(mut self, input: crate::model::IdentityHandle) -> Self {
1952 self.sender = Some(input);
1953 self
1954 }
1955 pub fn set_sender(
1957 mut self,
1958 input: std::option::Option<crate::model::IdentityHandle>,
1959 ) -> Self {
1960 self.sender = input;
1961 self
1962 }
1963 pub fn build(self) -> crate::model::ChatMessageBodyPartyJoinRequest {
1965 crate::model::ChatMessageBodyPartyJoinRequest {
1966 sender: self.sender,
1967 }
1968 }
1969 }
1970}
1971impl ChatMessageBodyPartyJoinRequest {
1972 pub fn builder() -> crate::model::chat_message_body_party_join_request::Builder {
1974 crate::model::chat_message_body_party_join_request::Builder::default()
1975 }
1976}
1977
1978#[non_exhaustive]
1980#[derive(std::clone::Clone, std::cmp::PartialEq)]
1981pub struct ChatMessageBodyPartyInvite {
1982 pub sender: std::option::Option<crate::model::IdentityHandle>,
1984 pub party: std::option::Option<crate::model::PartyHandle>,
1986 pub invite_token: std::option::Option<std::string::String>,
1988}
1989impl ChatMessageBodyPartyInvite {
1990 pub fn sender(&self) -> std::option::Option<&crate::model::IdentityHandle> {
1992 self.sender.as_ref()
1993 }
1994 pub fn party(&self) -> std::option::Option<&crate::model::PartyHandle> {
1996 self.party.as_ref()
1997 }
1998 pub fn invite_token(&self) -> std::option::Option<&str> {
2000 self.invite_token.as_deref()
2001 }
2002}
2003impl std::fmt::Debug for ChatMessageBodyPartyInvite {
2004 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2005 let mut formatter = f.debug_struct("ChatMessageBodyPartyInvite");
2006 formatter.field("sender", &self.sender);
2007 formatter.field("party", &self.party);
2008 formatter.field("invite_token", &"*** Sensitive Data Redacted ***");
2009 formatter.finish()
2010 }
2011}
2012pub mod chat_message_body_party_invite {
2014 #[non_exhaustive]
2016 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2017 pub struct Builder {
2018 pub(crate) sender: std::option::Option<crate::model::IdentityHandle>,
2019 pub(crate) party: std::option::Option<crate::model::PartyHandle>,
2020 pub(crate) invite_token: std::option::Option<std::string::String>,
2021 }
2022 impl Builder {
2023 pub fn sender(mut self, input: crate::model::IdentityHandle) -> Self {
2025 self.sender = Some(input);
2026 self
2027 }
2028 pub fn set_sender(
2030 mut self,
2031 input: std::option::Option<crate::model::IdentityHandle>,
2032 ) -> Self {
2033 self.sender = input;
2034 self
2035 }
2036 pub fn party(mut self, input: crate::model::PartyHandle) -> Self {
2038 self.party = Some(input);
2039 self
2040 }
2041 pub fn set_party(mut self, input: std::option::Option<crate::model::PartyHandle>) -> Self {
2043 self.party = input;
2044 self
2045 }
2046 pub fn invite_token(mut self, input: impl Into<std::string::String>) -> Self {
2048 self.invite_token = Some(input.into());
2049 self
2050 }
2051 pub fn set_invite_token(mut self, input: std::option::Option<std::string::String>) -> Self {
2053 self.invite_token = input;
2054 self
2055 }
2056 pub fn build(self) -> crate::model::ChatMessageBodyPartyInvite {
2058 crate::model::ChatMessageBodyPartyInvite {
2059 sender: self.sender,
2060 party: self.party,
2061 invite_token: self.invite_token,
2062 }
2063 }
2064 }
2065}
2066impl ChatMessageBodyPartyInvite {
2067 pub fn builder() -> crate::model::chat_message_body_party_invite::Builder {
2069 crate::model::chat_message_body_party_invite::Builder::default()
2070 }
2071}
2072
2073#[non_exhaustive]
2075#[derive(std::clone::Clone, std::cmp::PartialEq)]
2076pub struct ChatMessageBodyGroupLeave {
2077 pub identity: std::option::Option<crate::model::IdentityHandle>,
2079}
2080impl ChatMessageBodyGroupLeave {
2081 pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
2083 self.identity.as_ref()
2084 }
2085}
2086impl std::fmt::Debug for ChatMessageBodyGroupLeave {
2087 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2088 let mut formatter = f.debug_struct("ChatMessageBodyGroupLeave");
2089 formatter.field("identity", &self.identity);
2090 formatter.finish()
2091 }
2092}
2093pub mod chat_message_body_group_leave {
2095 #[non_exhaustive]
2097 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2098 pub struct Builder {
2099 pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
2100 }
2101 impl Builder {
2102 pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
2104 self.identity = Some(input);
2105 self
2106 }
2107 pub fn set_identity(
2109 mut self,
2110 input: std::option::Option<crate::model::IdentityHandle>,
2111 ) -> Self {
2112 self.identity = input;
2113 self
2114 }
2115 pub fn build(self) -> crate::model::ChatMessageBodyGroupLeave {
2117 crate::model::ChatMessageBodyGroupLeave {
2118 identity: self.identity,
2119 }
2120 }
2121 }
2122}
2123impl ChatMessageBodyGroupLeave {
2124 pub fn builder() -> crate::model::chat_message_body_group_leave::Builder {
2126 crate::model::chat_message_body_group_leave::Builder::default()
2127 }
2128}
2129
2130#[non_exhaustive]
2132#[derive(std::clone::Clone, std::cmp::PartialEq)]
2133pub struct ChatMessageBodyGroupJoin {
2134 pub identity: std::option::Option<crate::model::IdentityHandle>,
2136}
2137impl ChatMessageBodyGroupJoin {
2138 pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
2140 self.identity.as_ref()
2141 }
2142}
2143impl std::fmt::Debug for ChatMessageBodyGroupJoin {
2144 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2145 let mut formatter = f.debug_struct("ChatMessageBodyGroupJoin");
2146 formatter.field("identity", &self.identity);
2147 formatter.finish()
2148 }
2149}
2150pub mod chat_message_body_group_join {
2152 #[non_exhaustive]
2154 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2155 pub struct Builder {
2156 pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
2157 }
2158 impl Builder {
2159 pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
2161 self.identity = Some(input);
2162 self
2163 }
2164 pub fn set_identity(
2166 mut self,
2167 input: std::option::Option<crate::model::IdentityHandle>,
2168 ) -> Self {
2169 self.identity = input;
2170 self
2171 }
2172 pub fn build(self) -> crate::model::ChatMessageBodyGroupJoin {
2174 crate::model::ChatMessageBodyGroupJoin {
2175 identity: self.identity,
2176 }
2177 }
2178 }
2179}
2180impl ChatMessageBodyGroupJoin {
2181 pub fn builder() -> crate::model::chat_message_body_group_join::Builder {
2183 crate::model::chat_message_body_group_join::Builder::default()
2184 }
2185}
2186
2187#[non_exhaustive]
2189#[derive(std::clone::Clone, std::cmp::PartialEq)]
2190pub struct ChatMessageBodyIdentityFollow {}
2191impl std::fmt::Debug for ChatMessageBodyIdentityFollow {
2192 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2193 let mut formatter = f.debug_struct("ChatMessageBodyIdentityFollow");
2194 formatter.finish()
2195 }
2196}
2197pub mod chat_message_body_identity_follow {
2199 #[non_exhaustive]
2201 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2202 pub struct Builder {}
2203 impl Builder {
2204 pub fn build(self) -> crate::model::ChatMessageBodyIdentityFollow {
2206 crate::model::ChatMessageBodyIdentityFollow {}
2207 }
2208 }
2209}
2210impl ChatMessageBodyIdentityFollow {
2211 pub fn builder() -> crate::model::chat_message_body_identity_follow::Builder {
2213 crate::model::chat_message_body_identity_follow::Builder::default()
2214 }
2215}
2216
2217#[non_exhaustive]
2219#[derive(std::clone::Clone, std::cmp::PartialEq)]
2220pub struct ChatMessageBodyChatCreate {}
2221impl std::fmt::Debug for ChatMessageBodyChatCreate {
2222 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2223 let mut formatter = f.debug_struct("ChatMessageBodyChatCreate");
2224 formatter.finish()
2225 }
2226}
2227pub mod chat_message_body_chat_create {
2229 #[non_exhaustive]
2231 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2232 pub struct Builder {}
2233 impl Builder {
2234 pub fn build(self) -> crate::model::ChatMessageBodyChatCreate {
2236 crate::model::ChatMessageBodyChatCreate {}
2237 }
2238 }
2239}
2240impl ChatMessageBodyChatCreate {
2241 pub fn builder() -> crate::model::chat_message_body_chat_create::Builder {
2243 crate::model::chat_message_body_chat_create::Builder::default()
2244 }
2245}
2246
2247#[non_exhaustive]
2249#[derive(std::clone::Clone, std::cmp::PartialEq)]
2250pub struct ChatMessageBodyText {
2251 pub sender: std::option::Option<crate::model::IdentityHandle>,
2253 pub body: std::option::Option<std::string::String>,
2255}
2256impl ChatMessageBodyText {
2257 pub fn sender(&self) -> std::option::Option<&crate::model::IdentityHandle> {
2259 self.sender.as_ref()
2260 }
2261 pub fn body(&self) -> std::option::Option<&str> {
2263 self.body.as_deref()
2264 }
2265}
2266impl std::fmt::Debug for ChatMessageBodyText {
2267 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2268 let mut formatter = f.debug_struct("ChatMessageBodyText");
2269 formatter.field("sender", &self.sender);
2270 formatter.field("body", &self.body);
2271 formatter.finish()
2272 }
2273}
2274pub mod chat_message_body_text {
2276 #[non_exhaustive]
2278 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2279 pub struct Builder {
2280 pub(crate) sender: std::option::Option<crate::model::IdentityHandle>,
2281 pub(crate) body: std::option::Option<std::string::String>,
2282 }
2283 impl Builder {
2284 pub fn sender(mut self, input: crate::model::IdentityHandle) -> Self {
2286 self.sender = Some(input);
2287 self
2288 }
2289 pub fn set_sender(
2291 mut self,
2292 input: std::option::Option<crate::model::IdentityHandle>,
2293 ) -> Self {
2294 self.sender = input;
2295 self
2296 }
2297 pub fn body(mut self, input: impl Into<std::string::String>) -> Self {
2299 self.body = Some(input.into());
2300 self
2301 }
2302 pub fn set_body(mut self, input: std::option::Option<std::string::String>) -> Self {
2304 self.body = input;
2305 self
2306 }
2307 pub fn build(self) -> crate::model::ChatMessageBodyText {
2309 crate::model::ChatMessageBodyText {
2310 sender: self.sender,
2311 body: self.body,
2312 }
2313 }
2314 }
2315}
2316impl ChatMessageBodyText {
2317 pub fn builder() -> crate::model::chat_message_body_text::Builder {
2319 crate::model::chat_message_body_text::Builder::default()
2320 }
2321}
2322
2323#[non_exhaustive]
2326#[derive(
2327 std::clone::Clone,
2328 std::cmp::Eq,
2329 std::cmp::Ord,
2330 std::cmp::PartialEq,
2331 std::cmp::PartialOrd,
2332 std::fmt::Debug,
2333 std::hash::Hash,
2334)]
2335pub enum QueryDirection {
2336 After,
2338 Before,
2340 BeforeAndAfter,
2342 Unknown(String),
2344}
2345impl std::convert::From<&str> for QueryDirection {
2346 fn from(s: &str) -> Self {
2347 match s {
2348 "after" => QueryDirection::After,
2349 "before" => QueryDirection::Before,
2350 "before_and_after" => QueryDirection::BeforeAndAfter,
2351 other => QueryDirection::Unknown(other.to_owned()),
2352 }
2353 }
2354}
2355impl std::str::FromStr for QueryDirection {
2356 type Err = std::convert::Infallible;
2357
2358 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
2359 Ok(QueryDirection::from(s))
2360 }
2361}
2362impl QueryDirection {
2363 pub fn as_str(&self) -> &str {
2365 match self {
2366 QueryDirection::After => "after",
2367 QueryDirection::Before => "before",
2368 QueryDirection::BeforeAndAfter => "before_and_after",
2369 QueryDirection::Unknown(s) => s.as_ref(),
2370 }
2371 }
2372 pub fn values() -> &'static [&'static str] {
2374 &["after", "before", "before_and_after"]
2375 }
2376}
2377impl AsRef<str> for QueryDirection {
2378 fn as_ref(&self) -> &str {
2379 self.as_str()
2380 }
2381}
2382
2383#[non_exhaustive]
2385#[derive(std::clone::Clone, std::cmp::PartialEq)]
2386pub struct WatchResponse {
2387 pub index: std::option::Option<std::string::String>,
2389}
2390impl WatchResponse {
2391 pub fn index(&self) -> std::option::Option<&str> {
2393 self.index.as_deref()
2394 }
2395}
2396impl std::fmt::Debug for WatchResponse {
2397 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2398 let mut formatter = f.debug_struct("WatchResponse");
2399 formatter.field("index", &self.index);
2400 formatter.finish()
2401 }
2402}
2403pub mod watch_response {
2405 #[non_exhaustive]
2407 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2408 pub struct Builder {
2409 pub(crate) index: std::option::Option<std::string::String>,
2410 }
2411 impl Builder {
2412 pub fn index(mut self, input: impl Into<std::string::String>) -> Self {
2414 self.index = Some(input.into());
2415 self
2416 }
2417 pub fn set_index(mut self, input: std::option::Option<std::string::String>) -> Self {
2419 self.index = input;
2420 self
2421 }
2422 pub fn build(self) -> crate::model::WatchResponse {
2424 crate::model::WatchResponse { index: self.index }
2425 }
2426 }
2427}
2428impl WatchResponse {
2429 pub fn builder() -> crate::model::watch_response::Builder {
2431 crate::model::watch_response::Builder::default()
2432 }
2433}
2434
2435#[non_exhaustive]
2437#[derive(std::clone::Clone, std::cmp::PartialEq)]
2438pub struct ChatIdentityTypingStatus {
2439 pub identity: std::option::Option<crate::model::IdentityHandle>,
2441 pub status: std::option::Option<crate::model::ChatTypingStatus>,
2443}
2444impl ChatIdentityTypingStatus {
2445 pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
2447 self.identity.as_ref()
2448 }
2449 pub fn status(&self) -> std::option::Option<&crate::model::ChatTypingStatus> {
2451 self.status.as_ref()
2452 }
2453}
2454impl std::fmt::Debug for ChatIdentityTypingStatus {
2455 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2456 let mut formatter = f.debug_struct("ChatIdentityTypingStatus");
2457 formatter.field("identity", &self.identity);
2458 formatter.field("status", &self.status);
2459 formatter.finish()
2460 }
2461}
2462pub mod chat_identity_typing_status {
2464 #[non_exhaustive]
2466 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2467 pub struct Builder {
2468 pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
2469 pub(crate) status: std::option::Option<crate::model::ChatTypingStatus>,
2470 }
2471 impl Builder {
2472 pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
2474 self.identity = Some(input);
2475 self
2476 }
2477 pub fn set_identity(
2479 mut self,
2480 input: std::option::Option<crate::model::IdentityHandle>,
2481 ) -> Self {
2482 self.identity = input;
2483 self
2484 }
2485 pub fn status(mut self, input: crate::model::ChatTypingStatus) -> Self {
2487 self.status = Some(input);
2488 self
2489 }
2490 pub fn set_status(
2492 mut self,
2493 input: std::option::Option<crate::model::ChatTypingStatus>,
2494 ) -> Self {
2495 self.status = input;
2496 self
2497 }
2498 pub fn build(self) -> crate::model::ChatIdentityTypingStatus {
2500 crate::model::ChatIdentityTypingStatus {
2501 identity: self.identity,
2502 status: self.status,
2503 }
2504 }
2505 }
2506}
2507impl ChatIdentityTypingStatus {
2508 pub fn builder() -> crate::model::chat_identity_typing_status::Builder {
2510 crate::model::chat_identity_typing_status::Builder::default()
2511 }
2512}
2513
2514#[non_exhaustive]
2516#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2517pub enum ChatSimpleTopic {
2518 Direct(crate::model::ChatSimpleTopicDirect),
2520 Group(crate::model::ChatSimpleTopicGroup),
2522 Party(crate::model::ChatSimpleTopicParty),
2524 #[non_exhaustive]
2532 Unknown,
2533}
2534impl ChatSimpleTopic {
2535 pub fn as_direct(&self) -> std::result::Result<&crate::model::ChatSimpleTopicDirect, &Self> {
2538 if let ChatSimpleTopic::Direct(val) = &self {
2539 Ok(val)
2540 } else {
2541 Err(self)
2542 }
2543 }
2544 pub fn is_direct(&self) -> bool {
2546 self.as_direct().is_ok()
2547 }
2548 pub fn as_group(&self) -> std::result::Result<&crate::model::ChatSimpleTopicGroup, &Self> {
2551 if let ChatSimpleTopic::Group(val) = &self {
2552 Ok(val)
2553 } else {
2554 Err(self)
2555 }
2556 }
2557 pub fn is_group(&self) -> bool {
2559 self.as_group().is_ok()
2560 }
2561 pub fn as_party(&self) -> std::result::Result<&crate::model::ChatSimpleTopicParty, &Self> {
2564 if let ChatSimpleTopic::Party(val) = &self {
2565 Ok(val)
2566 } else {
2567 Err(self)
2568 }
2569 }
2570 pub fn is_party(&self) -> bool {
2572 self.as_party().is_ok()
2573 }
2574 pub fn is_unknown(&self) -> bool {
2576 matches!(self, Self::Unknown)
2577 }
2578}
2579
2580#[non_exhaustive]
2582#[derive(std::clone::Clone, std::cmp::PartialEq)]
2583pub struct ChatSimpleTopicDirect {
2584 pub identity_a_id: std::option::Option<std::string::String>,
2586 pub identity_b_id: std::option::Option<std::string::String>,
2588}
2589impl ChatSimpleTopicDirect {
2590 pub fn identity_a_id(&self) -> std::option::Option<&str> {
2592 self.identity_a_id.as_deref()
2593 }
2594 pub fn identity_b_id(&self) -> std::option::Option<&str> {
2596 self.identity_b_id.as_deref()
2597 }
2598}
2599impl std::fmt::Debug for ChatSimpleTopicDirect {
2600 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2601 let mut formatter = f.debug_struct("ChatSimpleTopicDirect");
2602 formatter.field("identity_a_id", &self.identity_a_id);
2603 formatter.field("identity_b_id", &self.identity_b_id);
2604 formatter.finish()
2605 }
2606}
2607pub mod chat_simple_topic_direct {
2609 #[non_exhaustive]
2611 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2612 pub struct Builder {
2613 pub(crate) identity_a_id: std::option::Option<std::string::String>,
2614 pub(crate) identity_b_id: std::option::Option<std::string::String>,
2615 }
2616 impl Builder {
2617 pub fn identity_a_id(mut self, input: impl Into<std::string::String>) -> Self {
2619 self.identity_a_id = Some(input.into());
2620 self
2621 }
2622 pub fn set_identity_a_id(
2624 mut self,
2625 input: std::option::Option<std::string::String>,
2626 ) -> Self {
2627 self.identity_a_id = input;
2628 self
2629 }
2630 pub fn identity_b_id(mut self, input: impl Into<std::string::String>) -> Self {
2632 self.identity_b_id = Some(input.into());
2633 self
2634 }
2635 pub fn set_identity_b_id(
2637 mut self,
2638 input: std::option::Option<std::string::String>,
2639 ) -> Self {
2640 self.identity_b_id = input;
2641 self
2642 }
2643 pub fn build(self) -> crate::model::ChatSimpleTopicDirect {
2645 crate::model::ChatSimpleTopicDirect {
2646 identity_a_id: self.identity_a_id,
2647 identity_b_id: self.identity_b_id,
2648 }
2649 }
2650 }
2651}
2652impl ChatSimpleTopicDirect {
2653 pub fn builder() -> crate::model::chat_simple_topic_direct::Builder {
2655 crate::model::chat_simple_topic_direct::Builder::default()
2656 }
2657}
2658
2659#[non_exhaustive]
2661#[derive(std::clone::Clone, std::cmp::PartialEq)]
2662pub struct ChatSimpleTopicParty {
2663 pub party_id: std::option::Option<std::string::String>,
2665}
2666impl ChatSimpleTopicParty {
2667 pub fn party_id(&self) -> std::option::Option<&str> {
2669 self.party_id.as_deref()
2670 }
2671}
2672impl std::fmt::Debug for ChatSimpleTopicParty {
2673 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2674 let mut formatter = f.debug_struct("ChatSimpleTopicParty");
2675 formatter.field("party_id", &self.party_id);
2676 formatter.finish()
2677 }
2678}
2679pub mod chat_simple_topic_party {
2681 #[non_exhaustive]
2683 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2684 pub struct Builder {
2685 pub(crate) party_id: std::option::Option<std::string::String>,
2686 }
2687 impl Builder {
2688 pub fn party_id(mut self, input: impl Into<std::string::String>) -> Self {
2690 self.party_id = Some(input.into());
2691 self
2692 }
2693 pub fn set_party_id(mut self, input: std::option::Option<std::string::String>) -> Self {
2695 self.party_id = input;
2696 self
2697 }
2698 pub fn build(self) -> crate::model::ChatSimpleTopicParty {
2700 crate::model::ChatSimpleTopicParty {
2701 party_id: self.party_id,
2702 }
2703 }
2704 }
2705}
2706impl ChatSimpleTopicParty {
2707 pub fn builder() -> crate::model::chat_simple_topic_party::Builder {
2709 crate::model::chat_simple_topic_party::Builder::default()
2710 }
2711}
2712
2713#[non_exhaustive]
2715#[derive(std::clone::Clone, std::cmp::PartialEq)]
2716pub struct ChatSimpleTopicGroup {
2717 pub group_id: std::option::Option<std::string::String>,
2719}
2720impl ChatSimpleTopicGroup {
2721 pub fn group_id(&self) -> std::option::Option<&str> {
2723 self.group_id.as_deref()
2724 }
2725}
2726impl std::fmt::Debug for ChatSimpleTopicGroup {
2727 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2728 let mut formatter = f.debug_struct("ChatSimpleTopicGroup");
2729 formatter.field("group_id", &self.group_id);
2730 formatter.finish()
2731 }
2732}
2733pub mod chat_simple_topic_group {
2735 #[non_exhaustive]
2737 #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
2738 pub struct Builder {
2739 pub(crate) group_id: std::option::Option<std::string::String>,
2740 }
2741 impl Builder {
2742 pub fn group_id(mut self, input: impl Into<std::string::String>) -> Self {
2744 self.group_id = Some(input.into());
2745 self
2746 }
2747 pub fn set_group_id(mut self, input: std::option::Option<std::string::String>) -> Self {
2749 self.group_id = input;
2750 self
2751 }
2752 pub fn build(self) -> crate::model::ChatSimpleTopicGroup {
2754 crate::model::ChatSimpleTopicGroup {
2755 group_id: self.group_id,
2756 }
2757 }
2758 }
2759}
2760impl ChatSimpleTopicGroup {
2761 pub fn builder() -> crate::model::chat_simple_topic_group::Builder {
2763 crate::model::chat_simple_topic_group::Builder::default()
2764 }
2765}