#[cfg(feature = "gas")]
use crate::gas::GasSteamUser;
#[cfg(feature = "remote")]
use crate::remote::RemoteSteamUser;
use crate::{
action::{ActionContext, ApiAction},
client::SteamUser,
error::SteamUserError,
steam_user_api::SteamUserApi,
};
pub struct FallbackSteamUser {
pub local: SteamUser,
#[cfg(feature = "remote")]
pub remote: Option<RemoteSteamUser>,
#[cfg(feature = "gas")]
pub gas: Option<GasSteamUser>,
}
impl FallbackSteamUser {
pub fn new(local: SteamUser) -> Self {
Self {
local,
#[cfg(feature = "remote")]
remote: None,
#[cfg(feature = "gas")]
gas: None,
}
}
#[cfg(feature = "remote")]
pub fn with_remote(mut self, remote: RemoteSteamUser) -> Self {
self.remote = Some(remote);
self
}
#[cfg(feature = "gas")]
pub fn with_gas(mut self, gas: GasSteamUser) -> Self {
self.gas = Some(gas);
self
}
}
for_each_api_method!(gen_fallback_impl);