1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
use crate::EpicGames;
use crate::api::error::EpicAPIError;
use crate::api::types::cloud_save::CloudSaveResponse;
use crate::api::types::presence::PresenceUpdate;
use crate::api::types::service_status::ServiceStatus;
impl EpicGames {
/// Like [`service_status`](Self::service_status), but returns a `Result` instead of swallowing errors.
pub async fn try_service_status(
&self,
service_id: &str,
) -> Result<Vec<ServiceStatus>, EpicAPIError> {
self.egs.service_status(service_id).await
}
/// Fetch service status from Epic's lightswitch API.
///
/// Returns the operational status of an Epic online service (e.g., a game's
/// backend). The response includes whether the service is UP/DOWN, any
/// maintenance message, and whether the current user is banned.
///
/// Returns `None` on API errors.
pub async fn service_status(&self, service_id: &str) -> Option<Vec<ServiceStatus>> {
self.try_service_status(service_id).await.ok()
}
/// Update the user's presence status.
///
/// Sends a PATCH request to update the user's online presence (e.g.,
/// "online", "away") and optionally set an activity with custom properties.
/// The `session_id` is the OAuth session token from login. Returns `Ok(())`
/// on success (204 No Content) or an [`EpicAPIError`] on failure.
pub async fn update_presence(
&self,
session_id: &str,
body: &PresenceUpdate,
) -> Result<(), EpicAPIError> {
self.egs.update_presence(session_id, body).await
}
// ── Cloud Saves ──
/// List cloud save files for the logged-in user.
///
/// If `app_name` is provided, lists saves for that specific game.
/// If `manifests` is true (only relevant when `app_name` is set), lists manifest files.
pub async fn cloud_save_list(
&self,
app_name: Option<&str>,
manifests: bool,
) -> Result<CloudSaveResponse, EpicAPIError> {
self.egs.cloud_save_list(app_name, manifests).await
}
/// Query cloud save files by specific filenames.
///
/// Returns metadata including read/write links for the specified files.
pub async fn cloud_save_query(
&self,
app_name: &str,
filenames: &[String],
) -> Result<CloudSaveResponse, EpicAPIError> {
self.egs.cloud_save_query(app_name, filenames).await
}
/// Delete a cloud save file by its storage path.
pub async fn cloud_save_delete(&self, path: &str) -> Result<(), EpicAPIError> {
self.egs.cloud_save_delete(path).await
}
}