Subversion Repositories SmartDukaan

Rev

Rev 48 | Rev 130 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package in.shop2020.model.v1.user;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;

public class UserContextService {

  /**
   * service
   */
  public interface Iface {

    public UserContext createContext(UserContext context, boolean updateExisting) throws UserContextException, TException;

    public UserContext getContextFromId(long userId, boolean isSessionId) throws UserContextException, TException;

    public UserContext getContextFromEmailOrHandle(String emailorhandle, boolean isEmail) throws UserContextException, TException;

    public UserState getState(long userId, boolean isSessionId) throws UserContextException, TException;

    public UserPrimaryInfo getPrimaryInfo(long userId, boolean isSessionId) throws UserContextException, TException;

    public UserInternalInfo getInternalInfo(long userId, boolean isSessionId) throws UserContextException, TException;

    public UserContext getContext(String email, String password) throws AuthenticationException, TException;

    public boolean authenticateUser(String handle, String password, boolean isEmail) throws AuthenticationException, TException;

    public boolean userExists(String email) throws UserContextException, TException;

    public boolean addIpAdressForUser(String ip, long timestamp, long userId) throws UserContextException, TException;

    public boolean addAddressForUser(Address address, long userid, long timestamp) throws UserContextException, TException;

    public boolean removeAddressForUser(long userid, long addressId) throws UserContextException, TException;

    public boolean setUserAsLoggedIn(long userId, long timestamp) throws UserContextException, TException;

    public boolean setUserAsLoggedOut(long userid, long timestamp) throws UserContextException, TException;

    public boolean updatePassword(long userid, String password) throws UserContextException, TException;

    public boolean deleteUser(long userid, boolean isSessionId) throws UserContextException, TException;

    public boolean sendEmailVerification(long userid) throws UserContextException, TException;

    public boolean sendSMSVerification(long userid) throws UserContextException, TException;

    public boolean confirmEmailVerification(long userid) throws UserContextException, TException;

    public boolean confirmSMSVerification(long userid) throws UserContextException, TException;

    public boolean addSocialhandle(long userid, String socialService, String handle) throws UserContextException, TException;

  }

  public static class Client implements Iface {
    public Client(TProtocol prot)
    {
      this(prot, prot);
    }

    public Client(TProtocol iprot, TProtocol oprot)
    {
      iprot_ = iprot;
      oprot_ = oprot;
    }

    protected TProtocol iprot_;
    protected TProtocol oprot_;

    protected int seqid_;

    public TProtocol getInputProtocol()
    {
      return this.iprot_;
    }

    public TProtocol getOutputProtocol()
    {
      return this.oprot_;
    }

    public UserContext createContext(UserContext context, boolean updateExisting) throws UserContextException, TException
    {
      send_createContext(context, updateExisting);
      return recv_createContext();
    }

