All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.aroma.thrift.email.service.EmailService Maven / Gradle / Ivy

Go to download

Part of the Aroma Project. This project contains the Service and Model Definitions. From this the Server and Client interfaces are generated for the Aroma Service.

There is a newer version: 2.2
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package tech.aroma.thrift.email.service;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
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.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-10")
public class EmailService {

  /**
   * The Notification  Service sends events and Notifications to the proper channels.
   * This includes Email, Slack, iOS Push Notification, etc.
   */
  public interface Iface {

    public double getApiVersion() throws org.apache.thrift.TException;

    public SendEmailResponse sendEmail(SendEmailRequest request) throws tech.aroma.thrift.exceptions.InvalidArgumentException, tech.aroma.thrift.exceptions.OperationFailedException, tech.aroma.thrift.exceptions.InvalidTokenException, org.apache.thrift.TException;

  }

  public interface AsyncIface {

    public void getApiVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void sendEmail(SendEmailRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

  }

  public static class Client extends org.apache.thrift.TServiceClient implements Iface {
    public static class Factory implements org.apache.thrift.TServiceClientFactory {
      public Factory() {}
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
        return new Client(prot);
      }
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
        return new Client(iprot, oprot);
      }
    }

    public Client(org.apache.thrift.protocol.TProtocol prot)
    {
      super(prot, prot);
    }

    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
      super(iprot, oprot);
    }

    public double getApiVersion() throws org.apache.thrift.TException
    {
      send_getApiVersion();
      return recv_getApiVersion();
    }

    public void send_getApiVersion() throws org.apache.thrift.TException
    {
      getApiVersion_args args = new getApiVersion_args();
      sendBase("getApiVersion", args);
    }

    public double recv_getApiVersion() throws org.apache.thrift.TException
    {
      getApiVersion_result result = new getApiVersion_result();
      receiveBase(result, "getApiVersion");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getApiVersion failed: unknown result");
    }

    public SendEmailResponse sendEmail(SendEmailRequest request) throws tech.aroma.thrift.exceptions.InvalidArgumentException, tech.aroma.thrift.exceptions.OperationFailedException, tech.aroma.thrift.exceptions.InvalidTokenException, org.apache.thrift.TException
    {
      send_sendEmail(request);
      return recv_sendEmail();
    }

    public void send_sendEmail(SendEmailRequest request) throws org.apache.thrift.TException
    {
      sendEmail_args args = new sendEmail_args();
      args.setRequest(request);
      sendBase("sendEmail", args);
    }

    public SendEmailResponse recv_sendEmail() throws tech.aroma.thrift.exceptions.InvalidArgumentException, tech.aroma.thrift.exceptions.OperationFailedException, tech.aroma.thrift.exceptions.InvalidTokenException, org.apache.thrift.TException
    {
      sendEmail_result result = new sendEmail_result();
      receiveBase(result, "sendEmail");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ex1 != null) {
        throw result.ex1;
      }
      if (result.ex2 != null) {
        throw result.ex2;
      }
      if (result.ex3 != null) {
        throw result.ex3;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "sendEmail failed: unknown result");
    }

  }
  public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory {
      private org.apache.thrift.async.TAsyncClientManager clientManager;
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
        this.clientManager = clientManager;
        this.protocolFactory = protocolFactory;
      }
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
        return new AsyncClient(protocolFactory, clientManager, transport);
      }
    }

    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
      super(protocolFactory, clientManager, transport);
    }

    public void getApiVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getApiVersion_call method_call = new getApiVersion_call(resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getApiVersion_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getApiVersion_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getApiVersion", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getApiVersion_args args = new getApiVersion_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public double getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getApiVersion();
      }
    }

    public void sendEmail(SendEmailRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      sendEmail_call method_call = new sendEmail_call(request, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class sendEmail_call extends org.apache.thrift.async.TAsyncMethodCall {
      private SendEmailRequest request;
      public sendEmail_call(SendEmailRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.request = request;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sendEmail", org.apache.thrift.protocol.TMessageType.CALL, 0));
        sendEmail_args args = new sendEmail_args();
        args.setRequest(request);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public SendEmailResponse getResult() throws tech.aroma.thrift.exceptions.InvalidArgumentException, tech.aroma.thrift.exceptions.OperationFailedException, tech.aroma.thrift.exceptions.InvalidTokenException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_sendEmail();
      }
    }

  }

  public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor {
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
    public Processor(I iface) {
      super(iface, getProcessMap(new HashMap>()));
    }

    protected Processor(I iface, Map> processMap) {
      super(iface, getProcessMap(processMap));
    }

    private static  Map> getProcessMap(Map> processMap) {
      processMap.put("getApiVersion", new getApiVersion());
      processMap.put("sendEmail", new sendEmail());
      return processMap;
    }

    public static class getApiVersion extends org.apache.thrift.ProcessFunction {
      public getApiVersion() {
        super("getApiVersion");
      }

      public getApiVersion_args getEmptyArgsInstance() {
        return new getApiVersion_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getApiVersion_result getResult(I iface, getApiVersion_args args) throws org.apache.thrift.TException {
        getApiVersion_result result = new getApiVersion_result();
        result.success = iface.getApiVersion();
        result.setSuccessIsSet(true);
        return result;
      }
    }

    public static class sendEmail extends org.apache.thrift.ProcessFunction {
      public sendEmail() {
        super("sendEmail");
      }

      public sendEmail_args getEmptyArgsInstance() {
        return new sendEmail_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public sendEmail_result getResult(I iface, sendEmail_args args) throws org.apache.thrift.TException {
        sendEmail_result result = new sendEmail_result();
        try {
          result.success = iface.sendEmail(args.request);
        } catch (tech.aroma.thrift.exceptions.InvalidArgumentException ex1) {
          result.ex1 = ex1;
        } catch (tech.aroma.thrift.exceptions.OperationFailedException ex2) {
          result.ex2 = ex2;
        } catch (tech.aroma.thrift.exceptions.InvalidTokenException ex3) {
          result.ex3 = ex3;
        }
        return result;
      }
    }

  }

  public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor {
    private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
    public AsyncProcessor(I iface) {
      super(iface, getProcessMap(new HashMap>()));
    }

    protected AsyncProcessor(I iface, Map> processMap) {
      super(iface, getProcessMap(processMap));
    }

    private static  Map> getProcessMap(Map> processMap) {
      processMap.put("getApiVersion", new getApiVersion());
      processMap.put("sendEmail", new sendEmail());
      return processMap;
    }

    public static class getApiVersion extends org.apache.thrift.AsyncProcessFunction {
      public getApiVersion() {
        super("getApiVersion");
      }

      public getApiVersion_args getEmptyArgsInstance() {
        return new getApiVersion_args();
      }

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(Double o) {
            getApiVersion_result result = new getApiVersion_result();
            result.success = o;
            result.setSuccessIsSet(true);
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            getApiVersion_result result = new getApiVersion_result();
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getApiVersion_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.getApiVersion(resultHandler);
      }
    }

    public static class sendEmail extends org.apache.thrift.AsyncProcessFunction {
      public sendEmail() {
        super("sendEmail");
      }

      public sendEmail_args getEmptyArgsInstance() {
        return new sendEmail_args();
      }

      public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback() { 
          public void onComplete(SendEmailResponse o) {
            sendEmail_result result = new sendEmail_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            sendEmail_result result = new sendEmail_result();
            if (e instanceof tech.aroma.thrift.exceptions.InvalidArgumentException) {
                        result.ex1 = (tech.aroma.thrift.exceptions.InvalidArgumentException) e;
                        result.setEx1IsSet(true);
                        msg = result;
            }
            else             if (e instanceof tech.aroma.thrift.exceptions.OperationFailedException) {
                        result.ex2 = (tech.aroma.thrift.exceptions.OperationFailedException) e;
                        result.setEx2IsSet(true);
                        msg = result;
            }
            else             if (e instanceof tech.aroma.thrift.exceptions.InvalidTokenException) {
                        result.ex3 = (tech.aroma.thrift.exceptions.InvalidTokenException) e;
                        result.setEx3IsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, sendEmail_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
        iface.sendEmail(args.request,resultHandler);
      }
    }

  }

  public static class getApiVersion_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getApiVersion_args");


    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getApiVersion_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getApiVersion_argsTupleSchemeFactory());
    }


    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;

      private static final Map byName = new HashMap();

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

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

      /**
       * 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;
      }
    }
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getApiVersion_args.class, metaDataMap);
    }

    public getApiVersion_args() {
    }

    /**
     * Performs a deep copy on other.
     */
    public getApiVersion_args(getApiVersion_args other) {
    }

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

    @Override
    public void clear() {
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      }
      throw new IllegalStateException();
    }

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

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

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      return list.hashCode();
    }

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

      int lastComparison = 0;

      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getApiVersion_argsStandardSchemeFactory implements SchemeFactory {
      public getApiVersion_argsStandardScheme getScheme() {
        return new getApiVersion_argsStandardScheme();
      }
    }

    private static class getApiVersion_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getApiVersion_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getApiVersion_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getApiVersion_argsTupleSchemeFactory implements SchemeFactory {
      public getApiVersion_argsTupleScheme getScheme() {
        return new getApiVersion_argsTupleScheme();
      }
    }

    private static class getApiVersion_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getApiVersion_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getApiVersion_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
      }
    }

  }

  public static class getApiVersion_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getApiVersion_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.DOUBLE, (short)0);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getApiVersion_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getApiVersion_resultTupleSchemeFactory());
    }

    public double success; // required

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

      private static final Map byName = new HashMap();

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * 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 byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getApiVersion_result.class, metaDataMap);
    }

    public getApiVersion_result() {
    }

    public getApiVersion_result(
      double success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public getApiVersion_result(getApiVersion_result other) {
      __isset_bitfield = other.__isset_bitfield;
      this.success = other.success;
    }

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

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0.0;
    }

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

    public getApiVersion_result setSuccess(double success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
    }

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

      }
    }

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

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(getApiVersion_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;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_success = true;
      list.add(present_success);
      if (present_success)
        list.add(success);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

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

      sb.append("success:");
      sb.append(this.success);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getApiVersion_resultStandardSchemeFactory implements SchemeFactory {
      public getApiVersion_resultStandardScheme getScheme() {
        return new getApiVersion_resultStandardScheme();
      }
    }

    private static class getApiVersion_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getApiVersion_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
                struct.success = iprot.readDouble();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getApiVersion_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.isSetSuccess()) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          oprot.writeDouble(struct.success);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getApiVersion_resultTupleSchemeFactory implements SchemeFactory {
      public getApiVersion_resultTupleScheme getScheme() {
        return new getApiVersion_resultTupleScheme();
      }
    }

    private static class getApiVersion_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getApiVersion_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetSuccess()) {
          oprot.writeDouble(struct.success);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getApiVersion_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = iprot.readDouble();
          struct.setSuccessIsSet(true);
        }
      }
    }

  }

  public static class sendEmail_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sendEmail_args");

    private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new sendEmail_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new sendEmail_argsTupleSchemeFactory());
    }

    public SendEmailRequest request; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      REQUEST((short)1, "request");

      private static final Map byName = new HashMap();

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // REQUEST
            return REQUEST;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SendEmailRequest.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sendEmail_args.class, metaDataMap);
    }

    public sendEmail_args() {
    }

    public sendEmail_args(
      SendEmailRequest request)
    {
      this();
      this.request = request;
    }

    /**
     * Performs a deep copy on other.
     */
    public sendEmail_args(sendEmail_args other) {
      if (other.isSetRequest()) {
        this.request = new SendEmailRequest(other.request);
      }
    }

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

    @Override
    public void clear() {
      this.request = null;
    }

    public SendEmailRequest getRequest() {
      return this.request;
    }

    public sendEmail_args setRequest(SendEmailRequest request) {
      this.request = request;
      return this;
    }

    public void unsetRequest() {
      this.request = null;
    }

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

    public void setRequestIsSet(boolean value) {
      if (!value) {
        this.request = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case REQUEST:
        if (value == null) {
          unsetRequest();
        } else {
          setRequest((SendEmailRequest)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case REQUEST:
        return getRequest();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case REQUEST:
        return isSetRequest();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_request = true && this.isSetRequest();
      boolean that_present_request = true && that.isSetRequest();
      if (this_present_request || that_present_request) {
        if (!(this_present_request && that_present_request))
          return false;
        if (!this.request.equals(that.request))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_request = true && (isSetRequest());
      list.add(present_request);
      if (present_request)
        list.add(request);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

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

      sb.append("request:");
      if (this.request == null) {
        sb.append("null");
      } else {
        sb.append(this.request);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (request != null) {
        request.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class sendEmail_argsStandardSchemeFactory implements SchemeFactory {
      public sendEmail_argsStandardScheme getScheme() {
        return new sendEmail_argsStandardScheme();
      }
    }

    private static class sendEmail_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, sendEmail_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.request = new SendEmailRequest();
                struct.request.read(iprot);
                struct.setRequestIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, sendEmail_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.request != null) {
          oprot.writeFieldBegin(REQUEST_FIELD_DESC);
          struct.request.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class sendEmail_argsTupleSchemeFactory implements SchemeFactory {
      public sendEmail_argsTupleScheme getScheme() {
        return new sendEmail_argsTupleScheme();
      }
    }

    private static class sendEmail_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, sendEmail_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetRequest()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetRequest()) {
          struct.request.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, sendEmail_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.request = new SendEmailRequest();
          struct.request.read(iprot);
          struct.setRequestIsSet(true);
        }
      }
    }

  }

  public static class sendEmail_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sendEmail_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField EX3_FIELD_DESC = new org.apache.thrift.protocol.TField("ex3", org.apache.thrift.protocol.TType.STRUCT, (short)3);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new sendEmail_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new sendEmail_resultTupleSchemeFactory());
    }

    public SendEmailResponse success; // required
    public tech.aroma.thrift.exceptions.InvalidArgumentException ex1; // required
    public tech.aroma.thrift.exceptions.OperationFailedException ex2; // required
    public tech.aroma.thrift.exceptions.InvalidTokenException ex3; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      EX1((short)1, "ex1"),
      EX2((short)2, "ex2"),
      EX3((short)3, "ex3");

      private static final Map byName = new HashMap();

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // EX1
            return EX1;
          case 2: // EX2
            return EX2;
          case 3: // EX3
            return EX3;
          default:
            return null;
        }
      }

      /**
       * 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SendEmailResponse.class)));
      tmpMap.put(_Fields.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT          , "InvalidArgumentException")));
      tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT          , "OperationFailedException")));
      tmpMap.put(_Fields.EX3, new org.apache.thrift.meta_data.FieldMetaData("ex3", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT          , "InvalidTokenException")));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sendEmail_result.class, metaDataMap);
    }

    public sendEmail_result() {
    }

    public sendEmail_result(
      SendEmailResponse success,
      tech.aroma.thrift.exceptions.InvalidArgumentException ex1,
      tech.aroma.thrift.exceptions.OperationFailedException ex2,
      tech.aroma.thrift.exceptions.InvalidTokenException ex3)
    {
      this();
      this.success = success;
      this.ex1 = ex1;
      this.ex2 = ex2;
      this.ex3 = ex3;
    }

    /**
     * Performs a deep copy on other.
     */
    public sendEmail_result(sendEmail_result other) {
      if (other.isSetSuccess()) {
        this.success = new SendEmailResponse(other.success);
      }
      if (other.isSetEx1()) {
        this.ex1 = other.ex1;
      }
      if (other.isSetEx2()) {
        this.ex2 = other.ex2;
      }
      if (other.isSetEx3()) {
        this.ex3 = other.ex3;
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.ex1 = null;
      this.ex2 = null;
      this.ex3 = null;
    }

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

    public sendEmail_result setSuccess(SendEmailResponse success) {
      this.success = success;
      return this;
    }

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

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

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

    public tech.aroma.thrift.exceptions.InvalidArgumentException getEx1() {
      return this.ex1;
    }

    public sendEmail_result setEx1(tech.aroma.thrift.exceptions.InvalidArgumentException ex1) {
      this.ex1 = ex1;
      return this;
    }

    public void unsetEx1() {
      this.ex1 = null;
    }

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

    public void setEx1IsSet(boolean value) {
      if (!value) {
        this.ex1 = null;
      }
    }

    public tech.aroma.thrift.exceptions.OperationFailedException getEx2() {
      return this.ex2;
    }

    public sendEmail_result setEx2(tech.aroma.thrift.exceptions.OperationFailedException ex2) {
      this.ex2 = ex2;
      return this;
    }

    public void unsetEx2() {
      this.ex2 = null;
    }

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

    public void setEx2IsSet(boolean value) {
      if (!value) {
        this.ex2 = null;
      }
    }

    public tech.aroma.thrift.exceptions.InvalidTokenException getEx3() {
      return this.ex3;
    }

    public sendEmail_result setEx3(tech.aroma.thrift.exceptions.InvalidTokenException ex3) {
      this.ex3 = ex3;
      return this;
    }

    public void unsetEx3() {
      this.ex3 = null;
    }

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

    public void setEx3IsSet(boolean value) {
      if (!value) {
        this.ex3 = null;
      }
    }

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

      case EX1:
        if (value == null) {
          unsetEx1();
        } else {
          setEx1((tech.aroma.thrift.exceptions.InvalidArgumentException)value);
        }
        break;

      case EX2:
        if (value == null) {
          unsetEx2();
        } else {
          setEx2((tech.aroma.thrift.exceptions.OperationFailedException)value);
        }
        break;

      case EX3:
        if (value == null) {
          unsetEx3();
        } else {
          setEx3((tech.aroma.thrift.exceptions.InvalidTokenException)value);
        }
        break;

      }
    }

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

      case EX1:
        return getEx1();

      case EX2:
        return getEx2();

      case EX3:
        return getEx3();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case EX1:
        return isSetEx1();
      case EX2:
        return isSetEx2();
      case EX3:
        return isSetEx3();
      }
      throw new IllegalStateException();
    }

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

    public boolean equals(sendEmail_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_ex1 = true && this.isSetEx1();
      boolean that_present_ex1 = true && that.isSetEx1();
      if (this_present_ex1 || that_present_ex1) {
        if (!(this_present_ex1 && that_present_ex1))
          return false;
        if (!this.ex1.equals(that.ex1))
          return false;
      }

      boolean this_present_ex2 = true && this.isSetEx2();
      boolean that_present_ex2 = true && that.isSetEx2();
      if (this_present_ex2 || that_present_ex2) {
        if (!(this_present_ex2 && that_present_ex2))
          return false;
        if (!this.ex2.equals(that.ex2))
          return false;
      }

      boolean this_present_ex3 = true && this.isSetEx3();
      boolean that_present_ex3 = true && that.isSetEx3();
      if (this_present_ex3 || that_present_ex3) {
        if (!(this_present_ex3 && that_present_ex3))
          return false;
        if (!this.ex3.equals(that.ex3))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_ex1 = true && (isSetEx1());
      list.add(present_ex1);
      if (present_ex1)
        list.add(ex1);

      boolean present_ex2 = true && (isSetEx2());
      list.add(present_ex2);
      if (present_ex2)
        list.add(ex2);

      boolean present_ex3 = true && (isSetEx3());
      list.add(present_ex3);
      if (present_ex3)
        list.add(ex3);

      return list.hashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEx1()).compareTo(other.isSetEx1());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx1()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex1, other.ex1);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEx2()).compareTo(other.isSetEx2());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx2()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex2, other.ex2);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetEx3()).compareTo(other.isSetEx3());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEx3()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex3, other.ex3);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("sendEmail_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("ex1:");
      if (this.ex1 == null) {
        sb.append("null");
      } else {
        sb.append(this.ex1);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex2:");
      if (this.ex2 == null) {
        sb.append("null");
      } else {
        sb.append(this.ex2);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ex3:");
      if (this.ex3 == null) {
        sb.append("null");
      } else {
        sb.append(this.ex3);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class sendEmail_resultStandardSchemeFactory implements SchemeFactory {
      public sendEmail_resultStandardScheme getScheme() {
        return new sendEmail_resultStandardScheme();
      }
    }

    private static class sendEmail_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, sendEmail_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new SendEmailResponse();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // EX1
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.ex1 = new tech.aroma.thrift.exceptions.InvalidArgumentException();
                struct.ex1.read(iprot);
                struct.setEx1IsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // EX2
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.ex2 = new tech.aroma.thrift.exceptions.OperationFailedException();
                struct.ex2.read(iprot);
                struct.setEx2IsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // EX3
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.ex3 = new tech.aroma.thrift.exceptions.InvalidTokenException();
                struct.ex3.read(iprot);
                struct.setEx3IsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, sendEmail_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.ex1 != null) {
          oprot.writeFieldBegin(EX1_FIELD_DESC);
          struct.ex1.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.ex2 != null) {
          oprot.writeFieldBegin(EX2_FIELD_DESC);
          struct.ex2.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.ex3 != null) {
          oprot.writeFieldBegin(EX3_FIELD_DESC);
          struct.ex3.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class sendEmail_resultTupleSchemeFactory implements SchemeFactory {
      public sendEmail_resultTupleScheme getScheme() {
        return new sendEmail_resultTupleScheme();
      }
    }

    private static class sendEmail_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, sendEmail_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetEx1()) {
          optionals.set(1);
        }
        if (struct.isSetEx2()) {
          optionals.set(2);
        }
        if (struct.isSetEx3()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetEx1()) {
          struct.ex1.write(oprot);
        }
        if (struct.isSetEx2()) {
          struct.ex2.write(oprot);
        }
        if (struct.isSetEx3()) {
          struct.ex3.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, sendEmail_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.success = new SendEmailResponse();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.ex1 = new tech.aroma.thrift.exceptions.InvalidArgumentException();
          struct.ex1.read(iprot);
          struct.setEx1IsSet(true);
        }
        if (incoming.get(2)) {
          struct.ex2 = new tech.aroma.thrift.exceptions.OperationFailedException();
          struct.ex2.read(iprot);
          struct.setEx2IsSet(true);
        }
        if (incoming.get(3)) {
          struct.ex3 = new tech.aroma.thrift.exceptions.InvalidTokenException();
          struct.ex3.read(iprot);
          struct.setEx3IsSet(true);
        }
      }
    }

  }

}