namespace py pangramia.yt.admin_ops
namespace java com.pangramia.yt.admin_ops

include "../data/common.thrift"
include "../data/exceptions.thrift"
include "base_service.thrift"

//  Proxy and Account management
service YTAccountsOpService extends base_service.BaseService {

    // AccountPairs                                                
    bool addAccountPair(1: string accountId, 2: string proxyId, 3: string machineId, 4: common.ProxyData proxyData, 5: optional common.AccountData accountData) 
                                            throws (1: exceptions.PBServiceException serviceExp,
                                                    2: exceptions.PBUserException userExp),
                                                    
    common.AccountPairWithState getPair(1: string machineId)
                                            throws (1: exceptions.PBServiceException serviceExp,
                                                    2: exceptions.PBUserException userExp),                                                

    bool pair(1: string accountId, 2: string proxyId, 3:string machineId) 
                                            throws (1: exceptions.PBServiceException serviceExp,
                                                    2: exceptions.PBUserException userExp),

    bool unpair(1: string accountId, 2: string proxyId, 3:string machineId) 
                                            throws (1: exceptions.PBServiceException serviceExp,
                                                    2: exceptions.PBUserException userExp),

    list<common.AccountPairWithState> listAccountPairs(1: optional common.AccountPairState filter) throws (1: exceptions.PBServiceException serviceExp,
                                                                                                           2: exceptions.PBUserException userExp),   

    // ManageAccounts
    bool addAccount(1: string accountId, 2: optional common.AccountData accountData) throws (1: exceptions.PBServiceException serviceExp,
                                                                                             2: exceptions.PBUserException userExp),


    bool suspendAccount(1: string accountId) throws (1: exceptions.PBServiceException serviceExp,
                                                     2: exceptions.PBUserException userExp),

    bool resumeAccount(1: string accountId) throws (1: exceptions.PBServiceException serviceExp,
                                                    2: exceptions.PBUserException userExp),     

    bool removeAccount(1: string accountId) throws (1: exceptions.PBServiceException serviceExp,
                                                    2: exceptions.PBUserException userExp),

    list<string> listActiveAccounts() throws (1: exceptions.PBServiceException serviceExp,    
                                              2: exceptions.PBUserException userExp),  

    // ManageProxy
    bool addProxy(1: string proxyId, 2: common.ProxyData proxyData) throws (1: exceptions.PBServiceException serviceExp,
                                                                            2: exceptions.PBUserException userExp),

    bool suspendProxy(1: string proxyId) throws (1: exceptions.PBServiceException serviceExp,
                                                 2: exceptions.PBUserException userExp),

    bool resumeProxy(1: string proxyId) throws (1: exceptions.PBServiceException serviceExp,
                                                 2: exceptions.PBUserException userExp),

    bool removeProxy(1: string proxyId) throws (1: exceptions.PBServiceException serviceExp,    
                                                 2: exceptions.PBUserException userExp),     

    list<string> listActiveProxies() throws (1: exceptions.PBServiceException serviceExp,    
                                             2: exceptions.PBUserException userExp),  
}
