pub struct Client { /* private fields */ }Expand description
HTTP client for the mod.io API.
Implementations§
Source§impl Client
impl Client
Sourcepub const fn get_terms(&self) -> GetTerms<'_>
pub const fn get_terms(&self) -> GetTerms<'_>
Get text and links for user agreement and consent prior to authentication. [required: apikey]
See the mod.io docs for more information.
Sourcepub const fn request_code<'a>(&'a self, email: &'a str) -> EmailRequest<'a>
pub const fn request_code<'a>(&'a self, email: &'a str) -> EmailRequest<'a>
Request a security code be sent to the email of the user. [required: apikey]
Sourcepub const fn request_token<'a>(
&'a self,
security_code: &'a str,
) -> EmailExchange<'a>
pub const fn request_token<'a>( &'a self, security_code: &'a str, ) -> EmailExchange<'a>
Get the access token for a security code. [required: apikey]
Sourcepub const fn external_auth<T: Provider>(
&self,
external: T,
) -> ExternalAuth<'_, T>
pub const fn external_auth<T: Provider>( &self, external: T, ) -> ExternalAuth<'_, T>
Authenticate via external services (Steam, GOG, Switch, Xbox, Discord, Oculus, Google etc.).
See the mod.io docs for more information.
§Examples
use modio::request::auth::external::Steam;
let response = client.external_auth(Steam::new("ticket")).await?;
let token = response.data().await?;
use modio::request::auth::external::PSN;
let response = client.external_auth(PSN::new("auth_code")).env(1).await?;
let token = response.data().await?;
use modio::request::auth::external::Discord;
let response = client
.external_auth(Discord::new("token"))
.email("john@example.com")
.await?;
let token = response.data().await?;Source§impl Client
impl Client
Sourcepub const fn get_game_stats(&self, game_id: GameId) -> GetGameStats<'_>
pub const fn get_game_stats(&self, game_id: GameId) -> GetGameStats<'_>
Return the statistics for a game.
Return the tag options for a game.
Add tags which can applied to mods. [required: token]
Delete an entire group of tags or individual tags. [required: token]
Sourcepub const fn rename_game_tag<'a>(
&'a self,
game_id: GameId,
from: &'a str,
to: &'a str,
) -> RenameGameTag<'a>
pub const fn rename_game_tag<'a>( &'a self, game_id: GameId, from: &'a str, to: &'a str, ) -> RenameGameTag<'a>
Rename an existing tag, updating all mods in the progress. [required: token]
Sourcepub const fn add_game_media(&self, game_id: GameId) -> AddGameMedia<'_>
pub const fn add_game_media(&self, game_id: GameId) -> AddGameMedia<'_>
Add new media to a game. [required: token]
Source§impl Client
impl Client
Sourcepub const fn get_mods(&self, game_id: GameId) -> GetMods<'_>
pub const fn get_mods(&self, game_id: GameId) -> GetMods<'_>
Get all mods for a game.
§Examples
use modio::request::filter::prelude::*;
use modio::request::mods::filters::Name;
use modio::types::id::Id;
let list = client
.get_mods(Id::new(51))
.filter(Name::eq("the-x-com-files"))
.await?
.data()
.await?;Sourcepub const fn get_mod(&self, game_id: GameId, mod_id: ModId) -> GetMod<'_>
pub const fn get_mod(&self, game_id: GameId, mod_id: ModId) -> GetMod<'_>
Get the Modio mod object that this refers to.
Sourcepub fn add_mod<'a>(
&'a self,
game_id: GameId,
name: &'a str,
summary: &'a str,
logo: impl AsRef<Path>,
) -> AddMod<'a>
pub fn add_mod<'a>( &'a self, game_id: GameId, name: &'a str, summary: &'a str, logo: impl AsRef<Path>, ) -> AddMod<'a>
Add a mod and return the newly created Modio mod object. [required: token]
Sourcepub const fn edit_mod(&self, game_id: GameId, mod_id: ModId) -> EditMod<'_>
pub const fn edit_mod(&self, game_id: GameId, mod_id: ModId) -> EditMod<'_>
Edit details for a mod. [required: token]
Sourcepub const fn delete_mod(&self, game_id: GameId, mod_id: ModId) -> DeleteMod<'_>
pub const fn delete_mod(&self, game_id: GameId, mod_id: ModId) -> DeleteMod<'_>
Delete a mod. [required: token]
Sourcepub const fn add_mod_media(
&self,
game_id: GameId,
mod_id: ModId,
) -> AddModMedia<'_>
pub const fn add_mod_media( &self, game_id: GameId, mod_id: ModId, ) -> AddModMedia<'_>
Add new media to a mod. [required: token]
Sourcepub const fn delete_mod_media(
&self,
game_id: GameId,
mod_id: ModId,
) -> DeleteModMedia<'_>
pub const fn delete_mod_media( &self, game_id: GameId, mod_id: ModId, ) -> DeleteModMedia<'_>
Delete media from a mod. [required: token]
Sourcepub const fn reorder_mod_media(
&self,
game_id: GameId,
mod_id: ModId,
) -> ReorderModMedia<'_>
pub const fn reorder_mod_media( &self, game_id: GameId, mod_id: ModId, ) -> ReorderModMedia<'_>
Reorder the media of a mod. [required: token]
Sourcepub const fn subscribe_to_mod(
&self,
game_id: GameId,
mod_id: ModId,
) -> SubscribeToMod<'_>
pub const fn subscribe_to_mod( &self, game_id: GameId, mod_id: ModId, ) -> SubscribeToMod<'_>
Subscribe the authenticated user to a mod. [required: token]
Sourcepub const fn unsubscribe_from_mod(
&self,
game_id: GameId,
mod_id: ModId,
) -> UnsubscribeFromMod<'_>
pub const fn unsubscribe_from_mod( &self, game_id: GameId, mod_id: ModId, ) -> UnsubscribeFromMod<'_>
Unsubscribe the authenticated user from a mod. [required: token]
Sourcepub const fn rate_mod(
&self,
game_id: GameId,
mod_id: ModId,
) -> SubmitModRating<'_>
pub const fn rate_mod( &self, game_id: GameId, mod_id: ModId, ) -> SubmitModRating<'_>
Submit a rating for a mod. [required: token]
Sourcepub const fn get_mod_team_members(
&self,
game_id: GameId,
mod_id: ModId,
) -> GetModTeamMembers<'_>
pub const fn get_mod_team_members( &self, game_id: GameId, mod_id: ModId, ) -> GetModTeamMembers<'_>
Get all users that are part of a mod team.
Source§impl Client
impl Client
Get all tags for a mod.
Add tags to a mod. [required: token]
Delete tags from a mod. [required: token]
Source§impl Client
impl Client
Sourcepub const fn get_mods_events(&self, game_id: GameId) -> GetModsEvents<'_>
pub const fn get_mods_events(&self, game_id: GameId) -> GetModsEvents<'_>
Get all mod events for a game sorted by latest first.
Sourcepub const fn get_mods_stats(&self, game_id: GameId) -> GetModsStats<'_>
pub const fn get_mods_stats(&self, game_id: GameId) -> GetModsStats<'_>
Get all mod statistics for a game.
Sourcepub const fn get_mod_events(
&self,
game_id: GameId,
mod_id: ModId,
) -> GetModEvents<'_>
pub const fn get_mod_events( &self, game_id: GameId, mod_id: ModId, ) -> GetModEvents<'_>
Get the event log for a mod, showing changes made sorted by latest first.
Sourcepub const fn get_mod_stats(
&self,
game_id: GameId,
mod_id: ModId,
) -> GetModStats<'_>
pub const fn get_mod_stats( &self, game_id: GameId, mod_id: ModId, ) -> GetModStats<'_>
Get the statistics for a mod.
Source§impl Client
impl Client
Sourcepub const fn get_mod_metadata(
&self,
game_id: GameId,
mod_id: ModId,
) -> GetModMetadata<'_>
pub const fn get_mod_metadata( &self, game_id: GameId, mod_id: ModId, ) -> GetModMetadata<'_>
Get all metadata key value pairs.
Sourcepub const fn add_mod_metadata(
&self,
game_id: GameId,
mod_id: ModId,
metadata: MetadataMap,
) -> AddModMetadata<'_>
pub const fn add_mod_metadata( &self, game_id: GameId, mod_id: ModId, metadata: MetadataMap, ) -> AddModMetadata<'_>
Add metadata for a mod as key value pairs. [required: token]
Sourcepub const fn delete_mod_metadata(
&self,
game_id: GameId,
mod_id: ModId,
metadata: MetadataMap,
) -> DeleteModMetadata<'_>
pub const fn delete_mod_metadata( &self, game_id: GameId, mod_id: ModId, metadata: MetadataMap, ) -> DeleteModMetadata<'_>
Delete metadata key value pairs for a mod. [required: token]
Source§impl Client
impl Client
Sourcepub const fn get_mod_dependencies(
&self,
game_id: GameId,
mod_id: ModId,
) -> GetModDependencies<'_>
pub const fn get_mod_dependencies( &self, game_id: GameId, mod_id: ModId, ) -> GetModDependencies<'_>
Get all dependencies a mod has selected.
Sourcepub const fn add_mod_dependencies<'a>(
&'a self,
game_id: GameId,
mod_id: ModId,
deps: &'a [ModId],
) -> AddModDependencies<'a>
pub const fn add_mod_dependencies<'a>( &'a self, game_id: GameId, mod_id: ModId, deps: &'a [ModId], ) -> AddModDependencies<'a>
Add mod dependencies required by a mod. [required: token]
Sourcepub const fn delete_mod_dependencies<'a>(
&'a self,
game_id: GameId,
mod_id: ModId,
deps: &'a [ModId],
) -> DeleteModDependencies<'a>
pub const fn delete_mod_dependencies<'a>( &'a self, game_id: GameId, mod_id: ModId, deps: &'a [ModId], ) -> DeleteModDependencies<'a>
Delete mod dependencies a mod requires. [required: token]
Source§impl Client
impl Client
Sourcepub const fn get_mod_comments(
&self,
game_id: GameId,
mod_id: ModId,
) -> GetModComments<'_>
pub const fn get_mod_comments( &self, game_id: GameId, mod_id: ModId, ) -> GetModComments<'_>
Get all comments posted on a mod’s profile.
Sourcepub const fn get_mod_comment(
&self,
game_id: GameId,
mod_id: ModId,
comment_id: CommentId,
) -> GetModComment<'_>
pub const fn get_mod_comment( &self, game_id: GameId, mod_id: ModId, comment_id: CommentId, ) -> GetModComment<'_>
Get a comment posted on a mod’s profile.
Sourcepub const fn add_mod_comment<'a>(
&'a self,
game_id: GameId,
mod_id: ModId,
content: &'a str,
) -> AddModComment<'a>
pub const fn add_mod_comment<'a>( &'a self, game_id: GameId, mod_id: ModId, content: &'a str, ) -> AddModComment<'a>
Add a comment on a mod’s profile. [required: token]
Sourcepub const fn edit_mod_comment<'a>(
&'a self,
game_id: GameId,
mod_id: ModId,
comment_id: CommentId,
content: &'a str,
) -> EditModComment<'a>
pub const fn edit_mod_comment<'a>( &'a self, game_id: GameId, mod_id: ModId, comment_id: CommentId, content: &'a str, ) -> EditModComment<'a>
Edit a comment on a mod’s profile. [required: token]
Sourcepub const fn delete_mod_comment(
&self,
game_id: GameId,
mod_id: ModId,
comment_id: CommentId,
) -> DeleteModComment<'_>
pub const fn delete_mod_comment( &self, game_id: GameId, mod_id: ModId, comment_id: CommentId, ) -> DeleteModComment<'_>
Delete a comment from a mod’s profile. [required: token]
Sourcepub const fn update_mod_comment_karma(
&self,
game_id: GameId,
mod_id: ModId,
comment_id: CommentId,
) -> UpdateModCommentKarma<'_>
pub const fn update_mod_comment_karma( &self, game_id: GameId, mod_id: ModId, comment_id: CommentId, ) -> UpdateModCommentKarma<'_>
Update the karma rating for a comment. [required: token]
Source§impl Client
impl Client
Sourcepub const fn get_files(&self, game_id: GameId, mod_id: ModId) -> GetFiles<'_>
pub const fn get_files(&self, game_id: GameId, mod_id: ModId) -> GetFiles<'_>
Get all files from a mod.
Sourcepub const fn get_file(
&self,
game_id: GameId,
mod_id: ModId,
file_id: FileId,
) -> GetFile<'_>
pub const fn get_file( &self, game_id: GameId, mod_id: ModId, file_id: FileId, ) -> GetFile<'_>
Get a file from a mod.
Sourcepub const fn add_file(&self, game_id: GameId, mod_id: ModId) -> AddFile<'_>
pub const fn add_file(&self, game_id: GameId, mod_id: ModId) -> AddFile<'_>
Add file to a mod. [required: token]
Sourcepub const fn edit_file(
&self,
game_id: GameId,
mod_id: ModId,
file_id: FileId,
) -> EditFile<'_>
pub const fn edit_file( &self, game_id: GameId, mod_id: ModId, file_id: FileId, ) -> EditFile<'_>
Edit the details of a published file. [required: token]
Sourcepub const fn delete_file(
&self,
game_id: GameId,
mod_id: ModId,
file_id: FileId,
) -> DeleteFile<'_>
pub const fn delete_file( &self, game_id: GameId, mod_id: ModId, file_id: FileId, ) -> DeleteFile<'_>
Delete a mod file. [required: token]
Sourcepub const fn manage_platform_status(
&self,
game_id: GameId,
mod_id: ModId,
file_id: FileId,
) -> ManagePlatformStatus<'_>
pub const fn manage_platform_status( &self, game_id: GameId, mod_id: ModId, file_id: FileId, ) -> ManagePlatformStatus<'_>
Manage the platform status of a particular mod file. [required: token]
Source§impl Client
impl Client
Sourcepub const fn get_multipart_upload_sessions(
&self,
game_id: GameId,
mod_id: ModId,
) -> GetMultipartUploadSessions<'_>
pub const fn get_multipart_upload_sessions( &self, game_id: GameId, mod_id: ModId, ) -> GetMultipartUploadSessions<'_>
Get all upload sessions. [required: token]
Sourcepub const fn create_multipart_upload_session<'a>(
&'a self,
game_id: GameId,
mod_id: ModId,
filename: &'a str,
) -> CreateMultipartUploadSession<'a>
pub const fn create_multipart_upload_session<'a>( &'a self, game_id: GameId, mod_id: ModId, filename: &'a str, ) -> CreateMultipartUploadSession<'a>
Create a new multipart upload session. [required: token]
Sourcepub const fn get_multipart_upload_parts(
&self,
game_id: GameId,
mod_id: ModId,
upload_id: UploadId,
) -> GetMultipartUploadParts<'_>
pub const fn get_multipart_upload_parts( &self, game_id: GameId, mod_id: ModId, upload_id: UploadId, ) -> GetMultipartUploadParts<'_>
Get the upload parts of the session. [required: token]
Sourcepub const fn add_multipart_upload_part<S>(
&self,
game_id: GameId,
mod_id: ModId,
upload_id: UploadId,
range: ContentRange,
stream: S,
) -> AddMultipartUploadPart<'_, S>
pub const fn add_multipart_upload_part<S>( &self, game_id: GameId, mod_id: ModId, upload_id: UploadId, range: ContentRange, stream: S, ) -> AddMultipartUploadPart<'_, S>
Add a new part to an existing upload session. [required: token]
Sourcepub const fn complete_multipart_upload_session(
&self,
game_id: GameId,
mod_id: ModId,
upload_id: UploadId,
) -> CompleteMultipartUploadSession<'_>
pub const fn complete_multipart_upload_session( &self, game_id: GameId, mod_id: ModId, upload_id: UploadId, ) -> CompleteMultipartUploadSession<'_>
Complete an active upload session after uploading all parts with
Client::add_multipart_upload_part. [required: token]
Sourcepub const fn delete_multipart_upload_session(
&self,
game_id: GameId,
mod_id: ModId,
upload_id: UploadId,
) -> DeleteMultipartUploadSession<'_>
pub const fn delete_multipart_upload_session( &self, game_id: GameId, mod_id: ModId, upload_id: UploadId, ) -> DeleteMultipartUploadSession<'_>
Terminate an active upload session. [required: token]
Sourcepub const fn add_multipart_upload_file(
&self,
game_id: GameId,
mod_id: ModId,
upload_id: UploadId,
) -> AddMultipartUploadFile<'_>
pub const fn add_multipart_upload_file( &self, game_id: GameId, mod_id: ModId, upload_id: UploadId, ) -> AddMultipartUploadFile<'_>
Finalize the upload with file details. [required: token]
§Example
use modio::types::files::File;
use modio::types::id::Id;
let game_id = Id::new(51);
let mod_id = Id::new(1041);
let UploadSession { id: upload_id, .. } = session;
let file: File = client
.add_multipart_upload_file(game_id, mod_id, upload_id)
.version("1.0")
.active(true)
.await?
.data()
.await?;Source§impl Client
impl Client
Sourcepub const fn get_authenticated_user(&self) -> GetAuthenticatedUser<'_>
pub const fn get_authenticated_user(&self) -> GetAuthenticatedUser<'_>
Get the authenticated user details. [required: token]
Sourcepub const fn get_user_games(&self) -> GetUserGames<'_>
pub const fn get_user_games(&self) -> GetUserGames<'_>
Get all games the authenticated user added or is a team member of. [required: token]
Sourcepub const fn get_user_mods(&self) -> GetUserMods<'_>
pub const fn get_user_mods(&self) -> GetUserMods<'_>
Get all mods the authenticated user added or is a team member of. [required: token]
Sourcepub const fn get_user_files(&self) -> GetUserFiles<'_>
pub const fn get_user_files(&self) -> GetUserFiles<'_>
Get all mod files the authenticated user uploaded. [required: token]
Sourcepub const fn get_user_ratings(&self) -> GetUserRatings<'_>
pub const fn get_user_ratings(&self) -> GetUserRatings<'_>
Get all mod ratings the authenticated user submitted. [required: token]
Sourcepub const fn get_user_subscriptions(&self) -> GetUserSubscriptions<'_>
pub const fn get_user_subscriptions(&self) -> GetUserSubscriptions<'_>
Get all mods the authenticated user is subscribed to. [required: token]
Sourcepub const fn get_user_events(&self) -> GetUserEvents<'_>
pub const fn get_user_events(&self) -> GetUserEvents<'_>
Get events that have been fired specific to the user. [required: token]
Source§impl Client
impl Client
Sourcepub const fn get_muted_users(&self) -> GetMutedUsers<'_>
pub const fn get_muted_users(&self) -> GetMutedUsers<'_>
Get all user muted by the authenticated user. [required: token]
Sourcepub const fn unmute_user(&self, user_id: UserId) -> UnmuteUser<'_>
pub const fn unmute_user(&self, user_id: UserId) -> UnmuteUser<'_>
Unmute a previously muted user. [required: token]
Source§impl Client
impl Client
Sourcepub fn report<'a>(
&'a self,
resource: &'a str,
id: ResourceId,
kind: u8,
summary: &'a str,
) -> SubmitReport<'a>
pub fn report<'a>( &'a self, resource: &'a str, id: ResourceId, kind: u8, summary: &'a str, ) -> SubmitReport<'a>
Report a resource (game, guide, mod or user) on mod.io.
Trait Implementations§
Source§impl Download for Client
impl Download for Client
Source§fn download<A>(&self, action: A) -> Downloader<'_, Init<'_>>where
DownloadAction: From<A>,
fn download<A>(&self, action: A) -> Downloader<'_, Init<'_>>where
DownloadAction: From<A>,
Source§impl MultipartUpload for Client
impl MultipartUpload for Client
Source§fn upload<'a>(
&'a self,
game_id: GameId,
mod_id: ModId,
filename: &'a str,
) -> MultipartUploader<'a, Init<'a>>
fn upload<'a>( &'a self, game_id: GameId, mod_id: ModId, filename: &'a str, ) -> MultipartUploader<'a, Init<'a>>
MultipartUploader for uploading files in multiple parts. Read more