///
/// Copyright (c) 2016 Dropbox, Inc. All rights reserved.
///
/// Auto-generated by Stone, do not modify.
///

import Foundation

/// Routes for the users namespace
open class UsersRoutes {
    public let client: DropboxTransportClient
    init(client: DropboxTransportClient) {
        self.client = client
    }

    /// Get a list of feature values that may be configured for the current account.
    ///
    /// - parameter features: A list of features in UserFeature. If the list is empty, this route will return
    /// UserFeaturesGetValuesBatchError.
    ///
    ///  - returns: Through the response callback, the caller will receive a `Users.UserFeaturesGetValuesBatchResult`
    /// object on success or a `Users.UserFeaturesGetValuesBatchError` object on failure.
    @discardableResult open func featuresGetValues(features: Array<Users.UserFeature>) -> RpcRequest<Users.UserFeaturesGetValuesBatchResultSerializer, Users.UserFeaturesGetValuesBatchErrorSerializer> {
        let route = Users.featuresGetValues
        let serverArgs = Users.UserFeaturesGetValuesBatchArg(features: features)
        return client.request(route, serverArgs: serverArgs)
    }

    /// Get information about a user's account.
    ///
    /// - parameter accountId: A user's account identifier.
    ///
    ///  - returns: Through the response callback, the caller will receive a `Users.BasicAccount` object on success or a
    /// `Users.GetAccountError` object on failure.
    @discardableResult open func getAccount(accountId: String) -> RpcRequest<Users.BasicAccountSerializer, Users.GetAccountErrorSerializer> {
        let route = Users.getAccount
        let serverArgs = Users.GetAccountArg(accountId: accountId)
        return client.request(route, serverArgs: serverArgs)
    }

    /// Get information about multiple user accounts.  At most 300 accounts may be queried per request.
    ///
    /// - parameter accountIds: List of user account identifiers.  Should not contain any duplicate account IDs.
    ///
    ///  - returns: Through the response callback, the caller will receive a `Array<Users.BasicAccount>` object on
    /// success or a `Users.GetAccountBatchError` object on failure.
    @discardableResult open func getAccountBatch(accountIds: Array<String>) -> RpcRequest<ArraySerializer<Users.BasicAccountSerializer>, Users.GetAccountBatchErrorSerializer> {
        let route = Users.getAccountBatch
        let serverArgs = Users.GetAccountBatchArg(accountIds: accountIds)
        return client.request(route, serverArgs: serverArgs)
    }

    /// Get information about the current user's account.
    ///
    ///
    ///  - returns: Through the response callback, the caller will receive a `Users.FullAccount` object on success or a
    /// `Void` object on failure.
    @discardableResult open func getCurrentAccount() -> RpcRequest<Users.FullAccountSerializer, VoidSerializer> {
        let route = Users.getCurrentAccount
        return client.request(route)
    }

    /// Get the space usage information for the current user's account.
    ///
    ///
    ///  - returns: Through the response callback, the caller will receive a `Users.SpaceUsage` object on success or a
    /// `Void` object on failure.
    @discardableResult open func getSpaceUsage() -> RpcRequest<Users.SpaceUsageSerializer, VoidSerializer> {
        let route = Users.getSpaceUsage
        return client.request(route)
    }

}