    public void send_createContext(UserContext context, boolean updateExisting) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("createContext", TMessageType.CALL, seqid_));
      createContext_args args = new createContext_args();
      args.context = context;
      args.updateExisting = updateExisting;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public UserContext recv_createContext() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      createContext_result result = new createContext_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cex != null) {
        throw result.cex;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "createContext failed: unknown result");
    }

    public UserContext getContextFromId(long userId, boolean isSessionId) throws UserContextException, TException
    {
      send_getContextFromId(userId, isSessionId);
      return recv_getContextFromId();
    }

    public void send_getContextFromId(long userId, boolean isSessionId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getContextFromId", TMessageType.CALL, seqid_));
      getContextFromId_args args = new getContextFromId_args();
      args.userId = userId;
      args.isSessionId = isSessionId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public UserContext recv_getContextFromId() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getContextFromId_result result = new getContextFromId_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getContextFromId failed: unknown result");
    }

    public UserContext getContextFromEmailOrHandle(String emailorhandle, boolean isEmail) throws UserContextException, TException
    {
      send_getContextFromEmailOrHandle(emailorhandle, isEmail);
      return recv_getContextFromEmailOrHandle();
    }

    public void send_getContextFromEmailOrHandle(String emailorhandle, boolean isEmail) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getContextFromEmailOrHandle", TMessageType.CALL, seqid_));
      getContextFromEmailOrHandle_args args = new getContextFromEmailOrHandle_args();
      args.emailorhandle = emailorhandle;
      args.isEmail = isEmail;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public UserContext recv_getContextFromEmailOrHandle() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getContextFromEmailOrHandle_result result = new getContextFromEmailOrHandle_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getContextFromEmailOrHandle failed: unknown result");
    }

    public UserState getState(long userId, boolean isSessionId) throws UserContextException, TException
    {
      send_getState(userId, isSessionId);
      return recv_getState();
    }

    public void send_getState(long userId, boolean isSessionId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getState", TMessageType.CALL, seqid_));
      getState_args args = new getState_args();
      args.userId = userId;
      args.isSessionId = isSessionId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public UserState recv_getState() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getState_result result = new getState_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getState failed: unknown result");
    }

    public UserPrimaryInfo getPrimaryInfo(long userId, boolean isSessionId) throws UserContextException, TException
    {
      send_getPrimaryInfo(userId, isSessionId);
      return recv_getPrimaryInfo();
    }

    public void send_getPrimaryInfo(long userId, boolean isSessionId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getPrimaryInfo", TMessageType.CALL, seqid_));
      getPrimaryInfo_args args = new getPrimaryInfo_args();
      args.userId = userId;
      args.isSessionId = isSessionId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public UserPrimaryInfo recv_getPrimaryInfo() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getPrimaryInfo_result result = new getPrimaryInfo_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getPrimaryInfo failed: unknown result");
    }

    public UserInternalInfo getInternalInfo(long userId, boolean isSessionId) throws UserContextException, TException
    {
      send_getInternalInfo(userId, isSessionId);
      return recv_getInternalInfo();
    }

    public void send_getInternalInfo(long userId, boolean isSessionId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getInternalInfo", TMessageType.CALL, seqid_));
      getInternalInfo_args args = new getInternalInfo_args();
      args.userId = userId;
      args.isSessionId = isSessionId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public UserInternalInfo recv_getInternalInfo() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getInternalInfo_result result = new getInternalInfo_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getInternalInfo failed: unknown result");
    }

    public UserContext getContext(String email, String password) throws AuthenticationException, TException
    {
      send_getContext(email, password);
      return recv_getContext();
    }

    public void send_getContext(String email, String password) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("getContext", TMessageType.CALL, seqid_));
      getContext_args args = new getContext_args();
      args.email = email;
      args.password = password;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public UserContext recv_getContext() throws AuthenticationException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      getContext_result result = new getContext_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ax != null) {
        throw result.ax;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getContext failed: unknown result");
    }

    public boolean authenticateUser(String handle, String password, boolean isEmail) throws AuthenticationException, TException
    {
      send_authenticateUser(handle, password, isEmail);
      return recv_authenticateUser();
    }

    public void send_authenticateUser(String handle, String password, boolean isEmail) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("authenticateUser", TMessageType.CALL, seqid_));
      authenticateUser_args args = new authenticateUser_args();
      args.handle = handle;
      args.password = password;
      args.isEmail = isEmail;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_authenticateUser() throws AuthenticationException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      authenticateUser_result result = new authenticateUser_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ax != null) {
        throw result.ax;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "authenticateUser failed: unknown result");
    }

    public boolean userExists(String email) throws UserContextException, TException
    {
      send_userExists(email);
      return recv_userExists();
    }

    public void send_userExists(String email) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("userExists", TMessageType.CALL, seqid_));
      userExists_args args = new userExists_args();
      args.email = email;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_userExists() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      userExists_result result = new userExists_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "userExists failed: unknown result");
    }

    public boolean addIpAdressForUser(String ip, long timestamp, long userId) throws UserContextException, TException
    {
      send_addIpAdressForUser(ip, timestamp, userId);
      return recv_addIpAdressForUser();
    }

    public void send_addIpAdressForUser(String ip, long timestamp, long userId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("addIpAdressForUser", TMessageType.CALL, seqid_));
      addIpAdressForUser_args args = new addIpAdressForUser_args();
      args.ip = ip;
      args.timestamp = timestamp;
      args.userId = userId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_addIpAdressForUser() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      addIpAdressForUser_result result = new addIpAdressForUser_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addIpAdressForUser failed: unknown result");
    }

    public boolean addAddressForUser(Address address, long userid, long timestamp) throws UserContextException, TException
    {
      send_addAddressForUser(address, userid, timestamp);
      return recv_addAddressForUser();
    }

    public void send_addAddressForUser(Address address, long userid, long timestamp) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("addAddressForUser", TMessageType.CALL, seqid_));
      addAddressForUser_args args = new addAddressForUser_args();
      args.address = address;
      args.userid = userid;
      args.timestamp = timestamp;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_addAddressForUser() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      addAddressForUser_result result = new addAddressForUser_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addAddressForUser failed: unknown result");
    }

    public boolean removeAddressForUser(long userid, long addressId) throws UserContextException, TException
    {
      send_removeAddressForUser(userid, addressId);
      return recv_removeAddressForUser();
    }

    public void send_removeAddressForUser(long userid, long addressId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("removeAddressForUser", TMessageType.CALL, seqid_));
      removeAddressForUser_args args = new removeAddressForUser_args();
      args.userid = userid;
      args.addressId = addressId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_removeAddressForUser() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      removeAddressForUser_result result = new removeAddressForUser_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "removeAddressForUser failed: unknown result");
    }

    public boolean setUserAsLoggedIn(long userId, long timestamp) throws UserContextException, TException
    {
      send_setUserAsLoggedIn(userId, timestamp);
      return recv_setUserAsLoggedIn();
    }

    public void send_setUserAsLoggedIn(long userId, long timestamp) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("setUserAsLoggedIn", TMessageType.CALL, seqid_));
      setUserAsLoggedIn_args args = new setUserAsLoggedIn_args();
      args.userId = userId;
      args.timestamp = timestamp;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_setUserAsLoggedIn() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      setUserAsLoggedIn_result result = new setUserAsLoggedIn_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "setUserAsLoggedIn failed: unknown result");
    }

    public boolean setUserAsLoggedOut(long userid, long timestamp) throws UserContextException, TException
    {
      send_setUserAsLoggedOut(userid, timestamp);
      return recv_setUserAsLoggedOut();
    }

    public void send_setUserAsLoggedOut(long userid, long timestamp) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("setUserAsLoggedOut", TMessageType.CALL, seqid_));
      setUserAsLoggedOut_args args = new setUserAsLoggedOut_args();
      args.userid = userid;
      args.timestamp = timestamp;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_setUserAsLoggedOut() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      setUserAsLoggedOut_result result = new setUserAsLoggedOut_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "setUserAsLoggedOut failed: unknown result");
    }

    public boolean updatePassword(long userid, String password) throws UserContextException, TException
    {
      send_updatePassword(userid, password);
      return recv_updatePassword();
    }

    public void send_updatePassword(long userid, String password) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("updatePassword", TMessageType.CALL, seqid_));
      updatePassword_args args = new updatePassword_args();
      args.userid = userid;
      args.password = password;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_updatePassword() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      updatePassword_result result = new updatePassword_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "updatePassword failed: unknown result");
    }

    public boolean deleteUser(long userid, boolean isSessionId) throws UserContextException, TException
    {
      send_deleteUser(userid, isSessionId);
      return recv_deleteUser();
    }

    public void send_deleteUser(long userid, boolean isSessionId) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("deleteUser", TMessageType.CALL, seqid_));
      deleteUser_args args = new deleteUser_args();
      args.userid = userid;
      args.isSessionId = isSessionId;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_deleteUser() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      deleteUser_result result = new deleteUser_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "deleteUser failed: unknown result");
    }

    public boolean sendEmailVerification(long userid) throws UserContextException, TException
    {
      send_sendEmailVerification(userid);
      return recv_sendEmailVerification();
    }

    public void send_sendEmailVerification(long userid) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("sendEmailVerification", TMessageType.CALL, seqid_));
      sendEmailVerification_args args = new sendEmailVerification_args();
      args.userid = userid;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_sendEmailVerification() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      sendEmailVerification_result result = new sendEmailVerification_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "sendEmailVerification failed: unknown result");
    }

    public boolean sendSMSVerification(long userid) throws UserContextException, TException
    {
      send_sendSMSVerification(userid);
      return recv_sendSMSVerification();
    }

    public void send_sendSMSVerification(long userid) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("sendSMSVerification", TMessageType.CALL, seqid_));
      sendSMSVerification_args args = new sendSMSVerification_args();
      args.userid = userid;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_sendSMSVerification() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      sendSMSVerification_result result = new sendSMSVerification_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "sendSMSVerification failed: unknown result");
    }

    public boolean confirmEmailVerification(long userid) throws UserContextException, TException
    {
      send_confirmEmailVerification(userid);
      return recv_confirmEmailVerification();
    }

    public void send_confirmEmailVerification(long userid) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("confirmEmailVerification", TMessageType.CALL, seqid_));
      confirmEmailVerification_args args = new confirmEmailVerification_args();
      args.userid = userid;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_confirmEmailVerification() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      confirmEmailVerification_result result = new confirmEmailVerification_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "confirmEmailVerification failed: unknown result");
    }

    public boolean confirmSMSVerification(long userid) throws UserContextException, TException
    {
      send_confirmSMSVerification(userid);
      return recv_confirmSMSVerification();
    }

    public void send_confirmSMSVerification(long userid) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("confirmSMSVerification", TMessageType.CALL, seqid_));
      confirmSMSVerification_args args = new confirmSMSVerification_args();
      args.userid = userid;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_confirmSMSVerification() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      confirmSMSVerification_result result = new confirmSMSVerification_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "confirmSMSVerification failed: unknown result");
    }

    public boolean addSocialhandle(long userid, String socialService, String handle) throws UserContextException, TException
    {
      send_addSocialhandle(userid, socialService, handle);
      return recv_addSocialhandle();
    }

    public void send_addSocialhandle(long userid, String socialService, String handle) throws TException
    {
      oprot_.writeMessageBegin(new TMessage("addSocialhandle", TMessageType.CALL, seqid_));
      addSocialhandle_args args = new addSocialhandle_args();
      args.userid = userid;
      args.socialService = socialService;
      args.handle = handle;
      args.write(oprot_);
      oprot_.writeMessageEnd();
      oprot_.getTransport().flush();
    }

    public boolean recv_addSocialhandle() throws UserContextException, TException
    {
      TMessage msg = iprot_.readMessageBegin();
      if (msg.type == TMessageType.EXCEPTION) {
        TApplicationException x = TApplicationException.read(iprot_);
        iprot_.readMessageEnd();
        throw x;
      }
      addSocialhandle_result result = new addSocialhandle_result();
      result.read(iprot_);
      iprot_.readMessageEnd();
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ucx != null) {
        throw result.ucx;
      }
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addSocialhandle failed: unknown result");
    }

  }
  public static class Processor implements TProcessor {
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
    public Processor(Iface iface)
    {
      iface_ = iface;
      processMap_.put("createContext", new createContext());
      processMap_.put("getContextFromId", new getContextFromId());
      processMap_.put("getContextFromEmailOrHandle", new getContextFromEmailOrHandle());
      processMap_.put("getState", new getState());
      processMap_.put("getPrimaryInfo", new getPrimaryInfo());
      processMap_.put("getInternalInfo", new getInternalInfo());
      processMap_.put("getContext", new getContext());
      processMap_.put("authenticateUser", new authenticateUser());
      processMap_.put("userExists", new userExists());
      processMap_.put("addIpAdressForUser", new addIpAdressForUser());
      processMap_.put("addAddressForUser", new addAddressForUser());
      processMap_.put("removeAddressForUser", new removeAddressForUser());
      processMap_.put("setUserAsLoggedIn", new setUserAsLoggedIn());
      processMap_.put("setUserAsLoggedOut", new setUserAsLoggedOut());
      processMap_.put("updatePassword", new updatePassword());
      processMap_.put("deleteUser", new deleteUser());
      processMap_.put("sendEmailVerification", new sendEmailVerification());
      processMap_.put("sendSMSVerification", new sendSMSVerification());
      processMap_.put("confirmEmailVerification", new confirmEmailVerification());
      processMap_.put("confirmSMSVerification", new confirmSMSVerification());
      processMap_.put("addSocialhandle", new addSocialhandle());
    }

    protected static interface ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
    }

    private Iface iface_;
    protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>();

    public boolean process(TProtocol iprot, TProtocol oprot) throws TException
    {
      TMessage msg = iprot.readMessageBegin();
      ProcessFunction fn = processMap_.get(msg.name);
      if (fn == null) {
        TProtocolUtil.skip(iprot, TType.STRUCT);
        iprot.readMessageEnd();
        TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'");
        oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));
        x.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
        return true;
      }
      fn.process(msg.seqid, iprot, oprot);
      return true;
    }

    private class createContext implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        createContext_args args = new createContext_args();
        args.read(iprot);
        iprot.readMessageEnd();
        createContext_result result = new createContext_result();
        try {
          result.success = iface_.createContext(args.context, args.updateExisting);
        } catch (UserContextException cex) {
          result.cex = cex;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing createContext", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing createContext");
          oprot.writeMessageBegin(new TMessage("createContext", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("createContext", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getContextFromId implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getContextFromId_args args = new getContextFromId_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getContextFromId_result result = new getContextFromId_result();
        try {
          result.success = iface_.getContextFromId(args.userId, args.isSessionId);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getContextFromId", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getContextFromId");
          oprot.writeMessageBegin(new TMessage("getContextFromId", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getContextFromId", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getContextFromEmailOrHandle implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getContextFromEmailOrHandle_args args = new getContextFromEmailOrHandle_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getContextFromEmailOrHandle_result result = new getContextFromEmailOrHandle_result();
        try {
          result.success = iface_.getContextFromEmailOrHandle(args.emailorhandle, args.isEmail);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getContextFromEmailOrHandle", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getContextFromEmailOrHandle");
          oprot.writeMessageBegin(new TMessage("getContextFromEmailOrHandle", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getContextFromEmailOrHandle", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getState implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getState_args args = new getState_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getState_result result = new getState_result();
        try {
          result.success = iface_.getState(args.userId, args.isSessionId);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getState", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getState");
          oprot.writeMessageBegin(new TMessage("getState", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getState", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getPrimaryInfo implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getPrimaryInfo_args args = new getPrimaryInfo_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getPrimaryInfo_result result = new getPrimaryInfo_result();
        try {
          result.success = iface_.getPrimaryInfo(args.userId, args.isSessionId);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getPrimaryInfo", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getPrimaryInfo");
          oprot.writeMessageBegin(new TMessage("getPrimaryInfo", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getPrimaryInfo", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getInternalInfo implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getInternalInfo_args args = new getInternalInfo_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getInternalInfo_result result = new getInternalInfo_result();
        try {
          result.success = iface_.getInternalInfo(args.userId, args.isSessionId);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getInternalInfo", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getInternalInfo");
          oprot.writeMessageBegin(new TMessage("getInternalInfo", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getInternalInfo", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class getContext implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        getContext_args args = new getContext_args();
        args.read(iprot);
        iprot.readMessageEnd();
        getContext_result result = new getContext_result();
        try {
          result.success = iface_.getContext(args.email, args.password);
        } catch (AuthenticationException ax) {
          result.ax = ax;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing getContext", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getContext");
          oprot.writeMessageBegin(new TMessage("getContext", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("getContext", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class authenticateUser implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        authenticateUser_args args = new authenticateUser_args();
        args.read(iprot);
        iprot.readMessageEnd();
        authenticateUser_result result = new authenticateUser_result();
        try {
          result.success = iface_.authenticateUser(args.handle, args.password, args.isEmail);
          result.setSuccessIsSet(true);
        } catch (AuthenticationException ax) {
          result.ax = ax;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing authenticateUser", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing authenticateUser");
          oprot.writeMessageBegin(new TMessage("authenticateUser", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("authenticateUser", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class userExists implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        userExists_args args = new userExists_args();
        args.read(iprot);
        iprot.readMessageEnd();
        userExists_result result = new userExists_result();
        try {
          result.success = iface_.userExists(args.email);
          result.setSuccessIsSet(true);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing userExists", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing userExists");
          oprot.writeMessageBegin(new TMessage("userExists", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("userExists", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class addIpAdressForUser implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        addIpAdressForUser_args args = new addIpAdressForUser_args();
        args.read(iprot);
        iprot.readMessageEnd();
        addIpAdressForUser_result result = new addIpAdressForUser_result();
        try {
          result.success = iface_.addIpAdressForUser(args.ip, args.timestamp, args.userId);
          result.setSuccessIsSet(true);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing addIpAdressForUser", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addIpAdressForUser");
          oprot.writeMessageBegin(new TMessage("addIpAdressForUser", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("addIpAdressForUser", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class addAddressForUser implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        addAddressForUser_args args = new addAddressForUser_args();
        args.read(iprot);
        iprot.readMessageEnd();
        addAddressForUser_result result = new addAddressForUser_result();
        try {
          result.success = iface_.addAddressForUser(args.address, args.userid, args.timestamp);
          result.setSuccessIsSet(true);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing addAddressForUser", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addAddressForUser");
          oprot.writeMessageBegin(new TMessage("addAddressForUser", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("addAddressForUser", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class removeAddressForUser implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        removeAddressForUser_args args = new removeAddressForUser_args();
        args.read(iprot);
        iprot.readMessageEnd();
        removeAddressForUser_result result = new removeAddressForUser_result();
        try {
          result.success = iface_.removeAddressForUser(args.userid, args.addressId);
          result.setSuccessIsSet(true);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing removeAddressForUser", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing removeAddressForUser");
          oprot.writeMessageBegin(new TMessage("removeAddressForUser", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("removeAddressForUser", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class setUserAsLoggedIn implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        setUserAsLoggedIn_args args = new setUserAsLoggedIn_args();
        args.read(iprot);
        iprot.readMessageEnd();
        setUserAsLoggedIn_result result = new setUserAsLoggedIn_result();
        try {
          result.success = iface_.setUserAsLoggedIn(args.userId, args.timestamp);
          result.setSuccessIsSet(true);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing setUserAsLoggedIn", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing setUserAsLoggedIn");
          oprot.writeMessageBegin(new TMessage("setUserAsLoggedIn", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("setUserAsLoggedIn", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class setUserAsLoggedOut implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        setUserAsLoggedOut_args args = new setUserAsLoggedOut_args();
        args.read(iprot);
        iprot.readMessageEnd();
        setUserAsLoggedOut_result result = new setUserAsLoggedOut_result();
        try {
          result.success = iface_.setUserAsLoggedOut(args.userid, args.timestamp);
          result.setSuccessIsSet(true);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing setUserAsLoggedOut", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing setUserAsLoggedOut");
          oprot.writeMessageBegin(new TMessage("setUserAsLoggedOut", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("setUserAsLoggedOut", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class updatePassword implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        updatePassword_args args = new updatePassword_args();
        args.read(iprot);
        iprot.readMessageEnd();
        updatePassword_result result = new updatePassword_result();
        try {
          result.success = iface_.updatePassword(args.userid, args.password);
          result.setSuccessIsSet(true);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing updatePassword", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing updatePassword");
          oprot.writeMessageBegin(new TMessage("updatePassword", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("updatePassword", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class deleteUser implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        deleteUser_args args = new deleteUser_args();
        args.read(iprot);
        iprot.readMessageEnd();
        deleteUser_result result = new deleteUser_result();
        try {
          result.success = iface_.deleteUser(args.userid, args.isSessionId);
          result.setSuccessIsSet(true);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing deleteUser", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing deleteUser");
          oprot.writeMessageBegin(new TMessage("deleteUser", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("deleteUser", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class sendEmailVerification implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        sendEmailVerification_args args = new sendEmailVerification_args();
        args.read(iprot);
        iprot.readMessageEnd();
        sendEmailVerification_result result = new sendEmailVerification_result();
        try {
          result.success = iface_.sendEmailVerification(args.userid);
          result.setSuccessIsSet(true);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing sendEmailVerification", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing sendEmailVerification");
          oprot.writeMessageBegin(new TMessage("sendEmailVerification", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("sendEmailVerification", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class sendSMSVerification implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        sendSMSVerification_args args = new sendSMSVerification_args();
        args.read(iprot);
        iprot.readMessageEnd();
        sendSMSVerification_result result = new sendSMSVerification_result();
        try {
          result.success = iface_.sendSMSVerification(args.userid);
          result.setSuccessIsSet(true);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing sendSMSVerification", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing sendSMSVerification");
          oprot.writeMessageBegin(new TMessage("sendSMSVerification", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("sendSMSVerification", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class confirmEmailVerification implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        confirmEmailVerification_args args = new confirmEmailVerification_args();
        args.read(iprot);
        iprot.readMessageEnd();
        confirmEmailVerification_result result = new confirmEmailVerification_result();
        try {
          result.success = iface_.confirmEmailVerification(args.userid);
          result.setSuccessIsSet(true);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing confirmEmailVerification", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing confirmEmailVerification");
          oprot.writeMessageBegin(new TMessage("confirmEmailVerification", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("confirmEmailVerification", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class confirmSMSVerification implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        confirmSMSVerification_args args = new confirmSMSVerification_args();
        args.read(iprot);
        iprot.readMessageEnd();
        confirmSMSVerification_result result = new confirmSMSVerification_result();
        try {
          result.success = iface_.confirmSMSVerification(args.userid);
          result.setSuccessIsSet(true);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing confirmSMSVerification", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing confirmSMSVerification");
          oprot.writeMessageBegin(new TMessage("confirmSMSVerification", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("confirmSMSVerification", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

    private class addSocialhandle implements ProcessFunction {
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
      {
        addSocialhandle_args args = new addSocialhandle_args();
        args.read(iprot);
        iprot.readMessageEnd();
        addSocialhandle_result result = new addSocialhandle_result();
        try {
          result.success = iface_.addSocialhandle(args.userid, args.socialService, args.handle);
          result.setSuccessIsSet(true);
        } catch (UserContextException ucx) {
          result.ucx = ucx;
        } catch (Throwable th) {
          LOGGER.error("Internal error processing addSocialhandle", th);
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addSocialhandle");
          oprot.writeMessageBegin(new TMessage("addSocialhandle", TMessageType.EXCEPTION, seqid));
          x.write(oprot);
          oprot.writeMessageEnd();
          oprot.getTransport().flush();
          return;
        }
        oprot.writeMessageBegin(new TMessage("addSocialhandle", TMessageType.REPLY, seqid));
        result.write(oprot);
        oprot.writeMessageEnd();
        oprot.getTransport().flush();
      }

    }

  }

  public static class createContext_args implements TBase<createContext_args._Fields>, java.io.Serializable, Cloneable   {
    private static final TStruct STRUCT_DESC = new TStruct("createContext_args");

    private static final TField CONTEXT_FIELD_DESC = new TField("context", TType.STRUCT, (short)1);
    private static final TField UPDATE_EXISTING_FIELD_DESC = new TField("updateExisting", TType.BOOL, (short)2);

    private UserContext context;
    private boolean updateExisting;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      CONTEXT((short)1, "context"),
      UPDATE_EXISTING((short)2, "updateExisting");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __UPDATEEXISTING_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.CONTEXT, new FieldMetaData("context", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, UserContext.class)));
      put(_Fields.UPDATE_EXISTING, new FieldMetaData("updateExisting", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(createContext_args.class, metaDataMap);
    }

    public createContext_args() {
    }

    public createContext_args(
      UserContext context,
      boolean updateExisting)
    {
      this();
      this.context = context;
      this.updateExisting = updateExisting;
      setUpdateExistingIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createContext_args(createContext_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetContext()) {
        this.context = new UserContext(other.context);
      }
      this.updateExisting = other.updateExisting;
    }

    public createContext_args deepCopy() {
      return new createContext_args(this);
    }

    @Deprecated
    public createContext_args clone() {
      return new createContext_args(this);
    }

    public UserContext getContext() {
      return this.context;
    }

    public createContext_args setContext(UserContext context) {
      this.context = context;
      return this;
    }

    public void unsetContext() {
      this.context = null;
    }

    /** Returns true if field context is set (has been asigned a value) and false otherwise */
    public boolean isSetContext() {
      return this.context != null;
    }

    public void setContextIsSet(boolean value) {
      if (!value) {
        this.context = null;
      }
    }

    public boolean isUpdateExisting() {
      return this.updateExisting;
    }

    public createContext_args setUpdateExisting(boolean updateExisting) {
      this.updateExisting = updateExisting;
      setUpdateExistingIsSet(true);
      return this;
    }

    public void unsetUpdateExisting() {
      __isset_bit_vector.clear(__UPDATEEXISTING_ISSET_ID);
    }

    /** Returns true if field updateExisting is set (has been asigned a value) and false otherwise */
    public boolean isSetUpdateExisting() {
      return __isset_bit_vector.get(__UPDATEEXISTING_ISSET_ID);
    }

    public void setUpdateExistingIsSet(boolean value) {
      __isset_bit_vector.set(__UPDATEEXISTING_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONTEXT:
        if (value == null) {
          unsetContext();
        } else {
          setContext((UserContext)value);
        }
        break;

      case UPDATE_EXISTING:
        if (value == null) {
          unsetUpdateExisting();
        } else {
          setUpdateExisting((Boolean)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONTEXT:
        return getContext();

      case UPDATE_EXISTING:
        return new Boolean(isUpdateExisting());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case CONTEXT:
        return isSetContext();
      case UPDATE_EXISTING:
        return isSetUpdateExisting();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof createContext_args)
        return this.equals((createContext_args)that);
      return false;
    }

    public boolean equals(createContext_args that) {
      if (that == null)
        return false;

      boolean this_present_context = true && this.isSetContext();
      boolean that_present_context = true && that.isSetContext();
      if (this_present_context || that_present_context) {
        if (!(this_present_context && that_present_context))
          return false;
        if (!this.context.equals(that.context))
          return false;
      }

      boolean this_present_updateExisting = true;
      boolean that_present_updateExisting = true;
      if (this_present_updateExisting || that_present_updateExisting) {
        if (!(this_present_updateExisting && that_present_updateExisting))
          return false;
        if (this.updateExisting != that.updateExisting)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case CONTEXT:
              if (field.type == TType.STRUCT) {
                this.context = new UserContext();
                this.context.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UPDATE_EXISTING:
              if (field.type == TType.BOOL) {
                this.updateExisting = iprot.readBool();
                setUpdateExistingIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.context != null) {
        oprot.writeFieldBegin(CONTEXT_FIELD_DESC);
        this.context.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(UPDATE_EXISTING_FIELD_DESC);
      oprot.writeBool(this.updateExisting);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createContext_args(");
      boolean first = true;

      sb.append("context:");
      if (this.context == null) {
        sb.append("null");
      } else {
        sb.append(this.context);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("updateExisting:");
      sb.append(this.updateExisting);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class createContext_result implements TBase<createContext_result._Fields>, java.io.Serializable, Cloneable   {
    private static final TStruct STRUCT_DESC = new TStruct("createContext_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField CEX_FIELD_DESC = new TField("cex", TType.STRUCT, (short)1);

    private UserContext success;
    private UserContextException cex;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CEX((short)1, "cex");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, UserContext.class)));
      put(_Fields.CEX, new FieldMetaData("cex", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(createContext_result.class, metaDataMap);
    }

    public createContext_result() {
    }

    public createContext_result(
      UserContext success,
      UserContextException cex)
    {
      this();
      this.success = success;
      this.cex = cex;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createContext_result(createContext_result other) {
      if (other.isSetSuccess()) {
        this.success = new UserContext(other.success);
      }
      if (other.isSetCex()) {
        this.cex = new UserContextException(other.cex);
      }
    }

    public createContext_result deepCopy() {
      return new createContext_result(this);
    }

    @Deprecated
    public createContext_result clone() {
      return new createContext_result(this);
    }

    public UserContext getSuccess() {
      return this.success;
    }

    public createContext_result setSuccess(UserContext success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public UserContextException getCex() {
      return this.cex;
    }

    public createContext_result setCex(UserContextException cex) {
      this.cex = cex;
      return this;
    }

    public void unsetCex() {
      this.cex = null;
    }

    /** Returns true if field cex is set (has been asigned a value) and false otherwise */
    public boolean isSetCex() {
      return this.cex != null;
    }

    public void setCexIsSet(boolean value) {
      if (!value) {
        this.cex = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((UserContext)value);
        }
        break;

      case CEX:
        if (value == null) {
          unsetCex();
        } else {
          setCex((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CEX:
        return getCex();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CEX:
        return isSetCex();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof createContext_result)
        return this.equals((createContext_result)that);
      return false;
    }

    public boolean equals(createContext_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cex = true && this.isSetCex();
      boolean that_present_cex = true && that.isSetCex();
      if (this_present_cex || that_present_cex) {
        if (!(this_present_cex && that_present_cex))
          return false;
        if (!this.cex.equals(that.cex))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new UserContext();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case CEX:
              if (field.type == TType.STRUCT) {
                this.cex = new UserContextException();
                this.cex.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetCex()) {
        oprot.writeFieldBegin(CEX_FIELD_DESC);
        this.cex.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createContext_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cex:");
      if (this.cex == null) {
        sb.append("null");
      } else {
        sb.append(this.cex);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getContextFromId_args implements TBase<getContextFromId_args._Fields>, java.io.Serializable, Cloneable, Comparable<getContextFromId_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getContextFromId_args");

    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
    private static final TField IS_SESSION_ID_FIELD_DESC = new TField("isSessionId", TType.BOOL, (short)2);

    private long userId;
    private boolean isSessionId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USER_ID((short)1, "userId"),
      IS_SESSION_ID((short)2, "isSessionId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private static final int __ISSESSIONID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.IS_SESSION_ID, new FieldMetaData("isSessionId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getContextFromId_args.class, metaDataMap);
    }

    public getContextFromId_args() {
    }

    public getContextFromId_args(
      long userId,
      boolean isSessionId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.isSessionId = isSessionId;
      setIsSessionIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getContextFromId_args(getContextFromId_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userId = other.userId;
      this.isSessionId = other.isSessionId;
    }

    public getContextFromId_args deepCopy() {
      return new getContextFromId_args(this);
    }

    @Deprecated
    public getContextFromId_args clone() {
      return new getContextFromId_args(this);
    }

    public long getUserId() {
      return this.userId;
    }

    public getContextFromId_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
    public boolean isSetUserId() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public boolean isIsSessionId() {
      return this.isSessionId;
    }

    public getContextFromId_args setIsSessionId(boolean isSessionId) {
      this.isSessionId = isSessionId;
      setIsSessionIdIsSet(true);
      return this;
    }

    public void unsetIsSessionId() {
      __isset_bit_vector.clear(__ISSESSIONID_ISSET_ID);
    }

    /** Returns true if field isSessionId is set (has been asigned a value) and false otherwise */
    public boolean isSetIsSessionId() {
      return __isset_bit_vector.get(__ISSESSIONID_ISSET_ID);
    }

    public void setIsSessionIdIsSet(boolean value) {
      __isset_bit_vector.set(__ISSESSIONID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      case IS_SESSION_ID:
        if (value == null) {
          unsetIsSessionId();
        } else {
          setIsSessionId((Boolean)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      case IS_SESSION_ID:
        return new Boolean(isIsSessionId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case USER_ID:
        return isSetUserId();
      case IS_SESSION_ID:
        return isSetIsSessionId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getContextFromId_args)
        return this.equals((getContextFromId_args)that);
      return false;
    }

    public boolean equals(getContextFromId_args that) {
      if (that == null)
        return false;

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      boolean this_present_isSessionId = true;
      boolean that_present_isSessionId = true;
      if (this_present_isSessionId || that_present_isSessionId) {
        if (!(this_present_isSessionId && that_present_isSessionId))
          return false;
        if (this.isSessionId != that.isSessionId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getContextFromId_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getContextFromId_args typedOther = (getContextFromId_args)other;

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetIsSessionId()).compareTo(isSetIsSessionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(isSessionId, typedOther.isSessionId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case IS_SESSION_ID:
              if (field.type == TType.BOOL) {
                this.isSessionId = iprot.readBool();
                setIsSessionIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(IS_SESSION_ID_FIELD_DESC);
      oprot.writeBool(this.isSessionId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getContextFromId_args(");
      boolean first = true;

      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("isSessionId:");
      sb.append(this.isSessionId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getContextFromId_result implements TBase<getContextFromId_result._Fields>, java.io.Serializable, Cloneable   {
    private static final TStruct STRUCT_DESC = new TStruct("getContextFromId_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private UserContext success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, UserContext.class)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getContextFromId_result.class, metaDataMap);
    }

    public getContextFromId_result() {
    }

    public getContextFromId_result(
      UserContext success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getContextFromId_result(getContextFromId_result other) {
      if (other.isSetSuccess()) {
        this.success = new UserContext(other.success);
      }
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public getContextFromId_result deepCopy() {
      return new getContextFromId_result(this);
    }

    @Deprecated
    public getContextFromId_result clone() {
      return new getContextFromId_result(this);
    }

    public UserContext getSuccess() {
      return this.success;
    }

    public getContextFromId_result setSuccess(UserContext success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public getContextFromId_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((UserContext)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getContextFromId_result)
        return this.equals((getContextFromId_result)that);
      return false;
    }

    public boolean equals(getContextFromId_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new UserContext();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getContextFromId_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getContextFromEmailOrHandle_args implements TBase<getContextFromEmailOrHandle_args._Fields>, java.io.Serializable, Cloneable, Comparable<getContextFromEmailOrHandle_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getContextFromEmailOrHandle_args");

    private static final TField EMAILORHANDLE_FIELD_DESC = new TField("emailorhandle", TType.STRING, (short)1);
    private static final TField IS_EMAIL_FIELD_DESC = new TField("isEmail", TType.BOOL, (short)2);

    private String emailorhandle;
    private boolean isEmail;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      EMAILORHANDLE((short)1, "emailorhandle"),
      IS_EMAIL((short)2, "isEmail");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ISEMAIL_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.EMAILORHANDLE, new FieldMetaData("emailorhandle", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.IS_EMAIL, new FieldMetaData("isEmail", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getContextFromEmailOrHandle_args.class, metaDataMap);
    }

    public getContextFromEmailOrHandle_args() {
    }

    public getContextFromEmailOrHandle_args(
      String emailorhandle,
      boolean isEmail)
    {
      this();
      this.emailorhandle = emailorhandle;
      this.isEmail = isEmail;
      setIsEmailIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getContextFromEmailOrHandle_args(getContextFromEmailOrHandle_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetEmailorhandle()) {
        this.emailorhandle = other.emailorhandle;
      }
      this.isEmail = other.isEmail;
    }

    public getContextFromEmailOrHandle_args deepCopy() {
      return new getContextFromEmailOrHandle_args(this);
    }

    @Deprecated
    public getContextFromEmailOrHandle_args clone() {
      return new getContextFromEmailOrHandle_args(this);
    }

    public String getEmailorhandle() {
      return this.emailorhandle;
    }

    public getContextFromEmailOrHandle_args setEmailorhandle(String emailorhandle) {
      this.emailorhandle = emailorhandle;
      return this;
    }

    public void unsetEmailorhandle() {
      this.emailorhandle = null;
    }

    /** Returns true if field emailorhandle is set (has been asigned a value) and false otherwise */
    public boolean isSetEmailorhandle() {
      return this.emailorhandle != null;
    }

    public void setEmailorhandleIsSet(boolean value) {
      if (!value) {
        this.emailorhandle = null;
      }
    }

    public boolean isIsEmail() {
      return this.isEmail;
    }

    public getContextFromEmailOrHandle_args setIsEmail(boolean isEmail) {
      this.isEmail = isEmail;
      setIsEmailIsSet(true);
      return this;
    }

    public void unsetIsEmail() {
      __isset_bit_vector.clear(__ISEMAIL_ISSET_ID);
    }

    /** Returns true if field isEmail is set (has been asigned a value) and false otherwise */
    public boolean isSetIsEmail() {
      return __isset_bit_vector.get(__ISEMAIL_ISSET_ID);
    }

    public void setIsEmailIsSet(boolean value) {
      __isset_bit_vector.set(__ISEMAIL_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case EMAILORHANDLE:
        if (value == null) {
          unsetEmailorhandle();
        } else {
          setEmailorhandle((String)value);
        }
        break;

      case IS_EMAIL:
        if (value == null) {
          unsetIsEmail();
        } else {
          setIsEmail((Boolean)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case EMAILORHANDLE:
        return getEmailorhandle();

      case IS_EMAIL:
        return new Boolean(isIsEmail());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case EMAILORHANDLE:
        return isSetEmailorhandle();
      case IS_EMAIL:
        return isSetIsEmail();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getContextFromEmailOrHandle_args)
        return this.equals((getContextFromEmailOrHandle_args)that);
      return false;
    }

    public boolean equals(getContextFromEmailOrHandle_args that) {
      if (that == null)
        return false;

      boolean this_present_emailorhandle = true && this.isSetEmailorhandle();
      boolean that_present_emailorhandle = true && that.isSetEmailorhandle();
      if (this_present_emailorhandle || that_present_emailorhandle) {
        if (!(this_present_emailorhandle && that_present_emailorhandle))
          return false;
        if (!this.emailorhandle.equals(that.emailorhandle))
          return false;
      }

      boolean this_present_isEmail = true;
      boolean that_present_isEmail = true;
      if (this_present_isEmail || that_present_isEmail) {
        if (!(this_present_isEmail && that_present_isEmail))
          return false;
        if (this.isEmail != that.isEmail)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getContextFromEmailOrHandle_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getContextFromEmailOrHandle_args typedOther = (getContextFromEmailOrHandle_args)other;

      lastComparison = Boolean.valueOf(isSetEmailorhandle()).compareTo(isSetEmailorhandle());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(emailorhandle, typedOther.emailorhandle);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetIsEmail()).compareTo(isSetIsEmail());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(isEmail, typedOther.isEmail);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case EMAILORHANDLE:
              if (field.type == TType.STRING) {
                this.emailorhandle = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case IS_EMAIL:
              if (field.type == TType.BOOL) {
                this.isEmail = iprot.readBool();
                setIsEmailIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.emailorhandle != null) {
        oprot.writeFieldBegin(EMAILORHANDLE_FIELD_DESC);
        oprot.writeString(this.emailorhandle);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(IS_EMAIL_FIELD_DESC);
      oprot.writeBool(this.isEmail);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getContextFromEmailOrHandle_args(");
      boolean first = true;

      sb.append("emailorhandle:");
      if (this.emailorhandle == null) {
        sb.append("null");
      } else {
        sb.append(this.emailorhandle);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("isEmail:");
      sb.append(this.isEmail);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getContextFromEmailOrHandle_result implements TBase<getContextFromEmailOrHandle_result._Fields>, java.io.Serializable, Cloneable   {
    private static final TStruct STRUCT_DESC = new TStruct("getContextFromEmailOrHandle_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private UserContext success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, UserContext.class)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getContextFromEmailOrHandle_result.class, metaDataMap);
    }

    public getContextFromEmailOrHandle_result() {
    }

    public getContextFromEmailOrHandle_result(
      UserContext success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getContextFromEmailOrHandle_result(getContextFromEmailOrHandle_result other) {
      if (other.isSetSuccess()) {
        this.success = new UserContext(other.success);
      }
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public getContextFromEmailOrHandle_result deepCopy() {
      return new getContextFromEmailOrHandle_result(this);
    }

    @Deprecated
    public getContextFromEmailOrHandle_result clone() {
      return new getContextFromEmailOrHandle_result(this);
    }

    public UserContext getSuccess() {
      return this.success;
    }

    public getContextFromEmailOrHandle_result setSuccess(UserContext success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public getContextFromEmailOrHandle_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((UserContext)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getContextFromEmailOrHandle_result)
        return this.equals((getContextFromEmailOrHandle_result)that);
      return false;
    }

    public boolean equals(getContextFromEmailOrHandle_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new UserContext();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getContextFromEmailOrHandle_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getState_args implements TBase<getState_args._Fields>, java.io.Serializable, Cloneable, Comparable<getState_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getState_args");

    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
    private static final TField IS_SESSION_ID_FIELD_DESC = new TField("isSessionId", TType.BOOL, (short)2);

    private long userId;
    private boolean isSessionId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USER_ID((short)1, "userId"),
      IS_SESSION_ID((short)2, "isSessionId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private static final int __ISSESSIONID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.IS_SESSION_ID, new FieldMetaData("isSessionId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getState_args.class, metaDataMap);
    }

    public getState_args() {
    }

    public getState_args(
      long userId,
      boolean isSessionId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.isSessionId = isSessionId;
      setIsSessionIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getState_args(getState_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userId = other.userId;
      this.isSessionId = other.isSessionId;
    }

    public getState_args deepCopy() {
      return new getState_args(this);
    }

    @Deprecated
    public getState_args clone() {
      return new getState_args(this);
    }

    public long getUserId() {
      return this.userId;
    }

    public getState_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
    public boolean isSetUserId() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public boolean isIsSessionId() {
      return this.isSessionId;
    }

    public getState_args setIsSessionId(boolean isSessionId) {
      this.isSessionId = isSessionId;
      setIsSessionIdIsSet(true);
      return this;
    }

    public void unsetIsSessionId() {
      __isset_bit_vector.clear(__ISSESSIONID_ISSET_ID);
    }

    /** Returns true if field isSessionId is set (has been asigned a value) and false otherwise */
    public boolean isSetIsSessionId() {
      return __isset_bit_vector.get(__ISSESSIONID_ISSET_ID);
    }

    public void setIsSessionIdIsSet(boolean value) {
      __isset_bit_vector.set(__ISSESSIONID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      case IS_SESSION_ID:
        if (value == null) {
          unsetIsSessionId();
        } else {
          setIsSessionId((Boolean)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      case IS_SESSION_ID:
        return new Boolean(isIsSessionId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case USER_ID:
        return isSetUserId();
      case IS_SESSION_ID:
        return isSetIsSessionId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getState_args)
        return this.equals((getState_args)that);
      return false;
    }

    public boolean equals(getState_args that) {
      if (that == null)
        return false;

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      boolean this_present_isSessionId = true;
      boolean that_present_isSessionId = true;
      if (this_present_isSessionId || that_present_isSessionId) {
        if (!(this_present_isSessionId && that_present_isSessionId))
          return false;
        if (this.isSessionId != that.isSessionId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getState_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getState_args typedOther = (getState_args)other;

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetIsSessionId()).compareTo(isSetIsSessionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(isSessionId, typedOther.isSessionId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case IS_SESSION_ID:
              if (field.type == TType.BOOL) {
                this.isSessionId = iprot.readBool();
                setIsSessionIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(IS_SESSION_ID_FIELD_DESC);
      oprot.writeBool(this.isSessionId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getState_args(");
      boolean first = true;

      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("isSessionId:");
      sb.append(this.isSessionId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getState_result implements TBase<getState_result._Fields>, java.io.Serializable, Cloneable, Comparable<getState_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getState_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private UserState success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, UserState.class)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getState_result.class, metaDataMap);
    }

    public getState_result() {
    }

    public getState_result(
      UserState success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getState_result(getState_result other) {
      if (other.isSetSuccess()) {
        this.success = new UserState(other.success);
      }
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public getState_result deepCopy() {
      return new getState_result(this);
    }

    @Deprecated
    public getState_result clone() {
      return new getState_result(this);
    }

    public UserState getSuccess() {
      return this.success;
    }

    public getState_result setSuccess(UserState success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public getState_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((UserState)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getState_result)
        return this.equals((getState_result)that);
      return false;
    }

    public boolean equals(getState_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getState_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getState_result typedOther = (getState_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new UserState();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getState_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getPrimaryInfo_args implements TBase<getPrimaryInfo_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPrimaryInfo_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getPrimaryInfo_args");

    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
    private static final TField IS_SESSION_ID_FIELD_DESC = new TField("isSessionId", TType.BOOL, (short)2);

    private long userId;
    private boolean isSessionId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USER_ID((short)1, "userId"),
      IS_SESSION_ID((short)2, "isSessionId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private static final int __ISSESSIONID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.IS_SESSION_ID, new FieldMetaData("isSessionId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getPrimaryInfo_args.class, metaDataMap);
    }

    public getPrimaryInfo_args() {
    }

    public getPrimaryInfo_args(
      long userId,
      boolean isSessionId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.isSessionId = isSessionId;
      setIsSessionIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPrimaryInfo_args(getPrimaryInfo_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userId = other.userId;
      this.isSessionId = other.isSessionId;
    }

    public getPrimaryInfo_args deepCopy() {
      return new getPrimaryInfo_args(this);
    }

    @Deprecated
    public getPrimaryInfo_args clone() {
      return new getPrimaryInfo_args(this);
    }

    public long getUserId() {
      return this.userId;
    }

    public getPrimaryInfo_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
    public boolean isSetUserId() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public boolean isIsSessionId() {
      return this.isSessionId;
    }

    public getPrimaryInfo_args setIsSessionId(boolean isSessionId) {
      this.isSessionId = isSessionId;
      setIsSessionIdIsSet(true);
      return this;
    }

    public void unsetIsSessionId() {
      __isset_bit_vector.clear(__ISSESSIONID_ISSET_ID);
    }

    /** Returns true if field isSessionId is set (has been asigned a value) and false otherwise */
    public boolean isSetIsSessionId() {
      return __isset_bit_vector.get(__ISSESSIONID_ISSET_ID);
    }

    public void setIsSessionIdIsSet(boolean value) {
      __isset_bit_vector.set(__ISSESSIONID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      case IS_SESSION_ID:
        if (value == null) {
          unsetIsSessionId();
        } else {
          setIsSessionId((Boolean)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      case IS_SESSION_ID:
        return new Boolean(isIsSessionId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case USER_ID:
        return isSetUserId();
      case IS_SESSION_ID:
        return isSetIsSessionId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPrimaryInfo_args)
        return this.equals((getPrimaryInfo_args)that);
      return false;
    }

    public boolean equals(getPrimaryInfo_args that) {
      if (that == null)
        return false;

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      boolean this_present_isSessionId = true;
      boolean that_present_isSessionId = true;
      if (this_present_isSessionId || that_present_isSessionId) {
        if (!(this_present_isSessionId && that_present_isSessionId))
          return false;
        if (this.isSessionId != that.isSessionId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPrimaryInfo_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPrimaryInfo_args typedOther = (getPrimaryInfo_args)other;

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetIsSessionId()).compareTo(isSetIsSessionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(isSessionId, typedOther.isSessionId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case IS_SESSION_ID:
              if (field.type == TType.BOOL) {
                this.isSessionId = iprot.readBool();
                setIsSessionIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(IS_SESSION_ID_FIELD_DESC);
      oprot.writeBool(this.isSessionId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPrimaryInfo_args(");
      boolean first = true;

      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("isSessionId:");
      sb.append(this.isSessionId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getPrimaryInfo_result implements TBase<getPrimaryInfo_result._Fields>, java.io.Serializable, Cloneable   {
    private static final TStruct STRUCT_DESC = new TStruct("getPrimaryInfo_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private UserPrimaryInfo success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, UserPrimaryInfo.class)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getPrimaryInfo_result.class, metaDataMap);
    }

    public getPrimaryInfo_result() {
    }

    public getPrimaryInfo_result(
      UserPrimaryInfo success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPrimaryInfo_result(getPrimaryInfo_result other) {
      if (other.isSetSuccess()) {
        this.success = new UserPrimaryInfo(other.success);
      }
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public getPrimaryInfo_result deepCopy() {
      return new getPrimaryInfo_result(this);
    }

    @Deprecated
    public getPrimaryInfo_result clone() {
      return new getPrimaryInfo_result(this);
    }

    public UserPrimaryInfo getSuccess() {
      return this.success;
    }

    public getPrimaryInfo_result setSuccess(UserPrimaryInfo success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public getPrimaryInfo_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((UserPrimaryInfo)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPrimaryInfo_result)
        return this.equals((getPrimaryInfo_result)that);
      return false;
    }

    public boolean equals(getPrimaryInfo_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new UserPrimaryInfo();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPrimaryInfo_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getInternalInfo_args implements TBase<getInternalInfo_args._Fields>, java.io.Serializable, Cloneable, Comparable<getInternalInfo_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getInternalInfo_args");

    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
    private static final TField IS_SESSION_ID_FIELD_DESC = new TField("isSessionId", TType.BOOL, (short)2);

    private long userId;
    private boolean isSessionId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USER_ID((short)1, "userId"),
      IS_SESSION_ID((short)2, "isSessionId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private static final int __ISSESSIONID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.IS_SESSION_ID, new FieldMetaData("isSessionId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getInternalInfo_args.class, metaDataMap);
    }

    public getInternalInfo_args() {
    }

    public getInternalInfo_args(
      long userId,
      boolean isSessionId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.isSessionId = isSessionId;
      setIsSessionIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInternalInfo_args(getInternalInfo_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userId = other.userId;
      this.isSessionId = other.isSessionId;
    }

    public getInternalInfo_args deepCopy() {
      return new getInternalInfo_args(this);
    }

    @Deprecated
    public getInternalInfo_args clone() {
      return new getInternalInfo_args(this);
    }

    public long getUserId() {
      return this.userId;
    }

    public getInternalInfo_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
    public boolean isSetUserId() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public boolean isIsSessionId() {
      return this.isSessionId;
    }

    public getInternalInfo_args setIsSessionId(boolean isSessionId) {
      this.isSessionId = isSessionId;
      setIsSessionIdIsSet(true);
      return this;
    }

    public void unsetIsSessionId() {
      __isset_bit_vector.clear(__ISSESSIONID_ISSET_ID);
    }

    /** Returns true if field isSessionId is set (has been asigned a value) and false otherwise */
    public boolean isSetIsSessionId() {
      return __isset_bit_vector.get(__ISSESSIONID_ISSET_ID);
    }

    public void setIsSessionIdIsSet(boolean value) {
      __isset_bit_vector.set(__ISSESSIONID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      case IS_SESSION_ID:
        if (value == null) {
          unsetIsSessionId();
        } else {
          setIsSessionId((Boolean)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      case IS_SESSION_ID:
        return new Boolean(isIsSessionId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case USER_ID:
        return isSetUserId();
      case IS_SESSION_ID:
        return isSetIsSessionId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInternalInfo_args)
        return this.equals((getInternalInfo_args)that);
      return false;
    }

    public boolean equals(getInternalInfo_args that) {
      if (that == null)
        return false;

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      boolean this_present_isSessionId = true;
      boolean that_present_isSessionId = true;
      if (this_present_isSessionId || that_present_isSessionId) {
        if (!(this_present_isSessionId && that_present_isSessionId))
          return false;
        if (this.isSessionId != that.isSessionId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInternalInfo_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInternalInfo_args typedOther = (getInternalInfo_args)other;

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetIsSessionId()).compareTo(isSetIsSessionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(isSessionId, typedOther.isSessionId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case IS_SESSION_ID:
              if (field.type == TType.BOOL) {
                this.isSessionId = iprot.readBool();
                setIsSessionIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(IS_SESSION_ID_FIELD_DESC);
      oprot.writeBool(this.isSessionId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInternalInfo_args(");
      boolean first = true;

      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("isSessionId:");
      sb.append(this.isSessionId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getInternalInfo_result implements TBase<getInternalInfo_result._Fields>, java.io.Serializable, Cloneable, Comparable<getInternalInfo_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("getInternalInfo_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private UserInternalInfo success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, UserInternalInfo.class)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getInternalInfo_result.class, metaDataMap);
    }

    public getInternalInfo_result() {
    }

    public getInternalInfo_result(
      UserInternalInfo success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getInternalInfo_result(getInternalInfo_result other) {
      if (other.isSetSuccess()) {
        this.success = new UserInternalInfo(other.success);
      }
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public getInternalInfo_result deepCopy() {
      return new getInternalInfo_result(this);
    }

    @Deprecated
    public getInternalInfo_result clone() {
      return new getInternalInfo_result(this);
    }

    public UserInternalInfo getSuccess() {
      return this.success;
    }

    public getInternalInfo_result setSuccess(UserInternalInfo success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public getInternalInfo_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((UserInternalInfo)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getInternalInfo_result)
        return this.equals((getInternalInfo_result)that);
      return false;
    }

    public boolean equals(getInternalInfo_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getInternalInfo_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getInternalInfo_result typedOther = (getInternalInfo_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new UserInternalInfo();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getInternalInfo_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getContext_args implements TBase<getContext_args._Fields>, java.io.Serializable, Cloneable, Comparable<getContext_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("getContext_args");

    private static final TField EMAIL_FIELD_DESC = new TField("email", TType.STRING, (short)1);
    private static final TField PASSWORD_FIELD_DESC = new TField("password", TType.STRING, (short)2);

    private String email;
    private String password;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      EMAIL((short)1, "email"),
      PASSWORD((short)2, "password");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.EMAIL, new FieldMetaData("email", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.PASSWORD, new FieldMetaData("password", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getContext_args.class, metaDataMap);
    }

    public getContext_args() {
    }

    public getContext_args(
      String email,
      String password)
    {
      this();
      this.email = email;
      this.password = password;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getContext_args(getContext_args other) {
      if (other.isSetEmail()) {
        this.email = other.email;
      }
      if (other.isSetPassword()) {
        this.password = other.password;
      }
    }

    public getContext_args deepCopy() {
      return new getContext_args(this);
    }

    @Deprecated
    public getContext_args clone() {
      return new getContext_args(this);
    }

    public String getEmail() {
      return this.email;
    }

    public getContext_args setEmail(String email) {
      this.email = email;
      return this;
    }

    public void unsetEmail() {
      this.email = null;
    }

    /** Returns true if field email is set (has been asigned a value) and false otherwise */
    public boolean isSetEmail() {
      return this.email != null;
    }

    public void setEmailIsSet(boolean value) {
      if (!value) {
        this.email = null;
      }
    }

    public String getPassword() {
      return this.password;
    }

    public getContext_args setPassword(String password) {
      this.password = password;
      return this;
    }

    public void unsetPassword() {
      this.password = null;
    }

    /** Returns true if field password is set (has been asigned a value) and false otherwise */
    public boolean isSetPassword() {
      return this.password != null;
    }

    public void setPasswordIsSet(boolean value) {
      if (!value) {
        this.password = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case EMAIL:
        if (value == null) {
          unsetEmail();
        } else {
          setEmail((String)value);
        }
        break;

      case PASSWORD:
        if (value == null) {
          unsetPassword();
        } else {
          setPassword((String)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case EMAIL:
        return getEmail();

      case PASSWORD:
        return getPassword();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case EMAIL:
        return isSetEmail();
      case PASSWORD:
        return isSetPassword();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getContext_args)
        return this.equals((getContext_args)that);
      return false;
    }

    public boolean equals(getContext_args that) {
      if (that == null)
        return false;

      boolean this_present_email = true && this.isSetEmail();
      boolean that_present_email = true && that.isSetEmail();
      if (this_present_email || that_present_email) {
        if (!(this_present_email && that_present_email))
          return false;
        if (!this.email.equals(that.email))
          return false;
      }

      boolean this_present_password = true && this.isSetPassword();
      boolean that_present_password = true && that.isSetPassword();
      if (this_present_password || that_present_password) {
        if (!(this_present_password && that_present_password))
          return false;
        if (!this.password.equals(that.password))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getContext_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getContext_args typedOther = (getContext_args)other;

      lastComparison = Boolean.valueOf(isSetEmail()).compareTo(isSetEmail());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(email, typedOther.email);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetPassword()).compareTo(isSetPassword());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(password, typedOther.password);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case EMAIL:
              if (field.type == TType.STRING) {
                this.email = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case PASSWORD:
              if (field.type == TType.STRING) {
                this.password = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.email != null) {
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
        oprot.writeString(this.email);
        oprot.writeFieldEnd();
      }
      if (this.password != null) {
        oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
        oprot.writeString(this.password);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getContext_args(");
      boolean first = true;

      sb.append("email:");
      if (this.email == null) {
        sb.append("null");
      } else {
        sb.append(this.email);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("password:");
      if (this.password == null) {
        sb.append("null");
      } else {
        sb.append(this.password);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class getContext_result implements TBase<getContext_result._Fields>, java.io.Serializable, Cloneable   {
    private static final TStruct STRUCT_DESC = new TStruct("getContext_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
    private static final TField AX_FIELD_DESC = new TField("ax", TType.STRUCT, (short)1);

    private UserContext success;
    private AuthenticationException ax;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      AX((short)1, "ax");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, UserContext.class)));
      put(_Fields.AX, new FieldMetaData("ax", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(getContext_result.class, metaDataMap);
    }

    public getContext_result() {
    }

    public getContext_result(
      UserContext success,
      AuthenticationException ax)
    {
      this();
      this.success = success;
      this.ax = ax;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getContext_result(getContext_result other) {
      if (other.isSetSuccess()) {
        this.success = new UserContext(other.success);
      }
      if (other.isSetAx()) {
        this.ax = new AuthenticationException(other.ax);
      }
    }

    public getContext_result deepCopy() {
      return new getContext_result(this);
    }

    @Deprecated
    public getContext_result clone() {
      return new getContext_result(this);
    }

    public UserContext getSuccess() {
      return this.success;
    }

    public getContext_result setSuccess(UserContext success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public AuthenticationException getAx() {
      return this.ax;
    }

    public getContext_result setAx(AuthenticationException ax) {
      this.ax = ax;
      return this;
    }

    public void unsetAx() {
      this.ax = null;
    }

    /** Returns true if field ax is set (has been asigned a value) and false otherwise */
    public boolean isSetAx() {
      return this.ax != null;
    }

    public void setAxIsSet(boolean value) {
      if (!value) {
        this.ax = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((UserContext)value);
        }
        break;

      case AX:
        if (value == null) {
          unsetAx();
        } else {
          setAx((AuthenticationException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case AX:
        return getAx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case AX:
        return isSetAx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getContext_result)
        return this.equals((getContext_result)that);
      return false;
    }

    public boolean equals(getContext_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_ax = true && this.isSetAx();
      boolean that_present_ax = true && that.isSetAx();
      if (this_present_ax || that_present_ax) {
        if (!(this_present_ax && that_present_ax))
          return false;
        if (!this.ax.equals(that.ax))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.STRUCT) {
                this.success = new UserContext();
                this.success.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case AX:
              if (field.type == TType.STRUCT) {
                this.ax = new AuthenticationException();
                this.ax.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetAx()) {
        oprot.writeFieldBegin(AX_FIELD_DESC);
        this.ax.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getContext_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ax:");
      if (this.ax == null) {
        sb.append("null");
      } else {
        sb.append(this.ax);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class authenticateUser_args implements TBase<authenticateUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<authenticateUser_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("authenticateUser_args");

    private static final TField HANDLE_FIELD_DESC = new TField("handle", TType.STRING, (short)1);
    private static final TField PASSWORD_FIELD_DESC = new TField("password", TType.STRING, (short)2);
    private static final TField IS_EMAIL_FIELD_DESC = new TField("isEmail", TType.BOOL, (short)3);

    private String handle;
    private String password;
    private boolean isEmail;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      HANDLE((short)1, "handle"),
      PASSWORD((short)2, "password"),
      IS_EMAIL((short)3, "isEmail");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ISEMAIL_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.HANDLE, new FieldMetaData("handle", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.PASSWORD, new FieldMetaData("password", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.IS_EMAIL, new FieldMetaData("isEmail", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(authenticateUser_args.class, metaDataMap);
    }

    public authenticateUser_args() {
    }

    public authenticateUser_args(
      String handle,
      String password,
      boolean isEmail)
    {
      this();
      this.handle = handle;
      this.password = password;
      this.isEmail = isEmail;
      setIsEmailIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public authenticateUser_args(authenticateUser_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetHandle()) {
        this.handle = other.handle;
      }
      if (other.isSetPassword()) {
        this.password = other.password;
      }
      this.isEmail = other.isEmail;
    }

    public authenticateUser_args deepCopy() {
      return new authenticateUser_args(this);
    }

    @Deprecated
    public authenticateUser_args clone() {
      return new authenticateUser_args(this);
    }

    public String getHandle() {
      return this.handle;
    }

    public authenticateUser_args setHandle(String handle) {
      this.handle = handle;
      return this;
    }

    public void unsetHandle() {
      this.handle = null;
    }

    /** Returns true if field handle is set (has been asigned a value) and false otherwise */
    public boolean isSetHandle() {
      return this.handle != null;
    }

    public void setHandleIsSet(boolean value) {
      if (!value) {
        this.handle = null;
      }
    }

    public String getPassword() {
      return this.password;
    }

    public authenticateUser_args setPassword(String password) {
      this.password = password;
      return this;
    }

    public void unsetPassword() {
      this.password = null;
    }

    /** Returns true if field password is set (has been asigned a value) and false otherwise */
    public boolean isSetPassword() {
      return this.password != null;
    }

    public void setPasswordIsSet(boolean value) {
      if (!value) {
        this.password = null;
      }
    }

    public boolean isIsEmail() {
      return this.isEmail;
    }

    public authenticateUser_args setIsEmail(boolean isEmail) {
      this.isEmail = isEmail;
      setIsEmailIsSet(true);
      return this;
    }

    public void unsetIsEmail() {
      __isset_bit_vector.clear(__ISEMAIL_ISSET_ID);
    }

    /** Returns true if field isEmail is set (has been asigned a value) and false otherwise */
    public boolean isSetIsEmail() {
      return __isset_bit_vector.get(__ISEMAIL_ISSET_ID);
    }

    public void setIsEmailIsSet(boolean value) {
      __isset_bit_vector.set(__ISEMAIL_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case HANDLE:
        if (value == null) {
          unsetHandle();
        } else {
          setHandle((String)value);
        }
        break;

      case PASSWORD:
        if (value == null) {
          unsetPassword();
        } else {
          setPassword((String)value);
        }
        break;

      case IS_EMAIL:
        if (value == null) {
          unsetIsEmail();
        } else {
          setIsEmail((Boolean)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case HANDLE:
        return getHandle();

      case PASSWORD:
        return getPassword();

      case IS_EMAIL:
        return new Boolean(isIsEmail());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case HANDLE:
        return isSetHandle();
      case PASSWORD:
        return isSetPassword();
      case IS_EMAIL:
        return isSetIsEmail();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof authenticateUser_args)
        return this.equals((authenticateUser_args)that);
      return false;
    }

    public boolean equals(authenticateUser_args that) {
      if (that == null)
        return false;

      boolean this_present_handle = true && this.isSetHandle();
      boolean that_present_handle = true && that.isSetHandle();
      if (this_present_handle || that_present_handle) {
        if (!(this_present_handle && that_present_handle))
          return false;
        if (!this.handle.equals(that.handle))
          return false;
      }

      boolean this_present_password = true && this.isSetPassword();
      boolean that_present_password = true && that.isSetPassword();
      if (this_present_password || that_present_password) {
        if (!(this_present_password && that_present_password))
          return false;
        if (!this.password.equals(that.password))
          return false;
      }

      boolean this_present_isEmail = true;
      boolean that_present_isEmail = true;
      if (this_present_isEmail || that_present_isEmail) {
        if (!(this_present_isEmail && that_present_isEmail))
          return false;
        if (this.isEmail != that.isEmail)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(authenticateUser_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      authenticateUser_args typedOther = (authenticateUser_args)other;

      lastComparison = Boolean.valueOf(isSetHandle()).compareTo(isSetHandle());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(handle, typedOther.handle);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetPassword()).compareTo(isSetPassword());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(password, typedOther.password);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetIsEmail()).compareTo(isSetIsEmail());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(isEmail, typedOther.isEmail);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case HANDLE:
              if (field.type == TType.STRING) {
                this.handle = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case PASSWORD:
              if (field.type == TType.STRING) {
                this.password = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case IS_EMAIL:
              if (field.type == TType.BOOL) {
                this.isEmail = iprot.readBool();
                setIsEmailIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.handle != null) {
        oprot.writeFieldBegin(HANDLE_FIELD_DESC);
        oprot.writeString(this.handle);
        oprot.writeFieldEnd();
      }
      if (this.password != null) {
        oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
        oprot.writeString(this.password);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(IS_EMAIL_FIELD_DESC);
      oprot.writeBool(this.isEmail);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("authenticateUser_args(");
      boolean first = true;

      sb.append("handle:");
      if (this.handle == null) {
        sb.append("null");
      } else {
        sb.append(this.handle);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("password:");
      if (this.password == null) {
        sb.append("null");
      } else {
        sb.append(this.password);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("isEmail:");
      sb.append(this.isEmail);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class authenticateUser_result implements TBase<authenticateUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<authenticateUser_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("authenticateUser_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField AX_FIELD_DESC = new TField("ax", TType.STRUCT, (short)1);

    private boolean success;
    private AuthenticationException ax;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      AX((short)1, "ax");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.AX, new FieldMetaData("ax", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(authenticateUser_result.class, metaDataMap);
    }

    public authenticateUser_result() {
    }

    public authenticateUser_result(
      boolean success,
      AuthenticationException ax)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ax = ax;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public authenticateUser_result(authenticateUser_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetAx()) {
        this.ax = new AuthenticationException(other.ax);
      }
    }

    public authenticateUser_result deepCopy() {
      return new authenticateUser_result(this);
    }

    @Deprecated
    public authenticateUser_result clone() {
      return new authenticateUser_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public authenticateUser_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public AuthenticationException getAx() {
      return this.ax;
    }

    public authenticateUser_result setAx(AuthenticationException ax) {
      this.ax = ax;
      return this;
    }

    public void unsetAx() {
      this.ax = null;
    }

    /** Returns true if field ax is set (has been asigned a value) and false otherwise */
    public boolean isSetAx() {
      return this.ax != null;
    }

    public void setAxIsSet(boolean value) {
      if (!value) {
        this.ax = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case AX:
        if (value == null) {
          unsetAx();
        } else {
          setAx((AuthenticationException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case AX:
        return getAx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case AX:
        return isSetAx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof authenticateUser_result)
        return this.equals((authenticateUser_result)that);
      return false;
    }

    public boolean equals(authenticateUser_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ax = true && this.isSetAx();
      boolean that_present_ax = true && that.isSetAx();
      if (this_present_ax || that_present_ax) {
        if (!(this_present_ax && that_present_ax))
          return false;
        if (!this.ax.equals(that.ax))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(authenticateUser_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      authenticateUser_result typedOther = (authenticateUser_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetAx()).compareTo(isSetAx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ax, typedOther.ax);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case AX:
              if (field.type == TType.STRUCT) {
                this.ax = new AuthenticationException();
                this.ax.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetAx()) {
        oprot.writeFieldBegin(AX_FIELD_DESC);
        this.ax.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("authenticateUser_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ax:");
      if (this.ax == null) {
        sb.append("null");
      } else {
        sb.append(this.ax);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class userExists_args implements TBase<userExists_args._Fields>, java.io.Serializable, Cloneable, Comparable<userExists_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("userExists_args");

    private static final TField EMAIL_FIELD_DESC = new TField("email", TType.STRING, (short)1);

    private String email;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      EMAIL((short)1, "email");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.EMAIL, new FieldMetaData("email", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(userExists_args.class, metaDataMap);
    }

    public userExists_args() {
    }

    public userExists_args(
      String email)
    {
      this();
      this.email = email;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public userExists_args(userExists_args other) {
      if (other.isSetEmail()) {
        this.email = other.email;
      }
    }

    public userExists_args deepCopy() {
      return new userExists_args(this);
    }

    @Deprecated
    public userExists_args clone() {
      return new userExists_args(this);
    }

    public String getEmail() {
      return this.email;
    }

    public userExists_args setEmail(String email) {
      this.email = email;
      return this;
    }

    public void unsetEmail() {
      this.email = null;
    }

    /** Returns true if field email is set (has been asigned a value) and false otherwise */
    public boolean isSetEmail() {
      return this.email != null;
    }

    public void setEmailIsSet(boolean value) {
      if (!value) {
        this.email = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case EMAIL:
        if (value == null) {
          unsetEmail();
        } else {
          setEmail((String)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case EMAIL:
        return getEmail();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case EMAIL:
        return isSetEmail();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof userExists_args)
        return this.equals((userExists_args)that);
      return false;
    }

    public boolean equals(userExists_args that) {
      if (that == null)
        return false;

      boolean this_present_email = true && this.isSetEmail();
      boolean that_present_email = true && that.isSetEmail();
      if (this_present_email || that_present_email) {
        if (!(this_present_email && that_present_email))
          return false;
        if (!this.email.equals(that.email))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(userExists_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      userExists_args typedOther = (userExists_args)other;

      lastComparison = Boolean.valueOf(isSetEmail()).compareTo(isSetEmail());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(email, typedOther.email);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case EMAIL:
              if (field.type == TType.STRING) {
                this.email = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.email != null) {
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
        oprot.writeString(this.email);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("userExists_args(");
      boolean first = true;

      sb.append("email:");
      if (this.email == null) {
        sb.append("null");
      } else {
        sb.append(this.email);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class userExists_result implements TBase<userExists_result._Fields>, java.io.Serializable, Cloneable, Comparable<userExists_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("userExists_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(userExists_result.class, metaDataMap);
    }

    public userExists_result() {
    }

    public userExists_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public userExists_result(userExists_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public userExists_result deepCopy() {
      return new userExists_result(this);
    }

    @Deprecated
    public userExists_result clone() {
      return new userExists_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public userExists_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public userExists_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof userExists_result)
        return this.equals((userExists_result)that);
      return false;
    }

    public boolean equals(userExists_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(userExists_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      userExists_result typedOther = (userExists_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("userExists_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addIpAdressForUser_args implements TBase<addIpAdressForUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<addIpAdressForUser_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("addIpAdressForUser_args");

    private static final TField IP_FIELD_DESC = new TField("ip", TType.STRING, (short)1);
    private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)2);
    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)3);

    private String ip;
    private long timestamp;
    private long userId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      IP((short)1, "ip"),
      TIMESTAMP((short)2, "timestamp"),
      USER_ID((short)3, "userId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __TIMESTAMP_ISSET_ID = 0;
    private static final int __USERID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.IP, new FieldMetaData("ip", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addIpAdressForUser_args.class, metaDataMap);
    }

    public addIpAdressForUser_args() {
    }

    public addIpAdressForUser_args(
      String ip,
      long timestamp,
      long userId)
    {
      this();
      this.ip = ip;
      this.timestamp = timestamp;
      setTimestampIsSet(true);
      this.userId = userId;
      setUserIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addIpAdressForUser_args(addIpAdressForUser_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetIp()) {
        this.ip = other.ip;
      }
      this.timestamp = other.timestamp;
      this.userId = other.userId;
    }

    public addIpAdressForUser_args deepCopy() {
      return new addIpAdressForUser_args(this);
    }

    @Deprecated
    public addIpAdressForUser_args clone() {
      return new addIpAdressForUser_args(this);
    }

    public String getIp() {
      return this.ip;
    }

    public addIpAdressForUser_args setIp(String ip) {
      this.ip = ip;
      return this;
    }

    public void unsetIp() {
      this.ip = null;
    }

    /** Returns true if field ip is set (has been asigned a value) and false otherwise */
    public boolean isSetIp() {
      return this.ip != null;
    }

    public void setIpIsSet(boolean value) {
      if (!value) {
        this.ip = null;
      }
    }

    public long getTimestamp() {
      return this.timestamp;
    }

    public addIpAdressForUser_args setTimestamp(long timestamp) {
      this.timestamp = timestamp;
      setTimestampIsSet(true);
      return this;
    }

    public void unsetTimestamp() {
      __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
    }

    /** Returns true if field timestamp is set (has been asigned a value) and false otherwise */
    public boolean isSetTimestamp() {
      return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
    }

    public void setTimestampIsSet(boolean value) {
      __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
    }

    public long getUserId() {
      return this.userId;
    }

    public addIpAdressForUser_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
    public boolean isSetUserId() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case IP:
        if (value == null) {
          unsetIp();
        } else {
          setIp((String)value);
        }
        break;

      case TIMESTAMP:
        if (value == null) {
          unsetTimestamp();
        } else {
          setTimestamp((Long)value);
        }
        break;

      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case IP:
        return getIp();

      case TIMESTAMP:
        return new Long(getTimestamp());

      case USER_ID:
        return new Long(getUserId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case IP:
        return isSetIp();
      case TIMESTAMP:
        return isSetTimestamp();
      case USER_ID:
        return isSetUserId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addIpAdressForUser_args)
        return this.equals((addIpAdressForUser_args)that);
      return false;
    }

    public boolean equals(addIpAdressForUser_args that) {
      if (that == null)
        return false;

      boolean this_present_ip = true && this.isSetIp();
      boolean that_present_ip = true && that.isSetIp();
      if (this_present_ip || that_present_ip) {
        if (!(this_present_ip && that_present_ip))
          return false;
        if (!this.ip.equals(that.ip))
          return false;
      }

      boolean this_present_timestamp = true;
      boolean that_present_timestamp = true;
      if (this_present_timestamp || that_present_timestamp) {
        if (!(this_present_timestamp && that_present_timestamp))
          return false;
        if (this.timestamp != that.timestamp)
          return false;
      }

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addIpAdressForUser_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addIpAdressForUser_args typedOther = (addIpAdressForUser_args)other;

      lastComparison = Boolean.valueOf(isSetIp()).compareTo(isSetIp());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ip, typedOther.ip);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case IP:
              if (field.type == TType.STRING) {
                this.ip = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TIMESTAMP:
              if (field.type == TType.I64) {
                this.timestamp = iprot.readI64();
                setTimestampIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.ip != null) {
        oprot.writeFieldBegin(IP_FIELD_DESC);
        oprot.writeString(this.ip);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
      oprot.writeI64(this.timestamp);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addIpAdressForUser_args(");
      boolean first = true;

      sb.append("ip:");
      if (this.ip == null) {
        sb.append("null");
      } else {
        sb.append(this.ip);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("timestamp:");
      sb.append(this.timestamp);
      first = false;
      if (!first) sb.append(", ");
      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addIpAdressForUser_result implements TBase<addIpAdressForUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<addIpAdressForUser_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("addIpAdressForUser_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addIpAdressForUser_result.class, metaDataMap);
    }

    public addIpAdressForUser_result() {
    }

    public addIpAdressForUser_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addIpAdressForUser_result(addIpAdressForUser_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public addIpAdressForUser_result deepCopy() {
      return new addIpAdressForUser_result(this);
    }

    @Deprecated
    public addIpAdressForUser_result clone() {
      return new addIpAdressForUser_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public addIpAdressForUser_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public addIpAdressForUser_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addIpAdressForUser_result)
        return this.equals((addIpAdressForUser_result)that);
      return false;
    }

    public boolean equals(addIpAdressForUser_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addIpAdressForUser_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addIpAdressForUser_result typedOther = (addIpAdressForUser_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addIpAdressForUser_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addAddressForUser_args implements TBase<addAddressForUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<addAddressForUser_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("addAddressForUser_args");

    private static final TField ADDRESS_FIELD_DESC = new TField("address", TType.STRUCT, (short)1);
    private static final TField USERID_FIELD_DESC = new TField("userid", TType.I64, (short)2);
    private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)3);

    private Address address;
    private long userid;
    private long timestamp;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      ADDRESS((short)1, "address"),
      USERID((short)2, "userid"),
      TIMESTAMP((short)3, "timestamp");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private static final int __TIMESTAMP_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.ADDRESS, new FieldMetaData("address", TFieldRequirementType.DEFAULT, 
          new StructMetaData(TType.STRUCT, Address.class)));
      put(_Fields.USERID, new FieldMetaData("userid", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addAddressForUser_args.class, metaDataMap);
    }

    public addAddressForUser_args() {
    }

    public addAddressForUser_args(
      Address address,
      long userid,
      long timestamp)
    {
      this();
      this.address = address;
      this.userid = userid;
      setUseridIsSet(true);
      this.timestamp = timestamp;
      setTimestampIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addAddressForUser_args(addAddressForUser_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      if (other.isSetAddress()) {
        this.address = new Address(other.address);
      }
      this.userid = other.userid;
      this.timestamp = other.timestamp;
    }

    public addAddressForUser_args deepCopy() {
      return new addAddressForUser_args(this);
    }

    @Deprecated
    public addAddressForUser_args clone() {
      return new addAddressForUser_args(this);
    }

    public Address getAddress() {
      return this.address;
    }

    public addAddressForUser_args setAddress(Address address) {
      this.address = address;
      return this;
    }

    public void unsetAddress() {
      this.address = null;
    }

    /** Returns true if field address is set (has been asigned a value) and false otherwise */
    public boolean isSetAddress() {
      return this.address != null;
    }

    public void setAddressIsSet(boolean value) {
      if (!value) {
        this.address = null;
      }
    }

    public long getUserid() {
      return this.userid;
    }

    public addAddressForUser_args setUserid(long userid) {
      this.userid = userid;
      setUseridIsSet(true);
      return this;
    }

    public void unsetUserid() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userid is set (has been asigned a value) and false otherwise */
    public boolean isSetUserid() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUseridIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public long getTimestamp() {
      return this.timestamp;
    }

    public addAddressForUser_args setTimestamp(long timestamp) {
      this.timestamp = timestamp;
      setTimestampIsSet(true);
      return this;
    }

    public void unsetTimestamp() {
      __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
    }

    /** Returns true if field timestamp is set (has been asigned a value) and false otherwise */
    public boolean isSetTimestamp() {
      return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
    }

    public void setTimestampIsSet(boolean value) {
      __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ADDRESS:
        if (value == null) {
          unsetAddress();
        } else {
          setAddress((Address)value);
        }
        break;

      case USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((Long)value);
        }
        break;

      case TIMESTAMP:
        if (value == null) {
          unsetTimestamp();
        } else {
          setTimestamp((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ADDRESS:
        return getAddress();

      case USERID:
        return new Long(getUserid());

      case TIMESTAMP:
        return new Long(getTimestamp());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case ADDRESS:
        return isSetAddress();
      case USERID:
        return isSetUserid();
      case TIMESTAMP:
        return isSetTimestamp();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addAddressForUser_args)
        return this.equals((addAddressForUser_args)that);
      return false;
    }

    public boolean equals(addAddressForUser_args that) {
      if (that == null)
        return false;

      boolean this_present_address = true && this.isSetAddress();
      boolean that_present_address = true && that.isSetAddress();
      if (this_present_address || that_present_address) {
        if (!(this_present_address && that_present_address))
          return false;
        if (!this.address.equals(that.address))
          return false;
      }

      boolean this_present_userid = true;
      boolean that_present_userid = true;
      if (this_present_userid || that_present_userid) {
        if (!(this_present_userid && that_present_userid))
          return false;
        if (this.userid != that.userid)
          return false;
      }

      boolean this_present_timestamp = true;
      boolean that_present_timestamp = true;
      if (this_present_timestamp || that_present_timestamp) {
        if (!(this_present_timestamp && that_present_timestamp))
          return false;
        if (this.timestamp != that.timestamp)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addAddressForUser_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addAddressForUser_args typedOther = (addAddressForUser_args)other;

      lastComparison = Boolean.valueOf(isSetAddress()).compareTo(isSetAddress());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(address, typedOther.address);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(isSetUserid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userid, typedOther.userid);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case ADDRESS:
              if (field.type == TType.STRUCT) {
                this.address = new Address();
                this.address.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case USERID:
              if (field.type == TType.I64) {
                this.userid = iprot.readI64();
                setUseridIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TIMESTAMP:
              if (field.type == TType.I64) {
                this.timestamp = iprot.readI64();
                setTimestampIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.address != null) {
        oprot.writeFieldBegin(ADDRESS_FIELD_DESC);
        this.address.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(USERID_FIELD_DESC);
      oprot.writeI64(this.userid);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
      oprot.writeI64(this.timestamp);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addAddressForUser_args(");
      boolean first = true;

      sb.append("address:");
      if (this.address == null) {
        sb.append("null");
      } else {
        sb.append(this.address);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("userid:");
      sb.append(this.userid);
      first = false;
      if (!first) sb.append(", ");
      sb.append("timestamp:");
      sb.append(this.timestamp);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addAddressForUser_result implements TBase<addAddressForUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<addAddressForUser_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("addAddressForUser_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addAddressForUser_result.class, metaDataMap);
    }

    public addAddressForUser_result() {
    }

    public addAddressForUser_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addAddressForUser_result(addAddressForUser_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public addAddressForUser_result deepCopy() {
      return new addAddressForUser_result(this);
    }

    @Deprecated
    public addAddressForUser_result clone() {
      return new addAddressForUser_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public addAddressForUser_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public addAddressForUser_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addAddressForUser_result)
        return this.equals((addAddressForUser_result)that);
      return false;
    }

    public boolean equals(addAddressForUser_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addAddressForUser_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addAddressForUser_result typedOther = (addAddressForUser_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addAddressForUser_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class removeAddressForUser_args implements TBase<removeAddressForUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<removeAddressForUser_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("removeAddressForUser_args");

    private static final TField USERID_FIELD_DESC = new TField("userid", TType.I64, (short)1);
    private static final TField ADDRESS_ID_FIELD_DESC = new TField("addressId", TType.I64, (short)2);

    private long userid;
    private long addressId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USERID((short)1, "userid"),
      ADDRESS_ID((short)2, "addressId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private static final int __ADDRESSID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.USERID, new FieldMetaData("userid", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.ADDRESS_ID, new FieldMetaData("addressId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(removeAddressForUser_args.class, metaDataMap);
    }

    public removeAddressForUser_args() {
    }

    public removeAddressForUser_args(
      long userid,
      long addressId)
    {
      this();
      this.userid = userid;
      setUseridIsSet(true);
      this.addressId = addressId;
      setAddressIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public removeAddressForUser_args(removeAddressForUser_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userid = other.userid;
      this.addressId = other.addressId;
    }

    public removeAddressForUser_args deepCopy() {
      return new removeAddressForUser_args(this);
    }

    @Deprecated
    public removeAddressForUser_args clone() {
      return new removeAddressForUser_args(this);
    }

    public long getUserid() {
      return this.userid;
    }

    public removeAddressForUser_args setUserid(long userid) {
      this.userid = userid;
      setUseridIsSet(true);
      return this;
    }

    public void unsetUserid() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userid is set (has been asigned a value) and false otherwise */
    public boolean isSetUserid() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUseridIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public long getAddressId() {
      return this.addressId;
    }

    public removeAddressForUser_args setAddressId(long addressId) {
      this.addressId = addressId;
      setAddressIdIsSet(true);
      return this;
    }

    public void unsetAddressId() {
      __isset_bit_vector.clear(__ADDRESSID_ISSET_ID);
    }

    /** Returns true if field addressId is set (has been asigned a value) and false otherwise */
    public boolean isSetAddressId() {
      return __isset_bit_vector.get(__ADDRESSID_ISSET_ID);
    }

    public void setAddressIdIsSet(boolean value) {
      __isset_bit_vector.set(__ADDRESSID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((Long)value);
        }
        break;

      case ADDRESS_ID:
        if (value == null) {
          unsetAddressId();
        } else {
          setAddressId((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERID:
        return new Long(getUserid());

      case ADDRESS_ID:
        return new Long(getAddressId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case USERID:
        return isSetUserid();
      case ADDRESS_ID:
        return isSetAddressId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof removeAddressForUser_args)
        return this.equals((removeAddressForUser_args)that);
      return false;
    }

    public boolean equals(removeAddressForUser_args that) {
      if (that == null)
        return false;

      boolean this_present_userid = true;
      boolean that_present_userid = true;
      if (this_present_userid || that_present_userid) {
        if (!(this_present_userid && that_present_userid))
          return false;
        if (this.userid != that.userid)
          return false;
      }

      boolean this_present_addressId = true;
      boolean that_present_addressId = true;
      if (this_present_addressId || that_present_addressId) {
        if (!(this_present_addressId && that_present_addressId))
          return false;
        if (this.addressId != that.addressId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(removeAddressForUser_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      removeAddressForUser_args typedOther = (removeAddressForUser_args)other;

      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(isSetUserid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userid, typedOther.userid);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetAddressId()).compareTo(isSetAddressId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(addressId, typedOther.addressId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case USERID:
              if (field.type == TType.I64) {
                this.userid = iprot.readI64();
                setUseridIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case ADDRESS_ID:
              if (field.type == TType.I64) {
                this.addressId = iprot.readI64();
                setAddressIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USERID_FIELD_DESC);
      oprot.writeI64(this.userid);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ADDRESS_ID_FIELD_DESC);
      oprot.writeI64(this.addressId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("removeAddressForUser_args(");
      boolean first = true;

      sb.append("userid:");
      sb.append(this.userid);
      first = false;
      if (!first) sb.append(", ");
      sb.append("addressId:");
      sb.append(this.addressId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class removeAddressForUser_result implements TBase<removeAddressForUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<removeAddressForUser_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("removeAddressForUser_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(removeAddressForUser_result.class, metaDataMap);
    }

    public removeAddressForUser_result() {
    }

    public removeAddressForUser_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public removeAddressForUser_result(removeAddressForUser_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public removeAddressForUser_result deepCopy() {
      return new removeAddressForUser_result(this);
    }

    @Deprecated
    public removeAddressForUser_result clone() {
      return new removeAddressForUser_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public removeAddressForUser_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public removeAddressForUser_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof removeAddressForUser_result)
        return this.equals((removeAddressForUser_result)that);
      return false;
    }

    public boolean equals(removeAddressForUser_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(removeAddressForUser_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      removeAddressForUser_result typedOther = (removeAddressForUser_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("removeAddressForUser_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class setUserAsLoggedIn_args implements TBase<setUserAsLoggedIn_args._Fields>, java.io.Serializable, Cloneable, Comparable<setUserAsLoggedIn_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("setUserAsLoggedIn_args");

    private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
    private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)2);

    private long userId;
    private long timestamp;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USER_ID((short)1, "userId"),
      TIMESTAMP((short)2, "timestamp");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private static final int __TIMESTAMP_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(setUserAsLoggedIn_args.class, metaDataMap);
    }

    public setUserAsLoggedIn_args() {
    }

    public setUserAsLoggedIn_args(
      long userId,
      long timestamp)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.timestamp = timestamp;
      setTimestampIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public setUserAsLoggedIn_args(setUserAsLoggedIn_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userId = other.userId;
      this.timestamp = other.timestamp;
    }

    public setUserAsLoggedIn_args deepCopy() {
      return new setUserAsLoggedIn_args(this);
    }

    @Deprecated
    public setUserAsLoggedIn_args clone() {
      return new setUserAsLoggedIn_args(this);
    }

    public long getUserId() {
      return this.userId;
    }

    public setUserAsLoggedIn_args setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
      return this;
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userId is set (has been asigned a value) and false otherwise */
    public boolean isSetUserId() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public long getTimestamp() {
      return this.timestamp;
    }

    public setUserAsLoggedIn_args setTimestamp(long timestamp) {
      this.timestamp = timestamp;
      setTimestampIsSet(true);
      return this;
    }

    public void unsetTimestamp() {
      __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
    }

    /** Returns true if field timestamp is set (has been asigned a value) and false otherwise */
    public boolean isSetTimestamp() {
      return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
    }

    public void setTimestampIsSet(boolean value) {
      __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      case TIMESTAMP:
        if (value == null) {
          unsetTimestamp();
        } else {
          setTimestamp((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return new Long(getUserId());

      case TIMESTAMP:
        return new Long(getTimestamp());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case USER_ID:
        return isSetUserId();
      case TIMESTAMP:
        return isSetTimestamp();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof setUserAsLoggedIn_args)
        return this.equals((setUserAsLoggedIn_args)that);
      return false;
    }

    public boolean equals(setUserAsLoggedIn_args that) {
      if (that == null)
        return false;

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      boolean this_present_timestamp = true;
      boolean that_present_timestamp = true;
      if (this_present_timestamp || that_present_timestamp) {
        if (!(this_present_timestamp && that_present_timestamp))
          return false;
        if (this.timestamp != that.timestamp)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(setUserAsLoggedIn_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      setUserAsLoggedIn_args typedOther = (setUserAsLoggedIn_args)other;

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case USER_ID:
              if (field.type == TType.I64) {
                this.userId = iprot.readI64();
                setUserIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TIMESTAMP:
              if (field.type == TType.I64) {
                this.timestamp = iprot.readI64();
                setTimestampIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
      oprot.writeI64(this.timestamp);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("setUserAsLoggedIn_args(");
      boolean first = true;

      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("timestamp:");
      sb.append(this.timestamp);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class setUserAsLoggedIn_result implements TBase<setUserAsLoggedIn_result._Fields>, java.io.Serializable, Cloneable, Comparable<setUserAsLoggedIn_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("setUserAsLoggedIn_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(setUserAsLoggedIn_result.class, metaDataMap);
    }

    public setUserAsLoggedIn_result() {
    }

    public setUserAsLoggedIn_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public setUserAsLoggedIn_result(setUserAsLoggedIn_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public setUserAsLoggedIn_result deepCopy() {
      return new setUserAsLoggedIn_result(this);
    }

    @Deprecated
    public setUserAsLoggedIn_result clone() {
      return new setUserAsLoggedIn_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public setUserAsLoggedIn_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public setUserAsLoggedIn_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof setUserAsLoggedIn_result)
        return this.equals((setUserAsLoggedIn_result)that);
      return false;
    }

    public boolean equals(setUserAsLoggedIn_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(setUserAsLoggedIn_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      setUserAsLoggedIn_result typedOther = (setUserAsLoggedIn_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("setUserAsLoggedIn_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class setUserAsLoggedOut_args implements TBase<setUserAsLoggedOut_args._Fields>, java.io.Serializable, Cloneable, Comparable<setUserAsLoggedOut_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("setUserAsLoggedOut_args");

    private static final TField USERID_FIELD_DESC = new TField("userid", TType.I64, (short)1);
    private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)2);

    private long userid;
    private long timestamp;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USERID((short)1, "userid"),
      TIMESTAMP((short)2, "timestamp");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private static final int __TIMESTAMP_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.USERID, new FieldMetaData("userid", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(setUserAsLoggedOut_args.class, metaDataMap);
    }

    public setUserAsLoggedOut_args() {
    }

    public setUserAsLoggedOut_args(
      long userid,
      long timestamp)
    {
      this();
      this.userid = userid;
      setUseridIsSet(true);
      this.timestamp = timestamp;
      setTimestampIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public setUserAsLoggedOut_args(setUserAsLoggedOut_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userid = other.userid;
      this.timestamp = other.timestamp;
    }

    public setUserAsLoggedOut_args deepCopy() {
      return new setUserAsLoggedOut_args(this);
    }

    @Deprecated
    public setUserAsLoggedOut_args clone() {
      return new setUserAsLoggedOut_args(this);
    }

    public long getUserid() {
      return this.userid;
    }

    public setUserAsLoggedOut_args setUserid(long userid) {
      this.userid = userid;
      setUseridIsSet(true);
      return this;
    }

    public void unsetUserid() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userid is set (has been asigned a value) and false otherwise */
    public boolean isSetUserid() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUseridIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public long getTimestamp() {
      return this.timestamp;
    }

    public setUserAsLoggedOut_args setTimestamp(long timestamp) {
      this.timestamp = timestamp;
      setTimestampIsSet(true);
      return this;
    }

    public void unsetTimestamp() {
      __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
    }

    /** Returns true if field timestamp is set (has been asigned a value) and false otherwise */
    public boolean isSetTimestamp() {
      return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
    }

    public void setTimestampIsSet(boolean value) {
      __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((Long)value);
        }
        break;

      case TIMESTAMP:
        if (value == null) {
          unsetTimestamp();
        } else {
          setTimestamp((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERID:
        return new Long(getUserid());

      case TIMESTAMP:
        return new Long(getTimestamp());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case USERID:
        return isSetUserid();
      case TIMESTAMP:
        return isSetTimestamp();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof setUserAsLoggedOut_args)
        return this.equals((setUserAsLoggedOut_args)that);
      return false;
    }

    public boolean equals(setUserAsLoggedOut_args that) {
      if (that == null)
        return false;

      boolean this_present_userid = true;
      boolean that_present_userid = true;
      if (this_present_userid || that_present_userid) {
        if (!(this_present_userid && that_present_userid))
          return false;
        if (this.userid != that.userid)
          return false;
      }

      boolean this_present_timestamp = true;
      boolean that_present_timestamp = true;
      if (this_present_timestamp || that_present_timestamp) {
        if (!(this_present_timestamp && that_present_timestamp))
          return false;
        if (this.timestamp != that.timestamp)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(setUserAsLoggedOut_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      setUserAsLoggedOut_args typedOther = (setUserAsLoggedOut_args)other;

      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(isSetUserid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userid, typedOther.userid);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case USERID:
              if (field.type == TType.I64) {
                this.userid = iprot.readI64();
                setUseridIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case TIMESTAMP:
              if (field.type == TType.I64) {
                this.timestamp = iprot.readI64();
                setTimestampIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USERID_FIELD_DESC);
      oprot.writeI64(this.userid);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
      oprot.writeI64(this.timestamp);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("setUserAsLoggedOut_args(");
      boolean first = true;

      sb.append("userid:");
      sb.append(this.userid);
      first = false;
      if (!first) sb.append(", ");
      sb.append("timestamp:");
      sb.append(this.timestamp);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class setUserAsLoggedOut_result implements TBase<setUserAsLoggedOut_result._Fields>, java.io.Serializable, Cloneable, Comparable<setUserAsLoggedOut_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("setUserAsLoggedOut_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(setUserAsLoggedOut_result.class, metaDataMap);
    }

    public setUserAsLoggedOut_result() {
    }

    public setUserAsLoggedOut_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public setUserAsLoggedOut_result(setUserAsLoggedOut_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public setUserAsLoggedOut_result deepCopy() {
      return new setUserAsLoggedOut_result(this);
    }

    @Deprecated
    public setUserAsLoggedOut_result clone() {
      return new setUserAsLoggedOut_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public setUserAsLoggedOut_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public setUserAsLoggedOut_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof setUserAsLoggedOut_result)
        return this.equals((setUserAsLoggedOut_result)that);
      return false;
    }

    public boolean equals(setUserAsLoggedOut_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(setUserAsLoggedOut_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      setUserAsLoggedOut_result typedOther = (setUserAsLoggedOut_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("setUserAsLoggedOut_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class updatePassword_args implements TBase<updatePassword_args._Fields>, java.io.Serializable, Cloneable, Comparable<updatePassword_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("updatePassword_args");

    private static final TField USERID_FIELD_DESC = new TField("userid", TType.I64, (short)1);
    private static final TField PASSWORD_FIELD_DESC = new TField("password", TType.STRING, (short)2);

    private long userid;
    private String password;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USERID((short)1, "userid"),
      PASSWORD((short)2, "password");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.USERID, new FieldMetaData("userid", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.PASSWORD, new FieldMetaData("password", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(updatePassword_args.class, metaDataMap);
    }

    public updatePassword_args() {
    }

    public updatePassword_args(
      long userid,
      String password)
    {
      this();
      this.userid = userid;
      setUseridIsSet(true);
      this.password = password;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updatePassword_args(updatePassword_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userid = other.userid;
      if (other.isSetPassword()) {
        this.password = other.password;
      }
    }

    public updatePassword_args deepCopy() {
      return new updatePassword_args(this);
    }

    @Deprecated
    public updatePassword_args clone() {
      return new updatePassword_args(this);
    }

    public long getUserid() {
      return this.userid;
    }

    public updatePassword_args setUserid(long userid) {
      this.userid = userid;
      setUseridIsSet(true);
      return this;
    }

    public void unsetUserid() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userid is set (has been asigned a value) and false otherwise */
    public boolean isSetUserid() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUseridIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public String getPassword() {
      return this.password;
    }

    public updatePassword_args setPassword(String password) {
      this.password = password;
      return this;
    }

    public void unsetPassword() {
      this.password = null;
    }

    /** Returns true if field password is set (has been asigned a value) and false otherwise */
    public boolean isSetPassword() {
      return this.password != null;
    }

    public void setPasswordIsSet(boolean value) {
      if (!value) {
        this.password = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((Long)value);
        }
        break;

      case PASSWORD:
        if (value == null) {
          unsetPassword();
        } else {
          setPassword((String)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERID:
        return new Long(getUserid());

      case PASSWORD:
        return getPassword();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case USERID:
        return isSetUserid();
      case PASSWORD:
        return isSetPassword();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updatePassword_args)
        return this.equals((updatePassword_args)that);
      return false;
    }

    public boolean equals(updatePassword_args that) {
      if (that == null)
        return false;

      boolean this_present_userid = true;
      boolean that_present_userid = true;
      if (this_present_userid || that_present_userid) {
        if (!(this_present_userid && that_present_userid))
          return false;
        if (this.userid != that.userid)
          return false;
      }

      boolean this_present_password = true && this.isSetPassword();
      boolean that_present_password = true && that.isSetPassword();
      if (this_present_password || that_present_password) {
        if (!(this_present_password && that_present_password))
          return false;
        if (!this.password.equals(that.password))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updatePassword_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updatePassword_args typedOther = (updatePassword_args)other;

      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(isSetUserid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userid, typedOther.userid);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetPassword()).compareTo(isSetPassword());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(password, typedOther.password);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case USERID:
              if (field.type == TType.I64) {
                this.userid = iprot.readI64();
                setUseridIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case PASSWORD:
              if (field.type == TType.STRING) {
                this.password = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USERID_FIELD_DESC);
      oprot.writeI64(this.userid);
      oprot.writeFieldEnd();
      if (this.password != null) {
        oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
        oprot.writeString(this.password);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updatePassword_args(");
      boolean first = true;

      sb.append("userid:");
      sb.append(this.userid);
      first = false;
      if (!first) sb.append(", ");
      sb.append("password:");
      if (this.password == null) {
        sb.append("null");
      } else {
        sb.append(this.password);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class updatePassword_result implements TBase<updatePassword_result._Fields>, java.io.Serializable, Cloneable, Comparable<updatePassword_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("updatePassword_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(updatePassword_result.class, metaDataMap);
    }

    public updatePassword_result() {
    }

    public updatePassword_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updatePassword_result(updatePassword_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public updatePassword_result deepCopy() {
      return new updatePassword_result(this);
    }

    @Deprecated
    public updatePassword_result clone() {
      return new updatePassword_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public updatePassword_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public updatePassword_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updatePassword_result)
        return this.equals((updatePassword_result)that);
      return false;
    }

    public boolean equals(updatePassword_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updatePassword_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updatePassword_result typedOther = (updatePassword_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updatePassword_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class deleteUser_args implements TBase<deleteUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<deleteUser_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("deleteUser_args");

    private static final TField USERID_FIELD_DESC = new TField("userid", TType.I64, (short)1);
    private static final TField IS_SESSION_ID_FIELD_DESC = new TField("isSessionId", TType.BOOL, (short)2);

    private long userid;
    private boolean isSessionId;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USERID((short)1, "userid"),
      IS_SESSION_ID((short)2, "isSessionId");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private static final int __ISSESSIONID_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.USERID, new FieldMetaData("userid", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.IS_SESSION_ID, new FieldMetaData("isSessionId", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(deleteUser_args.class, metaDataMap);
    }

    public deleteUser_args() {
    }

    public deleteUser_args(
      long userid,
      boolean isSessionId)
    {
      this();
      this.userid = userid;
      setUseridIsSet(true);
      this.isSessionId = isSessionId;
      setIsSessionIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public deleteUser_args(deleteUser_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userid = other.userid;
      this.isSessionId = other.isSessionId;
    }

    public deleteUser_args deepCopy() {
      return new deleteUser_args(this);
    }

    @Deprecated
    public deleteUser_args clone() {
      return new deleteUser_args(this);
    }

    public long getUserid() {
      return this.userid;
    }

    public deleteUser_args setUserid(long userid) {
      this.userid = userid;
      setUseridIsSet(true);
      return this;
    }

    public void unsetUserid() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userid is set (has been asigned a value) and false otherwise */
    public boolean isSetUserid() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUseridIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public boolean isIsSessionId() {
      return this.isSessionId;
    }

    public deleteUser_args setIsSessionId(boolean isSessionId) {
      this.isSessionId = isSessionId;
      setIsSessionIdIsSet(true);
      return this;
    }

    public void unsetIsSessionId() {
      __isset_bit_vector.clear(__ISSESSIONID_ISSET_ID);
    }

    /** Returns true if field isSessionId is set (has been asigned a value) and false otherwise */
    public boolean isSetIsSessionId() {
      return __isset_bit_vector.get(__ISSESSIONID_ISSET_ID);
    }

    public void setIsSessionIdIsSet(boolean value) {
      __isset_bit_vector.set(__ISSESSIONID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((Long)value);
        }
        break;

      case IS_SESSION_ID:
        if (value == null) {
          unsetIsSessionId();
        } else {
          setIsSessionId((Boolean)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERID:
        return new Long(getUserid());

      case IS_SESSION_ID:
        return new Boolean(isIsSessionId());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case USERID:
        return isSetUserid();
      case IS_SESSION_ID:
        return isSetIsSessionId();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof deleteUser_args)
        return this.equals((deleteUser_args)that);
      return false;
    }

    public boolean equals(deleteUser_args that) {
      if (that == null)
        return false;

      boolean this_present_userid = true;
      boolean that_present_userid = true;
      if (this_present_userid || that_present_userid) {
        if (!(this_present_userid && that_present_userid))
          return false;
        if (this.userid != that.userid)
          return false;
      }

      boolean this_present_isSessionId = true;
      boolean that_present_isSessionId = true;
      if (this_present_isSessionId || that_present_isSessionId) {
        if (!(this_present_isSessionId && that_present_isSessionId))
          return false;
        if (this.isSessionId != that.isSessionId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(deleteUser_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      deleteUser_args typedOther = (deleteUser_args)other;

      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(isSetUserid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userid, typedOther.userid);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetIsSessionId()).compareTo(isSetIsSessionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(isSessionId, typedOther.isSessionId);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case USERID:
              if (field.type == TType.I64) {
                this.userid = iprot.readI64();
                setUseridIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case IS_SESSION_ID:
              if (field.type == TType.BOOL) {
                this.isSessionId = iprot.readBool();
                setIsSessionIdIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USERID_FIELD_DESC);
      oprot.writeI64(this.userid);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(IS_SESSION_ID_FIELD_DESC);
      oprot.writeBool(this.isSessionId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("deleteUser_args(");
      boolean first = true;

      sb.append("userid:");
      sb.append(this.userid);
      first = false;
      if (!first) sb.append(", ");
      sb.append("isSessionId:");
      sb.append(this.isSessionId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class deleteUser_result implements TBase<deleteUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<deleteUser_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("deleteUser_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(deleteUser_result.class, metaDataMap);
    }

    public deleteUser_result() {
    }

    public deleteUser_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public deleteUser_result(deleteUser_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public deleteUser_result deepCopy() {
      return new deleteUser_result(this);
    }

    @Deprecated
    public deleteUser_result clone() {
      return new deleteUser_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public deleteUser_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public deleteUser_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof deleteUser_result)
        return this.equals((deleteUser_result)that);
      return false;
    }

    public boolean equals(deleteUser_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(deleteUser_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      deleteUser_result typedOther = (deleteUser_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("deleteUser_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class sendEmailVerification_args implements TBase<sendEmailVerification_args._Fields>, java.io.Serializable, Cloneable, Comparable<sendEmailVerification_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("sendEmailVerification_args");

    private static final TField USERID_FIELD_DESC = new TField("userid", TType.I64, (short)1);

    private long userid;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USERID((short)1, "userid");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.USERID, new FieldMetaData("userid", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(sendEmailVerification_args.class, metaDataMap);
    }

    public sendEmailVerification_args() {
    }

    public sendEmailVerification_args(
      long userid)
    {
      this();
      this.userid = userid;
      setUseridIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public sendEmailVerification_args(sendEmailVerification_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userid = other.userid;
    }

    public sendEmailVerification_args deepCopy() {
      return new sendEmailVerification_args(this);
    }

    @Deprecated
    public sendEmailVerification_args clone() {
      return new sendEmailVerification_args(this);
    }

    public long getUserid() {
      return this.userid;
    }

    public sendEmailVerification_args setUserid(long userid) {
      this.userid = userid;
      setUseridIsSet(true);
      return this;
    }

    public void unsetUserid() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userid is set (has been asigned a value) and false otherwise */
    public boolean isSetUserid() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUseridIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERID:
        return new Long(getUserid());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case USERID:
        return isSetUserid();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof sendEmailVerification_args)
        return this.equals((sendEmailVerification_args)that);
      return false;
    }

    public boolean equals(sendEmailVerification_args that) {
      if (that == null)
        return false;

      boolean this_present_userid = true;
      boolean that_present_userid = true;
      if (this_present_userid || that_present_userid) {
        if (!(this_present_userid && that_present_userid))
          return false;
        if (this.userid != that.userid)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(sendEmailVerification_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      sendEmailVerification_args typedOther = (sendEmailVerification_args)other;

      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(isSetUserid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userid, typedOther.userid);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case USERID:
              if (field.type == TType.I64) {
                this.userid = iprot.readI64();
                setUseridIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USERID_FIELD_DESC);
      oprot.writeI64(this.userid);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("sendEmailVerification_args(");
      boolean first = true;

      sb.append("userid:");
      sb.append(this.userid);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class sendEmailVerification_result implements TBase<sendEmailVerification_result._Fields>, java.io.Serializable, Cloneable, Comparable<sendEmailVerification_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("sendEmailVerification_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(sendEmailVerification_result.class, metaDataMap);
    }

    public sendEmailVerification_result() {
    }

    public sendEmailVerification_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public sendEmailVerification_result(sendEmailVerification_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public sendEmailVerification_result deepCopy() {
      return new sendEmailVerification_result(this);
    }

    @Deprecated
    public sendEmailVerification_result clone() {
      return new sendEmailVerification_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public sendEmailVerification_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public sendEmailVerification_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof sendEmailVerification_result)
        return this.equals((sendEmailVerification_result)that);
      return false;
    }

    public boolean equals(sendEmailVerification_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(sendEmailVerification_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      sendEmailVerification_result typedOther = (sendEmailVerification_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("sendEmailVerification_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class sendSMSVerification_args implements TBase<sendSMSVerification_args._Fields>, java.io.Serializable, Cloneable, Comparable<sendSMSVerification_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("sendSMSVerification_args");

    private static final TField USERID_FIELD_DESC = new TField("userid", TType.I64, (short)1);

    private long userid;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USERID((short)1, "userid");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.USERID, new FieldMetaData("userid", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(sendSMSVerification_args.class, metaDataMap);
    }

    public sendSMSVerification_args() {
    }

    public sendSMSVerification_args(
      long userid)
    {
      this();
      this.userid = userid;
      setUseridIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public sendSMSVerification_args(sendSMSVerification_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userid = other.userid;
    }

    public sendSMSVerification_args deepCopy() {
      return new sendSMSVerification_args(this);
    }

    @Deprecated
    public sendSMSVerification_args clone() {
      return new sendSMSVerification_args(this);
    }

    public long getUserid() {
      return this.userid;
    }

    public sendSMSVerification_args setUserid(long userid) {
      this.userid = userid;
      setUseridIsSet(true);
      return this;
    }

    public void unsetUserid() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userid is set (has been asigned a value) and false otherwise */
    public boolean isSetUserid() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUseridIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERID:
        return new Long(getUserid());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case USERID:
        return isSetUserid();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof sendSMSVerification_args)
        return this.equals((sendSMSVerification_args)that);
      return false;
    }

    public boolean equals(sendSMSVerification_args that) {
      if (that == null)
        return false;

      boolean this_present_userid = true;
      boolean that_present_userid = true;
      if (this_present_userid || that_present_userid) {
        if (!(this_present_userid && that_present_userid))
          return false;
        if (this.userid != that.userid)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(sendSMSVerification_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      sendSMSVerification_args typedOther = (sendSMSVerification_args)other;

      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(isSetUserid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userid, typedOther.userid);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case USERID:
              if (field.type == TType.I64) {
                this.userid = iprot.readI64();
                setUseridIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USERID_FIELD_DESC);
      oprot.writeI64(this.userid);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("sendSMSVerification_args(");
      boolean first = true;

      sb.append("userid:");
      sb.append(this.userid);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class sendSMSVerification_result implements TBase<sendSMSVerification_result._Fields>, java.io.Serializable, Cloneable, Comparable<sendSMSVerification_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("sendSMSVerification_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(sendSMSVerification_result.class, metaDataMap);
    }

    public sendSMSVerification_result() {
    }

    public sendSMSVerification_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public sendSMSVerification_result(sendSMSVerification_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public sendSMSVerification_result deepCopy() {
      return new sendSMSVerification_result(this);
    }

    @Deprecated
    public sendSMSVerification_result clone() {
      return new sendSMSVerification_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public sendSMSVerification_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public sendSMSVerification_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof sendSMSVerification_result)
        return this.equals((sendSMSVerification_result)that);
      return false;
    }

    public boolean equals(sendSMSVerification_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(sendSMSVerification_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      sendSMSVerification_result typedOther = (sendSMSVerification_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("sendSMSVerification_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class confirmEmailVerification_args implements TBase<confirmEmailVerification_args._Fields>, java.io.Serializable, Cloneable, Comparable<confirmEmailVerification_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("confirmEmailVerification_args");

    private static final TField USERID_FIELD_DESC = new TField("userid", TType.I64, (short)1);

    private long userid;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USERID((short)1, "userid");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.USERID, new FieldMetaData("userid", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(confirmEmailVerification_args.class, metaDataMap);
    }

    public confirmEmailVerification_args() {
    }

    public confirmEmailVerification_args(
      long userid)
    {
      this();
      this.userid = userid;
      setUseridIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public confirmEmailVerification_args(confirmEmailVerification_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userid = other.userid;
    }

    public confirmEmailVerification_args deepCopy() {
      return new confirmEmailVerification_args(this);
    }

    @Deprecated
    public confirmEmailVerification_args clone() {
      return new confirmEmailVerification_args(this);
    }

    public long getUserid() {
      return this.userid;
    }

    public confirmEmailVerification_args setUserid(long userid) {
      this.userid = userid;
      setUseridIsSet(true);
      return this;
    }

    public void unsetUserid() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userid is set (has been asigned a value) and false otherwise */
    public boolean isSetUserid() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUseridIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERID:
        return new Long(getUserid());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case USERID:
        return isSetUserid();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof confirmEmailVerification_args)
        return this.equals((confirmEmailVerification_args)that);
      return false;
    }

    public boolean equals(confirmEmailVerification_args that) {
      if (that == null)
        return false;

      boolean this_present_userid = true;
      boolean that_present_userid = true;
      if (this_present_userid || that_present_userid) {
        if (!(this_present_userid && that_present_userid))
          return false;
        if (this.userid != that.userid)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(confirmEmailVerification_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      confirmEmailVerification_args typedOther = (confirmEmailVerification_args)other;

      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(isSetUserid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userid, typedOther.userid);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case USERID:
              if (field.type == TType.I64) {
                this.userid = iprot.readI64();
                setUseridIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USERID_FIELD_DESC);
      oprot.writeI64(this.userid);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("confirmEmailVerification_args(");
      boolean first = true;

      sb.append("userid:");
      sb.append(this.userid);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class confirmEmailVerification_result implements TBase<confirmEmailVerification_result._Fields>, java.io.Serializable, Cloneable, Comparable<confirmEmailVerification_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("confirmEmailVerification_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(confirmEmailVerification_result.class, metaDataMap);
    }

    public confirmEmailVerification_result() {
    }

    public confirmEmailVerification_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public confirmEmailVerification_result(confirmEmailVerification_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public confirmEmailVerification_result deepCopy() {
      return new confirmEmailVerification_result(this);
    }

    @Deprecated
    public confirmEmailVerification_result clone() {
      return new confirmEmailVerification_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public confirmEmailVerification_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public confirmEmailVerification_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof confirmEmailVerification_result)
        return this.equals((confirmEmailVerification_result)that);
      return false;
    }

    public boolean equals(confirmEmailVerification_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(confirmEmailVerification_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      confirmEmailVerification_result typedOther = (confirmEmailVerification_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("confirmEmailVerification_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class confirmSMSVerification_args implements TBase<confirmSMSVerification_args._Fields>, java.io.Serializable, Cloneable, Comparable<confirmSMSVerification_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("confirmSMSVerification_args");

    private static final TField USERID_FIELD_DESC = new TField("userid", TType.I64, (short)1);

    private long userid;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USERID((short)1, "userid");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.USERID, new FieldMetaData("userid", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(confirmSMSVerification_args.class, metaDataMap);
    }

    public confirmSMSVerification_args() {
    }

    public confirmSMSVerification_args(
      long userid)
    {
      this();
      this.userid = userid;
      setUseridIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public confirmSMSVerification_args(confirmSMSVerification_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userid = other.userid;
    }

    public confirmSMSVerification_args deepCopy() {
      return new confirmSMSVerification_args(this);
    }

    @Deprecated
    public confirmSMSVerification_args clone() {
      return new confirmSMSVerification_args(this);
    }

    public long getUserid() {
      return this.userid;
    }

    public confirmSMSVerification_args setUserid(long userid) {
      this.userid = userid;
      setUseridIsSet(true);
      return this;
    }

    public void unsetUserid() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userid is set (has been asigned a value) and false otherwise */
    public boolean isSetUserid() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUseridIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((Long)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERID:
        return new Long(getUserid());

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case USERID:
        return isSetUserid();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof confirmSMSVerification_args)
        return this.equals((confirmSMSVerification_args)that);
      return false;
    }

    public boolean equals(confirmSMSVerification_args that) {
      if (that == null)
        return false;

      boolean this_present_userid = true;
      boolean that_present_userid = true;
      if (this_present_userid || that_present_userid) {
        if (!(this_present_userid && that_present_userid))
          return false;
        if (this.userid != that.userid)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(confirmSMSVerification_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      confirmSMSVerification_args typedOther = (confirmSMSVerification_args)other;

      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(isSetUserid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userid, typedOther.userid);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case USERID:
              if (field.type == TType.I64) {
                this.userid = iprot.readI64();
                setUseridIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USERID_FIELD_DESC);
      oprot.writeI64(this.userid);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("confirmSMSVerification_args(");
      boolean first = true;

      sb.append("userid:");
      sb.append(this.userid);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class confirmSMSVerification_result implements TBase<confirmSMSVerification_result._Fields>, java.io.Serializable, Cloneable, Comparable<confirmSMSVerification_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("confirmSMSVerification_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(confirmSMSVerification_result.class, metaDataMap);
    }

    public confirmSMSVerification_result() {
    }

    public confirmSMSVerification_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public confirmSMSVerification_result(confirmSMSVerification_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public confirmSMSVerification_result deepCopy() {
      return new confirmSMSVerification_result(this);
    }

    @Deprecated
    public confirmSMSVerification_result clone() {
      return new confirmSMSVerification_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public confirmSMSVerification_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public confirmSMSVerification_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof confirmSMSVerification_result)
        return this.equals((confirmSMSVerification_result)that);
      return false;
    }

    public boolean equals(confirmSMSVerification_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(confirmSMSVerification_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      confirmSMSVerification_result typedOther = (confirmSMSVerification_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("confirmSMSVerification_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addSocialhandle_args implements TBase<addSocialhandle_args._Fields>, java.io.Serializable, Cloneable, Comparable<addSocialhandle_args>   {
    private static final TStruct STRUCT_DESC = new TStruct("addSocialhandle_args");

    private static final TField USERID_FIELD_DESC = new TField("userid", TType.I64, (short)1);
    private static final TField SOCIAL_SERVICE_FIELD_DESC = new TField("socialService", TType.STRING, (short)2);
    private static final TField HANDLE_FIELD_DESC = new TField("handle", TType.STRING, (short)3);

    private long userid;
    private String socialService;
    private String handle;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      USERID((short)1, "userid"),
      SOCIAL_SERVICE((short)2, "socialService"),
      HANDLE((short)3, "handle");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.USERID, new FieldMetaData("userid", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.I64)));
      put(_Fields.SOCIAL_SERVICE, new FieldMetaData("socialService", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
      put(_Fields.HANDLE, new FieldMetaData("handle", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRING)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addSocialhandle_args.class, metaDataMap);
    }

    public addSocialhandle_args() {
    }

    public addSocialhandle_args(
      long userid,
      String socialService,
      String handle)
    {
      this();
      this.userid = userid;
      setUseridIsSet(true);
      this.socialService = socialService;
      this.handle = handle;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addSocialhandle_args(addSocialhandle_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userid = other.userid;
      if (other.isSetSocialService()) {
        this.socialService = other.socialService;
      }
      if (other.isSetHandle()) {
        this.handle = other.handle;
      }
    }

    public addSocialhandle_args deepCopy() {
      return new addSocialhandle_args(this);
    }

    @Deprecated
    public addSocialhandle_args clone() {
      return new addSocialhandle_args(this);
    }

    public long getUserid() {
      return this.userid;
    }

    public addSocialhandle_args setUserid(long userid) {
      this.userid = userid;
      setUseridIsSet(true);
      return this;
    }

    public void unsetUserid() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userid is set (has been asigned a value) and false otherwise */
    public boolean isSetUserid() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUseridIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public String getSocialService() {
      return this.socialService;
    }

    public addSocialhandle_args setSocialService(String socialService) {
      this.socialService = socialService;
      return this;
    }

    public void unsetSocialService() {
      this.socialService = null;
    }

    /** Returns true if field socialService is set (has been asigned a value) and false otherwise */
    public boolean isSetSocialService() {
      return this.socialService != null;
    }

    public void setSocialServiceIsSet(boolean value) {
      if (!value) {
        this.socialService = null;
      }
    }

    public String getHandle() {
      return this.handle;
    }

    public addSocialhandle_args setHandle(String handle) {
      this.handle = handle;
      return this;
    }

    public void unsetHandle() {
      this.handle = null;
    }

    /** Returns true if field handle is set (has been asigned a value) and false otherwise */
    public boolean isSetHandle() {
      return this.handle != null;
    }

    public void setHandleIsSet(boolean value) {
      if (!value) {
        this.handle = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((Long)value);
        }
        break;

      case SOCIAL_SERVICE:
        if (value == null) {
          unsetSocialService();
        } else {
          setSocialService((String)value);
        }
        break;

      case HANDLE:
        if (value == null) {
          unsetHandle();
        } else {
          setHandle((String)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERID:
        return new Long(getUserid());

      case SOCIAL_SERVICE:
        return getSocialService();

      case HANDLE:
        return getHandle();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case USERID:
        return isSetUserid();
      case SOCIAL_SERVICE:
        return isSetSocialService();
      case HANDLE:
        return isSetHandle();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addSocialhandle_args)
        return this.equals((addSocialhandle_args)that);
      return false;
    }

    public boolean equals(addSocialhandle_args that) {
      if (that == null)
        return false;

      boolean this_present_userid = true;
      boolean that_present_userid = true;
      if (this_present_userid || that_present_userid) {
        if (!(this_present_userid && that_present_userid))
          return false;
        if (this.userid != that.userid)
          return false;
      }

      boolean this_present_socialService = true && this.isSetSocialService();
      boolean that_present_socialService = true && that.isSetSocialService();
      if (this_present_socialService || that_present_socialService) {
        if (!(this_present_socialService && that_present_socialService))
          return false;
        if (!this.socialService.equals(that.socialService))
          return false;
      }

      boolean this_present_handle = true && this.isSetHandle();
      boolean that_present_handle = true && that.isSetHandle();
      if (this_present_handle || that_present_handle) {
        if (!(this_present_handle && that_present_handle))
          return false;
        if (!this.handle.equals(that.handle))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addSocialhandle_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addSocialhandle_args typedOther = (addSocialhandle_args)other;

      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(isSetUserid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(userid, typedOther.userid);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetSocialService()).compareTo(isSetSocialService());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(socialService, typedOther.socialService);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetHandle()).compareTo(isSetHandle());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(handle, typedOther.handle);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case USERID:
              if (field.type == TType.I64) {
                this.userid = iprot.readI64();
                setUseridIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case SOCIAL_SERVICE:
              if (field.type == TType.STRING) {
                this.socialService = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case HANDLE:
              if (field.type == TType.STRING) {
                this.handle = iprot.readString();
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USERID_FIELD_DESC);
      oprot.writeI64(this.userid);
      oprot.writeFieldEnd();
      if (this.socialService != null) {
        oprot.writeFieldBegin(SOCIAL_SERVICE_FIELD_DESC);
        oprot.writeString(this.socialService);
        oprot.writeFieldEnd();
      }
      if (this.handle != null) {
        oprot.writeFieldBegin(HANDLE_FIELD_DESC);
        oprot.writeString(this.handle);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addSocialhandle_args(");
      boolean first = true;

      sb.append("userid:");
      sb.append(this.userid);
      first = false;
      if (!first) sb.append(", ");
      sb.append("socialService:");
      if (this.socialService == null) {
        sb.append("null");
      } else {
        sb.append(this.socialService);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("handle:");
      if (this.handle == null) {
        sb.append("null");
      } else {
        sb.append(this.handle);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

  public static class addSocialhandle_result implements TBase<addSocialhandle_result._Fields>, java.io.Serializable, Cloneable, Comparable<addSocialhandle_result>   {
    private static final TStruct STRUCT_DESC = new TStruct("addSocialhandle_result");

    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);

    private boolean success;
    private UserContextException ucx;

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements TFieldIdEnum {
      SUCCESS((short)0, "success"),
      UCX((short)1, "ucx");

      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byId.put((int)field._thriftId, field);
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        return byId.get(fieldId);
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.BOOL)));
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
          new FieldValueMetaData(TType.STRUCT)));
    }});

    static {
      FieldMetaData.addStructMetaDataMap(addSocialhandle_result.class, metaDataMap);
    }

    public addSocialhandle_result() {
    }

    public addSocialhandle_result(
      boolean success,
      UserContextException ucx)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.ucx = ucx;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public addSocialhandle_result(addSocialhandle_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetUcx()) {
        this.ucx = new UserContextException(other.ucx);
      }
    }

    public addSocialhandle_result deepCopy() {
      return new addSocialhandle_result(this);
    }

    @Deprecated
    public addSocialhandle_result clone() {
      return new addSocialhandle_result(this);
    }

    public boolean isSuccess() {
      return this.success;
    }

    public addSocialhandle_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been asigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public UserContextException getUcx() {
      return this.ucx;
    }

    public addSocialhandle_result setUcx(UserContextException ucx) {
      this.ucx = ucx;
      return this;
    }

    public void unsetUcx() {
      this.ucx = null;
    }

    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
    public boolean isSetUcx() {
      return this.ucx != null;
    }

    public void setUcxIsSet(boolean value) {
      if (!value) {
        this.ucx = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case UCX:
        if (value == null) {
          unsetUcx();
        } else {
          setUcx((UserContextException)value);
        }
        break;

      }
    }

    public void setFieldValue(int fieldID, Object value) {
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return new Boolean(isSuccess());

      case UCX:
        return getUcx();

      }
      throw new IllegalStateException();
    }

    public Object getFieldValue(int fieldId) {
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
    }

    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case UCX:
        return isSetUcx();
      }
      throw new IllegalStateException();
    }

    public boolean isSet(int fieldID) {
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof addSocialhandle_result)
        return this.equals((addSocialhandle_result)that);
      return false;
    }

    public boolean equals(addSocialhandle_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_ucx = true && this.isSetUcx();
      boolean that_present_ucx = true && that.isSetUcx();
      if (this_present_ucx || that_present_ucx) {
        if (!(this_present_ucx && that_present_ucx))
          return false;
        if (!this.ucx.equals(that.ucx))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(addSocialhandle_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      addSocialhandle_result typedOther = (addSocialhandle_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
      if (lastComparison != 0) {
        return lastComparison;
      }
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
      if (lastComparison != 0) {
        return lastComparison;
      }
      return 0;
    }

    public void read(TProtocol iprot) throws TException {
      TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) { 
          break;
        }
        _Fields fieldId = _Fields.findByThriftId(field.id);
        if (fieldId == null) {
          TProtocolUtil.skip(iprot, field.type);
        } else {
          switch (fieldId) {
            case SUCCESS:
              if (field.type == TType.BOOL) {
                this.success = iprot.readBool();
                setSuccessIsSet(true);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
            case UCX:
              if (field.type == TType.STRUCT) {
                this.ucx = new UserContextException();
                this.ucx.read(iprot);
              } else { 
                TProtocolUtil.skip(iprot, field.type);
              }
              break;
          }
          iprot.readFieldEnd();
        }
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(TProtocol oprot) throws TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetUcx()) {
        oprot.writeFieldBegin(UCX_FIELD_DESC);
        this.ucx.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("addSocialhandle_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("ucx:");
      if (this.ucx == null) {
        sb.append("null");
      } else {
        sb.append(this.ucx);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws TException {
      // check for required fields
    }

  }

}