[][src]Struct gog::Gog

pub struct Gog {
    pub token: RefCell<Token>,
    pub client: RefCell<Client>,
    pub client_noredirect: RefCell<Client>,
    pub auto_update: bool,
}

The main GOG Struct that you'll use to make API calls.

Fields

token: RefCell<Token>client: RefCell<Client>client_noredirect: RefCell<Client>auto_update: bool

Methods

impl Gog[src]

pub fn from_login_code(code: &str) -> Gog[src]

Initializes out of a token from a login code

pub fn new(token: Token) -> Gog[src]

Creates using a pre-made token

pub fn uid_string(&self) -> String[src]

pub fn uid(&self) -> i64[src]

pub fn get_user_data(&self) -> Result<UserData>[src]

Gets the data of the user that is currently logged in

pub fn get_pub_info(&self, uid: i64, expand: Vec<String>) -> Result<PubInfo>[src]

Gets any publically available data about a user

pub fn get_games(&self) -> Result<Vec<i64>>[src]

Gets a user's owned games. Only gameids.

pub fn get_game_details(&self, game_id: i64) -> Result<GameDetails>[src]

Gets more info about a game by gameid

pub fn download_game(&self, downloads: Vec<Download>) -> Vec<Result<Response>>[src]

Returns a vec of game parts

pub fn hide_product(&self, game_id: i64) -> EmptyResponse[src]

Hides a product from your library

pub fn reveal_product(&self, game_id: i64) -> EmptyResponse[src]

Reveals a product in your library

pub fn wishlist(&self) -> Result<Wishlist>[src]

Gets the wishlist of the current user

pub fn add_wishlist(&self, game_id: i64) -> Result<Wishlist>[src]

Adds an item to the wishlist. Returns wishlist

pub fn rm_wishlist(&self, game_id: i64) -> Result<Wishlist>[src]

Removes an item from wishlist. Returns wishlist

pub fn save_birthday(&self, bday: &str) -> EmptyResponse[src]

Sets birthday of account. Date should be in ISO 8601 format

pub fn save_country(&self, country: &str) -> EmptyResponse[src]

Sets country of account. Country should be in ISO 3166 format

pub fn save_currency(&self, currency: Currency) -> EmptyResponse[src]

Changes default currency. Currency is in ISO 4217 format. Only currencies supported are ones in the currency enum.

pub fn save_language(&self, language: Language) -> EmptyResponse[src]

Changes default language. Possible languages are available as constants in the langauge enum.

pub fn connect_account(&self, user_id: i64) -> Result<LinkedSteam>[src]

Gets info about the steam account linked to GOG Connect for the user id

pub fn connect_status(&self, user_id: i64) -> Result<ConnectStatus>[src]

Gets claimable status of currently available games on GOG Connect

pub fn connect_scan(&self, user_id: i64) -> EmptyResponse[src]

Scans Connect for claimable games

pub fn connect_claim(&self, user_id: i64) -> EmptyResponse[src]

Claims all available Connect games

pub fn product(
    &self,
    ids: Vec<i64>,
    expand: Vec<String>
) -> Result<Vec<Product>>
[src]

Returns detailed info about a product/products.

pub fn achievements(
    &self,
    product_id: i64,
    user_id: i64
) -> Result<AchievementList>
[src]

Get a list of achievements for a game and user id

pub fn add_tag(&self, product_id: i64, tag_id: i64) -> Result<bool>[src]

Adds tag with tagid to product

pub fn rm_tag(&self, product_id: i64, tag_id: i64) -> Result<bool>[src]

Removes tag with tagid from product

pub fn get_filtered_products(
    &self,
    params: FilterParams
) -> Result<FilteredProducts>
[src]

Fetches info about a set of products owned by the user based on search criteria

pub fn get_all_filtered_products(
    &self,
    params: FilterParams
) -> Result<Vec<ProductDetails>>
[src]

Fetches info about all products matching criteria

pub fn get_products(
    &self,
    params: FilterParams
) -> Result<Vec<UnownedProductDetails>>
[src]

Fetches info about a set of products based on search criteria

pub fn create_tag(&self, name: &str) -> Result<i64>[src]

Creates a new tag. Returns the tag's id

pub fn delete_tag(&self, tag_id: i64) -> Result<bool>[src]

Deletes a tag. Returns bool indicating success

pub fn newsletter_subscription(&self, enabled: bool) -> EmptyResponse[src]

Changes newsletter subscription status

pub fn promo_subscription(&self, enabled: bool) -> EmptyResponse[src]

Changes promo subscription status

pub fn wishlist_subscription(&self, enabled: bool) -> EmptyResponse[src]

Changes wishlist subscription status

pub fn all_subscription(&self, enabled: bool) -> Vec<EmptyResponse>[src]

Shortcut function to enable or disable all subscriptions

pub fn game_ratings(&self) -> Result<Vec<(String, i64)>>[src]

Gets games this user has rated

pub fn voted_reviews(&self) -> Result<Vec<i64>>[src]

Gets reviews the user has voted on

pub fn report_review(&self, review_id: i32) -> Result<bool>[src]

Reports a review

pub fn library_background(&self, bg: ShelfBackground) -> EmptyResponse[src]

Sets library background style

pub fn friends(&self) -> Result<Vec<Friend>>[src]

Returns list of friends

pub fn download_request_range_at<H: Handler>(
    at: impl Into<String>,
    url: impl Into<String>,
    handler: H,
    start: i64,
    end: i64
) -> Result<Easy2<H>>
[src]

Downloadds a file parttally, using only access token instead of the full Gog struct

pub fn download_request_range(
    &self,
    url: impl Into<String>,
    start: i64,
    end: i64
) -> Result<Vec<u8>>
[src]

Downloads a file partially

pub fn extract_data(&self, downloads: Vec<Download>) -> Result<Vec<ZipData>>[src]

Extracts data on downloads

Auto Trait Implementations

impl Send for Gog

impl !Sync for Gog

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err