#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartySummary {
pub party_id: std::option::Option<std::string::String>,
pub create_ts: std::option::Option<aws_smithy_types::DateTime>,
pub activity: std::option::Option<crate::model::PartyActivity>,
pub external: std::option::Option<crate::model::PartyExternalLinks>,
#[allow(missing_docs)] pub publicity: std::option::Option<crate::model::PartyPublicity>,
pub party_size: std::option::Option<i32>,
pub members: std::option::Option<std::vec::Vec<crate::model::PartyMemberSummary>>,
pub thread_id: std::option::Option<std::string::String>,
}
impl PartySummary {
pub fn party_id(&self) -> std::option::Option<&str> {
self.party_id.as_deref()
}
pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.create_ts.as_ref()
}
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()
}
#[allow(missing_docs)] pub fn publicity(&self) -> std::option::Option<&crate::model::PartyPublicity> {
self.publicity.as_ref()
}
pub fn party_size(&self) -> std::option::Option<i32> {
self.party_size
}
pub fn members(&self) -> std::option::Option<&[crate::model::PartyMemberSummary]> {
self.members.as_deref()
}
pub fn thread_id(&self) -> std::option::Option<&str> {
self.thread_id.as_deref()
}
}
impl std::fmt::Debug for PartySummary {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartySummary");
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.field("publicity", &self.publicity);
formatter.field("party_size", &self.party_size);
formatter.field("members", &self.members);
formatter.field("thread_id", &self.thread_id);
formatter.finish()
}
}
pub mod party_summary {
#[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<aws_smithy_types::DateTime>,
pub(crate) activity: std::option::Option<crate::model::PartyActivity>,
pub(crate) external: std::option::Option<crate::model::PartyExternalLinks>,
pub(crate) publicity: std::option::Option<crate::model::PartyPublicity>,
pub(crate) party_size: std::option::Option<i32>,
pub(crate) members: std::option::Option<std::vec::Vec<crate::model::PartyMemberSummary>>,
pub(crate) thread_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 create_ts(mut self, input: aws_smithy_types::DateTime) -> Self {
self.create_ts = Some(input);
self
}
pub fn set_create_ts(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> 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
}
#[allow(missing_docs)] pub fn publicity(mut self, input: crate::model::PartyPublicity) -> Self {
self.publicity = Some(input);
self
}
#[allow(missing_docs)] pub fn set_publicity(
mut self,
input: std::option::Option<crate::model::PartyPublicity>,
) -> Self {
self.publicity = input;
self
}
pub fn party_size(mut self, input: i32) -> Self {
self.party_size = Some(input);
self
}
pub fn set_party_size(mut self, input: std::option::Option<i32>) -> Self {
self.party_size = input;
self
}
pub fn members(mut self, input: crate::model::PartyMemberSummary) -> Self {
let mut v = self.members.unwrap_or_default();
v.push(input);
self.members = Some(v);
self
}
pub fn set_members(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::PartyMemberSummary>>,
) -> Self {
self.members = 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 build(self) -> crate::model::PartySummary {
crate::model::PartySummary {
party_id: self.party_id,
create_ts: self.create_ts,
activity: self.activity,
external: self.external,
publicity: self.publicity,
party_size: self.party_size,
members: self.members,
thread_id: self.thread_id,
}
}
}
}
impl PartySummary {
pub fn builder() -> crate::model::party_summary::Builder {
crate::model::party_summary::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyMemberSummary {
pub identity: std::option::Option<crate::model::IdentityHandle>,
pub is_leader: std::option::Option<bool>,
pub join_ts: std::option::Option<aws_smithy_types::DateTime>,
pub state: std::option::Option<crate::model::PartyMemberState>,
}
impl PartyMemberSummary {
pub fn identity(&self) -> std::option::Option<&crate::model::IdentityHandle> {
self.identity.as_ref()
}
pub fn is_leader(&self) -> std::option::Option<bool> {
self.is_leader
}
pub fn join_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.join_ts.as_ref()
}
pub fn state(&self) -> std::option::Option<&crate::model::PartyMemberState> {
self.state.as_ref()
}
}
impl std::fmt::Debug for PartyMemberSummary {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyMemberSummary");
formatter.field("identity", &self.identity);
formatter.field("is_leader", &self.is_leader);
formatter.field("join_ts", &self.join_ts);
formatter.field("state", &self.state);
formatter.finish()
}
}
pub mod party_member_summary {
#[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) is_leader: std::option::Option<bool>,
pub(crate) join_ts: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) state: std::option::Option<crate::model::PartyMemberState>,
}
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 is_leader(mut self, input: bool) -> Self {
self.is_leader = Some(input);
self
}
pub fn set_is_leader(mut self, input: std::option::Option<bool>) -> Self {
self.is_leader = input;
self
}
pub fn join_ts(mut self, input: aws_smithy_types::DateTime) -> Self {
self.join_ts = Some(input);
self
}
pub fn set_join_ts(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.join_ts = input;
self
}
pub fn state(mut self, input: crate::model::PartyMemberState) -> Self {
self.state = Some(input);
self
}
pub fn set_state(
mut self,
input: std::option::Option<crate::model::PartyMemberState>,
) -> Self {
self.state = input;
self
}
pub fn build(self) -> crate::model::PartyMemberSummary {
crate::model::PartyMemberSummary {
identity: self.identity,
is_leader: self.is_leader,
join_ts: self.join_ts,
state: self.state,
}
}
}
}
impl PartyMemberSummary {
pub fn builder() -> crate::model::party_member_summary::Builder {
crate::model::party_member_summary::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub enum PartyMemberState {
Idle(crate::model::PartyMemberStateIdle),
MatchmakerFindingLobby(crate::model::PartyMemberStateMatchmakerFindingLobby),
MatchmakerLobby(crate::model::PartyMemberStateMatchmakerLobby),
MatchmakerPending(crate::model::PartyMemberStateMatchmakerPending),
#[non_exhaustive]
Unknown,
}
impl PartyMemberState {
pub fn as_idle(&self) -> std::result::Result<&crate::model::PartyMemberStateIdle, &Self> {
if let PartyMemberState::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::PartyMemberStateMatchmakerFindingLobby, &Self> {
if let PartyMemberState::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::PartyMemberStateMatchmakerLobby, &Self> {
if let PartyMemberState::MatchmakerLobby(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_matchmaker_lobby(&self) -> bool {
self.as_matchmaker_lobby().is_ok()
}
pub fn as_matchmaker_pending(
&self,
) -> std::result::Result<&crate::model::PartyMemberStateMatchmakerPending, &Self> {
if let PartyMemberState::MatchmakerPending(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_matchmaker_pending(&self) -> bool {
self.as_matchmaker_pending().is_ok()
}
pub fn is_unknown(&self) -> bool {
matches!(self, Self::Unknown)
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyMemberStateMatchmakerLobby {
pub player_id: std::option::Option<std::string::String>,
}
impl PartyMemberStateMatchmakerLobby {
pub fn player_id(&self) -> std::option::Option<&str> {
self.player_id.as_deref()
}
}
impl std::fmt::Debug for PartyMemberStateMatchmakerLobby {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyMemberStateMatchmakerLobby");
formatter.field("player_id", &self.player_id);
formatter.finish()
}
}
pub mod party_member_state_matchmaker_lobby {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) player_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn player_id(mut self, input: impl Into<std::string::String>) -> Self {
self.player_id = Some(input.into());
self
}
pub fn set_player_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.player_id = input;
self
}
pub fn build(self) -> crate::model::PartyMemberStateMatchmakerLobby {
crate::model::PartyMemberStateMatchmakerLobby {
player_id: self.player_id,
}
}
}
}
impl PartyMemberStateMatchmakerLobby {
pub fn builder() -> crate::model::party_member_state_matchmaker_lobby::Builder {
crate::model::party_member_state_matchmaker_lobby::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyMemberStateMatchmakerFindingLobby {}
impl std::fmt::Debug for PartyMemberStateMatchmakerFindingLobby {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyMemberStateMatchmakerFindingLobby");
formatter.finish()
}
}
pub mod party_member_state_matchmaker_finding_lobby {
#[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::PartyMemberStateMatchmakerFindingLobby {
crate::model::PartyMemberStateMatchmakerFindingLobby {}
}
}
}
impl PartyMemberStateMatchmakerFindingLobby {
pub fn builder() -> crate::model::party_member_state_matchmaker_finding_lobby::Builder {
crate::model::party_member_state_matchmaker_finding_lobby::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyMemberStateMatchmakerPending {}
impl std::fmt::Debug for PartyMemberStateMatchmakerPending {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyMemberStateMatchmakerPending");
formatter.finish()
}
}
pub mod party_member_state_matchmaker_pending {
#[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::PartyMemberStateMatchmakerPending {
crate::model::PartyMemberStateMatchmakerPending {}
}
}
}
impl PartyMemberStateMatchmakerPending {
pub fn builder() -> crate::model::party_member_state_matchmaker_pending::Builder {
crate::model::party_member_state_matchmaker_pending::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyMemberStateIdle {}
impl std::fmt::Debug for PartyMemberStateIdle {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyMemberStateIdle");
formatter.finish()
}
}
pub mod party_member_state_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::PartyMemberStateIdle {
crate::model::PartyMemberStateIdle {}
}
}
}
impl PartyMemberStateIdle {
pub fn builder() -> crate::model::party_member_state_idle::Builder {
crate::model::party_member_state_idle::Builder::default()
}
}
#[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 party: std::option::Option<crate::model::PartyHandle>,
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 party(&self) -> std::option::Option<&crate::model::PartyHandle> {
self.party.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("party", &self.party);
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) party: std::option::Option<crate::model::PartyHandle>,
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 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 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,
party: self.party,
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 PartyHandle {
pub party_id: std::option::Option<std::string::String>,
pub create_ts: std::option::Option<aws_smithy_types::DateTime>,
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<&aws_smithy_types::DateTime> {
self.create_ts.as_ref()
}
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<aws_smithy_types::DateTime>,
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: aws_smithy_types::DateTime) -> Self {
self.create_ts = Some(input);
self
}
pub fn set_create_ts(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> 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 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 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::PartialEq)]
pub struct IdentityPresence {
pub update_ts: std::option::Option<aws_smithy_types::DateTime>,
pub status: std::option::Option<crate::model::IdentityStatus>,
pub game_activity: std::option::Option<crate::model::IdentityGameActivity>,
}
impl IdentityPresence {
pub fn update_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.update_ts.as_ref()
}
pub fn status(&self) -> std::option::Option<&crate::model::IdentityStatus> {
self.status.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("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<aws_smithy_types::DateTime>,
pub(crate) status: std::option::Option<crate::model::IdentityStatus>,
pub(crate) game_activity: std::option::Option<crate::model::IdentityGameActivity>,
}
impl Builder {
pub fn update_ts(mut self, input: aws_smithy_types::DateTime) -> Self {
self.update_ts = Some(input);
self
}
pub fn set_update_ts(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> 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 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,
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 mutual_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 mutual_metadata(&self) -> std::option::Option<&aws_smithy_types::Document> {
self.mutual_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("mutual_metadata", &self.mutual_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) mutual_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 mutual_metadata(mut self, input: aws_smithy_types::Document) -> Self {
self.mutual_metadata = Some(input);
self
}
pub fn set_mutual_metadata(
mut self,
input: std::option::Option<aws_smithy_types::Document>,
) -> Self {
self.mutual_metadata = input;
self
}
pub fn build(self) -> crate::model::IdentityGameActivity {
crate::model::IdentityGameActivity {
game: self.game,
message: self.message,
public_metadata: self.public_metadata,
mutual_metadata: self.mutual_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::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()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyPublicity {
#[allow(missing_docs)] pub public: std::option::Option<crate::model::PartyPublicityLevel>,
#[allow(missing_docs)] pub mutual_followers: std::option::Option<crate::model::PartyPublicityLevel>,
#[allow(missing_docs)] pub groups: std::option::Option<crate::model::PartyPublicityLevel>,
}
impl PartyPublicity {
#[allow(missing_docs)] pub fn public(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> {
self.public.as_ref()
}
#[allow(missing_docs)] pub fn mutual_followers(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> {
self.mutual_followers.as_ref()
}
#[allow(missing_docs)] pub fn groups(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> {
self.groups.as_ref()
}
}
impl std::fmt::Debug for PartyPublicity {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyPublicity");
formatter.field("public", &self.public);
formatter.field("mutual_followers", &self.mutual_followers);
formatter.field("groups", &self.groups);
formatter.finish()
}
}
pub mod party_publicity {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) public: std::option::Option<crate::model::PartyPublicityLevel>,
pub(crate) mutual_followers: std::option::Option<crate::model::PartyPublicityLevel>,
pub(crate) groups: std::option::Option<crate::model::PartyPublicityLevel>,
}
impl Builder {
#[allow(missing_docs)] pub fn public(mut self, input: crate::model::PartyPublicityLevel) -> Self {
self.public = Some(input);
self
}
#[allow(missing_docs)] pub fn set_public(
mut self,
input: std::option::Option<crate::model::PartyPublicityLevel>,
) -> Self {
self.public = input;
self
}
#[allow(missing_docs)] pub fn mutual_followers(mut self, input: crate::model::PartyPublicityLevel) -> Self {
self.mutual_followers = Some(input);
self
}
#[allow(missing_docs)] pub fn set_mutual_followers(
mut self,
input: std::option::Option<crate::model::PartyPublicityLevel>,
) -> Self {
self.mutual_followers = input;
self
}
#[allow(missing_docs)] pub fn groups(mut self, input: crate::model::PartyPublicityLevel) -> Self {
self.groups = Some(input);
self
}
#[allow(missing_docs)] pub fn set_groups(
mut self,
input: std::option::Option<crate::model::PartyPublicityLevel>,
) -> Self {
self.groups = input;
self
}
pub fn build(self) -> crate::model::PartyPublicity {
crate::model::PartyPublicity {
public: self.public,
mutual_followers: self.mutual_followers,
groups: self.groups,
}
}
}
}
impl PartyPublicity {
pub fn builder() -> crate::model::party_publicity::Builder {
crate::model::party_publicity::Builder::default()
}
}
#[allow(missing_docs)] #[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 PartyPublicityLevel {
#[allow(missing_docs)] Join,
#[allow(missing_docs)] None,
#[allow(missing_docs)] View,
Unknown(String),
}
impl std::convert::From<&str> for PartyPublicityLevel {
fn from(s: &str) -> Self {
match s {
"join" => PartyPublicityLevel::Join,
"none" => PartyPublicityLevel::None,
"view" => PartyPublicityLevel::View,
other => PartyPublicityLevel::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for PartyPublicityLevel {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(PartyPublicityLevel::from(s))
}
}
impl PartyPublicityLevel {
pub fn as_str(&self) -> &str {
match self {
PartyPublicityLevel::Join => "join",
PartyPublicityLevel::None => "none",
PartyPublicityLevel::View => "view",
PartyPublicityLevel::Unknown(s) => s.as_ref(),
}
}
pub fn values() -> &'static [&'static str] {
&["join", "none", "view"]
}
}
impl AsRef<str> for PartyPublicityLevel {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub enum JoinPartyInvite {
Alias(std::string::String),
PartyId(std::string::String),
Token(std::string::String),
#[non_exhaustive]
Unknown,
}
impl JoinPartyInvite {
pub fn as_alias(&self) -> std::result::Result<&std::string::String, &Self> {
if let JoinPartyInvite::Alias(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_alias(&self) -> bool {
self.as_alias().is_ok()
}
pub fn as_party_id(&self) -> std::result::Result<&std::string::String, &Self> {
if let JoinPartyInvite::PartyId(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_party_id(&self) -> bool {
self.as_party_id().is_ok()
}
pub fn as_token(&self) -> std::result::Result<&std::string::String, &Self> {
if let JoinPartyInvite::Token(val) = &self {
Ok(val)
} else {
Err(self)
}
}
pub fn is_token(&self) -> bool {
self.as_token().is_ok()
}
pub fn is_unknown(&self) -> bool {
matches!(self, Self::Unknown)
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreatedInvite {
pub token: std::option::Option<std::string::String>,
}
impl CreatedInvite {
pub fn token(&self) -> std::option::Option<&str> {
self.token.as_deref()
}
}
impl std::fmt::Debug for CreatedInvite {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreatedInvite");
formatter.field("token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
pub mod created_invite {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn token(mut self, input: impl Into<std::string::String>) -> Self {
self.token = Some(input.into());
self
}
pub fn set_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.token = input;
self
}
pub fn build(self) -> crate::model::CreatedInvite {
crate::model::CreatedInvite { token: self.token }
}
}
}
impl CreatedInvite {
pub fn builder() -> crate::model::created_invite::Builder {
crate::model::created_invite::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreatePartyInviteConfig {
pub alias: std::option::Option<std::string::String>,
}
impl CreatePartyInviteConfig {
pub fn alias(&self) -> std::option::Option<&str> {
self.alias.as_deref()
}
}
impl std::fmt::Debug for CreatePartyInviteConfig {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreatePartyInviteConfig");
formatter.field("alias", &self.alias);
formatter.finish()
}
}
pub mod create_party_invite_config {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) alias: std::option::Option<std::string::String>,
}
impl Builder {
pub fn alias(mut self, input: impl Into<std::string::String>) -> Self {
self.alias = Some(input.into());
self
}
pub fn set_alias(mut self, input: std::option::Option<std::string::String>) -> Self {
self.alias = input;
self
}
pub fn build(self) -> crate::model::CreatePartyInviteConfig {
crate::model::CreatePartyInviteConfig { alias: self.alias }
}
}
}
impl CreatePartyInviteConfig {
pub fn builder() -> crate::model::create_party_invite_config::Builder {
crate::model::create_party_invite_config::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreatePartyPublicityConfig {
pub public: std::option::Option<crate::model::PartyPublicityLevel>,
pub mutual_followers: std::option::Option<crate::model::PartyPublicityLevel>,
pub groups: std::option::Option<crate::model::PartyPublicityLevel>,
}
impl CreatePartyPublicityConfig {
pub fn public(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> {
self.public.as_ref()
}
pub fn mutual_followers(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> {
self.mutual_followers.as_ref()
}
pub fn groups(&self) -> std::option::Option<&crate::model::PartyPublicityLevel> {
self.groups.as_ref()
}
}
impl std::fmt::Debug for CreatePartyPublicityConfig {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreatePartyPublicityConfig");
formatter.field("public", &self.public);
formatter.field("mutual_followers", &self.mutual_followers);
formatter.field("groups", &self.groups);
formatter.finish()
}
}
pub mod create_party_publicity_config {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) public: std::option::Option<crate::model::PartyPublicityLevel>,
pub(crate) mutual_followers: std::option::Option<crate::model::PartyPublicityLevel>,
pub(crate) groups: std::option::Option<crate::model::PartyPublicityLevel>,
}
impl Builder {
pub fn public(mut self, input: crate::model::PartyPublicityLevel) -> Self {
self.public = Some(input);
self
}
pub fn set_public(
mut self,
input: std::option::Option<crate::model::PartyPublicityLevel>,
) -> Self {
self.public = input;
self
}
pub fn mutual_followers(mut self, input: crate::model::PartyPublicityLevel) -> Self {
self.mutual_followers = Some(input);
self
}
pub fn set_mutual_followers(
mut self,
input: std::option::Option<crate::model::PartyPublicityLevel>,
) -> Self {
self.mutual_followers = input;
self
}
pub fn groups(mut self, input: crate::model::PartyPublicityLevel) -> Self {
self.groups = Some(input);
self
}
pub fn set_groups(
mut self,
input: std::option::Option<crate::model::PartyPublicityLevel>,
) -> Self {
self.groups = input;
self
}
pub fn build(self) -> crate::model::CreatePartyPublicityConfig {
crate::model::CreatePartyPublicityConfig {
public: self.public,
mutual_followers: self.mutual_followers,
groups: self.groups,
}
}
}
}
impl CreatePartyPublicityConfig {
pub fn builder() -> crate::model::create_party_publicity_config::Builder {
crate::model::create_party_publicity_config::Builder::default()
}
}
#[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()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyProfile {
pub party_id: std::option::Option<std::string::String>,
pub create_ts: std::option::Option<aws_smithy_types::DateTime>,
pub activity: std::option::Option<crate::model::PartyActivity>,
pub external: std::option::Option<crate::model::PartyExternalLinks>,
#[allow(missing_docs)] pub publicity: std::option::Option<crate::model::PartyPublicity>,
pub party_size: std::option::Option<i32>,
pub members: std::option::Option<std::vec::Vec<crate::model::PartyMemberSummary>>,
pub thread_id: std::option::Option<std::string::String>,
pub invites: std::option::Option<std::vec::Vec<crate::model::PartyInvite>>,
}
impl PartyProfile {
pub fn party_id(&self) -> std::option::Option<&str> {
self.party_id.as_deref()
}
pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.create_ts.as_ref()
}
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()
}
#[allow(missing_docs)] pub fn publicity(&self) -> std::option::Option<&crate::model::PartyPublicity> {
self.publicity.as_ref()
}
pub fn party_size(&self) -> std::option::Option<i32> {
self.party_size
}
pub fn members(&self) -> std::option::Option<&[crate::model::PartyMemberSummary]> {
self.members.as_deref()
}
pub fn thread_id(&self) -> std::option::Option<&str> {
self.thread_id.as_deref()
}
pub fn invites(&self) -> std::option::Option<&[crate::model::PartyInvite]> {
self.invites.as_deref()
}
}
impl std::fmt::Debug for PartyProfile {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyProfile");
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.field("publicity", &self.publicity);
formatter.field("party_size", &self.party_size);
formatter.field("members", &self.members);
formatter.field("thread_id", &self.thread_id);
formatter.field("invites", &self.invites);
formatter.finish()
}
}
pub mod party_profile {
#[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<aws_smithy_types::DateTime>,
pub(crate) activity: std::option::Option<crate::model::PartyActivity>,
pub(crate) external: std::option::Option<crate::model::PartyExternalLinks>,
pub(crate) publicity: std::option::Option<crate::model::PartyPublicity>,
pub(crate) party_size: std::option::Option<i32>,
pub(crate) members: std::option::Option<std::vec::Vec<crate::model::PartyMemberSummary>>,
pub(crate) thread_id: std::option::Option<std::string::String>,
pub(crate) invites: std::option::Option<std::vec::Vec<crate::model::PartyInvite>>,
}
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: aws_smithy_types::DateTime) -> Self {
self.create_ts = Some(input);
self
}
pub fn set_create_ts(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> 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
}
#[allow(missing_docs)] pub fn publicity(mut self, input: crate::model::PartyPublicity) -> Self {
self.publicity = Some(input);
self
}
#[allow(missing_docs)] pub fn set_publicity(
mut self,
input: std::option::Option<crate::model::PartyPublicity>,
) -> Self {
self.publicity = input;
self
}
pub fn party_size(mut self, input: i32) -> Self {
self.party_size = Some(input);
self
}
pub fn set_party_size(mut self, input: std::option::Option<i32>) -> Self {
self.party_size = input;
self
}
pub fn members(mut self, input: crate::model::PartyMemberSummary) -> Self {
let mut v = self.members.unwrap_or_default();
v.push(input);
self.members = Some(v);
self
}
pub fn set_members(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::PartyMemberSummary>>,
) -> Self {
self.members = 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 invites(mut self, input: crate::model::PartyInvite) -> Self {
let mut v = self.invites.unwrap_or_default();
v.push(input);
self.invites = Some(v);
self
}
pub fn set_invites(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::PartyInvite>>,
) -> Self {
self.invites = input;
self
}
pub fn build(self) -> crate::model::PartyProfile {
crate::model::PartyProfile {
party_id: self.party_id,
create_ts: self.create_ts,
activity: self.activity,
external: self.external,
publicity: self.publicity,
party_size: self.party_size,
members: self.members,
thread_id: self.thread_id,
invites: self.invites,
}
}
}
}
impl PartyProfile {
pub fn builder() -> crate::model::party_profile::Builder {
crate::model::party_profile::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyInvite {
pub invite_id: std::option::Option<std::string::String>,
pub create_ts: std::option::Option<aws_smithy_types::DateTime>,
pub token: std::option::Option<std::string::String>,
pub alias: std::option::Option<crate::model::PartyInviteAlias>,
pub external: std::option::Option<crate::model::PartyInviteExternalLinks>,
}
impl PartyInvite {
pub fn invite_id(&self) -> std::option::Option<&str> {
self.invite_id.as_deref()
}
pub fn create_ts(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.create_ts.as_ref()
}
pub fn token(&self) -> std::option::Option<&str> {
self.token.as_deref()
}
pub fn alias(&self) -> std::option::Option<&crate::model::PartyInviteAlias> {
self.alias.as_ref()
}
pub fn external(&self) -> std::option::Option<&crate::model::PartyInviteExternalLinks> {
self.external.as_ref()
}
}
impl std::fmt::Debug for PartyInvite {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyInvite");
formatter.field("invite_id", &self.invite_id);
formatter.field("create_ts", &self.create_ts);
formatter.field("token", &"*** Sensitive Data Redacted ***");
formatter.field("alias", &self.alias);
formatter.field("external", &self.external);
formatter.finish()
}
}
pub mod party_invite {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) invite_id: std::option::Option<std::string::String>,
pub(crate) create_ts: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) token: std::option::Option<std::string::String>,
pub(crate) alias: std::option::Option<crate::model::PartyInviteAlias>,
pub(crate) external: std::option::Option<crate::model::PartyInviteExternalLinks>,
}
impl Builder {
pub fn invite_id(mut self, input: impl Into<std::string::String>) -> Self {
self.invite_id = Some(input.into());
self
}
pub fn set_invite_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.invite_id = input;
self
}
pub fn create_ts(mut self, input: aws_smithy_types::DateTime) -> Self {
self.create_ts = Some(input);
self
}
pub fn set_create_ts(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.create_ts = input;
self
}
pub fn token(mut self, input: impl Into<std::string::String>) -> Self {
self.token = Some(input.into());
self
}
pub fn set_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.token = input;
self
}
pub fn alias(mut self, input: crate::model::PartyInviteAlias) -> Self {
self.alias = Some(input);
self
}
pub fn set_alias(
mut self,
input: std::option::Option<crate::model::PartyInviteAlias>,
) -> Self {
self.alias = input;
self
}
pub fn external(mut self, input: crate::model::PartyInviteExternalLinks) -> Self {
self.external = Some(input);
self
}
pub fn set_external(
mut self,
input: std::option::Option<crate::model::PartyInviteExternalLinks>,
) -> Self {
self.external = input;
self
}
pub fn build(self) -> crate::model::PartyInvite {
crate::model::PartyInvite {
invite_id: self.invite_id,
create_ts: self.create_ts,
token: self.token,
alias: self.alias,
external: self.external,
}
}
}
}
impl PartyInvite {
pub fn builder() -> crate::model::party_invite::Builder {
crate::model::party_invite::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyInviteExternalLinks {
pub invite: std::option::Option<std::string::String>,
}
impl PartyInviteExternalLinks {
pub fn invite(&self) -> std::option::Option<&str> {
self.invite.as_deref()
}
}
impl std::fmt::Debug for PartyInviteExternalLinks {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyInviteExternalLinks");
formatter.field("invite", &self.invite);
formatter.finish()
}
}
pub mod party_invite_external_links {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) invite: std::option::Option<std::string::String>,
}
impl Builder {
pub fn invite(mut self, input: impl Into<std::string::String>) -> Self {
self.invite = Some(input.into());
self
}
pub fn set_invite(mut self, input: std::option::Option<std::string::String>) -> Self {
self.invite = input;
self
}
pub fn build(self) -> crate::model::PartyInviteExternalLinks {
crate::model::PartyInviteExternalLinks {
invite: self.invite,
}
}
}
}
impl PartyInviteExternalLinks {
pub fn builder() -> crate::model::party_invite_external_links::Builder {
crate::model::party_invite_external_links::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PartyInviteAlias {
pub namespace_id: std::option::Option<std::string::String>,
pub alias: std::option::Option<std::string::String>,
}
impl PartyInviteAlias {
pub fn namespace_id(&self) -> std::option::Option<&str> {
self.namespace_id.as_deref()
}
pub fn alias(&self) -> std::option::Option<&str> {
self.alias.as_deref()
}
}
impl std::fmt::Debug for PartyInviteAlias {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PartyInviteAlias");
formatter.field("namespace_id", &self.namespace_id);
formatter.field("alias", &self.alias);
formatter.finish()
}
}
pub mod party_invite_alias {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) namespace_id: std::option::Option<std::string::String>,
pub(crate) alias: std::option::Option<std::string::String>,
}
impl Builder {
pub fn namespace_id(mut self, input: impl Into<std::string::String>) -> Self {
self.namespace_id = Some(input.into());
self
}
pub fn set_namespace_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.namespace_id = input;
self
}
pub fn alias(mut self, input: impl Into<std::string::String>) -> Self {
self.alias = Some(input.into());
self
}
pub fn set_alias(mut self, input: std::option::Option<std::string::String>) -> Self {
self.alias = input;
self
}
pub fn build(self) -> crate::model::PartyInviteAlias {
crate::model::PartyInviteAlias {
namespace_id: self.namespace_id,
alias: self.alias,
}
}
}
}
impl PartyInviteAlias {
pub fn builder() -> crate::model::party_invite_alias::Builder {
crate::model::party_invite_alias::Builder::default()
}
}