#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct IdentityHandle {
pub identity_id: std::option::Option<std::string::String>,
pub display_name: std::option::Option<std::string::String>,
pub account_number: std::option::Option<i32>,
pub avatar_url: std::option::Option<std::string::String>,
pub presence: std::option::Option<crate::model::IdentityPresence>,
pub is_registered: std::option::Option<bool>,
pub external: std::option::Option<crate::model::IdentityExternalLinks>,
}
impl IdentityHandle {
pub fn identity_id(&self) -> std::option::Option<&str> {
self.identity_id.as_deref()
}
pub fn display_name(&self) -> std::option::Option<&str> {
self.display_name.as_deref()
}
pub fn account_number(&self) -> std::option::Option<i32> {
self.account_number
}
pub fn avatar_url(&self) -> std::option::Option<&str> {
self.avatar_url.as_deref()
}
pub fn presence(&self) -> std::option::Option<&crate::model::IdentityPresence> {
self.presence.as_ref()
}
pub fn is_registered(&self) -> std::option::Option<bool> {
self.is_registered
}
pub fn external(&self) -> std::option::Option<&crate::model::IdentityExternalLinks> {
self.external.as_ref()
}
}
impl std::fmt::Debug for IdentityHandle {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("IdentityHandle");
formatter.field("identity_id", &self.identity_id);
formatter.field("display_name", &self.display_name);
formatter.field("account_number", &self.account_number);
formatter.field("avatar_url", &self.avatar_url);
formatter.field("presence", &self.presence);
formatter.field("is_registered", &self.is_registered);
formatter.field("external", &self.external);
formatter.finish()
}
}
pub mod identity_handle {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_id: std::option::Option<std::string::String>,
pub(crate) display_name: std::option::Option<std::string::String>,
pub(crate) account_number: std::option::Option<i32>,
pub(crate) avatar_url: std::option::Option<std::string::String>,
pub(crate) presence: std::option::Option<crate::model::IdentityPresence>,
pub(crate) is_registered: std::option::Option<bool>,
pub(crate) external: std::option::Option<crate::model::IdentityExternalLinks>,
}
impl Builder {
pub fn identity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_id = Some(input.into());
self
}
pub fn set_identity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.identity_id = input;
self
}
pub fn display_name(mut self, input: impl Into<std::string::String>) -> Self {
self.display_name = Some(input.into());
self
}
pub fn set_display_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.display_name = input;
self
}
pub fn account_number(mut self, input: i32) -> Self {
self.account_number = Some(input);
self
}
pub fn set_account_number(mut self, input: std::option::Option<i32>) -> Self {
self.account_number = input;
self
}
pub fn avatar_url(mut self, input: impl Into<std::string::String>) -> Self {
self.avatar_url = Some(input.into());
self
}
pub fn set_avatar_url(mut self, input: std::option::Option<std::string::String>) -> Self {
self.avatar_url = input;
self
}
pub fn presence(mut self, input: crate::model::IdentityPresence) -> Self {
self.presence = Some(input);
self
}
pub fn set_presence(
mut self,
input: std::option::Option<crate::model::IdentityPresence>,
) -> Self {
self.presence = input;
self
}
pub fn is_registered(mut self, input: bool) -> Self {
self.is_registered = Some(input);
self
}
pub fn set_is_registered(mut self, input: std::option::Option<bool>) -> Self {
self.is_registered = input;
self
}
pub fn external(mut self, input: crate::model::IdentityExternalLinks) -> Self {
self.external = Some(input);
self
}
pub fn set_external(
mut self,
input: std::option::Option<crate::model::IdentityExternalLinks>,
) -> Self {
self.external = input;
self
}
pub fn build(self) -> crate::model::IdentityHandle {
crate::model::IdentityHandle {
identity_id: self.identity_id,
display_name: self.display_name,
account_number: self.account_number,
avatar_url: self.avatar_url,
presence: self.presence,
is_registered: self.is_registered,
external: self.external,
}
}
}
}
impl IdentityHandle {
pub fn builder() -> crate::model::identity_handle::Builder {
crate::model::identity_handle::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct IdentityExternalLinks {
pub profile: std::option::Option<std::string::String>,
pub settings: std::option::Option<std::string::String>,
pub chat: std::option::Option<std::string::String>,
}
impl IdentityExternalLinks {
pub fn profile(&self) -> std::option::Option<&str> {
self.profile.as_deref()
}
pub fn settings(&self) -> std::option::Option<&str> {
self.settings.as_deref()
}
pub fn chat(&self) -> std::option::Option<&str> {
self.chat.as_deref()
}
}
impl std::fmt::Debug for IdentityExternalLinks {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("IdentityExternalLinks");
formatter.field("profile", &self.profile);
formatter.field("settings", &self.settings);
formatter.field("chat", &self.chat);
formatter.finish()
}
}
pub mod identity_external_links {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) profile: std::option::Option<std::string::String>,
pub(crate) settings: std::option::Option<std::string::String>,
pub(crate) chat: std::option::Option<std::string::String>,
}
impl Builder {
pub fn profile(mut self, input: impl Into<std::string::String>) -> Self {
self.profile = Some(input.into());
self
}
pub fn set_profile(mut self, input: std::option::Option<std::string::String>) -> Self {
self.profile = input;
self
}
pub fn settings(mut self, input: impl Into<std::string::String>) -> Self {
self.settings = Some(input.into());
self
}
pub fn set_settings(mut self, input: std::option::Option<std::string::String>) -> Self {
self.settings = input;
self
}
pub fn chat(mut self, input: impl Into<std::string::String>) -> Self {
self.chat = Some(input.into());
self
}
pub fn set_chat(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chat = input;
self
}
pub fn build(self) -> crate::model::IdentityExternalLinks {
crate::model::IdentityExternalLinks {
profile: self.profile,
settings: self.settings,
chat: self.chat,
}
}
}
}
impl IdentityExternalLinks {
pub fn builder() -> crate::model::identity_external_links::Builder {
crate::model::identity_external_links::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct IdentityPresence {
pub update_ts: std::option::Option<i64>,
pub status: std::option::Option<crate::model::IdentityStatus>,
pub party: std::option::Option<crate::model::PartyHandle>,
pub game_activity: std::option::Option<crate::model::IdentityGameActivity>,
}
impl IdentityPresence {
pub fn update_ts(&self) -> std::option::Option<i64> {
self.update_ts
}
pub fn status(&self) -> std::option::Option<&crate::model::IdentityStatus> {
self.status.as_ref()
}
pub fn party(&self) -> std::option::Option<&crate::model::PartyHandle> {
self.party.as_ref()
}
pub fn game_activity(&self) -> std::option::Option<&crate::model::IdentityGameActivity> {
self.game_activity.as_ref()
}
}
impl std::fmt::Debug for IdentityPresence {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("IdentityPresence");
formatter.field("update_ts", &self.update_ts);
formatter.field("status", &self.status);
formatter.field("party", &self.party);
formatter.field("game_activity", &self.game_activity);
formatter.finish()
}
}
pub mod identity_presence {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) update_ts: std::option::Option<i64>,
pub(crate) status: std::option::Option<crate::model::IdentityStatus>,
pub(crate) party: std::option::Option<crate::model::PartyHandle>,
pub(crate) game_activity: std::option::Option<crate::model::IdentityGameActivity>,
}
impl Builder {
pub fn update_ts(mut self, input: i64) -> Self {
self.update_ts = Some(input);
self
}
pub fn set_update_ts(mut self, input: std::option::Option<i64>) -> Self {
self.update_ts = input;
self
}
pub fn status(mut self, input: crate::model::IdentityStatus) -> Self {
self.status = Some(input);
self
}
pub fn set_status(
mut self,
input: std::option::Option<crate::model::IdentityStatus>,
) -> Self {
self.status = input;
self
}
pub fn party(mut self, input: crate::model::PartyHandle) -> Self {
self.party = Some(input);
self
}
pub fn set_party(mut self, input: std::option::Option<crate::model::PartyHandle>) -> Self {
self.party = input;
self
}
pub fn game_activity(mut self, input: crate::model::IdentityGameActivity) -> Self {
self.game_activity = Some(input);
self
}
pub fn set_game_activity(
mut self,
input: std::option::Option<crate::model::IdentityGameActivity>,
) -> Self {
self.game_activity = input;
self
}
pub fn build(self) -> crate::model::IdentityPresence {
crate::model::IdentityPresence {
update_ts: self.update_ts,
status: self.status,
party: self.party,
game_activity: self.game_activity,
}
}
}
}
impl IdentityPresence {
pub fn builder() -> crate::model::identity_presence::Builder {
crate::model::identity_presence::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct IdentityGameActivity {
pub game: std::option::Option<crate::model::GameHandle>,
pub message: std::option::Option<std::string::String>,
pub public_metadata: std::option::Option<aws_smithy_types::Document>,
pub friend_metadata: std::option::Option<aws_smithy_types::Document>,
}
impl IdentityGameActivity {
pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> {
self.game.as_ref()
}
pub fn message(&self) -> std::option::Option<&str> {
self.message.as_deref()
}
pub fn public_metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
self.public_metadata.as_ref()
}
pub fn friend_metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
self.friend_metadata.as_ref()
}
}
impl std::fmt::Debug for IdentityGameActivity {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("IdentityGameActivity");
formatter.field("game", &self.game);
formatter.field("message", &self.message);
formatter.field("public_metadata", &self.public_metadata);
formatter.field("friend_metadata", &self.friend_metadata);
formatter.finish()
}
}
pub mod identity_game_activity {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) game: std::option::Option<crate::model::GameHandle>,
pub(crate) message: std::option::Option<std::string::String>,
pub(crate) public_metadata: std::option::Option<aws_smithy_types::Document>,
pub(crate) friend_metadata: std::option::Option<aws_smithy_types::Document>,
}
impl Builder {
pub fn game(mut self, input: crate::model::GameHandle) -> Self {
self.game = Some(input);
self
}
pub fn set_game(mut self, input: std::option::Option<crate::model::GameHandle>) -> Self {
self.game = input;
self
}
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
pub fn public_metadata(mut self, input: aws_smithy_types::Document) -> Self {
self.public_metadata = Some(input);
self
}
pub fn set_public_metadata(
mut self,
input: std::option::Option<aws_smithy_types::Document>,
) -> Self {
self.public_metadata = input;
self
}
pub fn friend_metadata(mut self, input: aws_smithy_types::Document) -> Self {
self.friend_metadata = Some(input);
self
}
pub fn set_friend_metadata(
mut self,
input: std::option::Option<aws_smithy_types::Document>,
) -> Self {
self.friend_metadata = input;
self
}
pub fn build(self) -> crate::model::IdentityGameActivity {
crate::model::IdentityGameActivity {
game: self.game,
message: self.message,
public_metadata: self.public_metadata,
friend_metadata: self.friend_metadata,
}
}
}
}
impl IdentityGameActivity {
pub fn builder() -> crate::model::identity_game_activity::Builder {
crate::model::identity_game_activity::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct GameHandle {
pub game_id: std::option::Option<std::string::String>,
pub name_id: std::option::Option<std::string::String>,
pub display_name: std::option::Option<std::string::String>,
pub logo_url: std::option::Option<std::string::String>,
pub banner_url: std::option::Option<std::string::String>,
}
impl GameHandle {
pub fn game_id(&self) -> std::option::Option<&str> {
self.game_id.as_deref()
}
pub fn name_id(&self) -> std::option::Option<&str> {
self.name_id.as_deref()
}
pub fn display_name(&self) -> std::option::Option<&str> {
self.display_name.as_deref()
}
pub fn logo_url(&self) -> std::option::Option<&str> {
self.logo_url.as_deref()
}
pub fn banner_url(&self) -> std::option::Option<&str> {
self.banner_url.as_deref()
}
}
impl std::fmt::Debug for GameHandle {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("GameHandle");
formatter.field("game_id", &self.game_id);
formatter.field("name_id", &self.name_id);
formatter.field("display_name", &self.display_name);
formatter.field("logo_url", &self.logo_url);
formatter.field("banner_url", &self.banner_url);
formatter.finish()
}
}
pub mod game_handle {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) game_id: std::option::Option<std::string::String>,
pub(crate) name_id: std::option::Option<std::string::String>,
pub(crate) display_name: std::option::Option<std::string::String>,
pub(crate) logo_url: std::option::Option<std::string::String>,
pub(crate) banner_url: std::option::Option<std::string::String>,
}
impl Builder {
pub fn game_id(mut self, input: impl Into<std::string::String>) -> Self {
self.game_id = Some(input.into());
self
}
pub fn set_game_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.game_id = input;
self
}
pub fn name_id(mut self, input: impl Into<std::string::String>) -> Self {
self.name_id = Some(input.into());
self
}
pub fn set_name_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name_id = input;
self
}
pub fn display_name(mut self, input: impl Into<std::string::String>) -> Self {
self.display_name = Some(input.into());
self
}
pub fn set_display_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.display_name = input;
self
}
pub fn logo_url(mut self, input: impl Into<std::string::String>) -> Self {
self.logo_url = Some(input.into());
self
}
pub fn set_logo_url(mut self, input: std::option::Option<std::string::String>) -> Self {
self.logo_url = input;
self
}
pub fn banner_url(mut self, input: impl Into<std::string::String>) -> Self {
self.banner_url = Some(input.into());
self
}
pub fn set_banner_url(mut self, input: std::option::Option<std::string::String>) -> Self {
self.banner_url = input;
self
}
pub fn build(self) -> crate::model::GameHandle {
crate::model::GameHandle {
game_id: self.game_id,
name_id: self.name_id,
display_name: self.display_name,
logo_url: self.logo_url,
banner_url: self.banner_url,
}
}
}
}
impl GameHandle {
pub fn builder() -> crate::model::game_handle::Builder {
crate::model::game_handle::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyHandle {
pub party_id: std::option::Option<std::string::String>,
pub create_ts: std::option::Option<i64>,
pub activity: std::option::Option<crate::model::PartyActivity>,
pub external: std::option::Option<crate::model::PartyExternalLinks>,
}
impl PartyHandle {
pub fn party_id(&self) -> std::option::Option<&str> {
self.party_id.as_deref()
}
pub fn create_ts(&self) -> std::option::Option<i64> {
self.create_ts
}
pub fn activity(&self) -> std::option::Option<&crate::model::PartyActivity> {
self.activity.as_ref()
}
pub fn external(&self) -> std::option::Option<&crate::model::PartyExternalLinks> {
self.external.as_ref()
}
}
impl std::fmt::Debug for PartyHandle {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyHandle");
formatter.field("party_id", &self.party_id);
formatter.field("create_ts", &self.create_ts);
formatter.field("activity", &self.activity);
formatter.field("external", &self.external);
formatter.finish()
}
}
pub mod party_handle {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) party_id: std::option::Option<std::string::String>,
pub(crate) create_ts: std::option::Option<i64>,
pub(crate) activity: std::option::Option<crate::model::PartyActivity>,
pub(crate) external: std::option::Option<crate::model::PartyExternalLinks>,
}
impl Builder {
pub fn party_id(mut self, input: impl Into<std::string::String>) -> Self {
self.party_id = Some(input.into());
self
}
pub fn set_party_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.party_id = input;
self
}
pub fn create_ts(mut self, input: i64) -> Self {
self.create_ts = Some(input);
self
}
pub fn set_create_ts(mut self, input: std::option::Option<i64>) -> Self {
self.create_ts = input;
self
}
pub fn activity(mut self, input: crate::model::PartyActivity) -> Self {
self.activity = Some(input);
self
}
pub fn set_activity(
mut self,
input: std::option::Option<crate::model::PartyActivity>,
) -> Self {
self.activity = input;
self
}
pub fn external(mut self, input: crate::model::PartyExternalLinks) -> Self {
self.external = Some(input);
self
}
pub fn set_external(
mut self,
input: std::option::Option<crate::model::PartyExternalLinks>,
) -> Self {
self.external = input;
self
}
pub fn build(self) -> crate::model::PartyHandle {
crate::model::PartyHandle {
party_id: self.party_id,
create_ts: self.create_ts,
activity: self.activity,
external: self.external,
}
}
}
}
impl PartyHandle {
pub fn builder() -> crate::model::party_handle::Builder {
crate::model::party_handle::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyExternalLinks {
pub chat: std::option::Option<std::string::String>,
}
impl PartyExternalLinks {
pub fn chat(&self) -> std::option::Option<&str> {
self.chat.as_deref()
}
}
impl std::fmt::Debug for PartyExternalLinks {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyExternalLinks");
formatter.field("chat", &self.chat);
formatter.finish()
}
}
pub mod party_external_links {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) chat: std::option::Option<std::string::String>,
}
impl Builder {
pub fn chat(mut self, input: impl Into<std::string::String>) -> Self {
self.chat = Some(input.into());
self
}
pub fn set_chat(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chat = input;
self
}
pub fn build(self) -> crate::model::PartyExternalLinks {
crate::model::PartyExternalLinks { chat: self.chat }
}
}
}
impl PartyExternalLinks {
pub fn builder() -> crate::model::party_external_links::Builder {
crate::model::party_external_links::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub enum PartyActivity {
Idle(crate::model::PartyActivityIdle),
MatchmakerFindingLobby(crate::model::PartyActivityMatchmakerFindingLobby),
MatchmakerLobby(crate::model::PartyActivityMatchmakerLobby),
#[non_exhaustive]
Unknown,
}
impl PartyActivity {
pub fn as_idle(&self) -> std::result::Result<&crate::model::PartyActivityIdle, &Self> {
if let PartyActivity::Idle(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_idle(&self) -> bool {
self.as_idle().is_ok()
}
pub fn as_matchmaker_finding_lobby(
&self,
) -> std::result::Result<&crate::model::PartyActivityMatchmakerFindingLobby, &Self> {
if let PartyActivity::MatchmakerFindingLobby(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_matchmaker_finding_lobby(&self) -> bool {
self.as_matchmaker_finding_lobby().is_ok()
}
pub fn as_matchmaker_lobby(
&self,
) -> std::result::Result<&crate::model::PartyActivityMatchmakerLobby, &Self> {
if let PartyActivity::MatchmakerLobby(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_matchmaker_lobby(&self) -> bool {
self.as_matchmaker_lobby().is_ok()
}
pub fn is_unknown(&self) -> bool {
matches!(self, Self::Unknown)
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyActivityMatchmakerLobby {
pub lobby: std::option::Option<crate::model::PartyMatchmakerLobby>,
pub game: std::option::Option<crate::model::GameHandle>,
}
impl PartyActivityMatchmakerLobby {
pub fn lobby(&self) -> std::option::Option<&crate::model::PartyMatchmakerLobby> {
self.lobby.as_ref()
}
pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> {
self.game.as_ref()
}
}
impl std::fmt::Debug for PartyActivityMatchmakerLobby {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyActivityMatchmakerLobby");
formatter.field("lobby", &self.lobby);
formatter.field("game", &self.game);
formatter.finish()
}
}
pub mod party_activity_matchmaker_lobby {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) lobby: std::option::Option<crate::model::PartyMatchmakerLobby>,
pub(crate) game: std::option::Option<crate::model::GameHandle>,
}
impl Builder {
pub fn lobby(mut self, input: crate::model::PartyMatchmakerLobby) -> Self {
self.lobby = Some(input);
self
}
pub fn set_lobby(
mut self,
input: std::option::Option<crate::model::PartyMatchmakerLobby>,
) -> Self {
self.lobby = input;
self
}
pub fn game(mut self, input: crate::model::GameHandle) -> Self {
self.game = Some(input);
self
}
pub fn set_game(mut self, input: std::option::Option<crate::model::GameHandle>) -> Self {
self.game = input;
self
}
pub fn build(self) -> crate::model::PartyActivityMatchmakerLobby {
crate::model::PartyActivityMatchmakerLobby {
lobby: self.lobby,
game: self.game,
}
}
}
}
impl PartyActivityMatchmakerLobby {
pub fn builder() -> crate::model::party_activity_matchmaker_lobby::Builder {
crate::model::party_activity_matchmaker_lobby::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyMatchmakerLobby {
pub lobby_id: std::option::Option<std::string::String>,
}
impl PartyMatchmakerLobby {
pub fn lobby_id(&self) -> std::option::Option<&str> {
self.lobby_id.as_deref()
}
}
impl std::fmt::Debug for PartyMatchmakerLobby {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyMatchmakerLobby");
formatter.field("lobby_id", &self.lobby_id);
formatter.finish()
}
}
pub mod party_matchmaker_lobby {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) lobby_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn lobby_id(mut self, input: impl Into<std::string::String>) -> Self {
self.lobby_id = Some(input.into());
self
}
pub fn set_lobby_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.lobby_id = input;
self
}
pub fn build(self) -> crate::model::PartyMatchmakerLobby {
crate::model::PartyMatchmakerLobby {
lobby_id: self.lobby_id,
}
}
}
}
impl PartyMatchmakerLobby {
pub fn builder() -> crate::model::party_matchmaker_lobby::Builder {
crate::model::party_matchmaker_lobby::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyActivityMatchmakerFindingLobby {
pub game: std::option::Option<crate::model::GameHandle>,
}
impl PartyActivityMatchmakerFindingLobby {
pub fn game(&self) -> std::option::Option<&crate::model::GameHandle> {
self.game.as_ref()
}
}
impl std::fmt::Debug for PartyActivityMatchmakerFindingLobby {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyActivityMatchmakerFindingLobby");
formatter.field("game", &self.game);
formatter.finish()
}
}
pub mod party_activity_matchmaker_finding_lobby {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) game: std::option::Option<crate::model::GameHandle>,
}
impl Builder {
pub fn game(mut self, input: crate::model::GameHandle) -> Self {
self.game = Some(input);
self
}
pub fn set_game(mut self, input: std::option::Option<crate::model::GameHandle>) -> Self {
self.game = input;
self
}
pub fn build(self) -> crate::model::PartyActivityMatchmakerFindingLobby {
crate::model::PartyActivityMatchmakerFindingLobby { game: self.game }
}
}
}
impl PartyActivityMatchmakerFindingLobby {
pub fn builder() -> crate::model::party_activity_matchmaker_finding_lobby::Builder {
crate::model::party_activity_matchmaker_finding_lobby::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyActivityIdle {}
impl std::fmt::Debug for PartyActivityIdle {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyActivityIdle");
formatter.finish()
}
}
pub mod party_activity_idle {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {}
impl Builder {
pub fn build(self) -> crate::model::PartyActivityIdle {
crate::model::PartyActivityIdle {}
}
}
}
impl PartyActivityIdle {
pub fn builder() -> crate::model::party_activity_idle::Builder {
crate::model::party_activity_idle::Builder::default()
}
}
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum IdentityStatus {
#[allow(missing_docs)] Away,
#[allow(missing_docs)] Offline,
#[allow(missing_docs)] Online,
Unknown(String),
}
impl std::convert::From<&str> for IdentityStatus {
fn from(s: &str) -> Self {
match s {
"away" => IdentityStatus::Away,
"offline" => IdentityStatus::Offline,
"online" => IdentityStatus::Online,
other => IdentityStatus::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for IdentityStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(IdentityStatus::from(s))
}
}
impl IdentityStatus {
pub fn as_str(&self) -> &str {
match self {
IdentityStatus::Away => "away",
IdentityStatus::Offline => "offline",
IdentityStatus::Online => "online",
IdentityStatus::Unknown(s) => s.as_ref(),
}
}
pub fn values() -> &'static [&'static str] {
&["away", "offline", "online"]
}
}
impl AsRef<str> for IdentityStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub enum SendMessageBody {
Text(crate::model::SendMessageBodyText),
#[non_exhaustive]
Unknown,
}
impl SendMessageBody {
#[allow(irrefutable_let_patterns)]
pub fn as_text(&self) -> std::result::Result<&crate::model::SendMessageBodyText, &Self> {
if let SendMessageBody::Text(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_text(&self) -> bool {
self.as_text().is_ok()
}
pub fn is_unknown(&self) -> bool {
matches!(self, Self::Unknown)
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct SendMessageBodyText {
#[allow(missing_docs)] pub body: std::option::Option<std::string::String>,
}
impl SendMessageBodyText {
#[allow(missing_docs)] pub fn body(&self) -> std::option::Option<&str> {
self.body.as_deref()
}
}
impl std::fmt::Debug for SendMessageBodyText {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("SendMessageBodyText");
formatter.field("body", &self.body);
formatter.finish()
}
}
pub mod send_message_body_text {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) body: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] pub fn body(mut self, input: impl Into<std::string::String>) -> Self {
self.body = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_body(mut self, input: std::option::Option<std::string::String>) -> Self {
self.body = input;
self
}
pub fn build(self) -> crate::model::SendMessageBodyText {
crate::model::SendMessageBodyText { body: self.body }
}
}
}
impl SendMessageBodyText {
pub fn builder() -> crate::model::send_message_body_text::Builder {
crate::model::send_message_body_text::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub enum SendChatTopic {
Direct(crate::model::SendChatTopicDirect),
Group(crate::model::SendChatTopicGroup),
Party(crate::model::SendChatTopicParty),
ThreadId(std::string::String),
#[non_exhaustive]
Unknown,
}
impl SendChatTopic {
pub fn as_direct(&self) -> std::result::Result<&crate::model::SendChatTopicDirect, &Self> {
if let SendChatTopic::Direct(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_direct(&self) -> bool {
self.as_direct().is_ok()
}
pub fn as_group(&self) -> std::result::Result<&crate::model::SendChatTopicGroup, &Self> {
if let SendChatTopic::Group(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_group(&self) -> bool {
self.as_group().is_ok()
}
pub fn as_party(&self) -> std::result::Result<&crate::model::SendChatTopicParty, &Self> {
if let SendChatTopic::Party(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_party(&self) -> bool {
self.as_party().is_ok()
}
pub fn as_thread_id(&self) -> std::result::Result<&std::string::String, &Self> {
if let SendChatTopic::ThreadId(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_thread_id(&self) -> bool {
self.as_thread_id().is_ok()
}
pub fn is_unknown(&self) -> bool {
matches!(self, Self::Unknown)
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct SendChatTopicDirect {
pub identity_id: std::option::Option<std::string::String>,
}
impl SendChatTopicDirect {
pub fn identity_id(&self) -> std::option::Option<&str> {
self.identity_id.as_deref()
}
}
impl std::fmt::Debug for SendChatTopicDirect {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("SendChatTopicDirect");
formatter.field("identity_id", &self.identity_id);
formatter.finish()
}
}
pub mod send_chat_topic_direct {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn identity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_id = Some(input.into());
self
}
pub fn set_identity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.identity_id = input;
self
}
pub fn build(self) -> crate::model::SendChatTopicDirect {
crate::model::SendChatTopicDirect {
identity_id: self.identity_id,
}
}
}
}
impl SendChatTopicDirect {
pub fn builder() -> crate::model::send_chat_topic_direct::Builder {
crate::model::send_chat_topic_direct::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct SendChatTopicParty {
pub party_id: std::option::Option<std::string::String>,
}
impl SendChatTopicParty {
pub fn party_id(&self) -> std::option::Option<&str> {
self.party_id.as_deref()
}
}
impl std::fmt::Debug for SendChatTopicParty {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("SendChatTopicParty");
formatter.field("party_id", &self.party_id);
formatter.finish()
}
}
pub mod send_chat_topic_party {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) party_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn party_id(mut self, input: impl Into<std::string::String>) -> Self {
self.party_id = Some(input.into());
self
}
pub fn set_party_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.party_id = input;
self
}
pub fn build(self) -> crate::model::SendChatTopicParty {
crate::model::SendChatTopicParty {
party_id: self.party_id,
}
}
}
}
impl SendChatTopicParty {
pub fn builder() -> crate::model::send_chat_topic_party::Builder {
crate::model::send_chat_topic_party::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct SendChatTopicGroup {
pub group_id: std::option::Option<std::string::String>,
}
impl SendChatTopicGroup {
pub fn group_id(&self) -> std::option::Option<&str> {
self.group_id.as_deref()
}
}
impl std::fmt::Debug for SendChatTopicGroup {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("SendChatTopicGroup");
formatter.field("group_id", &self.group_id);
formatter.finish()
}
}
pub mod send_chat_topic_group {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) group_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn group_id(mut self, input: impl Into<std::string::String>) -> Self {
self.group_id = Some(input.into());
self
}
pub fn set_group_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.group_id = input;
self
}
pub fn build(self) -> crate::model::SendChatTopicGroup {
crate::model::SendChatTopicGroup {
group_id: self.group_id,
}
}
}
}
impl SendChatTopicGroup {
pub fn builder() -> crate::model::send_chat_topic_group::Builder {
crate::model::send_chat_topic_group::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub enum ChatTypingStatus {
Idle(crate::model::Unit),
Typing(crate::model::Unit),
#[non_exhaustive]
Unknown,
}
impl ChatTypingStatus {
pub fn as_idle(&self) -> std::result::Result<&crate::model::Unit, &Self> {
if let ChatTypingStatus::Idle(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_idle(&self) -> bool {
self.as_idle().is_ok()
}
pub fn as_typing(&self) -> std::result::Result<&crate::model::Unit, &Self> {
if let ChatTypingStatus::Typing(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_typing(&self) -> bool {
self.as_typing().is_ok()
}
pub fn is_unknown(&self) -> bool {
matches!(self, Self::Unknown)
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Unit {}
impl std::fmt::Debug for Unit {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Unit");
formatter.finish()
}
}
pub mod unit {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {}
impl Builder {
pub fn build(self) -> crate::model::Unit {
crate::model::Unit {}
}
}
}
impl Unit {
pub fn builder() -> crate::model::unit::Builder {
crate::model::unit::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ChatMessage {
pub chat_message_id: std::option::Option<std::string::String>,
pub thread_id: std::option::Option<std::string::String>,
pub send_ts: std::option::Option<i64>,
pub body: std::option::Option<crate::model::ChatMessageBody>,
}
impl ChatMessage {
pub fn chat_message_id(&self) -> std::option::Option<&str> {
self.chat_message_id.as_deref()
}
pub fn thread_id(&self) -> std::option::Option<&str> {
self.thread_id.as_deref()
}
pub fn send_ts(&self) -> std::option::Option<i64> {
self.send_ts
}
pub fn body(&self) -> std::option::Option<&crate::model::ChatMessageBody> {
self.body.as_ref()
}
}
impl std::fmt::Debug for ChatMessage {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ChatMessage");
formatter.field("chat_message_id", &self.chat_message_id);
formatter.field("thread_id", &self.thread_id);
formatter.field("send_ts", &self.send_ts);
formatter.field("body", &self.body);
formatter.finish()
}
}
pub mod chat_message {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) chat_message_id: std::option::Option<std::string::String>,
pub(crate) thread_id: std::option::Option<std::string::String>,
pub(crate) send_ts: std::option::Option<i64>,
pub(crate) body: std::option::Option<crate::model::ChatMessageBody>,
}
impl Builder {
pub fn chat_message_id(mut self, input: impl Into<std::string::String>) -> Self {
self.chat_message_id = Some(input.into());
self
}
pub fn set_chat_message_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.chat_message_id = input;
self
}
pub fn thread_id(mut self, input: impl Into<std::string::String>) -> Self {
self.thread_id = Some(input.into());
self
}
pub fn set_thread_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.thread_id = input;
self
}
pub fn send_ts(mut self, input: i64) -> Self {
self.send_ts = Some(input);
self
}
pub fn set_send_ts(mut self, input: std::option::Option<i64>) -> Self {
self.send_ts = input;
self
}
pub fn body(mut self, input: crate::model::ChatMessageBody) -> Self {
self.body = Some(input);
self
}
pub fn set_body(
mut self,
input: std::option::Option<crate::model::ChatMessageBody>,
) -> Self {
self.body = input;
self
}
pub fn build(self) -> crate::model::ChatMessage {
crate::model::ChatMessage {
chat_message_id: self.chat_message_id,
thread_id: self.thread_id,
send_ts: self.send_ts,
body: self.body,
}
}
}
}
impl ChatMessage {
pub fn builder() -> crate::model::chat_message::Builder {
crate::model::chat_message::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub enum ChatMessageBody {
ChatCreate(crate::model::ChatMessageBodyChatCreate),
GroupJoin(crate::model::ChatMessageBodyGroupJoin),
GroupLeave(crate::model::ChatMessageBodyGroupLeave),
IdentityFollow(crate::model::ChatMessageBodyIdentityFollow),
PartyActivityChange(crate::model::ChatMessageBodyPartyActivityChange),
PartyInvite(crate::model::ChatMessageBodyPartyInvite),
PartyJoin(crate::model::ChatMessageBodyPartyJoin),
PartyLeave(crate::model::ChatMessageBodyPartyLeave),
Text(crate::model::ChatMessageBodyText),
#[non_exhaustive]
Unknown,
}
impl ChatMessageBody {
pub fn as_chat_create(
&self,
) -> std::result::Result<&crate::model::ChatMessageBodyChatCreate, &Self> {
if let ChatMessageBody::ChatCreate(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_chat_create(&self) -> bool {
self.as_chat_create().is_ok()
}
pub fn as_group_join(
&self,
) -> std::result::Result<&crate::model::ChatMessageBodyGroupJoin, &Self> {
if let ChatMessageBody::GroupJoin(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_group_join(&self) -> bool {
self.as_group_join().is_ok()
}
pub fn as_group_leave(
&self,
) -> std::result::Result<&crate::model::ChatMessageBodyGroupLeave, &Self> {
if let ChatMessageBody::GroupLeave(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_group_leave(&self) -> bool {
self.as_group_leave().is_ok()
}
pub fn as_identity_follow(
&self,
) -> std::result::Result<&crate::model::ChatMessageBodyIdentityFollow, &Self> {
if let ChatMessageBody::IdentityFollow(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_identity_follow(&self) -> bool {
self.as_identity_follow().is_ok()
}
pub fn as_party_activity_change(
&self,
) -> std::result::Result<&crate::model::ChatMessageBodyPartyActivityChange, &Self> {
if let ChatMessageBody::PartyActivityChange(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_party_activity_change(&self) -> bool {
self.as_party_activity_change().is_ok()
}
pub fn as_party_invite(
&self,
) -> std::result::Result<&crate::model::ChatMessageBodyPartyInvite, &Self> {
if let ChatMessageBody::PartyInvite(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_party_invite(&self) -> bool {
self.as_party_invite().is_ok()
}
pub fn as_party_join(
&self,
) -> std::result::Result<&crate::model::ChatMessageBodyPartyJoin, &Self> {
if let ChatMessageBody::PartyJoin(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_party_join(&self) -> bool {
self.as_party_join().is_ok()
}
pub fn as_party_leave(
&self,
) -> std::result::Result<&crate::model::ChatMessageBodyPartyLeave, &Self> {
if let ChatMessageBody::PartyLeave(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_party_leave(&self) -> bool {
self.as_party_leave().is_ok()
}
pub fn as_text(&self) -> std::result::Result<&crate::model::ChatMessageBodyText, &Self> {
if let ChatMessageBody::Text(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_text(&self) -> bool {
self.as_text().is_ok()
}
pub fn is_unknown(&self) -> bool {
matches!(self, Self::Unknown)
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ChatMessageBodyPartyActivityChange {}
impl std::fmt::Debug for ChatMessageBodyPartyActivityChange {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ChatMessageBodyPartyActivityChange");
formatter.finish()
}
}
pub mod chat_message_body_party_activity_change {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {}
impl Builder {
pub fn build(self) -> crate::model::ChatMessageBodyPartyActivityChange {
crate::model::ChatMessageBodyPartyActivityChange {}
}
}
}
impl ChatMessageBodyPartyActivityChange {
pub fn builder() -> crate::model::chat_message_body_party_activity_change::Builder {
crate::model::chat_message_body_party_activity_change::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ChatMessageBodyPartyLeave {
pub identity: std::option::Option<crate::model::IdentityHandle>,
}
impl ChatMessageBodyPartyLeave {
pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
self.identity.as_ref()
}
}
impl std::fmt::Debug for ChatMessageBodyPartyLeave {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ChatMessageBodyPartyLeave");
formatter.field("identity", &self.identity);
formatter.finish()
}
}
pub mod chat_message_body_party_leave {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
}
impl Builder {
pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
self.identity = Some(input);
self
}
pub fn set_identity(
mut self,
input: std::option::Option<crate::model::IdentityHandle>,
) -> Self {
self.identity = input;
self
}
pub fn build(self) -> crate::model::ChatMessageBodyPartyLeave {
crate::model::ChatMessageBodyPartyLeave {
identity: self.identity,
}
}
}
}
impl ChatMessageBodyPartyLeave {
pub fn builder() -> crate::model::chat_message_body_party_leave::Builder {
crate::model::chat_message_body_party_leave::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ChatMessageBodyPartyJoin {
pub identity: std::option::Option<crate::model::IdentityHandle>,
}
impl ChatMessageBodyPartyJoin {
pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
self.identity.as_ref()
}
}
impl std::fmt::Debug for ChatMessageBodyPartyJoin {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ChatMessageBodyPartyJoin");
formatter.field("identity", &self.identity);
formatter.finish()
}
}
pub mod chat_message_body_party_join {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
}
impl Builder {
pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
self.identity = Some(input);
self
}
pub fn set_identity(
mut self,
input: std::option::Option<crate::model::IdentityHandle>,
) -> Self {
self.identity = input;
self
}
pub fn build(self) -> crate::model::ChatMessageBodyPartyJoin {
crate::model::ChatMessageBodyPartyJoin {
identity: self.identity,
}
}
}
}
impl ChatMessageBodyPartyJoin {
pub fn builder() -> crate::model::chat_message_body_party_join::Builder {
crate::model::chat_message_body_party_join::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ChatMessageBodyPartyInvite {
pub sender: std::option::Option<crate::model::IdentityHandle>,
pub party: std::option::Option<crate::model::PartyHandle>,
pub invite_token: std::option::Option<std::string::String>,
}
impl ChatMessageBodyPartyInvite {
pub fn sender(&self) -> std::option::Option<&crate::model::IdentityHandle> {
self.sender.as_ref()
}
pub fn party(&self) -> std::option::Option<&crate::model::PartyHandle> {
self.party.as_ref()
}
pub fn invite_token(&self) -> std::option::Option<&str> {
self.invite_token.as_deref()
}
}
impl std::fmt::Debug for ChatMessageBodyPartyInvite {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ChatMessageBodyPartyInvite");
formatter.field("sender", &self.sender);
formatter.field("party", &self.party);
formatter.field("invite_token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
pub mod chat_message_body_party_invite {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) sender: std::option::Option<crate::model::IdentityHandle>,
pub(crate) party: std::option::Option<crate::model::PartyHandle>,
pub(crate) invite_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn sender(mut self, input: crate::model::IdentityHandle) -> Self {
self.sender = Some(input);
self
}
pub fn set_sender(
mut self,
input: std::option::Option<crate::model::IdentityHandle>,
) -> Self {
self.sender = input;
self
}
pub fn party(mut self, input: crate::model::PartyHandle) -> Self {
self.party = Some(input);
self
}
pub fn set_party(mut self, input: std::option::Option<crate::model::PartyHandle>) -> Self {
self.party = input;
self
}
pub fn invite_token(mut self, input: impl Into<std::string::String>) -> Self {
self.invite_token = Some(input.into());
self
}
pub fn set_invite_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.invite_token = input;
self
}
pub fn build(self) -> crate::model::ChatMessageBodyPartyInvite {
crate::model::ChatMessageBodyPartyInvite {
sender: self.sender,
party: self.party,
invite_token: self.invite_token,
}
}
}
}
impl ChatMessageBodyPartyInvite {
pub fn builder() -> crate::model::chat_message_body_party_invite::Builder {
crate::model::chat_message_body_party_invite::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ChatMessageBodyGroupLeave {
pub identity: std::option::Option<crate::model::IdentityHandle>,
}
impl ChatMessageBodyGroupLeave {
pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
self.identity.as_ref()
}
}
impl std::fmt::Debug for ChatMessageBodyGroupLeave {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ChatMessageBodyGroupLeave");
formatter.field("identity", &self.identity);
formatter.finish()
}
}
pub mod chat_message_body_group_leave {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
}
impl Builder {
pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
self.identity = Some(input);
self
}
pub fn set_identity(
mut self,
input: std::option::Option<crate::model::IdentityHandle>,
) -> Self {
self.identity = input;
self
}
pub fn build(self) -> crate::model::ChatMessageBodyGroupLeave {
crate::model::ChatMessageBodyGroupLeave {
identity: self.identity,
}
}
}
}
impl ChatMessageBodyGroupLeave {
pub fn builder() -> crate::model::chat_message_body_group_leave::Builder {
crate::model::chat_message_body_group_leave::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ChatMessageBodyGroupJoin {
pub identity: std::option::Option<crate::model::IdentityHandle>,
}
impl ChatMessageBodyGroupJoin {
pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
self.identity.as_ref()
}
}
impl std::fmt::Debug for ChatMessageBodyGroupJoin {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ChatMessageBodyGroupJoin");
formatter.field("identity", &self.identity);
formatter.finish()
}
}
pub mod chat_message_body_group_join {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
}
impl Builder {
pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
self.identity = Some(input);
self
}
pub fn set_identity(
mut self,
input: std::option::Option<crate::model::IdentityHandle>,
) -> Self {
self.identity = input;
self
}
pub fn build(self) -> crate::model::ChatMessageBodyGroupJoin {
crate::model::ChatMessageBodyGroupJoin {
identity: self.identity,
}
}
}
}
impl ChatMessageBodyGroupJoin {
pub fn builder() -> crate::model::chat_message_body_group_join::Builder {
crate::model::chat_message_body_group_join::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ChatMessageBodyIdentityFollow {}
impl std::fmt::Debug for ChatMessageBodyIdentityFollow {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ChatMessageBodyIdentityFollow");
formatter.finish()
}
}
pub mod chat_message_body_identity_follow {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {}
impl Builder {
pub fn build(self) -> crate::model::ChatMessageBodyIdentityFollow {
crate::model::ChatMessageBodyIdentityFollow {}
}
}
}
impl ChatMessageBodyIdentityFollow {
pub fn builder() -> crate::model::chat_message_body_identity_follow::Builder {
crate::model::chat_message_body_identity_follow::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ChatMessageBodyChatCreate {}
impl std::fmt::Debug for ChatMessageBodyChatCreate {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ChatMessageBodyChatCreate");
formatter.finish()
}
}
pub mod chat_message_body_chat_create {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {}
impl Builder {
pub fn build(self) -> crate::model::ChatMessageBodyChatCreate {
crate::model::ChatMessageBodyChatCreate {}
}
}
}
impl ChatMessageBodyChatCreate {
pub fn builder() -> crate::model::chat_message_body_chat_create::Builder {
crate::model::chat_message_body_chat_create::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ChatMessageBodyText {
pub sender: std::option::Option<crate::model::IdentityHandle>,
pub body: std::option::Option<std::string::String>,
}
impl ChatMessageBodyText {
pub fn sender(&self) -> std::option::Option<&crate::model::IdentityHandle> {
self.sender.as_ref()
}
pub fn body(&self) -> std::option::Option<&str> {
self.body.as_deref()
}
}
impl std::fmt::Debug for ChatMessageBodyText {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ChatMessageBodyText");
formatter.field("sender", &self.sender);
formatter.field("body", &self.body);
formatter.finish()
}
}
pub mod chat_message_body_text {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) sender: std::option::Option<crate::model::IdentityHandle>,
pub(crate) body: std::option::Option<std::string::String>,
}
impl Builder {
pub fn sender(mut self, input: crate::model::IdentityHandle) -> Self {
self.sender = Some(input);
self
}
pub fn set_sender(
mut self,
input: std::option::Option<crate::model::IdentityHandle>,
) -> Self {
self.sender = input;
self
}
pub fn body(mut self, input: impl Into<std::string::String>) -> Self {
self.body = Some(input.into());
self
}
pub fn set_body(mut self, input: std::option::Option<std::string::String>) -> Self {
self.body = input;
self
}
pub fn build(self) -> crate::model::ChatMessageBodyText {
crate::model::ChatMessageBodyText {
sender: self.sender,
body: self.body,
}
}
}
}
impl ChatMessageBodyText {
pub fn builder() -> crate::model::chat_message_body_text::Builder {
crate::model::chat_message_body_text::Builder::default()
}
}
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum QueryDirection {
After,
Before,
BeforeAndAfter,
Unknown(String),
}
impl std::convert::From<&str> for QueryDirection {
fn from(s: &str) -> Self {
match s {
"after" => QueryDirection::After,
"before" => QueryDirection::Before,
"before_and_after" => QueryDirection::BeforeAndAfter,
other => QueryDirection::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for QueryDirection {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(QueryDirection::from(s))
}
}
impl QueryDirection {
pub fn as_str(&self) -> &str {
match self {
QueryDirection::After => "after",
QueryDirection::Before => "before",
QueryDirection::BeforeAndAfter => "before_and_after",
QueryDirection::Unknown(s) => s.as_ref(),
}
}
pub fn values() -> &'static [&'static str] {
&["after", "before", "before_and_after"]
}
}
impl AsRef<str> for QueryDirection {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct WatchResponse {
pub index: std::option::Option<std::string::String>,
}
impl WatchResponse {
pub fn index(&self) -> std::option::Option<&str> {
self.index.as_deref()
}
}
impl std::fmt::Debug for WatchResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("WatchResponse");
formatter.field("index", &self.index);
formatter.finish()
}
}
pub mod watch_response {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) index: std::option::Option<std::string::String>,
}
impl Builder {
pub fn index(mut self, input: impl Into<std::string::String>) -> Self {
self.index = Some(input.into());
self
}
pub fn set_index(mut self, input: std::option::Option<std::string::String>) -> Self {
self.index = input;
self
}
pub fn build(self) -> crate::model::WatchResponse {
crate::model::WatchResponse { index: self.index }
}
}
}
impl WatchResponse {
pub fn builder() -> crate::model::watch_response::Builder {
crate::model::watch_response::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ChatIdentityTypingStatus {
pub identity: std::option::Option<crate::model::IdentityHandle>,
pub status: std::option::Option<crate::model::ChatTypingStatus>,
}
impl ChatIdentityTypingStatus {
pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
self.identity.as_ref()
}
pub fn status(&self) -> std::option::Option<&crate::model::ChatTypingStatus> {
self.status.as_ref()
}
}
impl std::fmt::Debug for ChatIdentityTypingStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ChatIdentityTypingStatus");
formatter.field("identity", &self.identity);
formatter.field("status", &self.status);
formatter.finish()
}
}
pub mod chat_identity_typing_status {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity: std::option::Option<crate::model::IdentityHandle>,
pub(crate) status: std::option::Option<crate::model::ChatTypingStatus>,
}
impl Builder {
pub fn identity(mut self, input: crate::model::IdentityHandle) -> Self {
self.identity = Some(input);
self
}
pub fn set_identity(
mut self,
input: std::option::Option<crate::model::IdentityHandle>,
) -> Self {
self.identity = input;
self
}
pub fn status(mut self, input: crate::model::ChatTypingStatus) -> Self {
self.status = Some(input);
self
}
pub fn set_status(
mut self,
input: std::option::Option<crate::model::ChatTypingStatus>,
) -> Self {
self.status = input;
self
}
pub fn build(self) -> crate::model::ChatIdentityTypingStatus {
crate::model::ChatIdentityTypingStatus {
identity: self.identity,
status: self.status,
}
}
}
}
impl ChatIdentityTypingStatus {
pub fn builder() -> crate::model::chat_identity_typing_status::Builder {
crate::model::chat_identity_typing_status::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub enum ChatSimpleTopic {
Direct(crate::model::ChatSimpleTopicDirect),
Group(crate::model::ChatSimpleTopicGroup),
Party(crate::model::ChatSimpleTopicParty),
#[non_exhaustive]
Unknown,
}
impl ChatSimpleTopic {
pub fn as_direct(&self) -> std::result::Result<&crate::model::ChatSimpleTopicDirect, &Self> {
if let ChatSimpleTopic::Direct(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_direct(&self) -> bool {
self.as_direct().is_ok()
}
pub fn as_group(&self) -> std::result::Result<&crate::model::ChatSimpleTopicGroup, &Self> {
if let ChatSimpleTopic::Group(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_group(&self) -> bool {
self.as_group().is_ok()
}
pub fn as_party(&self) -> std::result::Result<&crate::model::ChatSimpleTopicParty, &Self> {
if let ChatSimpleTopic::Party(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_party(&self) -> bool {
self.as_party().is_ok()
}
pub fn is_unknown(&self) -> bool {
matches!(self, Self::Unknown)
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ChatSimpleTopicDirect {
pub identity_a_id: std::option::Option<std::string::String>,
pub identity_b_id: std::option::Option<std::string::String>,
}
impl ChatSimpleTopicDirect {
pub fn identity_a_id(&self) -> std::option::Option<&str> {
self.identity_a_id.as_deref()
}
pub fn identity_b_id(&self) -> std::option::Option<&str> {
self.identity_b_id.as_deref()
}
}
impl std::fmt::Debug for ChatSimpleTopicDirect {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ChatSimpleTopicDirect");
formatter.field("identity_a_id", &self.identity_a_id);
formatter.field("identity_b_id", &self.identity_b_id);
formatter.finish()
}
}
pub mod chat_simple_topic_direct {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_a_id: std::option::Option<std::string::String>,
pub(crate) identity_b_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn identity_a_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_a_id = Some(input.into());
self
}
pub fn set_identity_a_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_a_id = input;
self
}
pub fn identity_b_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_b_id = Some(input.into());
self
}
pub fn set_identity_b_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_b_id = input;
self
}
pub fn build(self) -> crate::model::ChatSimpleTopicDirect {
crate::model::ChatSimpleTopicDirect {
identity_a_id: self.identity_a_id,
identity_b_id: self.identity_b_id,
}
}
}
}
impl ChatSimpleTopicDirect {
pub fn builder() -> crate::model::chat_simple_topic_direct::Builder {
crate::model::chat_simple_topic_direct::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ChatSimpleTopicParty {
pub party_id: std::option::Option<std::string::String>,
}
impl ChatSimpleTopicParty {
pub fn party_id(&self) -> std::option::Option<&str> {
self.party_id.as_deref()
}
}
impl std::fmt::Debug for ChatSimpleTopicParty {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ChatSimpleTopicParty");
formatter.field("party_id", &self.party_id);
formatter.finish()
}
}
pub mod chat_simple_topic_party {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) party_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn party_id(mut self, input: impl Into<std::string::String>) -> Self {
self.party_id = Some(input.into());
self
}
pub fn set_party_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.party_id = input;
self
}
pub fn build(self) -> crate::model::ChatSimpleTopicParty {
crate::model::ChatSimpleTopicParty {
party_id: self.party_id,
}
}
}
}
impl ChatSimpleTopicParty {
pub fn builder() -> crate::model::chat_simple_topic_party::Builder {
crate::model::chat_simple_topic_party::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ChatSimpleTopicGroup {
pub group_id: std::option::Option<std::string::String>,
}
impl ChatSimpleTopicGroup {
pub fn group_id(&self) -> std::option::Option<&str> {
self.group_id.as_deref()
}
}
impl std::fmt::Debug for ChatSimpleTopicGroup {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ChatSimpleTopicGroup");
formatter.field("group_id", &self.group_id);
formatter.finish()
}
}
pub mod chat_simple_topic_group {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) group_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn group_id(mut self, input: impl Into<std::string::String>) -> Self {
self.group_id = Some(input.into());
self
}
pub fn set_group_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.group_id = input;
self
}
pub fn build(self) -> crate::model::ChatSimpleTopicGroup {
crate::model::ChatSimpleTopicGroup {
group_id: self.group_id,
}
}
}
}
impl ChatSimpleTopicGroup {
pub fn builder() -> crate::model::chat_simple_topic_group::Builder {
crate::model::chat_simple_topic_group::Builder::default()
}
}